diff options
| author | Glenn Morris | 2008-03-29 02:46:54 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-29 02:46:54 +0000 |
| commit | f2b4643502f6a63b37b1c5287e2ff5114f7690b2 (patch) | |
| tree | 17d1b495aee3097f3775a07ef825b78eceafeb72 | |
| parent | d4c9e004911c7c133d0defa5838009fcb01fbce5 (diff) | |
| download | emacs-f2b4643502f6a63b37b1c5287e2ff5114f7690b2.tar.gz emacs-f2b4643502f6a63b37b1c5287e2ff5114f7690b2.zip | |
Autoload diary-insert-entry-1.
(insert-hebrew-diary-entry, insert-monthly-hebrew-diary-entry)
(insert-yearly-hebrew-diary-entry): Use diary-insert-entry-1.
(diary-make-date): Autoload it.
(diary-yahrzeit): Doc fix. Use diary-make-date.
| -rw-r--r-- | lisp/ChangeLog | 49 | ||||
| -rw-r--r-- | lisp/calendar/cal-hebrew.el | 77 |
2 files changed, 80 insertions, 46 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c7dc80a6d65..cb8939ad470 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,52 @@ | |||
| 1 | 2008-03-29 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * calendar/calendar.el (diary-file, american-date-diary-pattern) | ||
| 4 | (european-date-diary-pattern,european-calendar-display-form) | ||
| 5 | (american-calendar-display-form, diary-display-hook): Doc fixes. | ||
| 6 | (european-calendar-style): Doc fix. Use calendar-set-date-style for | ||
| 7 | custom :set. Mark as obsolete. | ||
| 8 | (calendar-date-style, iso-date-diary-pattern) | ||
| 9 | (iso-calendar-display-form): New user variables. | ||
| 10 | (diary-date-forms, calendar-date-display-form): Set using | ||
| 11 | calendar-date-style. Doc fix. | ||
| 12 | (calendar-set-date-style): New command. | ||
| 13 | (european-calendar, american-calendar): Use calendar-set-date-style. | ||
| 14 | Mark as obsolete. | ||
| 15 | |||
| 16 | * calendar/diary-lib.el (number): Move declaration where needed. | ||
| 17 | (diary-mail-entries, list-sexp-diary-entries): Doc fixes. | ||
| 18 | (diary-make-date): New function. | ||
| 19 | (diary-date, diary-block, diary-anniversary, diary-cyclic): Doc fix. | ||
| 20 | Use diary-make-date. | ||
| 21 | (diary-date-display-form, diary-insert-entry-1): New functions. | ||
| 22 | (insert-monthly-diary-entry, insert-yearly-diary-entry): | ||
| 23 | Use diary-insert-entry-1. | ||
| 24 | (insert-anniversary-diary-entry, insert-block-diary-entry) | ||
| 25 | (insert-cyclic-diary-entry): Use diary-date-display-form. | ||
| 26 | |||
| 27 | * calendar/cal-bahai.el, calendar/cal-hebrew.el, calendar/cal-islam.el: | ||
| 28 | Autoload diary-insert-entry-1. | ||
| 29 | * calendar/cal-bahai.el (diary-bahai-insert-entry) | ||
| 30 | (diary-bahai-insert-monthly-entry, diary-bahai-insert-yearly-entry): | ||
| 31 | * calendar/cal-hebrew.el (insert-hebrew-diary-entry) | ||
| 32 | (insert-monthly-hebrew-diary-entry, insert-yearly-hebrew-diary-entry) | ||
| 33 | * calendar/cal-islam.el (insert-islamic-diary-entry) | ||
| 34 | (insert-monthly-islamic-diary-entry, insert-yearly-islamic-diary-entry): | ||
| 35 | Use diary-insert-entry-1. | ||
| 36 | |||
| 37 | * calendar/cal-hebrew.el (diary-make-date): Autoload it. | ||
| 38 | (diary-yahrzeit): Doc fix. Use diary-make-date. | ||
| 39 | |||
| 40 | * calendar/icalendar.el (icalendar--datetime-to-american-date): | ||
| 41 | New name for icalendar--datetime-to-noneuropean-date. Make old name | ||
| 42 | obsolete alias. | ||
| 43 | (icalendar--datetime-to-iso-date): New function. | ||
| 44 | (icalendar--datetime-to-diary-date): Doc fix. Respect | ||
| 45 | calendar-date-style if bound. | ||
| 46 | |||
| 47 | * textmodes/remember.el (remember-diary-convert-entry): | ||
| 48 | Respect calendar-date-style if bound. | ||
| 49 | |||
| 1 | 2008-03-29 Stefan Monnier <monnier@iro.umontreal.ca> | 50 | 2008-03-29 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 51 | ||
| 3 | * xt-mouse.el (xterm-mouse-mode): Use delete-terminal-functions. | 52 | * xt-mouse.el (xterm-mouse-mode): Use delete-terminal-functions. |
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el index d30dc295596..1e97d62df0d 100644 --- a/lisp/calendar/cal-hebrew.el +++ b/lisp/calendar/cal-hebrew.el | |||
| @@ -285,25 +285,25 @@ nil if it is not visible in the current calendar window." | |||
| 285 | (if (< 8 month) (- month 8) (+ month 4)) | 285 | (if (< 8 month) (- month 8) (+ month 4)) |
| 286 | (if (< 7 month) (- month 7) (+ month 5)))) | 286 | (if (< 7 month) (- month 7) (+ month 5)))) |
| 287 | (let ((m1 displayed-month) | 287 | (let ((m1 displayed-month) |
| 288 | (y1 displayed-year) | 288 | (y1 displayed-year) |
| 289 | (m2 displayed-month) | 289 | (m2 displayed-month) |
| 290 | (y2 displayed-year) | 290 | (y2 displayed-year) |
| 291 | (year)) | 291 | (year)) |
| 292 | (increment-calendar-month m1 y1 -1) | 292 | (increment-calendar-month m1 y1 -1) |
| 293 | (increment-calendar-month m2 y2 1) | 293 | (increment-calendar-month m2 y2 1) |
| 294 | (let* ((start-date (calendar-absolute-from-gregorian | 294 | (let* ((start-date (calendar-absolute-from-gregorian |
| 295 | (list m1 1 y1))) | 295 | (list m1 1 y1))) |
| 296 | (end-date (calendar-absolute-from-gregorian | 296 | (end-date (calendar-absolute-from-gregorian |
| 297 | (list m2 (calendar-last-day-of-month m2 y2) y2))) | 297 | (list m2 (calendar-last-day-of-month m2 y2) y2))) |
| 298 | (hebrew-start (calendar-hebrew-from-absolute start-date)) | 298 | (hebrew-start (calendar-hebrew-from-absolute start-date)) |
| 299 | (hebrew-end (calendar-hebrew-from-absolute end-date)) | 299 | (hebrew-end (calendar-hebrew-from-absolute end-date)) |
| 300 | (hebrew-y1 (extract-calendar-year hebrew-start)) | 300 | (hebrew-y1 (extract-calendar-year hebrew-start)) |
| 301 | (hebrew-y2 (extract-calendar-year hebrew-end))) | 301 | (hebrew-y2 (extract-calendar-year hebrew-end))) |
| 302 | (setq year (if (< 6 month) hebrew-y2 hebrew-y1)) | 302 | (setq year (if (< 6 month) hebrew-y2 hebrew-y1)) |
| 303 | (let ((date (calendar-gregorian-from-absolute | 303 | (let ((date (calendar-gregorian-from-absolute |
| 304 | (calendar-absolute-from-hebrew | 304 | (calendar-absolute-from-hebrew |
| 305 | (list month day year))))) | 305 | (list month day year))))) |
| 306 | (if (calendar-date-is-visible-p date) | 306 | (if (calendar-date-is-visible-p date) |
| 307 | (list (list date string)))))))) | 307 | (list (list date string)))))))) |
| 308 | 308 | ||
| 309 | ;; h-r-h-e should be called from holidays code. | 309 | ;; h-r-h-e should be called from holidays code. |
| @@ -595,20 +595,18 @@ window. See `list-hebrew-diary-entries' for more information." | |||
| 595 | 'calendar-hebrew-from-absolute | 595 | 'calendar-hebrew-from-absolute |
| 596 | 'mark-hebrew-calendar-date-pattern)) | 596 | 'mark-hebrew-calendar-date-pattern)) |
| 597 | 597 | ||
| 598 | |||
| 599 | (autoload 'diary-insert-entry-1 "diary-lib") | ||
| 600 | |||
| 598 | ;;;###cal-autoload | 601 | ;;;###cal-autoload |
| 599 | (defun insert-hebrew-diary-entry (arg) | 602 | (defun insert-hebrew-diary-entry (arg) |
| 600 | "Insert a diary entry. | 603 | "Insert a diary entry. |
| 601 | For the Hebrew date corresponding to the date indicated by point. | 604 | For the Hebrew date corresponding to the date indicated by point. |
| 602 | Prefix argument ARG makes the entry nonmarking." | 605 | Prefix argument ARG makes the entry nonmarking." |
| 603 | (interactive "P") | 606 | (interactive "P") |
| 604 | (let ((calendar-month-name-array calendar-hebrew-month-name-array-leap-year)) | 607 | (diary-insert-entry-1 nil arg calendar-hebrew-month-name-array-leap-year |
| 605 | (make-diary-entry | 608 | hebrew-diary-entry-symbol |
| 606 | (concat hebrew-diary-entry-symbol | 609 | 'calendar-hebrew-from-absolute)) |
| 607 | (calendar-date-string | ||
| 608 | (calendar-hebrew-from-absolute | ||
| 609 | (calendar-absolute-from-gregorian (calendar-cursor-to-date t))) | ||
| 610 | nil t)) | ||
| 611 | arg))) | ||
| 612 | 610 | ||
| 613 | ;;;###cal-autoload | 611 | ;;;###cal-autoload |
| 614 | (defun insert-monthly-hebrew-diary-entry (arg) | 612 | (defun insert-monthly-hebrew-diary-entry (arg) |
| @@ -616,16 +614,9 @@ Prefix argument ARG makes the entry nonmarking." | |||
| 616 | For the day of the Hebrew month corresponding to the date indicated by point. | 614 | For the day of the Hebrew month corresponding to the date indicated by point. |
| 617 | Prefix argument ARG makes the entry nonmarking." | 615 | Prefix argument ARG makes the entry nonmarking." |
| 618 | (interactive "P") | 616 | (interactive "P") |
| 619 | (let ((calendar-date-display-form (if european-calendar-style | 617 | (diary-insert-entry-1 'monthly arg calendar-hebrew-month-name-array-leap-year |
| 620 | '(day " * ") | 618 | hebrew-diary-entry-symbol |
| 621 | '("* " day ))) | 619 | 'calendar-hebrew-from-absolute)) |
| 622 | (calendar-month-name-array calendar-hebrew-month-name-array-leap-year)) | ||
| 623 | (make-diary-entry | ||
| 624 | (concat hebrew-diary-entry-symbol | ||
| 625 | (calendar-date-string | ||
| 626 | (calendar-hebrew-from-absolute | ||
| 627 | (calendar-absolute-from-gregorian (calendar-cursor-to-date t))))) | ||
| 628 | arg))) | ||
| 629 | 620 | ||
| 630 | ;;;###cal-autoload | 621 | ;;;###cal-autoload |
| 631 | (defun insert-yearly-hebrew-diary-entry (arg) | 622 | (defun insert-yearly-hebrew-diary-entry (arg) |
| @@ -633,16 +624,9 @@ Prefix argument ARG makes the entry nonmarking." | |||
| 633 | For the day of the Hebrew year corresponding to the date indicated by point. | 624 | For the day of the Hebrew year corresponding to the date indicated by point. |
| 634 | Prefix argument ARG makes the entry nonmarking." | 625 | Prefix argument ARG makes the entry nonmarking." |
| 635 | (interactive "P") | 626 | (interactive "P") |
| 636 | (let ((calendar-date-display-form (if european-calendar-style | 627 | (diary-insert-entry-1 'yearly arg calendar-hebrew-month-name-array-leap-year |
| 637 | '(day " " monthname) | 628 | hebrew-diary-entry-symbol |
| 638 | '(monthname " " day))) | 629 | 'calendar-hebrew-from-absolute)) |
| 639 | (calendar-month-name-array calendar-hebrew-month-name-array-leap-year)) | ||
| 640 | (make-diary-entry | ||
| 641 | (concat hebrew-diary-entry-symbol | ||
| 642 | (calendar-date-string | ||
| 643 | (calendar-hebrew-from-absolute | ||
| 644 | (calendar-absolute-from-gregorian (calendar-cursor-to-date t))))) | ||
| 645 | arg))) | ||
| 646 | 630 | ||
| 647 | ;;;###autoload | 631 | ;;;###autoload |
| 648 | (defun list-yahrzeit-dates (death-date start-year end-year) | 632 | (defun list-yahrzeit-dates (death-date start-year end-year) |
| @@ -745,23 +729,24 @@ use when highlighting the day in the calendar." | |||
| 745 | 729 | ||
| 746 | (defvar entry) | 730 | (defvar entry) |
| 747 | 731 | ||
| 732 | (autoload 'diary-make-date "diary-lib") | ||
| 733 | |||
| 748 | ;;;###diary-autoload | 734 | ;;;###diary-autoload |
| 749 | (defun diary-yahrzeit (death-month death-day death-year &optional mark) | 735 | (defun diary-yahrzeit (death-month death-day death-year &optional mark) |
| 750 | "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before. | 736 | "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before. |
| 751 | Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary entry is assumed | 737 | Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary |
| 752 | to be the name of the person. Date of death is on the *civil* calendar; | 738 | entry is assumed to be the name of the person. Although the date |
| 753 | although the date of death is specified by the civil calendar, the proper | 739 | of death is specified by the civil calendar, the proper Hebrew |
| 754 | Hebrew calendar Yahrzeit is determined. If `european-calendar-style' is | 740 | calendar Yahrzeit is determined. |
| 755 | non-nil, the order of the parameters is changed to DEATH-DAY, DEATH-MONTH, | 741 | |
| 756 | DEATH-YEAR. | 742 | The order of the input parameters changes according to `calendar-date-style' |
| 743 | \(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style). | ||
| 757 | 744 | ||
| 758 | An optional parameter MARK specifies a face or single-character string to | 745 | An optional parameter MARK specifies a face or single-character string to |
| 759 | use when highlighting the day in the calendar." | 746 | use when highlighting the day in the calendar." |
| 760 | (let* ((h-date (calendar-hebrew-from-absolute | 747 | (let* ((h-date (calendar-hebrew-from-absolute |
| 761 | (calendar-absolute-from-gregorian | 748 | (calendar-absolute-from-gregorian |
| 762 | (if european-calendar-style | 749 | (diary-make-date death-month death-day death-year)))) |
| 763 | (list death-day death-month death-year) | ||
| 764 | (list death-month death-day death-year))))) | ||
| 765 | (h-month (extract-calendar-month h-date)) | 750 | (h-month (extract-calendar-month h-date)) |
| 766 | (h-day (extract-calendar-day h-date)) | 751 | (h-day (extract-calendar-day h-date)) |
| 767 | (h-year (extract-calendar-year h-date)) | 752 | (h-year (extract-calendar-year h-date)) |