]> git.eshelyaron.com Git - emacs.git/commitdiff
; Remove dead code from 'server-stop-automatically--handle-delete-frame'
authorJim Porter <jporterbugs@gmail.com>
Fri, 2 Dec 2022 20:15:46 +0000 (12:15 -0800)
committerJim Porter <jporterbugs@gmail.com>
Tue, 6 Dec 2022 22:11:10 +0000 (14:11 -0800)
* lisp/server.el (server-stop-automatically--handle-delete-frame):
Since 'this-command' is never 'save-buffers-kill-terminal' in this
function, we can remove the second 'if' block and it's then-form,
leaving only the else-form.  Additionally, remove the 'delete-frame'
call; it's not necessary, since we just killed Emacs on the prior
line.

lisp/server.el

index 7e713eaecded79a6dc8b4bdf8d2b385ad86328d5..aa62b25a891937e678317e70bbe5ad4b9649381f 100644 (file)
@@ -1820,26 +1820,10 @@ only these files will be asked to be saved."
 
 (defun server-stop-automatically--handle-delete-frame (frame)
   "Handle deletion of FRAME when `server-stop-automatically' is used."
-  (when server-stop-automatically
-    (if (if (and (processp (frame-parameter frame 'client))
-                (eq this-command 'save-buffers-kill-terminal))
-           (progn
-             (dolist (f (frame-list))
-               (when (and (eq (frame-parameter frame 'client)
-                              (frame-parameter f 'client))
-                          (not (eq frame f)))
-                 (set-frame-parameter f 'client nil)
-                 (let ((server-stop-automatically nil))
-                   (delete-frame f))))
-             (if (cddr (frame-list))
-                 (let ((server-stop-automatically nil))
-                   (delete-frame frame)
-                   nil)
-               t))
-         (null (cddr (frame-list))))
-       (let ((server-stop-automatically nil))
-         (save-buffers-kill-emacs)
-         (delete-frame frame)))))
+  (when (and server-stop-automatically
+             (null (cddr (frame-list))))
+    (let ((server-stop-automatically nil))
+      (save-buffers-kill-emacs))))
 
 (defun server-stop-automatically--maybe-kill-emacs ()
   "Handle closing of Emacs daemon when `server-stop-automatically' is used."