[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: [External] : Hook on other minor modes
From: |
Drew Adams |
Subject: |
RE: [External] : Hook on other minor modes |
Date: |
Mon, 26 Jun 2023 23:50:00 +0000 |
> > > > It enables minor mode `tika-minor-mode' when minor mode
> > > > `outline-minor-mode' is enabled AND when `outline-minor-mode' is
> > > > disabled. See` C-h f
> > > > define-minor-mode':
> > It's useful if you want to provide behavior for when it's enabled OR
> when it's disabled, OR both. You can do any of those things. Pretty
> useful, I'd say.
>
> Can't one simply enable something.
Put a function `foo' on `outline-minor-mode-hook'. Define `foo' so that it
enables `tika-minor-mode when `outline-minor-mode' is non-nil. That's all it
has to do. Is that so hard?
The point is that by having the hook run when the hook's minor-mode is enabled
AND when it's disabled you can do whatever you want. That includes only
enabling some other mode when the hook's mode is enabled.
Simple, flexible, elegant. Que demande le peuple ?