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.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 19693 in the body.
You can then email your comments to 19693 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#19693; Package emacs. (Mon, 26 Jan 2015 16:47:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Mark Karpov <markkarpov <at> opmbx.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Mon, 26 Jan 2015 16:47:03 GMT) Full text and rfc822 format available.

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

From: Mark Karpov <markkarpov <at> opmbx.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.4;
 A possible typo in description of 'delete-selection-mode' variable
Date: Mon, 26 Jan 2015 20:52:58 +0600
From description of 'delete-selection-mode':

With a prefix argument ARG, enable Delete Selection mode if ARG
is positive, and disable it otherwise.  If called from Lisp,
enable the mode if ARG is omitted or nil.

In practice, if ARG is omitted or nil, the mode is disabled, otherwise
it's enabled.



In GNU Emacs 24.4.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.7)
 of 2015-01-18 on bisson
Windowing system distributor `The X.Org Foundation', version 11.0.11603000
Configured using:
 `configure --prefix=/usr --sysconfdir=/etc --libexecdir=/usr/lib
 --localstatedir=/var --with-x-toolkit=gtk3 --with-xft
 'CFLAGS=-march=x86-64 -mtune=generic -O2 -pipe -fstack-protector-strong
 --param=ssp-buffer-size=4' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-O1,--sort-common,--as-needed,-z,relro'

Important settings:
  value of $LANG: en_US.UTF-8
  locale-coding-system: utf-8-unix

Major mode: Emacs-Lisp

Minor modes in effect:
  magit-auto-revert-mode: t
  shell-dirtrack-mode: t
  diff-auto-refine-mode: t
  fci-mode: t
  rainbow-delimiters-mode: t
  flycheck-mode: t
  flyspell-mode: t
  which-function-mode: t
  show-paren-mode: t
  minibuffer-electric-default-mode: t
  electric-pair-mode: t
  display-time-mode: t
  delete-selection-mode: t
  smooth-scroll-mode: t
  tooltip-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  column-number-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  transient-mark-mode: t
  auto-fill-mode: 1

Recent input:
( d e f u n SPC c o m p i l e - c SPC ( C-f <return> 
" S t r a t <backspace> r t <backspace> <backspace> 
<backspace> <backspace> a r t . C-f <return> ( i n 
t e r a c t i v e C-f <return> ( c o m p i l e C-c 
r <down-mouse-5> <mouse-5> <down-mouse-5> <mouse-5> 
<double-down-mouse-5> <double-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <triple-down-mouse-5> 
<triple-mouse-5> <triple-down-mouse-5> <triple-mouse-5> 
<triple-down-mouse-5> <triple-mouse-5> <down-mouse-1> 
<mouse-1> <down-mouse-4> <mouse-4> <double-down-mouse-4> 
<double-mouse-4> <triple-down-mouse-4> <triple-mouse-4> 
M-v M-v M-v M-v M-v C-h v r e q u i r e - v <backspace> 
f i n a l - <tab> <return> <help-echo> <help-echo> 
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> q 
<down-mouse-1> <mouse-1> <return> r e q u i r e - f 
i n a l - n e w l i n e SPC SPC SPC SPC SPC SPC SPC 
SPC SPC SPC SPC SPC SPC t SPC SPC SPC SPC SPC SPC SPC 
; SPC a l w a y s SPC r e q u i t e SPC i t C-x C-s 
<down-mouse-5> <mouse-5> C-h f d e l e t e - d <backspace> 
s e l e c t i o n - m o d e <return> <help-echo> <help-echo> 
<down-mouse-1> <mouse-1> C-x o C-n C-n C-n C-n C-n 
C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-p C-SPC 
C-e d d f C-/ C-/ C-SPC C-e d f C-/ C-/ C-n C-n C-n 
C-n C-n C-n C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b 
C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b C-b 
C-b C-b M-x r e p o <tab> r t - m e <tab> <backspace> 
<backspace> e m <tab> <return>

Recent messages:
Type C-x 1 to delete the help window.

Saving file /home/mark/.emacs...
Wrote /home/mark/.emacs
Type C-x 1 to delete the help window.
Mark set
Undo! [2 times]
Mark activated
Undo! [2 times]
Making completion list...

Load-path shadows:
/home/mark/.emacs.d/elpa/prolog-1.22/prolog hides /usr/share/emacs/24.4/lisp/progmodes/prolog

Features:
(shadow sort mail-extr emacsbug sendmail debug url-util url-parse
url-vars eieio-opt speedbar sb-image ezimage dframe calc-alg calc-ext
calc-menu calc calc-loaddefs calc-macs dabbrev pcase ace-window
ace-jump-mode magit-key-mode magit view tramp tramp-compat auth-source
eieio eieio-core gnus-util password-cache tramp-loaddefs trampver shell
pcomplete grep epa epg diff-mode autorevert filenotify git-rebase-mode
git-commit-mode log-edit message idna format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
pcvs-util add-log vc-git dired disp-table fill-column-indicator
rainbow-delimiters flycheck find-func help-mode rx subr-x flyspell
ispell solarized-dark-theme solarized dash which-func imenu paren
minibuf-eldef elec-pair time delsel slime-fancy slime-trace-dialog
slime-fontifying-fu slime-package-fu slime-references
slime-compiler-notes-tree slime-scratch slime-presentations advice
bridge slime-fuzzy slime-fancy-trace slime-fancy-inspector slime-c-p-c
slime-editing-commands slime-autodoc eldoc slime-repl elp slime-parse
slime byte-opt bytecomp byte-compile cconv derived help-fns gud apropos
compile etags arc-mode archive-mode noutline outline easy-mmode pp
comint ansi-color ring hyperspec cl-macs thingatpt browse-url cl gv
slime-autoloads smooth-scroll server edmacro kmacro cl-loaddefs cl-lib
info easymenu package epg-config time-date tooltip electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment lisp-mode
prog-mode register page menu-bar rfn-eshadow timer select scroll-bar
mouse jit-lock font-lock syntax facemenu font-core frame cham georgian
utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao korean
japanese hebrew greek romanian slovak czech european ethiopic indian
cyrillic chinese case-table epa-hook jka-cmpr-hook help simple abbrev
minibuffer nadvice loaddefs button faces cus-face macroexp files
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote make-network-process
dbusbind gfilenotify dynamic-setting system-font-setting
font-render-setting move-toolbar gtk x-toolkit x multi-tty emacs)

Memory information:
((conses 16 366132 33341)
 (symbols 48 39607 0)
 (miscs 40 1059 1135)
 (strings 32 73893 5808)
 (string-bytes 1 2027330)
 (vectors 16 28779)
 (vector-slots 8 612061 12721)
 (floats 8 198 822)
 (intervals 56 1941 61)
 (buffers 960 24)
 (heap 1024 42581 2004))




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19693; Package emacs. (Mon, 26 Jan 2015 19:39:02 GMT) Full text and rfc822 format available.

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

From: Mark Karpov <markkarpov <at> opmbx.org>
To: 19693 <at> debbugs.gnu.org
Subject: Further information
Date: Tue, 27 Jan 2015 01:35:37 +0600
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.

Best,

-- Mark




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#19693; Package emacs. (Mon, 26 Jan 2015 23:15:02 GMT) Full text and rfc822 format available.

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
  




Added tag(s) notabug. Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 11 Feb 2015 01:30:04 GMT) Full text and rfc822 format available.

bug closed, send any further explanations to 19693 <at> debbugs.gnu.org and Mark Karpov <markkarpov <at> opmbx.org> Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Wed, 11 Feb 2015 01:30:04 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Wed, 11 Mar 2015 11:24:04 GMT) Full text and rfc822 format available.

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.