unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: martin rudalics <rudalics@gmx.at>
To: martin rudalics <rudalics@gmx.at>, 3949@emacsbugs.donarmstrong.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	[thread overview]
Message-ID: <4A743F3C.10507@gmx.at> (raw)
In-Reply-To: <4A6EAB48.2030309@gmx.at>

[-- 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,

  reply	other threads:[~2009-08-01 13:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2011-09-05  8:38 ` martin rudalics
2011-09-05 12:36   ` Lennart Borgman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4A743F3C.10507@gmx.at \
    --to=rudalics@gmx.at \
    --cc=3949@emacsbugs.donarmstrong.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).