[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/exwm 6eaa0301f1 04/10: Correctly stop the subordinate E
From: |
Adrián Medraño Calvo |
Subject: |
[elpa] externals/exwm 6eaa0301f1 04/10: Correctly stop the subordinate Emacs daemon |
Date: |
Mon, 8 Jan 2024 11:05:45 -0500 (EST) |
branch: externals/exwm
commit 6eaa0301f17898449827c778d52456800f776e65
Author: Steven Allen <steven@stebalien.com>
Commit: Steven Allen <steven@stebalien.com>
Correctly stop the subordinate Emacs daemon
This patch starts Emacs as a foreground daemon (so it can accurately be
killed) and terminates it by sending a signal (because
'server-force-delete' stops the local server, not the named server).
* exwm.el (exwm--server-timeout): The time to politely wait for the
subordinate server to exit before killing it.
(exwm--server-stop): Send SIGTERM to the subordinate process instead of
using 'server-force-delete'.
(exwm--server-eval-at): Prevent Emacs from forking so we can manage it
as a subprocess.
---
exwm.el | 14 +++++++++++---
1 file changed, 11 insertions(+), 3 deletions(-)
diff --git a/exwm.el b/exwm.el
index 5745533720..5e8489fee6 100644
--- a/exwm.el
+++ b/exwm.el
@@ -5,7 +5,7 @@
;; Author: Chris Feng <chris.w.feng@gmail.com>
;; Maintainer: Adrián Medraño Calvo <adrian@medranocalvo.com>
;; Version: 0.28
-;; Package-Requires: ((xelb "0.18"))
+;; Package-Requires: ((emacs "26.1") (xelb "0.18"))
;; Keywords: unix
;; URL: https://github.com/ch11ng/exwm
@@ -110,6 +110,9 @@
(defconst exwm--server-name "server-exwm"
"Name of the subordinate Emacs server.")
+(defvar exwm--server-timeout 1
+ "Number of seconds to wait for the subordinate Emacs server to exit before
killing it.")
+
(defvar exwm--server-process nil "Process of the subordinate Emacs server.")
(defun exwm-reset ()
@@ -999,8 +1002,13 @@ FRAME, if given, indicates the X display EXWM should
manage."
(defun exwm--server-stop ()
"Stop the subordinate Emacs server."
(exwm--log)
- (server-force-delete exwm--server-name)
(when exwm--server-process
+ (when (process-live-p exwm--server-process)
+ (cl-loop
+ initially (signal-process exwm--server-process 'TERM)
+ while (process-live-p exwm--server-process)
+ repeat (* 10 exwm--server-timeout)
+ do (sit-for 0.1)))
(delete-process exwm--server-process)
(setq exwm--server-process nil)))
@@ -1017,7 +1025,7 @@ FUNCTION is the function to be evaluated, ARGS are the
arguments."
(car command-line-args) ;The executable file
"-d" (frame-parameter nil 'display)
"-Q"
- (concat "--daemon=" exwm--server-name)
+ (concat "--fg-daemon=" exwm--server-name)
"--eval"
;; Create an invisible frame
"(make-frame '((window-system . x) (visibility)))"))
- [elpa] externals/exwm updated (56db521a3e -> 798dc60a9b), Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 6eaa0301f1 04/10: Correctly stop the subordinate Emacs daemon,
Adrián Medraño Calvo <=
- [elpa] externals/exwm 0b23607ca3 01/10: Remove exwm-cm, Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 50681727e3 02/10: Add message-box and message-or-box to exwm-blocking-subrs (fix #874), Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 9b5e4dc1c0 08/10: Merge branch 'minad.github.com/remove-cm' into externals/exwm, Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 64d324e6ea 06/10: Merge branch 'Stebalien.github.com/steb/fix-subordinate-daemon' into externals/exwm, Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 01ae286e49 07/10: Merge branch 'Stebalien.github.com/steb/passthrough-input' into externals/exwm, Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 8ea607ba85 03/10: Passthrough input when explicitly reading events and keys, Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 92fbafee6c 05/10: Update copyright year to 2024, Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 4192762223 09/10: Merge branch 'minad.github.com/blocking-subrs' into externals/exwm, Adrián Medraño Calvo, 2024/01/08
- [elpa] externals/exwm 798dc60a9b 10/10: ; Shorten docstrings, Adrián Medraño Calvo, 2024/01/08