[Top][All Lists]

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

Re: About the activation of minor modes

From: Eduardo Ochs
Subject: Re: About the activation of minor modes
Date: Sun, 6 Mar 2022 00:06:55 -0300

On Fri, 4 Mar 2022 at 23:48, angelomolina--- via Users list for the
GNU Emacs text editor <> wrote:
> Can a minor mode activate another minor-mode or functionalities residing in 
> other files ?  I ask because I would like my tools to be organised according 
> to some categorisation criteria' rather than all being huddled together.

Hi Angelo,

I don't know if this idea will help or not, but this is how I would
try to find the answer...

The function `find-epp' of eev pretty-prints its argument and shows
the result in a temporary buffer, and this

  (find-epp (macroexpand '

    (define-minor-mode A-mode
      "Help for A-mode"
      :init-value nil
      :global nil
      :lighter " A")


shows exactly what this `define-minor-mode' does. I _guess_ that it
should be easy to modify the (define-minor-mode A-mode ...) sexp bit
by bit until you get something that turns on and off B-mode when
A-mode is turned on and off - and if you use

  :lighter " B"

in your definition of B-mode then you'll be able to check if B mode
was turned on and off by just looking at the mode line.

Some people like to learn things using this approach and some hate it.
For more info on that, see:

and for more (basic) info on eev, see:

Cheers and happy hacking =),
  Eduardo Ochs

reply via email to

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