GNU bug report logs - #4812
23.1.50; delete-window move point to the wrong window

Previous Next

Package: emacs;

Reported by: Leo <sdl.web <at> gmail.com>

Date: Tue, 27 Oct 2009 08:35:04 UTC

Severity: normal

Done: martin rudalics <rudalics <at> gmx.at>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: martin rudalics <rudalics <at> gmx.at>
To: Leo <sdl.web <at> gmail.com>, 4812 <at> debbugs.gnu.org
Subject: bug#4812: 23.1.50; delete-window move point to the wrong window
Date: Tue, 27 Oct 2009 10:46:39 +0100
> A frame is setup as follows with point in window 1.
>
>     +------------------+----------+
>     |                  |          |
>     |        1         |     2    |
>     |                  |          |
>     |                  |          |
>     |------------------+----------+
>     |                  |          |
>     |        4         |     3    |
>     |                  |          |
>     |                  |          |
>     +------------------+----------+
>
>
> Assume each window is displaying different buffers. If I move point to
> window 4 and `M-x delete-window', the point is moved to window 2.

When describing window-layouts please alway describe the sequence of
events that got you there.  In the layout above it's not clear whether
the initial split was a horizontal one or a vertical one.

> It seems to me it is more intuitive if the point is remained in the
> window that is enlarged due to delete-window, in this case, window 1.

I suppose you refer to the case where window 4 is selected at the time
you delete it and want window 1 get selected thereafter.  `point' is
never changed by deleting windows.

The situation is not that simple, unfortunately.  In your first bug
report you talked about quitting the calc window.  In that case, I
suppose, you'd rather want to select the window that was selected at the
time you invoked calc (unless another window got selected in between).
So suppose you're in window 1, invoke calc which splits window 4, and
quit calc, you'd rather go back to window 1 instead of window 4.  But
you might have, in between, selected window 3 so quitting calc should
get you back to window 3.  Handling all possible scenarios (including
those that create/delete other windows in between) is tricky.

Also, note that in a configuration like

 -----------
|  1  |  2  |
|-----------|
|     3     |
 -----------

deleting window 3 will enlarge windows 1 and 2 so you still need another
strategy to decide which window should get selected.

martin



This bug report was last modified 13 years and 320 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.