From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Calderon Subject: Patch for org-clock.el Date: Wed, 18 Jul 2012 16:40:29 -0400 Message-ID: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([208.118.235.92]:42183) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srb3E-0006If-1W for emacs-orgmode@gnu.org; Wed, 18 Jul 2012 16:40:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Srb3C-0000bT-Iy for emacs-orgmode@gnu.org; Wed, 18 Jul 2012 16:40:51 -0400 Received: from mail-ob0-f169.google.com ([209.85.214.169]:49794) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Srb3C-0000bJ-EL for emacs-orgmode@gnu.org; Wed, 18 Jul 2012 16:40:50 -0400 Received: by obhx4 with SMTP id x4so3339214obh.0 for ; Wed, 18 Jul 2012 13:40:49 -0700 (PDT) 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 >From c8979b360749ecd66e298fdbdbc2450668be3a20 Mon Sep 17 00:00:00 2001 From: Nicolas Calderon Asselin Date: Wed, 18 Jul 2012 14:58:31 -0400 Subject: [PATCH 2/2] Added checks to determine which idle time to use * lisp/org-clock.el (org-clock-idle-time): Org-mode assumed that x11idle was an available command, and returned an idle time of 0 if it was not (never idle). Added checks so that org-idle-time will come from emacs' own current-idle-time if x11idle cannot be found or if it cannot retrieve the idle time from X11 TINYCHANGE --- lisp/org-clock.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 162ee07..a913014 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1010,7 +1010,12 @@ This routine returns a floating point number." (cond ((eq system-type 'darwin) (org-mac-idle-seconds)) - ((eq window-system 'x) + ((and + (eq window-system 'x) + ;; Check that x11idle exists + (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)) (org-x11-idle-seconds)) (t (org-emacs-idle-seconds)))) -- 1.7.10.4