feature/popup: (another) possible fix for elusive 'at top level' bug #436
This commit is contained in:
parent
4a29825e0d
commit
221061b599
1 changed files with 13 additions and 13 deletions
|
@ -14,19 +14,19 @@
|
||||||
"Tries to kill BUFFER, as was requested by a transient timer. If it fails, eg.
|
"Tries to kill BUFFER, as was requested by a transient timer. If it fails, eg.
|
||||||
the buffer is visible, then set another timer and try again later."
|
the buffer is visible, then set another timer and try again later."
|
||||||
(when (buffer-live-p buffer)
|
(when (buffer-live-p buffer)
|
||||||
(with-temp-buffer
|
(let ((inhibit-quit t)
|
||||||
(let ((kill-buffer-hook (remq '+popup|kill-buffer-hook kill-buffer-hook)))
|
(kill-buffer-hook (remq '+popup|kill-buffer-hook kill-buffer-hook)))
|
||||||
(cond ((eq ttl 0)
|
(cond ((eq ttl 0)
|
||||||
(kill-buffer buffer))
|
(kill-buffer buffer))
|
||||||
((get-buffer-window buffer)
|
((get-buffer-window buffer)
|
||||||
(with-current-buffer buffer
|
(with-current-buffer buffer
|
||||||
(setq +popup--timer
|
(setq +popup--timer
|
||||||
(run-at-time ttl nil #'+popup--kill-buffer buffer ttl))))
|
(run-at-time ttl nil #'+popup--kill-buffer buffer ttl))))
|
||||||
((with-demoted-errors "Error killing transient buffer: %s"
|
((with-demoted-errors "Error killing transient buffer: %s"
|
||||||
(let (confirm-kill-processes)
|
(let (confirm-kill-processes)
|
||||||
(when-let* ((process (get-buffer-process (current-buffer))))
|
(when-let* ((process (get-buffer-process (current-buffer))))
|
||||||
(kill-process process)))
|
(kill-process process)))
|
||||||
(kill-buffer buffer))))))))
|
(kill-buffer buffer)))))))
|
||||||
|
|
||||||
(defun +popup--init (window &optional alist)
|
(defun +popup--init (window &optional alist)
|
||||||
"Initializes a popup window. Run any time a popup is opened. It sets the
|
"Initializes a popup window. Run any time a popup is opened. It sets the
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue