bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#48367: 28.0.50; quit-restore-buffer may jam


From: pillule
Subject: bug#48367: 28.0.50; quit-restore-buffer may jam
Date: Tue, 11 May 2021 20:26:08 +0000


Hello there,

I think there is a small bug with quit-window / quit-restore-window :

with emacs -Q

;; set some rules
(setq display-buffer-alist
     '(("\\*\\(Backtrace\\|Messages\\)\\*"
       (display-buffer-in-side-window)
       (window-height . 0.2)
       (side . bottom))))

;; trigger a logical error to display the *Backtrace* buffer
(> vim emacs)

;; display the *Messages* buffer
(view-echo-area-messages)

;; mess the `quit-restore' window parameter
(kill-buffer (get-buffer "*Backtrace*"))

;; which looks now like that in the *Messages* window :
;; ((quit-restore) (window-slot . 0) (window-side . bottom))

;; try to quit the *Messages* window
(progn (select-window (view-echo-area-messages))
      (quit-window))

;; nothing happens :

The first `cond' of quit-restore-window end up to 't,
it calls (switch-to-prev-buffer window bury-or-kill)
but there is no previous-window available.

The first patch adress this, and a similar one : when there is a previous-buffer available, but it referes to the same buffer. (eg: try the recipe again but exchange the role of *Messages* and *Backtrace*, you will finish with a blank buffer for backtrace, that you can quit again to end up to the same point)

The second patch is a proposition to clarify a little the code.

Attachment: quit-restore-window.patch
Description: quit-restore-window-patch1

Attachment: quit-restore-window2.patch
Description: quit-restore-window-patch2


--

reply via email to

[Prev in Thread] Current Thread [Next in Thread]