From unknown Wed Jun 18 23:11:21 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#11930 <11930@debbugs.gnu.org> To: bug#11930 <11930@debbugs.gnu.org> Subject: Status: 24.1.50; kill-all-local-variables ignores some non-permanent-local vars Reply-To: bug#11930 <11930@debbugs.gnu.org> Date: Thu, 19 Jun 2025 06:11:21 +0000 retitle 11930 24.1.50; kill-all-local-variables ignores some non-permanent-= local vars reassign 11930 emacs submitter 11930 Chong Yidong severity 11930 normal thanks From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 13 03:49:14 2012 Received: (at submit) by debbugs.gnu.org; 13 Jul 2012 07:49:14 +0000 Received: from localhost ([127.0.0.1]:38294 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Spacj-0004WA-SZ for submit@debbugs.gnu.org; Fri, 13 Jul 2012 03:49:14 -0400 Received: from eggs.gnu.org ([208.118.235.92]:48053) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Spaci-0004W4-H1 for submit@debbugs.gnu.org; Fri, 13 Jul 2012 03:49:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SpaXH-0001G8-0T for submit@debbugs.gnu.org; Fri, 13 Jul 2012 03:43:36 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD autolearn=unavailable version=3.3.2 Received: from lists.gnu.org ([208.118.235.17]:50537) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpaXG-0001G4-TW for submit@debbugs.gnu.org; Fri, 13 Jul 2012 03:43:34 -0400 Received: from eggs.gnu.org ([208.118.235.92]:58332) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpaXA-0000sM-Kt for bug-gnu-emacs@gnu.org; Fri, 13 Jul 2012 03:43:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SpaX4-0001Dz-VM for bug-gnu-emacs@gnu.org; Fri, 13 Jul 2012 03:43:28 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:54899) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SpaX4-0001Du-No for bug-gnu-emacs@gnu.org; Fri, 13 Jul 2012 03:43:22 -0400 Received: from [155.69.18.139] (port=40407 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SpaX3-0000q3-TL for bug-gnu-emacs@gnu.org; Fri, 13 Jul 2012 03:43:22 -0400 From: Chong Yidong To: bug-gnu-emacs@gnu.org Subject: 24.1.50; kill-all-local-variables ignores some non-permanent-local vars Date: Fri, 13 Jul 2012 15:43:16 +0800 Message-ID: <87vchsgl7v.fsf@gnu.org> MIME-Version: 1.0 Content-Type: text/plain X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 208.118.235.17 X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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.9 (------) The documentation of `kill-all-local-variables' says only that it does not reset variables marked as `permanent-local'. But it also seems to ignore certain per-buffer variables that lack the `permanent-local' property. One such variable is `buffer-read-only': emacs -Q M-: (setq buffer-read-only t) RET (or just C-x C-q) M-: (kill-all-local-variables) RET C-h v buffer-read-only RET buffer-read-only is a variable defined in `C source code'. Its value is t Local in buffer *scratch*; global value is nil M-: (get 'buffer-read-only 'permanent-local) => nil The `default-directory' variable also behaves this way. Other per-buffer variables, like `line-spacing', ARE reset by `kill-all-local-variables'. We should assign a non-nil `permanent-local' property to these variables. Even if the internal code doesn't need the property to work for these variables, it would be a useful signal for Lisp programmers. Off the top of my head, I'm guessing the affected variables are those listed in buffer.c:4961 (with a -1 index in buffer_local_flags). In GNU Emacs 24.1.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.4.2) of 2012-07-13 on ulysses Bzr revision: 109067 eggert@cs.ucla.edu-20120713035058-5m17bmslw6b9z0s2 From debbugs-submit-bounces@debbugs.gnu.org Fri Jul 13 10:32:17 2012 Received: (at 11930-done) by debbugs.gnu.org; 13 Jul 2012 14:32:17 +0000 Received: from localhost ([127.0.0.1]:39469 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Spgum-0008BN-Qi for submit@debbugs.gnu.org; Fri, 13 Jul 2012 10:32:17 -0400 Received: from fencepost.gnu.org ([208.118.235.10]:42580) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Spgui-0008BC-JS for 11930-done@debbugs.gnu.org; Fri, 13 Jul 2012 10:32:14 -0400 Received: from cm162.gamma80.maxonline.com.sg ([202.156.80.162]:57572 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SpgpF-00034p-LA for 11930-done@debbugs.gnu.org; Fri, 13 Jul 2012 10:26:34 -0400 From: Chong Yidong To: 11930-done@debbugs.gnu.org Subject: Re: bug#11930: 24.1.50; kill-all-local-variables ignores some non-permanent-local vars References: <87vchsgl7v.fsf@gnu.org> Date: Fri, 13 Jul 2012 22:26:27 +0800 In-Reply-To: <87vchsgl7v.fsf@gnu.org> (Chong Yidong's message of "Fri, 13 Jul 2012 15:43:16 +0800") Message-ID: <87r4sf3ffw.fsf@gnu.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.9 (------) X-Debbugs-Envelope-To: 11930-done X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 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.9 (------) > We should assign a non-nil `permanent-local' property to these > variables. Even if the internal code doesn't need the property to work > for these variables, it would be a useful signal for Lisp programmers. Done in r109073. From unknown Wed Jun 18 23:11:21 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sat, 11 Aug 2012 11:24:03 +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