From: gareth.rees@pobox.com (Gareth Rees)
Subject: Re: values of buffer-local variables lost after dired-do-rename
Date: 28 Nov 2002 10:50:24 -0800 [thread overview]
Message-ID: <e867ce6d.0211281050.46435a42@posting.google.com> (raw)
In-Reply-To: m365uieza1.fsf@tfkp07.physik.uni-erlangen.de
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
prev parent reply other threads:[~2002-11-28 18:50 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2002-11-28 10:58 values of buffer-local variables lost after dired-do-rename Roland Winkler
2002-11-28 18:50 ` Gareth Rees [this message]
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=e867ce6d.0211281050.46435a42@posting.google.com \
--to=gareth.rees@pobox.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.