GNU bug report logs - #3949
23.1.50; C-x 0 should go to a sister window if possible

Previous Next

Package: emacs;

Reported by: Lennart Borgman <lennart.borgman <at> gmail.com>

Date: Mon, 27 Jul 2009 16:50:03 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: martin rudalics <rudalics <at> gmx.at>, 3949 <at> debbugs.gnu.org
Cc: Lennart Borgman <lennart.borgman <at> gmail.com>
Subject: bug#3949: 23.1.50; C-x 0 should go to a sister window if possible
Date: Sat, 01 Aug 2009 15:12:28 +0200
[Message part 1 (text/plain, inline)]
>  >    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
[window.c.diff (text/plain, inline)]
*** 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,

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

Previous Next


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