mirror of
https://git.savannah.gnu.org/git/emacs/org-mode.git
synced 2025-01-01 11:15:00 +00:00
Expand file name in org-clock-sound before using it
This commit is contained in:
parent
d51a830794
commit
5b65dc2bdf
@ -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.
|
||||
|
@ -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."
|
||||
|
Loading…
Reference in New Issue
Block a user