mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-06 06:20:55 -08:00
* lisp/emacs-lisp/bytecomp.el (byte-compile-lambda): Simplify.
Remove the add-lambda argument. All callers adapted.
This commit is contained in:
parent
b36fd07560
commit
c3c2e3b4d3
1 changed files with 5 additions and 7 deletions
|
|
@ -2841,7 +2841,7 @@ not to take responsibility for the actual compilation of the code."
|
||||||
;; Tell the caller that we didn't compile it yet.
|
;; Tell the caller that we didn't compile it yet.
|
||||||
nil)
|
nil)
|
||||||
|
|
||||||
(let* ((code (byte-compile-lambda (cons arglist body) t)))
|
(let ((code (byte-compile-lambda `(lambda ,arglist . ,body))))
|
||||||
(if this-one
|
(if this-one
|
||||||
;; A definition in b-c-initial-m-e should always take precedence
|
;; A definition in b-c-initial-m-e should always take precedence
|
||||||
;; during compilation, so don't let it be redefined. (Bug#8647)
|
;; during compilation, so don't let it be redefined. (Bug#8647)
|
||||||
|
|
@ -3069,14 +3069,12 @@ If FORM is a lambda or a macro, byte-compile it as a function."
|
||||||
byte-compile--known-dynamic-vars)
|
byte-compile--known-dynamic-vars)
|
||||||
", "))))
|
", "))))
|
||||||
|
|
||||||
(defun byte-compile-lambda (fun &optional add-lambda reserved-csts)
|
(defun byte-compile-lambda (fun &optional reserved-csts)
|
||||||
"Byte-compile a lambda-expression and return a valid function.
|
"Byte-compile a lambda-expression and return a valid function.
|
||||||
The value is usually a compiled function but may be the original
|
The value is usually a compiled function but may be the original
|
||||||
lambda-expression."
|
lambda-expression."
|
||||||
(if add-lambda
|
(unless (eq 'lambda (car-safe fun))
|
||||||
(setq fun (cons 'lambda fun))
|
(error "Not a lambda list: %S" fun))
|
||||||
(unless (eq 'lambda (car-safe fun))
|
|
||||||
(error "Not a lambda list: %S" fun)))
|
|
||||||
(byte-compile-check-lambda-list (nth 1 fun))
|
(byte-compile-check-lambda-list (nth 1 fun))
|
||||||
(let* ((arglist (nth 1 fun))
|
(let* ((arglist (nth 1 fun))
|
||||||
(bare-arglist (byte-run-strip-symbol-positions arglist)) ; for compile-defun.
|
(bare-arglist (byte-run-strip-symbol-positions arglist)) ; for compile-defun.
|
||||||
|
|
@ -4158,7 +4156,7 @@ This function is never called when `lexical-binding' is nil."
|
||||||
(docstring-exp (nth 3 form))
|
(docstring-exp (nth 3 form))
|
||||||
(body (nthcdr 4 form))
|
(body (nthcdr 4 form))
|
||||||
(fun
|
(fun
|
||||||
(byte-compile-lambda `(lambda ,vars . ,body) nil (length env))))
|
(byte-compile-lambda `(lambda ,vars . ,body) (length env))))
|
||||||
(cl-assert (or (> (length env) 0)
|
(cl-assert (or (> (length env) 0)
|
||||||
docstring-exp)) ;Otherwise, we don't need a closure.
|
docstring-exp)) ;Otherwise, we don't need a closure.
|
||||||
(cl-assert (byte-code-function-p fun))
|
(cl-assert (byte-code-function-p fun))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue