diff options
Diffstat (limited to 'lisp/emacs-lisp/bytecomp.el')
-rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 6ca8eed8ac6..e7f2115a848 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el @@ -1314,7 +1314,14 @@ extra args." ;; number of arguments. (defun byte-compile-arglist-warn (form macrop) (let* ((name (nth 1 form)) - (old (byte-compile-fdefinition name macrop))) + (old (byte-compile-fdefinition name macrop)) + (initial (and macrop + (cdr (assq name + byte-compile-initial-macro-environment))))) + ;; Assumes an element of b-c-i-macro-env that is a symbol points + ;; to a defined function. (Bug#8646) + (and initial (symbolp initial) + (setq old (byte-compile-fdefinition initial nil))) (if (and old (not (eq old t))) (progn (and (eq 'macro (car-safe old)) @@ -2414,7 +2421,11 @@ by side-effects." (let* ((code (byte-compile-lambda (nthcdr 2 form) t))) (if this-one - (setcdr this-one code) + ;; A definition in b-c-initial-m-e should always take precedence + ;; during compilation, so don't let it be redefined. (Bug#8647) + (or (and macrop + (assq name byte-compile-initial-macro-environment)) + (setcdr this-one code)) (set this-kind (cons (cons name code) (symbol-value this-kind)))) |