commit:     04343fac445aa78f3a5e3851f6dc5095313eb178
Author:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Sat Jun 28 17:47:24 2025 +0000
Commit:     Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Sat Jun 28 17:47:24 2025 +0000
URL:        https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=04343fac

Posixify the init script

* emacs.initd (start_pre): POSIX shell does not support "local".

Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>

 ChangeLog   | 4 ++++
 emacs.initd | 5 ++---
 2 files changed, 6 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index e9b1c1e..a5088d8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2025-06-28  Ulrich Müller  <[email protected]>
+
+       * emacs.initd (start_pre): POSIX shell does not support "local".
+
 2025-03-17  Ulrich Müller  <[email protected]>
 
        * Makefile (DISTFILES): Add ChangeLog.

diff --git a/emacs.initd b/emacs.initd
index 2a7c145..392ae66 100644
--- a/emacs.initd
+++ b/emacs.initd
@@ -23,9 +23,8 @@ start_pre() {
     # and would therefore hang, waiting for user interaction.
     # Redirecting stdin and unsetting TERM and DISPLAY will cause most
     # of them to exit with an error.
-    local has_daemon=$(unset TERM DISPLAY; ${EMACS} -batch -q --no-site-file \
-        --eval "(princ (fboundp 'daemonp))" </dev/null)
-    if [ "${has_daemon}" != t ]; then
+    if [ "$(unset TERM DISPLAY; ${EMACS} -batch -q --no-site-file \
+            --eval "(princ (fboundp 'daemonp))" </dev/null)" != t ]; then
         eerror "${EMACS} does not support running as a daemon"
         return 1
     fi

Reply via email to