GNU bug report logs - #47300
delete-window to select window with same position

Previous Next

Package: emacs;

Reported by: Juri Linkov <juri <at> linkov.net>

Date: Sun, 21 Mar 2021 21:15:02 UTC

Severity: minor

Tags: fixed, patch

Fixed in version 28.0.50

Done: Juri Linkov <juri <at> linkov.net>

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: Juri Linkov <juri <at> linkov.net>
Cc: Lars Ingebrigtsen <larsi <at> gnus.org>, 47300 <at> debbugs.gnu.org
Subject: bug#47300: delete-window to select window with same position
Date: Wed, 2 Jun 2021 11:08:48 +0200
[Message part 1 (text/plain, inline)]
> I changed <= to < to fix only Y coordinates for top/bottom windows,
> but maybe X coordinates should still use <= ?

The function has to treat the case where an edge is shared between two
windows separately.  A non-shared edge always belongs to the
corresponding window.

> Please note that the crucial difference is that now it uses
> frame relative positions rather than window relative ones
> with '(window-edges window nil nil t)' of the window to be deleted,
> and window coordinates added to X and Y of posn-at-point.

Right.  But the X and Y values are needed separately only at the time
`window-at-pos' is called.

> 1. `get-mru-window' could be one possible choice of the new option.
> 2. `use-posn-at-point' could be another choice.

I called them just 'mru' and 'pos' now.  The option is called
`selected-window-after-deletion', there might be better names.

> 3. Selecting the first window could remain in `delete-window-internal'.

It has to stay there.

> 4. But what to do with this code block with '(other-window -1 frame)'?
>     Should this be simply deleted?

That `other-window' was a bug: A frame that is not selected should not
get selected because we delete a window on it.  In addition, the old
code did not record a newly selected window unless that window was
produced by `get-mru-window'.  I tried to fix those too.  Please have a
look.

martin
[selected-window-after-deletion.diff (text/x-patch, attachment)]

This bug report was last modified 4 years and 36 days ago.

Previous Next


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