diff options
| -rw-r--r-- | lisp/calendar/calendar.el | 101 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 15 |
2 files changed, 61 insertions, 55 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el index bfe533fd607..4bf8b67ee53 100644 --- a/lisp/calendar/calendar.el +++ b/lisp/calendar/calendar.el | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | ;;; calendar.el --- calendar functions | 1 | ;;; calendar.el --- calendar functions -*- lexical-binding:t -*- |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1988-1995, 1997, 2000-2018 Free Software Foundation, | 3 | ;; Copyright (C) 1988-1995, 1997, 2000-2018 Free Software Foundation, |
| 4 | ;; Inc. | 4 | ;; Inc. |
| @@ -403,7 +403,7 @@ redisplays the diary for whatever date the cursor is moved to." | |||
| 403 | (defcustom calendar-date-echo-text | 403 | (defcustom calendar-date-echo-text |
| 404 | "mouse-2: general menu\nmouse-3: menu for this date" | 404 | "mouse-2: general menu\nmouse-3: menu for this date" |
| 405 | "String displayed when the cursor is over a date in the calendar. | 405 | "String displayed when the cursor is over a date in the calendar. |
| 406 | Can be either a fixed string, or a lisp expression that returns one. | 406 | Can be either a fixed string, or a Lisp expression that returns one. |
| 407 | When this expression is evaluated, DAY, MONTH, and YEAR are | 407 | When this expression is evaluated, DAY, MONTH, and YEAR are |
| 408 | integers appropriate to the relevant date. For example, to | 408 | integers appropriate to the relevant date. For example, to |
| 409 | display the ISO date: | 409 | display the ISO date: |
| @@ -497,8 +497,8 @@ Then redraw the calendar, if necessary." | |||
| 497 | (defcustom calendar-left-margin 5 | 497 | (defcustom calendar-left-margin 5 |
| 498 | "Empty space to the left of the first month in the calendar." | 498 | "Empty space to the left of the first month in the calendar." |
| 499 | :group 'calendar | 499 | :group 'calendar |
| 500 | :initialize 'custom-initialize-default | 500 | :initialize #'custom-initialize-default |
| 501 | :set 'calendar-set-layout-variable | 501 | :set #'calendar-set-layout-variable |
| 502 | :type 'integer | 502 | :type 'integer |
| 503 | :version "23.1") | 503 | :version "23.1") |
| 504 | 504 | ||
| @@ -508,7 +508,7 @@ Then redraw the calendar, if necessary." | |||
| 508 | (defcustom calendar-intermonth-spacing 4 | 508 | (defcustom calendar-intermonth-spacing 4 |
| 509 | "Space between months in the calendar. Minimum value is 1." | 509 | "Space between months in the calendar. Minimum value is 1." |
| 510 | :group 'calendar | 510 | :group 'calendar |
| 511 | :initialize 'custom-initialize-default | 511 | :initialize #'custom-initialize-default |
| 512 | :set (lambda (sym val) | 512 | :set (lambda (sym val) |
| 513 | (calendar-set-layout-variable sym val 1)) | 513 | (calendar-set-layout-variable sym val 1)) |
| 514 | :type 'integer | 514 | :type 'integer |
| @@ -517,7 +517,7 @@ Then redraw the calendar, if necessary." | |||
| 517 | ;; FIXME calendar-month-column-width? | 517 | ;; FIXME calendar-month-column-width? |
| 518 | (defcustom calendar-column-width 3 | 518 | (defcustom calendar-column-width 3 |
| 519 | "Width of each day column in the calendar. Minimum value is 3." | 519 | "Width of each day column in the calendar. Minimum value is 3." |
| 520 | :initialize 'custom-initialize-default | 520 | :initialize #'custom-initialize-default |
| 521 | :set (lambda (sym val) | 521 | :set (lambda (sym val) |
| 522 | (calendar-set-layout-variable sym val 3)) | 522 | (calendar-set-layout-variable sym val 3)) |
| 523 | :type 'integer | 523 | :type 'integer |
| @@ -537,7 +537,7 @@ WIDTH defaults to `calendar-day-header-width'." | |||
| 537 | "Width of the day column headers in the calendar. | 537 | "Width of the day column headers in the calendar. |
| 538 | Must be at least one less than `calendar-column-width'." | 538 | Must be at least one less than `calendar-column-width'." |
| 539 | :group 'calendar | 539 | :group 'calendar |
| 540 | :initialize 'custom-initialize-default | 540 | :initialize #'custom-initialize-default |
| 541 | :set (lambda (sym val) | 541 | :set (lambda (sym val) |
| 542 | (or (calendar-customized-p 'calendar-day-header-array) | 542 | (or (calendar-customized-p 'calendar-day-header-array) |
| 543 | (setq calendar-day-header-array | 543 | (setq calendar-day-header-array |
| @@ -550,7 +550,7 @@ Must be at least one less than `calendar-column-width'." | |||
| 550 | (defcustom calendar-day-digit-width 2 | 550 | (defcustom calendar-day-digit-width 2 |
| 551 | "Width of the day digits in the calendar. Minimum value is 2." | 551 | "Width of the day digits in the calendar. Minimum value is 2." |
| 552 | :group 'calendar | 552 | :group 'calendar |
| 553 | :initialize 'custom-initialize-default | 553 | :initialize #'custom-initialize-default |
| 554 | :set (lambda (sym val) | 554 | :set (lambda (sym val) |
| 555 | (calendar-set-layout-variable sym val 2)) | 555 | (calendar-set-layout-variable sym val 2)) |
| 556 | :type 'integer | 556 | :type 'integer |
| @@ -574,8 +574,8 @@ See `calendar-intermonth-text'." | |||
| 574 | 574 | ||
| 575 | (defcustom calendar-intermonth-text nil | 575 | (defcustom calendar-intermonth-text nil |
| 576 | "Text to display in the space to the left of each calendar month. | 576 | "Text to display in the space to the left of each calendar month. |
| 577 | Can be nil, a fixed string, or a lisp expression that returns a string. | 577 | Can be nil, a fixed string, or a Lisp expression that returns a string. |
| 578 | When the expression is evaluated, the variables DAY, MONTH and YEAR | 578 | When the expression is evaluated, the variables `day', `month' and `year' |
| 579 | are integers appropriate for the first day in each week. | 579 | are integers appropriate for the first day in each week. |
| 580 | Will be truncated to the smaller of `calendar-left-margin' and | 580 | Will be truncated to the smaller of `calendar-left-margin' and |
| 581 | `calendar-intermonth-spacing'. The last character is forced to be a space. | 581 | `calendar-intermonth-spacing'. The last character is forced to be a space. |
| @@ -746,7 +746,7 @@ calendar package is already loaded). Rather, use either | |||
| 746 | (const european :tag "Day/Month/Year") | 746 | (const european :tag "Day/Month/Year") |
| 747 | (const iso :tag "Year/Month/Day")) | 747 | (const iso :tag "Year/Month/Day")) |
| 748 | :initialize 'custom-initialize-default | 748 | :initialize 'custom-initialize-default |
| 749 | :set (lambda (symbol value) | 749 | :set (lambda (_symbol value) |
| 750 | (calendar-set-date-style value)) | 750 | (calendar-set-date-style value)) |
| 751 | :group 'calendar) | 751 | :group 'calendar) |
| 752 | 752 | ||
| @@ -971,7 +971,7 @@ Normally you should not customize this, but `calendar-month-header'." | |||
| 971 | calendar-european-month-header) | 971 | calendar-european-month-header) |
| 972 | (t calendar-american-month-header)) | 972 | (t calendar-american-month-header)) |
| 973 | "Expression to evaluate to return the calendar month headings. | 973 | "Expression to evaluate to return the calendar month headings. |
| 974 | When this expression is evaluated, the variables MONTH and YEAR are | 974 | When this expression is evaluated, the variables `month' and `year' are |
| 975 | integers appropriate to the relevant month. The result is padded | 975 | integers appropriate to the relevant month. The result is padded |
| 976 | to the width of `calendar-month-digit-width'. | 976 | to the width of `calendar-month-digit-width'. |
| 977 | 977 | ||
| @@ -1136,7 +1136,7 @@ MON defaults to `displayed-month'. YR defaults to `displayed-year'." | |||
| 1136 | (defmacro calendar-in-read-only-buffer (buffer &rest body) | 1136 | (defmacro calendar-in-read-only-buffer (buffer &rest body) |
| 1137 | "Switch to BUFFER and execute the forms in BODY. | 1137 | "Switch to BUFFER and execute the forms in BODY. |
| 1138 | First creates or erases BUFFER as needed. Leaves BUFFER read-only, | 1138 | First creates or erases BUFFER as needed. Leaves BUFFER read-only, |
| 1139 | with disabled undo. Leaves point at point-min, displays BUFFER." | 1139 | with disabled undo. Leaves point at `point-min', displays BUFFER." |
| 1140 | (declare (indent 1) (debug t)) | 1140 | (declare (indent 1) (debug t)) |
| 1141 | `(progn | 1141 | `(progn |
| 1142 | (set-buffer (get-buffer-create ,buffer)) | 1142 | (set-buffer (get-buffer-create ,buffer)) |
| @@ -1388,7 +1388,7 @@ Optional integers MON and YR are used instead of today's date." | |||
| 1388 | (let* ((inhibit-read-only t) | 1388 | (let* ((inhibit-read-only t) |
| 1389 | (today (calendar-current-date)) | 1389 | (today (calendar-current-date)) |
| 1390 | (month (calendar-extract-month today)) | 1390 | (month (calendar-extract-month today)) |
| 1391 | (day (calendar-extract-day today)) | 1391 | ;; (day (calendar-extract-day today)) |
| 1392 | (year (calendar-extract-year today)) | 1392 | (year (calendar-extract-year today)) |
| 1393 | (today-visible (or (not mon) | 1393 | (today-visible (or (not mon) |
| 1394 | (<= (abs (calendar-interval mon yr month year)) 1))) | 1394 | (<= (abs (calendar-interval mon yr month year)) 1))) |
| @@ -1490,8 +1490,9 @@ line." | |||
| 1490 | (goto-char (point-min)) | 1490 | (goto-char (point-min)) |
| 1491 | (calendar-move-to-column indent) | 1491 | (calendar-move-to-column indent) |
| 1492 | (insert | 1492 | (insert |
| 1493 | (calendar-string-spread (list calendar-month-header) | 1493 | (calendar-dlet* ((month month) (year year)) |
| 1494 | ?\s calendar-month-digit-width)) | 1494 | (calendar-string-spread (list calendar-month-header) |
| 1495 | ?\s calendar-month-digit-width))) | ||
| 1495 | (calendar-ensure-newline) | 1496 | (calendar-ensure-newline) |
| 1496 | (calendar-insert-at-column indent calendar-intermonth-header trunc) | 1497 | (calendar-insert-at-column indent calendar-intermonth-header trunc) |
| 1497 | ;; Use the first N characters of each day to head the columns. | 1498 | ;; Use the first N characters of each day to head the columns. |
| @@ -1506,7 +1507,8 @@ line." | |||
| 1506 | calendar-day-header-width nil ?\s) | 1507 | calendar-day-header-width nil ?\s) |
| 1507 | (make-string (- calendar-column-width calendar-day-header-width) ?\s))) | 1508 | (make-string (- calendar-column-width calendar-day-header-width) ?\s))) |
| 1508 | (calendar-ensure-newline) | 1509 | (calendar-ensure-newline) |
| 1509 | (calendar-insert-at-column indent calendar-intermonth-text trunc) | 1510 | (calendar-dlet* ((day day) (month month) (year year)) |
| 1511 | (calendar-insert-at-column indent calendar-intermonth-text trunc)) | ||
| 1510 | ;; Add blank days before the first of the month. | 1512 | ;; Add blank days before the first of the month. |
| 1511 | (insert (make-string (* blank-days calendar-column-width) ?\s)) | 1513 | (insert (make-string (* blank-days calendar-column-width) ?\s)) |
| 1512 | ;; Put in the days of the month. | 1514 | ;; Put in the days of the month. |
| @@ -1526,7 +1528,8 @@ line." | |||
| 1526 | (/= day last)) | 1528 | (/= day last)) |
| 1527 | (calendar-ensure-newline) | 1529 | (calendar-ensure-newline) |
| 1528 | (setq day (1+ day)) ; first day of next week | 1530 | (setq day (1+ day)) ; first day of next week |
| 1529 | (calendar-insert-at-column indent calendar-intermonth-text trunc))))) | 1531 | (calendar-dlet* ((day day) (month month) (year year)) |
| 1532 | (calendar-insert-at-column indent calendar-intermonth-text trunc)))))) | ||
| 1530 | 1533 | ||
| 1531 | (defun calendar-redraw () | 1534 | (defun calendar-redraw () |
| 1532 | "Redraw the calendar display, if `calendar-buffer' is live." | 1535 | "Redraw the calendar display, if `calendar-buffer' is live." |
| @@ -1790,18 +1793,18 @@ For a complete description, see the info node `Calendar/Diary'. | |||
| 1790 | 1793 | ||
| 1791 | (defun calendar-string-spread (strings char length) | 1794 | (defun calendar-string-spread (strings char length) |
| 1792 | "Concatenate list of STRINGS separated with copies of CHAR to fill LENGTH. | 1795 | "Concatenate list of STRINGS separated with copies of CHAR to fill LENGTH. |
| 1793 | The effect is like mapconcat but the separating pieces are as balanced as | 1796 | The effect is like `mapconcat' but the separating pieces are as balanced as |
| 1794 | possible. Each item of STRINGS is evaluated before concatenation so it can | 1797 | possible. Each item of STRINGS is evaluated before concatenation so it can |
| 1795 | actually be an expression that evaluates to a string. If LENGTH is too short, | 1798 | actually be an expression that evaluates to a string. If LENGTH is too short, |
| 1796 | the STRINGS are just concatenated and the result truncated." | 1799 | the STRINGS are just concatenated and the result truncated." |
| 1797 | ;; The algorithm is based on equation (3.25) on page 85 of Concrete | 1800 | ;; The algorithm is based on equation (3.25) on page 85 of Concrete |
| 1798 | ;; Mathematics by Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, | 1801 | ;; Mathematics by Ronald L. Graham, Donald E. Knuth, and Oren Patashnik, |
| 1799 | ;; Addison-Wesley, Reading, MA, 1989. | 1802 | ;; Addison-Wesley, Reading, MA, 1989. |
| 1800 | (let* ((strings (mapcar 'eval | 1803 | (let* ((strings (mapcar #'eval |
| 1801 | (if (< (length strings) 2) | 1804 | (if (< (length strings) 2) |
| 1802 | (append (list "") strings (list "")) | 1805 | (append (list "") strings (list "")) |
| 1803 | strings))) | 1806 | strings))) |
| 1804 | (n (- length (string-width (apply 'concat strings)))) | 1807 | (n (- length (string-width (apply #'concat strings)))) |
| 1805 | (m (* (1- (length strings)) (char-width char))) | 1808 | (m (* (1- (length strings)) (char-width char))) |
| 1806 | (s (car strings)) | 1809 | (s (car strings)) |
| 1807 | (strings (cdr strings)) | 1810 | (strings (cdr strings)) |
| @@ -1818,17 +1821,18 @@ the STRINGS are just concatenated and the result truncated." | |||
| 1818 | (if (and calendar-mode-line-format | 1821 | (if (and calendar-mode-line-format |
| 1819 | (bufferp (get-buffer calendar-buffer))) | 1822 | (bufferp (get-buffer calendar-buffer))) |
| 1820 | (with-current-buffer calendar-buffer | 1823 | (with-current-buffer calendar-buffer |
| 1821 | (let ((start (- calendar-left-margin 2)) | 1824 | (let ((start (- calendar-left-margin 2))) |
| 1822 | (date (condition-case nil | 1825 | (calendar-dlet* ((date (condition-case nil |
| 1823 | (calendar-cursor-to-nearest-date) | 1826 | (calendar-cursor-to-nearest-date) |
| 1824 | (error (calendar-current-date))))) | 1827 | (error (calendar-current-date))))) |
| 1825 | (setq mode-line-format | 1828 | (setq mode-line-format |
| 1826 | (concat (make-string (max 0 (+ start | 1829 | (concat (make-string (max 0 (+ start |
| 1827 | (- (car (window-inside-edges)) | 1830 | (- (car (window-inside-edges)) |
| 1828 | (car (window-edges))))) ?\s) | 1831 | (car (window-edges))))) |
| 1829 | (calendar-string-spread | 1832 | ?\s) |
| 1830 | (mapcar 'eval calendar-mode-line-format) | 1833 | (calendar-string-spread |
| 1831 | ?\s (- calendar-right-margin (1- start)))))) | 1834 | calendar-mode-line-format |
| 1835 | ?\s (- calendar-right-margin (1- start))))))) | ||
| 1832 | (force-mode-line-update)))) | 1836 | (force-mode-line-update)))) |
| 1833 | 1837 | ||
| 1834 | (defun calendar-buffer-list () | 1838 | (defun calendar-buffer-list () |
| @@ -2060,11 +2064,11 @@ is a string to insert in the minibuffer before reading." | |||
| 2060 | Each abbreviation is no longer than MAXLEN (default `calendar-abbrev-length') | 2064 | Each abbreviation is no longer than MAXLEN (default `calendar-abbrev-length') |
| 2061 | characters." | 2065 | characters." |
| 2062 | (or maxlen (setq maxlen calendar-abbrev-length)) | 2066 | (or maxlen (setq maxlen calendar-abbrev-length)) |
| 2063 | (apply 'vector (mapcar | 2067 | (apply #'vector (mapcar |
| 2064 | (lambda (f) | 2068 | (lambda (f) |
| 2065 | ;; TODO? truncate-string-to-width? | 2069 | ;; TODO? truncate-string-to-width? |
| 2066 | (substring f 0 (min maxlen (length f)))) | 2070 | (substring f 0 (min maxlen (length f)))) |
| 2067 | full))) | 2071 | full))) |
| 2068 | 2072 | ||
| 2069 | (defcustom calendar-day-name-array | 2073 | (defcustom calendar-day-name-array |
| 2070 | ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"] | 2074 | ["Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday"] |
| @@ -2282,7 +2286,7 @@ If optional NODAY is t, does not ask for day, but just returns | |||
| 2282 | (month (cdr (assoc-string | 2286 | (month (cdr (assoc-string |
| 2283 | (completing-read | 2287 | (completing-read |
| 2284 | "Month name: " | 2288 | "Month name: " |
| 2285 | (mapcar 'list (append month-array nil)) | 2289 | (mapcar #'list (append month-array nil)) |
| 2286 | nil t) | 2290 | nil t) |
| 2287 | (calendar-make-alist month-array 1) t))) | 2291 | (calendar-make-alist month-array 1) t))) |
| 2288 | (last (calendar-last-day-of-month month year))) | 2292 | (last (calendar-last-day-of-month month year))) |
| @@ -2343,7 +2347,7 @@ interpreted as BC; -1 being 1 BC, and so on." | |||
| 2343 | (setq calendar-mark-holidays-flag nil | 2347 | (setq calendar-mark-holidays-flag nil |
| 2344 | calendar-mark-diary-entries-flag nil) | 2348 | calendar-mark-diary-entries-flag nil) |
| 2345 | (with-current-buffer calendar-buffer | 2349 | (with-current-buffer calendar-buffer |
| 2346 | (mapc 'delete-overlay (overlays-in (point-min) (point-max))))) | 2350 | (mapc #'delete-overlay (overlays-in (point-min) (point-max))))) |
| 2347 | 2351 | ||
| 2348 | (defun calendar-date-is-visible-p (date) | 2352 | (defun calendar-date-is-visible-p (date) |
| 2349 | "Return non-nil if DATE is valid and is visible in the calendar window." | 2353 | "Return non-nil if DATE is valid and is visible in the calendar window." |
| @@ -2446,7 +2450,7 @@ ATTRLIST is a list with elements of the form :face face :foreground color." | |||
| 2446 | (make-face temp-face) | 2450 | (make-face temp-face) |
| 2447 | (copy-face face temp-face) | 2451 | (copy-face face temp-face) |
| 2448 | ;; Apply the font aspects. | 2452 | ;; Apply the font aspects. |
| 2449 | (apply 'set-face-attribute temp-face nil (nreverse faceinfo)) | 2453 | (apply #'set-face-attribute temp-face nil (nreverse faceinfo)) |
| 2450 | temp-face))) | 2454 | temp-face))) |
| 2451 | 2455 | ||
| 2452 | (defun calendar-mark-visible-date (date &optional mark) | 2456 | (defun calendar-mark-visible-date (date &optional mark) |
| @@ -2518,13 +2522,14 @@ and day names to be abbreviated as specified by | |||
| 2518 | `calendar-month-abbrev-array' and `calendar-day-abbrev-array', | 2522 | `calendar-month-abbrev-array' and `calendar-day-abbrev-array', |
| 2519 | respectively. An optional parameter NODAYNAME, when t, omits the | 2523 | respectively. An optional parameter NODAYNAME, when t, omits the |
| 2520 | name of the day of the week." | 2524 | name of the day of the week." |
| 2521 | (let* ((dayname (unless nodayname (calendar-day-name date abbreviate))) | 2525 | (let ((month (calendar-extract-month date))) |
| 2522 | (month (calendar-extract-month date)) | 2526 | (calendar-dlet* |
| 2527 | ((dayname (unless nodayname (calendar-day-name date abbreviate))) | ||
| 2523 | (monthname (calendar-month-name month abbreviate)) | 2528 | (monthname (calendar-month-name month abbreviate)) |
| 2524 | (day (number-to-string (calendar-extract-day date))) | 2529 | (day (number-to-string (calendar-extract-day date))) |
| 2525 | (month (number-to-string month)) | 2530 | (month (number-to-string month)) |
| 2526 | (year (number-to-string (calendar-extract-year date)))) | 2531 | (year (number-to-string (calendar-extract-year date)))) |
| 2527 | (mapconcat 'eval calendar-date-display-form ""))) | 2532 | (mapconcat #'eval calendar-date-display-form "")))) |
| 2528 | 2533 | ||
| 2529 | (defun calendar-dayname-on-or-before (dayname date) | 2534 | (defun calendar-dayname-on-or-before (dayname date) |
| 2530 | "Return the absolute date of the DAYNAME on or before absolute DATE. | 2535 | "Return the absolute date of the DAYNAME on or before absolute DATE. |
| @@ -2627,11 +2632,11 @@ If called by a mouse-event, pops up a menu with the result." | |||
| 2627 | selection) | 2632 | selection) |
| 2628 | (if (mouse-event-p event) | 2633 | (if (mouse-event-p event) |
| 2629 | (and (setq selection (cal-menu-x-popup-menu event title | 2634 | (and (setq selection (cal-menu-x-popup-menu event title |
| 2630 | (mapcar 'list others))) | 2635 | (mapcar #'list others))) |
| 2631 | (call-interactively selection)) | 2636 | (call-interactively selection)) |
| 2632 | (calendar-in-read-only-buffer calendar-other-calendars-buffer | 2637 | (calendar-in-read-only-buffer calendar-other-calendars-buffer |
| 2633 | (calendar-set-mode-line title) | 2638 | (calendar-set-mode-line title) |
| 2634 | (insert (mapconcat 'identity others "\n")))))) | 2639 | (insert (mapconcat #'identity others "\n")))))) |
| 2635 | 2640 | ||
| 2636 | (defun calendar-print-day-of-year () | 2641 | (defun calendar-print-day-of-year () |
| 2637 | "Show day number in year/days remaining in year for date under the cursor." | 2642 | "Show day number in year/days remaining in year for date under the cursor." |
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'.") | |||
| 740 | 740 | ||
| 741 | (defvar diary-saved-point) ; bound in diary-list-entries | 741 | (defvar diary-saved-point) ; bound in diary-list-entries |
| 742 | (defvar diary-including) | 742 | (defvar diary-including) |
| 743 | (defvar date-string) ; bound in diary-list-entries | 743 | (defvar diary--date-string) ; bound in diary-list-entries |
| 744 | 744 | ||
| 745 | (defun diary-list-entries (date number &optional list-only) | 745 | (defun diary-list-entries (date number &optional list-only) |
| 746 | "Create and display a buffer containing the relevant lines in `diary-file'. | 746 | "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." | |||
| 794 | diary-number-of-entries))) | 794 | diary-number-of-entries))) |
| 795 | (when (> number 0) | 795 | (when (> number 0) |
| 796 | (let* ((original-date date) ; save for possible use in the hooks | 796 | (let* ((original-date date) ; save for possible use in the hooks |
| 797 | (date-string (calendar-date-string date)) | 797 | (diary--date-string (calendar-date-string date)) |
| 798 | (diary-buffer (find-buffer-visiting diary-file)) | 798 | (diary-buffer (find-buffer-visiting diary-file)) |
| 799 | ;; Dynamically bound in diary-include-files. | 799 | ;; Dynamically bound in diary-include-files. |
| 800 | (d-incp (and (boundp 'diary-including) diary-including)) | 800 | (d-incp (and (boundp 'diary-including) diary-including)) |
| @@ -952,7 +952,7 @@ Returns a cons (NOENTRIES . HOLIDAY-STRING)." | |||
| 952 | (let* ((holiday-list (if diary-show-holidays-flag | 952 | (let* ((holiday-list (if diary-show-holidays-flag |
| 953 | (calendar-check-holidays original-date))) | 953 | (calendar-check-holidays original-date))) |
| 954 | (hol-string (format "%s%s%s" | 954 | (hol-string (format "%s%s%s" |
| 955 | date-string | 955 | diary--date-string |
| 956 | (if holiday-list ": " "") | 956 | (if holiday-list ": " "") |
| 957 | (mapconcat #'identity holiday-list "; "))) | 957 | (mapconcat #'identity holiday-list "; "))) |
| 958 | (msg (format "No diary entries for %s" hol-string)) | 958 | (msg (format "No diary entries for %s" hol-string)) |
| @@ -970,9 +970,10 @@ Returns a cons (NOENTRIES . HOLIDAY-STRING)." | |||
| 970 | (message "%s" msg) | 970 | (message "%s" msg) |
| 971 | ;; holiday-list which is too wide for a message gets a buffer. | 971 | ;; holiday-list which is too wide for a message gets a buffer. |
| 972 | (calendar-in-read-only-buffer holiday-buffer | 972 | (calendar-in-read-only-buffer holiday-buffer |
| 973 | (calendar-set-mode-line (format "Holidays for %s" date-string)) | 973 | (calendar-set-mode-line (format "Holidays for %s" |
| 974 | diary--date-string)) | ||
| 974 | (insert (mapconcat #'identity holiday-list "\n"))) | 975 | (insert (mapconcat #'identity holiday-list "\n"))) |
| 975 | (message "No diary entries for %s" date-string))) | 976 | (message "No diary entries for %s" diary--date-string))) |
| 976 | (cons noentries hol-string))) | 977 | (cons noentries hol-string))) |
| 977 | 978 | ||
| 978 | 979 | ||
| @@ -1126,7 +1127,7 @@ This is an option for `diary-display-function'." | |||
| 1126 | (if (eq major-mode 'diary-fancy-display-mode) | 1127 | (if (eq major-mode 'diary-fancy-display-mode) |
| 1127 | (run-hooks 'diary-fancy-display-mode-hook) | 1128 | (run-hooks 'diary-fancy-display-mode-hook) |
| 1128 | (diary-fancy-display-mode)) | 1129 | (diary-fancy-display-mode)) |
| 1129 | (calendar-set-mode-line date-string)))) | 1130 | (calendar-set-mode-line diary--date-string)))) |
| 1130 | 1131 | ||
| 1131 | ;; FIXME modernize? | 1132 | ;; FIXME modernize? |
| 1132 | (defun diary-print-entries () | 1133 | (defun diary-print-entries () |
| @@ -1668,7 +1669,7 @@ Sexp diary entries must be prefaced by a `diary-sexp-entry-symbol' | |||
| 1668 | 1669 | ||
| 1669 | %%(SEXP) ENTRY | 1670 | %%(SEXP) ENTRY |
| 1670 | 1671 | ||
| 1671 | Both ENTRY and DATE are available when the SEXP is evaluated. If | 1672 | Both `entry' and `date' are available when the SEXP is evaluated. If |
| 1672 | the SEXP returns nil, the diary entry does not apply. If it | 1673 | the SEXP returns nil, the diary entry does not apply. If it |
| 1673 | returns a non-nil value, ENTRY will be taken to apply to DATE; if | 1674 | returns a non-nil value, ENTRY will be taken to apply to DATE; if |
| 1674 | the value is a string, that string will be the diary entry in the | 1675 | the value is a string, that string will be the diary entry in the |