emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/diary-lib.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/diary-lib.el,v
Date: Sun, 09 Mar 2008 19:56:34 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/03/09 19:56:33

Index: diary-lib.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/diary-lib.el,v
retrieving revision 1.136
retrieving revision 1.137
diff -u -b -r1.136 -r1.137
--- diary-lib.el        9 Mar 2008 03:41:17 -0000       1.136
+++ diary-lib.el        9 Mar 2008 19:56:33 -0000       1.137
@@ -650,7 +650,10 @@
     `diary-hook' is run last.  This can be used for an appointment
         notification function.
 
-Functions called by these hooks may use DATE and NUMBER.
+Functions called by these hooks may use the variables ORIGINAL-DATE
+and NUMBER, which are the arguments with which this function was called.
+Note that hook functions should _not_ use DATE, but ORIGINAL-DATE.
+\(Sexp diary entries may use DATE - see `list-sexp-diary-entries').
 
 If LIST-ONLY is non-nil don't modify or display the buffer, only return a 
list."
   (unless number
@@ -658,7 +661,7 @@
                      (aref number-of-diary-entries (calendar-day-of-week date))
                    number-of-diary-entries)))
   (when (> number 0)
-    (let ((original-date date);; save for possible use in the hooks
+    (let ((original-date date)   ; save for possible use in the hooks
           diary-entries-list
           file-glob-attrs
           (date-string (calendar-date-string date))
@@ -701,8 +704,7 @@
                         (year (extract-calendar-year date))
                         (entry-found (list-sexp-diary-entries date)))
                     (dolist (date-form diary-date-forms)
-                      (let*
-                          ((backup (when (eq (car date-form) 'backup)
+                      (let ((backup (when (eq (car date-form) 'backup)
                                      (setq date-form (cdr date-form))
                                      t))
                            (dayname
@@ -797,7 +799,7 @@
            (regexp-quote diary-include-string)
            " \"\\([^\"]*\\)\"")
           nil t)
-    (let* ((diary-file (substitute-in-file-name
+    (let ((diary-file (substitute-in-file-name
                         (match-string-no-properties 1)))
            (diary-list-include-blanks nil)
            (list-diary-entries-hook 'include-other-diary-files)
@@ -951,19 +953,15 @@
                              (calendar-holiday-list)))
                      (increment-calendar-month
                       holiday-list-last-month holiday-list-last-year 1))
-                (let* ((date-string (calendar-date-string date))
-                       (date-holiday-list
-                        (let ((h holiday-list)
-                              (d))
+                (let (date-holiday-list)
                           ;; Make a list of all holidays for date.
-                          (while h
-                            (if (calendar-date-equal date (car (car h)))
-                                (setq d (append d (cdr (car h)))))
-                            (setq h (cdr h)))
-                          d)))
-                  (insert (if (bobp) "" ?\n) date-string)
+                 (dolist (h holiday-list)
+                   (if (calendar-date-equal date (car h))
+                       (setq date-holiday-list (append date-holiday-list
+                                                       (cdr h)))))
+                  (insert (if (bobp) "" ?\n) (calendar-date-string date))
                   (if date-holiday-list (insert ":  "))
-                  (let* ((l (current-column))
+                  (let ((l (current-column))
                          (longest 0))
                     (insert (mapconcat (lambda (x)
                                         (if (< longest (length x))
@@ -1185,7 +1183,7 @@
         (with-syntax-table diary-syntax-table
           (dolist (date-form diary-date-forms)
             (if (eq (car date-form) 'backup)
-                (setq date-form (cdr date-form))) ;; ignore 'backup directive
+                (setq date-form (cdr date-form))) ; ignore 'backup directive
             (let* ((dayname
                     (diary-name-pattern calendar-day-name-array
                                         calendar-day-abbrev-array))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]