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 13:39: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 1305135616 19043 80.91.229.12 (11 May 2011 17:40:16 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 May 2011 17:40:16 +0000 (UTC) Cc: 8646@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed May 11 19:40:11 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 1QKDOK-0003xN-J5 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 May 2011 19:40:08 +0200 Original-Received: from localhost ([::1]:44118 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKDOK-00045D-2M for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 May 2011 13:40:08 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:40747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKDOH-00043p-9G for bug-gnu-emacs@gnu.org; Wed, 11 May 2011 13:40:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QKDOG-0001wn-8I for bug-gnu-emacs@gnu.org; Wed, 11 May 2011 13:40:05 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:46960) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKDOG-0001wL-3d for bug-gnu-emacs@gnu.org; Wed, 11 May 2011 13:40:04 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.69) (envelope-from ) id 1QKDOF-00073H-6D; Wed, 11 May 2011 13:40:03 -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 17:40:03 +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.130513556327054 (code B ref 8646); Wed, 11 May 2011 17:40:03 +0000 Original-Received: (at 8646) by debbugs.gnu.org; 11 May 2011 17:39: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 1QKDNb-00072I-44 for submit@debbugs.gnu.org; Wed, 11 May 2011 13:39:23 -0400 Original-Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKDNZ-000727-Vo for 8646@debbugs.gnu.org; Wed, 11 May 2011 13:39:22 -0400 Original-Received: from localhost ([127.0.0.1]:52714) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKDNT-0002qZ-Ra; Wed, 11 May 2011 13:39:15 -0400 X-Spook: USCOI Serbian bce Albania bemd FTS2000 chameleon man X-Ran: NJ3!%5DmX0Nh|?$pA/LxNR(3g|5(UC)~_yt5|8cxxR]@ X-Hue: red X-Attribution: GM In-Reply-To: (Stefan Monnier's message of "Wed, 11 May 2011 10:54:02 -0300") 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 13:40:03 -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:46392 Archived-At: Stefan Monnier wrote: > The "2+" vs "2-4" can be fixed by changing either the macro definition > of its override so that their arglist matches. No, really? ;) I don't see how to change the override definition to not use &rest, since it is a function that needs to distinguish "no argument" from "argument nil". And changing the macro to match the override seems like putting the cart before the horse. How about the following, based on the idea that it is the override that should be congruent with the real macro definition, even though the former gets defined first? It's the reason that byte-compile-macroexpand-declare-function can work. *** lisp/emacs-lisp/bytecomp.el 2011-05-11 17:32:38 +0000 --- lisp/emacs-lisp/bytecomp.el 2011-05-11 17:35:51 +0000 *************** *** 1321,1327 **** ;; 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)) --- 1321,1328 ---- ;; 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) ! initial 'yes)) (if (and old (not (eq old t))) (progn (and (eq 'macro (car-safe old)) *************** *** 1334,1340 **** ((pred byte-code-function-p) (aref old 0)) (t '(&rest def))))) (sig2 (byte-compile-arglist-signature (nth 2 form)))) ! (unless (byte-compile-arglist-signatures-congruent-p sig1 sig2) (byte-compile-set-symbol-position name) (byte-compile-warn "%s %s used to take %s %s, now takes %s" --- 1335,1345 ---- ((pred byte-code-function-p) (aref old 0)) (t '(&rest def))))) (sig2 (byte-compile-arglist-signature (nth 2 form)))) ! ;; If something is on b-c-initial-m-e, *that* should be congruent ! ;; with the normal (new) definition, not vice versa. ! (unless (if (eq initial 'yes) ! (byte-compile-arglist-signatures-congruent-p sig2 sig1) ! (byte-compile-arglist-signatures-congruent-p sig1 sig2)) (byte-compile-set-symbol-position name) (byte-compile-warn "%s %s used to take %s %s, now takes %s"