diff options
| author | Glenn Morris | 2008-04-08 07:36:03 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-04-08 07:36:03 +0000 |
| commit | 3f651ee61bc1e8ea25890d7d9b1118d5609a4256 (patch) | |
| tree | 473053794e4e6b25bb0257642b18d028ca96a620 /lisp/textmodes | |
| parent | aa2d26b396f7afb8dd44bea134a2ba104dddd543 (diff) | |
| download | emacs-3f651ee61bc1e8ea25890d7d9b1118d5609a4256.tar.gz emacs-3f651ee61bc1e8ea25890d7d9b1118d5609a4256.zip | |
(remember-diary-convert-entry): Require calendar.
Diffstat (limited to 'lisp/textmodes')
| -rw-r--r-- | lisp/textmodes/remember.el | 43 |
1 files changed, 24 insertions, 19 deletions
diff --git a/lisp/textmodes/remember.el b/lisp/textmodes/remember.el index 1fd830afac7..e1c31f4a2b3 100644 --- a/lisp/textmodes/remember.el +++ b/lisp/textmodes/remember.el | |||
| @@ -478,25 +478,30 @@ If this is nil, then `diary-file' will be used instead." | |||
| 478 | (when remember-annotation | 478 | (when remember-annotation |
| 479 | (setq entry (concat entry " " remember-annotation))) | 479 | (setq entry (concat entry " " remember-annotation))) |
| 480 | (if (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" entry) | 480 | (if (string-match "\\([0-9]+\\)\\.\\([0-9]+\\)\\.\\([0-9]+\\)" entry) |
| 481 | (replace-match | 481 | (progn |
| 482 | (let ((style (if (boundp 'calendar-date-style) | 482 | ;; For calendar-date-style. This costs us nothing because |
| 483 | calendar-date-style | 483 | ;; the call to make-diary-entry below loads diary-lib |
| 484 | ;; Don't complain about obsoleteness. | 484 | ;; which requires calendar. |
| 485 | (if (with-no-warnings european-calendar-style) | 485 | (require 'calendar) |
| 486 | 'european | 486 | (replace-match |
| 487 | 'american)))) | 487 | (let ((style (if (boundp 'calendar-date-style) |
| 488 | (cond ((eq style 'european) | 488 | calendar-date-style |
| 489 | (concat (match-string 3 entry) "/" | 489 | ;; Don't complain about obsoleteness. |
| 490 | (match-string 2 entry) "/" | 490 | (if (with-no-warnings european-calendar-style) |
| 491 | (match-string 1 entry))) | 491 | 'european |
| 492 | ((eq style 'iso) | 492 | 'american)))) |
| 493 | (concat (match-string 1 entry) "-" | 493 | (cond ((eq style 'european) |
| 494 | (match-string 2 entry) "-" | 494 | (concat (match-string 3 entry) "/" |
| 495 | (match-string 3 entry))) | 495 | (match-string 2 entry) "/" |
| 496 | (t (concat (match-string 2 entry) "/" | 496 | (match-string 1 entry))) |
| 497 | (match-string 3 entry) "/" | 497 | ((eq style 'iso) |
| 498 | (match-string 1 entry))))) | 498 | (concat (match-string 1 entry) "-" |
| 499 | t t entry) | 499 | (match-string 2 entry) "-" |
| 500 | (match-string 3 entry))) | ||
| 501 | (t (concat (match-string 2 entry) "/" | ||
| 502 | (match-string 3 entry) "/" | ||
| 503 | (match-string 1 entry))))) | ||
| 504 | t t entry)) | ||
| 500 | entry))) | 505 | entry))) |
| 501 | 506 | ||
| 502 | (autoload 'make-diary-entry "diary-lib") | 507 | (autoload 'make-diary-entry "diary-lib") |