unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#26458: 25.1; abort on X close window
@ 2017-04-12  5:02 Kevin Ryde
  2017-04-12  6:14 ` Eli Zaretskii
  0 siblings, 1 reply; 5+ messages in thread
From: Kevin Ryde @ 2017-04-12  5:02 UTC (permalink / raw)
  To: 26458

Under X and motif mwm window manager, closing emacs using the window
manager does not save modified buffers, and sometimes aborts.  Eg.

    emacs -Q /tmp/x
    Ret                   # so modified
    mwm Alt-f4 "close"
    =>
    Connection lost to X server ':0.0'
    file /tmp/x not saved   

where I hoped to get the usual query save before exit as by C-x C-c or
menu File/Quit.

(Generally X clients can treat WM_DELETE_WINDOW message the same as
other user keyboard or menu input asking for an orderly shutdown -- so
interaction and display continuing as normal for however long.)


Sometimes WM_DELETE_WINDOW can make emacs abort, depending what the kill
hooks do.  For example foo.el containing

    (add-hook 'kill-emacs-hook
              (lambda ()
                (sit-for 5)))

then

    emacs -Q -l foo.el
    mwm Alt-f4 "close"
    =>
    Connection lost to X server ':0.0'
    Fatal error 6: Aborted
    Backtrace:
    emacs[0x8144f1c]
    ...
    /usr/lib/i386-linux-gnu/libX11.so.6(_XIOError+0x5d)[0xb7345c2d]
    /usr/lib/i386-linux-gnu/libX11.so.6(_XEventsQueued+0x96)[0xb7343266]
    /usr/lib/i386-linux-gnu/libX11.so.6(XPending+0x62)[0xb7334752]
    ...

where I hoped it would not abort, and preferably not say a connection
lost message.  (Don't mind exactly when the window is closed in this
case though, since kill-emacs-hook is not for interacting with the
user.)


xmon shows emacs gets ClientMessage WM_DELETE_WINDOW as expected, and a
WM_SAVE_YOURSELF.  Emacs does a bit of drawing and then closes the
connection and aborts almost immediately, much sooner than 5 seconds
sit-for.

xmon of "save buffer" above similarly, but emacs starts doing something
creating a window.  Perhaps it's the start of the save-changes dialog,
but it doesn't appear on screen.

I tried kill-emacs-query-functions, and the connection close seems to be
before it has a chance to ask user yes-or-no-p or similar.

I first struck the abort with save-place saving places on exit (no
buffers needing save, just save-place).  But since abort happens just
with a sit-for I presume it's only something about time taken, not
anything specific save-place does.



In GNU Emacs 25.1.1 (i686-pc-linux-gnu, X toolkit, Xaw3d scroll bars)
 of 2017-01-01, modified by Debian built on x86-csail-01
Windowing system distributor 'The X.Org Foundation', version 11.0.11900000
Configured using:
 'configure --build i686-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/emacs25:/etc/emacs:/usr/local/share/emacs/25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --build i686-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/emacs25:/etc/emacs:/usr/local/share/emacs/25.1/site-lisp:/usr/local/share/emacs/site-lisp:/usr/share/emacs/25.1/site-lisp:/usr/share/emacs/site-lisp
 --with-sound=alsa --with-x=yes --with-x-toolkit=lucid
 --with-toolkit-scroll-bars --without-gconf --without-gsettings
 'CFLAGS=-g -O2
 -fdebug-prefix-map=/build/emacs25-H2ebel/emacs25-25.1+1=. -fstack-protector-strong
 -Wformat -Werror=format-security -Wall' 'CPPFLAGS=-Wdate-time
 -D_FORTIFY_SOURCE=2' LDFLAGS=-Wl,-z,relro'

Configured features:
XAW3D XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS NOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB
TOOLKIT_SCROLL_BARS LUCID X11

Important settings:
  value of $LANG: en_AU.iso88591
  locale-coding-system: iso-latin-1-unix





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

end of thread, other threads:[~2017-04-17  6:42 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-12  5:02 bug#26458: 25.1; abort on X close window Kevin Ryde
2017-04-12  6:14 ` Eli Zaretskii
2017-04-14  3:56   ` Kevin Ryde
2017-04-14  7:40     ` Eli Zaretskii
2017-04-17  6:42       ` Kevin Ryde

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).