emacs-devel
[Top][All Lists]
Advanced

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

Re: [Emacs-diffs] scratch/so-long d216f81: fixup! Add so-long library


From: Stefan Monnier
Subject: Re: [Emacs-diffs] scratch/so-long d216f81: fixup! Add so-long library
Date: Sun, 14 Apr 2019 11:03:16 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

> +(defun turn-on-so-long-minor-mode ()
> +  "Enable minor mode `so-long-minor-mode'."
> +  (so-long-minor-mode 1))

You don't need to pass `1`, so you could also write:

    (defalias 'turn-on-so-long-minor-mode #'so-long-minor-mode)
    
or just don't define turn-on-so-long-minor-mode at all, which is what
I recommend.

> +(defun turn-off-so-long-minor-mode ()
> +  "Disable minor mode `so-long-minor-mode'."
> +  (so-long-minor-mode -1))

I also recommend not to bother defining the turn-off function and let
users call (so-long-minor-mode -1) for the few cases where they might
need it.


        Stefan



reply via email to

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