all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
@ 2009-07-27 16:42 Lennart Borgman
  2009-07-27 18:05 ` martin rudalics
  2011-09-05  8:38 ` martin rudalics
  0 siblings, 2 replies; 7+ messages in thread
From: Lennart Borgman @ 2009-07-27 16:42 UTC (permalink / raw)
  To: emacs-pretest-bug

I can't think of any situation where I do not want that.


In GNU Emacs 23.1.50.1 (i386-mingw-nt5.1.2600)
 of 2009-06-30
Windowing system distributor `Microsoft Corp.', version 5.1.2600
configured using `configure --with-gcc (3.4) --no-opt --cflags
-Ic:/g/include -fno-crossjumping'





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
  2009-07-27 16:42 bug#3949: 23.1.50; C-x 0 should go to a sister window if possible Lennart Borgman
@ 2009-07-27 18:05 ` martin rudalics
  2009-07-27 18:49   ` Lennart Borgman
  2011-09-05  8:38 ` martin rudalics
  1 sibling, 1 reply; 7+ messages in thread
From: martin rudalics @ 2009-07-27 18:05 UTC (permalink / raw)
  To: Lennart Borgman, 3949

 > I can't think of any situation where I do not want that.

I suppose you refer to configurations like

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

and you do C-x 0 in 1 ending up in 3 or in 3 ending up in 2.

It happens because `delete-window' selects the previous window of the
selected one which is usually also the one that gets enlarged.  You'd
probably prefer C-x 0 in 1 end up in 2 and when in 3 end up in 1.  This
could be done but I'm not sure whether this was a great annoyance over
the years in order to warrant such a change.

martin





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
  2009-07-27 18:05 ` martin rudalics
@ 2009-07-27 18:49   ` Lennart Borgman
  2009-07-28  7:39     ` martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: Lennart Borgman @ 2009-07-27 18:49 UTC (permalink / raw)
  To: martin rudalics; +Cc: 3949

On Mon, Jul 27, 2009 at 8:05 PM, martin rudalics<rudalics@gmx.at> wrote:
>> I can't think of any situation where I do not want that.
>
> I suppose you refer to configurations like
>
>  -------
> | 1 | 2 |
> |-------|
> |   3   |
>  -------
>
> and you do C-x 0 in 1 ending up in 3

This is the case I that I find surprising. And I can't figure out what
the algorithm is - it does not go to the previous window. At least not
after

   C-x 1
   C-x 3
   windmove-right
   C-x 2
   windmove-down
   C-x 0

For me it stops in the left window, not the right as I expect.


> or in 3 ending up in 2.

In this case the current default (which I suppose is going to the
previous window ...) should be fine.


> It happens because `delete-window' selects the previous window of the
> selected one which is usually also the one that gets enlarged.  You'd
> probably prefer C-x 0 in 1 end up in 2 and when in 3 end up in 1.  This
> could be done but I'm not sure whether this was a great annoyance over
> the years in order to warrant such a change.
>
> martin
>





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
  2009-07-27 18:49   ` Lennart Borgman
@ 2009-07-28  7:39     ` martin rudalics
  2009-08-01 13:12       ` martin rudalics
  0 siblings, 1 reply; 7+ messages in thread
From: martin rudalics @ 2009-07-28  7:39 UTC (permalink / raw)
  To: Lennart Borgman; +Cc: 3949

 >    C-x 1
 >    C-x 3
 >    windmove-right
 >    C-x 2
 >    windmove-down
 >    C-x 0
 >
 > For me it stops in the left window, not the right as I expect.

Looks like a bug indeed.  It behaves this way in the current trunk but
doesn't so in my Emacs.  I'll have to look into this.

martin





^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
  2009-07-28  7:39     ` martin rudalics
@ 2009-08-01 13:12       ` martin rudalics
  0 siblings, 0 replies; 7+ messages in thread
From: martin rudalics @ 2009-08-01 13:12 UTC (permalink / raw)
  To: martin rudalics, 3949

[-- Attachment #1: Type: text/plain, Size: 858 bytes --]

 >  >    C-x 1
 >  >    C-x 3
 >  >    windmove-right
 >  >    C-x 2
 >  >    windmove-down
 >  >    C-x 0
 >  >
 >  > For me it stops in the left window, not the right as I expect.
 >
 > Looks like a bug indeed.  It behaves this way in the current trunk but
 > doesn't so in my Emacs.  I'll have to look into this.

OK the problem is with the following assignment in delete_window:

	/* Otherwise, try another window for SWINDOW.  */
	swindow = Fnext_window (swindow, Qlambda, Qnil);

This will fail to pick a useful window when deleting the bottom-right
window of a frame.  I use

	/* Otherwise, try another window for SWINDOW.  */
	swindow = Fprevious_window (swindow, Qlambda, Qnil);

which is better for me but fails miserably when deleting the
top-left window of a frame.  So maybe we need something like the
attached patch.  Could you try it?

martin

[-- Attachment #2: window.c.diff --]
[-- Type: text/plain, Size: 800 bytes --]

*** window.c.~1.639.~	2009-07-04 17:09:38.265625000 +0200
--- window.c	2009-08-01 15:06:48.906250000 +0200
***************
*** 1596,1602 ****
  	if (!EQ (window, pwindow))
  	  break;
  	/* Otherwise, try another window for SWINDOW.  */
! 	swindow = Fnext_window (swindow, Qlambda, Qnil);
  
  	/* If we get back to the frame's selected window,
  	   it means there was no acceptable alternative,
--- 1596,1605 ----
  	if (!EQ (window, pwindow))
  	  break;
  	/* Otherwise, try another window for SWINDOW.  */
! 	if (NILP (XWINDOW (swindow)->prev))
! 	  swindow = Fnext_window (swindow, Qlambda, Qnil);
! 	else
! 	  swindow = Fprevious_window (swindow, Qlambda, Qnil);
  
  	/* If we get back to the frame's selected window,
  	   it means there was no acceptable alternative,

^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
  2009-07-27 16:42 bug#3949: 23.1.50; C-x 0 should go to a sister window if possible Lennart Borgman
  2009-07-27 18:05 ` martin rudalics
@ 2011-09-05  8:38 ` martin rudalics
  2011-09-05 12:36   ` Lennart Borgman
  1 sibling, 1 reply; 7+ messages in thread
From: martin rudalics @ 2011-09-05  8:38 UTC (permalink / raw)
  To: 3949-done

> I can't think of any situation where I do not want that.

The window selected now is the most recently used one.

Closed, martin.






^ permalink raw reply	[flat|nested] 7+ messages in thread

* bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
  2011-09-05  8:38 ` martin rudalics
@ 2011-09-05 12:36   ` Lennart Borgman
  0 siblings, 0 replies; 7+ messages in thread
From: Lennart Borgman @ 2011-09-05 12:36 UTC (permalink / raw)
  To: 3949, rudalics; +Cc: 3949-done

On Mon, Sep 5, 2011 at 10:38, martin rudalics <rudalics@gmx.at> wrote:
>> I can't think of any situation where I do not want that.
>
> The window selected now is the most recently used one.
>
> Closed, martin.

Thanks.





^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-09-05 12:36 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-27 16:42 bug#3949: 23.1.50; C-x 0 should go to a sister window if possible Lennart Borgman
2009-07-27 18:05 ` martin rudalics
2009-07-27 18:49   ` Lennart Borgman
2009-07-28  7:39     ` martin rudalics
2009-08-01 13:12       ` martin rudalics
2011-09-05  8:38 ` martin rudalics
2011-09-05 12:36   ` Lennart Borgman

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.