* values of buffer-local variables lost after dired-do-rename
@ 2002-11-28 10:58 Roland Winkler
2002-11-28 18:50 ` Gareth Rees
0 siblings, 1 reply; 2+ messages in thread
From: Roland Winkler @ 2002-11-28 10:58 UTC (permalink / raw)
The following appears strange to me:
Suppose I've visited a file in emacs, then I rename that file by
means of dired-do-rename. Afterwards all the values of buffer-local
variables are replaced by the corresponding global values. Why don't
they keep their buffer-local values (at least for file-local
variables)??
Is there a simple way for re-evaluating the values of file-local
variables without reloading the file? (After reloading I loose, for
example, the buffer-undo-list.)
Roland
PS/ I am using GNU Emacs 21.2.1 (i386-pc-linux-gnu, X toolkit, Xaw3d
scroll bars)
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: values of buffer-local variables lost after dired-do-rename
2002-11-28 10:58 values of buffer-local variables lost after dired-do-rename Roland Winkler
@ 2002-11-28 18:50 ` Gareth Rees
0 siblings, 0 replies; 2+ messages in thread
From: Gareth Rees @ 2002-11-28 18:50 UTC (permalink / raw)
Roland Winkler <Roland.Winkler@physik.uni-erlangen.de> wrote:
> Suppose I've visited a file in emacs, then I rename that file by means
> of dired-do-rename. Afterwards all the values of buffer-local
> variables are replaced by the corresponding global values. Why don't
> they keep their buffer-local values (at least for file-local
> variables)?
Because when you change the file name Emacs changes the major mode to
match the the new file name. And changing the major mode kills all the
local variables.
You can stop Emacs changing the major mode when the file name changes by
setting `change-major-mode-with-file-name' to nil.
Or if you have a particular local variable that you want to preserve,
you can give it the `permanent-local' property so that
`kill-all-local-variables'' will ignore it, for example:
(put 'fill-column 'permanent-local t)
--
Gareth Rees
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2002-11-28 18:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2002-11-28 10:58 values of buffer-local variables lost after dired-do-rename Roland Winkler
2002-11-28 18:50 ` Gareth Rees
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.