From: Glenn Morris Date: Sat, 29 Mar 2008 02:46:54 +0000 (+0000) Subject: Autoload diary-insert-entry-1. X-Git-Tag: emacs-pretest-23.0.90~6801 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f2b4643502f6a63b37b1c5287e2ff5114f7690b2;p=emacs.git 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. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index c7dc80a6d65..cb8939ad470 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,52 @@ +2008-03-29 Glenn Morris + + * calendar/calendar.el (diary-file, american-date-diary-pattern) + (european-date-diary-pattern,european-calendar-display-form) + (american-calendar-display-form, diary-display-hook): Doc fixes. + (european-calendar-style): Doc fix. Use calendar-set-date-style for + custom :set. Mark as obsolete. + (calendar-date-style, iso-date-diary-pattern) + (iso-calendar-display-form): New user variables. + (diary-date-forms, calendar-date-display-form): Set using + calendar-date-style. Doc fix. + (calendar-set-date-style): New command. + (european-calendar, american-calendar): Use calendar-set-date-style. + Mark as obsolete. + + * calendar/diary-lib.el (number): Move declaration where needed. + (diary-mail-entries, list-sexp-diary-entries): Doc fixes. + (diary-make-date): New function. + (diary-date, diary-block, diary-anniversary, diary-cyclic): Doc fix. + Use diary-make-date. + (diary-date-display-form, diary-insert-entry-1): New functions. + (insert-monthly-diary-entry, insert-yearly-diary-entry): + Use diary-insert-entry-1. + (insert-anniversary-diary-entry, insert-block-diary-entry) + (insert-cyclic-diary-entry): Use diary-date-display-form. + + * calendar/cal-bahai.el, calendar/cal-hebrew.el, calendar/cal-islam.el: + Autoload diary-insert-entry-1. + * calendar/cal-bahai.el (diary-bahai-insert-entry) + (diary-bahai-insert-monthly-entry, diary-bahai-insert-yearly-entry): + * calendar/cal-hebrew.el (insert-hebrew-diary-entry) + (insert-monthly-hebrew-diary-entry, insert-yearly-hebrew-diary-entry) + * calendar/cal-islam.el (insert-islamic-diary-entry) + (insert-monthly-islamic-diary-entry, insert-yearly-islamic-diary-entry): + Use diary-insert-entry-1. + + * calendar/cal-hebrew.el (diary-make-date): Autoload it. + (diary-yahrzeit): Doc fix. Use diary-make-date. + + * calendar/icalendar.el (icalendar--datetime-to-american-date): + New name for icalendar--datetime-to-noneuropean-date. Make old name + obsolete alias. + (icalendar--datetime-to-iso-date): New function. + (icalendar--datetime-to-diary-date): Doc fix. Respect + calendar-date-style if bound. + + * textmodes/remember.el (remember-diary-convert-entry): + Respect calendar-date-style if bound. + 2008-03-29 Stefan Monnier * 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." (if (< 8 month) (- month 8) (+ month 4)) (if (< 7 month) (- month 7) (+ month 5)))) (let ((m1 displayed-month) - (y1 displayed-year) - (m2 displayed-month) - (y2 displayed-year) + (y1 displayed-year) + (m2 displayed-month) + (y2 displayed-year) (year)) - (increment-calendar-month m1 y1 -1) - (increment-calendar-month m2 y2 1) + (increment-calendar-month m1 y1 -1) + (increment-calendar-month m2 y2 1) (let* ((start-date (calendar-absolute-from-gregorian (list m1 1 y1))) (end-date (calendar-absolute-from-gregorian (list m2 (calendar-last-day-of-month m2 y2) y2))) - (hebrew-start (calendar-hebrew-from-absolute start-date)) - (hebrew-end (calendar-hebrew-from-absolute end-date)) - (hebrew-y1 (extract-calendar-year hebrew-start)) + (hebrew-start (calendar-hebrew-from-absolute start-date)) + (hebrew-end (calendar-hebrew-from-absolute end-date)) + (hebrew-y1 (extract-calendar-year hebrew-start)) (hebrew-y2 (extract-calendar-year hebrew-end))) (setq year (if (< 6 month) hebrew-y2 hebrew-y1)) (let ((date (calendar-gregorian-from-absolute (calendar-absolute-from-hebrew (list month day year))))) - (if (calendar-date-is-visible-p date) + (if (calendar-date-is-visible-p date) (list (list date string)))))))) ;; h-r-h-e should be called from holidays code. @@ -595,20 +595,18 @@ window. See `list-hebrew-diary-entries' for more information." 'calendar-hebrew-from-absolute 'mark-hebrew-calendar-date-pattern)) + +(autoload 'diary-insert-entry-1 "diary-lib") + ;;;###cal-autoload (defun insert-hebrew-diary-entry (arg) "Insert a diary entry. For the Hebrew date corresponding to the date indicated by point. Prefix argument ARG makes the entry nonmarking." (interactive "P") - (let ((calendar-month-name-array calendar-hebrew-month-name-array-leap-year)) - (make-diary-entry - (concat hebrew-diary-entry-symbol - (calendar-date-string - (calendar-hebrew-from-absolute - (calendar-absolute-from-gregorian (calendar-cursor-to-date t))) - nil t)) - arg))) + (diary-insert-entry-1 nil arg calendar-hebrew-month-name-array-leap-year + hebrew-diary-entry-symbol + 'calendar-hebrew-from-absolute)) ;;;###cal-autoload (defun insert-monthly-hebrew-diary-entry (arg) @@ -616,16 +614,9 @@ Prefix argument ARG makes the entry nonmarking." For the day of the Hebrew month corresponding to the date indicated by point. Prefix argument ARG makes the entry nonmarking." (interactive "P") - (let ((calendar-date-display-form (if european-calendar-style - '(day " * ") - '("* " day ))) - (calendar-month-name-array calendar-hebrew-month-name-array-leap-year)) - (make-diary-entry - (concat hebrew-diary-entry-symbol - (calendar-date-string - (calendar-hebrew-from-absolute - (calendar-absolute-from-gregorian (calendar-cursor-to-date t))))) - arg))) + (diary-insert-entry-1 'monthly arg calendar-hebrew-month-name-array-leap-year + hebrew-diary-entry-symbol + 'calendar-hebrew-from-absolute)) ;;;###cal-autoload (defun insert-yearly-hebrew-diary-entry (arg) @@ -633,16 +624,9 @@ Prefix argument ARG makes the entry nonmarking." For the day of the Hebrew year corresponding to the date indicated by point. Prefix argument ARG makes the entry nonmarking." (interactive "P") - (let ((calendar-date-display-form (if european-calendar-style - '(day " " monthname) - '(monthname " " day))) - (calendar-month-name-array calendar-hebrew-month-name-array-leap-year)) - (make-diary-entry - (concat hebrew-diary-entry-symbol - (calendar-date-string - (calendar-hebrew-from-absolute - (calendar-absolute-from-gregorian (calendar-cursor-to-date t))))) - arg))) + (diary-insert-entry-1 'yearly arg calendar-hebrew-month-name-array-leap-year + hebrew-diary-entry-symbol + 'calendar-hebrew-from-absolute)) ;;;###autoload (defun list-yahrzeit-dates (death-date start-year end-year) @@ -745,23 +729,24 @@ use when highlighting the day in the calendar." (defvar entry) +(autoload 'diary-make-date "diary-lib") + ;;;###diary-autoload (defun diary-yahrzeit (death-month death-day death-year &optional mark) "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before. -Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary entry is assumed -to be the name of the person. Date of death is on the *civil* calendar; -although the date of death is specified by the civil calendar, the proper -Hebrew calendar Yahrzeit is determined. If `european-calendar-style' is -non-nil, the order of the parameters is changed to DEATH-DAY, DEATH-MONTH, -DEATH-YEAR. +Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary +entry is assumed to be the name of the person. Although the date +of death is specified by the civil calendar, the proper Hebrew +calendar Yahrzeit is determined. + +The order of the input parameters changes according to `calendar-date-style' +\(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style). An optional parameter MARK specifies a face or single-character string to use when highlighting the day in the calendar." (let* ((h-date (calendar-hebrew-from-absolute (calendar-absolute-from-gregorian - (if european-calendar-style - (list death-day death-month death-year) - (list death-month death-day death-year))))) + (diary-make-date death-month death-day death-year)))) (h-month (extract-calendar-month h-date)) (h-day (extract-calendar-day h-date)) (h-year (extract-calendar-year h-date))