From: martin rudalics <rudalics@gmx.at>
To: David Hansen <david.hansen@gmx.net>
Cc: emacs-devel@gnu.org
Subject: Re: `split-window-preferred-horizontally'
Date: Sat, 07 Jun 2008 10:21:48 +0200 [thread overview]
Message-ID: <484A451C.2010408@gmx.at> (raw)
In-Reply-To: <87fxrq198q.fsf@localhorst.mine.nu>
> That's how I would like it:
>
> If the *frame* is >= 160 chars wide
>
> - if it is already (horizontally) split use the *other* window with
> all the `*-other-window' commands and `display-buffer'
`split-window-preferred-function' should decide if and how to split the
largest (or most recently used) window offered by `display-buffer'. It
cannot decide which window to use when _no_ window gets split.
> - otherwise split it horizontally.
>
> If the *frame* is < 160 chars wide do above with s/horizontally/vertically/
> (as the default behavior already is).
(defun my-spf (window)
(if (>= (frame-width (window-frame window)) 120)
(when (window-full-width-p window)
(let ((split-width-threshold 120))
(split-window window nil t)))
(split-window)))
seems to do what you want with a value of 120 - I can't test 160 here.
> I suspect that emacs thinks my already (horizontally) split frame is to
> small because the *window* is just 80 + ? chars wide.
The value of `split-width-threshold' must be set accordingly to handle
this when your frame contains more than one window. If WINDOW is 120
columns wide, `split-width-threshold' equals 160, and you have more than
one window on your frame, `split-window' should refuse to split WINDOW.
next prev parent reply other threads:[~2008-06-07 8:21 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-06 19:44 `split-window-preferred-horizontally' David Hansen
2008-06-06 22:01 ` `split-window-preferred-horizontally' martin rudalics
2008-06-06 22:36 ` `split-window-preferred-horizontally' David Hansen
2008-06-07 8:21 ` martin rudalics [this message]
2008-06-07 20:16 ` `split-window-preferred-horizontally' David Hansen
2008-06-08 13:07 ` `split-window-preferred-horizontally' martin rudalics
2008-06-08 17:49 ` `split-window-preferred-horizontally' David Hansen
2008-06-09 20:54 ` `split-window-preferred-horizontally' David Hansen
2008-06-10 7:54 ` `split-window-preferred-horizontally' martin rudalics
2008-06-10 14:27 ` `split-window-preferred-horizontally' Stefan Monnier
2008-06-07 1:44 ` `split-window-preferred-horizontally' Stefan Monnier
2008-06-07 2:29 ` `split-window-preferred-horizontally' Juanma Barranquero
2008-06-07 8:21 ` `split-window-preferred-horizontally' martin rudalics
2008-06-07 12:46 ` `split-window-preferred-horizontally' Juanma Barranquero
2008-06-07 14:41 ` `split-window-preferred-horizontally' martin rudalics
2008-06-07 8:21 ` `split-window-preferred-horizontally' martin rudalics
2008-06-07 18:23 ` `split-window-preferred-horizontally' Stefan Monnier
2008-06-07 14:36 ` `split-window-preferred-horizontally' martin rudalics
2008-06-07 18:33 ` `split-window-preferred-horizontally' Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=484A451C.2010408@gmx.at \
--to=rudalics@gmx.at \
--cc=david.hansen@gmx.net \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).