From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Jared Finder , 3142@debbugs.gnu.org Resent-From: Jared Finder Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 28 Apr 2009 01:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: report 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by submit@emacsbugs.donarmstrong.com id=B.124088262813479 (code B ref -1); Tue, 28 Apr 2009 01:45:03 +0000 Received: (at submit) by emacsbugs.donarmstrong.com; 28 Apr 2009 01:37:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.1 required=4.0 tests=FOURLA,MULTALT autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3S1b3Xu013471 for ; Mon, 27 Apr 2009 18:37:04 -0700 Received: from mx10.gnu.org ([199.232.76.166]:54169) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LycFq-0002Sh-Ew for emacs-pretest-bug@gnu.org; Mon, 27 Apr 2009 21:37:02 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LycFn-0000mm-HU for emacs-pretest-bug@gnu.org; Mon, 27 Apr 2009 21:37:02 -0400 Received: from universe.crypticstudios.com ([208.95.187.69]:50757) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1LycFm-0000mW-SP for emacs-pretest-bug@gnu.org; Mon, 27 Apr 2009 21:36:59 -0400 Received: from proserpine.paragon.crypticstudios.com (172.31.97.6) by universe.crypticstudios.com (208.95.187.69) with Microsoft SMTP Server (TLS) id 8.1.311.2; Mon, 27 Apr 2009 18:16:12 -0700 Received: from proserpine.paragon.crypticstudios.com ([172.31.97.6]) by proserpine.paragon.crypticstudios.com ([172.31.97.6]) with mapi; Mon, 27 Apr 2009 18:16:11 -0700 From: Jared Finder To: "emacs-pretest-bug@gnu.org" Date: Mon, 27 Apr 2009 18:16:11 -0700 Thread-Topic: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Thread-Index: AcnHdtm/Q3qUbljrRZ2LNPYp6K+Hpg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_" MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-Greylist: delayed 1244 seconds by postgrey-1.27 at monty-python; Mon, 27 Apr 2009 21:36:57 EDT --_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I would expect that split-window-preferred-function would accept split-wind= ow-horizontally and split-window-vertically. At the very least, there shou= ld be an easy way to set this to "always split vertically", "always split h= orizontally", and "intelligently split". -- MJF In GNU Emacs 23.0.92.1 (i386-mingw-nt6.0.6001) of 2009-03-30 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 6.0.6001 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Custom/lw Minor modes in effect: global-balanced-mode: t balanced-mode: t hrule-mode: t global-hi-lock-mode: t hi-lock-mode: t c-subword-mode: t url-handler-mode: t show-paren-mode: t recentf-mode: t global-reveal-mode: t reveal-mode: t global-c-subword-mode: t shell-dirtrack-mode: t cua-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: c u s t o m i z e SPC v a r s p l i t SPC w i n p C-x o C-x o C-h f C-x o C-x o n i l C-h f s p l i t SPC w i n SPC v C-h f s l p l i t SPC w i n s p l i t - w i n C-x C-s y C-x 1 C-x 2 C-x 1 C-x 4 b C-x 0 C-x 1 Recent messages: split-window-vertically: Window height 1 too small (after splitting) custom-variable-set: Invalid function: nil To install your edits, invoke [State] and choose the Set operation Type "q" to delete this window, to scroll help. To install your edits, invoke [State] and choose the Set operation Save all settings in this buffer? (y or n) Loading vc-cvs...done Saving file c:/Users/jfinder/Desktop/.emacs.d/custom.el... Wrote c:/Users/jfinder/Desktop/.emacs.d/custom.el (No files need saving) --_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I would expect that split-window-preferred-function would accept split-window-horizontally and split-window-vertically.  At the very least, there should be an easy w= ay to set this to "always split vertically", "always split horizontall= y", and "intelligently split".

 

  -- MJF

 

In GNU Emacs 23.0.92.= 1 (i386-mingw-nt6.0.6001)

 of 2009-03-30 o= n SOFT-MJASON

Windowing system distributor `Microsoft Corp.', version 6.0.6001

configured using `con= figure --with-gcc (3.4)'

 

Important settings:

  value of $LC_A= LL: nil

  value of $LC_C= OLLATE: nil

  value of $LC_C= TYPE: nil

  value of $LC_M= ESSAGES: nil

  value of $LC_M= ONETARY: nil

  value of $LC_N= UMERIC: nil

  value of $LC_T= IME: nil

  value of $LANG= : ENU

  value of $XMOD= IFIERS: nil

  locale-coding-= system: cp1252

  default-enable= -multibyte-characters: t

 

Major mode: Custom/lw=

 

Minor modes in effect= :

  global-balance= d-mode: t

  balanced-mode:= t

  hrule-mode: t<= o:p>

  global-hi-lock= -mode: t

  hi-lock-mode: = t

  c-subword-mode= : t

  url-handler-mo= de: t

  show-paren-mod= e: t

  recentf-mode: = t

  global-reveal-= mode: t

  reveal-mode: t=

  global-c-subwo= rd-mode: t

  shell-dirtrack= -mode: t

  cua-mode: t

  tooltip-mode: = t

  mouse-wheel-mo= de: t

  menu-bar-mode:= t

  file-name-shad= ow-mode: t

  global-font-lo= ck-mode: t

  font-lock-mode= : t

  blink-cursor-m= ode: t

  global-auto-composition-mode: t

  auto-compositi= on-mode: t

  auto-encryptio= n-mode: t

  auto-compressi= on-mode: t

  column-number-= mode: t

  line-number-mo= de: t

  transient-mark= -mode: t

 

Recent input:

<help-echo> <select-window> <switch-frame> <switch-frame> =

<switch-frame> <switch-frame> <select-window> <down-mouse-1> =

<mouse-movement>= ; <mouse-1> <apps> <up> <up> c u s t

o m i z e SPC v a r <tab> <return> <up> s p l i t SPC

w i n <tab> p <tab> <return> <help-echo> <help-echo> <= /span>

<help-echo> <help-echo> <down-mouse-1> <mouse-2> <help-echo>

<wheel-down> <double-wheel-down> <wheel-down> <down-mouse-1>

<drag-mouse-1> <down-mouse-1> <mouse-1> <help-echo>

<down-mouse-1> <mouse-1> <help-echo> <down-mouse-1>

<mouse-1> <down-mouse-1> <mouse-1> <help-echo> <help-echo>

<wheel-down> <double-wheel-down> <wheel-down> <double-wheel-down>

<triple-wheel-down= > <wheel-down> <double-wheel-down>

<wheel-down> <double-wheel-down> <wheel-down> <double-wheel-down>

<wheel-down> <wheel-down> <help-echo> <down-mouse-1>

<mouse-1> <help-echo> <wheel-down> <double-wheel-down> <= /span>

<triple-wheel-down= > <wheel-down> <wheel-down> <wheel-down> =

<wheel-up> <wheel-up> <wheel-up> <help-echo> <help-echo> =

<down-mouse-1> <mouse-1> <help-echo> C-x o C-x o C-h

f <return> C-x = o C-x o <left> <S-end> <home> <S-end> <= /p>

n i l <help-echo&g= t; <help-echo> <down-mouse-1> <help-echo> =

<down-mouse-1> <help-echo> <help-echo> <down-mouse-1> =

<down-mouse-1> <mouse-1> C-h f s p l i t SPC w i n

<tab> SPC v <tab> <return> <help-echo> <help-echo> <= /span>

<wheel-down> <wheel-down> <wheel-down> <double-wheel-down> =

<triple-wheel-down= > <wheel-up> <double-wheel-up> <triple-wheel-up>

<triple-wheel-up&g= t; <triple-wheel-up> <select-window>

<help-echo> C-h= f s l <backspace> p l i t SPC w i n

<tab> <retur= n> <down-mouse-1> <help-echo> <down-mouse-1>

<mouse-1> <double-down-mouse-1> <double-mouse-1> s

p l i t - w i n <C-tab> C-x C-s y C-x 1 C-x 2 C-x 1

C-x 4 b <return>= ; C-x 0 <down> <down> <down> <down>

<down> <down= > <up> <up> <up> <up> <up> <help-echo>

<C-f7> <retu= rn> <help-echo> <up> <up> C-x 1 <up> <help-echo> =

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <= ;help-echo> <help-echo> <help-echo> <menu-bar>

<help-menu> <send-emacs-bug-report>

 

Recent messages:=

split-window-vertical= ly: Window height 1 too small (after splitting)

custom-variable-set: Invalid function: nil

To install your edits= , invoke [State] and choose the Set operation

Type "q" to delete this window, <next> to scroll help.

To install your edits= , invoke [State] and choose the Set operation

Save all settings in = this buffer? (y or n)

Loading vc-cvs...done=

Saving file c:/Users/jfinder/Desktop/.emacs.d/custom.el...

Wrote c:/Users/jfinder/Desktop/.emacs.d/custom.el

(No files need saving= )

--_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_-- From cyd@stupidchicken.com Mon Apr 27 21:12:21 2009 Received: (at control) by emacsbugs.donarmstrong.com; 28 Apr 2009 04:12:21 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=VALID_BTS_CONTROL autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from cyd.mit.edu (CYD.MIT.EDU [18.115.2.24]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3S4CIx3020559 for ; Mon, 27 Apr 2009 21:12:20 -0700 Received: by cyd.mit.edu (Postfix, from userid 1000) id CC05557E251; Tue, 28 Apr 2009 00:12:20 -0400 (EDT) From: Chong Yidong To: control@debbugs.gnu.org Subject: severity 3142 wishlist Date: Tue, 28 Apr 2009 00:12:20 -0400 Message-ID: <87prexct7f.fsf@cyd.mit.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii severity 3142 wishlist thanks From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 28 Apr 2009 06:40:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124090032823109 (code B ref 3142); Tue, 28 Apr 2009 06:40:04 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 28 Apr 2009 06:32:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n3S6W3fS023097 for <3142@emacsbugs.donarmstrong.com>; Mon, 27 Apr 2009 23:32:04 -0700 Received: (qmail invoked by alias); 28 Apr 2009 06:31:57 -0000 Received: from 62-47-34-116.adsl.highway.telekom.at (EHLO [62.47.34.116]) [62.47.34.116] by mail.gmx.net (mp071) with SMTP; 28 Apr 2009 08:31:57 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1/oXwd5IJroFy0glPTTozNVXAq6y2xjQr+fU4H1tE 6gvsrR2QnMbKPT Message-ID: <49F6A25B.3050108@gmx.at> Date: Tue, 28 Apr 2009 08:29:47 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Jared Finder CC: 3142@debbugs.gnu.org References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.68 > I would expect that split-window-preferred-function would accept > split-window-horizontally and split-window-vertically. `split-window-preferred-function', if non-nil, must be a function called with a WINDOW as single argument. `split-window-vertically' and `split-window-horizontally' are functions that split the selected window and take a SIZE argument. Hence, when you set `split-window-preferred-function' to `split-window-vertically' as you did you will get a split-window-vertically: Window height 1 too small (after splitting) error because you call `split-window-vertically' with a window as argument, and `prefix-numeric-value' when called with a window as argument returns 1, a SIZE argument disliked by `split-window'. Sounds contrived, but I don't have a better explanation. If you really need `split-window-preferred-function' use `split-window-vertically' you have to write a wrapper like (defun my-split-window-function (window) (with-selected-window window (split-window-vertically))) > At the very > least, there should be an easy way to set this to "always split > vertically", "always split horizontally", and "intelligently split". Setting `split-width-threshold' nil for "always split vertically" and `split-height-threshold' nil for "always split horizontally" should accomplish that. Can't you use these directly? martin From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Jared Finder , 3142@debbugs.gnu.org Resent-From: Jared Finder Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 28 Apr 2009 17:30:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124093932225455 (code B ref 3142); Tue, 28 Apr 2009 17:30:02 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 28 Apr 2009 17:22:02 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from universe.crypticstudios.com (universe.crypticstudios.com [208.95.187.69]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3SHLwSn025443 for <3142@emacsbugs.donarmstrong.com>; Tue, 28 Apr 2009 10:21:59 -0700 Received: from proserpine.paragon.crypticstudios.com (172.31.97.6) by universe.crypticstudios.com (208.95.187.69) with Microsoft SMTP Server (TLS) id 8.1.311.2; Tue, 28 Apr 2009 10:21:53 -0700 Received: from proserpine.paragon.crypticstudios.com ([172.31.97.6]) by proserpine.paragon.crypticstudios.com ([172.31.97.6]) with mapi; Tue, 28 Apr 2009 10:21:52 -0700 From: Jared Finder To: martin rudalics CC: "3142@debbugs.gnu.org" <3142@debbugs.gnu.org> Date: Tue, 28 Apr 2009 10:21:51 -0700 Thread-Topic: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Thread-Index: AcnHywj3eggPrpYvQkmTtvjp9fKWQgAWkGqQ Message-ID: References: <49F6A25B.3050108@gmx.at> In-Reply-To: <49F6A25B.3050108@gmx.at> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 That's not obvious! I like the idea of the split window thresholds, but it= needs to be a lot more obvious how to use them. What's wrong with my sugg= estion to change the customize interface to have two more options "Always s= plit vertical" and "Always split horizontal" that calls the appropriate fun= ctions? -- MJF -----Original Message----- From: martin rudalics [mailto:rudalics@gmx.at]=20 Sent: Monday, April 27, 2009 11:30 PM To: Jared Finder Cc: 3142@debbugs.gnu.org Subject: Re: bug#3142: 23.0.92; split-window-prefered-function should be ab= le to use split-window-horizontally/split-window-vertically > I would expect that split-window-preferred-function would accept > split-window-horizontally and split-window-vertically. `split-window-preferred-function', if non-nil, must be a function called with a WINDOW as single argument. `split-window-vertically' and `split-window-horizontally' are functions that split the selected window and take a SIZE argument. Hence, when you set `split-window-preferred-function' to `split-window-vertically' as you did you will get a split-window-vertically: Window height 1 too small (after splitting) error because you call `split-window-vertically' with a window as argument, and `prefix-numeric-value' when called with a window as argument returns 1, a SIZE argument disliked by `split-window'. Sounds contrived, but I don't have a better explanation. If you really need `split-window-preferred-function' use `split-window-vertically' you have to write a wrapper like (defun my-split-window-function (window) (with-selected-window window (split-window-vertically))) > At the very > least, there should be an easy way to set this to "always split > vertically", "always split horizontally", and "intelligently split". Setting `split-width-threshold' nil for "always split vertically" and `split-height-threshold' nil for "always split horizontally" should accomplish that. Can't you use these directly? martin From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Juri Linkov , 3142@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 28 Apr 2009 23:10:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124095987814569 (code B ref 3142); Tue, 28 Apr 2009 23:10:06 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 28 Apr 2009 23:04:38 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3SN4XA6014560 for <3142@emacsbugs.donarmstrong.com>; Tue, 28 Apr 2009 16:04:35 -0700 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LywLk-000DUe-Aa; Wed, 29 Apr 2009 02:04:28 +0300 From: Juri Linkov To: Jared Finder Cc: 3142@debbugs.gnu.org, martin rudalics Organization: JURTA References: <49F6A25B.3050108@gmx.at> Date: Wed, 29 Apr 2009 01:48:21 +0300 In-Reply-To: (Jared Finder's message of "Tue, 28 Apr 2009 10:21:51 -0700") Message-ID: <874ow84cp6.fsf_-_@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: 233cb89e4cdd9c68f6fe52a505261b56 X-DrWeb-checked: yes > That's not obvious! I like the idea of the split window thresholds, > but it needs to be a lot more obvious how to use them. What's wrong > with my suggestion to change the customize interface to have two more > options "Always split vertical" and "Always split horizontal" that > calls the appropriate functions? I remember we once considered creating a default function with "intelligently splitting" logic (IOW, moving the `else' part of `if' in `window--try-to-split-window' to a separate function) and setting the default value of `split-window-preferred-function' to the name of this function. This will allow defining three const values in defcustom: - the default function name; - vertically splitting function; - horizontally splitting function; - and user-defined function's name. -- Juri Linkov http://www.jurta.org/emacs/ From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Stefan Monnier , 3142@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 29 Apr 2009 01:35:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124096856720016 (code B ref 3142); Wed, 29 Apr 2009 01:35:04 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 29 Apr 2009 01:29:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3T1TNVG020008 for <3142@emacsbugs.donarmstrong.com>; Tue, 28 Apr 2009 18:29:25 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: An4FAHdK90lFxLKx/2dsb2JhbACBUM0Ig3MFhTk X-IronPort-AV: E=Sophos;i="4.40,263,1238990400"; d="scan'208";a="37741249" Received: from 69-196-178-177.dsl.teksavvy.com (HELO pastel.home) ([69.196.178.177]) by ironport2-out.teksavvy.com with ESMTP; 28 Apr 2009 21:29:16 -0400 Received: by pastel.home (Postfix, from userid 20848) id 777118291; Tue, 28 Apr 2009 21:29:14 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Cc: 3142@debbugs.gnu.org, Jared Finder Message-ID: References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> Date: Tue, 28 Apr 2009 21:29:14 -0400 In-Reply-To: <874ow84cp6.fsf_-_@mail.jurta.org> (Juri Linkov's message of "Wed, 29 Apr 2009 01:48:21 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > I remember we once considered creating a default function with > "intelligently splitting" logic (IOW, moving the `else' part of `if' > in `window--try-to-split-window' to a separate function) > and setting the default value of `split-window-preferred-function' > to the name of this function. Indeed. IMO, `foo-function' should not accept nil as value and should be unconditionally called. Stefan From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 29 Apr 2009 07:25:06 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124098945111816 (code B ref 3142); Wed, 29 Apr 2009 07:25:06 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 29 Apr 2009 07:17:31 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n3T7HR8R011801 for <3142@emacsbugs.donarmstrong.com>; Wed, 29 Apr 2009 00:17:28 -0700 Received: (qmail invoked by alias); 29 Apr 2009 07:17:21 -0000 Received: from 62-47-45-129.adsl.highway.telekom.at (EHLO [62.47.45.129]) [62.47.45.129] by mail.gmx.net (mp064) with SMTP; 29 Apr 2009 09:17:21 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18dcgohlC8dFkqCg7dAzmkyCWXaN6mtvnf0+nA9Zn KCGKOEgHGaivu6 Message-ID: <49F7FE0F.1020107@gmx.at> Date: Wed, 29 Apr 2009 09:13:19 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Juri Linkov CC: Jared Finder , 3142@debbugs.gnu.org References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> In-Reply-To: <874ow84cp6.fsf_-_@mail.jurta.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.74 >> That's not obvious! I like the idea of the split window thresholds, >> but it needs to be a lot more obvious how to use them. What's wrong >> with my suggestion to change the customize interface to have two more >> options "Always split vertical" and "Always split horizontal" that >> calls the appropriate functions? > > I remember we once considered creating a default function with > "intelligently splitting" logic (IOW, moving the `else' part of `if' > in `window--try-to-split-window' to a separate function) > and setting the default value of `split-window-preferred-function' > to the name of this function. > > This will allow defining three const values in defcustom: > - the default function name; > - vertically splitting function; > - horizontally splitting function; > > - and user-defined function's name. Remains the question whether `split-window-preferred-function' should always operate on the selected window or have a window argument. AFAICT nothing speaks for the window argument but the fact that people may have customized this already. Omitting the window argument would allow users to put `split-window-vertically' directly as value of `split-window-preferred-function' without having to delve any deeper. martin From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Juri Linkov , 3142@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 29 Apr 2009 11:20:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.12410036849738 (code B ref 3142); Wed, 29 Apr 2009 11:20:05 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 29 Apr 2009 11:14:44 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from relay03.kiev.sovam.com (relay03.kiev.sovam.com [62.64.120.201]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3TBEeso009726 for <3142@emacsbugs.donarmstrong.com>; Wed, 29 Apr 2009 04:14:42 -0700 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1Lz7kL-000HB4-CR; Wed, 29 Apr 2009 14:14:37 +0300 From: Juri Linkov To: martin rudalics Cc: Jared Finder , 3142@debbugs.gnu.org Organization: JURTA References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> Date: Wed, 29 Apr 2009 12:59:52 +0300 In-Reply-To: <49F7FE0F.1020107@gmx.at> (martin rudalics's message of "Wed, 29 Apr 2009 09:13:19 +0200") Message-ID: <87r5zbbttn.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: 7b6940144bc5d56bdacd12344196c2df X-DrWeb-checked: yes > Remains the question whether `split-window-preferred-function' should > always operate on the selected window or have a window argument. AFAICT > nothing speaks for the window argument but the fact that people may have > customized this already. Omitting the window argument would allow users > to put `split-window-vertically' directly as value of > `split-window-preferred-function' without having to delve any deeper. How about adding two wrapper functions? (split-window-preferred-vertically &optional window) that calls split-window-vertically (split-window-preferred-horizontally &optional window) that calls split-window-horizontally -- Juri Linkov http://www.jurta.org/emacs/ From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 29 Apr 2009 12:50:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124100890732146 (code B ref 3142); Wed, 29 Apr 2009 12:50:07 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 29 Apr 2009 12:41:47 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n3TCfi38032138 for <3142@emacsbugs.donarmstrong.com>; Wed, 29 Apr 2009 05:41:45 -0700 Received: (qmail invoked by alias); 29 Apr 2009 12:41:37 -0000 Received: from 62-47-59-107.adsl.highway.telekom.at (EHLO [62.47.59.107]) [62.47.59.107] by mail.gmx.net (mp055) with SMTP; 29 Apr 2009 14:41:37 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18izoEVlOsiaoyWH1ZrGcFNKVxjakSinLK8N6obRt rhaWY8dh1m4OHe Message-ID: <49F84AAC.60902@gmx.at> Date: Wed, 29 Apr 2009 14:40:12 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Juri Linkov CC: Jared Finder , 3142@debbugs.gnu.org References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <87r5zbbttn.fsf@mail.jurta.org> In-Reply-To: <87r5zbbttn.fsf@mail.jurta.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.78 > How about adding two wrapper functions? > > (split-window-preferred-vertically &optional window) > that calls split-window-vertically > > (split-window-preferred-horizontally &optional window) > that calls split-window-horizontally I can't really comment that because the current behavior seems already confusing enough. At least that's the impression I got from Jared's mail. Personally, I'm always confused by -window (-buffer) functions that do not have a window (or buffer) as first argument :-( martin From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92;split-window-prefered-function should be able to usesplit-window-horizontally/split-window-vertically Reply-To: "Drew Adams" , 3142@debbugs.gnu.org Resent-From: "Drew Adams" Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 29 Apr 2009 14:00:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124101306417805 (code B ref 3142); Wed, 29 Apr 2009 14:00:04 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 29 Apr 2009 13:51:04 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from rgminet11.oracle.com (rcsinet11.oracle.com [148.87.113.123]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3TDp15w017799 for <3142@emacsbugs.donarmstrong.com>; Wed, 29 Apr 2009 06:51:02 -0700 Received: from acsinet15.oracle.com (acsinet15.oracle.com [141.146.126.227]) by rgminet11.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n3TDp0Js004855 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Wed, 29 Apr 2009 13:51:02 GMT Received: from acsmt705.oracle.com (acsmt705.oracle.com [141.146.40.83]) by acsinet15.oracle.com (Switch-3.3.1/Switch-3.3.1) with ESMTP id n3TDp0O4013620; Wed, 29 Apr 2009 13:51:00 GMT Received: from dradamslap1 (/141.144.88.34) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 29 Apr 2009 06:50:49 -0700 From: "Drew Adams" To: "'martin rudalics'" , <3142@debbugs.gnu.org>, "'Juri Linkov'" Cc: "'Jared Finder'" References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> Date: Wed, 29 Apr 2009 06:50:41 -0700 Message-ID: <011501c9c8d1$86d11820$0200a8c0@us.oracle.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Mailer: Microsoft Office Outlook 11 In-Reply-To: <49F7FE0F.1020107@gmx.at> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3350 Thread-Index: AcnInL5NntVY4JWJT2yScmWuMbtmRQANGABQ X-Source-IP: acsmt705.oracle.com [141.146.40.83] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A010209.49F85B3B.0111:SCFMA4539814,ss=1,fgs=0 > Remains the question whether `split-window-preferred-function' should > always operate on the selected window or have a window > argument. AFAICT > nothing speaks for the window argument but the fact that > people may have > customized this already. Omitting the window argument would > allow users > to put `split-window-vertically' directly as value of > `split-window-preferred-function' without having to delve any deeper. I haven't followed this thread, and I'm not familiar with the commands in question. But if you have a choice between defining foo to be unary or nullary, consider defining it with &optional: (defun foo (&optional window)...) That allows use of foo as an object method for windows. That is, given a window, `foo' is one of the functions that can be applied to it. If defined as nullary, this is not possible. From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Stefan Monnier , 3142@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 29 Apr 2009 15:35:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.12410188089665 (code B ref 3142); Wed, 29 Apr 2009 15:35:05 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 29 Apr 2009 15:26:48 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3TFQiYc009659 for <3142@emacsbugs.donarmstrong.com>; Wed, 29 Apr 2009 08:26:46 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AhsFAP0N+ElMCpT6/2dsb2JhbACBUM5Tg3UFhTo X-IronPort-AV: E=Sophos;i="4.40,266,1238990400"; d="scan'208";a="37764162" Received: from 76-10-148-250.dsl.teksavvy.com (HELO ceviche.home) ([76.10.148.250]) by ironport2-out.teksavvy.com with ESMTP; 29 Apr 2009 11:26:39 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 1B5C0B5227; Wed, 29 Apr 2009 11:26:39 -0400 (EDT) From: Stefan Monnier To: martin rudalics Cc: 3142@debbugs.gnu.org, Juri Linkov , Jared Finder Message-ID: References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> Date: Wed, 29 Apr 2009 11:26:39 -0400 In-Reply-To: <49F7FE0F.1020107@gmx.at> (martin rudalics's message of "Wed, 29 Apr 2009 09:13:19 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Remains the question whether `split-window-preferred-function' should > always operate on the selected window or have a window argument. AFAICT > nothing speaks for the window argument but the fact that people may have > customized this already. Omitting the window argument would allow users > to put `split-window-vertically' directly as value of > `split-window-preferred-function' without having to delve any deeper. I agree it would make sense to operate on the selected-window rather than pass an explicit window argument. Stefan From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 30 Apr 2009 09:15:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124108250722580 (code B ref 3142); Thu, 30 Apr 2009 09:15:07 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 30 Apr 2009 09:08:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=HAS_BUG_NUMBER,MIXEDBDN, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n3U98LIC022565 for <3142@emacsbugs.donarmstrong.com>; Thu, 30 Apr 2009 02:08:22 -0700 Received: (qmail invoked by alias); 30 Apr 2009 09:08:14 -0000 Received: from 62-47-58-178.adsl.highway.telekom.at (EHLO [62.47.58.178]) [62.47.58.178] by mail.gmx.net (mp010) with SMTP; 30 Apr 2009 11:08:14 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18W0oMR9foWHkgiv4qn5IxbFGaF7ysZLWJofuh8fS QrPYcmh7yaNUEk Message-ID: <49F9673F.6000806@gmx.at> Date: Thu, 30 Apr 2009 10:54:23 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Stefan Monnier CC: 3142@debbugs.gnu.org, Juri Linkov , Jared Finder References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> In-Reply-To: Content-Type: multipart/mixed; boundary="------------040008030404020703060907" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.85,0.53 This is a multi-part message in MIME format. --------------040008030404020703060907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > I agree it would make sense to operate on the selected-window rather > than pass an explicit window argument. Please have a look at the attached patch. martin --------------040008030404020703060907 Content-Type: text/plain; name="window.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window.el.diff" *** window.el.~1.179.~ 2009-04-29 07:50:42.078125000 +0200 --- window.el 2009-04-30 10:48:18.875000000 +0200 *************** *** 794,832 **** :type 'boolean :group 'windows) (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many lines. If the value is nil, ! `display-buffer' cannot split a window vertically. ! ! If the window is the only window on its frame, `display-buffer' ! can split it regardless of this value." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many columns. If the value is nil, ! `display-buffer' cannot split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) - (defcustom split-window-preferred-function nil - "Function used by `display-buffer' to split windows. - If non-nil, a function called with a window as single argument - supposed to split that window and return the new window. If the - function returns nil the window is not split. - - If nil, `display-buffer' will split the window respecting the - values of `split-height-threshold' and `split-width-threshold'." - :type '(choice (const nil) (function :tag "Function")) - :version "23.1" - :group 'windows) - (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW --- 794,828 ---- :type 'boolean :group 'windows) + (defcustom split-window-preferred-function 'split-selected-window + "Function called by `display-buffer' to split a window. + The window that shall be split is selected when this function is + called. The function is supposed to either return the new window + or nil if the window can (or shall) not be split." + :type 'function + :version "23.1" + :group 'windows) + (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, `split-selected-window' splits a window ! vertically only if it has at least as many lines. If the value ! is nil, it does not split a window vertically. If a window is ! the only window on its frame, it can be split regardless of the ! value of this variable." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, `split-selected-window' splits a window ! only if it has at least as many columns. If the value is nil, it ! does not split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW *************** *** 882,911 **** (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) (defun window--try-to-split-window (window) ! "Split WINDOW if it is splittable. ! See `window--splittable-p' for how to determine whether a window ! is splittable. If WINDOW can be split, return the value returned ! by `split-window' (or `split-window-preferred-function')." ! (when (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable))) ! (if (functionp split-window-preferred-function) ! ;; `split-window-preferred-function' is specified, so use it. ! (funcall split-window-preferred-function window) ! (or (and (window--splittable-p window) ! ;; Split window vertically. ! (split-window window)) ! (and (window--splittable-p window t) ! ;; Split window horizontally. ! (split-window window nil t)) ! (and (eq window (frame-root-window (window-frame window))) ! (not (window-minibuffer-p window)) ! ;; If WINDOW is the only window on its frame and not the ! ;; minibuffer window, attempt to split it vertically ! ;; disregarding the value of `split-height-threshold'. ! (let ((split-height-threshold 0)) ! (and (window--splittable-p window) ! (split-window window)))))))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --- 878,913 ---- (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) + (defun split-selected-window () + "Split selected window. + Return the new window if the selected window can be split either + vertically or horizontally. If the selected window is the only + window on its frame try to split it disregarding the value of + `split-height-threshold'. Return nil if the selected window + can't be split. This function provides the default value for + `split-window-preferred-function'." + (or (and (window--splittable-p (selected-window)) + ;; Split window vertically. + (split-window)) + (and (window--splittable-p (selected-window) t) + ;; Split window horizontally. + (split-window nil nil t)) + (and (eq (selected-window) (frame-root-window)) + (not (window-minibuffer-p)) + ;; If the selected 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)) + (and (window--splittable-p (selected-window)) + (split-window)))))) + (defun window--try-to-split-window (window) ! "Split WINDOW if it can be split. ! Return value returned by `split-window-preferred-function'." ! (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable)) ! (with-selected-window window ! (funcall split-window-preferred-function)))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --------------040008030404020703060907-- From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92;split-window-prefered-function should be able to usesplit-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 30 Apr 2009 09:15:09 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124108250722583 (code B ref 3142); Thu, 30 Apr 2009 09:15:09 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 30 Apr 2009 09:08:27 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.9 required=4.0 tests=FOURLA,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n3U98N0l022566 for <3142@emacsbugs.donarmstrong.com>; Thu, 30 Apr 2009 02:08:24 -0700 Received: (qmail invoked by alias); 30 Apr 2009 09:08:17 -0000 Received: from 62-47-58-178.adsl.highway.telekom.at (EHLO [62.47.58.178]) [62.47.58.178] by mail.gmx.net (mp050) with SMTP; 30 Apr 2009 11:08:17 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX1+Qc7NmFDGQn3CHEHjI1gBQEtLWUV9rogCwgalj02 S6Les3IFmq4QEs Message-ID: <49F969D5.9090409@gmx.at> Date: Thu, 30 Apr 2009 11:05:25 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Drew Adams CC: 3142@debbugs.gnu.org, "'Juri Linkov'" , "'Jared Finder'" References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <011501c9c8d1$86d11820$0200a8c0@us.oracle.com> In-Reply-To: <011501c9c8d1$86d11820$0200a8c0@us.oracle.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.6899999999999999 > But if you have a choice between defining foo to be unary or nullary, consider > defining it with &optional: (defun foo (&optional window)...) > > That allows use of foo as an object method for windows. That is, given a window, > `foo' is one of the functions that can be applied to it. If defined as nullary, > this is not possible. Yes. But I don't want to burden customizers with the problem in the first place. For example, Jared wants to use `split-window-vertically' as value for this variable and that function has an optional SIZE argument but no WINDOW argument. martin From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Juri Linkov , 3142@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 30 Apr 2009 15:05:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124110378129801 (code B ref 3142); Thu, 30 Apr 2009 15:05:07 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 30 Apr 2009 15:03:01 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3UF2ukD029790 for <3142@emacsbugs.donarmstrong.com>; Thu, 30 Apr 2009 08:02:57 -0700 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LzVdR-0009gw-Kl; Thu, 30 Apr 2009 15:45:05 +0300 From: Juri Linkov To: martin rudalics Cc: Stefan Monnier , 3142@debbugs.gnu.org, Jared Finder Organization: JURTA References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49F9673F.6000806@gmx.at> Date: Thu, 30 Apr 2009 14:47:27 +0300 In-Reply-To: <49F9673F.6000806@gmx.at> (martin rudalics's message of "Thu, 30 Apr 2009 10:54:23 +0200") Message-ID: <87ljpiuyi0.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: 068dd79c68aafbc760c35e97c5d420ed X-DrWeb-checked: yes > + (defcustom split-window-preferred-function 'split-selected-window > + "Function called by `display-buffer' to split a window. > + The window that shall be split is selected when this function is > + called. The function is supposed to either return the new window > + or nil if the window can (or shall) not be split." > + :type 'function > + :version "23.1" > + :group 'windows) If setting this option to `split-window-horizontally' and `split-window-vertically' is possible and it works correctly with these value, then I suggest adding them as constants, e.g. "Always split horizontally" and "Always split vertically". Also I suggest keeping the common function name prefix "split-window-", i.e. instead of `split-selected-window' to name it something like "split-window-sensibly" or "split-window-with-thresholds". -- Juri Linkov http://www.jurta.org/emacs/ From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Stefan Monnier , 3142@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Thu, 30 Apr 2009 18:25:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124111566922676 (code B ref 3142); Thu, 30 Apr 2009 18:25:04 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 30 Apr 2009 18:21:09 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-0.5 required=4.0 tests=HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.pppoe.ca [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3UIL5Qw022664 for <3142@emacsbugs.donarmstrong.com>; Thu, 30 Apr 2009 11:21:06 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AlkGAHOI+UnO+ITX/2dsb2JhbACBUM8fg38FhTo X-IronPort-AV: E=Sophos;i="4.40,274,1238990400"; d="scan'208";a="37828375" Received: from 206-248-132-215.dsl.teksavvy.com (HELO pastel.home) ([206.248.132.215]) by ironport2-out.teksavvy.com with ESMTP; 30 Apr 2009 14:20:59 -0400 Received: by pastel.home (Postfix, from userid 20848) id E4E857F64; Thu, 30 Apr 2009 14:20:58 -0400 (EDT) From: Stefan Monnier To: Juri Linkov Cc: martin rudalics , 3142@debbugs.gnu.org, Jared Finder Message-ID: References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49F9673F.6000806@gmx.at> <87ljpiuyi0.fsf@mail.jurta.org> Date: Thu, 30 Apr 2009 14:20:58 -0400 In-Reply-To: <87ljpiuyi0.fsf@mail.jurta.org> (Juri Linkov's message of "Thu, 30 Apr 2009 14:47:27 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii >> + (defcustom split-window-preferred-function 'split-selected-window >> + "Function called by `display-buffer' to split a window. >> + The window that shall be split is selected when this function is >> + called. The function is supposed to either return the new window >> + or nil if the window can (or shall) not be split." >> + :type 'function >> + :version "23.1" >> + :group 'windows) > If setting this option to `split-window-horizontally' and > `split-window-vertically' is possible and it works correctly > with these value, then I suggest adding them as constants, > e.g. "Always split horizontally" and "Always split vertically". Agreed (does :options work in such a case?). > Also I suggest keeping the common function name prefix > "split-window-", Yes, please. > i.e. instead of `split-selected-window' to name it something like > "split-window-sensibly" or "split-window-with-thresholds". Or split-window-dwim, split-window-somehow. Stefan PS: Other than that, the code looks fine. From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 01 May 2009 10:15:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124117242820249 (code B ref 3142); Fri, 01 May 2009 10:15:04 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 1 May 2009 10:07:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=HAS_BUG_NUMBER,MIXEDBDN, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n41A72Eu020230 for <3142@emacsbugs.donarmstrong.com>; Fri, 1 May 2009 03:07:03 -0700 Received: (qmail invoked by alias); 01 May 2009 10:06:56 -0000 Received: from 62-47-59-240.adsl.highway.telekom.at (EHLO [62.47.59.240]) [62.47.59.240] by mail.gmx.net (mp071) with SMTP; 01 May 2009 12:06:56 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX189WAI8n8w9pC+LlzOfNTbfpjaX4PafUYNI8ljG41 dZsontFaqhoKcJ Message-ID: <49FAB3F1.7040301@gmx.at> Date: Fri, 01 May 2009 10:33:53 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Juri Linkov CC: Stefan Monnier , 3142@debbugs.gnu.org, Jared Finder References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49F9673F.6000806@gmx.at> <87ljpiuyi0.fsf@mail.jurta.org> In-Reply-To: <87ljpiuyi0.fsf@mail.jurta.org> Content-Type: multipart/mixed; boundary="------------030702030003060502010002" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.7,0.53 This is a multi-part message in MIME format. --------------030702030003060502010002 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >> + (defcustom split-window-preferred-function 'split-selected-window >> + "Function called by `display-buffer' to split a window. >> + The window that shall be split is selected when this function is >> + called. The function is supposed to either return the new window >> + or nil if the window can (or shall) not be split." >> + :type 'function >> + :version "23.1" >> + :group 'windows) > > If setting this option to `split-window-horizontally' and > `split-window-vertically' is possible and it works correctly > with these value, then I suggest adding them as constants, > e.g. "Always split horizontally" and "Always split vertically". Done. But note that a function like `split-window-vertically' is suited for interactive use and thus may throw an error when the window is too small. I can't allow an error in `display-buffer' so I have to wrap that call in a `condition-case'. > Also I suggest keeping the common function name prefix "split-window-", > i.e. instead of `split-selected-window' to name it something like > "split-window-sensibly" or "split-window-with-thresholds". I've chosen `split-window-sensibly'. It also calls `split-window-vertically' and `split-window-horizontally' now. Please try the new patch - we're in pretest and I don't want to take too many chances. martin --------------030702030003060502010002 Content-Type: text/plain; name="window.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window.el.diff" *** window.el.~1.179.~ 2009-04-29 07:50:42.078125000 +0200 --- window.el 2009-05-01 10:19:20.625000000 +0200 *************** *** 794,832 **** :type 'boolean :group 'windows) (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many lines. If the value is nil, ! `display-buffer' cannot split a window vertically. ! ! If the window is the only window on its frame, `display-buffer' ! can split it regardless of this value." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many columns. If the value is nil, ! `display-buffer' cannot split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) - (defcustom split-window-preferred-function nil - "Function used by `display-buffer' to split windows. - If non-nil, a function called with a window as single argument - supposed to split that window and return the new window. If the - function returns nil the window is not split. - - If nil, `display-buffer' will split the window respecting the - values of `split-height-threshold' and `split-width-threshold'." - :type '(choice (const nil) (function :tag "Function")) - :version "23.1" - :group 'windows) - (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW --- 794,831 ---- :type 'boolean :group 'windows) + (defcustom split-window-preferred-function 'split-window-sensibly + "Function called by `display-buffer' to split a window. + The window that shall be split is selected when this function is + called. The function is supposed to either return the new window + or nil if the window can (or shall) not be split." + :type '(choice + (function :tag "Function") + (const :tag "Split vertically" split-window-vertically) + (const :tag "Split horizontally" split-window-horizontally)) + :version "23.1" + :group 'windows) + (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, `split-window-sensibly' splits a window ! vertically only if it has at least as many lines. If the value ! is nil, it does not split a window vertically. If a window is ! the only window on its frame, it can be split regardless of the ! value of this variable." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, `split-window-sensibly' splits a window ! only if it has at least as many columns. If the value is nil, it ! does not split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW *************** *** 882,911 **** (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) (defun window--try-to-split-window (window) ! "Split WINDOW if it is splittable. ! See `window--splittable-p' for how to determine whether a window ! is splittable. If WINDOW can be split, return the value returned ! by `split-window' (or `split-window-preferred-function')." ! (when (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable))) ! (if (functionp split-window-preferred-function) ! ;; `split-window-preferred-function' is specified, so use it. ! (funcall split-window-preferred-function window) ! (or (and (window--splittable-p window) ! ;; Split window vertically. ! (split-window window)) ! (and (window--splittable-p window t) ! ;; Split window horizontally. ! (split-window window nil t)) ! (and (eq window (frame-root-window (window-frame window))) ! (not (window-minibuffer-p window)) ! ;; If WINDOW is the only window on its frame and not the ! ;; minibuffer window, attempt to split it vertically ! ;; disregarding the value of `split-height-threshold'. ! (let ((split-height-threshold 0)) ! (and (window--splittable-p window) ! (split-window window)))))))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --- 881,922 ---- (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) + (defun split-window-sensibly () + "\"Sensibly\" split the selected window. + Split selected window vertically or horizontally respecting the + values of `split-height-threshold' and `split-width-threshold'. + If the selected window is the only window on its frame, it may be + split disregarding the value of `split-height-threshold'. If the + window can be split, return the new window, nil otherwise. + + The default value of `split-window-preferred-function' is set to + this function." + (or (and (window--splittable-p (selected-window)) + ;; Split window vertically. + (split-window-vertically)) + (and (window--splittable-p (selected-window) t) + ;; Split window horizontally. + (split-window-horizontally)) + (and (eq (selected-window) (frame-root-window)) + (not (window-minibuffer-p)) + ;; If the selected 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)) + (and (window--splittable-p (selected-window)) + (split-window-vertically)))))) + (defun window--try-to-split-window (window) ! "Split WINDOW if it can be split. ! Return value returned by `split-window-preferred-function'." ! ;; Use `condition-case' since `split-window-preferred-function' might ! ;; throw an error. ! (condition-case nil ! (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable)) ! (with-selected-window window ! (funcall split-window-preferred-function))) ! (error nil))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --------------030702030003060502010002-- From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Juri Linkov , 3142@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 01 May 2009 12:30:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124118051425783 (code B ref 3142); Fri, 01 May 2009 12:30:03 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 1 May 2009 12:21:54 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from relay02.kiev.sovam.com (relay02.kiev.sovam.com [62.64.120.197]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n41CLoSx025774 for <3142@emacsbugs.donarmstrong.com>; Fri, 1 May 2009 05:21:51 -0700 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay02.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LzrkR-000HJV-H7; Fri, 01 May 2009 15:21:47 +0300 From: Juri Linkov To: martin rudalics Cc: Stefan Monnier , 3142@debbugs.gnu.org, Jared Finder Organization: JURTA References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49F9673F.6000806@gmx.at> <87ljpiuyi0.fsf@mail.jurta.org> <49FAB3F1.7040301@gmx.at> Date: Fri, 01 May 2009 14:52:07 +0300 In-Reply-To: <49FAB3F1.7040301@gmx.at> (martin rudalics's message of "Fri, 01 May 2009 10:33:53 +0200") Message-ID: <878wlhkoo8.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: be98704d0ffb13ed258a3fe1bd3e20b6 X-DrWeb-checked: yes > Done. But note that a function like `split-window-vertically' is suited > for interactive use and thus may throw an error when the window is too > small. I can't allow an error in `display-buffer' so I have to wrap > that call in a `condition-case'. Thanks, the only thing to fix I noticed is the missing const option for the default value split-window-sensibly in split-window-preferred-function. -- Juri Linkov http://www.jurta.org/emacs/ From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Juri Linkov , 3142@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Fri, 01 May 2009 12:30:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124118051525788 (code B ref 3142); Fri, 01 May 2009 12:30:04 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 1 May 2009 12:21:55 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-3.0 required=4.0 tests=HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from relay01.kiev.sovam.com (relay01.kiev.sovam.com [62.64.120.200]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n41CLoHd025773 for <3142@emacsbugs.donarmstrong.com>; Fri, 1 May 2009 05:21:52 -0700 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay01.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1LzrkT-000M8p-68; Fri, 01 May 2009 15:21:49 +0300 From: Juri Linkov To: Stefan Monnier Cc: martin rudalics , 3142@debbugs.gnu.org, Jared Finder Organization: JURTA References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49F9673F.6000806@gmx.at> <87ljpiuyi0.fsf@mail.jurta.org> Date: Fri, 01 May 2009 14:54:17 +0300 In-Reply-To: (Stefan Monnier's message of "Thu, 30 Apr 2009 14:20:58 -0400") Message-ID: <877i11kony.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: 485d3c07c5d69b41d1cad5b5ab8b481e X-DrWeb-checked: yes >> If setting this option to `split-window-horizontally' and >> `split-window-vertically' is possible and it works correctly >> with these value, then I suggest adding them as constants, >> e.g. "Always split horizontally" and "Always split vertically". > > Agreed (does :options work in such a case?). It seems `:options' is suitable only for the `hook' type since it allow multiple choices. -- Juri Linkov http://www.jurta.org/emacs/ From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Sat, 02 May 2009 08:45:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124125377410590 (code B ref 3142); Sat, 02 May 2009 08:45:03 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 2 May 2009 08:42:54 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.0 required=4.0 tests=HAS_BUG_NUMBER,MIXEDBDN autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n428gms9010584 for <3142@emacsbugs.donarmstrong.com>; Sat, 2 May 2009 01:42:50 -0700 Received: (qmail invoked by alias); 02 May 2009 08:42:42 -0000 Received: from 62-47-43-85.adsl.highway.telekom.at (EHLO [62.47.43.85]) [62.47.43.85] by mail.gmx.net (mp017) with SMTP; 02 May 2009 10:42:42 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18yDkQyye4ythRuN+Q1rXmcXHpuIU0pr9DHY80FMv 6yh6T9OmAgAtkq Message-ID: <49FC06F7.9060509@gmx.at> Date: Sat, 02 May 2009 10:40:23 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Juri Linkov CC: Stefan Monnier , 3142@debbugs.gnu.org, Jared Finder References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49F9673F.6000806@gmx.at> <87ljpiuyi0.fsf@mail.jurta.org> <49FAB3F1.7040301@gmx.at> <878wlhkoo8.fsf@mail.jurta.org> In-Reply-To: <878wlhkoo8.fsf@mail.jurta.org> Content-Type: multipart/mixed; boundary="------------090807060400060205070103" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.8100000000000001,0.53 This is a multi-part message in MIME format. --------------090807060400060205070103 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit > Thanks, the only thing to fix I noticed is the missing const option for > the default value split-window-sensibly in split-window-preferred-function. I added the const option, rewrote some doc-strings, and narrowed the scope of the condition-case. If no one objects I shall commit that. Thanks, martin --------------090807060400060205070103 Content-Type: text/plain; name="window.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window.el.diff" *** window.el.~1.179.~ 2009-04-29 07:50:42.078125000 +0200 --- window.el 2009-05-01 17:28:24.125000000 +0200 *************** *** 794,832 **** :type 'boolean :group 'windows) (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many lines. If the value is nil, ! `display-buffer' cannot split a window vertically. ! ! If the window is the only window on its frame, `display-buffer' ! can split it regardless of this value." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many columns. If the value is nil, ! `display-buffer' cannot split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) - (defcustom split-window-preferred-function nil - "Function used by `display-buffer' to split windows. - If non-nil, a function called with a window as single argument - supposed to split that window and return the new window. If the - function returns nil the window is not split. - - If nil, `display-buffer' will split the window respecting the - values of `split-height-threshold' and `split-width-threshold'." - :type '(choice (const nil) (function :tag "Function")) - :version "23.1" - :group 'windows) - (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW --- 794,848 ---- :type 'boolean :group 'windows) + (defcustom split-window-preferred-function 'split-window-sensibly + "Function called by `display-buffer' to split a window. + The window that shall be split is selected when this function is + called. The function is supposed to either return the new window + or nil if the selected window can (or shall) not be split. + + The default is to split the window \"sensibly\". This calls the + function `split-window-sensibly' which tries to split the window + in a way which seems most suitable. A second standard option is + \"vertically\" which calls the function `split-window-vertically' + to split the window into two windows one above the other. The + third standard option is \"horizontally\" which calls the + function `split-window-horizontally' to split the window into two + windows side by side. + + If you set this to any other function, observe that it may be + called two times: A first time with the largest window selected + and, if that call fails to provide a suitable window, a second + time with the least recently used window selected. If neither of + these calls produces a suitable window, `display-buffer' will use + an existing one to display its buffer." + :type '(choice + (const :tag "Split sensibly" split-window-sensibly) + (const :tag "Split vertically" split-window-vertically) + (const :tag "Split horizontally" split-window-horizontally) + (function :tag "Function")) + :version "23.1" + :group 'windows) + (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, `split-window-sensibly' splits a window ! vertically only if it has at least as many lines. If the value ! is nil, it does not split a window vertically. If a window is ! the only window on its frame, it can be split regardless of the ! value of this variable." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, `split-window-sensibly' splits a window ! only if it has at least as many columns. If the value is nil, it ! does not split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW *************** *** 882,911 **** (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) (defun window--try-to-split-window (window) ! "Split WINDOW if it is splittable. ! See `window--splittable-p' for how to determine whether a window ! is splittable. If WINDOW can be split, return the value returned ! by `split-window' (or `split-window-preferred-function')." ! (when (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable))) ! (if (functionp split-window-preferred-function) ! ;; `split-window-preferred-function' is specified, so use it. ! (funcall split-window-preferred-function window) ! (or (and (window--splittable-p window) ! ;; Split window vertically. ! (split-window window)) ! (and (window--splittable-p window t) ! ;; Split window horizontally. ! (split-window window nil t)) ! (and (eq window (frame-root-window (window-frame window))) ! (not (window-minibuffer-p window)) ! ;; If WINDOW is the only window on its frame and not the ! ;; minibuffer window, attempt to split it vertically ! ;; disregarding the value of `split-height-threshold'. ! (let ((split-height-threshold 0)) ! (and (window--splittable-p window) ! (split-window window)))))))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --- 898,945 ---- (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) + (defun split-window-sensibly () + "\"Sensibly\" split the selected window. + If the selected window has at least `split-height-threshold' + lines, split it into two windows one above the other and return + the lower one. Otherwise, if the selected window is at least + `split-width-threshold' columns wide, split it into two windows + side by side and return the one on the right. If this does not + produce a suitable window either and the selected window is the + only one on its frame, try to split that window vertically and + return the lower one. Return nil if that fails as well. + + The default value of `split-window-preferred-function' is set to + this function." + (or (and (window--splittable-p (selected-window)) + ;; Split window vertically. + (split-window-vertically)) + (and (window--splittable-p (selected-window) t) + ;; Split window horizontally. + (split-window-horizontally)) + (and (eq (selected-window) (frame-root-window)) + (not (window-minibuffer-p)) + ;; If the selected 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)) + (and (window--splittable-p (selected-window)) + (split-window-vertically)))))) + (defun window--try-to-split-window (window) ! "Split WINDOW if it can be split. ! Return value returned by `split-window-preferred-function' if it ! represents a live window, nil otherwise." ! (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable)) ! (with-selected-window window ! (let ((new-window ! ;; Since `split-window-preferred-function' might ! ;; throw an error use `condition-case'. ! (condition-case nil ! (funcall split-window-preferred-function) ! (error nil)))) ! (and (window-live-p new-window) new-window))))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --------------090807060400060205070103-- From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 05 May 2009 07:15:04 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124150725313183 (code B ref 3142); Tue, 05 May 2009 07:15:04 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 5 May 2009 07:07:33 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.2 required=4.0 tests=AWL,HAS_BUG_NUMBER,MIXEDBDN, MURPHY_DRUGS_REL8 autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n4577P2X013167 for <3142@emacsbugs.donarmstrong.com>; Tue, 5 May 2009 00:07:27 -0700 Received: (qmail invoked by alias); 05 May 2009 07:07:19 -0000 Received: from 62-47-49-59.adsl.highway.telekom.at (EHLO [62.47.49.59]) [62.47.49.59] by mail.gmx.net (mp040) with SMTP; 05 May 2009 09:07:19 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX18jlH4B8iojiGUjRsIh4yUxyNWQhUwDLxA+WVKKpY G3crPEP0aiF3yr Message-ID: <49FFE487.5000106@gmx.at> Date: Tue, 05 May 2009 09:02:31 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Stefan Monnier CC: 3142@debbugs.gnu.org, Juri Linkov References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> In-Reply-To: Content-Type: multipart/mixed; boundary="------------050801000002030900000804" X-Y-GMX-Trusted: 0 X-FuHaFi: 0.68,0.51 This is a multi-part message in MIME format. --------------050801000002030900000804 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit >> Remains the question whether `split-window-preferred-function' should >> always operate on the selected window or have a window argument. AFAICT >> nothing speaks for the window argument but the fact that people may have >> customized this already. Omitting the window argument would allow users >> to put `split-window-vertically' directly as value of >> `split-window-preferred-function' without having to delve any deeper. > > I agree it would make sense to operate on the selected-window rather > than pass an explicit window argument. Unfortunately, this will create the following problem: Suppose a user wants to (1) always split the selected window instead of the largest or LRU one, (2) never split the selected window (as Drew points out in another thread), or (3) base her decision on whether a window shall be split on which window was selected at the time `display-buffer' was called. In any of these cases calling `split-window-preferred-function' with the window to split selected will obscure the identity of the selected window and make the desired customization impossible. So we should probably leave the current behavior alone. The attached patch just makes sure that `split-window-preferred-function' gets always called and provides the standard options requested earlier. martin --------------050801000002030900000804 Content-Type: text/plain; name="window.el.diff" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="window.el.diff" *** window.el.~1.179.~ 2009-04-29 07:50:42.078125000 +0200 --- window.el 2009-05-05 08:46:08.390625000 +0200 *************** *** 794,832 **** :type 'boolean :group 'windows) (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many lines. If the value is nil, ! `display-buffer' cannot split a window vertically. ! ! If the window is the only window on its frame, `display-buffer' ! can split it regardless of this value." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, `display-buffer' can split a window ! only if it has at least as many columns. If the value is nil, ! `display-buffer' cannot split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) - (defcustom split-window-preferred-function nil - "Function used by `display-buffer' to split windows. - If non-nil, a function called with a window as single argument - supposed to split that window and return the new window. If the - function returns nil the window is not split. - - If nil, `display-buffer' will split the window respecting the - values of `split-height-threshold' and `split-width-threshold'." - :type '(choice (const nil) (function :tag "Function")) - :version "23.1" - :group 'windows) - (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW --- 794,865 ---- :type 'boolean :group 'windows) + (defcustom split-window-preferred-function 'split-window-sensibly + "Function called by `display-buffer' to split a window. + The function is called with a window as single argument and is + supposed to either split that window and return the new window or + return nil if the window can (or shall) not be split. + + The default is to split the window \"sensibly\". This calls the + function `split-window-sensibly' which tries to split the window + in a way which seems most suitable. A second standard option is + \"vertically\" to split the window into two windows one above the + other. The third standard option is \"horizontally\" which tries + to split the window into two windows side by side. All three + standard options examine the values of `split-height-threshold' + and/or `split-width-threshold' before they apply the split. + + If you set this to any other function, bear in mind that it may + be called two times: The argument of the first call is the + largest window on its frame. If that call fails to provide a + suitable window, it gets called again with the least recently + used window as argument. If neither of these calls produces a + suitable window, `display-buffer' will use an existing one to + display its buffer. + + The window selected at the time `display-buffer' was invoked is + selected when `split-window-preferred-function' gets called. + Hence you can compare WINDOW with the value of `selected-window' + if you always want to split the selected window instead of WINDOW + or if you never want to split the currently selected window." + :type '(choice + (const :tag "sensibly" split-window-sensibly) + (const :tag "vertically" + (lambda (window) + (when (window--splittable-p window) + (with-selected-window window + (split-window-vertically))))) + (const :tag "horizontally" + (lambda (window) + (when (window--splittable-p window t) + (with-selected-window window + (split-window-horizontally))))) + (function :tag "Function")) + :version "23.1" + :group 'windows) + (defcustom split-height-threshold 80 "Minimum height of window to be split vertically. ! If the value is a number, the standard functions specified for ! `split-window-preferred-function' are allowed to split a window ! vertically only if it has at least this many lines. If the value ! is nil, they do not split a window vertically. If a window is ! the only window on its frame, they can split it disregarding the ! value of this variable." :type '(choice (const nil) (number :tag "lines")) :version "23.1" :group 'windows) (defcustom split-width-threshold 160 "Minimum width of window to be split horizontally. ! If the value is a number, the standard functions specified for ! `split-window-preferred-function' are allowed to split a window ! horizontally only if it has at least this many columns. If the ! value is nil, they do not split a window horizontally." :type '(choice (const nil) (number :tag "columns")) :version "23.1" :group 'windows) (defun window--splittable-p (window &optional horizontal) "Return non-nil if WINDOW can be split evenly. Optional argument HORIZONTAL non-nil means check whether WINDOW *************** *** 882,911 **** (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) (defun window--try-to-split-window (window) ! "Split WINDOW if it is splittable. ! See `window--splittable-p' for how to determine whether a window ! is splittable. If WINDOW can be split, return the value returned ! by `split-window' (or `split-window-preferred-function')." ! (when (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable))) ! (if (functionp split-window-preferred-function) ! ;; `split-window-preferred-function' is specified, so use it. ! (funcall split-window-preferred-function window) ! (or (and (window--splittable-p window) ! ;; Split window vertically. ! (split-window window)) ! (and (window--splittable-p window t) ! ;; Split window horizontally. ! (split-window window nil t)) ! (and (eq window (frame-root-window (window-frame window))) ! (not (window-minibuffer-p window)) ! ;; If WINDOW is the only window on its frame and not the ! ;; minibuffer window, attempt to split it vertically ! ;; disregarding the value of `split-height-threshold'. ! (let ((split-height-threshold 0)) ! (and (window--splittable-p window) ! (split-window window)))))))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --- 915,964 ---- (* 2 (max window-min-height (if mode-line-format 2 1)))))))))) + (defun split-window-sensibly (window) + "Split WINDOW \"sensibly\". + If WINDOW has at least `split-height-threshold' lines, split it + into two windows one above the other and return the lower one. + Otherwise, if WINDOW is at least `split-width-threshold' columns + wide, split it into two windows side by side and return the one + on the right. If this does not produce a suitable window either + and WINDOW is the only window on its frame, try to split WINDOW + vertically and return the lower one. Return nil if that fails as + well. + + The default value of `split-window-preferred-function' is set to + this function." + (or (and (window--splittable-p window) + ;; Split window vertically. + (with-selected-window window + (split-window-vertically))) + (and (window--splittable-p window t) + ;; Split window horizontally. + (with-selected-window window + (split-window-horizontally))) + (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-vertically))))))) + (defun window--try-to-split-window (window) ! "Split WINDOW if it can be split. ! Return value returned by `split-window-preferred-function' if it ! represents a live window, nil otherwise." ! (and (window-live-p window) ! (not (frame-parameter (window-frame window) 'unsplittable)) ! (let ((new-window ! ;; Since `split-window-preferred-function' might ! ;; throw an error use `condition-case'. ! (condition-case nil ! (funcall split-window-preferred-function window) ! (error nil)))) ! (and (window-live-p new-window) new-window)))) (defun window--frame-usable-p (frame) "Return FRAME if it can be used to display a buffer." --------------050801000002030900000804-- From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Juri Linkov , 3142@debbugs.gnu.org Resent-From: Juri Linkov Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Tue, 05 May 2009 11:15:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124152162715833 (code B ref 3142); Tue, 05 May 2009 11:15:03 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 5 May 2009 11:07:07 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.7 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from relay03.kiev.sovam.com (relay03.kiev.sovam.com [62.64.120.201]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n45B73tP015826 for <3142@emacsbugs.donarmstrong.com>; Tue, 5 May 2009 04:07:04 -0700 Received: from [83.170.232.243] (helo=smtp.svitonline.com) by relay03.kiev.sovam.com with esmtp (Exim 4.69) (envelope-from ) id 1M1IUH-0002xH-Ec; Tue, 05 May 2009 14:07:01 +0300 From: Juri Linkov To: martin rudalics Cc: Stefan Monnier , 3142@debbugs.gnu.org Organization: JURTA References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49FFE487.5000106@gmx.at> Date: Tue, 05 May 2009 14:03:44 +0300 In-Reply-To: <49FFE487.5000106@gmx.at> (martin rudalics's message of "Tue, 05 May 2009 09:02:31 +0200") Message-ID: <87d4an95gv.fsf@mail.jurta.org> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Scanner-Signature: e35cef5ed21d82303c208435479e4a86 X-DrWeb-checked: yes > + :type '(choice > + (const :tag "sensibly" split-window-sensibly) > + (const :tag "vertically" > + (lambda (window) > + (when (window--splittable-p window) > + (with-selected-window window > + (split-window-vertically))))) > + (const :tag "horizontally" > + (lambda (window) > + (when (window--splittable-p window t) > + (with-selected-window window > + (split-window-horizontally))))) Using lambdas in defcustoms is too ugly: it will put this long lambda code to custom-set-variables in .emacs, and cause other problems. I suggest defining new functions with the prefix `split-window-preferred-' that will provide a hint for the user where they are intended to be used: split-window-preferred-sensibly (window) split-window-preferred-vertically (window) split-window-preferred-horizontally (window) -- Juri Linkov http://www.jurta.org/emacs/ From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Stefan Monnier , 3142@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 06 May 2009 01:50:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124157411112250 (code B ref 3142); Wed, 06 May 2009 01:50:03 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 6 May 2009 01:41:51 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-2.6 required=4.0 tests=AWL,HAS_BUG_NUMBER,XIRONPORT autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from ironport2-out.teksavvy.com (ironport2-out.teksavvy.com [206.248.154.182]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n461flCg012244 for <3142@emacsbugs.donarmstrong.com>; Tue, 5 May 2009 18:41:48 -0700 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: ArUFAE6HAErO+IYe/2dsb2JhbACBUM4PhAEFhU4 X-IronPort-AV: E=Sophos;i="4.40,300,1238990400"; d="scan'208";a="38048453" Received: from 206-248-134-30.dsl.teksavvy.com (HELO ceviche.home) ([206.248.134.30]) by ironport2-out.teksavvy.com with ESMTP; 05 May 2009 21:41:41 -0400 Received: by ceviche.home (Postfix, from userid 20848) id 50B91B523F; Tue, 5 May 2009 21:41:41 -0400 (EDT) From: Stefan Monnier To: martin rudalics Cc: 3142@debbugs.gnu.org, Juri Linkov Message-ID: References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49FFE487.5000106@gmx.at> Date: Tue, 05 May 2009 21:41:41 -0400 In-Reply-To: <49FFE487.5000106@gmx.at> (martin rudalics's message of "Tue, 05 May 2009 09:02:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.93 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii > Unfortunately, this will create the following problem: Suppose a user > wants to > (1) always split the selected window instead of the largest or LRU one, > (2) never split the selected window (as Drew points out in another > thread), or > (3) base her decision on whether a window shall be split on which window > was selected at the time `display-buffer' was called. Good call. > + (const :tag "sensibly" split-window-sensibly) > + (const :tag "vertically" > + (lambda (window) > + (when (window--splittable-p window) > + (with-selected-window window > + (split-window-vertically))))) > + (const :tag "horizontally" > + (lambda (window) > + (when (window--splittable-p window t) > + (with-selected-window window > + (split-window-horizontally))))) I'd rather try to better advertise the use of (setq split-width-threshold nil) and friends then bother with lambdas here or defining new functions. Stefan From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: martin rudalics , 3142@debbugs.gnu.org Resent-From: martin rudalics Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 06 May 2009 16:40:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124162788113653 (code B ref 3142); Wed, 06 May 2009 16:40:08 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 6 May 2009 16:38:01 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.7 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from mail.gmx.net (mail.gmx.net [213.165.64.20]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with SMTP id n46GbtZF013632 for <3142@emacsbugs.donarmstrong.com>; Wed, 6 May 2009 09:37:57 -0700 Received: (qmail invoked by alias); 06 May 2009 16:37:48 -0000 Received: from 62-47-42-255.adsl.highway.telekom.at (EHLO [62.47.42.255]) [62.47.42.255] by mail.gmx.net (mp018) with SMTP; 06 May 2009 18:37:48 +0200 X-Authenticated: #14592706 X-Provags-ID: V01U2FsdGVkX19cmAUHaz9ceIlntcAwwZsH665oAeauoii1ZVhNM0 hlNmCKVRbyYBeO Message-ID: <4A01B90B.3070600@gmx.at> Date: Wed, 06 May 2009 18:21:31 +0200 From: martin rudalics User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Stefan Monnier CC: 3142@debbugs.gnu.org, Juri Linkov References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49FFE487.5000106@gmx.at> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Y-GMX-Trusted: 0 X-FuHaFi: 0.79 > I'd rather try to better advertise the use of (setq > split-width-threshold nil) and friends then bother with lambdas here or > defining new functions. Agreed. But then why did you want me to define a function like `split-window-sensibly' in the first place? martin From unknown Sun Aug 17 22:08:20 2025 X-Loop: owner@emacsbugs.donarmstrong.com Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Reply-To: Stefan Monnier , 3142@debbugs.gnu.org Resent-From: Stefan Monnier Resent-To: bug-submit-list@lists.donarmstrong.com Resent-CC: Emacs Bugs Resent-Date: Wed, 06 May 2009 19:10:07 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-Emacs-PR-Message: followup 3142 X-Emacs-PR-Package: emacs X-Emacs-PR-Keywords: Received: via spool by 3142-submit@emacsbugs.donarmstrong.com id=B3142.124163665525513 (code B ref 3142); Wed, 06 May 2009 19:10:07 +0000 Received: (at 3142) by emacsbugs.donarmstrong.com; 6 May 2009 19:04:15 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=-4.6 required=4.0 tests=AWL,HAS_BUG_NUMBER autolearn=ham version=3.2.5-bugs.debian.org_2005_01_02 Received: from pruche.dit.umontreal.ca (pruche.dit.umontreal.ca [132.204.246.22]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n46J47kg025500 for <3142@emacsbugs.donarmstrong.com>; Wed, 6 May 2009 12:04:08 -0700 Received: from faina.iro.umontreal.ca (faina.iro.umontreal.ca [132.204.26.177]) by pruche.dit.umontreal.ca (8.14.1/8.14.1) with ESMTP id n46J44pe006389; Wed, 6 May 2009 15:04:04 -0400 Received: by faina.iro.umontreal.ca (Postfix, from userid 20848) id 6B0E83A03E; Wed, 6 May 2009 15:04:02 -0400 (EDT) From: Stefan Monnier To: martin rudalics Cc: 3142@debbugs.gnu.org, Juri Linkov Message-ID: References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <49FFE487.5000106@gmx.at> <4A01B90B.3070600@gmx.at> Date: Wed, 06 May 2009 15:04:02 -0400 In-Reply-To: <4A01B90B.3070600@gmx.at> (martin rudalics's message of "Wed, 06 May 2009 18:21:31 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.92 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-NAI-Spam-Score: 0 X-NAI-Spam-Rules: 1 Rules triggered RV3269=0 >> I'd rather try to better advertise the use of (setq >> split-width-threshold nil) and friends then bother with lambdas here or >> defining new functions. > Agreed. But then why did you want me to define a function like > `split-window-sensibly' in the first place? Because we need it as default value of split-window-prefered-function. Or am I misunderstanding your question? Stefan From unknown Sun Aug 17 22:08:20 2025 X-Loop: help-debbugs@gnu.org Subject: bug#3142: 23.0.92; split-window-prefered-function should be able to usesplit-window-horizontally/split-window-vertically Resent-From: Glenn Morris Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 05 Oct 2011 18:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 3142 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: To: 3142@debbugs.gnu.org Received: via spool by 3142-submit@debbugs.gnu.org id=B3142.131784058817309 (code B ref 3142); Wed, 05 Oct 2011 18:50:02 +0000 Received: (at 3142) by debbugs.gnu.org; 5 Oct 2011 18:49:48 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBWXL-0004V7-0r for submit@debbugs.gnu.org; Wed, 05 Oct 2011 14:49:48 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBWXH-0004Uz-R9 for 3142@debbugs.gnu.org; Wed, 05 Oct 2011 14:49:45 -0400 Received: from rgm by fencepost.gnu.org with local (Exim 4.71) (envelope-from ) id 1RBWXD-0005R7-6M; Wed, 05 Oct 2011 14:49:39 -0400 From: Glenn Morris References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <011501c9c8d1$86d11820$0200a8c0@us.oracle.com> <49F969D5.9090409@gmx.at> X-Spook: BATF oil MD5 Abu Ghraib Rand Corporation radar advisors X-Ran: @^&i@z9HAFUQ}u_PIq-U`E,Yy+5LS,o4jhaDn=WHv"1?qv'z2h#7vlL!hOQ\9%_2de)YQO X-Hue: blue X-Attribution: GM Date: Wed, 05 Oct 2011 14:49:39 -0400 In-Reply-To: <49F969D5.9090409@gmx.at> (martin rudalics's message of "Thu, 30 Apr 2009 11:05:25 +0200") Message-ID: User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/software/emacs/) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Score: -6.4 (------) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.4 (------) As with many bug reports about window handling, this became rather long. What actually needs to be done to close this? AFAICS, the actual bug report was "I would like a way to tell split-window-preferred-function to always split vertically, or always horizontally". Surely there is such a way, and it is documented in that variable's documentation: You can customize the options `split-height-threshold' and/or `split-width-threshold' in order to have `split-window-sensibly' prefer either vertical or horizontal splitting. From unknown Sun Aug 17 22:08:20 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.427 (Entity 5.427) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Jared Finder Subject: bug#3142: closed (Re: bug#3142: 23.0.92; split-window-prefered-function should be able to usesplit-window-horizontally/split-window-vertically) Message-ID: References: X-Gnu-PR-Message: they-closed 3142 X-Gnu-PR-Package: emacs Reply-To: 3142@debbugs.gnu.org Date: Wed, 05 Oct 2011 22:12:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1317852722-8507-1" This is a multi-part message in MIME format... ------------=_1317852722-8507-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #3142: 23.0.92; split-window-prefered-function should be able to use split-= window-horizontally/split-window-vertically which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 3142@debbugs.gnu.org. --=20 3142: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D3142 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1317852722-8507-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 3142-done) by debbugs.gnu.org; 5 Oct 2011 22:11:53 +0000 Received: from localhost ([127.0.0.1] helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBZgv-0002Ct-3u for submit@debbugs.gnu.org; Wed, 05 Oct 2011 18:11:53 -0400 Received: from fencepost.gnu.org ([140.186.70.10]) by debbugs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1RBZgt-0002Cn-Kd for 3142-done@debbugs.gnu.org; Wed, 05 Oct 2011 18:11:52 -0400 Received: from webcon4.ubishops.ca ([206.167.194.115]:37050 helo=ceviche.home) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1RBZgn-0007Sn-7M; Wed, 05 Oct 2011 18:11:45 -0400 Received: by ceviche.home (Postfix, from userid 20848) id AAB5A660B6; Wed, 5 Oct 2011 18:11:43 -0400 (EDT) From: Stefan Monnier To: Glenn Morris Subject: Re: bug#3142: 23.0.92; split-window-prefered-function should be able to usesplit-window-horizontally/split-window-vertically Message-ID: References: <49F6A25B.3050108@gmx.at> <874ow84cp6.fsf_-_@mail.jurta.org> <49F7FE0F.1020107@gmx.at> <011501c9c8d1$86d11820$0200a8c0@us.oracle.com> <49F969D5.9090409@gmx.at> Date: Wed, 05 Oct 2011 18:11:43 -0400 In-Reply-To: (Glenn Morris's message of "Wed, 05 Oct 2011 14:49:39 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Score: -6.0 (------) X-Debbugs-Envelope-To: 3142-done Cc: 3142-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.11 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: debbugs-submit-bounces@debbugs.gnu.org Errors-To: debbugs-submit-bounces@debbugs.gnu.org X-Spam-Score: -6.0 (------) > What actually needs to be done to close this? I think this email will do ;-) Stefan ------------=_1317852722-8507-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by emacsbugs.donarmstrong.com; 28 Apr 2009 01:37:08 +0000 X-Spam-Checker-Version: SpamAssassin 3.2.5-bugs.debian.org_2005_01_02 (2008-06-10) on rzlab.ucr.edu X-Spam-Level: * X-Spam-Bayes: score:0.5 Bayes not run. spammytokens:Tokens not available. hammytokens:Tokens not available. X-Spam-Status: No, score=1.1 required=4.0 tests=FOURLA,MULTALT autolearn=no version=3.2.5-bugs.debian.org_2005_01_02 Received: from fencepost.gnu.org (fencepost.gnu.org [140.186.70.10]) by rzlab.ucr.edu (8.13.8/8.13.8/Debian-3) with ESMTP id n3S1b3Xu013471 for ; Mon, 27 Apr 2009 18:37:04 -0700 Received: from mx10.gnu.org ([199.232.76.166]:54169) by fencepost.gnu.org with esmtp (Exim 4.67) (envelope-from ) id 1LycFq-0002Sh-Ew for emacs-pretest-bug@gnu.org; Mon, 27 Apr 2009 21:37:02 -0400 Received: from Debian-exim by monty-python.gnu.org with spam-scanned (Exim 4.60) (envelope-from ) id 1LycFn-0000mm-HU for emacs-pretest-bug@gnu.org; Mon, 27 Apr 2009 21:37:02 -0400 Received: from universe.crypticstudios.com ([208.95.187.69]:50757) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_ARCFOUR_MD5:16) (Exim 4.60) (envelope-from ) id 1LycFm-0000mW-SP for emacs-pretest-bug@gnu.org; Mon, 27 Apr 2009 21:36:59 -0400 Received: from proserpine.paragon.crypticstudios.com (172.31.97.6) by universe.crypticstudios.com (208.95.187.69) with Microsoft SMTP Server (TLS) id 8.1.311.2; Mon, 27 Apr 2009 18:16:12 -0700 Received: from proserpine.paragon.crypticstudios.com ([172.31.97.6]) by proserpine.paragon.crypticstudios.com ([172.31.97.6]) with mapi; Mon, 27 Apr 2009 18:16:11 -0700 From: Jared Finder To: "emacs-pretest-bug@gnu.org" Date: Mon, 27 Apr 2009 18:16:11 -0700 Subject: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Thread-Topic: 23.0.92; split-window-prefered-function should be able to use split-window-horizontally/split-window-vertically Thread-Index: AcnHdtm/Q3qUbljrRZ2LNPYp6K+Hpg== Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: acceptlanguage: en-US Content-Type: multipart/alternative; boundary="_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_" MIME-Version: 1.0 X-detected-operating-system: by monty-python.gnu.org: Windows 2000 SP4, XP SP1+ X-Greylist: delayed 1244 seconds by postgrey-1.27 at monty-python; Mon, 27 Apr 2009 21:36:57 EDT --_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable I would expect that split-window-preferred-function would accept split-wind= ow-horizontally and split-window-vertically. At the very least, there shou= ld be an easy way to set this to "always split vertically", "always split h= orizontally", and "intelligently split". -- MJF In GNU Emacs 23.0.92.1 (i386-mingw-nt6.0.6001) of 2009-03-30 on SOFT-MJASON Windowing system distributor `Microsoft Corp.', version 6.0.6001 configured using `configure --with-gcc (3.4)' Important settings: value of $LC_ALL: nil value of $LC_COLLATE: nil value of $LC_CTYPE: nil value of $LC_MESSAGES: nil value of $LC_MONETARY: nil value of $LC_NUMERIC: nil value of $LC_TIME: nil value of $LANG: ENU value of $XMODIFIERS: nil locale-coding-system: cp1252 default-enable-multibyte-characters: t Major mode: Custom/lw Minor modes in effect: global-balanced-mode: t balanced-mode: t hrule-mode: t global-hi-lock-mode: t hi-lock-mode: t c-subword-mode: t url-handler-mode: t show-paren-mode: t recentf-mode: t global-reveal-mode: t reveal-mode: t global-c-subword-mode: t shell-dirtrack-mode: t cua-mode: t tooltip-mode: t mouse-wheel-mode: t menu-bar-mode: t file-name-shadow-mode: t global-font-lock-mode: t font-lock-mode: t blink-cursor-mode: t global-auto-composition-mode: t auto-composition-mode: t auto-encryption-mode: t auto-compression-mode: t column-number-mode: t line-number-mode: t transient-mark-mode: t Recent input: c u s t o m i z e SPC v a r s p l i t SPC w i n p C-x o C-x o C-h f C-x o C-x o n i l C-h f s p l i t SPC w i n SPC v C-h f s l p l i t SPC w i n s p l i t - w i n C-x C-s y C-x 1 C-x 2 C-x 1 C-x 4 b C-x 0 C-x 1 Recent messages: split-window-vertically: Window height 1 too small (after splitting) custom-variable-set: Invalid function: nil To install your edits, invoke [State] and choose the Set operation Type "q" to delete this window, to scroll help. To install your edits, invoke [State] and choose the Set operation Save all settings in this buffer? (y or n) Loading vc-cvs...done Saving file c:/Users/jfinder/Desktop/.emacs.d/custom.el... Wrote c:/Users/jfinder/Desktop/.emacs.d/custom.el (No files need saving) --_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

I would expect that split-window-preferred-function would accept split-window-horizontally and split-window-vertically.  At the very least, there should be an easy w= ay to set this to "always split vertically", "always split horizontall= y", and "intelligently split".

 

  -- MJF

 

In GNU Emacs 23.0.92.= 1 (i386-mingw-nt6.0.6001)

 of 2009-03-30 o= n SOFT-MJASON

Windowing system distributor `Microsoft Corp.', version 6.0.6001

configured using `con= figure --with-gcc (3.4)'

 

Important settings:

  value of $LC_A= LL: nil

  value of $LC_C= OLLATE: nil

  value of $LC_C= TYPE: nil

  value of $LC_M= ESSAGES: nil

  value of $LC_M= ONETARY: nil

  value of $LC_N= UMERIC: nil

  value of $LC_T= IME: nil

  value of $LANG= : ENU

  value of $XMOD= IFIERS: nil

  locale-coding-= system: cp1252

  default-enable= -multibyte-characters: t

 

Major mode: Custom/lw=

 

Minor modes in effect= :

  global-balance= d-mode: t

  balanced-mode:= t

  hrule-mode: t<= o:p>

  global-hi-lock= -mode: t

  hi-lock-mode: = t

  c-subword-mode= : t

  url-handler-mo= de: t

  show-paren-mod= e: t

  recentf-mode: = t

  global-reveal-= mode: t

  reveal-mode: t=

  global-c-subwo= rd-mode: t

  shell-dirtrack= -mode: t

  cua-mode: t

  tooltip-mode: = t

  mouse-wheel-mo= de: t

  menu-bar-mode:= t

  file-name-shad= ow-mode: t

  global-font-lo= ck-mode: t

  font-lock-mode= : t

  blink-cursor-m= ode: t

  global-auto-composition-mode: t

  auto-compositi= on-mode: t

  auto-encryptio= n-mode: t

  auto-compressi= on-mode: t

  column-number-= mode: t

  line-number-mo= de: t

  transient-mark= -mode: t

 

Recent input:

<help-echo> <select-window> <switch-frame> <switch-frame> =

<switch-frame> <switch-frame> <select-window> <down-mouse-1> =

<mouse-movement>= ; <mouse-1> <apps> <up> <up> c u s t

o m i z e SPC v a r <tab> <return> <up> s p l i t SPC

w i n <tab> p <tab> <return> <help-echo> <help-echo> <= /span>

<help-echo> <help-echo> <down-mouse-1> <mouse-2> <help-echo>

<wheel-down> <double-wheel-down> <wheel-down> <down-mouse-1>

<drag-mouse-1> <down-mouse-1> <mouse-1> <help-echo>

<down-mouse-1> <mouse-1> <help-echo> <down-mouse-1>

<mouse-1> <down-mouse-1> <mouse-1> <help-echo> <help-echo>

<wheel-down> <double-wheel-down> <wheel-down> <double-wheel-down>

<triple-wheel-down= > <wheel-down> <double-wheel-down>

<wheel-down> <double-wheel-down> <wheel-down> <double-wheel-down>

<wheel-down> <wheel-down> <help-echo> <down-mouse-1>

<mouse-1> <help-echo> <wheel-down> <double-wheel-down> <= /span>

<triple-wheel-down= > <wheel-down> <wheel-down> <wheel-down> =

<wheel-up> <wheel-up> <wheel-up> <help-echo> <help-echo> =

<down-mouse-1> <mouse-1> <help-echo> C-x o C-x o C-h

f <return> C-x = o C-x o <left> <S-end> <home> <S-end> <= /p>

n i l <help-echo&g= t; <help-echo> <down-mouse-1> <help-echo> =

<down-mouse-1> <help-echo> <help-echo> <down-mouse-1> =

<down-mouse-1> <mouse-1> C-h f s p l i t SPC w i n

<tab> SPC v <tab> <return> <help-echo> <help-echo> <= /span>

<wheel-down> <wheel-down> <wheel-down> <double-wheel-down> =

<triple-wheel-down= > <wheel-up> <double-wheel-up> <triple-wheel-up>

<triple-wheel-up&g= t; <triple-wheel-up> <select-window>

<help-echo> C-h= f s l <backspace> p l i t SPC w i n

<tab> <retur= n> <down-mouse-1> <help-echo> <down-mouse-1>

<mouse-1> <double-down-mouse-1> <double-mouse-1> s

p l i t - w i n <C-tab> C-x C-s y C-x 1 C-x 2 C-x 1

C-x 4 b <return>= ; C-x 0 <down> <down> <down> <down>

<down> <down= > <up> <up> <up> <up> <up> <help-echo>

<C-f7> <retu= rn> <help-echo> <up> <up> C-x 1 <up> <help-echo> =

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <help-echo> <help-echo> <help-echo> <help-echo>

<help-echo> <= ;help-echo> <help-echo> <help-echo> <menu-bar>

<help-menu> <send-emacs-bug-report>

 

Recent messages:=

split-window-vertical= ly: Window height 1 too small (after splitting)

custom-variable-set: Invalid function: nil

To install your edits= , invoke [State] and choose the Set operation

Type "q" to delete this window, <next> to scroll help.

To install your edits= , invoke [State] and choose the Set operation

Save all settings in = this buffer? (y or n)

Loading vc-cvs...done=

Saving file c:/Users/jfinder/Desktop/.emacs.d/custom.el...

Wrote c:/Users/jfinder/Desktop/.emacs.d/custom.el

(No files need saving= )

--_000_C73CE12E0E2E6D4AA8C97475050023A60FF541AA62proserpinepar_-- ------------=_1317852722-8507-1--