Subject: Re: bug#76535: Recommend against turn-on-<FOO>-mode functions

From: Sean Whitton <[email-masked]>
Date: Mon, 10 Mar 2025 13:16:06 +0800

Hello,

On Mon 24 Feb 2025 at 04:34pm -06, Stefan Kangas wrote:

> Severity: wishlist
>
> How about adding to tips.texi a recommendation not to add any new
> functions like these?
>
>     (defun turn-on-<FOO>-mode ()
>       (<FOO>-mode 1))
>     (defun turn-off-<FOO>-mode ()
>       (<FOO>-mode -1))
>
> I think they are redundant in almost all cases, but it seems to me that
> they are sometimes added pretty much routinely.

What about when you want to put

    (add-hook 'foo-mode 'turn-on-bar-mode)

in your init?  Without the wrapper, you need a (lambda () ...) which
isn't great.

-- 
Sean Whitton