unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Tassilo Horn <tassilo@member.fsf.org>
To: emacs-devel@gnu.org
Subject: Re: Patch: prefer-window-split-horizontally
Date: Thu, 16 Aug 2007 16:37:34 +0200	[thread overview]
Message-ID: <87zm0rwno1.fsf@baldur.tsdh.de> (raw)
In-Reply-To: A47B192B0358794C958615D788BF7FB703C40A3C@mucmail1.sdm.de

<klaus.berndl@sdm.de> writes:

Hi Klaus,

>>> If all/most current callers of this function would rather have it
>>> stay the way it is and if all callers that want it changed do not
>>> call it directly (or call it interactively), then we're better off
>>> changing the other place where split-window is called (i.e.
>>> display-buffer) or creating a new function.
>> 
>> I cannot follow you completely.  In most cases it's not the caller
>> who should decide how windows are split but the user, who wants to
>> use his screen as good as possible.
>> 
>> Beside Gnus and ECB I don't know any packages that have to care of
>> how windows have to be split.  And at least for Gnus I can say that
>> it does the split using all params `split-window' has, and thus
>> `split-window-function' wouldn't be used.
>
> If it's usefull for you, i can check this for ECB - can you please
> repeat exactly what i have to check! Then i can do this at weekend...

I suggested to change `split-window' so that it splits in a way the user
can configure by setting `split-window-function' to a function that
returns a symbol naming a function that should do the split, if and only
if split-window is called with zero or one (the WINDOW) argument.  So
calls to `split-window' that rely on the current behavior (that the
split will be vertically) are forced to use the additional parameters.

So if ECB relies on the current behavior, calls like

   (split-window window)

might not do what you expect if the user configured
`split-window-function'.

I grepped ECB's code and there are at least 4 places that would need to
be adapted.

./ecb-layout.el:2213:                       (setq window (split-window window))
./ecb-layout.el:2227:                           (setq window (split-window window)))
./ecb-layout.el:2955:                    (split-window (car (ecb-canonical-edit-windows-list)))))
./ecb-layout.el:2991:                    (split-window (car edit-win-list)))))
./ecb-layout.el:3757:   (call-interactively 'split-window)))

BTW: I see a problem with my approach.  I guess in elisp the calls

     (split-window window)

and

     (split-window window nil nil)

are equal and you cannot distinguish if nil was given explicitly or not,
right?

So maybe the HORFLAG argument should be changed to FLAG with possible
values 'horizontal and 'vertical, defaulting to 'horizontal.  I guess
that wouldn't break most current packages, because you normally wouldn't
give all args if they're nil.  Of course, calls like

     (split-window window size (want-horiz))

where the FLAG is calculated would need to be checked.

Bye,
Tassilo

  reply	other threads:[~2007-08-16 14:37 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-14 16:34 Patch: prefer-window-split-horizontally Tassilo Horn
2007-08-14 16:51 ` Tassilo Horn
2007-08-15 18:22   ` Richard Stallman
2007-08-15 18:47     ` Tassilo Horn
2007-08-16  2:42       ` Richard Stallman
2007-08-16  5:52         ` Tassilo Horn
2007-08-14 20:47 ` Juri Linkov
2007-08-15  5:35   ` Tassilo Horn
2007-08-15 15:24     ` Davis Herring
2007-08-15 15:49       ` Tassilo Horn
2007-08-15 18:22   ` Richard Stallman
2007-08-15 18:57     ` Tassilo Horn
2007-08-15 19:35   ` Stefan Monnier
2007-08-15 19:53     ` Tassilo Horn
2007-08-15 20:31       ` Stefan Monnier
2007-08-16  6:28         ` Tassilo Horn
2007-08-16 13:11           ` Stefan Monnier
2007-08-16 13:38             ` Tassilo Horn
2007-08-16 14:00               ` klaus.berndl
2007-08-16 14:37                 ` Tassilo Horn [this message]
2007-08-16 14:34               ` Stefan Monnier
2007-08-16 14:52                 ` Tassilo Horn
2007-08-16 15:46                   ` klaus.berndl
2007-08-15 23:36     ` Juri Linkov
2007-08-16  0:45       ` Stefan Monnier
2007-08-16 20:21         ` Juri Linkov
2007-08-16  2:42       ` Richard Stallman
2007-08-16 20:23         ` Juri Linkov
2007-08-15  5:52 ` Dieter Wilhelm
2007-08-15  6:27   ` Tassilo Horn

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=87zm0rwno1.fsf@baldur.tsdh.de \
    --to=tassilo@member.fsf.org \
    --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).