branch: externals/org
commit 4151edf6d3edd2bb8c9051a57ea95d3979fd916d
Author: Ulrich Müller <[email protected]>
Commit: Ihor Radchenko <[email protected]>

    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 39022af647..0c9f85b26b 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."

Reply via email to