diff options
author | JSDurand <mmemmew@gmail.com> | 2022-08-28 23:26:27 +0800 |
---|---|---|
committer | JSDurand <mmemmew@gmail.com> | 2022-08-28 23:26:27 +0800 |
commit | e46eef2a70c675a0cb62cc35bbf50ec3d31f6ee0 (patch) | |
tree | ab2067b434c67e2fa1bf6d2dc2a10eb3da2919ea | |
parent | d2981800dabfb0cdae9eaaf5a4c644c177fb0e12 (diff) |
basic: delete associated timers to pdf-view-mode
* basic.el (durand-kill-current-buffer): Modify this funcion so that
the associated timers to PDF files are also killed at the time of
deletion.
-rw-r--r-- | basic.el | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -239,6 +239,27 @@ window, then also delete the selected window." ((window-minibuffer-p (selected-window)) ;; this is the same as calling `abort-recursive-edit'. (throw 'exit t)) + ((derived-mode-p 'pdf-view-mode) + ;; We also want to kill the associated timer, if any. + (mapc + (lambda (timer) + (cond + ((and + (eq (timer--function timer) 'pdf-cache--prefetch-start) + (listp (timer--args timer)) + (memq (current-buffer) (timer--args timer))) + (setq timer-idle-list (delq timer timer-idle-list))))) + timer-idle-list) + (mapc + (lambda (timer) + (cond + ((and + (eq (timer--function timer) 'pdf-cache--prefetch-start) + (listp (timer--args timer)) + (memq (current-buffer) (timer--args timer))) + (setq timer-list (delq timer timer-list))))) + timer-list) + (kill-buffer (current-buffer))) (t (kill-buffer (current-buffer)))) (cond ((and arg (not (one-window-p t))) |