emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master feea2b5: * lisp/calendar/diary-lib.el: Fix bug#3005


From: Stefan Monnier
Subject: [Emacs-diffs] master feea2b5: * lisp/calendar/diary-lib.el: Fix bug#30051
Date: Wed, 10 Jan 2018 11:36:52 -0500 (EST)

branch: master
commit feea2b5b0df946e2ec9519220b9e1707064274ab
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/calendar/diary-lib.el: Fix bug#30051
    
    (diary-list-entries): Dynamically bind 'number' and 'original-date' around
    diary-hook as documented in the docstring.
---
 lisp/calendar/diary-lib.el | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index 159dd9b..c327717 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -151,8 +151,10 @@ See also `diary-comment-start'."
   :group 'diary)
 
 (defcustom diary-hook nil
-  "List of functions called after the display of the diary.
-Used for example by the appointment package - see `appt-activate'."
+  "Hook run after displaying the diary.
+Used for example by the appointment package - see `appt-activate'.
+The variables `number' and `original-date' are dynamically bound around
+the call."
   :type 'hook
   :group 'diary)
 
@@ -779,10 +781,10 @@ After preparing the initial list, hooks run in this order:
   `diary-hook' runs last, after the diary is displayed.
       This is used e.g. by `appt-check'.
 
-Functions called by these hooks may use the variables ORIGINAL-DATE
-and NUMBER, which are the arguments with which this function was called.
-Note that hook functions should _not_ use DATE, but ORIGINAL-DATE.
-\(Sexp diary entries may use DATE - see `diary-list-sexp-entries'.)
+Functions called by these hooks may use the variables `original-date'
+and `number', which are the arguments with which this function was called.
+Note that hook functions should _not_ use `date', but `original-date'.
+\(Sexp diary entries may use `date' - see `diary-list-sexp-entries'.)
 
 This function displays the list using `diary-display-function', unless
 LIST-ONLY is non-nil, in which case it just returns the list."
@@ -872,7 +874,9 @@ LIST-ONLY is non-nil, in which case it just returns the 
list."
                                   (copy-sequence
                                    (car display-buffer-fallback-action))))))
                       (funcall diary-display-function)))
-                  (run-hooks 'diary-hook)))))
+                  (calendar-dlet* ((number number)
+                                   (original-date original-date))
+                    (run-hooks 'diary-hook))))))
         (and temp-buff (buffer-name temp-buff) (kill-buffer temp-buff)))
       (or d-incp (message "Preparing diary...done"))
       diary-entries-list)))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]