unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Re: Windows splitting: prefer only 2 windows horizontal spliting.
@ 2011-02-21  7:47 martin rudalics
  2011-02-21 14:15 ` Perry Smith
  0 siblings, 1 reply; 11+ messages in thread
From: martin rudalics @ 2011-02-21  7:47 UTC (permalink / raw)
  To: pedzsan, help-gnu-emacs

 > This is not exactly what you were asking for.  I wanted to get emacs to
 > do what it was doing before.  I followed the instructions but found

Which instructions?

 > that it kept creating smaller and smaller windows.  So, now I leave
 > split-height-threshold alone and do this (this is inside my
 > .emacs.d/init.el file.
 >
 > (custom-set-variables
 >  ...
 > '(split-width-threshold 1600)
 > )
 >
 > which basically says "don't split windows vertically".

Actually it means "don't split windows horizontally" ;-)

 > Setting it to nil didn't have the effect I was looking for.

What effect were you looking for?

To avoid that `display-buffer' creates smaller and smaller windows, set
the values of either or both `split-height-threshold' and
`split-width-threshold' to nil or to some larger value.  If this doesn't
work for you there's a bug; so please try to tell us more precisely what
you wanted to do and how it failed.

Thanks, martin



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Re: Windows splitting: prefer only 2 windows horizontal spliting.
@ 2011-02-21  7:46 martin rudalics
  0 siblings, 0 replies; 11+ messages in thread
From: martin rudalics @ 2011-02-21  7:46 UTC (permalink / raw)
  To: gavenkoa; +Cc: help-gnu-emacs

 > How prefer horizontal splitting I know:
 >
 >
 > (when window-system
 >   ;; Prefer horizontal windows splitting.
 >   (setq split-height-threshold 0)
 >   (setq split-width-threshold nil)
 >   )

This prefers "vertical" splitting in Emacs parlance ;-) But why do you
check for `window-system' and why do you set `split-height-threshold' to
zero?

 > But how stop Emacs from splitting when already 2 windows?
 > So reuse existing window.

Whenever you ask Emacs to display a buffer, it looks at the largest
window on your frame which, since you don't make side-by-side windows,
is the highest window on your frame.  In `window-splittable-p' the
following happens:

	     (>= (window-height window)
		 (max split-height-threshold
		      (* 2 (max window-min-height
				(if mode-line-format 2 1))))))))))

Since `split-height-threshold' is zero, a new window is split off
whenever the height of the largest window (the value of `window-height'
for that window) is at least as large as two times the minimum height of
the largest window (the value of `window-min-height').

Try setting `split-height-threshold' and `split-width-threshold' both to
nil.  This should allow at most two windows on your frames.

martin



^ permalink raw reply	[flat|nested] 11+ messages in thread
* Windows splitting: prefer only 2 windows horizontal spliting.
@ 2011-02-20 20:52 Oleksandr Gavenko (aka gavenkoa)
  2011-02-20 23:07 ` Perry Smith
  0 siblings, 1 reply; 11+ messages in thread
From: Oleksandr Gavenko (aka gavenkoa) @ 2011-02-20 20:52 UTC (permalink / raw)
  To: help-gnu-emacs

How prefer horizontal splitting I know:

(when window-system
   ;; Prefer horizontal windows splitting.
   (setq split-height-threshold 0)
   (setq split-width-threshold nil)
   )

But how stop Emacs from splitting when already 2 windows?
So reuse existing window.

For example I edit file (1 window) then M-x compile (2 windows)
then C-x ` (2 windows, *Compilation* and source with error) -
no other window appear.

Emacs 23.1/22.3/21.4 work in such way on Debian, but new Emacs 23.2.1
work different.

For example: open file, C-x v l (new window show log),
d (new window show diff, there are 3 windows now),
M-x man printf RET (new window show man, there 4 windows now).

So how force Emacs display no more that 2 windows at same time?




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

end of thread, other threads:[~2011-03-10 12:38 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-21  7:47 Windows splitting: prefer only 2 windows horizontal spliting martin rudalics
2011-02-21 14:15 ` Perry Smith
2011-02-21 17:00   ` martin rudalics
2011-02-21 17:43     ` Perry Smith
2011-02-21 19:03       ` martin rudalics
2011-02-21 22:44       ` Oleksandr Gavenko
2011-03-10 12:38         ` Oleksandr Gavenko
  -- strict thread matches above, loose matches on Subject: below --
2011-02-21  7:46 martin rudalics
2011-02-20 20:52 Oleksandr Gavenko (aka gavenkoa)
2011-02-20 23:07 ` Perry Smith
2011-02-21 22:40   ` Oleksandr Gavenko

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