From unknown Sat Aug 16 23:43:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8647: since lexical merge, declare-function in subr.el no longer works 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: Tue, 10 May 2011 22:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 8647 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 8647@debbugs.gnu.org X-Debbugs-Original-To: submit@debbugs.gnu.org Received: via spool by submit@debbugs.gnu.org id=B.130506656814452 (code B ref -1); Tue, 10 May 2011 22:30:03 +0000 Received: (at submit) by debbugs.gnu.org; 10 May 2011 22:29:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJvQl-0003l3-Ul for submit@debbugs.gnu.org; Tue, 10 May 2011 18:29:28 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJvQk-0003ks-1Q for submit@debbugs.gnu.org; Tue, 10 May 2011 18:29:26 -0400 Received: from localhost ([127.0.0.1]:37307) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJvQe-000133-TW; Tue, 10 May 2011 18:29:20 -0400 From: Glenn Morris X-Spook: ASLET AMW BROMURE genetic csystems Taiwan eavesdropping X-Ran: D*%gnDkVp/|y>9Bfv8qOE(]+%?3]r57{k*4@Lh&Z.-2pa;"&LKh93AvCsE;+ 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-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 merge of the lexical branch, `declare-function' statements in subr.el no longer have the desired effect. Eg compiling subr.el warns: In end of data: subr.el:4015:1:Warning: the function `w32-shell-dos-semantics' is not known to be defined. despite the presence of (declare-function w32-shell-dos-semantics "w32-fns" nil) in the file. From unknown Sat Aug 16 23:43:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8647: since lexical merge, declare-function in subr.el no longer works In-Reply-To: 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 18:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8647 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 8647@debbugs.gnu.org Received: via spool by 8647-submit@debbugs.gnu.org id=B8647.130513757730095 (code B ref 8647); Wed, 11 May 2011 18:13:02 +0000 Received: (at 8647) by debbugs.gnu.org; 11 May 2011 18:12: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 1QKDu4-0007pM-MN for submit@debbugs.gnu.org; Wed, 11 May 2011 14:12:56 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKDu2-0007pB-Ox for 8647@debbugs.gnu.org; Wed, 11 May 2011 14:12:55 -0400 Received: from localhost ([127.0.0.1]:47097) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKDtx-0004o8-EU; Wed, 11 May 2011 14:12:49 -0400 From: Glenn Morris References: X-Spook: Janet Reno Jiang Zemin Ft. Bragg Ortega digicash target X-Ran: Ch)]9TJJFm47ZU`CaZ#zVYzUOt)jQ'a7T.*rXaPv[bwHn[vrc$,ND9Gt{g'>]El!;>y+{3 X-Hue: cyan X-Attribution: GM Date: Wed, 11 May 2011 14:12:48 -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-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 (------) Moving the definition to the end of subr.el does not work, because subr.el is loaded uncompiled during bootstrap. IMO, conceptually the right fix is for an element in byte-compile-initial-macro-environment to _always_ take precedence during compilation, even if the file being compiled contains a redefinition. *** lisp/emacs-lisp/bytecomp.el 2011-05-11 17:32:38 +0000 --- lisp/emacs-lisp/bytecomp.el 2011-05-11 17:57:12 +0000 *************** *** 2166,2172 **** byte-compile-output nil)))) (defun byte-compile-preprocess (form &optional _for-effect) ! (setq form (macroexpand-all form byte-compile-macro-environment)) ;; FIXME: We should run byte-optimize-form here, but it currently does not ;; recurse through all the code, so we'd have to fix this first. ;; Maybe a good fix would be to merge byte-optimize-form into --- 2174,2183 ---- byte-compile-output nil)))) (defun byte-compile-preprocess (form &optional _for-effect) ! ;; b-c-initial-m-e should take precedence during compilation. (Bug#8647) ! (setq form (macroexpand-all form ! (append byte-compile-initial-macro-environment ! byte-compile-macro-environment))) ;; FIXME: We should run byte-optimize-form here, but it currently does not ;; recurse through all the code, so we'd have to fix this first. ;; Maybe a good fix would be to merge byte-optimize-form into From unknown Sat Aug 16 23:43:14 2025 X-Loop: help-debbugs@gnu.org Subject: bug#8647: since lexical merge, declare-function in subr.el no longer works Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-To: owner@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 12 May 2011 01:03:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 8647 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: Glenn Morris Cc: 8647@debbugs.gnu.org Received: via spool by 8647-submit@debbugs.gnu.org id=B8647.13051621801785 (code B ref 8647); Thu, 12 May 2011 01:03:02 +0000 Received: (at 8647) by debbugs.gnu.org; 12 May 2011 01:03:00 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKKIt-0000Sj-Nd for submit@debbugs.gnu.org; Wed, 11 May 2011 21:02:59 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKKIr-0000SX-FI for 8647@debbugs.gnu.org; Wed, 11 May 2011 21:02:57 -0400 Received: from 213-159-126-200.fibertel.com.ar ([200.126.159.213]:41975 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1QKKIl-0005Xa-MT; Wed, 11 May 2011 21:02:52 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 9372B66152; Wed, 11 May 2011 22:02:49 -0300 (ART) From: Stefan Monnier Message-ID: References: Date: Wed, 11 May 2011 22:02:49 -0300 In-Reply-To: (Glenn Morris's message of "Wed, 11 May 2011 14:12:48 -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-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 (------) > IMO, conceptually the right fix is for an element in > byte-compile-initial-macro-environment to _always_ take precedence > during compilation, even if the file being compiled contains a > redefinition. Agreed. Another way to get that result is to change the place where we add elements to byte-compile-macro-environment (so as not to add it if it's in byte-compile-initial-macro-environment), but the one you showed seems fine. Feel free to install it. Stefan From unknown Sat Aug 16 23:43:14 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Glenn Morris Subject: bug#8647: closed (Re: bug#8647: since lexical merge, declare-function in subr.el no longer works) Message-ID: References: <00y62cprus.fsf@fencepost.gnu.org> X-Gnu-PR-Message: they-closed 8647 X-Gnu-PR-Package: emacs Reply-To: 8647@debbugs.gnu.org Date: Thu, 12 May 2011 02:37:01 +0000 Content-Type: multipart/mixed; boundary="----------=_1305167821-10028-1" This is a multi-part message in MIME format... ------------=_1305167821-10028-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #8647: since lexical merge, declare-function in subr.el no longer works which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 8647@debbugs.gnu.org. --=20 8647: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D8647 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1305167821-10028-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 8647-done) by debbugs.gnu.org; 12 May 2011 02:36:50 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKLli-0002bO-D0 for submit@debbugs.gnu.org; Wed, 11 May 2011 22:36:50 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QKLlg-0002bD-TD for 8647-done@debbugs.gnu.org; Wed, 11 May 2011 22:36:49 -0400 Received: from localhost ([127.0.0.1]:38724) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QKLlb-0001Oe-LV; Wed, 11 May 2011 22:36:43 -0400 From: Glenn Morris To: 8647-done@debbugs.gnu.org Subject: Re: bug#8647: since lexical merge, declare-function in subr.el no longer works References: X-Spook: UMTS terrorist radar INSCOM INS Verisign weapons of mass X-Ran: C"#ML4'%-:HmtS=^uyD,Fn$EI^b-u=ms\]6q)*V<-qIG^R`24>W'rk^I$[:kfEccFB4^YO X-Hue: blue X-Debbugs-No-Ack: yes X-Attribution: GM Date: Wed, 11 May 2011 22:36:43 -0400 Message-ID: <00y62cprus.fsf@fencepost.gnu.org> 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: 8647-done 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: > Another way to get that result is to change the place where we add > elements to byte-compile-macro-environment (so as not to add it if it's > in byte-compile-initial-macro-environment), I like that idea better. Done. ------------=_1305167821-10028-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 10 May 2011 22:29:28 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJvQl-0003l3-Ul for submit@debbugs.gnu.org; Tue, 10 May 2011 18:29:28 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1QJvQk-0003ks-1Q for submit@debbugs.gnu.org; Tue, 10 May 2011 18:29:26 -0400 Received: from localhost ([127.0.0.1]:37307) by fencepost.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QJvQe-000133-TW; Tue, 10 May 2011 18:29:20 -0400 From: Glenn Morris To: submit@debbugs.gnu.org Subject: since lexical merge, declare-function in subr.el no longer works X-Spook: ASLET AMW BROMURE genetic csystems Taiwan eavesdropping X-Ran: D*%gnDkVp/|y>9Bfv8qOE(]+%?3]r57{k*4@Lh&Z.-2pa;"&LKh93AvCsE;+ 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 merge of the lexical branch, `declare-function' statements in subr.el no longer have the desired effect. Eg compiling subr.el warns: In end of data: subr.el:4015:1:Warning: the function `w32-shell-dos-semantics' is not known to be defined. despite the presence of (declare-function w32-shell-dos-semantics "w32-fns" nil) in the file. ------------=_1305167821-10028-1--