Commit 2546bcdd authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(byte-compile-file-form-custom-declare-variable): Simplify.

parent d1a3873f
2007-11-22 Stefan Monnier <>
* emacs-lisp/bytecomp.el
(byte-compile-file-form-custom-declare-variable): Simplify.
2007-11-22 Juanma Barranquero <> 2007-11-22 Juanma Barranquero <>
* cus-edit.el (custom-mode): Define with `define-derived-mode'. * cus-edit.el (custom-mode): Define with `define-derived-mode'.
...@@ -2277,18 +2277,17 @@ list that represents a doc string reference. ...@@ -2277,18 +2277,17 @@ list that represents a doc string reference.
(byte-compile-nogroup-warn form)) (byte-compile-nogroup-warn form))
(when (byte-compile-warning-enabled-p 'free-vars) (when (byte-compile-warning-enabled-p 'free-vars)
(push (nth 1 (nth 1 form)) byte-compile-bound-variables)) (push (nth 1 (nth 1 form)) byte-compile-bound-variables))
;; Don't compile the expression because it may be displayed to the user.
;; (when (eq (car-safe (nth 2 form)) 'quote)
;; ;; (nth 2 form) is meant to evaluate to an expression, so if we have the
;; ;; final value already, we can byte-compile it.
;; (setcar (cdr (nth 2 form))
;; (byte-compile-top-level (cadr (nth 2 form)) nil 'file)))
(let ((tail (nthcdr 4 form))) (let ((tail (nthcdr 4 form)))
(while tail (while tail
;; If there are any (function (lambda ...)) expressions, compile (unless (keywordp (car tail)) ;No point optimizing keywords.
;; those functions. ;; Compile the keyword arguments.
(if (and (consp (car tail)) (setcar tail (byte-compile-top-level (car tail) nil 'file)))
(eq (car (car tail)) 'function)
(consp (nth 1 (car tail))))
(setcar tail (byte-compile-lambda (nth 1 (car tail))))
;; Likewise for a bare lambda.
(if (and (consp (car tail))
(eq (car (car tail)) 'lambda))
(setcar tail (byte-compile-lambda (car tail)))))
(setq tail (cdr tail)))) (setq tail (cdr tail))))
form) form)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment