summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2011-05-03 19:03:30 -0700
committerGlenn Morris <rgm@gnu.org>2011-05-03 19:03:30 -0700
commit31dfb76ced3936a6a9f5417ce048414d8039e8f7 (patch)
treef485b565b6affd10b9c1fb3da392724510ac58ec /lisp
parentdd19b5fb3e3d84800d205e0377fc7a31646c66a0 (diff)
downloademacs-31dfb76ced3936a6a9f5417ce048414d8039e8f7.tar.gz
diary-lib.el fix for bug#8583.
* lisp/calendar/diary-lib.el (diary-fancy-date-pattern): Do not use non-numbers for `year' etc pseudo-variables.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/calendar/diary-lib.el19
2 files changed, 18 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 21c2acf72a6..277d7c12cf7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
+2011-05-04 Glenn Morris <rgm@gnu.org>
+
+ * calendar/diary-lib.el (diary-fancy-date-pattern): Do not use
+ non-numbers for `year' etc pseudo-variables. (Bug#8583)
+
2011-05-04 Teodor Zlatanov <tzz@lifelogs.com>
* net/gnutls.el (gnutls-negotiate): Use CL-style keyword arguments
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index a2528ac22ca..ee9ad0e4567 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -2090,7 +2090,7 @@ Optional symbol TYPE is either `monthly' or `yearly'."
'(day " " monthname))
(t '(monthname " " day))))
;; Iso cannot contain "-", because this form used eg by
- ;; insert-anniversary-diary-entry.
+ ;; diary-insert-anniversary-entry.
(t (cond ((eq calendar-date-style 'iso)
'((format "%s %.2d %.2d" year
(string-to-number month) (string-to-number day))))
@@ -2369,13 +2369,20 @@ return a font-lock pattern matching array of MONTHS and marking SYMBOL."
(concat
(let ((dayname (diary-name-pattern calendar-day-name-array nil t))
(monthname (diary-name-pattern calendar-month-name-array nil t))
- (day "[0-9]+")
- (month "[0-9]+")
- (year "-?[0-9]+"))
- (mapconcat 'eval calendar-date-display-form ""))
+ (day "1")
+ (month "2")
+ ;; FIXME? This used to be "-?[0-9]+" - what was the "-?" for?
+ (year "3"))
+ ;; This is ugly. c-d-d-form expects `day' etc to be "numbers in
+ ;; string form"; eg the iso version calls string-to-number on some.
+ ;; Therefore we cannot eg just let day = "[0-9]+". (Bug#8583).
+ ;; Assumes no integers in c-day/month-name-array.
+ (replace-regexp-in-string "[0-9]+" "[0-9]+"
+ (mapconcat 'eval calendar-date-display-form "")
+ nil t))
;; Optional ": holiday name" after the date.
"\\(: .*\\)?")
- "Regular expression matching a date header in Fancy Diary.")
+ "Regular expression matching the first line of a fancy diary date header.")
(define-obsolete-variable-alias 'fancy-diary-font-lock-keywords
'diary-fancy-font-lock-keywords "23.1")