all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#19693: 24.4; A possible typo in description of 'delete-selection-mode' variable
@ 2015-01-26 14:52 Mark Karpov
  2015-01-26 19:35 ` bug#19693: Further information Mark Karpov
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Karpov @ 2015-01-26 14:52 UTC (permalink / raw)
  To: 19693


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))





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#19693: Further information
  2015-01-26 14:52 bug#19693: 24.4; A possible typo in description of 'delete-selection-mode' variable Mark Karpov
@ 2015-01-26 19:35 ` Mark Karpov
  2015-01-26 23:14   ` Stefan Monnier
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Karpov @ 2015-01-26 19:35 UTC (permalink / raw)
  To: 19693


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





^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#19693: Further information
  2015-01-26 19:35 ` bug#19693: Further information Mark Karpov
@ 2015-01-26 23:14   ` Stefan Monnier
  0 siblings, 0 replies; 3+ messages in thread
From: Stefan Monnier @ 2015-01-26 23:14 UTC (permalink / raw)
  To: Mark Karpov; +Cc: 19693

> 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
  





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-01-26 23:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-26 14:52 bug#19693: 24.4; A possible typo in description of 'delete-selection-mode' variable Mark Karpov
2015-01-26 19:35 ` bug#19693: Further information Mark Karpov
2015-01-26 23:14   ` Stefan Monnier

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.