From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 055001582EF for ; Sun, 09 Mar 2025 20:48:07 +0000 (UTC) Received: from lists.gentoo.org (bobolink.gentoo.org [140.211.166.189]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: relay-lists.gentoo.org@gentoo.org) by smtp.gentoo.org (Postfix) with ESMTPSA id C350D34311A for ; Sun, 09 Mar 2025 20:48:06 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id C8430110370; Sun, 09 Mar 2025 20:48:05 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bobolink.gentoo.org (Postfix) with ESMTPS id BD32F110370 for ; Sun, 09 Mar 2025 20:48:05 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 746423430D0 for ; Sun, 09 Mar 2025 20:48:05 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 10274122C for ; Sun, 09 Mar 2025 20:48:04 +0000 (UTC) From: "Ulrich Müller" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Ulrich Müller" Message-ID: <1741549162.0381452423e624e26fc554f759ea84d6f47a8143.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:emacs-daemon commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: 10emacs-daemon-gentoo.el ChangeLog Makefile emacs-wrapper.sh emacs.conf emacs.rc X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 0381452423e624e26fc554f759ea84d6f47a8143 X-VCS-Branch: emacs-daemon Date: Sun, 09 Mar 2025 20:48:04 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 0829ad21-d6b8-49c7-a3f5-f2588e62fa72 X-Archives-Hash: 73a4b98f62a386c8afc366d1b07941e4 commit: 0381452423e624e26fc554f759ea84d6f47a8143 Author: Ulrich Müller gentoo org> AuthorDate: Sun Mar 9 19:39:22 2025 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Sun Mar 9 19:39:22 2025 +0000 URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=03814524 Wrapper and site-init moved to emacs-common * emacs-wrapper.sh: * 10emacs-daemon-gentoo.el: Files removed. These have been moved to the emacs-common package. * Makefile (DISTFILES): Updated. Signed-off-by: Ulrich Müller gentoo.org> 10emacs-daemon-gentoo.el | 26 -------------------------- ChangeLog | 7 +++++++ Makefile | 3 +-- emacs-wrapper.sh | 3 --- emacs.conf | 6 ++---- emacs.rc | 42 +++++++++++++++++++++--------------------- 6 files changed, 31 insertions(+), 56 deletions(-) diff --git a/10emacs-daemon-gentoo.el b/10emacs-daemon-gentoo.el deleted file mode 100644 index b878eb4..0000000 --- a/10emacs-daemon-gentoo.el +++ /dev/null @@ -1,26 +0,0 @@ -;;; emacs-daemon site-lisp configuration - -;; Copyright 2008-2025 Gentoo Authors -;; Distributed under the terms of the GNU General Public License v2 or later - -(and - (daemonp) - (null after-init-time) - (let* ((file (concat "/var/run/emacs/" (user-login-name) "/emacs.pid")) - (pid (if (file-readable-p file) - ;; Get process id from file - (with-temp-buffer - (ignore-errors - (insert-file-contents-literally file nil 0 100) - (and (looking-at "[0-9]+") - (string-to-number (match-string 0)))))))) - (when (and (integerp pid) - (string-match - "emacs" (or (cdr (assq 'comm (process-attributes pid))) "")) - (/= pid (emacs-pid))) - ;; If another Emacs daemon is already running for this user, - ;; then we would steal its server socket. So we better die. - (message "Another Emacs daemon is already running at process id %d" pid) - (kill-emacs)) - ;; Restart the server if signal SIGUSR1 is received. - (define-key special-event-map [sigusr1] #'server-start))) diff --git a/ChangeLog b/ChangeLog index bb62705..35823a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-03-09 Ulrich Müller + + * emacs-wrapper.sh: + * 10emacs-daemon-gentoo.el: Files removed. These have been moved + to the emacs-common package. + * Makefile (DISTFILES): Updated. + 2025-03-07 Ulrich Müller * emacs.rc (checkconfig): Make running Emacs more robust. diff --git a/Makefile b/Makefile index f180383..2e866ae 100644 --- a/Makefile +++ b/Makefile @@ -6,8 +6,7 @@ PV = $(shell sed '/^[ \t]*\* .*[Vv]ersion/!d;s/[^0-9.]*\([0-9.]*\).*/\1/;q' \ ChangeLog) P = $(PN)-$(PV) -DISTFILES = README ChangeLog emacs.rc emacs.conf emacs-wrapper.sh \ - 10emacs-daemon-gentoo.el +DISTFILES = README ChangeLog emacs.rc emacs.conf .PHONY: all dist clean diff --git a/emacs-wrapper.sh b/emacs-wrapper.sh deleted file mode 100644 index 22c8cd9..0000000 --- a/emacs-wrapper.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash -# Start Emacs with a login shell wrapper to read the user's profile -exec -l "${SHELL}" -c "exec \"${EMACS}\" $*" diff --git a/emacs.conf b/emacs.conf index b962fd9..54a4880 100644 --- a/emacs.conf +++ b/emacs.conf @@ -8,10 +8,8 @@ # Options to pass to emacs. Don't remove "--fg-daemon". #EMACS_OPTS="--fg-daemon" -# Emacs detaches and exits the parent process only after loading the -# user's .emacs (initialisation). Anything may happen there, so we use -# a wrapper script to ensure that the Emacs daemon properly starts. -# This also executes a login shell to read the user's profile. #246460 +# Wrapper script for starting Emacs. This executes a login shell, +# in order to read the user's profile. #246460 #EMACS_START="/usr/libexec/emacs/emacs-wrapper.sh" # Optionally, you may execute a custom script before stopping the diff --git a/emacs.rc b/emacs.rc index 35a76f9..8302aa8 100644 --- a/emacs.rc +++ b/emacs.rc @@ -2,11 +2,11 @@ # Copyright 2008-2025 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 or later -: ${EMACS:=/usr/bin/emacs} -: ${EMACS_OPTS:=--fg-daemon} -: ${EMACS_SHELL=/bin/bash} -: ${EMACS_START:=/usr/libexec/emacs/emacs-wrapper.sh} -: ${EMACS_TIMEOUT:=30} +: "${EMACS:=/usr/bin/emacs}" +: "${EMACS_OPTS:=--fg-daemon}" +: "${EMACS_SHELL=/bin/bash}" +: "${EMACS_START:=/usr/libexec/emacs/emacs-wrapper.sh}" +: "${EMACS_TIMEOUT:=30}" USER=${RC_SVCNAME##*.} PIDFILE_DIR=/var/run/emacs/${USER} PIDFILE=${PIDFILE_DIR}/emacs.pid @@ -20,14 +20,14 @@ depend() { checkconfig() { if [ "${USER}" = "${RC_SVCNAME}" ]; then - eerror "You have to create an init script for each user:" - eerror "ln -s emacs /etc/init.d/emacs." - return 1 + eerror "You have to create an init script for each user:" + eerror "ln -s emacs /etc/init.d/emacs." + return 1 fi if ! id -u "${USER}" >/dev/null; then - eerror "${USER}: No such user" - return 1 + eerror "${USER}: No such user" + return 1 fi # EMACS could be a microemacs variant that ignores the -batch option @@ -35,10 +35,10 @@ checkconfig() { # 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))"