]> git.eshelyaron.com Git - emacs.git/commitdiff
(remember-diary-convert-entry): Require calendar.
authorGlenn Morris <rgm@gnu.org>
Tue, 8 Apr 2008 07:36:03 +0000 (07:36 +0000)
committerGlenn Morris <rgm@gnu.org>
Tue, 8 Apr 2008 07:36:03 +0000 (07:36 +0000)
lisp/ChangeLog
lisp/textmodes/remember.el

index beb9fe71e39b5778682e7bc0289b92ec198f1d52..9e53db5f3aafa095e76a78fe98c3d850f0946de6 100644 (file)
@@ -1,5 +1,9 @@
 2008-04-08  Glenn Morris  <rgm@gnu.org>
 
+       * calendar/calendar.el (calendar-date-style): Remove autoload cookie.
+       * textmodes/remember.el (remember-diary-convert-entry):
+       Require calendar.
+
        * calendar/cal-menu.el (cal-menu-event-to-date):
        Rename calendar-event-to-date.  Update callers.
        (calendar-mouse-tex-day): Rename cal-tex-mouse-day.
index 1fd830afac706faae04d9fdc3820e313ab712204..e1c31f4a2b343d8dc549805b5b2db2972645f52e 100644 (file)
@@ -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")