[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: bug#3385: Bug calling patched appt-display-message
From: |
Davin Pearson |
Subject: |
Re: bug#3385: Bug calling patched appt-display-message |
Date: |
Wed, 27 May 2009 16:31:40 -0700 (PDT) |
User-agent: |
G2/1.0 |
I have narrowed down my code to the smallest possible file that
reproduces the bug:
(require 'appt)
(require 'calendar)
(setq diary-date-forms (cons '(year "-" month "-" day "[^0-9]") diary-
date-forms))
(defun appt-display-message (string mins)
"Bug: why no v"
;;(debug)
(message "*** raw-string=%s mins=%s" string mins)
;;(message "*** string=%s mins=%s" (d-trim-string string) mins)
(let (ptr base-path appt-file num min)
(save-match-data
(if (string-match "[a-z]:/[^ \t\r\n]*" string)
(progn
(setq appt-file (substring string (match-beginning 0)
(match-end 0)))
;;(message "*** appt-file=%s" appt-file)
(when (string-match "\\.wa$" appt-file)
(setq appt-file (concat appt-file "v"))
(message "*** added v")
)
;;(message "*** appt-file=%s" appt-file)
(setq base-path "c:/sound-samples/emacs/")
(if (and appt-file (file-exists-p appt-file))
(play-sound (list 'sound :file appt-file :volume 1.0))
(beep)))
(beep))
;;(assert (>= mins 0))
(setq num (format "c:/sound-samples/emacs/numbers/%d.wav" mins))
(if (file-exists-p num)
(play-sound (list 'sound :file num :volume 1.0))
(play-sound (list 'sound :file (concat base-path
"many.wav") :volume 1.0)))
(if (= 1 mins)
(setq min "c:/sound-samples/emacs/minute-to-go.wav")
(setq min "c:/sound-samples/emacs/minutes-to-go.wav"))
(if (file-exists-p min)
(play-sound (list 'sound :file min :volume 1.0))
(beep)))))
(defun d-appt-activate ()
(interactive)
(appt-activate 1)
(setq appt-audible t)
(setq appt-display-mode-line t)
;;(d-f4)
)
(d-appt-activate)
(provide 'd-appt)
With the following diary file:
Thursday
11:29 cally smeggy.wav
21:00
carrot.wav
(note carrot.wav needs to be on the same line as 21:00)
Here is the result of executing emacs --batch --load d-appt.el
Preparing diary...
Preparing diary...done
*** raw-string=11:29 cally smeggy.wa
mins=3
Notice the missing "v" at the end of
wav.
Message not available