Fix elusive 'already at top-level' error
I have hunted this bug on and off for nearly a year now. It would kill processes randomly, move the point suddenly, and quit the active minibuffer without warning. The only clue it'd leave behind is an announcement in the minibuffer: "Already at top-level". Thanks to @UndeadKernel for the last piece of the puzzle! Fixes #436
This commit is contained in:
parent
98d2a35a59
commit
a77a967299
1 changed files with 7 additions and 6 deletions
|
@ -90,17 +90,18 @@ the buffer is visible, then set another timer and try again later."
|
|||
(when (buffer-live-p buffer)
|
||||
(let ((inhibit-quit t)
|
||||
(kill-buffer-hook (remq '+popup|kill-buffer-hook kill-buffer-hook)))
|
||||
(cond ((eq ttl 0)
|
||||
(kill-buffer buffer))
|
||||
((get-buffer-window buffer)
|
||||
(cond ((get-buffer-window buffer)
|
||||
(with-current-buffer buffer
|
||||
(setq +popup--timer
|
||||
(run-at-time ttl nil #'+popup--kill-buffer buffer ttl))))
|
||||
((eq ttl 0)
|
||||
(kill-buffer buffer))
|
||||
((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)))))))
|
||||
(when-let* ((process (get-buffer-process buffer)))
|
||||
(kill-process process))
|
||||
(let (kill-buffer-hook kill-buffer-query-functions)
|
||||
(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