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 68E011582EF for ; Fri, 07 Mar 2025 16:58:59 +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 50CD634076D for ; Fri, 07 Mar 2025 16:58:59 +0000 (UTC) Received: from bobolink.gentoo.org (localhost [127.0.0.1]) by bobolink.gentoo.org (Postfix) with ESMTP id 4CF6311027C; Fri, 07 Mar 2025 16:58:58 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 4017111027C for ; Fri, 07 Mar 2025 16:58:58 +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 E0FB634076D for ; Fri, 07 Mar 2025 16:58:57 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 7A9242893 for ; Fri, 07 Mar 2025 16:58:56 +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: <1741366663.4c751e364e093f4632240fc30de89d2e34f616da.ulm@gentoo> Subject: [gentoo-commits] proj/emacs-tools:emacs-daemon commit in: / X-VCS-Repository: proj/emacs-tools X-VCS-Files: ChangeLog emacs.rc X-VCS-Directories: / X-VCS-Committer: ulm X-VCS-Committer-Name: Ulrich Müller X-VCS-Revision: 4c751e364e093f4632240fc30de89d2e34f616da X-VCS-Branch: emacs-daemon Date: Fri, 07 Mar 2025 16:58:56 +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: 178f1ad9-0044-4607-9c54-3a63a84bb5a3 X-Archives-Hash: 9122c718ac989888c55dcfadd2b978ea commit: 4c751e364e093f4632240fc30de89d2e34f616da Author: Ulrich Müller gentoo org> AuthorDate: Fri Mar 7 16:57:43 2025 +0000 Commit: Ulrich Müller gentoo org> CommitDate: Fri Mar 7 16:57:43 2025 +0000 URL: https://gitweb.gentoo.org/proj/emacs-tools.git/commit/?id=4c751e36 Make running Emacs more robust * emacs.rc (checkconfig): Make running Emacs more robust. Taken from elisp-common.eclass. Signed-off-by: Ulrich Müller gentoo.org> ChangeLog | 5 +++++ emacs.rc | 8 ++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 82c0f88..bb62705 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-03-07 Ulrich Müller + + * emacs.rc (checkconfig): Make running Emacs more robust. + Taken from elisp-common.eclass. + 2025-03-05 Ulrich Müller * Version 0.23 released. diff --git a/emacs.rc b/emacs.rc index 449e45b..35a76f9 100644 --- a/emacs.rc +++ b/emacs.rc @@ -30,8 +30,12 @@ checkconfig() { return 1 fi - local has_daemon=$(${EMACS} -batch -q --no-site-file \ - --eval "(princ (fboundp 'daemonp))") + # 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))"