From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.bugs Subject: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn Date: Wed, 11 May 2011 00:33:15 -0400 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1305088450 4906 80.91.229.12 (11 May 2011 04:34:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 May 2011 04:34:10 +0000 (UTC) To: 8646@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 11 06:34:06 2011 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QK17e-0005dr-C9 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 May 2011 06:34:06 +0200 Original-Received: from localhost ([::1]:60366 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK17d-0005d5-Us for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 May 2011 00:34:05 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:56994) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK17b-0005d0-LN for bug-gnu-emacs@gnu.org; Wed, 11 May 2011 00:34:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QK17a-0000z7-Nk for bug-gnu-emacs@gnu.org; Wed, 11 May 2011 00:34:03 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK17a-0000z3-L0 for bug-gnu-emacs@gnu.org; Wed, 11 May 2011 00:34:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QK17a-000493-4c; Wed, 11 May 2011 00:34:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 May 2011 04:34:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8646 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 8646-submit@debbugs.gnu.org id=B8646.130508840315889 (code B ref 8646); Wed, 11 May 2011 04:34:02 +0000 Original-Received: (at 8646) by debbugs.gnu.org; 11 May 2011 04:33:23 +0000 Original-Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK16x-00048E-D1 for submit@debbugs.gnu.org; Wed, 11 May 2011 00:33:23 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK16v-000481-Us for 8646@debbugs.gnu.org; Wed, 11 May 2011 00:33:22 -0400 Original-Received: from localhost ([127.0.0.1]:35236) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QK16p-0008Oc-M4; Wed, 11 May 2011 00:33:15 -0400 X-Spook: illuminati supercomputer oil passwd embassy Vince Foster X-Ran: 9s#Z9:*Nj%lseZje8i2@_6}D0+!NdItTiHdFA-A*xO3`(H:+=~;E#{"t:sBE`Gj}&)D{~j X-Hue: red X-Attribution: GM In-Reply-To: (Glenn Morris's message of "Tue, 10 May 2011 18:26:55 -0400") User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list Resent-Date: Wed, 11 May 2011 00:34:02 -0400 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:46381 Archived-At: 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))