Skip to content

Commit

Permalink
transient--delete-window: Get transient buffer by name
Browse files Browse the repository at this point in the history
We try to dedicate the transient window to the transient buffer, but
that does not actually guarantee that it is not used to displayed
another buffer.  Normally displaying another buffer in this window
would be fatal, but if it happens when displaying the *Help* buffer,
then that works out okay, as long as we avoid immediately killing
that buffer again.

Closes #271.
  • Loading branch information
tarsius committed Jan 5, 2024
1 parent 6872fb8 commit 8cc2415
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lisp/transient.el
Original file line number Diff line number Diff line change
Expand Up @@ -2231,14 +2231,14 @@ value. Otherwise return CHILDREN as is."
(when (window-live-p transient--window)
(let ((remain-in-minibuffer-window
(and (minibuffer-selected-window)
(selected-window)))
(buf (window-buffer transient--window)))
(selected-window))))
;; Only delete the window if it has never shown another buffer.
(unless (eq (car (window-parameter transient--window 'quit-restore))
'other)
(with-demoted-errors "Error while exiting transient: %S"
(delete-window transient--window)))
(kill-buffer buf)
(when-let ((buffer (get-buffer transient--buffer-name)))
(kill-buffer buffer))
(when remain-in-minibuffer-window
(select-window remain-in-minibuffer-window)))))

Expand Down

0 comments on commit 8cc2415

Please sign in to comment.