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).
This commit is contained in:
Bastien Guerry 2012-07-28 01:42:59 +02:00
parent 725a6c6a3d
commit f398b9ee53
1 changed files with 3 additions and 9 deletions

View File

@ -1009,15 +1009,9 @@ This routine returns a floating point number."
(cond (cond
((eq system-type 'darwin) ((eq system-type 'darwin)
(org-mac-idle-seconds)) (org-mac-idle-seconds))
((and ((eq window-system 'x)
(eq window-system 'x) (max (org-x11-idle-seconds) (org-emacs-idle-seconds)))
;; Check that x11idle exists (t (org-emacs-idle-seconds))))
(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))))
(defvar org-clock-user-idle-seconds) (defvar org-clock-user-idle-seconds)