]> git.eshelyaron.com Git - emacs.git/commitdiff
Autoload diary-insert-entry-1.
authorGlenn Morris <rgm@gnu.org>
Sat, 29 Mar 2008 02:46:54 +0000 (02:46 +0000)
committerGlenn Morris <rgm@gnu.org>
Sat, 29 Mar 2008 02:46:54 +0000 (02:46 +0000)
(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.

lisp/ChangeLog
lisp/calendar/cal-hebrew.el

index c7dc80a6d65a19a29e5629c1ffec74d29ad42ad1..cb8939ad470d516bf782a8618ac417dc266d6694 100644 (file)
@@ -1,3 +1,52 @@
+2008-03-29  Glenn Morris  <rgm@gnu.org>
+
+       * 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  <monnier@iro.umontreal.ca>
 
        * xt-mouse.el (xterm-mouse-mode): Use delete-terminal-functions.
index d30dc2955967340bfc3b47b356dc1587e42b733a..1e97d62df0d3f2e26a4feb9d074af62bda6b8552 100644 (file)
@@ -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))