unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#15658: 24.1; (wishlist) Easy way to make a file-local variable also permanent-local
@ 2013-10-19 22:15 yary
  2022-05-10 15:14 ` Lars Ingebrigtsen
  0 siblings, 1 reply; 5+ messages in thread
From: yary @ 2013-10-19 22:15 UTC (permalink / raw)
  To: 15658

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.

(There is one edge case with this proposal: what would `permanent: eval'
do? Re-evaluate all `eval' file variables after a mode change? And
`permanent: mode' would have to be ignored or give a warning.)


In GNU Emacs 24.1.1 (i386-mingw-nt5.1.2600)
 of 2012-06-10 on MARVIN
Windowing system distributor `Microsoft Corp.', version 5.1.2600
Configured using:
 `configure --with-gcc (4.6) --cflags
 -ID:/devel/emacs/libs/libXpm-3.5.8/include
 -ID:/devel/emacs/libs/libXpm-3.5.8/src
 -ID:/devel/emacs/libs/libpng-dev_1.4.3-1/include
 -ID:/devel/emacs/libs/zlib-dev_1.2.5-2/include
 -ID:/devel/emacs/libs/giflib-4.1.4-1/include
 -ID:/devel/emacs/libs/jpeg-6b-4/include
 -ID:/devel/emacs/libs/tiff-3.8.2-1/include
 -ID:/devel/emacs/libs/gnutls-3.0.9/include'

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: ENU
  value of $XMODIFIERS: nil
  locale-coding-system: cp1252
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t





^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-05-11 11:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2022-05-10 19:54   ` yary
2022-05-11 11:47     ` Lars Ingebrigtsen
2022-05-11  4:05   ` Phil Sainty

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).