changeset 5884:5a93f519accc

If not waiting for C-x #, don't memorise the device, #'gnuserv-edit-files lisp/ChangeLog addition: 2015-04-03 Aidan Kehoe <kehoea@parhasard.net> * gnuserv.el (gnuserv-edit-files): No need to memorise the device created for the sake of C-x #, if the client is not waiting for us. Fixes a bug in the following situation: -- Start gnuserv from an XEmacs within screen -- Call gnuclient with an X11 display available, connecting successfully to that XEmacs and creating an X11 frame -- Then call gnuclient file-name.txt, save the file, then type C-x #; this deletes all the frames on the device, which it shouldn't.
author Aidan Kehoe <kehoea@parhasard.net>
date Fri, 03 Apr 2015 00:27:59 +0100
parents d93195c2c906
children c8bbb32fe124
files lisp/ChangeLog lisp/gnuserv.el
diffstat 2 files changed, 16 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Fri Apr 03 00:15:18 2015 +0100
+++ b/lisp/ChangeLog	Fri Apr 03 00:27:59 2015 +0100
@@ -1,3 +1,15 @@
+2015-04-03  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* gnuserv.el (gnuserv-edit-files):
+	No need to memorise the device created for the sake of C-x #, if
+	the client is not waiting for us.
+	Fixes a bug in the following situation:
+	-- Start gnuserv from an XEmacs within screen
+	-- Call gnuclient with an X11 display available, connecting
+	   successfully to that XEmacs and creating an X11 frame
+	-- Then call gnuclient file-name.txt, save the file, then type C-x
+	#; this deletes all the frames on the device, which it shouldn't.
+
 2015-04-01  Aidan Kehoe  <kehoea@parhasard.net>
 
 	When calling #'string-match with a REGEXP without regular
--- a/lisp/gnuserv.el	Fri Apr 03 00:15:18 2015 +0100
+++ b/lisp/gnuserv.el	Fri Apr 03 00:27:59 2015 +0100
@@ -466,9 +466,6 @@
 				   :frame new-frame)))
       (select-frame frame)
       (setq gnuserv-current-client nil)
-      ;; If the device was created by this client, push it to the list.
-      (and (not (eql old-device-num (length (device-list))))
-	   (push device gnuserv-devices))
       (and (frame-iconified-p frame)
 	   (deiconify-frame frame))
       ;; Visit all the listed files.
@@ -503,6 +500,10 @@
        (t
 	;; Else, the client gets a vote.
 	(push client gnuserv-clients)
+        ;; If the device was created for this client, and we are memorizing
+        ;; the client, memorize the device too.
+        (and (not (eql old-device-num (length (device-list))))
+             (push device gnuserv-devices))
 	;; Explain buffer exit options.  If dest-frame is nil, the
 	;; user can exit via `delete-frame'.  OTOH, if FLAGS are nil
 	;; and there are some buffers, the user can exit via