]> git.eshelyaron.com Git - emacs.git/commitdiff
* etc/NEWS: Mention nil `calendar-mode-line-format' will not modify
authorChristopher Schmidt <ch@ristopher.com>
Sat, 13 Sep 2014 17:44:32 +0000 (19:44 +0200)
committerChristopher Schmidt <ch@ristopher.com>
Sat, 13 Sep 2014 17:44:32 +0000 (19:44 +0200)
the mode line of the calendar buffer.
* lisp/calendar/calendar.el (calendar-update-mode-line):
Do not overwrite mode-line-format if calendar-mode-line-format is nil.
(Bug#18467)

etc/ChangeLog
etc/NEWS
lisp/ChangeLog
lisp/calendar/calendar.el

index 404822a79ea59db3bd4fd09fe69d0ca8cda4485a..42bd7cb40d1c452b65b1735406344836e40d1a47 100644 (file)
@@ -1,3 +1,8 @@
+2014-09-13  Christopher Schmidt  <ch@ristopher.com>
+
+       * NEWS: Mention nil `calendar-mode-line-format' will not modify
+       the mode line of the calendar buffer.  (Bug#18467)
+
 2014-09-06  Leo Liu  <sdl.web@gmail.com>
 
        * NEWS: Mention vector qpattern for pcase.  (Bug#18327).
index 56aa9958bd0f994256b1e38986f3286676ed22c1..44f54369793f73cb4c7cbca75513e30e78a77b3a 100644 (file)
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -127,6 +127,9 @@ appending FUN to `minibuffer-setup-hook'.
 *** Calendar can list and mark diary entries with Chinese dates.
 See `diary-chinese-list-entries' and `diary-chinese-mark-entries'.
 
+*** The mode line of the calendar buffer will not be modified if
+`calendar-mode-line-format' is nil.
+
 ** New ERT function `ert-summarize-tests-batch-and-exit'.
 
 ---
index f0b767886cbbc6f1f6a340a2f141cc784e99ee6e..7a4cf2e902780465cff326e9502d7dd910803f5e 100644 (file)
@@ -1,3 +1,9 @@
+2014-09-13  Christopher Schmidt  <ch@ristopher.com>
+
+       * calendar/calendar.el (calendar-update-mode-line):
+       Do not overwrite mode-line-format if calendar-mode-line-format is
+       nil.  (Bug#18467)
+
 2014-09-13  Leo Liu  <sdl.web@gmail.com>
 
        * emacs-lisp/pcase.el (pcase--dontwarn-upats): New var.
index 2b8c359047fd650b80e264b818c3ab47c2de9a9b..199b21ecd773ef5050dd023ce89ae67378407da9 100644 (file)
@@ -1804,14 +1804,18 @@ is COMMAND's keybinding, STRING describes the binding."
                               nil "today"))
    '(calendar-date-string (calendar-current-date) t)
    (calendar-mode-line-entry 'calendar-scroll-left "next month" ">"))
-  "The mode line of the calendar buffer.
+  "If non-nil, the mode line of the calendar buffer.
 This is a list of items that evaluate to strings.  The elements
 are evaluated and concatenated, evenly separated by blanks.
 During evaluation, the variable `date' is available as the date
 nearest the cursor (or today's date if that fails).  To update
-the mode-line as the cursor moves, add `calendar-update-mode-line'
-to `calendar-move-hook'.  Here is an example that has the Hebrew date,
-the day number/days remaining in the year, and the ISO week/year numbers:
+the mode-line as the cursor moves, add
+`calendar-update-mode-line' to `calendar-move-hook'.
+
+If nil, do not modify the mode line at all.
+
+Here is an example that has the Hebrew date, the day number/days
+remaining in the year, and the ISO week/year numbers:
 
   (list
    \"\"
@@ -1889,7 +1893,8 @@ the STRINGS are just concatenated and the result truncated."
 
 (defun calendar-update-mode-line ()
   "Update the calendar mode line with the current date and date style."
-  (if (bufferp (get-buffer calendar-buffer))
+  (if (and calendar-mode-line-format
+           (bufferp (get-buffer calendar-buffer)))
       (with-current-buffer calendar-buffer
         (let ((start (- calendar-left-margin 2))
               (date (condition-case nil