comparison lisp/calendar/diary-lib.el @ 93276:487270d1d4da

(diary-mark-entries-1): Fix position offsets in non-gregorian case.
author Glenn Morris <rgm@gnu.org>
date Thu, 27 Mar 2008 06:19:33 +0000
parents 177806bc3b1b
children e4f021df35fd
comparison
equal deleted inserted replaced
93275:12975334805f 93276:487270d1d4da
1106 calendar-month-abbrev-array)))) 1106 calendar-month-abbrev-array))))
1107 (month "[0-9]+\\|\\*") 1107 (month "[0-9]+\\|\\*")
1108 (day "[0-9]+\\|\\*") 1108 (day "[0-9]+\\|\\*")
1109 (year "[0-9]+\\|\\*") 1109 (year "[0-9]+\\|\\*")
1110 (case-fold-search t) 1110 (case-fold-search t)
1111 ;; FIXME is this the right reason for 1 versus 2?
1112 ;; Should docs of symbols say must be single character?
1113 (inc (if symbol 2 1))
1114 marks) 1111 marks)
1115 (dolist (date-form diary-date-forms) 1112 (dolist (date-form diary-date-forms)
1116 (if (eq (car date-form) 'backup) ; ignore 'backup directive 1113 (if (eq (car date-form) 'backup) ; ignore 'backup directive
1117 (setq date-form (cdr date-form))) 1114 (setq date-form (cdr date-form)))
1118 (let* ((l (length date-form)) 1115 (let* ((l (length date-form))
1119 (d-name-pos (- l (length (memq 'dayname date-form)))) 1116 (d-name-pos (- l (length (memq 'dayname date-form))))
1120 (d-name-pos (if (/= l d-name-pos) (+ inc d-name-pos))) 1117 (d-name-pos (if (/= l d-name-pos) (1+ d-name-pos)))
1121 (m-name-pos (- l (length (memq 'monthname date-form)))) 1118 (m-name-pos (- l (length (memq 'monthname date-form))))
1122 (m-name-pos (if (/= l m-name-pos) (+ inc m-name-pos))) 1119 (m-name-pos (if (/= l m-name-pos) (1+ m-name-pos)))
1123 (d-pos (- l (length (memq 'day date-form)))) 1120 (d-pos (- l (length (memq 'day date-form))))
1124 (d-pos (if (/= l d-pos) (+ inc d-pos))) 1121 (d-pos (if (/= l d-pos) (1+ d-pos)))
1125 (m-pos (- l (length (memq 'month date-form)))) 1122 (m-pos (- l (length (memq 'month date-form))))
1126 (m-pos (if (/= l m-pos) (+ inc m-pos))) 1123 (m-pos (if (/= l m-pos) (1+ m-pos)))
1127 (y-pos (- l (length (memq 'year date-form)))) 1124 (y-pos (- l (length (memq 'year date-form))))
1128 (y-pos (if (/= l y-pos) (+ inc y-pos))) 1125 (y-pos (if (/= l y-pos) (1+ y-pos)))
1129 (regexp (format "^%s\\(%s\\)" 1126 (regexp (format "^%s\\(%s\\)"
1130 (if symbol (regexp-quote symbol) "") 1127 (if symbol (regexp-quote symbol) "")
1131 (mapconcat 'eval date-form "\\)\\(")))) 1128 (mapconcat 'eval date-form "\\)\\("))))
1132 (goto-char (point-min)) 1129 (goto-char (point-min))
1133 (while (re-search-forward regexp nil t) 1130 (while (re-search-forward regexp nil t)