From debbugs-submit-bounces@debbugs.gnu.org Tue May 10 18:27:02 2011 Received: (at submit) by debbugs.gnu.org; 10 May 2011 22:27:02 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJvOQ-0003hB-Cu for submit@debbugs.gnu.org; Tue, 10 May 2011 18:27:02 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJvOP-0003gt-6c for submit@debbugs.gnu.org; Tue, 10 May 2011 18:27:01 -0400 Received: from localhost ([127.0.0.1]:41108) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJvOJ-0000zL-SM; Tue, 10 May 2011 18:26:56 -0400 From: Glenn Morris To: submit@debbugs.gnu.org Subject: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn X-Spook: halcon CISU ARPA Steve Case MD4 industrial intelligence X-Ran: MJNA+ugPztF,U\b>m3:qU5?&TVaoNCVAJa)*={&vzU0trnznc+&KT!I4E$/32J3Sjcr5V" X-Hue: yellow X-Debbugs-No-Ack: yes X-Attribution: GM Date: Tue, 10 May 2011 18:26:55 -0400 Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) Package: emacs Version: 24.0.50 Severity: minor Since the lexical merge, compiling subr.el warns: In declare-function: subr.el:39:11:Warning: macro declare-function used to take 0+ arguments, now takes 2-4 This is caused by the element in byte-compile-initial-macro-environment: (declare-function . byte-compile-macroexpand-declare-function) This confuses byte-compile-arglist-warn, because (byte-compile-fdefinition 'declare-function t) returns `byte-compile-macroexpand-declare-function', which leads to a (bogus) arglist signature of 0+. From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 00:33:23 2011 Received: (at 8646) by debbugs.gnu.org; 11 May 2011 04:33:23 +0000 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 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 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 From: Glenn Morris To: 8646@debbugs.gnu.org Subject: Re: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn References: 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-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 11 May 2011 00:33:15 -0400 In-Reply-To: (Glenn Morris's message of "Tue, 10 May 2011 18:26:55 -0400") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 8646 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) 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)) From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 09:54:15 2011 Received: (at 8646) by debbugs.gnu.org; 11 May 2011 13:54:15 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK9ri-0000sK-U3 for submit@debbugs.gnu.org; Wed, 11 May 2011 09:54:15 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QK9rg-0000s8-ES for 8646@debbugs.gnu.org; Wed, 11 May 2011 09:54:13 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:47262 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QK9ra-0001ZK-LR; Wed, 11 May 2011 09:54:06 -0400 Received: by ceviche.home (Postfix, from userid 20848) id E7AD766152; Wed, 11 May 2011 10:54:02 -0300 (ART) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn Message-ID: References: Date: Wed, 11 May 2011 10:54:02 -0300 In-Reply-To: (Glenn Morris's message of "Wed, 11 May 2011 00:33:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8646 Cc: 8646@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) > Here's a patch that I think might be right in general, but still leaves > a warning in this specific case: The patch looks right, thanks. The "2+" vs "2-4" can be fixed by changing either the macro definition of its override so that their arglist matches. > 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. (?) The intention of byte-compile-initial-macro-environment is to override "the" actual macro definition. Obviously, this presumes that the macro is not redefined elsewhere in a different way, otherwise the intended behavior is not defined. Stefan From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 13:39:23 2011 Received: (at 8646) by debbugs.gnu.org; 11 May 2011 17:39:23 +0000 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 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 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 From: Glenn Morris To: Stefan Monnier Subject: Re: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn References: 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-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 11 May 2011 13:39:15 -0400 In-Reply-To: (Stefan Monnier's message of "Wed, 11 May 2011 10:54:02 -0300") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: 8646 Cc: 8646@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) 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" From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 21:00:14 2011 Received: (at 8646) by debbugs.gnu.org; 12 May 2011 01:00:14 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKKGD-0000Ov-SK for submit@debbugs.gnu.org; Wed, 11 May 2011 21:00:14 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKKGD-0000Ol-63 for 8646@debbugs.gnu.org; Wed, 11 May 2011 21:00:13 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:45621 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QKKG7-0005Nb-4D; Wed, 11 May 2011 21:00:07 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 4767966152; Wed, 11 May 2011 22:00:03 -0300 (ART) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn Message-ID: References: Date: Wed, 11 May 2011 22:00:03 -0300 In-Reply-To: (Glenn Morris's message of "Wed, 11 May 2011 13:39:15 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8646 Cc: 8646@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) >> 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. It makes some sense, indeed. But I'm not thrilled about this solution. I'd rather change the defmacro to match the override. Stefan From debbugs-submit-bounces@debbugs.gnu.org Thu May 19 15:06:43 2011 Received: (at 8646) by debbugs.gnu.org; 19 May 2011 19:06:43 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QN8YU-0006mX-T6 for submit@debbugs.gnu.org; Thu, 19 May 2011 15:06:43 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QN8YT-0006mN-GG for 8646@debbugs.gnu.org; Thu, 19 May 2011 15:06:42 -0400 Received: from localhost ([127.0.0.1]:40743) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QN8YO-0002iZ-0T; Thu, 19 May 2011 15:06:36 -0400 From: Glenn Morris To: Stefan Monnier Subject: Re: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn References: X-Spook: security JUWTF Guantanamo brigand AMW David John Oates X-Ran: ~%C(w|?`\`8]En7Cvjs<-aa#uG""T;h!'y_gP9jO!nzIa;C+)C (Stefan Monnier's message of "Wed, 11 May 2011 22:00:03 -0300") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -4.8 (----) X-Debbugs-Envelope-To: 8646 Cc: 8646@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -4.8 (----) Stefan Monnier wrote: > It makes some sense, indeed. But I'm not thrilled about this solution. > I'd rather change the defmacro to match the override. I think I'd rather put up with the warning. From debbugs-submit-bounces@debbugs.gnu.org Thu May 19 22:19:08 2011 Received: (at 8646) by debbugs.gnu.org; 20 May 2011 02:19:08 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNFIx-0000wF-Pk for submit@debbugs.gnu.org; Thu, 19 May 2011 22:19:07 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QNFIv-0000vh-R2 for 8646@debbugs.gnu.org; Thu, 19 May 2011 22:19:06 -0400 Received: from 121-249-126-200.fibertel.com.ar ([200.126.249.121]:2636 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QNFIq-0004Q7-FF; Thu, 19 May 2011 22:19:00 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 710B866230; Thu, 19 May 2011 23:18:58 -0300 (ART) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#8646: byte-compile-initial-macro-environment confuses byte-compile-arglist-warn Message-ID: References: Date: Thu, 19 May 2011 23:18:58 -0300 In-Reply-To: (Glenn Morris's message of "Thu, 19 May 2011 15:06:35 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 8646 Cc: 8646@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) >> It makes some sense, indeed. But I'm not thrilled about this solution. >> I'd rather change the defmacro to match the override. > I think I'd rather put up with the warning. Good idea, Stefan From debbugs-submit-bounces@debbugs.gnu.org Mon May 23 20:45:57 2011 Received: (at control) by debbugs.gnu.org; 24 May 2011 00:45:57 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QOfky-0001Ak-NG for submit@debbugs.gnu.org; Mon, 23 May 2011 20:45:56 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QOfkw-0001AT-7T for control@debbugs.gnu.org; Mon, 23 May 2011 20:45:55 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1QOfkq-0004Jl-Je for control@debbugs.gnu.org; Mon, 23 May 2011 20:45:48 -0400 Date: Mon, 23 May 2011 20:45:48 -0400 Message-Id: Subject: control message for bug 8646 To: X-Mailer: mail (GNU Mailutils 2.1) From: Glenn Morris X-Spam-Score: -6.3 (------) X-Debbugs-Envelope-To: control X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.3 (------) close 8646 From unknown Sat Aug 16 13:40:23 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 21 Jun 2011 11:24:04 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator