[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to debug strange value changes of a variable?

From: Alex Kost
Subject: Re: How to debug strange value changes of a variable?
Date: Thu, 01 Jan 2015 17:00:22 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4 (gnu/linux)

Marcin Borkowski (2015-01-01 03:23 +0300) wrote:

> On 2014-12-31, at 22:09, Michael Heerdegen <> wrote:


>> Also note that changing a buffer's major mode removes all buffer local
>> bindings in the current buffer.  That could maybe happen in your case.
> Thank you, thank you, thank you, thank you so much!  I'd *never* think
> of that (I didn't even know that).  That was it!  The first time my
> function was called, the buffer was in fundamental mode; all subsequent
> times, it was in mu4e-compose-mode.  That should explain everything.
> Now the question is: what to do.  I could dive into mu4e sources (which
> I'm just a bit too lazy to do now).  I could just start
> mu4e-compose-mode myself in my function and see what happens (I'll try
> that).  Other than that, I don't have many ideas.


I didn't follow the thread but IIUC you want your variable to survive a
changing of a major-mode.  If so, you can do it using 'permanent-local'

  (put '<your-var> 'permanent-local t)

See (info "(elisp) Creating Buffer-Local").


reply via email to

[Prev in Thread] Current Thread [Next in Thread]