From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#21466: [PATCH] Avoid defining (temporarily) vars and functions Date: Tue, 11 May 2021 18:03:38 -0400 Message-ID: References: <87eeeestgu.fsf@gnus.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="35456"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) Cc: Lars Ingebrigtsen , 21466@debbugs.gnu.org To: Alan Mackenzie Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 12 00:04:12 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lgaU7-00094i-II for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 12 May 2021 00:04:11 +0200 Original-Received: from localhost ([::1]:39974 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lgaU5-0006lf-Ll for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 11 May 2021 18:04:09 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:55176) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lgaTy-0006lI-Q3 for bug-gnu-emacs@gnu.org; Tue, 11 May 2021 18:04:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:54400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lgaTy-00054U-Ig; Tue, 11 May 2021 18:04:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lgaTy-0001Oo-9Y; Tue, 11 May 2021 18:04:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org, bug-cc-mode@gnu.org Resent-Date: Tue, 11 May 2021 22:04:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21466 X-GNU-PR-Package: emacs,cc-mode X-GNU-PR-Keywords: patch Original-Received: via spool by 21466-submit@debbugs.gnu.org id=B21466.16207706335360 (code B ref 21466); Tue, 11 May 2021 22:04:02 +0000 Original-Received: (at 21466) by debbugs.gnu.org; 11 May 2021 22:03:53 +0000 Original-Received: from localhost ([127.0.0.1]:37713 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgaTo-0001OO-Pg for submit@debbugs.gnu.org; Tue, 11 May 2021 18:03:53 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:5792) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lgaTm-0001OB-Un for 21466@debbugs.gnu.org; Tue, 11 May 2021 18:03:51 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 534524414D6; Tue, 11 May 2021 18:03:45 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B00D44414D0; Tue, 11 May 2021 18:03:39 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1620770619; bh=/FPA5vlkS7B9LJVoTHDd3cZ7Wo5NMfqZzGN3Ht2KTSY=; h=From:To:Cc:Subject:References:Date:In-Reply-To:From; b=Dj4uKZdgIiRYrw0BZQ2CsDsBMJIpNxFZxbrWrxLK0JcRHG1zpPYwzoiMcBY/a5DLa 4D2YebMaHl3NUs1PQeeloYwqM/QmEGHJaEpukfQs/LA19NzArZFLIoKJPKe9hCc7xy uulpO6CyZjvWG1ikFUoGrVlyevuatfhv+hMwYVpnH8Lp9B6I+nfTTKaFIY8RoqrORJ I/NWwWb9PWfAsTf+NrkDjp72zIPXZox8eXaYR2PBUMd9fMHQH+wq6duGCnhTbs/Xdy GqxL8PCR5dt3GMC/MOidLwjjICFUayGb9Z/LC8lhub5sy+hglpY7rq1bmvj7xdCr9r c5BYdcFgCIEiQ== Original-Received: from alfajor (76-10-140-76.dsl.teksavvy.com [76.10.140.76]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 5C51912067C; Tue, 11 May 2021 18:03:39 -0400 (EDT) In-Reply-To: (Alan Mackenzie's message of "Tue, 11 May 2021 20:34:30 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:206299 Archived-At: > There are little things I'm unhappy about with the patch: it > explicitly tests (featurep 'xemacs), which is not done in CC Mode, > being regarded as somewhat vulgar. Instead specific functionalities > are always tested for. I use (featurep 'xemacs) because it results in cleaner byte-code because the compiler replaces it with nil. It also usually results in fewer spurious warnings (because of the removal of XEmacs-only code). [ I believe the same holds on XEmacs where (featurep 'xemacs) is optimized to t, which removes Emacs-only code. ] But that's just my favorite bikeshed color, it's not crucial for the patch. > Also, in place of cc-bytecomp-defun is proposed declare-function. > However this is in an inconsistent state, with the documentation > requiring a FILE argument, but Stefan's patch supplying nil. `declare-function` says: The FILE argument is not used by the byte-compiler, but by the `check-declare' package, which checks that FILE contains a definition for FN. So indeed, a real FILE argument would be preferable, but passing nil works fine (it will simply prevent `check-declare` from making sure that file indeed defines that function, which is no different than what we have now with `cc-bytecomp-defun` which `check-declare` also ignores). If you want the "better" option, then it will require changing `cc-bytecomp-defun` so it takes a FILE arg. Stefan