changeset 93377:e66b3bd7cef1

(remember-diary-convert-entry): Respect calendar-date-style if bound.
author Glenn Morris <rgm@gnu.org>
date Sat, 29 Mar 2008 02:45:02 +0000
parents bc4871e6df44
children 5fce742bc681
files lisp/textmodes/remember.el
diffstat 1 files changed, 16 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/remember.el	Sat Mar 29 02:44:44 2008 +0000
+++ b/lisp/textmodes/remember.el	Sat Mar 29 02:45:02 2008 +0000
@@ -479,13 +479,22 @@
         (setq entry (concat entry " " remember-annotation)))
     (if (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" entry)
         (replace-match
-         (if european-calendar-style
-             (concat (match-string 3 entry) "/"
-                     (match-string 2 entry) "/"
-                     (match-string 1 entry))
-           (concat (match-string 2 entry) "/"
-                   (match-string 3 entry) "/"
-                   (match-string 1 entry)))
+         (let ((style (if (boundp 'calendar-date-style)
+                          calendar-date-style
+                        (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)))