[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: q in *Help* buffer deletes another window
From: |
martin rudalics |
Subject: |
Re: q in *Help* buffer deletes another window |
Date: |
Sat, 28 Jul 2007 14:56:00 +0200 |
User-agent: |
Mozilla Thunderbird 1.0 (Windows/20041206) |
> The code that handles exiting from view mode is complex,
> and apparently needs redesign. This isn't the only recent
> complaint.
These problems are caused by help and help-mode. They only become
manifest when exiting view-mode.
> emacs -Q
> C-x d RET
> C-x 3
> C-x C-f <some file>
> M-x set-variable pop-up-frames t
> C-h f forward-char
> q (in *Help* buffer)
>
> The *Help* buffer is iconified, and the window of the buffer visiting
> file <some-file> is deleted. The window of <some-file> should not be
> deleted.
C-h f creates an entry (W1 W2 . t) in `view-return-to-alist' where W1 is
the window displaying *Help* in a separate frame, W2 the original
window, and t means delete W1 when you are done. This is due to the
change
2005-12-03 Eli Zaretskii <address@hidden>
* help.el (print-help-return-message): If pop-up-frames is
non-nil, set up help-return-method to delete the help window and,
possibly, its frame as well, and don't display message about
scrolling the help window. Doc fix.
(help-return-method): Doc fix.
Since by default `view-remove-frame-by-deleting' is nil, q (in *Help*
buffer) will not delete that frame but rather iconify it. In addition
`view-mode-exit' will select W2 since that window is still alive.
Finally, `view-mode-exit' runs the `view-exit-action' formerly installed
by `help-mode' during C-h f:
(setq view-exit-action (lambda (buffer)
(or (window-minibuffer-p (selected-window))
(one-window-p t)
(delete-window))))
This code will (disregarding BUFFER) delete the selected window W2 and
leave you with that frame's other window (earlier created by C-x 3).
A partial remedy would be using
(setq view-exit-action (lambda (buffer)
(or (window-minibuffer-p (selected-window))
(one-window-p t)
(not (eq (window-buffer) buffer))
(delete-window))))
as explained in another thread.
Comments welcome.
> (It is also a bug, IMO, that *Help* is iconified. When pop-up-frames
> is non-nil, the frame should be deleted. Other users have also
> reported this awful behavior.)
Setting `view-remove-frame-by-deleting' to non-nil should solve this.