Mercurial > emacs
diff lisp/textmodes/remember.el @ 93847:c3db88579de4
(remember-diary-convert-entry): Require calendar.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Tue, 08 Apr 2008 07:35:47 +0000 |
parents | bc6b2ba17b08 |
children | 067c4553fc2e |
line wrap: on
line diff
--- a/lisp/textmodes/remember.el Tue Apr 08 07:31:13 2008 +0000 +++ b/lisp/textmodes/remember.el Tue Apr 08 07:35:47 2008 +0000 @@ -478,25 +478,30 @@ (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")