From: Christopher Schmidt Date: Sat, 13 Sep 2014 17:44:32 +0000 (+0200) Subject: * etc/NEWS: Mention nil `calendar-mode-line-format' will not modify X-Git-Tag: emacs-25.0.90~2635^2~679^2~295 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=2805ba196436a4f24344f9ef39942f772a221ac6;p=emacs.git * etc/NEWS: Mention nil `calendar-mode-line-format' will not modify 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) --- diff --git a/etc/ChangeLog b/etc/ChangeLog index 404822a79ea..42bd7cb40d1 100644 --- a/etc/ChangeLog +++ b/etc/ChangeLog @@ -1,3 +1,8 @@ +2014-09-13 Christopher Schmidt + + * NEWS: Mention nil `calendar-mode-line-format' will not modify + the mode line of the calendar buffer. (Bug#18467) + 2014-09-06 Leo Liu * NEWS: Mention vector qpattern for pcase. (Bug#18327). diff --git a/etc/NEWS b/etc/NEWS index 56aa9958bd0..44f54369793 100644 --- 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'. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f0b767886cb..7a4cf2e9027 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,9 @@ +2014-09-13 Christopher Schmidt + + * 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 * emacs-lisp/pcase.el (pcase--dontwarn-upats): New var. diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index 2b8c359047f..199b21ecd77 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el @@ -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