From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
To: rms@gnu.org
Cc: emacs-devel@gnu.org
Subject: Re: Feature request: permanent-local values in hooks buffer local values
Date: Wed, 05 Dec 2007 08:21:42 +0100 [thread overview]
Message-ID: <47565186.8080909@gmail.com> (raw)
In-Reply-To: <E1IznNi-0000Rk-Se@fencepost.gnu.org>
Richard Stallman wrote:
> > Isn't change-major-mode-hook sufficient to take care of this need?
>
> Perhaps you meant after-change-major-mode-hook?
>
> Isn't this about cleaning up something after you exit a major mode?
> `change-major-mode-hook' is the feature for that.
In a way, yes. But remember the goal. It is to let a minor mode that is
turned on in the buffer survive changing major mode.
There are two kind of things to survive:
1) buffer local variable values, which are survived by using (put
'VARIABLE 'permanent-local t)
2) buffer local entries in hooks. Those are what I am asking about here.
We have now mentioned three ways of achieving 2:
a) my original proposition in this thread
b) my (mis)interpretetion of your previous answer, where I suggested
using a global entry in after-change-major-mode-hook
c) your suggestion to use change-major-mode-hook.
Using change-major-mode-hook would require something like this AFAICS:
- The minor mode that want to survive puts a function in the buffer
local value of change-major-mode-hook.
- This function when called puts another function in the global value of
after-change-major-mode-hook. This function should then restore the
buffer local entries for the minor mode in the hooks. After this the
function removes itself from the global value of
after-change-major-mode-hook.
Is this the solution you would like?
next prev parent reply other threads:[~2007-12-05 7:21 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-03 17:15 Feature request: permanent-local values in hooks buffer local values Lennart Borgman (gmail)
2007-12-03 18:22 ` Juanma Barranquero
2007-12-04 4:56 ` Richard Stallman
2007-12-04 18:13 ` Lennart Borgman (gmail)
2007-12-05 6:05 ` Richard Stallman
2007-12-05 7:21 ` Lennart Borgman (gmail) [this message]
2007-12-06 2:11 ` Richard Stallman
2007-12-07 0:25 ` Lennart Borgman (gmail)
2007-12-09 12:36 ` Richard Stallman
2007-12-09 14:21 ` Lennart Borgman (gmail)
2007-12-09 15:24 ` Lennart Borgman (gmail)
2007-12-09 23:19 ` Richard Stallman
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=47565186.8080909@gmail.com \
--to=lennart.borgman@gmail.com \
--cc=emacs-devel@gnu.org \
--cc=rms@gnu.org \
/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.