[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#8646: byte-compile-initial-macro-environment confuses byte-compile-a

From: Glenn Morris
Subject: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn
Date: Wed, 11 May 2011 00:33:15 -0400
User-agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/)

Here's a patch that I think might be right in general, but still leaves
a warning in this specific case:

In declare-function:
subr.el:39:11:Warning: macro declare-function used to take 2+ arguments,
  now takes 2-4

Strictly speaking, that warning is correct.

Actually, I guess this patch is not fully correct, because something
that is in byte-compile-initial-macro-environment could be redefined
more than once, in theory. But it's better than the current version. (?)

*** lisp/emacs-lisp/bytecomp.el 2011-05-07 04:03:49 +0000
--- lisp/emacs-lisp/bytecomp.el 2011-05-11 04:22:58 +0000
*** 1314,1320 ****
  ;; number of arguments.
  (defun byte-compile-arglist-warn (form macrop)
    (let* ((name (nth 1 form))
!          (old (byte-compile-fdefinition name macrop)))
      (if (and old (not (eq old t)))
          (and (eq 'macro (car-safe old))
--- 1314,1327 ----
  ;; number of arguments.
  (defun byte-compile-arglist-warn (form macrop)
    (let* ((name (nth 1 form))
!          (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.
!     (and initial (symbolp initial)
!          (setq old (byte-compile-fdefinition initial nil)))
      (if (and old (not (eq old t)))
          (and (eq 'macro (car-safe old))

reply via email to

[Prev in Thread] Current Thread [Next in Thread]