diff options
author | krick <antipin.konstantin@googlemail.com> | 2009-05-28 01:10:27 +0200 |
---|---|---|
committer | krick <antipin.konstantin@googlemail.com> | 2009-05-28 01:10:27 +0200 |
commit | 59c6574c0519178a2a17fdbe043493542bee69dd (patch) | |
tree | cdb0d56eb1e532f344ce08daf2858efb6b4383bf | |
parent | 8c3ffc625977bea245a868921ceda384040d765a (diff) | |
download | org-mode-59c6574c0519178a2a17fdbe043493542bee69dd.tar.gz |
org-clock-sound could be
* nil. No sound played.
* any string, that is not a file. Make a beep
* file name. Emacs tries to play it with aplay, if available.
If not, use standard emacs play-sound-file function.
-rw-r--r-- | lisp/org-clock.el | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/lisp/org-clock.el b/lisp/org-clock.el index 30379a0..ab60117 100644 --- a/lisp/org-clock.el +++ b/lisp/org-clock.el @@ -150,8 +150,11 @@ All this depends on running `org-clock-persistence-insinuate' in .emacs" (defcustom org-clock-sound nil - "Sound that will play once timer is expired. -If you don't have alsa, it is better to be .wav file" + "Sound that will used for notifications. +Possible values: +* nil. No sound played. +* any string, that is not a file. Make a beep. +* file name. If you don't have alsa, it is better to be .wav file" :group 'org-clock :type 'string ) @@ -363,15 +366,18 @@ Notification is shown only once." (message notification) )) - + (play-sound-file org-clock-sound) + (message "%s is not a file" org-clock-sound) + ) (defun org-clock-play-sound () - "Play sound. + "Play sound. Controlled by org-clock-sound. Use alsa's aplay tool if available." - (if (not (eq nil org-clock-sound)) + (if (and (not (eq org-clock-sound "")) + (file-exists-p org-clock-sound)) (if (program-exists "aplay") (start-process "org-clock-play-notification" nil "aplay" org-clock-sound) (play-sound-file org-clock-sound)) - (progn (beep t) (beep t))) + (progn (beep t) (beep t))c) ) (defun program-exists (program-name) |