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

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

Re: Hooks in minor modes


From: Stefan Monnier
Subject: Re: Hooks in minor modes
Date: Thu, 29 Apr 2021 23:31:57 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> Is it acceptable to set mode hooks in a minor mode so that the minor
> mode is available by default, rather than requiring the user to include
>
>   (add-hook 'texinfo-mode-hook 'my-minor-mode))

Depends when you do that and it likely depends whom you ask.

The convention that we strongly encourage to follow is that *loading* an
ELisp file should not noticeably change Emacs's behavior (among other
things, because files may be loaded without the user's explicit
request).  So doing such an `add-hook` at the top-level of your file
would probably not be considered as acceptable from that point of view
(unless activating `my-minor-mode` by default has no visible effect,
which is definitely possible but unusual).


        Stefan




reply via email to

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