GNU bug report logs - #8646
byte-compile-initial-macro-environment confuses byte-compile-arglist-warn

Previous Next

Package: emacs;

Reported by: Glenn Morris <rgm <at> gnu.org>

Date: Tue, 10 May 2011 22:28:02 UTC

Severity: minor

Found in version 24.0.50

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Glenn Morris <rgm <at> gnu.org>
To: 8646 <at> debbugs.gnu.org
Subject: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn
Date: Wed, 11 May 2011 00:33:15 -0400
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)))
  	(progn
  	  (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)))
  	(progn
  	  (and (eq 'macro (car-safe old))





This bug report was last modified 14 years and 21 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.