GNU bug report logs - #76535
Recommend against turn-on-<FOO>-mode functions

Previous Next

Package: emacs;

Reported by: Stefan Kangas <stefankangas <at> gmail.com>

Date: Mon, 24 Feb 2025 22:35:02 UTC

Severity: wishlist

Full log


View this message in rfc822 format

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Sean Whitton <spwhitton <at> spwhitton.name>
Cc: Stefan Kangas <stefankangas <at> gmail.com>, 76535 <at> debbugs.gnu.org
Subject: bug#76535: Recommend against turn-on-<FOO>-mode functions
Date: Mon, 10 Mar 2025 11:29:04 -0400
> Oh, thanks, I guess that's new since I last looked into this.

etc/NEWS.24:

    * Incompatible Lisp Changes in Emacs 24.1
    
    ** Passing a nil argument to a minor mode function call now ENABLES
    the minor mode unconditionally.  This is so that you can write e.g.
    
        (add-hook 'text-mode-hook #'foo-mode)
    
    to enable foo-mode in Text mode buffers, removing the need for
    'turn-on-foo-mode' style functions.  This affects all mode commands
    defined by 'define-minor-mode'.  If called interactively, the mode
    command still toggles the minor mode.


- Stefan





This bug report was last modified 151 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.