From: Alex Kost <alezost@gmail.com>
To: Marcin Borkowski <mbork@wmi.amu.edu.pl>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to debug strange value changes of a variable?
Date: Thu, 01 Jan 2015 17:00:22 +0300 [thread overview]
Message-ID: <8761cqwqh5.fsf@gmail.com> (raw)
In-Reply-To: <874msbnybl.fsf@mbork.pl> (Marcin Borkowski's message of "Thu, 01 Jan 2015 01:23:26 +0100")
Marcin Borkowski (2015-01-01 03:23 +0300) wrote:
> On 2014-12-31, at 22:09, Michael Heerdegen <michael_heerdegen@web.de> 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'
property:
(put '<your-var> 'permanent-local t)
See (info "(elisp) Creating Buffer-Local").
--
Alex
prev parent reply other threads:[~2015-01-01 14:00 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-12-31 1:03 How to debug strange value changes of a variable? Marcin Borkowski
2014-12-31 21:09 ` Michael Heerdegen
2015-01-01 0:23 ` Marcin Borkowski
2015-01-01 14:00 ` Alex Kost [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=8761cqwqh5.fsf@gmail.com \
--to=alezost@gmail.com \
--cc=help-gnu-emacs@gnu.org \
--cc=mbork@wmi.amu.edu.pl \
/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.