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

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

View-quit deletes *Help* frame (good), then deletes another window (bad)


From: Drew Adams
Subject: View-quit deletes *Help* frame (good), then deletes another window (bad)
Date: Sun, 6 Aug 2006 19:47:14 -0700

I use pop-up-frames=t, and I have a standalone minibuffer frame (the only
minibuffer). I have another frame with three buffers visible in it, in three
windows side by side. I do C-h k mouse-2 in one of those windows. Buffer
*Help* is displayed in its own frame, and that *Help* frame is automatically
selected.

I do `q', which invokes View-quit. Not only is the *Help* frame deleted
(good), but the originally selected window is also deleted (bad).

Here is the guilty part of the `view-mode-exit' code (at the end):

        (if (window-live-p old-window) ; still existing window
            (select-window old-window))
        (when exit-action
          (setq view-exit-action nil)
          (funcall exit-action buffer))

Before getting to this code, the *Help* frame has already been deleted.
There is no *Help* window left to delete.

old-window is the window that was selected before doing `C-h k'. This code
selects it, then calls exit-action on buffer (the *Help* buffer).
exit-action is a parameter passed to view-mode-exit, and its value is
view-exit-action, which in this case is this: (lambda (buffer) (or
(window-minibuffer-p (selected-window)) (one-window-p) (delete-window)))

Obviously, this means that the selected window, which is the window current
before *Help* was selected, is deleted.

Here is a backtrace, showing that the selected window is not *Help* (it is
buffer "Palette (Hue x Saturation)"):

Debugger entered--entering a function:
* window-minibuffer-p(#<window 379 on Palette (Hue x Saturation)>)
* #[(buffer) ...
* funcall(#[(buffer) ...
* (progn (setq view-exit-action nil) (funcall exit-action buffer))
* (if exit-action (progn (setq view-exit-action nil) (funcall exit-action
buffer)))
* (when exit-action (setq view-exit-action nil) (funcall exit-action
buffer))
* (let* ((buffer ...) window notlost (sel-old ...) (alist ...) (old-window
...)) (if all-win (let ... ... ...)) (or view-no-disable-on-exit
(view-mode-disable)) (while alist (setq notlost nil) (if ... ...) (unless
notlost ...) (setq alist ...)) (if (window-live-p old-window) (select-window
old-window)) (when exit-action (setq view-exit-action nil) (funcall
exit-action buffer)) (force-mode-line-update))
* (if view-mode (let* (... window notlost ... ... ...) (if all-win ...) (or
view-no-disable-on-exit ...) (while alist ... ... ... ...) (if ... ...)
(when exit-action ... ...) (force-mode-line-update)))
* view-mode-exit(((#<window 385> #<window 379 on Palette (Hue x Saturation)>
. t) (#<window 376> #<window 241 on view.el> . t)) #[(buffer)...
* View-quit()
  call-interactively(View-quit)

The next step is * one-window-p(t), which returns nil. The following step is
* delete-window(), which deletes the wrong window.






reply via email to

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