From: "Ulrich Müller" <ulm@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] proj/emacs-tools:emacs-common commit in: /
Date: Fri, 07 Mar 2025 18:35:40 +0000 (UTC) [thread overview]
Message-ID: <1741367544.ee79082103da7e8090136b6ef4867bff7ddf5521.ulm@gentoo> (raw)
commit: ee79082103da7e8090136b6ef4867bff7ddf5521
Author: Ulrich Müller <ulm <AT> gentoo <DOT> org>
AuthorDate: Fri Mar 7 17:12:24 2025 +0000
Commit: Ulrich Müller <ulm <AT> gentoo <DOT> org>
CommitDate: Fri Mar 7 17:12:24 2025 +0000
URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=ee790821
Add user initd file for OpenRC
* emacs.initd: New file. Merged version of the user initd file
attached to bug 950671 and emacs.rc from the emacs-daemon package.
Thanks to Anna (navi) Figueiredo Gomes.
* Makefile (DISTFILES): Add it.
Bug: https://bugs.gentoo.org/950671
Signed-off-by: Anna (navi) Figueiredo Gomes <navi <AT> vlhl.dev>
Signed-off-by: Ulrich Müller <ulm <AT> gentoo.org>
ChangeLog | 5 +++++
Makefile | 7 ++++---
emacs.initd | 29 +++++++++++++++++++++++++++++
3 files changed, 38 insertions(+), 3 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index 565945f..53d2f73 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2025-03-07 Ulrich Müller <ulm@gentoo.org>
+ * emacs.initd: New file. Merged version of the user initd file
+ attached to bug 950671 and emacs.rc from the emacs-daemon package.
+ Thanks to Anna (navi) Figueiredo Gomes.
+ * Makefile (DISTFILES): Add it.
+
* emacsclient.desktop (MimeType): Add org-protocol, from Emacs 30.
Bug 950674.
diff --git a/Makefile b/Makefile
index 65da9b7..9a4fbac 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-# Copyright 2007-2023 Gentoo Authors
+# Copyright 2007-2025 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2 or later
PN = emacs-common
@@ -14,8 +14,9 @@ ICONFILES = sink.png \
emacs25_16.png emacs25_24.png emacs25_32.png emacs25_48.png \
emacs25_128.png emacs25.svg
GSCHEMAFILES = org.gnu.emacs.defaults.gschema.xml
-DISTFILES = site-start.el site-gentoo.el subdirs.el.in $(DESKTOPFILES) \
- $(addprefix icons/,COPYRIGHT.icons $(ICONFILES)) $(GSCHEMAFILES)
+DISTFILES = site-start.el site-gentoo.el subdirs.el.in emacs.initd \
+ $(DESKTOPFILES) $(addprefix icons/,COPYRIGHT.icons $(ICONFILES)) \
+ $(GSCHEMAFILES)
.PHONY: all dist clean $(DESKTOPFILES)
diff --git a/emacs.initd b/emacs.initd
new file mode 100644
index 0000000..f71b4c2
--- /dev/null
+++ b/emacs.initd
@@ -0,0 +1,29 @@
+#!/sbin/openrc-run
+# Copyright 2008-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2 or later
+
+: ${EMACS:=/usr/bin/emacs}
+
+description="Start an Emacs server running in the background"
+
+supervisor=supervise-daemon
+command="${EMACS}"
+command_args="${EMACS_OPTS}"
+command_args_foreground="--fg-daemon"
+
+depend() {
+ after dbus
+}
+
+start_pre() {
+ # EMACS could be a microemacs variant that ignores the -batch option
+ # 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
+ eerror "${EMACS} does not support running as a daemon"
+ return 1
+ fi
+}
next reply other threads:[~2025-03-07 18:35 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-07 18:35 Ulrich Müller [this message]
-- strict thread matches above, loose matches on Subject: below --
2025-03-17 21:19 [gentoo-commits] proj/emacs-tools:emacs-common commit in: / Ulrich Müller
2025-03-17 9:52 Ulrich Müller
2025-03-17 9:52 Ulrich Müller
2025-03-10 12:03 Ulrich Müller
2025-03-09 20:47 Ulrich Müller
2025-03-09 20:47 Ulrich Müller
2025-03-08 16:36 Ulrich Müller
2025-03-08 16:32 Ulrich Müller
2025-03-08 8:44 Ulrich Müller
2025-03-08 8:39 Ulrich Müller
2025-03-08 8:18 Ulrich Müller
2025-03-08 6:20 Ulrich Müller
2025-03-07 6:20 Ulrich Müller
2024-05-05 12:43 Ulrich Müller
2023-09-13 7:29 Ulrich Müller
2023-09-12 16:21 Ulrich Müller
2023-07-24 16:07 Ulrich Müller
2023-07-24 16:07 Ulrich Müller
2021-03-22 8:34 Ulrich Müller
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1741367544.ee79082103da7e8090136b6ef4867bff7ddf5521.ulm@gentoo \
--to=ulm@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox