feature/popup: possible fix for elusive 'at top level' bug
Occasionally, a keyboard-quit bubbles up from popup's buffer cleanup process, causing all kinds of havoc; like killed term buffers (#436), abrupt interrupting of the minibuffer, and the point jumping around. This tries to fix this, but needs more testing!
This commit is contained in:
parent
026ba51c42
commit
5d69851f39
1 changed files with 13 additions and 12 deletions
|
@ -14,18 +14,19 @@
|
|||
"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."
|
||||
(when (buffer-live-p buffer)
|
||||
(let ((kill-buffer-hook (remq '+popup|kill-buffer-hook kill-buffer-hook)))
|
||||
(cond ((eq ttl 0)
|
||||
(kill-buffer buffer))
|
||||
((get-buffer-window buffer)
|
||||
(with-current-buffer buffer
|
||||
(setq +popup--timer
|
||||
(run-at-time ttl nil #'+popup--kill-buffer buffer ttl))))
|
||||
((with-demoted-errors "Error killing transient buffer: %s"
|
||||
(let (confirm-kill-processes)
|
||||
(when-let* ((process (get-buffer-process (current-buffer))))
|
||||
(kill-process process)))
|
||||
(kill-buffer buffer)))))))
|
||||
(with-temp-buffer
|
||||
(let ((kill-buffer-hook (remq '+popup|kill-buffer-hook kill-buffer-hook)))
|
||||
(cond ((eq ttl 0)
|
||||
(kill-buffer buffer))
|
||||
((get-buffer-window buffer)
|
||||
(with-current-buffer buffer
|
||||
(setq +popup--timer
|
||||
(run-at-time ttl nil #'+popup--kill-buffer buffer ttl))))
|
||||
((with-demoted-errors "Error killing transient buffer: %s"
|
||||
(let (confirm-kill-processes)
|
||||
(when-let* ((process (get-buffer-process (current-buffer))))
|
||||
(kill-process process)))
|
||||
(kill-buffer buffer))))))))
|
||||
|
||||
(defun +popup--init (window &optional alist)
|
||||
"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