summaryrefslogtreecommitdiff
path: root/lisp/calendar/diary-lib.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2018-01-18 23:01:35 -0500
committerStefan Monnier <monnier@iro.umontreal.ca>2018-01-18 23:01:35 -0500
commitffeb1164d43c351786bc1e93e441fcbc29f5207b (patch)
treec29da2aa58288ab6811cfd21dcb6dc7ca5d0da19 /lisp/calendar/diary-lib.el
parent47019a521f774fbd13441e178a6a82c9989b9912 (diff)
downloademacs-ffeb1164d43c351786bc1e93e441fcbc29f5207b.tar.gz
emacs-ffeb1164d43c351786bc1e93e441fcbc29f5207b.tar.bz2
emacs-ffeb1164d43c351786bc1e93e441fcbc29f5207b.zip
* lisp/calendar/calendar.el: Use lexical-binding
(calendar-generate-window): Remove unused variable `day'. (calendar-generate-month): Use calendar-dlet* to provide the dynbind vars promised by the respective docstrings. (calendar-update-mode-line): Use calendar-dlet* to provide `date' to calendar-mode-line-format. Don't call `eval' here since it's called in calendar-string-spread anyway! (calendar-date-string): Use calendar-dlet* to provide the dynbind vars promised by the docstring of calendar-date-display-form. * lisp/calendar/diary-lib.el (diary--date-string): Rename from date-string.
Diffstat (limited to 'lisp/calendar/diary-lib.el')
-rw-r--r--lisp/calendar/diary-lib.el15
1 files changed, 8 insertions, 7 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index c327717c8a6..181b1172fa6 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -740,7 +740,7 @@ Or to `diary-mark-entries'.")
(defvar diary-saved-point) ; bound in diary-list-entries
(defvar diary-including)
-(defvar date-string) ; bound in diary-list-entries
+(defvar diary--date-string) ; bound in diary-list-entries
(defun diary-list-entries (date number &optional list-only)
"Create and display a buffer containing the relevant lines in `diary-file'.
@@ -794,7 +794,7 @@ LIST-ONLY is non-nil, in which case it just returns the list."
diary-number-of-entries)))
(when (> number 0)
(let* ((original-date date) ; save for possible use in the hooks
- (date-string (calendar-date-string date))
+ (diary--date-string (calendar-date-string date))
(diary-buffer (find-buffer-visiting diary-file))
;; Dynamically bound in diary-include-files.
(d-incp (and (boundp 'diary-including) diary-including))
@@ -952,7 +952,7 @@ Returns a cons (NOENTRIES . HOLIDAY-STRING)."
(let* ((holiday-list (if diary-show-holidays-flag
(calendar-check-holidays original-date)))
(hol-string (format "%s%s%s"
- date-string
+ diary--date-string
(if holiday-list ": " "")
(mapconcat #'identity holiday-list "; ")))
(msg (format "No diary entries for %s" hol-string))
@@ -970,9 +970,10 @@ Returns a cons (NOENTRIES . HOLIDAY-STRING)."
(message "%s" msg)
;; holiday-list which is too wide for a message gets a buffer.
(calendar-in-read-only-buffer holiday-buffer
- (calendar-set-mode-line (format "Holidays for %s" date-string))
+ (calendar-set-mode-line (format "Holidays for %s"
+ diary--date-string))
(insert (mapconcat #'identity holiday-list "\n")))
- (message "No diary entries for %s" date-string)))
+ (message "No diary entries for %s" diary--date-string)))
(cons noentries hol-string)))
@@ -1126,7 +1127,7 @@ This is an option for `diary-display-function'."
(if (eq major-mode 'diary-fancy-display-mode)
(run-hooks 'diary-fancy-display-mode-hook)
(diary-fancy-display-mode))
- (calendar-set-mode-line date-string))))
+ (calendar-set-mode-line diary--date-string))))
;; FIXME modernize?
(defun diary-print-entries ()
@@ -1668,7 +1669,7 @@ Sexp diary entries must be prefaced by a `diary-sexp-entry-symbol'
%%(SEXP) ENTRY
-Both ENTRY and DATE are available when the SEXP is evaluated. If
+Both `entry' and `date' are available when the SEXP is evaluated. If
the SEXP returns nil, the diary entry does not apply. If it
returns a non-nil value, ENTRY will be taken to apply to DATE; if
the value is a string, that string will be the diary entry in the