From 008689cc79d31fa91815652fbfda479ffef3dacb Mon Sep 17 00:00:00 2001 From: Bastien Guerry Date: Sat, 28 Apr 2012 23:43:10 +0200 Subject: [PATCH] org-clock.el: Use `executable-find' instead of `org-program-exists'. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit * org-clock.el (org-program-exists): Remove. (org-show-notification, org-clock-play-sound): Use `executable-find' instead of `org-program-exists'. Thanks to Sébastien Vauban for pointing this. --- lisp/org-clock.el | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 84a53006b..ad1e87cd0 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -670,7 +670,7 @@ use libnotify if available, or fall back on a message." ;; FIXME how to link to the Org icon? ;; :app-icon "~/.emacs.d/icons/mail.png" :urgency 'low)) - ((org-program-exists "notify-send") + ((executable-find "notify-send") (start-process "emacs-timer-notification" nil "notify-send" notification)) ;; Maybe the handler will send a message, so only use message as @@ -686,18 +686,13 @@ Use alsa's aplay tool if available." ((stringp org-clock-sound) (let ((file (expand-file-name org-clock-sound))) (if (file-exists-p file) - (if (org-program-exists "aplay") + (if (executable-find "aplay") (start-process "org-clock-play-notification" nil "aplay" file) (condition-case nil (play-sound-file file) (error (beep t) (beep t))))))))) -(defun org-program-exists (program-name) - "Checks whenever we can locate PROGRAM-NAME using the `which' executable." - (if (member system-type '(gnu/linux darwin)) - (= 0 (call-process "which" nil nil nil program-name)))) - (defvar org-clock-mode-line-entry nil "Information for the modeline about the running clock.") -- 2.11.4.GIT