all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Does erase-buffer reset buffer-local variables to nil?
@ 2013-02-27 22:35 Thorsten Jolitz
  2013-02-28  0:51 ` Thorsten Jolitz
  0 siblings, 1 reply; 2+ messages in thread
From: Thorsten Jolitz @ 2013-02-27 22:35 UTC (permalink / raw)
  To: help-gnu-emacs


Hi List, 

I face the problem that I set a buffer-local variable in one function,
and find its value to be nil later on in another function. In between,
'revert-buffer' is called with a revert-buffer-function that uses
erase-buffer.

I experimented a bit, and during the experiments it seemed that
'erase-buffer' doesn't modify buffer-local vars. But then I don't really
understand how its possible to set a variable (even print out its value
in a message call) in one function, but find its value to be nil again
later on without touching it explicitly in between.

Any hints would be welcome. 

-- 
cheers,
Thorsten





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

* Re: Does erase-buffer reset buffer-local variables to nil?
  2013-02-27 22:35 Does erase-buffer reset buffer-local variables to nil? Thorsten Jolitz
@ 2013-02-28  0:51 ` Thorsten Jolitz
  0 siblings, 0 replies; 2+ messages in thread
From: Thorsten Jolitz @ 2013-02-28  0:51 UTC (permalink / raw)
  To: help-gnu-emacs

Thorsten Jolitz <tjolitz@gmail.com> writes:

> I face the problem that I set a buffer-local variable in one function,
> and find its value to be nil later on in another function. In between,
> 'revert-buffer' is called with a revert-buffer-function that uses
> erase-buffer.

Following up to my own post: 

I figured out that its not 'erase-buffer' that is the culprit, but a
temporary change of major-mode, because by convention:

,-------------------------------------------------------------------------
| The major mode command should start by calling kill-all-local-variables...
`-------------------------------------------------------------------------

-- 
cheers,
Thorsten




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

end of thread, other threads:[~2013-02-28  0:51 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-02-27 22:35 Does erase-buffer reset buffer-local variables to nil? Thorsten Jolitz
2013-02-28  0:51 ` Thorsten Jolitz

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.