]> git.eshelyaron.com Git - emacs.git/commitdiff
(update-calendar-mode-line): Force mode-line update.
authorRichard M. Stallman <rms@gnu.org>
Wed, 3 Apr 2002 14:36:02 +0000 (14:36 +0000)
committerRichard M. Stallman <rms@gnu.org>
Wed, 3 Apr 2002 14:36:02 +0000 (14:36 +0000)
Make date under the cursor available as `date' in
calendar-mode-line-format.
Eval items in calendar-mode-line-format list.

lisp/ChangeLog
lisp/calendar/calendar.el

index 2acf3fafcdf897cab8b996ca8388c26f03e03b51..60f0ce948aae08db11d48950c3a14981767a50ab 100644 (file)
@@ -1,3 +1,41 @@
+2002-04-03  Edward M. Reingold  <reingold@emr.cs.iit.edu>
+
+       * solar.el (solar-spring-or-summer-season): Deleted.
+       (solar-northern-spring-or-summer-season): New variable.
+       (solar-sunrise-and-sunset, solar-moment, solar-sunrise-sunset):
+       Rewritten.
+
+       * solar.el (diary-sabbath-candles-minutes): New variable.
+       (diary-sabbath-candles): Use it instead of fixed 18 minutes.
+
+       * calendar.el (update-calendar-mode-line): Force mode-line update.
+       Make date under the cursor available as `date' in
+       calendar-mode-line-format.
+       Eval items in calendar-mode-line-format list.
+
+       * cal-tex.el (cal-tex-hook, cal-tex-year-hook, cal-tex-month-hook,
+       cal-tex-week-hook, cal-tex-daily-hook): Add doc strings.
+
+       * cal-tex.el (cal-tex-latexify-list): Fix doc string.
+
+       * cal-tex.el (cal-tex-insert-day-names): LaTeXify day names.
+       (cal-tex-cursor-week-iso, cal-tex-week-hours, cal-tex-weekly4-box)
+       (cal-tex-cursor-filofax-2week, cal-tex-cursor-filofax-week)
+       (cal-tex-daily-page, cal-tex-mini-calendar): LaTeXify day names.
+
+       * cal-tex.el: Change all instances (interactive "P") to
+       (interactive "p").
+       (cal-tex-cursor-month): Add hfill and newline at end of month that
+       ended on Saturday.
+       (cal-tex-preamble): Change to LaTeX2e.
+       (cal-tex-cursor-filofax-year): Don't use default month names in
+       LaTeX macros in case user changes them.
+       (cal-tex-month-name): New function.  Used throughout in case user
+       has done something funny with month names.
+
+       * cal-hebrew.el (holiday-rosh-hashanah-etc): Spelling correction.
+       (diary-rosh-hodesh): Spelling correction.
+
 2002-04-03  Mike Williams  <mdub@bigfoot.com>
 
        * textmodes/sgml-mode.el (sgml-lexical-context)
index 99e6757c03ae24a564c5d30f1c239521a4ef5666..9eb9352843a3d643517073b61f2d5c8f447a0f69 100644 (file)
@@ -569,7 +569,7 @@ See the documentation of `diary-date-forms' for an explanation."
       european-date-diary-pattern
     american-date-diary-pattern)
   "*List of pseudo-patterns describing the forms of date used in the diary.
-The patterns on the list must be MUTUALLY EXCLUSIVE and must not match
+The patterns on the list must be MUTUALLY EXCLUSIVE and must should not match
 any portion of the diary entry itself, just the date component.
 
 A pseudo-pattern is a list of regular expressions and the keywords `month',
@@ -2075,7 +2075,32 @@ the inserted text.  Value is always t."
               'help-echo "mouse-2: scroll right"
               'keymap (make-mode-line-mouse-map
                        'mouse-2 #'scroll-calendar-right)))
-  "The mode line of the calendar buffer.")
+  "The mode line of the calendar buffer.
+
+This must be a list of items that evaluate to strings--those strings are
+evaluated and concatenated together, evenly separated by blanks.  The variable
+`date' is available for use as the date under (or near) the cursor; `date'
+defaults to the current date if it is otherwise undefined.  Here is an example
+value that has the Hebrew date, the day number/days reamining in the year,
+and the ISO week/year numbers in the mode.  When calendar-move-hook is set to
+'update-calendar-mode-line, these mode line shows these values for the date
+under the cursor:
+
+      (list
+       \"\"
+       '(calendar-hebrew-date-string date)
+       '(let* ((year (extract-calendar-year date))
+               (d (calendar-day-number date))
+               (days-remaining
+                (- (calendar-day-number (list 12 31 year)) d)))
+          (format \"%d/%d\" d days-remaining))
+       '(let* ((d (calendar-absolute-from-gregorian date))
+               (iso-date (calendar-iso-from-absolute d)))
+          (format \"ISO week %d of %d\"
+            (extract-calendar-month iso-date)
+            (extract-calendar-year iso-date)))
+       \"\"))
+")
 
 (defun calendar-goto-info-node ()
   "Go to the info node for the calendar."
@@ -2142,7 +2167,12 @@ the STRINGS are just concatenated and the result truncated."
         (set-buffer calendar-buffer)
         (setq mode-line-format
               (calendar-string-spread
-               calendar-mode-line-format ?  (frame-width))))))
+               (let ((date (condition-case nil
+                               (calendar-cursor-to-nearest-date)
+                             (error (calendar-current-date)))))
+                 (mapcar 'eval  calendar-mode-line-format))
+               ?  (frame-width)))
+        (force-mode-line-update))))
 
 (defun calendar-window-list ()
   "List of all calendar-related windows."