# HG changeset patch # User Glenn Morris # Date 1207640147 0 # Node ID c3db88579de4aa8b71cadaa875925e71d20485a8 # Parent e4a7737b7ba2a10dba3ee17726f11cad6b4f4ee8 (remember-diary-convert-entry): Require calendar. diff -r e4a7737b7ba2 -r c3db88579de4 lisp/textmodes/remember.el --- 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")