summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2009-11-02 22:07:08 +0100
committerCarsten Dominik <carsten.dominik@gmail.com>2009-11-02 22:07:08 +0100
commit5b65dc2bdf5751b8a6026ca24cd1886d2cab4fa9 (patch)
treefc8339746723f16d6b5554f54314a66d81e1c1da
parentd51a830794a5449f03dec7a49bfa2fdcc93d4853 (diff)
downloadorg-mode-5b65dc2bdf5751b8a6026ca24cd1886d2cab4fa9.tar.gz
Expand file name in org-clock-sound before using it
-rwxr-xr-xlisp/ChangeLog3
-rw-r--r--lisp/org-clock.el15
2 files changed, 11 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index f165dbc..9f2c71a 100755
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
2009-11-02 Carsten Dominik <carsten.dominik@gmail.com>
+ * org-clock.el (org-clock-play-sound): Expand file in
+ org-clock-sound, to allow ~ for home.
+
* org-remember.el (org-remember-handler): Set
text-before-node-creation even if this already looks like a node,
because the string might be needed on non-org-mode target files.
diff --git a/lisp/org-clock.el b/lisp/org-clock.el
index de4073f..67deb76 100644
--- a/lisp/org-clock.el
+++ b/lisp/org-clock.el
@@ -500,13 +500,14 @@ Use alsa's aplay tool if available."
((not org-clock-sound))
((eq org-clock-sound t) (beep t) (beep t))
((stringp org-clock-sound)
- (if (file-exists-p org-clock-sound)
- (if (org-program-exists "aplay")
- (start-process "org-clock-play-notification" nil
- "aplay" org-clock-sound)
- (condition-case nil
- (play-sound-file org-clock-sound)
- (error (beep t) (beep t))))))))
+ (let ((file (expand-file-name org-clock-sound)))
+ (if (file-exists-p file)
+ (if (org-program-exists "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 and launch it."