unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Kevin Ryde <user42_kevin@yahoo.com.au>
To: 26458@debbugs.gnu.org
Subject: bug#26458: 25.1; abort on X close window
Date: Wed, 12 Apr 2017 15:02:52 +1000	[thread overview]
Message-ID: <87r30yusjn.fsf@blah.blah> (raw)

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





             reply	other threads:[~2017-04-12  5:02 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-12  5:02 Kevin Ryde [this message]
2017-04-12  6:14 ` bug#26458: 25.1; abort on X close window Eli Zaretskii
2017-04-14  3:56   ` Kevin Ryde
2017-04-14  7:40     ` Eli Zaretskii
2017-04-17  6:42       ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87r30yusjn.fsf@blah.blah \
    --to=user42_kevin@yahoo.com.au \
    --cc=26458@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).