bug#81569: 31.0.90; easy-mmode.el: Zero seems inadvertently removed or omitted from documentation
Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <[email protected]>
| Newsgroups | gmane.emacs.bugs |
|---|---|
| Message-ID | <[email protected]> |
>> Who uses zero, anyway, and why? > Regarding this question: There are many cases in the Emacs source code > itself where 0 is used to disable a mode, such as for example: I think we should fix those because I don't think we should encourage this use. > desktop.el: (desktop-save-mode 0)) > desktop.el: (auto-fill-mode 0)) > desktop.el: (desktop-save-mode 0))) > epa-hook.el: (auto-save-mode 0))) > erc/erc-spelling.el: (with-current-buffer buffer (flyspell-mode 0))))) > face-remap.el: (buffer-face-mode 0) > face-remap.el: (buffer-face-mode 0) > etc. > > Personally, I find this way to enable and disable a mode natural and > easy to understand: 1 to enable a mode, 0 to disable it, so I can see > why it is intuitively used in libraries, and in fact I also use it. But such C-style practice would then suggest that calls like (foo-mode -1) will also enable the mode, so I prefer to stay away from such misleading practice. === Stefan