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

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

[nongnu] elpa/symbol-overlay 07119d9c95 151/152: Make the timer function


From: ELPA Syncer
Subject: [nongnu] elpa/symbol-overlay 07119d9c95 151/152: Make the timer function only affect the current buffer
Date: Thu, 7 Jul 2022 12:04:24 -0400 (EDT)

branch: elpa/symbol-overlay
commit 07119d9c9565de6d339e392edbcc966034812ced
Author: Matt Beshara <m@mfa.pw>
Commit: Matt Beshara <m@mfa.pw>

    Make the timer function only affect the current buffer
---
 symbol-overlay.el | 15 ++++++---------
 1 file changed, 6 insertions(+), 9 deletions(-)

diff --git a/symbol-overlay.el b/symbol-overlay.el
index 3f87c6b240..c20f59355d 100644
--- a/symbol-overlay.el
+++ b/symbol-overlay.el
@@ -342,21 +342,18 @@ This only affects symbols in the current displayed window 
if
   (when symbol-overlay-timer
     (cancel-timer symbol-overlay-timer)))
 
-(defun symbol-overlay-idle-timer (buf)
-  "Idle timer callback for BUF.
-This is used to maybe highlight the symbol at point, but only if
-the buffer is visible in the currently-selected window at the
-time."
-  (when (and (buffer-live-p buf) (eq (window-buffer) buf))
-    (with-current-buffer buf
-      (symbol-overlay-maybe-put-temp))))
+(defun symbol-overlay-idle-timer ()
+  "Idle timer callback.
+This is used to maybe highlight the symbol at point in whichever
+buffer happens to be current when the timer is fired."
+  (symbol-overlay-maybe-put-temp))
 
 (defun symbol-overlay-update-timer (value)
   "Update `symbol-overlay-timer' with new idle-time VALUE."
   (symbol-overlay-cancel-timer)
   (setq symbol-overlay-timer
         (and value (> value 0)
-             (run-with-idle-timer value t #'symbol-overlay-idle-timer 
(current-buffer)))))
+             (run-with-idle-timer value t #'symbol-overlay-idle-timer))))
 
 (defun symbol-overlay-post-command ()
   "Installed on `post-command-hook'."



reply via email to

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