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

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

Re: two View-mode "quit" bugs


From: martin rudalics
Subject: Re: two View-mode "quit" bugs
Date: Sat, 28 Jul 2007 14:24:23 +0200
User-agent: Mozilla Thunderbird 1.0 (Windows/20041206)

> I've found what I believe to be two bugs in View-quit.
> I have two frames visible.  In one frame I type: C-h m C-x o C-x 1.
> This makes the only window in this frame show the *Help* buffer.
> Now I type "q", and the frame iconifies.

After C-h m `view-return-to-alist' will contain references for the
*Help* window W1 and the original window W2 as (W1 W2 . t) which
essentially means if W1 still exists try to delete it when you're done.
C-x 1 makes `one-window-p' non-nil for W1 and `view-mode-exit' will
subsequently fail to delete W1 due to

                 ((not (one-window-p t)) (delete-window))

In the sequel it sticks to the rule

          ;; If a frame is removed by iconifying it, then the window is not
          ;; really lost.

and iconifies the frame.  Note that `view-exit-action' fails to do
anything here since `one-window-p' is non-nil.

> I find this quite surprising.  I would much prefer View-quit to simply
> act like bury-buffer.  I certainly never want it to iconify the frame.

If you had set `view-remove-frame-by-deleting' to a non-nil value,
`view-mode-exit' would have deleted the frame.  Burying the buffer might
be a good idea but Emacs would then have to display another buffer in
W1.  Maybe the one from W2.  However, information about that buffer was
never recorded and W2 is dead.  Also, if you had displayed another
buffer in W2 in the meantime you'd still get the buffer displayed in W2
when you invoked C-h m.

> Now, I deiconify this frame.  Then I switch to the other frame, and in
> that frame type C-x b *Help* RET C-x 1.  This makes the only window in
> the other frame display the *Help* buffer.
>
> Now I type "q".  Nothing changes.  Again I expected the help buffer to
> be buried.

C-x b *Help* does _not_ change the exit information established above,
namely (W1 W2 . t).  `view-mode-exit' notes that W1 is _not_ the window
displaying *Help* in the second conjunct of

          (if (and (window-live-p (setq window (car (car alist))))
                   (eq buffer (window-buffer window)))

and refrains from doing anything.  `view-exit-action' won't do anything
since `one-window-p' is non-nil.  As a rule, you can expect "q" DTRT iff
you created the help window with a help command.

Doing the right thing here seems difficult.  We'd have to add a function
to `window-configuration-change-hook' and, for every buffer, update any
information for all windows on `view-return-to-alist'.

Comments welcome.





reply via email to

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