aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2007-07-24 06:11:17 +0000
committerGlenn Morris2007-07-24 06:11:17 +0000
commit2ed4b0e2e4c286b18f3de11e03757360603fb1b4 (patch)
treef110a09e405197202e0aa95f0519c7ebcac19fd9
parent92b1f7abee0696a043a323e23eb670ee5ac4497c (diff)
downloademacs-2ed4b0e2e4c286b18f3de11e03757360603fb1b4.tar.gz
emacs-2ed4b0e2e4c286b18f3de11e03757360603fb1b4.zip
(list-hebrew-diary-entries): Use dotimes rather than
calendar-for-loop.
-rw-r--r--lisp/calendar/cal-hebrew.el140
1 files changed, 70 insertions, 70 deletions
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 9f32d9df471..3441f15c22f 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -516,76 +516,76 @@ not be marked in the calendar. This function is provided for use with the
516 (diary-modified (buffer-modified-p)) 516 (diary-modified (buffer-modified-p))
517 (gdate original-date) 517 (gdate original-date)
518 (mark (regexp-quote diary-nonmarking-symbol))) 518 (mark (regexp-quote diary-nonmarking-symbol)))
519 (calendar-for-loop i from 1 to number do 519 (dotimes (idummy number)
520 (let* ((d diary-date-forms) 520 (let* ((d diary-date-forms)
521 (hdate (calendar-hebrew-from-absolute 521 (hdate (calendar-hebrew-from-absolute
522 (calendar-absolute-from-gregorian gdate))) 522 (calendar-absolute-from-gregorian gdate)))
523 (month (extract-calendar-month hdate)) 523 (month (extract-calendar-month hdate))
524 (day (extract-calendar-day hdate)) 524 (day (extract-calendar-day hdate))
525 (year (extract-calendar-year hdate))) 525 (year (extract-calendar-year hdate)))
526 (while d 526 (while d
527 (let* 527 (let*
528 ((date-form (if (equal (car (car d)) 'backup) 528 ((date-form (if (equal (car (car d)) 'backup)
529 (cdr (car d)) 529 (cdr (car d))
530 (car d))) 530 (car d)))
531 (backup (equal (car (car d)) 'backup)) 531 (backup (equal (car (car d)) 'backup))
532 (dayname 532 (dayname
533 (format "%s\\|%s\\.?" 533 (format "%s\\|%s\\.?"
534 (calendar-day-name gdate) 534 (calendar-day-name gdate)
535 (calendar-day-name gdate 'abbrev))) 535 (calendar-day-name gdate 'abbrev)))
536 (calendar-month-name-array 536 (calendar-month-name-array
537 calendar-hebrew-month-name-array-leap-year) 537 calendar-hebrew-month-name-array-leap-year)
538 (monthname 538 (monthname
539 (concat 539 (concat
540 "\\*\\|" 540 "\\*\\|"
541 (calendar-month-name month))) 541 (calendar-month-name month)))
542 (month (concat "\\*\\|0*" (int-to-string month))) 542 (month (concat "\\*\\|0*" (int-to-string month)))
543 (day (concat "\\*\\|0*" (int-to-string day))) 543 (day (concat "\\*\\|0*" (int-to-string day)))
544 (year 544 (year
545 (concat 545 (concat
546 "\\*\\|0*" (int-to-string year) 546 "\\*\\|0*" (int-to-string year)
547 (if abbreviated-calendar-year 547 (if abbreviated-calendar-year
548 (concat "\\|" (int-to-string (% year 100))) 548 (concat "\\|" (int-to-string (% year 100)))
549 ""))) 549 "")))
550 (regexp 550 (regexp
551 (concat 551 (concat
552 "\\(\\`\\|\^M\\|\n\\)" mark "?" 552 "\\(\\`\\|\^M\\|\n\\)" mark "?"
553 (regexp-quote hebrew-diary-entry-symbol) 553 (regexp-quote hebrew-diary-entry-symbol)
554 "\\(" 554 "\\("
555 (mapconcat 'eval date-form "\\)\\(") 555 (mapconcat 'eval date-form "\\)\\(")
556 "\\)")) 556 "\\)"))
557 (case-fold-search t)) 557 (case-fold-search t))
558 (goto-char (point-min)) 558 (goto-char (point-min))
559 (while (re-search-forward regexp nil t) 559 (while (re-search-forward regexp nil t)
560 (if backup (re-search-backward "\\<" nil t)) 560 (if backup (re-search-backward "\\<" nil t))
561 (if (and (or (char-equal (preceding-char) ?\^M) 561 (if (and (or (char-equal (preceding-char) ?\^M)
562 (char-equal (preceding-char) ?\n)) 562 (char-equal (preceding-char) ?\n))
563 (not (looking-at " \\|\^I"))) 563 (not (looking-at " \\|\^I")))
564 ;; Diary entry that consists only of date. 564 ;; Diary entry that consists only of date.
565 (backward-char 1) 565 (backward-char 1)
566 ;; Found a nonempty diary entry--make it visible and 566 ;; Found a nonempty diary entry--make it visible and
567 ;; add it to the list. 567 ;; add it to the list.
568 (let ((entry-start (point)) 568 (let ((entry-start (point))
569 (date-start)) 569 (date-start))
570 (re-search-backward "\^M\\|\n\\|\\`") 570 (re-search-backward "\^M\\|\n\\|\\`")
571 (setq date-start (point)) 571 (setq date-start (point))
572 (re-search-forward "\^M\\|\n" nil t 2) 572 (re-search-forward "\^M\\|\n" nil t 2)
573 (while (looking-at " \\|\^I") 573 (while (looking-at " \\|\^I")
574 (re-search-forward "\^M\\|\n" nil t)) 574 (re-search-forward "\^M\\|\n" nil t))
575 (backward-char 1) 575 (backward-char 1)
576 (subst-char-in-region date-start (point) ?\^M ?\n t) 576 (subst-char-in-region date-start (point) ?\^M ?\n t)
577 (add-to-diary-list 577 (add-to-diary-list
578 gdate 578 gdate
579 (buffer-substring-no-properties entry-start (point)) 579 (buffer-substring-no-properties entry-start (point))
580 (buffer-substring-no-properties 580 (buffer-substring-no-properties
581 (1+ date-start) (1- entry-start)) 581 (1+ date-start) (1- entry-start))
582 (copy-marker entry-start)))))) 582 (copy-marker entry-start))))))
583 (setq d (cdr d)))) 583 (setq d (cdr d))))
584 (setq gdate 584 (setq gdate
585 (calendar-gregorian-from-absolute 585 (calendar-gregorian-from-absolute
586 (1+ (calendar-absolute-from-gregorian gdate))))) 586 (1+ (calendar-absolute-from-gregorian gdate)))))
587 (set-buffer-modified-p diary-modified)) 587 (set-buffer-modified-p diary-modified))
588 (goto-char (point-min)))) 588 (goto-char (point-min))))
589 589
590(defun mark-hebrew-calendar-date-pattern (month day year) 590(defun mark-hebrew-calendar-date-pattern (month day year)
591 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR. 591 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.