Subject: 24.4; variable-pitch-mode should turn itself on when passed nil

From: [email-masked] (João Távora)
Date: Mon, 15 Dec 2014 12:11:27 +0000

Stefan Monnier <[email-masked]> writes:
> Indeed.  Could you make it a bug report?

The minor mode `variable-pitch-mode' should turn itself on when passed
nil as the value of its ARG parameter, cccording to minor-mode
standards.

This is so that placing the symbol `variable-pitch-mode' in any hook
does the intuitive thing: i.e. ensure the mode is turned on. Currently
it might toggle the mode off if it is already on.

The actual problem may live in `buffer-face-mode-invoke', whose
docstring states that its ARG parameter is "interpreted in the usual
manner for minor-mode commands". That is not true, since passing it as
NIL causes `buffer-face-toggle' to be called. It's probably safe to fix
it here since it's apparently only used in two places:

    ./face-remap.el:422:(defun buffer-face-mode-invoke (specs arg &optional interactive)
    ./face-remap.el:458:  (buffer-face-mode-invoke 'variable-pitch arg
    ./mouse.el:1836:(declare-function buffer-face-mode-invoke "face-remap"
    ./mouse.el:1896:		 (buffer-face-mode-invoke

João

In GNU Emacs 24.4.1 (i686-pc-mingw32)
 of 2014-10-24 on LEG570
Windowing system distributor `Microsoft Corp.', version 6.1.7601
Configured using:
 `configure --prefix=/c/usr'

Important settings:
  value of $LC_CTYPE: UTF-8
  value of $LANG: C.UTF-8
  locale-coding-system: cp1252

Major mode: Lisp

Minor modes in effect:
  diff-auto-refine-mode: t
  yas-global-mode: t
  yas-minor-mode: t
  shell-dirtrack-mode: t
  sly-stickers-shortcut-mode: t
  sly-stickers-mode: t
  sly-profiler-shortcut-mode: t
  sly-trace-dialog-shortcut-mode: t
  sly-autodoc-mode: t
  eldoc-mode: t
  sly-editing-mode: t
  sly-mode: t
  global-edit-server-edit-mode: t
  electric-pair-mode: t
  ido-everywhere: t
  delete-selection-mode: t
  global-auto-revert-mode: t
  show-paren-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
  line-number-mode: t
  transient-mark-mode: t
  hs-minor-mode: t

Recent input:
C-n C-n C-n C-n C-n C-n C-n C-p C-p C-p C-p C-p C-p 
C-p C-p C-p C-p C-p C-p C-p C-p C-p C-e M-b M-b M-b 
M-b 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-a C-a C-k C-k M-< C-e M-b M-b M-b M-b 
C-b a v o r a C-f M-d g m a i l C-f M-d c o m C-c C-c 
C-g 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-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-f C-p C-f C-b m o r e SPC M-q C-p C-n <M-backspace> 
m o s t SPC M-b M-b M-d i t s M-q C-p C-n C-e C-x C-s 
C-p C-n C-p C-p C-p C-p C-p C-p C-n C-n C-n C-c C-c 
y C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-x 1 <wheel-down> 
<double-wheel-down> <wheel-down> <wheel-down> <wheel-down> 
<wheel-down> <wheel-down> <wheel-down> <wheel-down> 
<wheel-down> <wheel-down> <double-wheel-down> <wheel-down> 
<wheel-up> <double-wheel-up> <wheel-down> <double-wheel-down> 
<triple-wheel-down> <triple-wheel-down> <wheel-up> 
<double-wheel-up> <down-mouse-1> <mouse-1> <wheel-down> 
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> <wheel-down> 
<wheel-down> <double-wheel-down> <triple-wheel-down> 
<wheel-down> <double-wheel-down> <triple-wheel-down> 
<wheel-down> <double-wheel-down> <triple-wheel-down> 
<wheel-down> <double-wheel-down> <triple-wheel-down> 
<wheel-down> <double-wheel-down> <down-mouse-1> <mouse-1> 
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> <down-mouse-1> 
<mouse-1> <down-mouse-1> <drag-mouse-1> <down-mouse-1> 
<mouse-movement> <drag-mouse-1> <down-mouse-1> <mouse-1> 
<wheel-down> <wheel-down> <down-mouse-1> <mouse-1> 
<down-mouse-1> <mouse-1> <down-mouse-1> <mouse-1> <wheel-down> 
<wheel-up> <down-mouse-1> <mouse-1> <down-mouse-1> 
<mouse-1> <down-mouse-1> <mouse-movement> <mouse-movement> 
<drag-mouse-1> <down-mouse-1> <mouse-1> C-c C-c <down-mouse-1> 
<mouse-1> <down-mouse-1> <mouse-1> C-a C-c @ C-c 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-n C-n C-n C-n C-n C-n C-n C-n C-n C-n C-n 
C-n <S-down-mouse-1> <drag-mouse-1> <down-mouse-1> 
<mouse-movement> <drag-mouse-1> M-x s c s t <backspace> 
<backspace> SPC s t a <tab> <return> M-x r e p o r 
t SPC e m <tab> <return>

Recent messages:
Loading z:/siscog/sc-emacs/cl-hyperspec/online-doc.el (source)...
Loading z:/siscog/sc-emacs/cl-hyperspec/cltl2.el (source)...done
Loading z:/siscog/sc-emacs/cl-hyperspec/hyperspec.el (source)...
../../../../../sc-emacs/cl-hyperspec/hyperspec.el: `labels' is an obsolete macro (as of 24.3); use `cl-labels' instead.
Loading z:/siscog/sc-emacs/cl-hyperspec/hyperspec.el (source)...done
Loading z:/siscog/sc-emacs/cl-hyperspec/online-doc.el (source)...done
CREWS_DIR: z:/siscog/crews-vdev
Loading lisp-mode...done
Loading bytecomp...done
Loading z:/siscog/sc-emacs/init.el (source)...done

Load-path shadows:
z:/.emacs.d/el-get/ido-vertical-mode/ido-vertical-mode hides z:/holy/share/emacs/ido-vertical-mode
z:/siscog/sc-emacs/eli81/fi-manual hides z:/holy/share/emacs/fi-manual
z:/siscog/sc-emacs/cl-shell/completion hides z:/Vendor/emacs-24.4/share/emacs/24.4/lisp/completion

Features:
(shadow emacsbug sc-emacs cltl2 cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs ps-print ps-def lpr
fi-site-init fi-manual allegro-manual-data ediff-merg ediff-wind
ediff-diff ediff-mult ediff-help ediff-init ediff-util ediff ffap
smerge-mode gnus-fun url-http url-gw url-cache url-auth url-handlers
mm-url url url-proxy url-privacy url-expand url-methods url-history
url-cookie url-domsuf url-util url-parse url-vars cua-rect rect cua-base
face-remap org-element org-rmail org-mhe org-irc org-info org-gnus
org-docview doc-view jka-compr image-mode org-bibtex bibtex org-bbdb
org-w3m org org-macro org-footnote org-pcomplete org-list org-faces
org-entities org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs cal-menu calendar cal-loaddefs tex-mode latexenc
darkroom hippie-exp eieio-opt speedbar sb-image ezimage dframe find-func
misearch multi-isearch flow-fill mailalias smtpmail sendmail quail
shr-color shr sort smiley gnus-cite mm-archive mail-extr gnus-async
gnus-bcklg qp gnus-ml gnus-topic nndraft nnmh utf-7 nnimap utf7 nnfolder
parse-time netrc gnutls network-stream starttls tls gnus-agent gnus-srvr
gnus-score score-mode nnvirtual gnus-msg gnus-art mm-uu mml2015 mm-view
mml-smime smime dig mailcap nntp gnus-cache nnir gnus-sum gnus-group
gnus-undo nnmail mail-source gnus-start gnus-spec gnus-int gnus-range
gnus-win nnoo gnus gnus-ems nnheader wid-edit diff-mode ibuf-ext ibuffer
hideshow perl-mode vc-git vc-bzr vc-sccs vc-svn vc-cvs vc-rcs vc-dir
ewoc yasnippet sql view siscog-sly sly-fancy sly-tramp tramp
tramp-compat auth-source eieio eieio-core gnus-util password-cache
tramp-loaddefs trampver shell pcomplete sly-indentation sly-cl-indent
cl-indent sly-stickers color hi-lock sly-profiler sly-trace-dialog
sly-fontifying-fu sly-package-fu sly-scratch sly-fuzzy sly-fancy-trace
sly-fancy-inspector sly-autodoc sly-parse eldoc sly-mrepl sly rx gud
compile sly-buttons sly-messages apropos etags arc-mode archive-mode
noutline outline comint ansi-color hyperspec browse-url
sc-extra-autoloads sgml-mode warnings circe lui-irc-colors lcs
lui-format lui tracking shorten flyspell ispell git-rebase-mode
thingatpt byte-opt edit-server ido-vertical-mode .loaddefs el-get
el-get-autoloading el-get-list-packages el-get-dependencies el-get-build
el-get-status pp el-get-methods el-get-fossil el-get-svn el-get-pacman
el-get-github-zip el-get-github-tar el-get-http-zip el-get-http-tar
el-get-hg el-get-go el-get-git-svn el-get-fink el-get-emacswiki
el-get-http el-get-notify help-mode el-get-emacsmirror el-get-github
el-get-git el-get-elpa package el-get-darcs el-get-cvs el-get-bzr
el-get-brew el-get-builtin el-get-apt-get el-get-recipes
el-get-byte-compile el-get-custom el-get-core autoload lisp-mnt bytecomp
byte-compile cconv dired-x dired sly-autoloads epa-file epa derived epg
epg-config windmove elec-pair ido delsel autorevert filenotify paren
server log-edit easy-mmode message format-spec rfc822 mml easymenu
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
ring pcvs-util add-log vc vc-dispatcher advice help-fns edmacro kmacro
mule-util holy cl-macs cl gv cl-loaddefs cl-lib time-date tooltip
electric uniquify ediff-hook vc-hooks lisp-float-type mwheel dos-w32
ls-lisp w32-common-fns disp-table w32-win w32-vars 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
w32notify w32 multi-tty emacs)

Memory information:
((conses 8 815495 79726)
 (symbols 32 71291 49)
 (miscs 32 1592 2629)
 (strings 16 158464 16487)
 (string-bytes 1 4848736)
 (vectors 8 66501)
 (vector-slots 4 1965454 35386)
 (floats 8 1307 1268)
 (intervals 28 9709 299)
 (buffers 508 84))