GNU bug report logs - #20189
25.0.50; Feature request: Alternative split-window-sensibly functions

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Severity: wishlist; Reported by: Tassilo Horn <tsdh@HIDDEN>; dated Tue, 24 Mar 2015 09:19:01 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 27 Mar 2015 18:26:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Mar 27 14:26:36 2015
Received: from localhost ([127.0.0.1]:38305 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YbYxo-00043v-K1
	for submit <at> debbugs.gnu.org; Fri, 27 Mar 2015 14:26:36 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:61077)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1YbYxm-00043i-0x
 for 20189 <at> debbugs.gnu.org; Fri, 27 Mar 2015 14:26:35 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AnEFAGvvdVRBbthL/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCzQSFBgNJIgTohGMG0kJAQIBAoM+A4NwBKg7
X-IPAS-Result: AnEFAGvvdVRBbthL/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCzQSFBgNJIgTohGMG0kJAQIBAoM+A4NwBKg7
X-IronPort-AV: E=Sophos;i="5.01,1,1400040000"; 
   d="scan'208";a="114764861"
Received: from 65-110-216-75.cpe.pppoe.ca (HELO pastel.home) ([65.110.216.75])
 by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA;
 27 Mar 2015 14:26:28 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id 20AFFD65; Fri, 27 Mar 2015 14:26:28 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
Message-ID: <jwvh9t6mh5z.fsf-monnier+emacsbugs@HIDDEN>
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
 <87egoebp60.fsf@HIDDEN> <551166DE.9070007@HIDDEN>
 <87384ubfwj.fsf@HIDDEN> <55127095.2010703@HIDDEN>
 <87k2y51kjk.fsf@HIDDEN> <87iodo58ge.fsf@HIDDEN>
 <55140DF0.2040304@HIDDEN> <jwvmw2z3ksf.fsf-monnier+emacsbugs@HIDDEN>
 <55141849.3010206@HIDDEN>
Date: Fri, 27 Mar 2015 14:26:28 -0400
In-Reply-To: <55141849.3010206@HIDDEN> (martin rudalics's message of "Thu, 26
 Mar 2015 15:31:37 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org, Tassilo Horn <tsdh@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> Because, as I explained two mails ago, `split-window-preferred-function'
> has a doc-string which explicitly says:

Ah, so the issue is if the reuse happens in
split-window-preferred-function.  Indeed, in this case the problem would
be in split-window-preferred-function.


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 16:29:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 12:29:14 2015
Received: from localhost ([127.0.0.1]:37494 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YbAeg-0006Ir-Hp
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 12:29:14 -0400
Received: from mtaout29.012.net.il ([80.179.55.185]:60673)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1YbAed-0006Ib-R9
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 12:29:13 -0400
Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il
 (HyperSendmail v2007.08) id <0NLT00H00UV71T00@HIDDEN> for
 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 18:26:08 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NLT009U6UZKGJ70@HIDDEN>; Thu, 26 Mar 2015 18:26:08 +0200 (IST)
Date: Thu, 26 Mar 2015 18:29:00 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
In-reply-to: <87oange62o.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Tassilo Horn <tsdh@HIDDEN>
Message-id: <838uejoh83.fsf@HIDDEN>
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
 <871tkd36jx.fsf@HIDDEN> <83egodouoo.fsf@HIDDEN> <87a8z027or.fsf_-_@HIDDEN>
 <83lhikoojd.fsf@HIDDEN> <87oange62o.fsf@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Tassilo Horn <tsdh@HIDDEN>
> Cc: 20189 <at> debbugs.gnu.org
> Date: Thu, 26 Mar 2015 05:27:43 +0100
> 
> I'm still a bit unsure how to differentiate "preferred width" from
> `window-min-width'.

I'd suggest to use the preferred width/height when you can split both
ways, and the minimum values to determine when only one way of split
is possible.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 16:04:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 12:04:41 2015
Received: from localhost ([127.0.0.1]:37487 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YbAGv-0005kf-8t
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 12:04:41 -0400
Received: from mout.gmx.net ([212.227.17.20]:53196)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1YbAGt-0005kT-QN
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 12:04:40 -0400
Received: from [62.47.140.183] ([62.47.140.183]) by mail.gmx.com (mrgmx103)
 with ESMTPSA (Nemesis) id 0LmrZY-1Z7ClZ0Jga-00h2gM; Thu, 26 Mar 2015 17:04:33
 +0100
Message-ID: <55142E0A.5080609@HIDDEN>
Date: Thu, 26 Mar 2015 17:04:26 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN>
 <551141AC.40003@HIDDEN>	<87egoebp60.fsf@HIDDEN>
 <551166DE.9070007@HIDDEN>	<87384ubfwj.fsf@HIDDEN>
 <55127095.2010703@HIDDEN>	<87k2y51kjk.fsf@HIDDEN>
 <87iodo58ge.fsf@HIDDEN>	<55140DF0.2040304@HIDDEN> <87a8yz6b8r.fsf@HIDDEN>
In-Reply-To: <87a8yz6b8r.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:TMJar/qKkmJGTP2x36akWARa3cFqg8tnovEJQzBk2yGn7rwbTMP
 h3l0uQjYB/B6mEnSXndBHMwFjFpT3yQFXt+8pg3gXWyqgsdcdp8PuJfB7PfGNFWZwWAUZE8
 O6uSsVwIKuUcm3+BRHGnPUe4QByn6vt4dSLZ1UHqmIFK8HVUr41l80W/Tsr8iwvplU+mmUb
 U0E8nIg7SYJLD/20c4nsg==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 > Yes, I probably don't.  But I like reusing the current window even
 > lesser which would happen when returning just nil.  I also don't want
 > another split which would happen when I defer to
 > `split-window-sensibly'.  So what else can I do?

Earlier you said that you wanted a behavior like.

 >   +--------------------+--------------------+-----------------+
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |   (TWO)         |
 >   |                    |                    |   (THREE)       |
 >   |    *scratch*       |     ONE            |    FOUR         |
 >   +--------------------+--------------------+-----------------+


so even if TWO's window were selected you wanted to show THREE in that
window.

Have you tried the `th/display-buffer' I sent you earlier?  It should
always use the right-/bottommost window after deciding not to split.

If you want a different behavior you'd have to tell me what you want
instead.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 15:15:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 11:15:40 2015
Received: from localhost ([127.0.0.1]:37410 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb9VT-0004ZO-Qd
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 11:15:40 -0400
Received: from deliver.uni-koblenz.de ([141.26.64.15]:43516)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1Yb9VQ-0004ZC-IE
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 11:15:37 -0400
Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by deliver.uni-koblenz.de (Postfix) with ESMTPSA id A03DC1A851C;
 Thu, 26 Mar 2015 16:15:33 +0100 (CET)
From: Tassilo Horn <tsdh@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
 <87egoebp60.fsf@HIDDEN> <551166DE.9070007@HIDDEN>
 <87384ubfwj.fsf@HIDDEN> <55127095.2010703@HIDDEN>
 <87k2y51kjk.fsf@HIDDEN> <87iodo58ge.fsf@HIDDEN>
 <55140DF0.2040304@HIDDEN>
Date: Thu, 26 Mar 2015 16:15:32 +0100
In-Reply-To: <55140DF0.2040304@HIDDEN> (martin rudalics's message of "Thu, 26
 Mar 2015 14:47:28 +0100")
Message-ID: <87a8yz6b8r.fsf@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

martin rudalics <rudalics@HIDDEN> writes:

>> With your suggestions, I finally came up with this which seems to
>> work exactly as I like it:
> [...]
>> (defun th/split-window-sensibly (window)
> [...]
>>        ;; Reuse the LRU window
>>        (get-lru-window)))))
>
> If the last form gets executed, you reuse a window.  Suppose it's
> reused for showing completions.  Then selecting a completion will, as
> a side-effect, delete that window instead of showing the previously
> shown buffer in it.  You probably won't like that.

Yes, I probably don't.  But I like reusing the current window even
lesser which would happen when returning just nil.  I also don't want
another split which would happen when I defer to
`split-window-sensibly'.  So what else can I do?

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 14:32:06 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 10:32:06 2015
Received: from localhost ([127.0.0.1]:37390 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb8pF-0003ZV-8T
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 10:32:05 -0400
Received: from mout.gmx.net ([212.227.15.18]:60060)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1Yb8p9-0003ZD-1T
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 10:31:59 -0400
Received: from [62.47.140.183] ([62.47.140.183]) by mail.gmx.com (mrgmx002)
 with ESMTPSA (Nemesis) id 0MQiB3-1Z30wv26cn-00TzWd; Thu, 26 Mar 2015 15:31:44
 +0100
Message-ID: <55141849.3010206@HIDDEN>
Date: Thu, 26 Mar 2015 15:31:37 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Stefan Monnier <monnier@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN>
 <551141AC.40003@HIDDEN>	<87egoebp60.fsf@HIDDEN>
 <551166DE.9070007@HIDDEN>	<87384ubfwj.fsf@HIDDEN>
 <55127095.2010703@HIDDEN>	<87k2y51kjk.fsf@HIDDEN>
 <87iodo58ge.fsf@HIDDEN>	<55140DF0.2040304@HIDDEN>
 <jwvmw2z3ksf.fsf-monnier+emacsbugs@HIDDEN>
In-Reply-To: <jwvmw2z3ksf.fsf-monnier+emacsbugs@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:pTC9K7q6TXYbcbiJJt4mbz6Shyh7ftgiGYQPUMtoLcN79DeTIKD
 57UI1FGj5MGlaj64/fcCMpcEeQkfCyFQGLp3em93ynfdIRxUveBG0hbL67ON38xHXN+gp+U
 pNOEErxD3kZtfiiPLGNfXd9oERGpLH44qwa5otDvsNXicuytukaDySLWb19c6MWHPZRmP/5
 qcdh9CbRWtYDNJl/J2Org==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org, Tassilo Horn <tsdh@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 >> If the last form gets executed, you reuse a window.  Suppose it's reused
 >> for showing completions.  Then selecting a completion will, as a
 >> side-effect, delete that window instead of showing the previously shown
 >> buffer in it.  You probably won't like that.
 >
 > Sounds like a bug.  Why would the window be deleted?

Because, as I explained two mails ago, `split-window-preferred-function'
has a doc-string which explicitly says:

   This function is called with a window as single argument and is
   supposed to split that window and return the new window.  If the
   window can (or shall) not be split, it is supposed to return nil.

This function is not supposed to reuse a window or create a new frame.
If it does so, the result of quitting the window will be to delete the
window, if possible.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 14:18:12 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 10:18:12 2015
Received: from localhost ([127.0.0.1]:37369 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb8bs-0003EP-9T
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 10:18:12 -0400
Received: from ironport2-out.teksavvy.com ([206.248.154.181]:3566)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <monnier@HIDDEN>) id 1Yb8bp-0003EA-Qh
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 10:18:10 -0400
X-IronPort-Anti-Spam-Filtered: true
X-IronPort-Anti-Spam-Result: AnEFAGvvdVRBbthL/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCzQSFBgNJIgTohGJMIM0CQECAQKDPgODcASoO4E3
X-IPAS-Result: AnEFAGvvdVRBbthL/2dsb2JhbAA3gVOfQYIugQiBdQEBBAFWIwULCzQSFBgNJIgTohGJMIM0CQECAQKDPgODcASoO4E3
X-IronPort-AV: E=Sophos;i="5.01,1,1400040000"; 
   d="scan'208";a="114647105"
Received: from 65-110-216-75.cpe.pppoe.ca (HELO pastel.home) ([65.110.216.75])
 by ironport2-out.teksavvy.com with ESMTP/TLS/DHE-RSA-AES256-SHA;
 26 Mar 2015 10:18:04 -0400
Received: by pastel.home (Postfix, from userid 20848)
 id D47B32441; Thu, 26 Mar 2015 10:18:03 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
Message-ID: <jwvmw2z3ksf.fsf-monnier+emacsbugs@HIDDEN>
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
 <87egoebp60.fsf@HIDDEN> <551166DE.9070007@HIDDEN>
 <87384ubfwj.fsf@HIDDEN> <55127095.2010703@HIDDEN>
 <87k2y51kjk.fsf@HIDDEN> <87iodo58ge.fsf@HIDDEN>
 <55140DF0.2040304@HIDDEN>
Date: Thu, 26 Mar 2015 10:18:03 -0400
In-Reply-To: <55140DF0.2040304@HIDDEN> (martin rudalics's message of "Thu, 26
 Mar 2015 14:47:28 +0100")
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org, Tassilo Horn <tsdh@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

> If the last form gets executed, you reuse a window.  Suppose it's reused
> for showing completions.  Then selecting a completion will, as a
> side-effect, delete that window instead of showing the previously shown
> buffer in it.  You probably won't like that.

Sounds like a bug.  Why would the window be deleted?


        Stefan




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 13:47:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 09:47:44 2015
Received: from localhost ([127.0.0.1]:37100 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb88N-0002TY-Ot
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 09:47:43 -0400
Received: from mout.gmx.net ([212.227.17.20]:59611)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1Yb88L-0002TH-OH
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 09:47:42 -0400
Received: from [62.47.140.183] ([62.47.140.183]) by mail.gmx.com (mrgmx102)
 with ESMTPSA (Nemesis) id 0MbJTE-1Yrh2o1npk-00IpHE; Thu, 26 Mar 2015 14:47:34
 +0100
Message-ID: <55140DF0.2040304@HIDDEN>
Date: Thu, 26 Mar 2015 14:47:28 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN>
 <551141AC.40003@HIDDEN>	<87egoebp60.fsf@HIDDEN>
 <551166DE.9070007@HIDDEN>	<87384ubfwj.fsf@HIDDEN>
 <55127095.2010703@HIDDEN>	<87k2y51kjk.fsf@HIDDEN> <87iodo58ge.fsf@HIDDEN>
In-Reply-To: <87iodo58ge.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:Aym4v0vV+atCkSgRlJ53kyqnV3NjgbBP6CGMefDsv15dm7l6Fxk
 NZOrze4PbLos6EPTRNCptcbx/DVWGh7233dsfQ8SN7lVC/4BeM0Uu5IHDwqytKZeg8Hx4JI
 Lc9lxMALPBNk1rJEcVK1GwOEHsxGy1hL9HcD9hB6CBaudxsEwn7oq8ZShj1BLu0qG2CZi1U
 v6Zp8P2frSmoGPPWsYcZA==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 > With your suggestions, I finally came up with this which seems to work
 > exactly as I like it:
[...]
 > (defun th/split-window-sensibly (window)
[...]
 >        ;; Reuse the LRU window
 >        (get-lru-window)))))

If the last form gets executed, you reuse a window.  Suppose it's reused
for showing completions.  Then selecting a completion will, as a
side-effect, delete that window instead of showing the previously shown
buffer in it.  You probably won't like that.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 11:01:17 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 07:01:17 2015
Received: from localhost ([127.0.0.1]:37048 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb5XF-0005bK-Pd
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 07:01:17 -0400
Received: from deliver.uni-koblenz.de ([141.26.64.15]:38424)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1Yb5XA-0005b3-B0
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 07:01:12 -0400
Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 86FCF1A84DE;
 Thu, 26 Mar 2015 12:01:05 +0100 (CET)
From: Tassilo Horn <tsdh@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
 <87egoebp60.fsf@HIDDEN> <551166DE.9070007@HIDDEN>
 <87384ubfwj.fsf@HIDDEN> <55127095.2010703@HIDDEN>
 <87k2y51kjk.fsf@HIDDEN>
Date: Thu, 26 Mar 2015 12:01:05 +0100
In-Reply-To: <87k2y51kjk.fsf@HIDDEN> (Tassilo Horn's message of "Wed, 25 Mar
 2015 10:41:19 +0100")
Message-ID: <87iodo58ge.fsf@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

Tassilo Horn <tsdh@HIDDEN> writes:

>> You should be able to simplify your code by using idioms from the
>> below.
>>
>> (defun th/split-window-sensibly (_window)
>>   (let ((root (frame-root-window))
>>      (window-combination-resize 'resize))
>>     (cond
>>      ((>= (/ (window-total-width root) (window-combinations root t)) 80)
>>       (split-window (window-last-child root) nil 'right))
>>      ((>= (/ (window-total-height root) (window-combinations root)) 40)
>>       (split-window (window-last-child root) nil 'below))
>>      (t
>>       (split-window-sensibly window)))))
>
> With that and repeated `display-buffer' calls for different buffers
> starting with a single 269x82 window, I get 3 balanced side-by-side
> windows first (good!), but the next d-b creates another horizontal
> window.  Then I have 4 side-by-side balanced windows where each one is
> less than 80 columns wide.  And yet another d-b splits the rightmost
> window vertically although I don't want vertical splits at all if there
> are already horizontal splits.  In that case, it should have reused some
> existing window.

With your suggestions, I finally came up with this which seems to work
exactly as I like it:

--8<---------------cut here---------------start------------->8---
(setq window-min-height 30
      window-min-width 80
      window-combination-resize t
      window-combination-limit nil)

(defun th/split-window-sensibly (window)
  (let ((root (frame-root-window)))
    (cond
     ((and (< (window-combinations root) 2)
           (>= (/ (window-total-width root)
                  (1+ (window-combinations root t)))
               window-min-width))
      (split-window (window-last-child root) nil 'right))
     ((and (< (window-combinations root t) 2)
           (>= (/ (window-total-height root)
                  (1+ (window-combinations root)))
               window-min-height))
      (split-window (window-last-child root) nil 'below))
     (t
      ;; Reuse the LRU window
      (get-lru-window)))))
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 10:58:43 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 06:58:43 2015
Received: from localhost ([127.0.0.1]:37043 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb5Up-0005Vq-7k
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 06:58:43 -0400
Received: from mout.gmx.net ([212.227.15.15]:53503)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1Yb5Un-0005VS-88
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 06:58:41 -0400
Received: from [178.191.139.211] ([178.191.139.211]) by mail.gmx.com
 (mrgmx002) with ESMTPSA (Nemesis) id 0Mb7lL-1Yu03M10YN-00KgLz; Thu, 26 Mar
 2015 11:58:35 +0100
Message-ID: <5513E654.3010501@HIDDEN>
Date: Thu, 26 Mar 2015 11:58:28 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN>
 <83384uqqao.fsf@HIDDEN>	<871tkd36jx.fsf@HIDDEN>
 <83egodouoo.fsf@HIDDEN>	<87a8z027or.fsf_-_@HIDDEN> <83lhikoojd.fsf@HIDDEN>
 <87oange62o.fsf@HIDDEN>
In-Reply-To: <87oange62o.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:VrdvCx87Czv37Vjo5H8YPiclJgk1mYe7ggRESrc+R6M2nIXdZwU
 jbsR2qhZ2ikjpgSCX7Qu8HmrB5yB3UWBQFX37L1xfE3mm/X0mH28S/3WAmMxnqR82RNlSQt
 lV4J9OlezXSkNkDeNHAtIFTQrBUqerHKUpS5FhT1YeSFEUdMnmQ5NyCx8TtfYVvqMOdwlbx
 stskBpezYhBm8j3ELrNFg==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 > To answer myself: it seems I actually want to use a minimum width of
 > 80.  That seems to supress any splits that result in windows smaller
 > than 80 columns unless the width is explicitly given, e.g.,
 >
 >    (setq window-min-width 80)
 >    (display-buffer (get-buffer "*Help*")
 >                    '(display-buffer-pop-up-window
 >                      (window-width . 10)))
 >
 > still splits although the new window is just 10 columns wide.

Not really.  The window gets split because your frame is wide enough
(probably larger than 160 columns).  The new window is 10 columns wide
because you explicitly asked for it via (window-width . 10).

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 10:58:37 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 06:58:37 2015
Received: from localhost ([127.0.0.1]:37040 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yb5Ui-0005VT-Mb
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 06:58:37 -0400
Received: from mout.gmx.net ([212.227.15.19]:49844)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1Yb5Uf-0005VF-KS
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 06:58:34 -0400
Received: from [178.191.139.211] ([178.191.139.211]) by mail.gmx.com
 (mrgmx002) with ESMTPSA (Nemesis) id 0M4WRI-1ZQbFO1UxY-00yfVQ; Thu, 26 Mar
 2015 11:58:26 +0100
Message-ID: <5513E649.80004@HIDDEN>
Date: Thu, 26 Mar 2015 11:58:17 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN>
 <551141AC.40003@HIDDEN>	<87egoebp60.fsf@HIDDEN>
 <551166DE.9070007@HIDDEN>	<87384ubfwj.fsf@HIDDEN> <55127095.2010703@HIDDEN>
 <87k2y51kjk.fsf@HIDDEN>
In-Reply-To: <87k2y51kjk.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:ym8H3bb7mnuRBQSe/FBTpCyufOvsDToQnp++HUrylJnkGIXgeCy
 kMMFJ3w8ioS/jcmZ0CFCRsC4z1kPHeYwfVLRNPg9aAUpwIxSLzZdifVQoczWc1VYZ9Xm1JQ
 /+M8cgoc8ru/plRMclk51qvPyFV1q+3Vih3PLvzC5ydEk+PyUwTLJXkKTeRrAXk7EFfa0rT
 +MNEKO7aflo6t7TWWqeuQ==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 >> If you set `split-width-threshold' to zero and
 >> `split-height-threshold' to nil you should get the behavior you want.
 >
 > Wouldn't that mean that I get as many horizontal windows until they
 > become smaller than `window-min-width'?  I want them to alway be at
 > least 80 columns wide.

Then you have to set `split-width-threshold' to a larger value.

 >> You should be able to simplify your code by using idioms from the
 >> below.
 >>
 >> (defun th/split-window-sensibly (_window)
 >>    (let ((root (frame-root-window))
 >> 	(window-combination-resize 'resize))
 >>      (cond
 >>       ((>= (/ (window-total-width root) (window-combinations root t)) 80)
 >>        (split-window (window-last-child root) nil 'right))
 >>       ((>= (/ (window-total-height root) (window-combinations root)) 40)
 >>        (split-window (window-last-child root) nil 'below))
 >>       (t
 >>        (split-window-sensibly window)))))
 >
 > With that and repeated `display-buffer' calls for different buffers
 > starting with a single 269x82 window, I get 3 balanced side-by-side
 > windows first (good!), but the next d-b creates another horizontal
 > window.  Then I have 4 side-by-side balanced windows where each one is
 > less than 80 columns wide.  And yet another d-b splits the rightmost
 > window vertically although I don't want vertical splits at all if there
 > are already horizontal splits.

I only suggested to use the idioms of that form.  Instead of
`window-tree' or `balance-windows' as you did.

 > In that case, it should have reused some
 > existing window.

That's invalid with `split-window-preferred-function':

   This function is called with a window as single argument and is
   supposed to split that window and return the new window.  If the
   window can (or shall) not be split, it is supposed to return nil.

I think its doc-string is very clear about this.

 > That's ok for me although I think I'd like it better if it was this way:
 >
 >   +--------------------+--------------------+-----------------+
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |                 |
 >   |                    |                    |   (TWO)         |
 >   |                    |                    |   (THREE)       |
 >   |    *scratch*       |     ONE            |    FOUR         |
 >   +--------------------+--------------------+-----------------+


If you want to "reuse" a window you have to do it "elsewhere".  For
example thusly (largely untested, you also have to tweak hardcoded
values like 40 and 80):


(defun th/display-buffer (buffer alist)
   (or (display-buffer-reuse-window buffer alist)
       (let* ((root (frame-root-window))
	     (horizontal (window-combination-p root t))
	     (combs (window-combinations root horizontal)))
	(if (> combs 1)
	    (let* ((last (window-last-child root))
		   (window-combination-resize 'resize)
		   (window
		    (or (and horizontal
			     (>= (/ (window-total-width root) combs) 80)
			     (split-window last nil 'right))
			(and (not horizontal)
			     (>= (/ (window-total-height root) combs) 40)
			     (split-window last nil 'below)))))
	      (if (window-live-p window)
		  (window--display-buffer
		   buffer window 'window alist display-buffer-mark-dedicated)
		;; Reuse last.
		(window--display-buffer buffer last 'reuse alist)))
	  ;; Try to pop up a new window.
	  (display-buffer-pop-up-window buffer alist)))))

(customize-set-variable
  'display-buffer-base-action '(th/display-buffer . nil))


I hope you get the idea ;-)

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 26 Mar 2015 04:27:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu Mar 26 00:27:50 2015
Received: from localhost ([127.0.0.1]:36892 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YazOY-0003kC-8g
	for submit <at> debbugs.gnu.org; Thu, 26 Mar 2015 00:27:50 -0400
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59225)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1YazOV-0003jz-TS
 for 20189 <at> debbugs.gnu.org; Thu, 26 Mar 2015 00:27:48 -0400
Received: from compute6.internal (compute6.nyi.internal [10.202.2.46])
 by mailout.nyi.internal (Postfix) with ESMTP id 9A8AA20977
 for <20189 <at> debbugs.gnu.org>; Thu, 26 Mar 2015 00:27:44 -0400 (EDT)
Received: from frontend2 ([10.202.2.161])
 by compute6.internal (MEProxy); Thu, 26 Mar 2015 00:27:47 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
 messagingengine.com; h=x-sasl-enc:from:to:cc:subject:references
 :date:in-reply-to:message-id:mime-version:content-type; s=
 smtpout; bh=NRseQ41ST9Cd0ybHEg+I2learT8=; b=VT57vVlqn+sZ8s3lALoH
 Gk84uZWiDVDpQ+tiP5xL2tniXFVGBRXmo+g4ArpBqlwCPQW5R6vCFTd03mFG+9jx
 aIcVvJDoyldxAP5Znv+Shtx20uMUtJ9sx3MiHvATvtT9sfNy0Lu0pVl7sRoedkZ5
 mUApjjYFMsuqKNiqPfm07as=
X-Sasl-enc: XOddbsUlEZpM1RvaWtSf/lAcYFWrg4asX23ilYL0PY5H 1427344066
Received: from thinkpad-t440p (unknown [2.161.101.39])
 by mail.messagingengine.com (Postfix) with ESMTPA id 5C874680105;
 Thu, 26 Mar 2015 00:27:46 -0400 (EDT)
From: Tassilo Horn <tsdh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
 <871tkd36jx.fsf@HIDDEN> <83egodouoo.fsf@HIDDEN>
 <87a8z027or.fsf_-_@HIDDEN> <83lhikoojd.fsf@HIDDEN>
Date: Thu, 26 Mar 2015 05:27:43 +0100
In-Reply-To: <83lhikoojd.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 25 Mar
 2015 21:38:46 +0200")
Message-ID: <87oange62o.fsf@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

>> But for the time being, I prefer some solution which is available
>> right now and good enough for my personal preferences.  And that's
>> the point of the issue.  Window handling is extremely hard to
>> configure in Emacs with the amounts of options we have.  That's why
>> I've suggested to have a small set of alternatives one can choose
>> from without having to dig into the details of window thresholds,
>> window parameters, window combinations, etc.
>
> So how about adding 2 more parameters that we've discussed a few
> messages ago, and then come up with a logic that uses all 4 of them to
> give more "sensible" results?

With the new parameters you mean something like `window-preferred-width'
and `window-preferred-height', right?

Sounds legit to me.  In my case, I'd set the preferred width to 80 but
my preferred height is usually as high as possible or as high as needed
to fit the contents of the buffer we want to show in that new window.

Maybe it would make sense to use the values of these two variables (if
non-nil) as defaults for the `window-width' and `window-height' alist
entries of `display-buffer'.

I'm still a bit unsure how to differentiate "preferred width" from
`window-min-width'.  For me, preferred width means a lower bound for
windows with "normal" buffers.  So maybe I want to set
`window-min-width' to 80 instead of its default of 10?  But what about
special, narrow buffers such as `sr-speedbar' (speedbar shown in a
narrow window instead of an extra frame)?

To answer myself: it seems I actually want to use a minimum width of
80.  That seems to supress any splits that result in windows smaller
than 80 columns unless the width is explicitly given, e.g.,

  (setq window-min-width 80)
  (display-buffer (get-buffer "*Help*")
                  '(display-buffer-pop-up-window
                    (window-width . 10)))

still splits although the new window is just 10 columns wide.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 19:39:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 15:39:03 2015
Received: from localhost ([127.0.0.1]:36625 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yar8o-0007fz-Mb
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 15:39:02 -0400
Received: from mtaout25.012.net.il ([80.179.55.181]:58869)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1Yar8l-0007fS-Lr
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 15:39:00 -0400
Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il
 (HyperSendmail v2007.08) id <0NLS00E008U9L700@HIDDEN> for
 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 21:33:58 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NLS00EQS90MUS00@HIDDEN>; Wed, 25 Mar 2015 21:33:58 +0200 (IST)
Date: Wed, 25 Mar 2015 21:38:46 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
In-reply-to: <87a8z027or.fsf_-_@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Tassilo Horn <tsdh@HIDDEN>
Message-id: <83lhikoojd.fsf@HIDDEN>
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
 <871tkd36jx.fsf@HIDDEN> <83egodouoo.fsf@HIDDEN> <87a8z027or.fsf_-_@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Tassilo Horn <tsdh@HIDDEN>
> Cc: 20189 <at> debbugs.gnu.org
> Date: Wed, 25 Mar 2015 20:33:40 +0100
> 
> But for the time being, I prefer some solution which is available right
> now and good enough for my personal preferences.  And that's the point
> of the issue.  Window handling is extremely hard to configure in Emacs
> with the amounts of options we have.  That's why I've suggested to have
> a small set of alternatives one can choose from without having to dig
> into the details of window thresholds, window parameters, window
> combinations, etc.

So how about adding 2 more parameters that we've discussed a few
messages ago, and then come up with a logic that uses all 4 of them to
give more "sensible" results?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 19:33:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 15:33:51 2015
Received: from localhost ([127.0.0.1]:36620 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yar3m-0007YE-FC
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 15:33:50 -0400
Received: from out2-smtp.messagingengine.com ([66.111.4.26]:59000)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1Yar3h-0007Y4-Pt
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 15:33:47 -0400
Received: from compute1.internal (compute1.nyi.internal [10.202.2.41])
 by mailout.nyi.internal (Postfix) with ESMTP id 8C70720843
 for <20189 <at> debbugs.gnu.org>; Wed, 25 Mar 2015 15:33:41 -0400 (EDT)
Received: from frontend2 ([10.202.2.161])
 by compute1.internal (MEProxy); Wed, 25 Mar 2015 15:33:44 -0400
DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=
 messagingengine.com; h=x-sasl-enc:from:to:cc:subject:references
 :date:in-reply-to:message-id:mime-version:content-type; s=
 smtpout; bh=QRdx33sDsb0N/+4vro5L9qT1nn8=; b=fZOQqJ8NH9ZY+bxw9U3b
 itcsTyKz35536J9L0vJG2Rz3mbh/i+/AzFT5/RSzPqe7bSLRIWmeyyFPRAIAX0TP
 g8JCJIwLx81ss3Zz3Z8/sKeAYTbwhdUew9ymcyEQrqmldv91kdj/navM1CZHNbzR
 /Rardj4cgTrkS7qaixdHTlA=
X-Sasl-enc: SKpBBiIh7POu3RtatRX80faes49TvKcvMb+ezk+kQtkF 1427312023
Received: from thinkpad-t440p (unknown [2.162.103.220])
 by mail.messagingengine.com (Postfix) with ESMTPA id 4DE23680169;
 Wed, 25 Mar 2015 15:33:43 -0400 (EDT)
From: Tassilo Horn <tsdh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
 <871tkd36jx.fsf@HIDDEN> <83egodouoo.fsf@HIDDEN>
Date: Wed, 25 Mar 2015 20:33:40 +0100
In-Reply-To: <83egodouoo.fsf@HIDDEN> (Eli Zaretskii's message of "Wed, 25 Mar
 2015 19:25:59 +0200")
Message-ID: <87a8z027or.fsf_-_@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: 0.3 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.3 (/)

Eli Zaretskii <eliz@HIDDEN> writes:

Hi Eli,

> I don't see how we can judge "sensibility" of what display-buffer does
> without knowing which command(s) invoked it.  Users don't invoke
> display-buffer directly, and the commands that do differ widely in the
> amount and dimensions of text they display and subsequent use of the
> displayed stuff.
>
> As a simple example, a command that calls display-buffer could prepare
> text that is best shown in a 100x10 window (think about some columnar
> display), in which case it doesn't make sense to prefer 80-column wide
> side-by-side windows that you seem to prefer.

Long story short: I agree with all that you've said.  And if there's
some optimal algorithm for splitting windows in such a way that the
least screen estate is wasted and at the same time the most buffer
contents are visible, that would be awesome.  No need to convince me
that there's something much better than what I've suggested.

But for the time being, I prefer some solution which is available right
now and good enough for my personal preferences.  And that's the point
of the issue.  Window handling is extremely hard to configure in Emacs
with the amounts of options we have.  That's why I've suggested to have
a small set of alternatives one can choose from without having to dig
into the details of window thresholds, window parameters, window
combinations, etc.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 17:26:18 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 13:26:18 2015
Received: from localhost ([127.0.0.1]:36576 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yap4L-0004Rg-MP
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 13:26:18 -0400
Received: from mtaout25.012.net.il ([80.179.55.181]:44635)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1Yap4I-0004RO-VX
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 13:26:16 -0400
Received: from conversion-daemon.mtaout25.012.net.il by mtaout25.012.net.il
 (HyperSendmail v2007.08) id <0NLS008002RTDT00@HIDDEN> for
 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 19:21:12 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout25.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NLS0025S2VCAD60@HIDDEN>; Wed, 25 Mar 2015 19:21:12 +0200 (IST)
Date: Wed, 25 Mar 2015 19:25:59 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
In-reply-to: <871tkd36jx.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Tassilo Horn <tsdh@HIDDEN>
Message-id: <83egodouoo.fsf@HIDDEN>
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
 <871tkd36jx.fsf@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Tassilo Horn <tsdh@HIDDEN>
> Cc: 20189 <at> debbugs.gnu.org
> Date: Wed, 25 Mar 2015 08:00:34 +0100
> 
> > 'split-window-sensibly' is documented to "split WINDOW in a way
> > suitable for 'display-buffer'".  Are you talking about the same use
> > case, i.e. are you talking about some command that invoked
> > 'display-buffer'?  Or are you talking about some different use case?
>
> Yes, I'm talking about display-buffer.  This is a test case:
> 
> --8<---------------cut here---------------start------------->8---
> (defun test-display-buffer ()
>   (interactive)
>   (display-buffer (get-buffer-create "ONE"))
>   (display-buffer (get-buffer-create "TWO")))
> --8<---------------cut here---------------end--------------->8---
>
> If your screen is as large that your emacs frame/window is taller than
> `split-height-threshold' (80 lines), then the first split will be a
> vertical one.  E.g., do emacs -Q, eval the above function in *scratch*,
> and then M-x it.  You end up with 3 windows: one wide window on top
> showing *scratch*, the lower half contains two side-by-side windows.

I don't see how we can judge "sensibility" of what display-buffer does
without knowing which command(s) invoked it.  Users don't invoke
display-buffer directly, and the commands that do differ widely in the
amount and dimensions of text they display and subsequent use of the
displayed stuff.

As a simple example, a command that calls display-buffer could prepare
text that is best shown in a 100x10 window (think about some columnar
display), in which case it doesn't make sense to prefer 80-column wide
side-by-side windows that you seem to prefer.

> That's not too sensible when one assumes that most buffers are at most
> 80 columns wide but have many lines.  If the first split was a
> horizontal split, you'd have more buffer contents on your screen.

As you see from your own description, the "sensibility" depends quite
a lot on the preferred dimensions and the nature of the text to be
displayed.  I'm not at all sure we can find a "one size fits all"
strategy, at least not without examining the text itself, something
split-window-sensibly doesn't do, AFAIK.

> > This is not clear from your description, since it lacks the context in
> > which your needs are different.
> 
> The context is having a big enough screen where both a vertical and a
> horizontal split would be possible initially.

No, I meant the commands that invoked display-buffer -- they are the
most important context for "sensibility" of the split.

> > If we are willing to produce long-lived splits automatically, then the
> > 2 thresholds are IMO not enough for "sensible" behavior of any kind;
> > what is missing is 2 more parameters that provide the desired (as
> > opposed to minimal) height and width of a window.  These parameters
> > are implicitly present in your description, but you never explicitly
> > name them.
> 
> Yeah, exactly.  I personally defined them to be
> 
>   (/ split-{width,height}-threshold 2)
> 
> although I think the preferred height is usually "as high as possible"
> or "exactly as high to fit the buffer contents".

Once again, I think this depends on the text to be displayed.  If we
want to have a split-window function that does not consult the text to
be displayed, the only way to go is IMO to parameterize the problem
space, and make the function accept these parameters and DTRT for each
combination.

> >> (1) That version would prefer horizontal splits as above.
> >> 
> >> (2) I want either horizontal or vertical splitting but not both, i.e.,
> >>     the layout should always be Nx1 or 1xN windows.
> >> 
> >> (3) A window may get split horizontally not if it's wider/taller than
> >>     `split-width-threshold'/`split-height-threshold' but instead when
> >>     its width/height *after* the split followed by `balance-windows'
> >>     is larger than or equal to (/ split-{width,height}-threshold 2).
> >> 
> >> (4) The single-window exception of `split-height-threshold' still
> >>     holds, so in frames with just one window a vertical split is
> >>     performed even though that window is actually too small according
> >>     to the rules above.
> >
> > Maybe I misunderstand, but doesn't (2) contradict (1)?
> 
> No.  (1) is meant for the initial split case, i.e., when there's just
> one window.  If that's splittable both vertically and horizontally, I
> prefer a horizontal split.

That's a far cry from what you wrote in (1).

> > And why is (1) a good idea anyway?  Why not have a more optimal split,
> > whereby (for example) the larger dimension is preferred?
> 
> IMO, a vertial split which produces windows which are much larger than
> 80 columns is useless to me because usually buffer contents are at most
> 80 columns wide so you have tons of empty space next to the contents.

If the horizontal dimension of the initial widow to be split is larger
than the vertical one, then the rule I propose will always do what you
want for the first couple of splits.  After that, I see no reason to
prefer splitting, say, a 120x80 window into 2 60x80 windows instead of
into 2 120x40 windows.

> Ok, there might be a situation where my single window contains a buffer
> with very wide contents.  Let's say in that case, the optimal window
> split function would determine that a vertical split is better.  With my
> usage habits, I'd still say its wrong because chances are almost certain
> that I'll switch buffers sooner or later, and the buffer being switched
> to is most probably at most 80 columns wide again.

You do see how this line of reasoning is deeply specific to your
habits, don't you?  Which means there cannot be on strategy that fits
all of us.

> There might be some "dynamic" window adaption manager which computes an
> optimal window configuration after every `set-window-buffer'.  But I'm
> not sure if that is feasible and provides a good user experience.

We need to define the strategy for such an optimization first, then we
can reason about whether users will like it, and how to customize it
to user needs.

> > As for (3), such a criterion is IMO a good idea only if we actually
> > balance the windows as part of the split.  Otherwise, you will have
> > adverse effects when the window to be split is very narrow, but some
> > of its peers are wide.
> 
> Yes, in my last mail I've hacked a split function which does exactly
> that.

But actually balancing windows would be a bad idea for some users of
display-buffer, at least in my eyes.  A typical example is the
*Compilation* buffer and its ilk: I generally want them to keep their
small size, not to steal screen estate from my editing windows.
Similarly with *Help* etc.

> >> When I use a frame of size 80x82 instead, I'd end up with 2 vertical
> >> windows
> >
> > And this is good because?...
> 
> Exactly because of the reason you state below.  The frame/window isn't
> wide enough to have 2 side-by-side windows with at least 80 columns
> each, so that's the case where I favor vertical over horizontal
> splitting.

That's because you think about displaying some program text there, or
similar.  But what if the text to be displayed there is much more
narrow, or even adapts itself dynamically to the window dimensions,
like the *Completions* buffer?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 09:41:25 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 05:41:25 2015
Received: from localhost ([127.0.0.1]:35597 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YahoT-0007UB-08
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 05:41:25 -0400
Received: from deliver.uni-koblenz.de ([141.26.64.15]:46012)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1YahoP-0007Tz-1U
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 05:41:22 -0400
Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 9241B1A843E;
 Wed, 25 Mar 2015 10:41:19 +0100 (CET)
From: Tassilo Horn <tsdh@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
 <87egoebp60.fsf@HIDDEN> <551166DE.9070007@HIDDEN>
 <87384ubfwj.fsf@HIDDEN> <55127095.2010703@HIDDEN>
Date: Wed, 25 Mar 2015 10:41:19 +0100
Message-ID: <87k2y51kjk.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

martin rudalics <rudalics@HIDDEN> writes:

>> two consecutive C-x 3 starting from the big single window results in
>> three side-by-side *balanced* windows, each being 86x82 large.
>> That's actually what I wanted.  However, I'd like that this splitting
>> behavior was the default for `display-buffer'.  But that fails
>> because after the first horizontal split, `window-splittable-p' says
>> that both horizontal windows aren't horizontally splittable anymore
>> because they are narrower than `split-width-threshold'.
>
> If you set `split-width-threshold' to zero and
> `split-height-threshold' to nil you should get the behavior you want.

Wouldn't that mean that I get as many horizontal windows until they
become smaller than `window-min-width'?  I want them to alway be at
least 80 columns wide.

>> I've come up with a solution which seems to fit my preferences quite
>> nicely although it's probably quite hackish and ignores possible
>> contracts that might exist for dedicated windows, fixed-size windows,
>> side windows and what else there might be.
>
> You should be able to simplify your code by using idioms from the
> below.
>
> (defun th/split-window-sensibly (_window)
>   (let ((root (frame-root-window))
> 	(window-combination-resize 'resize))
>     (cond
>      ((>= (/ (window-total-width root) (window-combinations root t)) 80)
>       (split-window (window-last-child root) nil 'right))
>      ((>= (/ (window-total-height root) (window-combinations root)) 40)
>       (split-window (window-last-child root) nil 'below))
>      (t
>       (split-window-sensibly window)))))

With that and repeated `display-buffer' calls for different buffers
starting with a single 269x82 window, I get 3 balanced side-by-side
windows first (good!), but the next d-b creates another horizontal
window.  Then I have 4 side-by-side balanced windows where each one is
less than 80 columns wide.  And yet another d-b splits the rightmost
window vertically although I don't want vertical splits at all if there
are already horizontal splits.  In that case, it should have reused some
existing window.

Here's my test case:

--8<---------------cut here---------------start------------->8---
(defun th/split-window-sensibly (_window)
  (let ((root (frame-root-window))
 	(window-combination-resize 'resize))
    (cond
     ((>= (/ (window-total-width root) (window-combinations root t)) 80)
      (split-window (window-last-child root) nil 'right))
     ((>= (/ (window-total-height root) (window-combinations root)) 40)
      (split-window (window-last-child root) nil 'below))
     (t
      (split-window-sensibly window)))))

(setq split-window-preferred-function #'th/split-window-sensibly)

(defun test-splitting ()
  (interactive)
  (display-buffer (get-buffer-create "ONE"))
  (display-buffer (get-buffer-create "TWO"))
  (display-buffer (get-buffer-create "THREE"))
  (display-buffer (get-buffer-create "FOUR")))
--8<---------------cut here---------------end--------------->8---

So now when starting with emacs -Q, maximizing, putting the above in
*scratch*, evaling it, followed by M-x test-splitting RET, I get:

 +---------------+-------------+---------------+-------------+
 |               |             |               |             |
 |               |             |               |             |
 |               |             |               |             |
 |               |             |               |             |
 |               |             |               |             |
 |               |             |               |   THREE     |
 |               |             |               +-------------+
 |               |             |               |             |
 |               |             |               |             |
 |               |             |               |             |
 |               |             |               |             |
 | *scratch*     |    ONE      |    TWO        |   FOUR      |
 +---------------+-------------+---------------+-------------+

With my function, I get instead

 +--------------------+--------------------+-----------------+
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |   (ONE)         |
 |                    |                    |   (THREE)       |
 |    *scratch*       |     TWO            |    FOUR         |
 +--------------------+--------------------+-----------------+

where the (ONE), (THREE) denotes the buffer history, e.g., initially the
leftmost window showed buffer ONE, then it was reused to show THREE, and
finally it was reused again to show buffer FOUR.

That's ok for me although I think I'd like it better if it was this way:

 +--------------------+--------------------+-----------------+
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |                 |
 |                    |                    |   (TWO)         |
 |                    |                    |   (THREE)       |
 |    *scratch*       |     ONE            |    FOUR         |
 +--------------------+--------------------+-----------------+

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 08:24:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 04:24:22 2015
Received: from localhost ([127.0.0.1]:35588 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yagbt-0005R5-Lw
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 04:24:21 -0400
Received: from mout.gmx.net ([212.227.17.22]:60728)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1Yagbs-0005Qq-79
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 04:24:20 -0400
Received: from [178.189.204.62] ([178.189.204.62]) by mail.gmx.com (mrgmx102)
 with ESMTPSA (Nemesis) id 0Mcxtm-1YrfWo1aqY-00IGWY;
 Wed, 25 Mar 2015 09:24:12 +0100
Message-ID: <551270A7.5070601@HIDDEN>
Date: Wed, 25 Mar 2015 09:24:07 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
 <871tkd36jx.fsf@HIDDEN>
In-Reply-To: <871tkd36jx.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:Y6T0PajW8WtOAa9LPeTwApKUdaxdDdisQrLgNVpMKxplDXVKOIq
 qm6GScgQMvNHAbuU2RSvFwund6PYrNrBXwPCN7XXvzMjnfNx5riqWEorUSOyAJLVaFuudvu
 LpuY/4LXnBjmirnJLjIBcpnlb6ek/6EV1hWpsQeqZCS5itcU7yM/hsHCCNJGvZV6Kldhd/H
 98UdCpww9MYQfWCF6Tghw==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 > Are explicitly created windows treated any differently than explicitly
 > created windows?

Now that's a difficult question ...

One thing `display-buffer' sets up is the 'quit-restore' window
parameter which determines the future behavior of `quit-window'.
C-x 2 and C-x 3 don't do that.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 08:24:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 04:24:09 2015
Received: from localhost ([127.0.0.1]:35585 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Yagbh-0005Qe-AC
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 04:24:09 -0400
Received: from mout.gmx.net ([212.227.17.20]:56117)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1Yagbe-0005Py-Os
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 04:24:08 -0400
Received: from [178.189.204.62] ([178.189.204.62]) by mail.gmx.com (mrgmx101)
 with ESMTPSA (Nemesis) id 0Lip2P-1ZDbr03vNl-00czBy;
 Wed, 25 Mar 2015 09:24:00 +0100
Message-ID: <5512709B.9080003@HIDDEN>
Date: Wed, 25 Mar 2015 09:23:55 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Eli Zaretskii <eliz@HIDDEN>, Tassilo Horn <tsdh@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
In-Reply-To: <83384uqqao.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:fEYEPC0QToDKzsPKUOBNCWzQcT1ghK5zqDc7Z8mUavn1E08MoZQ
 o1i/zEswd5+DZWARBMcE6MY4rPVplHZHt+OuY8rfrVseLxbDTkVQDJkz4dnEtzd6wEeHIF7
 atDH9qNyeRaDAOPEc+TrON/k7C5B3eIVTQe2GFY74gw3q8ZrMQ0jQiPNou/JB5vp5Fi4Nu0
 FNJTO+GJgWweo2S2sYtCQ==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 > My understanding of the current logic is that 'display-buffer' is
 > generally used for short-lived windows that are intended to be deleted
 > a short time after the split.

`display-buffer' is, for example, used in `find-file-other-window' so
it's also used for making long-lived windows.

 >> (1) That version would prefer horizontal splits as above.
 >>
 >> (2) I want either horizontal or vertical splitting but not both, i.e.,
 >>      the layout should always be Nx1 or 1xN windows.
 >>
 >> (3) A window may get split horizontally not if it's wider/taller than
 >>      `split-width-threshold'/`split-height-threshold' but instead when
 >>      its width/height *after* the split followed by `balance-windows'
 >>      is larger than or equal to (/ split-{width,height}-threshold 2).
 >>
 >> (4) The single-window exception of `split-height-threshold' still
 >>      holds, so in frames with just one window a vertical split is
 >>      performed even though that window is actually too small according
 >>      to the rules above.
 >
 > Maybe I misunderstand, but doesn't (2) contradict (1)?

I don't think so.  Tassilo just prefers side-by-side windows, if the
frame dimensions permit them.

 > And why is (1) a good idea anyway?  Why not have a more optimal split,
 > whereby (for example) the larger dimension is preferred?

`display-buffer' proposes to split the largest window first.  This
choice cannot be influenced by `split-window-preferred-function'.
Although the latter may deliberately try to split another window
instead.

 > It is also possible that in some cases the caller of
 > split-window-sensibly could provide the requested dimensions in
 > advance.

The `window-width' and `window-height' alist members of `display-buffer'
can be used to provide them.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 08:24:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 04:24:08 2015
Received: from localhost ([127.0.0.1]:35582 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YagbZ-0005Q2-Uh
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 04:24:08 -0400
Received: from mout.gmx.net ([212.227.17.21]:57198)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1YagbX-0005Pj-U0
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 04:24:00 -0400
Received: from [178.189.204.62] ([178.189.204.62]) by mail.gmx.com (mrgmx103)
 with ESMTPSA (Nemesis) id 0LlV4F-1ZAqy643J1-00bHvW;
 Wed, 25 Mar 2015 09:23:54 +0100
Message-ID: <55127095.2010703@HIDDEN>
Date: Wed, 25 Mar 2015 09:23:49 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN>
 <551141AC.40003@HIDDEN>	<87egoebp60.fsf@HIDDEN> <551166DE.9070007@HIDDEN>
 <87384ubfwj.fsf@HIDDEN>
In-Reply-To: <87384ubfwj.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:1pXN8A5fNgdZRirkZ7mhPS9ulzFDKPsD/e9CH2RueGA8/PTZwsH
 +YpMwFwGrr+N1ApHyNVvCGine+uJ8usieRQuHk9Y4gCWHC86AZURvN0dynetTQpKA5B3QrT
 03OLksqWLkW0icPDTFpKkCwhDAEA3oEJBB66lRiFHiwixxfAOo1oqW0vfbTAPHxvc+Ejd04
 DRVsKtJgtKOqwkW8OBslg==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 >> Then how comes you "eventually end up with three side-by-side windows
 >> each of size 86x82"?
 >
 > No, I don't end up with that.  If I had the split function I imagined,
 > then I would end up with that configuration.  So that's the goal I want
 > to achieve but for which I have no solution.

I see.  I thought there was some black magic involved when I read your
first post ;-)

 >> By default you should get one window with 135 columns and two windows
 >> with 67 columns, approximately.
 >
 > Indeed, that's what I get with C-x 3 C-x 3 starting from a single window
 > of size 269x82 and the default value of `window-combination-resize' and
 > `window-combination-limit'.
 >
 > With
 >
 >    (setq window-combination-resize t
 >          window-combination-limit nil)
 >
 > two consecutive C-x 3 starting from the big single window results in
 > three side-by-side *balanced* windows, each being 86x82 large.  That's
 > actually what I wanted.  However, I'd like that this splitting behavior
 > was the default for `display-buffer'.  But that fails because after the
 > first horizontal split, `window-splittable-p' says that both horizontal
 > windows aren't horizontally splittable anymore because they are narrower
 > than `split-width-threshold'.

If you set `split-width-threshold' to zero and `split-height-threshold'
to nil you should get the behavior you want.

 > I've come up with a solution which seems to fit my preferences quite
 > nicely although it's probably quite hackish and ignores possible
 > contracts that might exist for dedicated windows, fixed-size windows,
 > side windows and what else there might be.

You should be able to simplify your code by using idioms from the below.

(defun th/split-window-sensibly (_window)
   (let ((root (frame-root-window))
	(window-combination-resize 'resize))
     (cond
      ((>= (/ (window-total-width root) (window-combinations root t)) 80)
       (split-window (window-last-child root) nil 'right))
      ((>= (/ (window-total-height root) (window-combinations root)) 40)
       (split-window (window-last-child root) nil 'below))
      (t
       (split-window-sensibly window)))))

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 25 Mar 2015 07:00:42 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Mar 25 03:00:42 2015
Received: from localhost ([127.0.0.1]:35532 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YafIv-0003Cb-5J
	for submit <at> debbugs.gnu.org; Wed, 25 Mar 2015 03:00:41 -0400
Received: from deliver.uni-koblenz.de ([141.26.64.15]:42798)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1YafIq-0003CP-75
 for 20189 <at> debbugs.gnu.org; Wed, 25 Mar 2015 03:00:37 -0400
Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 0A0C61A8472;
 Wed, 25 Mar 2015 08:00:34 +0100 (CET)
From: Tassilo Horn <tsdh@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <83384uqqao.fsf@HIDDEN>
Date: Wed, 25 Mar 2015 08:00:34 +0100
Message-ID: <871tkd36jx.fsf@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

Eli Zaretskii <eliz@HIDDEN> writes:

Hi Eli,

>> The problem with `split-window-sensibly' on a wide screen is that it
>> prefers vertical splits.  The current emacs -Q behavior in a
>> maximized frame of size 269x82, the first split will be a vertical
>> one.  That's pretty useless because then you have two windows with
>> nearly 200 columns of free space right of the buffer contents
>> (assuming that usually most buffer contents are at most 80 columns
>> wide).
>
> 'split-window-sensibly' is documented to "split WINDOW in a way
> suitable for 'display-buffer'".  Are you talking about the same use
> case, i.e. are you talking about some command that invoked
> 'display-buffer'?  Or are you talking about some different use case?

Yes, I'm talking about display-buffer.  This is a test case:

--8<---------------cut here---------------start------------->8---
(defun test-display-buffer ()
  (interactive)
  (display-buffer (get-buffer-create "ONE"))
  (display-buffer (get-buffer-create "TWO")))
--8<---------------cut here---------------end--------------->8---

If your screen is as large that your emacs frame/window is taller than
`split-height-threshold' (80 lines), then the first split will be a
vertical one.  E.g., do emacs -Q, eval the above function in *scratch*,
and then M-x it.  You end up with 3 windows: one wide window on top
showing *scratch*, the lower half contains two side-by-side windows.

That's not too sensible when one assumes that most buffers are at most
80 columns wide but have many lines.  If the first split was a
horizontal split, you'd have more buffer contents on your screen.

> This is not clear from your description, since it lacks the context in
> which your needs are different.

The context is having a big enough screen where both a vertical and a
horizontal split would be possible initially.

> IMO, the rest of the discussion depends crucially upon the context,
> and in particular on the command that invoked 'display-buffer' (or
> maybe invoked 'split-window-sensibly' directly?).
>
> My understanding of the current logic is that 'display-buffer' is
> generally used for short-lived windows that are intended to be deleted
> a short time after the split.  Long-lived splits are supposed to be
> caused by "C-x 2" and "C-x 3", where the user determines how to split
> anyway.

I almost never split explicitly.  I just reuse the windows that are
there anyway no matter how they were brought into life.

Are explicitly created windows treated any differently than explicitly
created windows?

> If we are willing to produce long-lived splits automatically, then the
> 2 thresholds are IMO not enough for "sensible" behavior of any kind;
> what is missing is 2 more parameters that provide the desired (as
> opposed to minimal) height and width of a window.  These parameters
> are implicitly present in your description, but you never explicitly
> name them.

Yeah, exactly.  I personally defined them to be

  (/ split-{width,height}-threshold 2)

although I think the preferred height is usually "as high as possible"
or "exactly as high to fit the buffer contents".

>> It's exactly like `split-window-sensibly' except that the
>> horizontal/vertical clauses are reversed, i.e., it tries a horizontal
>> split before trying a vertical split.  That version suits my needs a
>> bit better.
>> 
>> However, it's still not exactly what I really want.  The problem is
>> that after the first horizontal split I end up with 2 side-by-side
>> windows where each one is 132 columns wide.  That's still much wider
>> as needed for most buffer contents but less than
>> `split-width-threshold', so the next splits will all be vertical ones
>> so that I'll eventually end up with four windows arranged in a 2x2
>> grid, each window having the size 132x40.
>
> You never say what are your values of the 2 thresholds, so it is hard
> to reason about your description.

Then assum they are the defaults.  Actually, `split-width-threshold' is
152 because most buffers I use are generally narrower than 80 chars, but
my examples were all run with emacs -Q.

>> (1) That version would prefer horizontal splits as above.
>> 
>> (2) I want either horizontal or vertical splitting but not both, i.e.,
>>     the layout should always be Nx1 or 1xN windows.
>> 
>> (3) A window may get split horizontally not if it's wider/taller than
>>     `split-width-threshold'/`split-height-threshold' but instead when
>>     its width/height *after* the split followed by `balance-windows'
>>     is larger than or equal to (/ split-{width,height}-threshold 2).
>> 
>> (4) The single-window exception of `split-height-threshold' still
>>     holds, so in frames with just one window a vertical split is
>>     performed even though that window is actually too small according
>>     to the rules above.
>
> Maybe I misunderstand, but doesn't (2) contradict (1)?

No.  (1) is meant for the initial split case, i.e., when there's just
one window.  If that's splittable both vertically and horizontally, I
prefer a horizontal split.

Thereafter, i.e., we already have 2 or more either side-by-side or
on-top-of-each-other windows, rule (2) says to stick to that layout.

> And why is (1) a good idea anyway?  Why not have a more optimal split,
> whereby (for example) the larger dimension is preferred?

IMO, a vertial split which produces windows which are much larger than
80 columns is useless to me because usually buffer contents are at most
80 columns wide so you have tons of empty space next to the contents.

Ok, there might be a situation where my single window contains a buffer
with very wide contents.  Let's say in that case, the optimal window
split function would determine that a vertical split is better.  With my
usage habits, I'd still say its wrong because chances are almost certain
that I'll switch buffers sooner or later, and the buffer being switched
to is most probably at most 80 columns wide again.

There might be some "dynamic" window adaption manager which computes an
optimal window configuration after every `set-window-buffer'.  But I'm
not sure if that is feasible and provides a good user experience.

> As for (3), such a criterion is IMO a good idea only if we actually
> balance the windows as part of the split.  Otherwise, you will have
> adverse effects when the window to be split is very narrow, but some
> of its peers are wide.

Yes, in my last mail I've hacked a split function which does exactly
that.

>> When I use a frame of size 80x82 instead, I'd end up with 2 vertical
>> windows
>
> And this is good because?...

Exactly because of the reason you state below.  The frame/window isn't
wide enough to have 2 side-by-side windows with at least 80 columns
each, so that's the case where I favor vertical over horizontal
splitting.

> FWIW, I'd prefer a 80x41 window to a 40x82 window, since 40 columns is
> way too few for editing a typical program or text buffer.  Or do you
> have a lot of buffers with very short lines?

No, exactly.  Do I use the wrong terminology?  When I say I end up with
2 vertical windows, I mean they are on top of each other thus have the
sizes 80x41 (or 80x40 because of the additional mode-line) each.

> It is also possible that in some cases the caller of
> split-window-sensibly could provide the requested dimensions in
> advance.

Possibly, but at least that's not possible with the current API.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 24 Mar 2015 17:05:54 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 13:05:54 2015
Received: from localhost ([127.0.0.1]:35218 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YaSH4-0001kw-3E
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 13:05:54 -0400
Received: from mtaout29.012.net.il ([80.179.55.185]:50140)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <eliz@HIDDEN>) id 1YaSH1-0001ki-BW
 for 20189 <at> debbugs.gnu.org; Tue, 24 Mar 2015 13:05:52 -0400
Received: from conversion-daemon.mtaout29.012.net.il by mtaout29.012.net.il
 (HyperSendmail v2007.08) id <0NLQ005007A5JS00@HIDDEN> for
 20189 <at> debbugs.gnu.org; Tue, 24 Mar 2015 19:02:43 +0200 (IST)
Received: from HOME-C4E4A596F7 ([87.69.4.28]) by mtaout29.012.net.il
 (HyperSendmail v2007.08) with ESMTPA id
 <0NLQ0042O7CJQ010@HIDDEN>; Tue, 24 Mar 2015 19:02:43 +0200 (IST)
Date: Tue, 24 Mar 2015 19:05:35 +0200
From: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
In-reply-to: <87iodqbvoz.fsf@HIDDEN>
X-012-Sender: halo1@HIDDEN
To: Tassilo Horn <tsdh@HIDDEN>
Message-id: <83384uqqao.fsf@HIDDEN>
References: <87iodqbvoz.fsf@HIDDEN>
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
Reply-To: Eli Zaretskii <eliz@HIDDEN>
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 1.0 (+)

> From: Tassilo Horn <tsdh@HIDDEN>
> Date: Tue, 24 Mar 2015 10:18:04 +0100
> 
> With the widescreen displays that are common today, the default behavior
> of `split-window-sensibly' is not always too sensible, and of course
> what's sensible is determined by the user.  So I'd suggest that some
> alternative implementations are provided so that users can easily try
> them out to find the one that suits them best.
> 
> The problem with `split-window-sensibly' on a wide screen is that it
> prefers vertical splits.  The current emacs -Q behavior in a maximized
> frame of size 269x82, the first split will be a vertical one.  That's
> pretty useless because then you have two windows with nearly 200 columns
> of free space right of the buffer contents (assuming that usually most
> buffer contents are at most 80 columns wide).

'split-window-sensibly' is documented to "split WINDOW in a way
suitable for 'display-buffer'".  Are you talking about the same use
case, i.e. are you talking about some command that invoked
'display-buffer'?  Or are you talking about some different use case?
This is not clear from your description, since it lacks the context in
which your needs are different.

IMO, the rest of the discussion depends crucially upon the context,
and in particular on the command that invoked 'display-buffer' (or
maybe invoked 'split-window-sensibly' directly?).

My understanding of the current logic is that 'display-buffer' is
generally used for short-lived windows that are intended to be deleted
a short time after the split.  Long-lived splits are supposed to be
caused by "C-x 2" and "C-x 3", where the user determines how to split
anyway.

If we are willing to produce long-lived splits automatically, then the
2 thresholds are IMO not enough for "sensible" behavior of any kind;
what is missing is 2 more parameters that provide the desired (as
opposed to minimal) height and width of a window.  These parameters
are implicitly present in your description, but you never explicitly
name them.

> It's exactly like `split-window-sensibly' except that the
> horizontal/vertical clauses are reversed, i.e., it tries a horizontal
> split before trying a vertical split.  That version suits my needs a bit
> better.
> 
> However, it's still not exactly what I really want.  The problem is that
> after the first horizontal split I end up with 2 side-by-side windows
> where each one is 132 columns wide.  That's still much wider as needed
> for most buffer contents but less than `split-width-threshold', so the
> next splits will all be vertical ones so that I'll eventually end up
> with four windows arranged in a 2x2 grid, each window having the size
> 132x40.

You never say what are your values of the 2 thresholds, so it is hard
to reason about your description.

> (1) That version would prefer horizontal splits as above.
> 
> (2) I want either horizontal or vertical splitting but not both, i.e.,
>     the layout should always be Nx1 or 1xN windows.
> 
> (3) A window may get split horizontally not if it's wider/taller than
>     `split-width-threshold'/`split-height-threshold' but instead when
>     its width/height *after* the split followed by `balance-windows'
>     is larger than or equal to (/ split-{width,height}-threshold 2).
> 
> (4) The single-window exception of `split-height-threshold' still
>     holds, so in frames with just one window a vertical split is
>     performed even though that window is actually too small according
>     to the rules above.

Maybe I misunderstand, but doesn't (2) contradict (1)?

And why is (1) a good idea anyway?  Why not have a more optimal split,
whereby (for example) the larger dimension is preferred?

As for (3), such a criterion is IMO a good idea only if we actually
balance the windows as part of the split.  Otherwise, you will have
adverse effects when the window to be split is very narrow, but some
of its peers are wide.

> When I use a frame of size 80x82 instead, I'd end up with 2 vertical
> windows

And this is good because?...

FWIW, I'd prefer a 80x41 window to a 40x82 window, since 40 columns is
way too few for editing a typical program or text buffer.  Or do you
have a lot of buffers with very short lines?

It is also possible that in some cases the caller of
split-window-sensibly could provide the requested dimensions in
advance.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 24 Mar 2015 14:59:14 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 10:59:14 2015
Received: from localhost ([127.0.0.1]:35172 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YaQIT-0007Iu-DI
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 10:59:14 -0400
Received: from deliver.uni-koblenz.de ([141.26.64.15]:34195)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1YaQIQ-0007Il-A4
 for 20189 <at> debbugs.gnu.org; Tue, 24 Mar 2015 10:59:11 -0400
Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 2133A3D6005;
 Tue, 24 Mar 2015 15:59:09 +0100 (CET)
From: Tassilo Horn <tsdh@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
 <87egoebp60.fsf@HIDDEN> <551166DE.9070007@HIDDEN>
Date: Tue, 24 Mar 2015 15:59:08 +0100
In-Reply-To: <551166DE.9070007@HIDDEN> (martin rudalics's message of "Tue, 24
 Mar 2015 14:30:06 +0100")
Message-ID: <87384ubfwj.fsf@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

martin rudalics <rudalics@HIDDEN> writes:

>>>> With that and a maximized frame of size 269x82, I'd eventually end
>>>> up with three side-by-side windows each of size 86x82.
>>>
>>> Interesting.  What is your value of `window-combination-resize'?
>>
>> I didn't know that, so it has the default value nil.
>
> Then how comes you "eventually end up with three side-by-side windows
> each of size 86x82"?

No, I don't end up with that.  If I had the split function I imagined,
then I would end up with that configuration.  So that's the goal I want
to achieve but for which I have no solution.

> By default you should get one window with 135 columns and two windows
> with 67 columns, approximately.

Indeed, that's what I get with C-x 3 C-x 3 starting from a single window
of size 269x82 and the default value of `window-combination-resize' and
`window-combination-limit'.

With

  (setq window-combination-resize t
        window-combination-limit nil)

two consecutive C-x 3 starting from the big single window results in
three side-by-side *balanced* windows, each being 86x82 large.  That's
actually what I wanted.  However, I'd like that this splitting behavior
was the default for `display-buffer'.  But that fails because after the
first horizontal split, `window-splittable-p' says that both horizontal
windows aren't horizontally splittable anymore because they are narrower
than `split-width-threshold'.

>> Reading its docs I get the impression that I want that to be t
>> instead, and to have it effective, I'd also need to set
>> `window-combination-limit' to nil.
>>
>> But with
>>
>>    (setq window-combination-resize t
>>          window-combination-limit nil) ;; was window-size before
>>
>> and a single 269x82 window, I still get a horizontal split first
>> (forming a horizontal combination IIUC) and then a vertical split.
>
> Yes - these are unrelated.  `split-window-sensibly' controls the
> "split-direction".
>
> I share most of your concerns.  But I'm not sure though where to put
> a/the solution.

I've come up with a solution which seems to fit my preferences quite
nicely although it's probably quite hackish and ignores possible
contracts that might exist for dedicated windows, fixed-size windows,
side windows and what else there might be.

--8<---------------cut here---------------start------------->8---
(defun th/split-window-sensibly-prefer-horizontal-split (&optional window)
  "Like `split-window-sensibly' but prefer horizontal splits."
  (let ((window (or window (selected-window))))
    (or (and (window-splittable-p window t)
             ;; Split window horizontally.
             (with-selected-window window
               (split-window-right)))
        (and (window-splittable-p window)
             ;; Split window vertically.
             (with-selected-window window
               (split-window-below)))
        (and (eq window (frame-root-window (window-frame window)))
             (not (window-minibuffer-p window))
             ;; If WINDOW is the only window on its frame and is not the
             ;; minibuffer window, try to split it vertically disregarding
             ;; the value of `split-height-threshold'.
             (let ((split-height-threshold 0))
               (when (window-splittable-p window)
                 (with-selected-window window
                   (split-window-below))))))))

(defun th/split-window-sensibly (&optional window)
  (interactive)
  (let* ((root-tree (car (window-tree)))
         (new-window (when (listp root-tree)
                       (let ((dir (car root-tree))
                             (windows (cddr root-tree)))
                         (cond
                          ;; Split horizontally if we're horizontally split
                          ;; already and have enough space for another
                          ;; horizontal window after balancing.
                          ((and (null dir)
                                (cl-every #'windowp windows)
                                (> (apply #'+ (mapcar (lambda (w)
                                                        (- (window-width w)
                                                           (/ split-width-threshold 2)))
                                                      windows))
                                   (/ split-width-threshold 2)))
                           (split-window-right))
                          ;; Split vertically if we're vertically split already
                          ;; and have enough space for another vertical window.
                          ((and dir
                                (cl-every #'windowp windows)
                                (> (apply #'+ (mapcar (lambda (w)
                                                        (- (window-height w)
                                                           (/ split-height-threshold 2)))
                                                      windows))
                                   (/ split-height-threshold 2)))
                           (split-window-below))
                          ;; If we're already split either only horizontally or
                          ;; vertically, reuse the right-most/bottom window
                          ;; unless that's the one which should be split (which
                          ;; is usually the selected one).  In that case, reuse
                          ;; the LRU window.
                          ((cl-every #'windowp windows)
                           (if (eq window (car (last windows)))
                               (get-lru-window)
                             (car (last windows)))))))))
    (unless new-window
      ;; Ok, if we arrive here this means we've already destroyed our preferred
      ;; either-only-horizontal-or-only-vertical splits layout, so just let my
      ;; horizontal splitting favoring sensible split function do its job.  We
      ;; have to arrange windows manually anyhow to come back to
      (setq new-window (th/split-window-sensibly-prefer-horizontal-split window)))
    (balance-windows (window-parent new-window))
    new-window))

(setq split-window-preferred-function #'th/split-window-sensibly)
--8<---------------cut here---------------end--------------->8---

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 24 Mar 2015 13:30:34 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 09:30:34 2015
Received: from localhost ([127.0.0.1]:34673 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YaOue-0005DA-DW
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 09:30:33 -0400
Received: from mout.gmx.net ([212.227.15.15]:54149)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1YaOuQ-0005CY-9e
 for 20189 <at> debbugs.gnu.org; Tue, 24 Mar 2015 09:30:19 -0400
Received: from [178.191.139.166] ([178.191.139.166]) by mail.gmx.com
 (mrgmx002) with ESMTPSA (Nemesis) id 0MVe87-1YztJF0kRz-00YvNh; Tue, 24 Mar
 2015 14:30:10 +0100
Message-ID: <551166DE.9070007@HIDDEN>
Date: Tue, 24 Mar 2015 14:30:06 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
 <87egoebp60.fsf@HIDDEN>
In-Reply-To: <87egoebp60.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:CKAMik18UZ6Nn6XnPQt8xKWiXtNLm+yIEGge9lxcwt1Z0FSxzMt
 m5WnxNCaFRCRbWy4NAHNvLWU7P8ni5rvYUtjWe1MBoYlAOOrlLlJxGjyYXUUmI1UB8OgcBU
 0DcTNAX/hZi8VrQGYH+ESb3KHzQ09vbozeLORHJCmQ9MXJNolIbpI0PN2lSQubjExNI/JmC
 pNmdg0aIRWsVCRjvWdHow==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 >>> With that and a maximized frame of size 269x82, I'd eventually end up
 >>> with three side-by-side windows each of size 86x82.
 >>
 >> Interesting.  What is your value of `window-combination-resize'?
 >
 > I didn't know that, so it has the default value nil.

Then how comes you "eventually end up with three side-by-side windows
each of size 86x82"?  By default you should get one window with 135
columns and two windows with 67 columns, approximately.

 > Reading its docs I
 > get the impression that I want that to be t instead, and to have it
 > effective, I'd also need to set `window-combination-limit' to nil.
 >
 > But with
 >
 >    (setq window-combination-resize t
 >          window-combination-limit nil) ;; was window-size before
 >
 > and a single 269x82 window, I still get a horizontal split first
 > (forming a horizontal combination IIUC) and then a vertical split.

Yes - these are unrelated.  `split-window-sensibly' controls the
"split-direction".

I share most of your concerns.  But I'm not sure though where to put
a/the solution.

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 24 Mar 2015 11:39:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 07:39:08 2015
Received: from localhost ([127.0.0.1]:34594 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YaNAq-0002es-95
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 07:39:08 -0400
Received: from deliver.uni-koblenz.de ([141.26.64.15]:58731)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1YaNAo-0002ej-4y
 for 20189 <at> debbugs.gnu.org; Tue, 24 Mar 2015 07:39:07 -0400
Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by deliver.uni-koblenz.de (Postfix) with ESMTPSA id 3E2853D6010;
 Tue, 24 Mar 2015 12:39:04 +0100 (CET)
From: Tassilo Horn <tsdh@HIDDEN>
To: martin rudalics <rudalics@HIDDEN>
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN> <551141AC.40003@HIDDEN>
Date: Tue, 24 Mar 2015 12:39:03 +0100
In-Reply-To: <551141AC.40003@HIDDEN> (martin rudalics's message of "Tue, 24
 Mar 2015 11:51:24 +0100")
Message-ID: <87egoebp60.fsf@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: 20189
Cc: 20189 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.3 (-)

martin rudalics <rudalics@HIDDEN> writes:

>> With that and a maximized frame of size 269x82, I'd eventually end up
>> with three side-by-side windows each of size 86x82.
>
> Interesting.  What is your value of `window-combination-resize'?

I didn't know that, so it has the default value nil.  Reading its docs I
get the impression that I want that to be t instead, and to have it
effective, I'd also need to set `window-combination-limit' to nil.

But with

  (setq window-combination-resize t
        window-combination-limit nil) ;; was window-size before

and a single 269x82 window, I still get a horizontal split first
(forming a horizontal combination IIUC) and then a vertical split.

Bye,
Tassilo




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at 20189 <at> debbugs.gnu.org:


Received: (at 20189) by debbugs.gnu.org; 24 Mar 2015 10:51:40 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 06:51:40 2015
Received: from localhost ([127.0.0.1]:34554 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YaMQt-00007j-TL
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 06:51:40 -0400
Received: from mout.gmx.net ([212.227.17.21]:49386)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <rudalics@HIDDEN>) id 1YaMQs-00007R-0P
 for 20189 <at> debbugs.gnu.org; Tue, 24 Mar 2015 06:51:38 -0400
Received: from [178.190.164.186] ([178.190.164.186]) by mail.gmx.com
 (mrgmx101) with ESMTPSA (Nemesis) id 0LbR3e-1ZLI1N3vn0-00l08g; Tue, 24 Mar
 2015 11:51:28 +0100
Message-ID: <551141AC.40003@HIDDEN>
Date: Tue, 24 Mar 2015 11:51:24 +0100
From: martin rudalics <rudalics@HIDDEN>
MIME-Version: 1.0
To: Tassilo Horn <tsdh@HIDDEN>, 20189 <at> debbugs.gnu.org
Subject: Re: bug#20189: 25.0.50;
 Feature request: Alternative split-window-sensibly functions
References: <87iodqbvoz.fsf@HIDDEN>
In-Reply-To: <87iodqbvoz.fsf@HIDDEN>
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
X-Provags-ID: V03:K0:A0zFa9LS9qccs4psHwiUb7drXzEV4Jd6LAASAatz0BoD9D1DzTZ
 fyfHCAexEuewNggszOy+nex81MFli0eSor2umAW8YmtlqMhtwcnAG1a/SiE6NGEFqzVhf/V
 XH0MWLbvrX53g2VJKjDbvJGa7UN90Auo2U4UM5NgoUlITmZwoGWXfEznAAKrqOFBukY9tN9
 7aC3nwSkPn5551gm7PLuA==
X-UI-Out-Filterresults: notjunk:1;
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 20189
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

 > With that and a maximized frame of size 269x82, I'd eventually end up
 > with three side-by-side windows each of size 86x82.

Interesting.  What is your value of `window-combination-resize'?

martin




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 24 Mar 2015 09:18:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Mar 24 05:18:26 2015
Received: from localhost ([127.0.0.1]:34504 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.80)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1YaKye-0006Nm-EK
	for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 05:18:26 -0400
Received: from eggs.gnu.org ([208.118.235.92]:46371)
 by debbugs.gnu.org with esmtp (Exim 4.80)
 (envelope-from <tsdh@HIDDEN>) id 1YaKya-0006NW-Ds
 for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 05:18:22 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <tsdh@HIDDEN>) id 1YaKyR-0005Lk-Qw
 for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 05:18:15 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,T_RP_MATCHES_RCVD
 autolearn=disabled version=3.3.2
Received: from lists.gnu.org ([2001:4830:134:3::11]:39282)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <tsdh@HIDDEN>)
 id 1YaKyR-0005Lg-N0
 for submit <at> debbugs.gnu.org; Tue, 24 Mar 2015 05:18:11 -0400
Received: from eggs.gnu.org ([2001:4830:134:3::10]:48086)
 by lists.gnu.org with esmtp (Exim 4.71)
 (envelope-from <tsdh@HIDDEN>) id 1YaKyO-0001Iu-I0
 for bug-gnu-emacs@HIDDEN; Tue, 24 Mar 2015 05:18:11 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
 (envelope-from <tsdh@HIDDEN>) id 1YaKyL-0005Ks-It
 for bug-gnu-emacs@HIDDEN; Tue, 24 Mar 2015 05:18:08 -0400
Received: from deliver.uni-koblenz.de ([141.26.64.15]:43732)
 by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from <tsdh@HIDDEN>)
 id 1YaKyL-0005Kd-6q
 for bug-gnu-emacs@HIDDEN; Tue, 24 Mar 2015 05:18:05 -0400
Received: from thinkpad-t440p (dhcp25.uni-koblenz.de [141.26.71.25])
 (using TLSv1 with cipher AES128-SHA (128/128 bits))
 (No client certificate requested)
 by deliver.uni-koblenz.de (Postfix) with ESMTPSA id A29303D600C
 for <bug-gnu-emacs@HIDDEN>; Tue, 24 Mar 2015 10:18:04 +0100 (CET)
From: Tassilo Horn <tsdh@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 25.0.50; Feature request: Alternative split-window-sensibly functions
Date: Tue, 24 Mar 2015 10:18:04 +0100
Message-ID: <87iodqbvoz.fsf@HIDDEN>
User-Agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x
X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address
 (bad octet value).
X-Received-From: 2001:4830:134:3::11
X-Spam-Score: -5.0 (-----)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.15
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -5.0 (-----)


With the widescreen displays that are common today, the default behavior
of `split-window-sensibly' is not always too sensible, and of course
what's sensible is determined by the user.  So I'd suggest that some
alternative implementations are provided so that users can easily try
them out to find the one that suits them best.

The problem with `split-window-sensibly' on a wide screen is that it
prefers vertical splits.  The current emacs -Q behavior in a maximized
frame of size 269x82, the first split will be a vertical one.  That's
pretty useless because then you have two windows with nearly 200 columns
of free space right of the buffer contents (assuming that usually most
buffer contents are at most 80 columns wide).

So one trivial alternative sensible window splitting function is given
below.

--8<---------------cut here---------------start------------->8---
(defun split-window-sensibly-prefer-horizontal-split (&optional window)
  "Like `split-window-sensibly' but prefer horizontal splits."
  (let ((window (or window (selected-window))))
    (or (and (window-splittable-p window t)
	     ;; Split window horizontally.
	     (with-selected-window window
	       (split-window-right)))
	(and (window-splittable-p window)
	     ;; Split window vertically.
	     (with-selected-window window
	       (split-window-below)))
	(and (eq window (frame-root-window (window-frame window)))
	     (not (window-minibuffer-p window))
	     ;; If WINDOW is the only window on its frame and is not the
	     ;; minibuffer window, try to split it vertically disregarding
	     ;; the value of `split-height-threshold'.
	     (let ((split-height-threshold 0))
	       (when (window-splittable-p window)
		 (with-selected-window window
		   (split-window-below))))))))
--8<---------------cut here---------------end--------------->8---

It's exactly like `split-window-sensibly' except that the
horizontal/vertical clauses are reversed, i.e., it tries a horizontal
split before trying a vertical split.  That version suits my needs a bit
better.

However, it's still not exactly what I really want.  The problem is that
after the first horizontal split I end up with 2 side-by-side windows
where each one is 132 columns wide.  That's still much wider as needed
for most buffer contents but less than `split-width-threshold', so the
next splits will all be vertical ones so that I'll eventually end up
with four windows arranged in a 2x2 grid, each window having the size
132x40.

The "perfect" (for me) window splitting function would acknowledge the
following preferences:

  (1) That version would prefer horizontal splits as above.

  (2) I want either horizontal or vertical splitting but not both, i.e.,
      the layout should always be Nx1 or 1xN windows.

  (3) A window may get split horizontally not if it's wider/taller than
      `split-width-threshold'/`split-height-threshold' but instead when
      its width/height *after* the split followed by `balance-windows'
      is larger than or equal to (/ split-{width,height}-threshold 2).

  (4) The single-window exception of `split-height-threshold' still
      holds, so in frames with just one window a vertical split is
      performed even though that window is actually too small according
      to the rules above.

With that and a maximized frame of size 269x82, I'd eventually end up
with three side-by-side windows each of size 86x82.  When I use a frame
of size 80x82 instead, I'd end up with 2 vertical windows.  Ditto if
it's smaller in height than 80 because of the "single-window" exception.



In GNU Emacs 25.0.50.15 (x86_64-unknown-linux-gnu, GTK+ Version 3.14.9)
 of 2015-03-24 on thinkpad-t440p
Repository revision: e5ce95fa4a0b311792b9b9dcc3b8901fc1f24a0d
Windowing system distributor `The X.Org Foundation', version 11.0.11701000
System Description:	Arch Linux

Configured features:
XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GCONF GSETTINGS
NOTIFY ACL GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB

Important settings:
  value of $LC_MONETARY: de_DE.utf8
  value of $LC_NUMERIC: de_DE.utf8
  value of $LC_TIME: de_DE.utf8
  value of $LANG: en_US.utf8
  locale-coding-system: utf-8-unix

Major mode: Group

Minor modes in effect:
  gnus-topic-mode: t
  hl-line-mode: t
  global-company-mode: t
  global-aggressive-indent-mode: t
  gnus-undo-mode: t
  global-edit-server-edit-mode: t
  recentf-mode: t
  shell-dirtrack-mode: t
  helm-autoresize-mode: t
  global-subword-mode: t
  subword-mode: t
  savehist-mode: t
  show-paren-mode: t
  icomplete-mode: t
  minibuffer-depth-indicate-mode: t
  winner-mode: t
  electric-pair-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  buffer-read-only: t
  column-number-mode: t
  line-number-mode: t

Recent messages:
20150324T080543.864> End of message
20150324T080543.881> End of message
20150324T080543.898> End of message
20150324T080543.914> End of message
20150324T080543.932> End of message
20150324T080543.949> End of message
20150324T080557.600> Exiting summary buffer and applying spam rules
20150324T080557.815> Expiring articles...
20150324T080558.437> Expiring articles...done
Auto-saving...
Quit

Load-path shadows:
~/Repos/el/auctex/lpath hides ~/Repos/el/gnus/lisp/lpath
~/Repos/el/gnus/lisp/md4 hides /home/horn/Repos/el/emacs/lisp/md4
~/Repos/el/gnus/lisp/color hides /home/horn/Repos/el/emacs/lisp/color
~/Repos/el/gnus/lisp/format-spec hides /home/horn/Repos/el/emacs/lisp/format-spec
~/Repos/el/gnus/lisp/password-cache hides /home/horn/Repos/el/emacs/lisp/password-cache
~/Repos/el/gnus/lisp/hex-util hides /home/horn/Repos/el/emacs/lisp/hex-util
~/Repos/el/gnus/lisp/dns-mode hides /home/horn/Repos/el/emacs/lisp/textmodes/dns-mode
~/Repos/el/gnus/lisp/dig hides /home/horn/Repos/el/emacs/lisp/net/dig
~/Repos/el/gnus/lisp/hmac-md5 hides /home/horn/Repos/el/emacs/lisp/net/hmac-md5
~/Repos/el/gnus/lisp/ntlm hides /home/horn/Repos/el/emacs/lisp/net/ntlm
~/Repos/el/gnus/lisp/hmac-def hides /home/horn/Repos/el/emacs/lisp/net/hmac-def
~/Repos/el/gnus/lisp/rfc2104 hides /home/horn/Repos/el/emacs/lisp/net/rfc2104
~/Repos/el/gnus/lisp/sasl-ntlm hides /home/horn/Repos/el/emacs/lisp/net/sasl-ntlm
~/Repos/el/gnus/lisp/sasl-cram hides /home/horn/Repos/el/emacs/lisp/net/sasl-cram
~/Repos/el/gnus/lisp/dns hides /home/horn/Repos/el/emacs/lisp/net/dns
~/Repos/el/gnus/lisp/sasl hides /home/horn/Repos/el/emacs/lisp/net/sasl
~/Repos/el/gnus/lisp/tls hides /home/horn/Repos/el/emacs/lisp/net/tls
~/Repos/el/gnus/lisp/sasl-scram-rfc hides /home/horn/Repos/el/emacs/lisp/net/sasl-scram-rfc
~/Repos/el/gnus/lisp/netrc hides /home/horn/Repos/el/emacs/lisp/net/netrc
~/Repos/el/gnus/lisp/sasl-digest hides /home/horn/Repos/el/emacs/lisp/net/sasl-digest
~/Repos/el/gnus/lisp/uudecode hides /home/horn/Repos/el/emacs/lisp/mail/uudecode
~/Repos/el/gnus/lisp/binhex hides /home/horn/Repos/el/emacs/lisp/mail/binhex
~/Repos/el/gnus/lisp/hashcash hides /home/horn/Repos/el/emacs/lisp/mail/hashcash
~/Repos/el/gnus/lisp/canlock hides /home/horn/Repos/el/emacs/lisp/gnus/canlock
~/Repos/el/gnus/lisp/nneething hides /home/horn/Repos/el/emacs/lisp/gnus/nneething
~/Repos/el/gnus/lisp/mm-encode hides /home/horn/Repos/el/emacs/lisp/gnus/mm-encode
~/Repos/el/gnus/lisp/mm-util hides /home/horn/Repos/el/emacs/lisp/gnus/mm-util
~/Repos/el/gnus/lisp/rfc2047 hides /home/horn/Repos/el/emacs/lisp/gnus/rfc2047
~/Repos/el/gnus/lisp/nnml hides /home/horn/Repos/el/emacs/lisp/gnus/nnml
~/Repos/el/gnus/lisp/gnus-cus hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-cus
~/Repos/el/gnus/lisp/gnus-range hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-range
~/Repos/el/gnus/lisp/gnus-int hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-int
~/Repos/el/gnus/lisp/gnus-cloud hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-cloud
~/Repos/el/gnus/lisp/spam-stat hides /home/horn/Repos/el/emacs/lisp/gnus/spam-stat
~/Repos/el/gnus/lisp/nnmh hides /home/horn/Repos/el/emacs/lisp/gnus/nnmh
~/Repos/el/gnus/lisp/gnus-mlspl hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-mlspl
~/Repos/el/gnus/lisp/deuglify hides /home/horn/Repos/el/emacs/lisp/gnus/deuglify
~/Repos/el/gnus/lisp/gnus-gravatar hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-gravatar
~/Repos/el/gnus/lisp/nngateway hides /home/horn/Repos/el/emacs/lisp/gnus/nngateway
~/Repos/el/gnus/lisp/ietf-drums hides /home/horn/Repos/el/emacs/lisp/gnus/ietf-drums
~/Repos/el/gnus/lisp/mail-parse hides /home/horn/Repos/el/emacs/lisp/gnus/mail-parse
~/Repos/el/gnus/lisp/gnus-salt hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-salt
~/Repos/el/gnus/lisp/nnimap hides /home/horn/Repos/el/emacs/lisp/gnus/nnimap
~/Repos/el/gnus/lisp/gnus-draft hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-draft
~/Repos/el/gnus/lisp/mail-source hides /home/horn/Repos/el/emacs/lisp/gnus/mail-source
~/Repos/el/gnus/lisp/messcompat hides /home/horn/Repos/el/emacs/lisp/gnus/messcompat
~/Repos/el/gnus/lisp/pop3 hides /home/horn/Repos/el/emacs/lisp/gnus/pop3
~/Repos/el/gnus/lisp/nnmaildir hides /home/horn/Repos/el/emacs/lisp/gnus/nnmaildir
~/Repos/el/gnus/lisp/nnheader hides /home/horn/Repos/el/emacs/lisp/gnus/nnheader
~/Repos/el/gnus/lisp/gnus-cite hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-cite
~/Repos/el/gnus/lisp/nndiary hides /home/horn/Repos/el/emacs/lisp/gnus/nndiary
~/Repos/el/gnus/lisp/gnus-diary hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-diary
~/Repos/el/gnus/lisp/nnfolder hides /home/horn/Repos/el/emacs/lisp/gnus/nnfolder
~/Repos/el/gnus/lisp/gnus-art hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-art
~/Repos/el/gnus/lisp/gnus-demon hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-demon
~/Repos/el/gnus/lisp/mml-sec hides /home/horn/Repos/el/emacs/lisp/gnus/mml-sec
~/Repos/el/gnus/lisp/nnir hides /home/horn/Repos/el/emacs/lisp/gnus/nnir
~/Repos/el/gnus/lisp/mm-partial hides /home/horn/Repos/el/emacs/lisp/gnus/mm-partial
~/Repos/el/gnus/lisp/gnus-registry hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-registry
~/Repos/el/gnus/lisp/gnus-icalendar hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-icalendar
~/Repos/el/gnus/lisp/compface hides /home/horn/Repos/el/emacs/lisp/gnus/compface
~/Repos/el/gnus/lisp/gnus-fun hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-fun
~/Repos/el/gnus/lisp/gnus-start hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-start
~/Repos/el/gnus/lisp/smiley hides /home/horn/Repos/el/emacs/lisp/gnus/smiley
~/Repos/el/gnus/lisp/gnus-picon hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-picon
~/Repos/el/gnus/lisp/spam-report hides /home/horn/Repos/el/emacs/lisp/gnus/spam-report
~/Repos/el/gnus/lisp/nntp hides /home/horn/Repos/el/emacs/lisp/gnus/nntp
~/Repos/el/gnus/lisp/nnnil hides /home/horn/Repos/el/emacs/lisp/gnus/nnnil
~/Repos/el/gnus/lisp/nndir hides /home/horn/Repos/el/emacs/lisp/gnus/nndir
~/Repos/el/gnus/lisp/gnus-srvr hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-srvr
~/Repos/el/gnus/lisp/smime hides /home/horn/Repos/el/emacs/lisp/gnus/smime
~/Repos/el/gnus/lisp/nnvirtual hides /home/horn/Repos/el/emacs/lisp/gnus/nnvirtual
~/Repos/el/gnus/lisp/gnus-notifications hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-notifications
~/Repos/el/gnus/lisp/nnspool hides /home/horn/Repos/el/emacs/lisp/gnus/nnspool
~/Repos/el/gnus/lisp/gnus-group hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-group
~/Repos/el/gnus/lisp/gnus-bcklg hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-bcklg
~/Repos/el/gnus/lisp/gnus-util hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-util
~/Repos/el/gnus/lisp/gnus-sieve hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-sieve
~/Repos/el/gnus/lisp/nndraft hides /home/horn/Repos/el/emacs/lisp/gnus/nndraft
~/Repos/el/gnus/lisp/nnagent hides /home/horn/Repos/el/emacs/lisp/gnus/nnagent
~/Repos/el/gnus/lisp/gnus-spec hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-spec
~/Repos/el/gnus/lisp/gnus-bookmark hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-bookmark
~/Repos/el/gnus/lisp/mml1991 hides /home/horn/Repos/el/emacs/lisp/gnus/mml1991
~/Repos/el/gnus/lisp/rfc2231 hides /home/horn/Repos/el/emacs/lisp/gnus/rfc2231
~/Repos/el/gnus/lisp/yenc hides /home/horn/Repos/el/emacs/lisp/gnus/yenc
~/Repos/el/gnus/lisp/gnus-undo hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-undo
~/Repos/el/gnus/lisp/ecomplete hides /home/horn/Repos/el/emacs/lisp/gnus/ecomplete
~/Repos/el/gnus/lisp/legacy-gnus-agent hides /home/horn/Repos/el/emacs/lisp/gnus/legacy-gnus-agent
~/Repos/el/gnus/lisp/utf7 hides /home/horn/Repos/el/emacs/lisp/gnus/utf7
~/Repos/el/gnus/lisp/rtree hides /home/horn/Repos/el/emacs/lisp/gnus/rtree
~/Repos/el/gnus/lisp/gnus-uu hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-uu
~/Repos/el/gnus/lisp/gnus-ml hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-ml
~/Repos/el/gnus/lisp/sieve hides /home/horn/Repos/el/emacs/lisp/gnus/sieve
~/Repos/el/gnus/lisp/gnus hides /home/horn/Repos/el/emacs/lisp/gnus/gnus
~/Repos/el/gnus/lisp/mml hides /home/horn/Repos/el/emacs/lisp/gnus/mml
~/Repos/el/gnus/lisp/message hides /home/horn/Repos/el/emacs/lisp/gnus/message
~/Repos/el/gnus/lisp/mml-smime hides /home/horn/Repos/el/emacs/lisp/gnus/mml-smime
~/Repos/el/gnus/lisp/gnus-eform hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-eform
~/Repos/el/gnus/lisp/gnus-agent hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-agent
~/Repos/el/gnus/lisp/gnus-logic hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-logic
~/Repos/el/gnus/lisp/mm-extern hides /home/horn/Repos/el/emacs/lisp/gnus/mm-extern
~/Repos/el/gnus/lisp/nndoc hides /home/horn/Repos/el/emacs/lisp/gnus/nndoc
~/Repos/el/gnus/lisp/sieve-manage hides /home/horn/Repos/el/emacs/lisp/gnus/sieve-manage
~/Repos/el/gnus/lisp/mm-decode hides /home/horn/Repos/el/emacs/lisp/gnus/mm-decode
~/Repos/el/gnus/lisp/starttls hides /home/horn/Repos/el/emacs/lisp/gnus/starttls
~/Repos/el/gnus/lisp/gnus-dired hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-dired
~/Repos/el/gnus/lisp/nnbabyl hides /home/horn/Repos/el/emacs/lisp/gnus/nnbabyl
~/Repos/el/gnus/lisp/nnmbox hides /home/horn/Repos/el/emacs/lisp/gnus/nnmbox
~/Repos/el/gnus/lisp/gnus-win hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-win
~/Repos/el/gnus/lisp/gnus-async hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-async
~/Repos/el/gnus/lisp/mm-url hides /home/horn/Repos/el/emacs/lisp/gnus/mm-url
~/Repos/el/gnus/lisp/gnus-html hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-html
~/Repos/el/gnus/lisp/gssapi hides /home/horn/Repos/el/emacs/lisp/gnus/gssapi
~/Repos/el/gnus/lisp/mml2015 hides /home/horn/Repos/el/emacs/lisp/gnus/mml2015
~/Repos/el/gnus/lisp/nnrss hides /home/horn/Repos/el/emacs/lisp/gnus/nnrss
~/Repos/el/gnus/lisp/gnus-mh hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-mh
~/Repos/el/gnus/lisp/gnus-sum hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-sum
~/Repos/el/gnus/lisp/nnweb hides /home/horn/Repos/el/emacs/lisp/gnus/nnweb
~/Repos/el/gnus/lisp/mail-prsvr hides /home/horn/Repos/el/emacs/lisp/gnus/mail-prsvr
~/Repos/el/gnus/lisp/nnmairix hides /home/horn/Repos/el/emacs/lisp/gnus/nnmairix
~/Repos/el/gnus/lisp/plstore hides /home/horn/Repos/el/emacs/lisp/gnus/plstore
~/Repos/el/gnus/lisp/rfc2045 hides /home/horn/Repos/el/emacs/lisp/gnus/rfc2045
~/Repos/el/gnus/lisp/gnus-msg hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-msg
~/Repos/el/gnus/lisp/spam-wash hides /home/horn/Repos/el/emacs/lisp/gnus/spam-wash
~/Repos/el/gnus/lisp/gnus-score hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-score
~/Repos/el/gnus/lisp/mm-uu hides /home/horn/Repos/el/emacs/lisp/gnus/mm-uu
~/Repos/el/gnus/lisp/spam hides /home/horn/Repos/el/emacs/lisp/gnus/spam
~/Repos/el/gnus/lisp/mm-view hides /home/horn/Repos/el/emacs/lisp/gnus/mm-view
~/Repos/el/gnus/lisp/sieve-mode hides /home/horn/Repos/el/emacs/lisp/gnus/sieve-mode
~/Repos/el/gnus/lisp/html2text hides /home/horn/Repos/el/emacs/lisp/gnus/html2text
~/Repos/el/gnus/lisp/gnus-ems hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-ems
~/Repos/el/gnus/lisp/registry hides /home/horn/Repos/el/emacs/lisp/gnus/registry
~/Repos/el/gnus/lisp/auth-source hides /home/horn/Repos/el/emacs/lisp/gnus/auth-source
~/Repos/el/gnus/lisp/gravatar hides /home/horn/Repos/el/emacs/lisp/gnus/gravatar
~/Repos/el/gnus/lisp/flow-fill hides /home/horn/Repos/el/emacs/lisp/gnus/flow-fill
~/Repos/el/gnus/lisp/gmm-utils hides /home/horn/Repos/el/emacs/lisp/gnus/gmm-utils
~/Repos/el/gnus/lisp/mailcap hides /home/horn/Repos/el/emacs/lisp/gnus/mailcap
~/Repos/el/gnus/lisp/gnus-delay hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-delay
~/Repos/el/gnus/lisp/mm-bodies hides /home/horn/Repos/el/emacs/lisp/gnus/mm-bodies
~/Repos/el/gnus/lisp/mm-archive hides /home/horn/Repos/el/emacs/lisp/gnus/mm-archive
~/Repos/el/gnus/lisp/rfc1843 hides /home/horn/Repos/el/emacs/lisp/gnus/rfc1843
~/Repos/el/gnus/lisp/gnus-kill hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-kill
~/Repos/el/gnus/lisp/qp hides /home/horn/Repos/el/emacs/lisp/gnus/qp
~/Repos/el/gnus/lisp/score-mode hides /home/horn/Repos/el/emacs/lisp/gnus/score-mode
~/Repos/el/gnus/lisp/gnus-topic hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-topic
~/Repos/el/gnus/lisp/gnus-cache hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-cache
~/Repos/el/gnus/lisp/nnmail hides /home/horn/Repos/el/emacs/lisp/gnus/nnmail
~/Repos/el/gnus/lisp/gnus-vm hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-vm
~/Repos/el/gnus/lisp/gnus-sync hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-sync
~/Repos/el/gnus/lisp/nnoo hides /home/horn/Repos/el/emacs/lisp/gnus/nnoo
~/Repos/el/gnus/lisp/nnregistry hides /home/horn/Repos/el/emacs/lisp/gnus/nnregistry
~/Repos/el/gnus/lisp/gnus-dup hides /home/horn/Repos/el/emacs/lisp/gnus/gnus-dup
~/Repos/el/gnus/lisp/parse-time hides /home/horn/Repos/el/emacs/lisp/calendar/parse-time
~/Repos/el/gnus/lisp/time-date hides /home/horn/Repos/el/emacs/lisp/calendar/time-date

Features:
(shadow hippie-exp gnus-fun emacsbug mailalias smtpmail sendmail
filecache shr-color color url-http url-gw url-auth sort gnus-cite smiley
shr dom qp mm-archive gnus-async gnus-bcklg gnus-ml hl-line nndraft nnmh
rot13 utf-7 gnutls network-stream nsm starttls nnml nnnil gnus-agent
gnus-srvr gnus-score score-mode nnvirtual gnus-cache gnus-demon nntp
spam spam-stat gnus-uu yenc gnus-msg gnus-gravatar mail-extr gravatar
gnus-topic nnir gnus-registry registry eieio-base th-private
company-files company-oddmuse company-keywords company-etags
company-gtags company-dabbrev-code company-dabbrev company-capf
company-cmake company-xcode company-clang company-semantic company-eclim
company-template company-css company-nxml company-bbdb
highlight-parentheses company finder-inf stratego-mode greql-mode
tg-mode generic preview-latex tex-site auto-loads cider tramp-sh
cider-mode cider-repl cider-eldoc cider-interaction arc-mode
archive-mode cider-doc org-table cider-test cider-stacktrace
cider-client nrepl-client queue cider-util ewoc etags xref clojure-mode
imenu paredit aggressive-indent names edebug epa-file epa epg rdictcc
google-contacts-message google-contacts derived url-cache google-oauth
google-contacts-gnus gnus-art mm-uu mml2015 mm-view mml-smime smime dig
gnus-sum gnus-group gnus-undo gnus-start gnus-cloud nnimap nnmail
mail-source tls utf7 netrc nnoo parse-time gnus-spec gnus-int gnus-range
gnus-win gnus gnus-ems gnus-compat nnheader em-term term ehelp esh-opt
esh-ext esh-util highlight-symbol boxquote rect ecomplete message rfc822
mml mml-sec mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047
rfc2045 ietf-drums mailabbrev mail-utils gmm-utils mailheader
edit-server server haskell-yas yasnippet help-mode cl disp-table
pdf-tools cus-edit cus-start cus-load pdf-view jka-compr pdf-cache
pdf-info tq pdf-util image-mode browse-kill-ring recentf tree-widget
wid-edit helm-projectile helm-files image-dired tramp tramp-compat
tramp-loaddefs trampver shell dired-x dired-aux ffap helm-tags
helm-bookmark helm-adaptive helm-info bookmark pp helm-external helm-net
browse-url xml url url-proxy url-privacy url-expand url-methods
url-history url-cookie url-domsuf url-util url-parse auth-source
gnus-util mm-util mail-prsvr password-cache url-vars mailcap
helm-buffers helm-match-plugin helm-help helm-org org org-macro
org-footnote org-pcomplete pcomplete org-list org-faces org-entities
noutline outline org-version ob-emacs-lisp ob ob-tangle ob-ref ob-lob
ob-table ob-exp org-src ob-keys ob-comint ob-core ob-eval org-compat
org-macs org-loaddefs format-spec find-func cal-menu calendar
cal-loaddefs helm-grep helm-regexp helm-plugin grep helm-elscreen
helm-utils dired compile comint ansi-color helm-locate helm helm-source
eieio-compat projectile ibuf-ext ibuffer thingatpt helm-config
async-bytecomp async helm-aliases easy-mmode iedit iedit-lib cap-words
superword subword saveplace savehist paren icomplete mb-depth
smart-mode-line-respectful-theme smart-mode-line-light-theme
smart-mode-line mule-util rich-minority dash rx bs windmove winner ring
elec-pair edmacro kmacro gnus-load subr-x tsdh-light-theme info easymenu
memory-usage-autoloads advice help-fns package epg-config cl-macs eieio
eieio-core cl-generic byte-opt gv bytecomp byte-compile cl-extra seq
cconv cl-loaddefs pcase cl-lib time-date tooltip eldoc electric uniquify
ediff-hook vc-hooks lisp-float-type mwheel x-win x-dnd tool-bar dnd
fontset image regexp-opt fringe tabulated-list newcomment elisp-mode
lisp-mode prog-mode register page menu-bar rfn-eshadow timer select
scroll-bar mouse jit-lock font-lock syntax facemenu font-core frame cham
georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese hebrew greek romanian slovak czech european ethiopic
indian cyrillic chinese case-table epa-hook jka-cmpr-hook help simple
abbrev minibuffer cl-preloaded nadvice loaddefs button faces cus-face
macroexp files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process dbusbind gfilenotify dynamic-setting
system-font-setting font-render-setting move-toolbar gtk x-toolkit x
multi-tty emacs)

Memory information:
((conses 16 706236 91834)
 (symbols 48 56469 21)
 (miscs 40 545 942)
 (strings 32 175938 60530)
 (string-bytes 1 5958351)
 (vectors 16 61951)
 (vector-slots 8 1751692 221276)
 (floats 8 963 895)
 (intervals 56 10927 1548)
 (buffers 976 57)
 (heap 1024 119493 5276))




Acknowledgement sent to Tassilo Horn <tsdh@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#20189; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Mon, 25 Nov 2019 12:00:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.