>>>>> On Sun, 09 Nov 2025, Ulrich Müller wrote: > Forwarding: > - Gentoo bug <https://bugs.gentoo.org/965834> > - Emacs bug <https://bugs.gnu.org/79801>
> Building of Emacs fails when the SHELL environment variable points to a > non-existent file: > [...] > AFAICS the problem is triggered by this code in org/org-clock.el: > [...] Attached patch fixes the problem for me. Tested with x11-misc/xprintidle-2.1 on Gentoo. I've left the test for MS-Windows in place for now. In principle it could be removed because command.com is no longer involved.
>From b466b474d261dce26ef2146abfb94a41a875a1f5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ulrich=20M=C3=BCller?= <[email protected]> Date: Sun, 9 Nov 2025 22:36:31 +0100 Subject: [PATCH] org-clock: Avoid call-process-shell-command * lisp/org-clock.el (org-x11idle-exists-p): Use executable-find and call-process instead of call-process-shell-command. The latter relies on the SHELL environment variable, which may break byte-compilation. See Emacs bug #79801. --- lisp/org-clock.el | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 39022af64..0c9f85b26 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1290,14 +1290,11 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling (defvar org-x11idle-exists-p ;; Check that x11idle exists. But don't do that on DOS/Windows, - ;; since the command definitely does NOT exist there, and invoking - ;; COMMAND.COM on MS-Windows is a bad idea -- it hangs. + ;; since the command definitely does NOT exist there. (and (null (memq system-type '(windows-nt ms-dos))) - (eq 0 (call-process-shell-command - (format "command -v %s" org-clock-x11idle-program-name))) + (executable-find org-clock-x11idle-program-name) ;; Check that x11idle can retrieve the idle time - ;; FIXME: Why "..-shell-command" rather than just `call-process'? - (eq 0 (call-process-shell-command org-clock-x11idle-program-name)))) + (eq 0 (call-process org-clock-x11idle-program-name)))) (defun org-x11-idle-seconds () "Return the current X11 idle time in seconds." -- 2.51.2
