emacs-31 a56e964941f: Speedbar: no more stale idle timers (bug#81561)

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: emacs-31
commit a56e964941fe5c21e2f79e62088852f504e21070
Author: Vincenzo Pupillo <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    Speedbar: no more stale idle timers (bug#81561)
    
    * lisp/dframe.el (dframe-set-timer): Fixed the condition for removing
    the timer (the code does not match what is written in the comment).
    * lisp/speedbar.el (speedbar-window--close): 'speedbar-set-timer' must
    be called from the 'speedbar-buffer'.
---
 lisp/dframe.el   | 2 +-
 lisp/speedbar.el | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/lisp/dframe.el b/lisp/dframe.el
index 2332ef3056f..08dd8aa873c 100644
--- a/lisp/dframe.el
+++ b/lisp/dframe.el
@@ -652,7 +652,7 @@ who requested the timer.  NULL-ON-ERROR is ignored."
        timeout
        ;; We have a timer, an off is requested, and no client
        ;; functions are left, shut er down.
-       (and dframe-timer (not timeout) dframe-client-functions))
+       (and dframe-timer (not timeout) (not dframe-client-functions)))
       ;; Only call the low level function if we are changing the state.
       (dframe-set-timer-internal timeout)))
 
diff --git a/lisp/speedbar.el b/lisp/speedbar.el
index 08af40a0aca..3e965d4286c 100644
--- a/lisp/speedbar.el
+++ b/lisp/speedbar.el
@@ -1123,7 +1123,8 @@ supported at a time.
       (setq speedbar--window nil
 	    speedbar-frame nil
 	    dframe-attached-frame nil)
-      (speedbar-set-timer nil)
+      (with-current-buffer speedbar-buffer
+        (speedbar-set-timer nil))
       (kill-buffer speedbar-buffer)
       (setq speedbar-buffer nil)
       (when (and current-window (window-live-p current-window))
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.