diff options
| author | Glenn Morris <rgm@gnu.org> | 2008-04-08 07:36:03 +0000 |
|---|---|---|
| committer | Glenn Morris <rgm@gnu.org> | 2008-04-08 07:36:03 +0000 |
| commit | 3f651ee61bc1e8ea25890d7d9b1118d5609a4256 (patch) | |
| tree | 473053794e4e6b25bb0257642b18d028ca96a620 /lisp/textmodes/remember.el | |
| parent | aa2d26b396f7afb8dd44bea134a2ba104dddd543 (diff) | |
| download | emacs-3f651ee61bc1e8ea25890d7d9b1118d5609a4256.tar.gz | |
(remember-diary-convert-entry): Require calendar.
Diffstat (limited to 'lisp/textmodes/remember.el')
| -rw-r--r-- | lisp/textmodes/remember.el | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 1fd830afac7..e1c31f4a2b3 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -478,25 +478,30 @@ If this is nil, then `diary-file' will be used instead." (when remember-annotation (setq entry (concat entry " " remember-annotation))) (if (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" entry) - (replace-match - (let ((style (if (boundp 'calendar-date-style) - calendar-date-style - ;; Don't complain about obsoleteness. - (if (with-no-warnings european-calendar-style) - 'european - 'american)))) - (cond ((eq style 'european) - (concat (match-string 3 entry) "/" - (match-string 2 entry) "/" - (match-string 1 entry))) - ((eq style 'iso) - (concat (match-string 1 entry) "-" - (match-string 2 entry) "-" - (match-string 3 entry))) - (t (concat (match-string 2 entry) "/" - (match-string 3 entry) "/" - (match-string 1 entry))))) - t t entry) + (progn + ;; For calendar-date-style. This costs us nothing because + ;; the call to make-diary-entry below loads diary-lib + ;; which requires calendar. + (require 'calendar) + (replace-match + (let ((style (if (boundp 'calendar-date-style) + calendar-date-style + ;; Don't complain about obsoleteness. + (if (with-no-warnings european-calendar-style) + 'european + 'american)))) + (cond ((eq style 'european) + (concat (match-string 3 entry) "/" + (match-string 2 entry) "/" + (match-string 1 entry))) + ((eq style 'iso) + (concat (match-string 1 entry) "-" + (match-string 2 entry) "-" + (match-string 3 entry))) + (t (concat (match-string 2 entry) "/" + (match-string 3 entry) "/" + (match-string 1 entry))))) + t t entry)) entry))) (autoload 'make-diary-entry "diary-lib") |
