emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix org-clock evaluation startup hang on Windows
@ 2012-08-29 11:25 Stuart Hickinbottom
  2012-08-29 17:42 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Stuart Hickinbottom @ 2012-08-29 11:25 UTC (permalink / raw)
  To: emacs-orgmode

* 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
---
 lisp/org-clock.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index 263f2cb..91f1c63 100644
--- a/lisp/org-clock.el
+++ b/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)))
 
-- 
1.7.11.4


-- 
Stuart Hickinbottom

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] Fix org-clock evaluation startup hang on Windows
  2012-08-29 11:25 [PATCH] Fix org-clock evaluation startup hang on Windows Stuart Hickinbottom
@ 2012-08-29 17:42 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2012-08-29 17:42 UTC (permalink / raw)
  To: Stuart Hickinbottom; +Cc: emacs-orgmode

Hi Stuart,

I applied your patch.

Thanks a lot for catching this and for the clear explanations!

Best,

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-08-29 17:41 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-29 11:25 [PATCH] Fix org-clock evaluation startup hang on Windows Stuart Hickinbottom
2012-08-29 17:42 ` Bastien

Code repositories for project(s) associated with this inbox:

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).