From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Lars Ingebrigtsen Newsgroups: gmane.emacs.bugs Subject: bug#15658: 24.1; (wishlist) Easy way to make a file-local variable also permanent-local Date: Tue, 10 May 2022 17:14:21 +0200 Message-ID: <87lev9fmia.fsf@gnus.org> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6593"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) Cc: 15658@debbugs.gnu.org To: yary Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 10 17:15:43 2022 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 1noRaR-0001TC-Sj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 May 2022 17:15:43 +0200 Original-Received: from localhost ([::1]:44096 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1noRaQ-0006YI-H1 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 10 May 2022 11:15:42 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1noRZq-0006Wf-PG for bug-gnu-emacs@gnu.org; Tue, 10 May 2022 11:15:06 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40939) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1noRZm-0003Qh-Dq for bug-gnu-emacs@gnu.org; Tue, 10 May 2022 11:15:06 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1noRZm-0001Kc-3c for bug-gnu-emacs@gnu.org; Tue, 10 May 2022 11:15:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Lars Ingebrigtsen Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 10 May 2022 15:15:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15658 X-GNU-PR-Package: emacs Original-Received: via spool by 15658-submit@debbugs.gnu.org id=B15658.16521956765060 (code B ref 15658); Tue, 10 May 2022 15:15:02 +0000 Original-Received: (at 15658) by debbugs.gnu.org; 10 May 2022 15:14:36 +0000 Original-Received: from localhost ([127.0.0.1]:34833 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noRZL-0001JX-Gx for submit@debbugs.gnu.org; Tue, 10 May 2022 11:14:35 -0400 Original-Received: from quimby.gnus.org ([95.216.78.240]:56402) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1noRZJ-0001JE-2J for 15658@debbugs.gnu.org; Tue, 10 May 2022 11:14:33 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org; s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=xiNb8XKWfyBOlYBqZ2oOE+mrKrS64IJylH4dRUQpJKQ=; b=qzyiYNAyDTg9d9lbMMEKsPFunZ kaWAuSGkBNkjmn/f9gBCeUunotUhOdmhm84ARqwXPFf2cuSqfStTXEie8qMb04gGT/L2jwOR8/oHe cEUXonUQ9rLapt6HzAn3p5RVvsZENLjQn1pXC/MRbfDv3JIrMUJWvYIR3avBIBGO244w=; Original-Received: from [84.212.220.105] (helo=xo) by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1noRZA-00056J-1r; Tue, 10 May 2022 17:14:26 +0200 X-Now-Playing: Joni Mitchell's _Shadows And Light (1)_: "Hejira" In-Reply-To: (yary's message of "Sat, 19 Oct 2013 18:15:04 -0400") 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:231846 Archived-At: yary writes: > There are occasional needs to preserve buffer-local variables across > major-mode changes. In the specific case of directory-local variables, > an automated solution looks to be feasible, see "bug#15577: 24.3; > dir-local variables not applied when switching major-mode" > > File-local variables on the other hand are not as easy to categorize as > to their intent- for a particular mode, vs the file contents in general. > > I propose adding `permanent' as another special "variable name" (along > the lines of `mode', `eval', `coding', and `unibyte') to let people > mark the file variables they want to remain between mode changes. For > example: > > ; mode: Lisp > ; fill-column: 75 > ; comment-column: 50 > ; permanent: fill-column tab-width > > would set & keep fill-column at 75 between mode changes, and would > preserve between major-mode switches any changes to tab-width. (I'm going through old bug reports that unfortunately weren't resolved at the time.) With the following: ;; Local variables: ;; foo-var: t ;; end: foo-var is set whenever I change the major mode. Has the behaviour changed here since Emacs 24.1? (The earliest Emacs I have is Emacs 25.1.) -- (domestic pets only, the antidote for overdose, milk.) bloggy blog: http://lars.ingebrigtsen.no