From: Lars Ingebrigtsen <larsi@gnus.org>
To: yary <not.com@gmail.com>
Cc: 15658@debbugs.gnu.org
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 [thread overview]
Message-ID: <87lev9fmia.fsf@gnus.org> (raw)
In-Reply-To: <CAG2CFAZfn2TH5KeSxoYvKyh71-49BB3Ho35YLp3XpQsRE=DXLQ@mail.gmail.com> (yary's message of "Sat, 19 Oct 2013 18:15:04 -0400")
yary <not.com@gmail.com> 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
next prev parent reply other threads:[~2022-05-10 15:14 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-19 22:15 bug#15658: 24.1; (wishlist) Easy way to make a file-local variable also permanent-local yary
2022-05-10 15:14 ` Lars Ingebrigtsen [this message]
2022-05-10 19:54 ` yary
2022-05-11 11:47 ` Lars Ingebrigtsen
2022-05-11 4:05 ` Phil Sainty
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87lev9fmia.fsf@gnus.org \
--to=larsi@gnus.org \
--cc=15658@debbugs.gnu.org \
--cc=not.com@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.