瀏覽代碼

Fix org-clock evaluation startup hang on Windows

* lisp/org-clock.el (org-x11idle-exists-p): Only shell out when running
on X.

The definition of this variable currently executes "command" via the
shell during evaluation, irrespective of the platform on which
Org-mode is running. Unfortunately, on Windows, this matches the
"command.com" NT Virtual DOS Machine executable and so this gets
launched, but this is a shell and therefore sits there waiting for
user input and never returns. The net result is that Emacs will hang
on Windows when evaluating org-clock.el with the ntdvm.exe process
spinning at 100%.

The simple fix is to check that the platform is X before trying to
deal with the "x11idle" external process.

TINYCHANGE
Stuart Hickinbottom 12 年之前
父節點
當前提交
4f5bd2522e
共有 1 個文件被更改,包括 2 次插入1 次删除
  1. 2 1
      lisp/org-clock.el

+ 2 - 1
lisp/org-clock.el

@@ -1001,7 +1001,8 @@ If `only-dangling-p' is non-nil, only ask to resolve dangling
 
 (defvar org-x11idle-exists-p
   ;; Check that x11idle exists
-  (and (eq (call-process-shell-command "command" nil nil nil "-v" "x11idle") 0)
+  (and (eq window-system 'x)
+       (eq (call-process-shell-command "command" nil nil nil "-v" "x11idle") 0)
        ;; Check that x11idle can retrieve the idle time
        (eq (call-process-shell-command "x11idle" nil nil nil) 0)))