From: Glenn Morris Date: Sat, 29 Mar 2008 02:45:02 +0000 (+0000) Subject: (remember-diary-convert-entry): Respect calendar-date-style if bound. X-Git-Tag: emacs-pretest-23.0.90~6802 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d4c9e004911c7c133d0defa5838009fcb01fbce5;p=emacs.git (remember-diary-convert-entry): Respect calendar-date-style if bound. --- diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index b077f08f295..459bf5b7898 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el @@ -479,13 +479,22 @@ If this is nil, then `diary-file' will be used instead." (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)))