all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Minor mode hook run when mode is deactivated?
@ 2020-10-07 23:15 Joost Kremers
  2020-10-07 23:45 ` Stefan Monnier
  0 siblings, 1 reply; 5+ messages in thread
From: Joost Kremers @ 2020-10-07 23:15 UTC (permalink / raw)
  To: help-gnu-emacs

Hi,

I recently ran into a problem that was apparently caused by a 
minor mode hook being run when the mode is deactivated. 
Counter-intuitive as that may be (to me, at least), a quick look 
at the code for `define-minor-mode` seems to suggest that it's in 
fact correct.

Is there a rationale behind this? I noticed in the code that there 
are actually two more hooks, `<mode>-on-hook` and 
`<mode>-off-hook`, which according to a comment in the code are 
there for backward compatibility only. Which suggests that someone 
at some point thought about these things and made a conscious 
decision to this effect.

Which in turn makes me wonder what the rationale was for that 
decision. :-) Also, I haven't been able to find any info on this 
in the Elisp and Emacs manuals. Aren't minor modes supposed to be 
turned off?

TIA


-- 
Joost Kremers
Life has its moments



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

end of thread, other threads:[~2020-10-08 14:33 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-07 23:15 Minor mode hook run when mode is deactivated? Joost Kremers
2020-10-07 23:45 ` Stefan Monnier
2020-10-08  6:44   ` Joost Kremers
2020-10-08 13:53     ` Stefan Monnier
2020-10-08 14:33       ` Joost Kremers

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.