Subject: 24.4; server-kill-emacs-query-function only prompts if there are live clients

From: Leo White <[email-masked]>
Date: Tue, 20 Jan 2015 17:47:00 +0000

With an emacs daemon running:

  $ emacs -Q --daemon

If you create a client which is not live (i.e. has no buffers):

  $ emacsclient -c

then using save-buffers-kill-emacs will prompt

  "This Emacs session has clients; exit anyway? "

However, if the client is live:

  $ emacsclient -c foo

(where `foo` is a filename) then using save-buffers-kill-emacs will not
issue the prompt.

It seems that the logic of `server-kill-emacs-query-function` was
accidently reversed by the commit "Another server.el overhaul." back in
2004.

In GNU Emacs 24.4.1 (x86_64-pc-linux-gnu, GTK+ Version 3.14.3)
 of 2014-10-25 on trouble, modified by Debian
Windowing system distributor `The X.Org Foundation', version 11.0.11601901
System Description:	Debian GNU/Linux testing (jessie)

Configured using:
 `configure --build x86_64-linux-gnu --prefix=/usr
 --sharedstatedir=/var/lib --libexecdir=/usr/lib
 --localstatedir=/var/lib --infodir=/usr/share/info
 --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --build x86_64-linux-gnu --prefix=/usr --sharedstatedir=/var/lib
 --libexecdir=/usr/lib --localstatedir=/var/lib
 --infodir=/usr/share/info --mandir=/usr/share/man --with-pop=yes
 --enable-locallisppath=/etc/emacs24:/etc/emacs:/usr/local/share/emacs/24.4/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/24.4/site-lisp:/usr/share/emacs/site-lisp
 --with-x=yes --with-x-toolkit=gtk3 --with-toolkit-scroll-bars
 'CFLAGS=-g -O2 -fstack-protector-strong -Wformat
 -Werror=format-security -Wall' CPPFLAGS=-D_FORTIFY_SOURCE=2
 LDFLAGS=-Wl,-z,relro'

Important settings:
  value of $LANG: en_GB.utf8
  locale-coding-system: utf-8-unix

Major mode: IBuffer

Minor modes in effect:
  yas-global-mode: t
  yas-minor-mode: t
  global-semanticdb-minor-mode: t
  global-semantic-idle-scheduler-mode: t
  global-semantic-idle-summary-mode: t
  global-semantic-decoration-mode: t
  server-mode: t
  global-semantic-stickyfunc-mode: t
  semantic-mode: t
  savehist-mode: t
  recentf-mode: t
  iswitchb-mode: t
  display-time-mode: t
  desktop-save-mode: t
  delete-selection-mode: t
  ergoemacs-mode: t
  cua-mode: t
  global-undo-tree-mode: t
  undo-tree-mode: t
  volatile-highlights-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<help-echo> M-x <help-echo> <help-echo> e m a <tab> 
r e p <tab> r <backspace> <tab> <backspace> <backspace> 
<backspace> <backspace> <backspace> <backspace> <backspace> 
<backspace> <backspace> r e p o <tab> r t - <tab> 
<return>

Recent messages:
[yas] Loading for `prog-mode', just-in-time: (lambda nil (yas--load-directory-1 (quote /home/leo/.emacs.d/elpa/yasnippet-20140911.312/snippets/prog-mode) (quote prog-mode)))!
[yas] Loading compiled snippets from /home/leo/.emacs.d/elpa/yasnippet-20140911.312/snippets/prog-mode
Loading /home/leo/.emacs.d/elpa/yasnippet-20140911.312/snippets/prog-mode/.yas-setup...done
Source file `/home/leo/.emacs.d/utilities/util-completion.el' newer than byte-compiled file
Starting Emacs daemon.
Restarting server
Package iswitchb is obsolete!
Formats have changed, recompiling...done
Updating buffer list...done
When done with this frame, type C-x 5 0

Load-path shadows:
/usr/share/emacs/24.4/site-lisp/debian-startup hides /usr/share/emacs/site-lisp/debian-startup
/usr/share/emacs24/site-lisp/flim/md4 hides /usr/share/emacs/24.4/lisp/md4
/usr/share/emacs24/site-lisp/flim/hex-util hides /usr/share/emacs/24.4/lisp/hex-util
/usr/share/emacs24/site-lisp/dictionaries-common/flyspell hides /usr/share/emacs/24.4/lisp/textmodes/flyspell
/usr/share/emacs24/site-lisp/dictionaries-common/ispell hides /usr/share/emacs/24.4/lisp/textmodes/ispell
/usr/share/emacs/site-lisp/rst hides /usr/share/emacs/24.4/lisp/textmodes/rst
/home/leo/.emacs.d/org-7.8.11/lisp/ob-python hides /usr/share/emacs/24.4/lisp/org/ob-python
/home/leo/.emacs.d/org-7.8.11/lisp/ob-octave hides /usr/share/emacs/24.4/lisp/org/ob-octave
/home/leo/.emacs.d/org-7.8.11/lisp/org-timer hides /usr/share/emacs/24.4/lisp/org/org-timer
/home/leo/.emacs.d/org-7.8.11/lisp/org-datetree hides /usr/share/emacs/24.4/lisp/org/org-datetree
/home/leo/.emacs.d/org-7.8.11/lisp/org-macs hides /usr/share/emacs/24.4/lisp/org/org-macs
/home/leo/.emacs.d/org-7.8.11/lisp/ob-maxima hides /usr/share/emacs/24.4/lisp/org/ob-maxima
/home/leo/.emacs.d/org-7.8.11/lisp/org-gnus hides /usr/share/emacs/24.4/lisp/org/org-gnus
/home/leo/.emacs.d/org-7.8.11/lisp/ob-js hides /usr/share/emacs/24.4/lisp/org/ob-js
/home/leo/.emacs.d/org-7.8.11/lisp/ob-ruby hides /usr/share/emacs/24.4/lisp/org/ob-ruby
/home/leo/.emacs.d/org-7.8.11/lisp/org-irc hides /usr/share/emacs/24.4/lisp/org/org-irc
/home/leo/.emacs.d/org-7.8.11/lisp/org-capture hides /usr/share/emacs/24.4/lisp/org/org-capture
/home/leo/.emacs.d/org-7.8.11/lisp/org-attach hides /usr/share/emacs/24.4/lisp/org/org-attach
/home/leo/.emacs.d/org-7.8.11/lisp/ob-ocaml hides /usr/share/emacs/24.4/lisp/org/ob-ocaml
/home/leo/.emacs.d/org-7.8.11/lisp/org-docview hides /usr/share/emacs/24.4/lisp/org/org-docview
/home/leo/.emacs.d/org-7.8.11/lisp/org-bibtex hides /usr/share/emacs/24.4/lisp/org/org-bibtex
/home/leo/.emacs.d/org-7.8.11/lisp/org-id hides /usr/share/emacs/24.4/lisp/org/org-id
/home/leo/.emacs.d/org-7.8.11/lisp/org-protocol hides /usr/share/emacs/24.4/lisp/org/org-protocol
/home/leo/.emacs.d/org-7.8.11/lisp/org-info hides /usr/share/emacs/24.4/lisp/org/org-info
/home/leo/.emacs.d/org-7.8.11/lisp/ob-tangle hides /usr/share/emacs/24.4/lisp/org/ob-tangle
/home/leo/.emacs.d/org-7.8.11/lisp/org-plot hides /usr/share/emacs/24.4/lisp/org/org-plot
/home/leo/.emacs.d/org-7.8.11/lisp/org-indent hides /usr/share/emacs/24.4/lisp/org/org-indent
/home/leo/.emacs.d/org-7.8.11/lisp/org-src hides /usr/share/emacs/24.4/lisp/org/org-src
/home/leo/.emacs.d/org-7.8.11/lisp/ob-eval hides /usr/share/emacs/24.4/lisp/org/ob-eval
/home/leo/.emacs.d/org-7.8.11/lisp/ob-css hides /usr/share/emacs/24.4/lisp/org/ob-css
/home/leo/.emacs.d/org-7.8.11/lisp/org-faces hides /usr/share/emacs/24.4/lisp/org/org-faces
/home/leo/.emacs.d/org-7.8.11/lisp/ob-emacs-lisp hides /usr/share/emacs/24.4/lisp/org/ob-emacs-lisp
/home/leo/.emacs.d/org-7.8.11/lisp/ob-lisp hides /usr/share/emacs/24.4/lisp/org/ob-lisp
/home/leo/.emacs.d/org-7.8.11/lisp/org hides /usr/share/emacs/24.4/lisp/org/org
/home/leo/.emacs.d/org-7.8.11/lisp/ob-keys hides /usr/share/emacs/24.4/lisp/org/ob-keys
/home/leo/.emacs.d/org-7.8.11/lisp/ob-picolisp hides /usr/share/emacs/24.4/lisp/org/ob-picolisp
/home/leo/.emacs.d/org-7.8.11/lisp/ob-shen hides /usr/share/emacs/24.4/lisp/org/ob-shen
/home/leo/.emacs.d/org-7.8.11/lisp/ob hides /usr/share/emacs/24.4/lisp/org/ob
/home/leo/.emacs.d/org-7.8.11/lisp/ob-sqlite hides /usr/share/emacs/24.4/lisp/org/ob-sqlite
/home/leo/.emacs.d/org-7.8.11/lisp/org-compat hides /usr/share/emacs/24.4/lisp/org/org-compat
/home/leo/.emacs.d/org-7.8.11/lisp/org-habit hides /usr/share/emacs/24.4/lisp/org/org-habit
/home/leo/.emacs.d/org-7.8.11/lisp/org-inlinetask hides /usr/share/emacs/24.4/lisp/org/org-inlinetask
/home/leo/.emacs.d/org-7.8.11/lisp/ob-screen hides /usr/share/emacs/24.4/lisp/org/ob-screen
/home/leo/.emacs.d/org-7.8.11/lisp/ob-comint hides /usr/share/emacs/24.4/lisp/org/ob-comint
/home/leo/.emacs.d/org-7.8.11/lisp/ob-sql hides /usr/share/emacs/24.4/lisp/org/ob-sql
/home/leo/.emacs.d/org-7.8.11/lisp/ob-exp hides /usr/share/emacs/24.4/lisp/org/ob-exp
/home/leo/.emacs.d/org-7.8.11/lisp/ob-perl hides /usr/share/emacs/24.4/lisp/org/ob-perl
/home/leo/.emacs.d/org-7.8.11/lisp/org-colview hides /usr/share/emacs/24.4/lisp/org/org-colview
/home/leo/.emacs.d/org-7.8.11/lisp/ob-mscgen hides /usr/share/emacs/24.4/lisp/org/ob-mscgen
/home/leo/.emacs.d/org-7.8.11/lisp/org-entities hides /usr/share/emacs/24.4/lisp/org/org-entities
/home/leo/.emacs.d/org-7.8.11/lisp/ob-ref hides /usr/share/emacs/24.4/lisp/org/ob-ref
/home/leo/.emacs.d/org-7.8.11/lisp/ob-org hides /usr/share/emacs/24.4/lisp/org/ob-org
/home/leo/.emacs.d/org-7.8.11/lisp/ob-C hides /usr/share/emacs/24.4/lisp/org/ob-C
/home/leo/.emacs.d/org-7.8.11/lisp/ob-calc hides /usr/share/emacs/24.4/lisp/org/ob-calc
/home/leo/.emacs.d/org-7.8.11/lisp/org-mobile hides /usr/share/emacs/24.4/lisp/org/org-mobile
/home/leo/.emacs.d/org-7.8.11/lisp/org-table hides /usr/share/emacs/24.4/lisp/org/org-table
/home/leo/.emacs.d/org-7.8.11/lisp/org-list hides /usr/share/emacs/24.4/lisp/org/org-list
/home/leo/.emacs.d/org-7.8.11/lisp/org-bbdb hides /usr/share/emacs/24.4/lisp/org/org-bbdb
/home/leo/.emacs.d/org-7.8.11/lisp/org-feed hides /usr/share/emacs/24.4/lisp/org/org-feed
/home/leo/.emacs.d/org-7.8.11/lisp/org-crypt hides /usr/share/emacs/24.4/lisp/org/org-crypt
/home/leo/.emacs.d/org-7.8.11/lisp/ob-dot hides /usr/share/emacs/24.4/lisp/org/ob-dot
/home/leo/.emacs.d/org-7.8.11/lisp/ob-clojure hides /usr/share/emacs/24.4/lisp/org/ob-clojure
/home/leo/.emacs.d/org-7.8.11/lisp/ob-haskell hides /usr/share/emacs/24.4/lisp/org/ob-haskell
/home/leo/.emacs.d/org-7.8.11/lisp/ob-plantuml hides /usr/share/emacs/24.4/lisp/org/ob-plantuml
/home/leo/.emacs.d/org-7.8.11/lisp/ob-sh hides /usr/share/emacs/24.4/lisp/org/ob-sh
/home/leo/.emacs.d/org-7.8.11/lisp/org-mouse hides /usr/share/emacs/24.4/lisp/org/org-mouse
/home/leo/.emacs.d/org-7.8.11/lisp/ob-gnuplot hides /usr/share/emacs/24.4/lisp/org/ob-gnuplot
/home/leo/.emacs.d/org-7.8.11/lisp/org-ctags hides /usr/share/emacs/24.4/lisp/org/org-ctags
/home/leo/.emacs.d/org-7.8.11/lisp/org-w3m hides /usr/share/emacs/24.4/lisp/org/org-w3m
/home/leo/.emacs.d/org-7.8.11/lisp/org-archive hides /usr/share/emacs/24.4/lisp/org/org-archive
/home/leo/.emacs.d/org-7.8.11/lisp/org-footnote hides /usr/share/emacs/24.4/lisp/org/org-footnote
/home/leo/.emacs.d/org-7.8.11/lisp/ob-table hides /usr/share/emacs/24.4/lisp/org/ob-table
/home/leo/.emacs.d/org-7.8.11/lisp/ob-scheme hides /usr/share/emacs/24.4/lisp/org/ob-scheme
/home/leo/.emacs.d/org-7.8.11/lisp/ob-fortran hides /usr/share/emacs/24.4/lisp/org/ob-fortran
/home/leo/.emacs.d/org-7.8.11/lisp/org-mhe hides /usr/share/emacs/24.4/lisp/org/org-mhe
/home/leo/.emacs.d/org-7.8.11/lisp/ob-awk hides /usr/share/emacs/24.4/lisp/org/ob-awk
/home/leo/.emacs.d/org-7.8.11/lisp/ob-ditaa hides /usr/share/emacs/24.4/lisp/org/ob-ditaa
/home/leo/.emacs.d/org-7.8.11/lisp/ob-sass hides /usr/share/emacs/24.4/lisp/org/ob-sass
/home/leo/.emacs.d/org-7.8.11/lisp/ob-lilypond hides /usr/share/emacs/24.4/lisp/org/ob-lilypond
/home/leo/.emacs.d/org-7.8.11/lisp/ob-ledger hides /usr/share/emacs/24.4/lisp/org/ob-ledger
/home/leo/.emacs.d/org-7.8.11/lisp/org-eshell hides /usr/share/emacs/24.4/lisp/org/org-eshell
/home/leo/.emacs.d/org-7.8.11/lisp/ob-matlab hides /usr/share/emacs/24.4/lisp/org/ob-matlab
/home/leo/.emacs.d/org-7.8.11/lisp/ob-latex hides /usr/share/emacs/24.4/lisp/org/ob-latex
/home/leo/.emacs.d/org-7.8.11/lisp/org-pcomplete hides /usr/share/emacs/24.4/lisp/org/org-pcomplete
/home/leo/.emacs.d/org-7.8.11/lisp/org-rmail hides /usr/share/emacs/24.4/lisp/org/org-rmail
/home/leo/.emacs.d/org-7.8.11/lisp/ob-java hides /usr/share/emacs/24.4/lisp/org/ob-java
/home/leo/.emacs.d/org-7.8.11/lisp/org-agenda hides /usr/share/emacs/24.4/lisp/org/org-agenda
/home/leo/.emacs.d/org-7.8.11/lisp/ob-lob hides /usr/share/emacs/24.4/lisp/org/ob-lob
/home/leo/.emacs.d/org-7.8.11/lisp/org-clock hides /usr/share/emacs/24.4/lisp/org/org-clock
/home/leo/.emacs.d/org-7.8.11/lisp/org-install hides /usr/share/emacs/24.4/lisp/org/org-install
/home/leo/.emacs.d/org-7.8.11/lisp/ob-R hides /usr/share/emacs/24.4/lisp/org/ob-R
/home/leo/.emacs.d/org-7.8.11/lisp/ob-asymptote hides /usr/share/emacs/24.4/lisp/org/ob-asymptote
/usr/share/emacs24/site-lisp/flim/hmac-def hides /usr/share/emacs/24.4/lisp/net/hmac-def
/usr/share/emacs24/site-lisp/flim/ntlm hides /usr/share/emacs/24.4/lisp/net/ntlm
/usr/share/emacs24/site-lisp/flim/hmac-md5 hides /usr/share/emacs/24.4/lisp/net/hmac-md5
/usr/share/emacs24/site-lisp/flim/sasl-digest hides /usr/share/emacs/24.4/lisp/net/sasl-digest
/usr/share/emacs24/site-lisp/flim/sasl-ntlm hides /usr/share/emacs/24.4/lisp/net/sasl-ntlm
/usr/share/emacs24/site-lisp/flim/sasl hides /usr/share/emacs/24.4/lisp/net/sasl
/usr/share/emacs24/site-lisp/flim/sasl-cram hides /usr/share/emacs/24.4/lisp/net/sasl-cram

Features:
(shadow sort mail-extr emacsbug message rfc822 mml mml-sec mm-decode
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums pp ibuf-ext ibuffer
auto-complete-config flymake compile auto-complete popup
rainbow-delimiters dired-aux dired-x dired vc-git cus-edit unsafep
ace-jump-mode-autoloads tex-site auto-complete-autoloads
expand-region-autoloads magit-autoloads git-rebase-mode-autoloads
git-commit-mode-autoloads multiple-cursors-autoloads popup-autoloads
rainbow-delimiters-autoloads info scratch-autoloads
sr-speedbar-autoloads tuareg-autoloads caml-autoloads
twittering-mode-autoloads undo-tree-autoloads
volatile-highlights-autoloads yasnippet-autoloads package epg-config
yasnippet help-mode etags semantic/db-mode semantic/db eieio-base
semantic/idle semantic/format ezimage semantic/ctxt
semantic/decorate/mode semantic/tag-ls semantic/find semantic/decorate
pulse org-mouse org-w3m org-wl org-vm org-rmail org-protocol org-mhe
org-mew org-irc org-jsinfo org-infojs org-html org-info org-gnus
org-docview org-bibtex bibtex org-bbdb ob-ditaa ob-ocaml
whiteboard-theme paren server semantic/util-modes semantic/util semantic
semantic/tag semantic/lex semantic/fw eieio eieio-core mode-local cedet
savehist recentf tree-widget iswitchb gnus gnus-ems nnheader gnus-util
mail-utils mm-util mail-prsvr wid-edit time desktop frameset delsel
cus-start cus-load ergoemacs-mode edmacro kmacro cua-gmrk cua-rect rect
cua-base ottmode generic eproject derived cl-macs esh-var esh-io esh-cmd
esh-opt esh-ext esh-proc esh-arg eldoc esh-groups eshell esh-module
esh-mode esh-util cl gv cl-loaddefs cl-lib appt diary-lib diary-loaddefs
org-clock org-exp ob-exp org-exp-blocks find-func org-agenda org
byte-opt bytecomp byte-compile cconv ob-emacs-lisp ob-tangle ob-ref
ob-lob ob-table org-footnote org-src ob-comint ob-keys ob ob-eval
org-pcomplete pcomplete comint ring org-list org-faces org-compat
org-entities org-macs time-date noutline outline easy-mmode format-spec
cal-menu easymenu calendar cal-loaddefs org-install cc-styles cc-align
cc-engine cc-vars cc-defs undo-tree diff volatile-highlights ansi-color
utilities advice help-fns w3m-load agda2 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 361474 14204)
 (symbols 48 42757 0)
 (miscs 40 2936 963)
 (strings 32 88300 9908)
 (string-bytes 1 2611021)
 (vectors 16 36388)
 (vector-slots 8 718977 6321)
 (floats 8 511 56)
 (intervals 56 798 0)
 (buffers 960 23)
 (heap 1024 33008 1672))