From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.help Subject: Re: Windows splitting: prefer only 2 windows horizontal spliting. Date: Mon, 21 Feb 2011 08:46:53 +0100 Message-ID: <4D62186D.1080800@gmx.at> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1298382022 19525 80.91.229.12 (22 Feb 2011 13:40:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 22 Feb 2011 13:40:22 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: gavenkoa@gmail.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 22 14:40:18 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PrsT5-0005kV-0g for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 14:40:16 +0100 Original-Received: from localhost ([127.0.0.1]:44669 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrsT1-0003zs-G9 for geh-help-gnu-emacs@m.gmane.org; Tue, 22 Feb 2011 08:39:51 -0500 Original-Received: from [140.186.70.92] (port=57869 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PrQTy-0002tx-UG for help-gnu-emacs@gnu.org; Mon, 21 Feb 2011 02:47:00 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PrQTx-0004ao-Bp for help-gnu-emacs@gnu.org; Mon, 21 Feb 2011 02:46:58 -0500 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:60275) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1PrQTx-0004XD-03 for help-gnu-emacs@gnu.org; Mon, 21 Feb 2011 02:46:57 -0500 Original-Received: (qmail invoked by alias); 21 Feb 2011 07:46:54 -0000 Original-Received: from 62-47-41-106.adsl.highway.telekom.at (EHLO [62.47.41.106]) [62.47.41.106] by mail.gmx.net (mp069) with SMTP; 21 Feb 2011 08:46:54 +0100 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18GmaUUpTUGVaGn7xECcQ9Z/0g7kgHr1GH35+c02p MpAE5rizuQDPfn User-Agent: Thunderbird 2.0.0.21 (Windows/20090302) Original-References: ijruuv$3hu$1@dough.gmane.org X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 213.165.64.23 X-Mailman-Approved-At: Tue, 22 Feb 2011 08:35:55 -0500 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:79307 Archived-At: > 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