unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* opening buffers in particular windows?
@ 2010-04-02 19:04 Brendan Miller
  2010-04-03 21:34 ` Pawel
  0 siblings, 1 reply; 4+ messages in thread
From: Brendan Miller @ 2010-04-02 19:04 UTC (permalink / raw)
  To: help-gnu-emacs

A number of emacs commands open buffers in a window other than the
current one. For instance, hitting o in dired, or M-x man.

For dired, this works ok if I only have two windows open, but I often
have 3, it and it picks the window I *don't* want it to open in. Say,
I open a source file from dired, the source opens up in the small
window I was using for ansi-term, instead of the big window I was
using to edit source in. Then I have to rearrange or resize
immediately.

M-x man is actually kind of annoying because I usually want it to open
in the window that I run the command in.

Is there any way to control the window that buffers select to open in
better? Maybe make one window a target for certain types of new
buffers?

Thanks,
Brendan




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

* Re: opening buffers in particular windows?
  2010-04-02 19:04 Brendan Miller
@ 2010-04-03 21:34 ` Pawel
  2010-04-03 22:57   ` Brendan Miller
  0 siblings, 1 reply; 4+ messages in thread
From: Pawel @ 2010-04-03 21:34 UTC (permalink / raw)
  To: Brendan Miller; +Cc: help-gnu-emacs

Brendan Miller <catphive@catphive.net> writes:

> M-x man is actually kind of annoying because I usually want it to open
> in the window that I run the command in.
>

good point.
the first thing I did after learning elisp a bit was to open buffer list
(C-x b) in current window. Solution is specific to buffer list only, but
the question remains for other cases.

best regards




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

* Re: opening buffers in particular windows?
  2010-04-03 21:34 ` Pawel
@ 2010-04-03 22:57   ` Brendan Miller
  0 siblings, 0 replies; 4+ messages in thread
From: Brendan Miller @ 2010-04-03 22:57 UTC (permalink / raw)
  To: Pawel; +Cc: help-gnu-emacs

On Sat, Apr 3, 2010 at 2:34 PM, Pawel <mafeusek@gmail.com> wrote:
> Brendan Miller <catphive@catphive.net> writes:
>
>> M-x man is actually kind of annoying because I usually want it to open
>> in the window that I run the command in.
>>
>
> good point.
> the first thing I did after learning elisp a bit was to open buffer list
> (C-x b) in current window. Solution is specific to buffer list only, but
> the question remains for other cases.
>
> best regards
>

I think that now that monitors have gotten so big, it's common to have
3 or 4 windows open, whereas in the past most emacs users probably had
2 max. For this reason most of the "open in other window" type
commands now behave very unpredictably with 3 or more windows.

I'm currently learning elisp so I can fix things like this for myself.
Guidance on how C-x o, dired's o, C-x b, and M-x man decide which of n
windows is the "other window" would be helpful. Hopefully they all
just call some "other window" function that I can hook to customize
its behavior.

Brendan




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

* Re: opening buffers in particular windows?
@ 2010-04-04  7:05 martin rudalics
  0 siblings, 0 replies; 4+ messages in thread
From: martin rudalics @ 2010-04-04  7:05 UTC (permalink / raw)
  To: catphive; +Cc: help-gnu-emacs

 > >> M-x man is actually kind of annoying because I usually want it to open
 > >> in the window that I run the command in.

If you want that behavior, it might help to add man buffers to either
`same-window-buffer-names' or `same-window-regexps'

 > I think that now that monitors have gotten so big, it's common to have
 > 3 or 4 windows open, whereas in the past most emacs users probably had
 > 2 max. For this reason most of the "open in other window" type
 > commands now behave very unpredictably with 3 or more windows.

Those commands based on `display-buffer' should behave predictably.  If
they don't please report that as a bug.

 > I'm currently learning elisp so I can fix things like this for myself.
 > Guidance on how C-x o, dired's o, C-x b, and M-x man decide which of n
 > windows is the "other window" would be helpful. Hopefully they all
 > just call some "other window" function that I can hook to customize
 > its behavior.

If the same-window-... based behavior fails, `display-buffer' based
functions try to "reuse", in this order

(1) the "least recently used" window,

(2) some visible window on another frame showing the buffer already,

(3) the largest visible window,

(4) some window showing the buffer already,

(5) the largest window.

martin




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

end of thread, other threads:[~2010-04-04  7:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-04  7:05 opening buffers in particular windows? martin rudalics
  -- strict thread matches above, loose matches on Subject: below --
2010-04-02 19:04 Brendan Miller
2010-04-03 21:34 ` Pawel
2010-04-03 22:57   ` Brendan Miller

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).