GNU bug report logs - #19693
24.4; A possible typo in description of 'delete-selection-mode' variable

Previous Next

Package: emacs;

Reported by: Mark Karpov <markkarpov <at> opmbx.org>

Date: Mon, 26 Jan 2015 16:47:03 UTC

Severity: minor

Tags: notabug

Found in version 24.4

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #11 received at 19693 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> IRO.UMontreal.CA>
To: Mark Karpov <markkarpov <at> opmbx.org>
Cc: 19693 <at> debbugs.gnu.org
Subject: Re: bug#19693: Further information
Date: Mon, 26 Jan 2015 18:14:42 -0500
> I'm sorry if it's not really a bug. After some testing I understood that
> functions (something-mode ARG) when called from Lisp, enable
> corresponding mode if ARG is omitted, if it's NIL, and even if it's not
> NIL (some people use (something-mode t) to enable the such a
> actually). So, it's quite strange: almost any argument or its absence
> enables the mode, but to disable it one must use negative number. It
> would be more logical if T would enable the mode and NIL would disable
> it.

This is the same for all minor-modes.  The reason is partly historical
and partly pragmatic.  The situation is basically:
- there are 3 different cases: enable, disable, toggle (so just using
  nil and t doesn't cut it).
- when called from Elisp the most common case (by far) is `enable' and
  in many cases it's very handy to be able to skip the argument
  (typically (add-hook 'foo-mode-hook #'bar-mode) instead of (add-hook
  'foo-mode-hook (lambda () (bar-mode <something>)))).

This means that (optional) nil has to mean "enable".  The rest doesn't
matter much.  I chose `toggle' for the toggling case, and the
"negative/positive" was chosen before I got involved in Emacs.


        Stefan
  




This bug report was last modified 10 years and 103 days ago.

Previous Next


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