diff options
| author | Glenn Morris | 2007-07-24 06:10:22 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-07-24 06:10:22 +0000 |
| commit | d7489fd9df90328de15a71860df5268c080d3361 (patch) | |
| tree | 04d2fc40f31da73073f6be97e634064950e1a440 | |
| parent | 55abc44f16196f6110749e662f0df01f177614d4 (diff) | |
| download | emacs-d7489fd9df90328de15a71860df5268c080d3361.tar.gz emacs-d7489fd9df90328de15a71860df5268c080d3361.zip | |
(list-bahai-diary-entries): Use dotimes rather than calendar-for-loop.
| -rw-r--r-- | lisp/calendar/cal-bahai.el | 138 |
1 files changed, 69 insertions, 69 deletions
diff --git a/lisp/calendar/cal-bahai.el b/lisp/calendar/cal-bahai.el index 06703e3b73b..bd9a62a8baf 100644 --- a/lisp/calendar/cal-bahai.el +++ b/lisp/calendar/cal-bahai.el | |||
| @@ -220,75 +220,75 @@ calendar. This function is provided for use with the | |||
| 220 | (diary-modified (buffer-modified-p)) | 220 | (diary-modified (buffer-modified-p)) |
| 221 | (gdate original-date) | 221 | (gdate original-date) |
| 222 | (mark (regexp-quote diary-nonmarking-symbol))) | 222 | (mark (regexp-quote diary-nonmarking-symbol))) |
| 223 | (calendar-for-loop i from 1 to number do | 223 | (dotimes (idummy number) |
| 224 | (let* ((d diary-date-forms) | 224 | (let* ((d diary-date-forms) |
| 225 | (bdate (calendar-bahai-from-absolute | 225 | (bdate (calendar-bahai-from-absolute |
| 226 | (calendar-absolute-from-gregorian gdate))) | 226 | (calendar-absolute-from-gregorian gdate))) |
| 227 | (month (extract-calendar-month bdate)) | 227 | (month (extract-calendar-month bdate)) |
| 228 | (day (extract-calendar-day bdate)) | 228 | (day (extract-calendar-day bdate)) |
| 229 | (year (extract-calendar-year bdate))) | 229 | (year (extract-calendar-year bdate))) |
| 230 | (while d | 230 | (while d |
| 231 | (let* | 231 | (let* |
| 232 | ((date-form (if (equal (car (car d)) 'backup) | 232 | ((date-form (if (equal (car (car d)) 'backup) |
| 233 | (cdr (car d)) | 233 | (cdr (car d)) |
| 234 | (car d))) | 234 | (car d))) |
| 235 | (backup (equal (car (car d)) 'backup)) | 235 | (backup (equal (car (car d)) 'backup)) |
| 236 | (dayname | 236 | (dayname |
| 237 | (concat | 237 | (concat |
| 238 | (calendar-day-name gdate) "\\|" | 238 | (calendar-day-name gdate) "\\|" |
| 239 | (substring (calendar-day-name gdate) 0 3) ".?")) | 239 | (substring (calendar-day-name gdate) 0 3) ".?")) |
| 240 | (calendar-month-name-array | 240 | (calendar-month-name-array |
| 241 | bahai-calendar-month-name-array) | 241 | bahai-calendar-month-name-array) |
| 242 | (monthname | 242 | (monthname |
| 243 | (concat | 243 | (concat |
| 244 | "\\*\\|" | 244 | "\\*\\|" |
| 245 | (calendar-month-name month))) | 245 | (calendar-month-name month))) |
| 246 | (month (concat "\\*\\|0*" (int-to-string month))) | 246 | (month (concat "\\*\\|0*" (int-to-string month))) |
| 247 | (day (concat "\\*\\|0*" (int-to-string day))) | 247 | (day (concat "\\*\\|0*" (int-to-string day))) |
| 248 | (year | 248 | (year |
| 249 | (concat | 249 | (concat |
| 250 | "\\*\\|0*" (int-to-string year) | 250 | "\\*\\|0*" (int-to-string year) |
| 251 | (if abbreviated-calendar-year | 251 | (if abbreviated-calendar-year |
| 252 | (concat "\\|" (int-to-string (% year 100))) | 252 | (concat "\\|" (int-to-string (% year 100))) |
| 253 | ""))) | 253 | ""))) |
| 254 | (regexp | 254 | (regexp |
| 255 | (concat | 255 | (concat |
| 256 | "\\(\\`\\|\^M\\|\n\\)" mark "?" | 256 | "\\(\\`\\|\^M\\|\n\\)" mark "?" |
| 257 | (regexp-quote bahai-diary-entry-symbol) | 257 | (regexp-quote bahai-diary-entry-symbol) |
| 258 | "\\(" | 258 | "\\(" |
| 259 | (mapconcat 'eval date-form "\\)\\(") | 259 | (mapconcat 'eval date-form "\\)\\(") |
| 260 | "\\)")) | 260 | "\\)")) |
| 261 | (case-fold-search t)) | 261 | (case-fold-search t)) |
| 262 | (goto-char (point-min)) | 262 | (goto-char (point-min)) |
| 263 | (while (re-search-forward regexp nil t) | 263 | (while (re-search-forward regexp nil t) |
| 264 | (if backup (re-search-backward "\\<" nil t)) | 264 | (if backup (re-search-backward "\\<" nil t)) |
| 265 | (if (and (or (char-equal (preceding-char) ?\^M) | 265 | (if (and (or (char-equal (preceding-char) ?\^M) |
| 266 | (char-equal (preceding-char) ?\n)) | 266 | (char-equal (preceding-char) ?\n)) |
| 267 | (not (looking-at " \\|\^I"))) | 267 | (not (looking-at " \\|\^I"))) |
| 268 | ;; Diary entry that consists only of date. | 268 | ;; Diary entry that consists only of date. |
| 269 | (backward-char 1) | 269 | (backward-char 1) |
| 270 | ;; Found a nonempty diary entry--make it visible and | 270 | ;; Found a nonempty diary entry--make it visible and |
| 271 | ;; add it to the list. | 271 | ;; add it to the list. |
| 272 | (let ((entry-start (point)) | 272 | (let ((entry-start (point)) |
| 273 | (date-start)) | 273 | (date-start)) |
| 274 | (re-search-backward "\^M\\|\n\\|\\`") | 274 | (re-search-backward "\^M\\|\n\\|\\`") |
| 275 | (setq date-start (point)) | 275 | (setq date-start (point)) |
| 276 | (re-search-forward "\^M\\|\n" nil t 2) | 276 | (re-search-forward "\^M\\|\n" nil t 2) |
| 277 | (while (looking-at " \\|\^I") | 277 | (while (looking-at " \\|\^I") |
| 278 | (re-search-forward "\^M\\|\n" nil t)) | 278 | (re-search-forward "\^M\\|\n" nil t)) |
| 279 | (backward-char 1) | 279 | (backward-char 1) |
| 280 | (subst-char-in-region date-start (point) ?\^M ?\n t) | 280 | (subst-char-in-region date-start (point) ?\^M ?\n t) |
| 281 | (add-to-diary-list | 281 | (add-to-diary-list |
| 282 | gdate | 282 | gdate |
| 283 | (buffer-substring-no-properties entry-start (point)) | 283 | (buffer-substring-no-properties entry-start (point)) |
| 284 | (buffer-substring-no-properties | 284 | (buffer-substring-no-properties |
| 285 | (1+ date-start) (1- entry-start))))))) | 285 | (1+ date-start) (1- entry-start))))))) |
| 286 | (setq d (cdr d)))) | 286 | (setq d (cdr d)))) |
| 287 | (setq gdate | 287 | (setq gdate |
| 288 | (calendar-gregorian-from-absolute | 288 | (calendar-gregorian-from-absolute |
| 289 | (1+ (calendar-absolute-from-gregorian gdate))))) | 289 | (1+ (calendar-absolute-from-gregorian gdate))))) |
| 290 | (set-buffer-modified-p diary-modified)) | 290 | (set-buffer-modified-p diary-modified)) |
| 291 | (goto-char (point-min)))) | 291 | (goto-char (point-min)))) |
| 292 | 292 | ||
| 293 | (defun mark-bahai-diary-entries () | 293 | (defun mark-bahai-diary-entries () |
| 294 | "Mark days in the calendar window that have Baha'i date diary entries. | 294 | "Mark days in the calendar window that have Baha'i date diary entries. |