all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* Annoying change in "other window" behavior
@ 2011-08-23  6:55 MBR
  2011-08-23  8:26 ` suvayu ali
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: MBR @ 2011-08-23  6:55 UTC (permalink / raw)
  To: help-gnu-emacs

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

I've been using Emacs 21.3.1 for a long time and never got around to 
upgrading. I just installed Ubuntu (Natty Narwahl) on another system and 
when I installed Emacs on it, version 23.2.1 got installed. The new 
Emacs implements a "feature" that I'm finding very inconvenient, but I 
haven't found any way to turn it off.

There are certain commands that operate on the "other window". For example:

   1. C-x b brings up the *Buffer List* buffer in the other window,
   2. C-x 4 f opens up a file in the other window, and
   3. In a dired buffer you can position the cursor on a file or
      directory and type "o", and it will open that file or directory in
      the other window.

Note that I'm using the Emacs meaning of "window". I don't mean what the 
GUI (e.g. X11) calls a "window", which Emacs calls a "frame". I mean a 
subdivision of a top-level GUI window. Emacs windows are tiled either 
side-by-side or directly above and below other Emacs windows.

Anyway, I can split a window horizontally (i.e. turn it into two 
side-by-side windows) with C-x 3.

	+--------------------+--------------------+
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	+--------------------+--------------------+

Or I can split a window vertically (i.e. turn it into two windows, one 
directly below the other) with C-x 2.

	+-----------------------------------------+
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	+-----------------------------------------+
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	+-----------------------------------------+

In the older version of Emacs, when I used a command that operates on 
the other window, it always chose the other window from the set of 
windows I'd already created. If I'd previously created two 
vertically-stacked windows with C-x 2 or two side-by-side windows with 
C-x 3, it would put the data in whatever window the cursor was not in. 
Only when I had just one Emacs window, would it create a second window.

In version 23.2.1, that's all changed. The rule now seems to be that it 
will reuse a side-by-side window, but won't reuse a vertically-stacked 
window. So, if I've previously split my screen into side-by-side windows 
with C-x 3, the behavior is like it used to be. If my screen starts out 
looking like:

	+--------------------+--------------------+
	|  Dired buffer      |                    |
	|  ...>file #1      |                    |
	|  ... file #2       |                    |
	|  ... file #3       |                    |
	|  ... file #4 	     |                    |
	| 	      	     |                    |
	| 	      	     |                    |
	| 	      	     |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	+--------------------+--------------------+

	Note: ">" represents the cursor position.

after I type "o" (which runs dired-find-file-other-window), it looks 
just like it used to in the older version:

	+--------------------+--------------------+
	|  Dired buffer      |  This window now   |
	|  ...>file #1      |  displays the      |
	|  ... file #2       |  contents of       |
	|  ... file #3       |  file #1.          |
	|  ... file #4 	     |                    |
	| 	      	     |                    |
	| 	      	     |                    |
	| 	      	     |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	|                    |                    |
	+--------------------+--------------------+

BUT if I've previously split my screen into vertically-stacked windows 
with C-x 2, it now splits my current window into two side-by-side 
windows, leaving me with three windows. So, if my screen starts out 
looking like:

	+-----------------------------------------+
	|  Dired buffer                           |
	|  ...>file #1                           |
	|  ... file #2                            |
	|  ... file #3                            |
	|  ... file #4                            |
	|                                         |
	+-----------------------------------------+
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	+-----------------------------------------+

After I type "o" it used to look like:

	+-----------------------------------------+
	|  Dired buffer                           |
	|  ...>file #1                           |
	|  ... file #2                            |
	|  ... file #3                            |
	|  ... file #4                            |
	|                                         |
	+-----------------------------------------+
	|  This window now displays the contents  |
	|  of file #1.                            |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	+-----------------------------------------+

BUT NOW it looks like:

	+--------------------+--------------------+
	|  Dired buffer      |  This window now   |
	|  ...>file #1      |  displays the      |
	|  ... file #2       |  contents of       |
	|  ... file #3       |  file #1.          |
	|  ... file #4 	     |                    |
	| 	      	     |                    |
	+--------------------+--------------------+
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	|                                         |
	+-----------------------------------------+

I'm finding this very inconvenient. Does anyone know if there's a 
variable I can set in my .emacs to change back to the old behavior? Or 
if not, is there anyone who's familiar with the Lisp code that 
implements this who can point me to where in the code I should look to 
figure out how to change this?


[-- Attachment #2: Type: text/html, Size: 8090 bytes --]

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

* Re: Annoying change in "other window" behavior
  2011-08-23  6:55 Annoying change in "other window" behavior MBR
@ 2011-08-23  8:26 ` suvayu ali
  2011-08-23 16:14   ` MBR
  2011-08-23  8:30 ` suvayu ali
  2011-08-23 11:34 ` Bernardo
  2 siblings, 1 reply; 8+ messages in thread
From: suvayu ali @ 2011-08-23  8:26 UTC (permalink / raw)
  To: MBR; +Cc: help-gnu-emacs

On Tue, Aug 23, 2011 at 8:55 AM, MBR <mbr@arlsoft.com> wrote:
> There are certain commands that operate on the "other window". For example:
>
> C-x b brings up the *Buffer List* buffer in the other window,

I believe you mean C-x C-b or list-buffers? C-x b is switch-to-buffer.

> C-x 4 f opens up a file in the other window, and

find-file-other-window

> In a dired buffer you can position the cursor on a file or directory and
> type "o", and it will open that file or directory in the other window.

dired-find-file-other-window

In any case these commands have always used the other-window. I will
have to say you either had some special configuration which is not
working with Emacs 23 or you remember incorrectly.

I just tested this with Emacs 21.4.1.

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: Annoying change in "other window" behavior
  2011-08-23  6:55 Annoying change in "other window" behavior MBR
  2011-08-23  8:26 ` suvayu ali
@ 2011-08-23  8:30 ` suvayu ali
  2011-08-23 11:34 ` Bernardo
  2 siblings, 0 replies; 8+ messages in thread
From: suvayu ali @ 2011-08-23  8:30 UTC (permalink / raw)
  To: MBR; +Cc: help-gnu-emacs

Sorry, I misunderstood the post. Too early in the morning for me. :-p

On Tue, Aug 23, 2011 at 8:55 AM, MBR <mbr@arlsoft.com> wrote:
> In version 23.2.1, that's all changed. The rule now seems to be that it will
> reuse a side-by-side window, but won't reuse a vertically-stacked window.
> So, if I've previously split my screen into side-by-side windows with C-x 3,
> the behavior is like it used to be. If my screen starts out looking like:

Maybe you have customised how spitting is controlled which doesn't
work the same way in Emacs 23, split-*-threshold or
split-window-prefered-funtion ?

-- 
Suvayu

Open source is the future. It sets us free.



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

* Re: Annoying change in "other window" behavior
  2011-08-23  6:55 Annoying change in "other window" behavior MBR
  2011-08-23  8:26 ` suvayu ali
  2011-08-23  8:30 ` suvayu ali
@ 2011-08-23 11:34 ` Bernardo
  2011-08-23 16:34   ` MBR
       [not found]   ` <mailman.1818.1314117273.939.help-gnu-emacs@gnu.org>
  2 siblings, 2 replies; 8+ messages in thread
From: Bernardo @ 2011-08-23 11:34 UTC (permalink / raw)
  To: MBR; +Cc: help-gnu-emacs


> After I type "o" it used to look like:
> 
>     +-----------------------------------------+
>     |  Dired buffer                           |
>     |  ...>file #1                           |
>     |  ... file #2                            |
>     |  ... file #3                            |
>     |  ... file #4                            |
>     |                                         |
>     +-----------------------------------------+
>     |  This window now displays the contents  |
>     |  of file #1.                            |
>     |                                         |
>     |                                         |
>     |                                         |
>     |                                         |
>     +-----------------------------------------+
> 
> BUT NOW it looks like:
> 
>     +--------------------+--------------------+
>     |  Dired buffer      |  This window now   |
>     |  ...>file #1      |  displays the      |
>     |  ... file #2       |  contents of       |
>     |  ... file #3       |  file #1.          |
>     |  ... file #4          |                    |
>     |                    |                    |
>     +--------------------+--------------------+
>     |                                         |
>     |                                         |
>     |                                         |
>     |                                         |
>     |                                         |
>     |                                         |
>     +-----------------------------------------+
> 

setting the value of split-width-threshold variable to a larger value 
might help;
maybe something like this will make a difference:
(setq split-width-threshold 300)




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

* Re: Annoying change in "other window" behavior
  2011-08-23  8:26 ` suvayu ali
@ 2011-08-23 16:14   ` MBR
  0 siblings, 0 replies; 8+ messages in thread
From: MBR @ 2011-08-23 16:14 UTC (permalink / raw)
  To: suvayu ali; +Cc: help-gnu-emacs

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

On 8/23/2011 4:26 AM, suvayu ali wrote:
> In any case these commands have always used the other-window. I will 
> have to say you either had some special configuration which is not
> working with Emacs 23 or you remember incorrectly.
>
> I just tested this with Emacs 21.4.1.
>
I'm sure I'm not remembering incorrectly because I still have both 
installations.  I recently installed Ubuntu in a separate partition on 
my laptop.  Emacs 21.3.1 runs when I boot Windows XP, and Emacs 23.2.1 
runs when I boot Ubuntu.  The behavior differences I'm describing should 
all be implemented in Lisp, and should therefore not depend in any way 
on the OS under which Emacs is running.

I did discover something more about 23.2.1's behavior after I posted.  
It seems the behavior depends on the width of the top-level window (what 
Emacs calls a "frame").  If I have two vertically-stacked Emacs windows 
in a small Emacs frame and type C-x C-b, *Buffer List* is displayed in 
the other pre-existing Emacs window.  But if I have the same two 
vertically-stacked Emacs windows in a large Emacs frame (I frequently 
work with one Emacs frame maximized) when I type C-x C-b, instead of 
displaying *Buffer List* in the other pre-existing Emacs window, it 
behaves as if I'd run M-x split-window-horizontally before running M-x 
list-buffers.

Just to be sure, I double-checked 21.3.1's behavior (i.e. the old 
version), and it doesn't do this.  Unless it's starting with only one 
Emacs window and has no choice but to split it into two, it always 
reuses a pre-existing Emacs window.

So, there can be no doubt that somebody added a new feature that makes 
this window-splitting behavior dependent on the width of the frame, 
which it never used to be.  I'd really like to turn this feature off.

    Mark


[-- Attachment #2: Type: text/html, Size: 2397 bytes --]

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

* Re: Annoying change in "other window" behavior
  2011-08-23 11:34 ` Bernardo
@ 2011-08-23 16:34   ` MBR
       [not found]   ` <mailman.1818.1314117273.939.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 8+ messages in thread
From: MBR @ 2011-08-23 16:34 UTC (permalink / raw)
  To: bernardo.bacic; +Cc: help-gnu-emacs

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

Thank you!  I just Googled the variable you pointed me to 
(split-width-threshold), and instantly turned up the Emacs 23.3 page at 
http://www.gnu.org/software/emacs/elisp/html_node/Choosing-Window.html, 
which describes the function display-buffer. display-buffer is described 
as "the basic facility that chooses a window to display a buffer in."  
This sounds like exactly the function I was looking for.  The 
documentation shown when I run M-x describe-function display-buffer in 
21.3 doesn't contain any mention of a variable named 
split-width-threshold, which is pretty strong evidence that that feature 
wasn't added until some later version.

    Mark

On 8/23/2011 7:34 AM, Bernardo wrote:
>
>> After I type "o" it used to look like:
>>
>>     +-----------------------------------------+
>>     |  Dired buffer                           |
>>     |  ...>file #1                           |
>>     |  ... file #2                            |
>>     |  ... file #3                            |
>>     |  ... file #4                            |
>>     |                                         |
>>     +-----------------------------------------+
>>     |  This window now displays the contents  |
>>     |  of file #1.                            |
>>     |                                         |
>>     |                                         |
>>     |                                         |
>>     |                                         |
>>     +-----------------------------------------+
>>
>> BUT NOW it looks like:
>>
>>     +--------------------+--------------------+
>>     |  Dired buffer      |  This window now   |
>>     |  ...>file #1      |  displays the      |
>>     |  ... file #2       |  contents of       |
>>     |  ... file #3       |  file #1.          |
>>     |  ... file #4          |                    |
>>     |                    |                    |
>>     +--------------------+--------------------+
>>     |                                         |
>>     |                                         |
>>     |                                         |
>>     |                                         |
>>     |                                         |
>>     |                                         |
>>     +-----------------------------------------+
>>
>
> setting the value of split-width-threshold variable to a larger value 
> might help;
> maybe something like this will make a difference:
> (setq split-width-threshold 300)
>

[-- Attachment #2: Type: text/html, Size: 8101 bytes --]

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

* Re: Annoying change in "other window" behavior
       [not found]   ` <mailman.1818.1314117273.939.help-gnu-emacs@gnu.org>
@ 2011-08-24  5:51     ` Jason Rumney
  2011-08-24 16:11       ` MBR
  0 siblings, 1 reply; 8+ messages in thread
From: Jason Rumney @ 2011-08-24  5:51 UTC (permalink / raw)
  To: gnu.emacs.help; +Cc: help-gnu-emacs

C-h n will give you the NEWS file, explaining all the changes in the latest version of Emacs.  In there you will find the answer you are looking for (how to get the old behaviour back):

** Changes affecting display-buffer

*** display-buffer tries to be smarter when splitting windows.
The new option split-window-preferred-function lets you specify your own
function to pop up new windows.  Its default value split-window-sensibly
can split a window either vertically or horizontally, whichever seems
more suitable in the current configuration.  You can tune the behavior
of split-window-sensibly by customizing split-height-threshold and the
new option split-width-threshold.  Both options now take the value nil
to inhibit splitting in one direction.  Setting split-width-threshold to
nil inhibits horizontal splitting and gets you the behavior of Emacs 22
in this respect.  In any case, display-buffer may now split the largest
window vertically even when it is not as wide as the containing frame.


This is for 23.3, for 23.2, you may not have the option of setting it to nil (judging by the wording above, this was added at a later date) but setting it to a very large value (more columns than will fit on your display) should also work.



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

* Re: Annoying change in "other window" behavior
  2011-08-24  5:51     ` Jason Rumney
@ 2011-08-24 16:11       ` MBR
  0 siblings, 0 replies; 8+ messages in thread
From: MBR @ 2011-08-24 16:11 UTC (permalink / raw)
  To: gnu.emacs.help; +Cc: help-gnu-emacs, Jason Rumney

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

Much obliged.  Thanks for bringing that to my attention.

    Mark

On 8/24/2011 1:51 AM, Jason Rumney wrote:
> C-h n will give you the NEWS file, explaining all the changes in the latest version of Emacs.  In there you will find the answer you are looking for (how to get the old behaviour back):
>
> ** Changes affecting display-buffer
>
> *** display-buffer tries to be smarter when splitting windows.
> The new option split-window-preferred-function lets you specify your own
> function to pop up new windows.  Its default value split-window-sensibly
> can split a window either vertically or horizontally, whichever seems
> more suitable in the current configuration.  You can tune the behavior
> of split-window-sensibly by customizing split-height-threshold and the
> new option split-width-threshold.  Both options now take the value nil
> to inhibit splitting in one direction.  Setting split-width-threshold to
> nil inhibits horizontal splitting and gets you the behavior of Emacs 22
> in this respect.  In any case, display-buffer may now split the largest
> window vertically even when it is not as wide as the containing frame.
>
>
> This is for 23.3, for 23.2, you may not have the option of setting it to nil (judging by the wording above, this was added at a later date) but setting it to a very large value (more columns than will fit on your display) should also work.

[-- Attachment #2: Type: text/html, Size: 1911 bytes --]

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

end of thread, other threads:[~2011-08-24 16:11 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-08-23  6:55 Annoying change in "other window" behavior MBR
2011-08-23  8:26 ` suvayu ali
2011-08-23 16:14   ` MBR
2011-08-23  8:30 ` suvayu ali
2011-08-23 11:34 ` Bernardo
2011-08-23 16:34   ` MBR
     [not found]   ` <mailman.1818.1314117273.939.help-gnu-emacs@gnu.org>
2011-08-24  5:51     ` Jason Rumney
2011-08-24 16:11       ` MBR

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.