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 03:41:17 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/03/09 03:41:17

Index: diary-lib.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/diary-lib.el,v
retrieving revision 1.135
retrieving revision 1.136
diff -u -b -r1.135 -r1.136
--- diary-lib.el        8 Mar 2008 23:37:54 -0000       1.135
+++ diary-lib.el        9 Mar 2008 03:41:17 -0000       1.136
@@ -164,7 +164,7 @@
 As the files are processed for diary entries, these functions are used
 to cull relevant entries.  You can use either or both of
 `mark-hebrew-diary-entries', `mark-islamic-diary-entries' and
-`mark-bahai-diary-entries'.  The documentation for these functions
+`bahai-mark-diary-entries'.  The documentation for these functions
 describes the style of such diary entries."
   :type 'hook
   :options '(mark-hebrew-diary-entries
@@ -650,6 +650,8 @@
     `diary-hook' is run last.  This can be used for an appointment
         notification function.
 
+Functions called by these hooks may use DATE and NUMBER.
+
 If LIST-ONLY is non-nil don't modify or display the buffer, only return a 
list."
   (unless number
     (setq number (if (vectorp number-of-diary-entries)
@@ -748,13 +750,12 @@
                               (unless list-only
                                 (remove-overlays date-start (point)
                                                  'invisible 'diary))
-                             ; FIXME free variable entry?
-                             (setq entry (buffer-substring entry-start (point))
-                                   temp (diary-pull-attrs entry 
file-glob-attrs)
-                                   entry (nth 0 temp))
+                             (setq temp (diary-pull-attrs
+                                         (buffer-substring entry-start (point))
+                                         file-glob-attrs))
                               (add-to-diary-list
                                date
-                               entry
+                               (car temp)
                                (buffer-substring
                                 (1+ date-start) (1- entry-start))
                                (copy-marker entry-start) (nth 1 temp)))))))
@@ -923,10 +924,10 @@
             (holiday-list-last-month 1)
             (holiday-list-last-year 1)
             (date (list 0 0 0)))
-        (while entry-list
-          (if (not (calendar-date-equal date (car (car entry-list))))
+       (dolist (entry entry-list)
+          (if (not (calendar-date-equal date (car entry)))
               (progn
-                (setq date (car (car entry-list)))
+                (setq date (car entry))
                 (and holidays-in-diary-buffer
                      (calendar-date-compare
                       (list (list holiday-list-last-month
@@ -937,8 +938,8 @@
                       (list date))
                      ;; We need to get the holidays for the next 3 months.
                      (setq holiday-list-last-month
-                           (extract-calendar-month date))
-                     (setq holiday-list-last-year
+                           (extract-calendar-month date)
+                          holiday-list-last-year
                            (extract-calendar-year date))
                      (progn
                        (increment-calendar-month
@@ -960,7 +961,7 @@
                                 (setq d (append d (cdr (car h)))))
                             (setq h (cdr h)))
                           d)))
-                  (insert (if (= (point) (point-min)) "" ?\n) date-string)
+                  (insert (if (bobp) "" ?\n) date-string)
                   (if date-holiday-list (insert ":  "))
                   (let* ((l (current-column))
                          (longest 0))
@@ -971,25 +972,21 @@
                                        date-holiday-list
                                        (concat "\n" (make-string l ? ))))
                     (insert ?\n (make-string (+ l longest) ?=) ?\n)))))
-
-         ;; FIXME free variable entry?
-         (setq entry (car (cdr (car entry-list))))
-         (if (< 0 (length entry))
-              (let ((this-entry (car entry-list))
+         (let ((this-entry (cadr entry))
                     this-loc)
-               (if (setq this-loc (nth 3 this-entry))
-                   (insert-button (concat entry "\n")
+           (unless (zerop (length this-entry))
+             (if (setq this-loc (nth 3 entry))
+                 (insert-button (concat this-entry "\n")
                                    ;; (MARKER FILENAME SPECIFIER LITERAL)
                                    'locator (list (car this-loc)
                                                   (cadr this-loc)
-                                                  (nth 2 this-entry)
+                                               (nth 2 entry)
                                                   (or (nth 2 this-loc)
-                                                      (nth 1 this-entry)))
+                                                   (nth 1 entry)))
                                   :type 'diary-entry)
-                 ; FIXME free variable entry?
-                 (insert entry ?\n))
+               (insert this-entry ?\n))
                (save-excursion
-                  (let* ((marks (nth 4 this-entry))
+               (let* ((marks (nth 4 entry))
                          (faceinfo marks)
                          temp-face)
                     (when marks
@@ -1011,11 +1008,10 @@
                       (setq marks (delq nil marks))
                       ;; Apply the font aspects.
                       (apply 'set-face-attribute temp-face nil marks)
-                      (search-backward entry)
+                   (search-backward this-entry)
                       (overlay-put
                        (make-overlay (match-beginning 0) (match-end 0))
-                       'face temp-face))))))
-         (setq entry-list (cdr entry-list))))
+                    'face temp-face))))))))
       (set-buffer-modified-p nil)
       (goto-char (point-min))
       (setq buffer-read-only t)
@@ -1251,12 +1247,10 @@
                                          (+ y 100)
                                        y)))
                                (string-to-number y-str)))))
-                  (let ((tmp (diary-pull-attrs (buffer-substring-no-properties
+                 (setq marks (nth 1
+                                  (diary-pull-attrs 
(buffer-substring-no-properties
                                                 (point) (line-end-position))
                                                file-glob-attrs)))
-                   ;; FIXME free variable entry.
-                    (setq entry (nth 0 tmp)
-                          marks (nth 1 tmp)))
                   (if dd-name
                       (mark-calendar-days-named
                        (cdr (assoc-string
@@ -1453,7 +1447,7 @@
 
 (defun list-sexp-diary-entries (date)
   "Add sexp entries for DATE from the diary file to `diary-entries-list'.
-Also, Make them visible in the diary file.  Returns t if any entries were
+Also, make them visible in the diary file.  Returns t if any entries were
 found.
 
 Sexp diary entries must be prefaced by a `sexp-diary-entry-symbol' (normally




reply via email to

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