changeset 92898:3aa36f5712f6

(mark-diary-entries): Move some constant variables outside the diary-date-forms loop.
author Glenn Morris <rgm@gnu.org>
date Fri, 14 Mar 2008 02:52:35 +0000
parents 478f528ad208
children f1e7eae84755
files lisp/calendar/diary-lib.el
diffstat 1 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/diary-lib.el	Fri Mar 14 02:49:59 2008 +0000
+++ b/lisp/calendar/diary-lib.el	Fri Mar 14 02:52:35 2008 +0000
@@ -1094,6 +1094,16 @@
     (setq mark-diary-entries-in-calendar nil)
     (redraw-calendar))
   (let ((marking-diary-entries t)
+        (dayname
+         (diary-name-pattern calendar-day-name-array
+                             calendar-day-abbrev-array))
+        (monthname
+         (format "%s\\|\\*"
+                 (diary-name-pattern calendar-month-name-array
+                                     calendar-month-abbrev-array)))
+        (month "[0-9]+\\|\\*")
+        (day "[0-9]+\\|\\*")
+        (year "[0-9]+\\|\\*")
         file-glob-attrs marks)
     (with-current-buffer (find-file-noselect (diary-check-diary-file) t)
       (save-excursion
@@ -1105,17 +1115,7 @@
           (dolist (date-form diary-date-forms)
             (if (eq (car date-form) 'backup)
                 (setq date-form (cdr date-form))) ; ignore 'backup directive
-            (let* ((dayname
-                    (diary-name-pattern calendar-day-name-array
-                                        calendar-day-abbrev-array))
-                   (monthname
-                    (format "%s\\|\\*"
-                            (diary-name-pattern calendar-month-name-array
-                                                calendar-month-abbrev-array)))
-                   (month "[0-9]+\\|\\*")
-                   (day "[0-9]+\\|\\*")
-                   (year "[0-9]+\\|\\*")
-                   (l (length date-form))
+            (let* ((l (length date-form))
                    (d-name-pos (- l (length (memq 'dayname date-form))))
                    (d-name-pos (if (/= l d-name-pos) (+ 1 d-name-pos)))
                    (m-name-pos (- l (length (memq 'monthname date-form))))