From unknown Sun Jun 22 11:48:55 2025 X-Loop: help-debbugs@gnu.org Subject: bug#11930: 24.1.50; kill-all-local-variables ignores some non-permanent-local vars Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 13 Jul 2012 07:50:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 11930 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 11930@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.134216575417373 (code B ref -1); Fri, 13 Jul 2012 07:50:01 +0000 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 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-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 unknown Sun Jun 22 11:48:55 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.428 (Entity 5.428) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Chong Yidong Subject: bug#11930: closed (Re: bug#11930: 24.1.50; kill-all-local-variables ignores some non-permanent-local vars) Message-ID: References: <87r4sf3ffw.fsf@gnu.org> <87vchsgl7v.fsf@gnu.org> X-Gnu-PR-Message: they-closed 11930 X-Gnu-PR-Package: emacs Reply-To: 11930@debbugs.gnu.org Date: Fri, 13 Jul 2012 14:33:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1342189982-31517-1" This is a multi-part message in MIME format... ------------=_1342189982-31517-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #11930: 24.1.50; kill-all-local-variables ignores some non-permanent-local = vars 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 11930@debbugs.gnu.org. --=20 11930: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D11930 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1342189982-31517-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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. ------------=_1342189982-31517-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit 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 ------------=_1342189982-31517-1--