From unknown Fri Aug 15 03:57:17 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#8647 <8647@debbugs.gnu.org> To: bug#8647 <8647@debbugs.gnu.org> Subject: Status: since lexical merge, declare-function in subr.el no longer works Reply-To: bug#8647 <8647@debbugs.gnu.org> Date: Fri, 15 Aug 2025 10:57:17 +0000 retitle 8647 since lexical merge, declare-function in subr.el no longer wor= ks reassign 8647 emacs submitter 8647 Glenn Morris severity 8647 minor thanks From debbugs-submit-bounces@debbugs.gnu.org Tue May 10 18:29:28 2011 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. From debbugs-submit-bounces@debbugs.gnu.org Wed May 11 14:12:56 2011 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 To: 8647@debbugs.gnu.org Subject: Re: bug#8647: since lexical merge, declare-function in subr.el no longer works 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-Debbugs-No-Ack: yes 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-Debbugs-Envelope-To: 8647 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 debbugs-submit-bounces@debbugs.gnu.org Wed May 11 21:03:00 2011 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 To: Glenn Morris Subject: Re: bug#8647: since lexical merge, declare-function in subr.el no longer works 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-Debbugs-Envelope-To: 8647 Cc: 8647@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 (------) > 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 debbugs-submit-bounces@debbugs.gnu.org Wed May 11 22:36:50 2011 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. From unknown Fri Aug 15 03:57:17 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Thu, 09 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