help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Adding functionality to a minor mode


From: Michael Heerdegen
Subject: Re: Adding functionality to a minor mode
Date: Mon, 07 Feb 2022 19:05:53 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)

goncholden <goncholden@protonmail.com> writes:

> I am also struck about what happens when "(define-minor-mode
> rich-minor-mode" is used to disable the mode.  I suppose that "(when
> richerenkov-minor-mode" would evaluate to false, but the other parts
> would evaluate.

Yes.  Whenever you turn the mode on or off, the complete body is
evaluated normally, with the mode variable bound to a non-nil value when
the mode has been enabled and nil else.

M-: (macroexpand-1 '(define-minor-mode rich-minor-mode ...)) RET to see
the macroexpanded code of your definition - helps in understanding.

Michael.




reply via email to

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