emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/eldoc-eval cc37666378 11/28: Make timer not accessible


From: Stefan Monnier
Subject: [elpa] externals/eldoc-eval cc37666378 11/28: Make timer not accessible within body.
Date: Thu, 6 Jan 2022 08:34:55 -0500 (EST)

branch: externals/eldoc-eval
commit cc376663783ec4f7527b6ef864942a42737f0767
Author: Thierry Volpiatto <thierry.volpiatto@gmail.com>
Commit: Thierry Volpiatto <thierry.volpiatto@gmail.com>

    Make timer not accessible within body.
    
    * eldoc-eval.el (with-eldoc-in-minibuffer): Do it.
---
 eldoc-eval.el | 33 +++++++++++++++++----------------
 1 file changed, 17 insertions(+), 16 deletions(-)

diff --git a/eldoc-eval.el b/eldoc-eval.el
index 09ac0d7992..eb7d5799a9 100644
--- a/eldoc-eval.el
+++ b/eldoc-eval.el
@@ -123,22 +123,23 @@ See `with-eldoc-in-minibuffer'."
 (defmacro with-eldoc-in-minibuffer (&rest body)
   "Enable eldoc support for minibuffer input that runs in BODY."
   (declare (indent 0) (debug t))
-  `(let ((timer (and eldoc-in-minibuffer-mode
-                     (run-with-idle-timer
-                      eldoc-idle-delay
-                      'repeat #'eldoc-run-in-minibuffer))))
-     (unwind-protect
-         (minibuffer-with-setup-hook
-             ;; When minibuffer is activated in body, store it.
-             #'eldoc-store-minibuffer
-           ,@body)
-       (and timer (cancel-timer timer))
-       ;; Each time a minibuffer exits or aborts
-       ;; its buffer is removed from stack,
-       ;; assuming we can only exit the active minibuffer
-       ;; on top of stack.
-       (setq eldoc-active-minibuffers-list
-             (cdr eldoc-active-minibuffers-list)))))
+  (let ((timer (make-symbol "eldoc-eval--timer")))
+    `(let ((,timer (and eldoc-in-minibuffer-mode
+                       (run-with-idle-timer
+                        eldoc-idle-delay
+                        'repeat #'eldoc-run-in-minibuffer))))
+       (unwind-protect
+            (minibuffer-with-setup-hook
+                ;; When minibuffer is activated in body, store it.
+                #'eldoc-store-minibuffer
+              ,@body)
+         (and ,timer (cancel-timer ,timer))
+         ;; Each time a minibuffer exits or aborts
+         ;; its buffer is removed from stack,
+         ;; assuming we can only exit the active minibuffer
+         ;; on top of stack.
+         (setq eldoc-active-minibuffers-list
+               (cdr eldoc-active-minibuffers-list))))))
 
 (defun eldoc-current-buffer ()
   "Return the current buffer prior to activating the minibuffer."



reply via email to

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