From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stuart Hickinbottom Subject: [PATCH] Fix org-clock evaluation startup hang on Windows Date: Wed, 29 Aug 2012 12:25:39 +0100 Message-ID: <503DFC33.70703@hickinbottom.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([208.118.235.92]:54221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6gPA-0005VK-Fo for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 07:25:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1T6gP4-0005MW-MP for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 07:25:52 -0400 Received: from anchor-post-3.mail.demon.net ([195.173.77.134]:59521) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1T6gP4-0005LQ-B8 for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 07:25:46 -0400 Received: from hickinbottom.demon.co.uk ([80.177.102.168] helo=discovery.hickinbottom.com) by anchor-post-3.mail.demon.net with esmtp (Exim 4.69) id 1T6gOy-0001QU-ny for emacs-orgmode@gnu.org; Wed, 29 Aug 2012 11:25:40 +0000 Received: from leonov2.hickinbottom.com (localhost [127.0.0.1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by discovery.hickinbottom.com (Postfix) with ESMTPS id 0E6AB2098F for ; Wed, 29 Aug 2012 12:25:40 +0100 (BST) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org * 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