From f398b9ee5358422ae171405482f8f34d4f91b6bf Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 28 Jul 2012 01:42:59 +0200 Subject: [PATCH] org-clock.el (org-user-idle-seconds): Simplify. * org-clock.el (org-user-idle-seconds): Simplify. Thanks to Nick Dokos for paving the way (all the way down). --- lisp/org-clock.el | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 66a75593d..add7bc3a2 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -1009,15 +1009,9 @@ This routine returns a floating point number." (cond ((eq system-type 'darwin) (org-mac-idle-seconds)) - ((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)))) + ((eq window-system 'x) + (max (org-x11-idle-seconds) (org-emacs-idle-seconds))) + (t (org-emacs-idle-seconds)))) (defvar org-clock-user-idle-seconds)