unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: martin rudalics <rudalics@gmx.at>
Cc: Juri Linkov <juri@jurta.org>, rms@gnu.org, emacs-devel@gnu.org
Subject: Re: split-window-preferred-function
Date: Wed, 02 Apr 2008 11:18:26 -0400	[thread overview]
Message-ID: <jwvve305mnd.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <47F34982.2000706@gmx.at> (martin rudalics's message of "Wed, 02 Apr 2008 10:53:22 +0200")

>> This change could involve exposing whatever else is needed.
> I'm not yet sure how to handle the following two:
> 		  || (NILP (XWINDOW (window)->parent))

Wouldn't that be something like one-window-p ?

> and

> 	  if (!NILP (XWINDOW (window)->prev))
> 	    other = upper = XWINDOW (window)->prev;
> 	  if (!NILP (XWINDOW (window)->next))
> 	    other = XWINDOW (window)->next, upper = window;
>           ...

This part of code needs a comment explaining what is the use of `upper'
(i.e. why is enlarge_window called on `upper' rather than on `window'
(or `other')).

> I initially planned to use `window-edges' to check whether two windows
> are "arrayed" in some sense.  That's not quite accurate when window
> edges match but the involved windows have different parents.  Hence
> enlarge_window could affect other windows and the overall behavior of
> `display-buffer' might change.

Indeed, it's a problem.  Maybe a good solution is to change the
behavior: if you can't tell which if (next-window) is "->next" or not
just by looking at window-edges, then the user probably can't either, so
the current behavior (which depends on such a distinction) is not
great anyway.  Better would be to take all windows in a sequence of
next-window/previous-window which (according to window-edges) are
"siblings", and then rebalance them all.

> XEmacs handles this by exposing `window-parent', `window-next', ... to
> Elisp.  This would, however, contradict the Emacs ideology that Elisp
> code should never see a non-leaf window.  In particular, we would have
> to rewrite things like `adjust-window-trailing-edge' which currently
> chokes on non-leaf windows.

Of course, we can also expose window-next without exposing
window-parent, so we still only expose non-leaf windows.


        Stefan






  parent reply	other threads:[~2008-04-02 15:18 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-19 21:42 split-window-preferred-function martin rudalics
2008-03-20 23:02 ` split-window-preferred-function Juri Linkov
2008-03-21  1:47   ` split-window-preferred-function Stefan Monnier
2008-03-22  1:07     ` split-window-preferred-function Juri Linkov
2008-03-22 16:36       ` split-window-preferred-function Stefan Monnier
2008-03-23  2:16         ` split-window-preferred-function Juri Linkov
2008-03-27 23:44         ` split-window-preferred-function Juri Linkov
2008-03-28 19:50           ` split-window-preferred-function martin rudalics
2008-03-29  0:45             ` split-window-preferred-function Juri Linkov
2008-03-29  9:05               ` split-window-preferred-function martin rudalics
2008-03-29 12:30                 ` split-window-preferred-function Juri Linkov
2008-03-29 13:25                   ` split-window-preferred-function martin rudalics
2008-03-29 19:42                   ` split-window-preferred-function Stefan Monnier
2008-03-30  5:49                   ` split-window-preferred-function Richard Stallman
2008-04-02  8:53                     ` split-window-preferred-function martin rudalics
2008-04-02  9:36                       ` split-window-preferred-function Tassilo Horn
2008-04-02  9:58                         ` split-window-preferred-function martin rudalics
2008-04-02 10:30                           ` split-window-preferred-function Tassilo Horn
2008-04-02 12:13                             ` split-window-preferred-function martin rudalics
2008-04-02 12:33                               ` split-window-preferred-function Tassilo Horn
2008-04-02 22:26                         ` split-window-preferred-function David De La Harpe Golden
2008-04-02 15:18                       ` Stefan Monnier [this message]
2008-04-02 17:00                         ` split-window-preferred-function martin rudalics
2008-04-02 22:27                       ` split-window-preferred-function Juri Linkov
2008-04-03  6:49                         ` split-window-preferred-function martin rudalics
2008-04-03 22:52                           ` split-window-preferred-function Juri Linkov
2008-04-04  6:50                             ` split-window-preferred-function martin rudalics
2008-04-03  7:02                         ` split-window-preferred-function Tassilo Horn
2008-04-03 22:54                           ` split-window-preferred-function Juri Linkov
2008-04-04 10:04                             ` split-window-preferred-function Tassilo Horn
2008-04-04 12:19                               ` split-window-preferred-function martin rudalics
2008-04-04 12:57                                 ` split-window-preferred-function Tassilo Horn
2008-04-04 13:55                               ` split-window-preferred-function Stefan Monnier
2008-04-04 17:21                                 ` split-window-preferred-function Tassilo Horn
2008-04-04 20:21                                   ` split-window-preferred-function Stefan Monnier
2008-04-04 22:14                                     ` split-window-preferred-function Tassilo Horn
2008-04-04 23:52                                       ` split-window-preferred-function Stefan Monnier
2008-03-21  9:18   ` split-window-preferred-function martin rudalics
2008-03-22  1:09     ` split-window-preferred-function Juri Linkov
  -- strict thread matches above, loose matches on Subject: below --
2008-04-05 12:36 split-window-preferred-function grischka
2008-04-05 15:42 ` split-window-preferred-function martin rudalics
2008-04-05 18:35   ` split-window-preferred-function grischka
2008-04-05 22:02     ` split-window-preferred-function martin rudalics
2008-04-06 16:45       ` split-window-preferred-function grischka
2008-04-06 20:35   ` split-window-preferred-function Juri Linkov

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=jwvve305mnd.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    --cc=juri@jurta.org \
    --cc=rms@gnu.org \
    --cc=rudalics@gmx.at \
    /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).