From: martin rudalics <rudalics@gmx.at>
To: rms@gnu.org
Cc: Lennart Borgman <lennart.borgman@gmail.com>, emacs-devel@gnu.org
Subject: Re: moving window handling into lisp
Date: Fri, 21 Aug 2009 14:40:49 +0200 [thread overview]
Message-ID: <4A8E95D1.7050009@gmx.at> (raw)
In-Reply-To: <E1MeHqT-00033U-1j@fencepost.gnu.org>
> One of the benefits of moving window resizing into Lisp
> is that people will be able to easiy try out various different
> ways of doing it. So we need not try to decide the best way
> by a discussion about abstractions now.
>
> It will be possible to have different resizing strategies for
> different situations, too. Responding to a window manager need not be
> the same as responding to the user's dragging a boundary.
Currently, resizing a window W vertically is implemented by the
following routines:
- `enlarge_window' resizes W by stealing/giving space from/to windows
above and/or below W and may delete windows when they get too small.
`enlarge_window' does it's job by always calling `set_window_height'
(see below) with the NODELETE argument 0 so it essentially always gets
it's job done. Note that `enlarge_window' is the routine implementing
the commands `enlarge-window' and `shrink-window' so the majority of
Emacs' window resizing operations is done here.
- `set_window_height' deletes windows when called by `enlarge_window'
and display initialization (but this should hardly matter) and
currently tries to not delete windows when called by the frame
resizing routines (unless there's no other way because the windows
won't fit). Generally, `set-window_height' only serves as an
interface to `size_window' (see below).
- `size_window' is the basic resizing routine. It currently can either
delete other windows unconditionally, delete other windows only when
they shrink below `window-min-height', or delete them when they shrink
to zero. It apparently doesn't handle fixed-size windows correctly
and does a poor job re-resizing windows.
- `adjust_window_trailing_edge' resizes W by stealing/giving space
from/to the window below W and does not delete windows when they get
too small. `adjust_window_trailing_edge' is used when dragging a
modeline or vertical divider and calls size_window with the NODELETE
argument 0. Due to its ability to not delete any windows it's also
called by `balance-windows-area'. To avoid that a window gets deleted
it saves and restores window-configuration but this could be likely
resolved by having it call size_window with NODELETE non-zero. Due to
the bug in `size_window', `adjust_window_trailing_edge' doesn't handle
fixed-size windows correctly.
- `delete_window' resizes either the sibling above or below W and is not
allowed to delete other windows. So inherently `delete_window' is not
able to handle fixed-size windows correctly even if size_window were.
- `split-window' resizes only W (where W is the window that shall be
split) and does not delete any other window. Currently,
`split-window' is trivial because it operates on leaf windows only.
As a consequence, you can, for example, never create a full-width
window in a frame with two side-by-side windows without deleting one
of these windows first which I consider a considerable drawback. If
`split-window' were allowed to split internal windows, some more
intelligent resizing routine would be needed.
- `resize_mini_window' shrinks windows above W (where W is the
minibuffer window) using a routine called `shrink_window_lowest_first'
which does not delete windows. `resize_mini_window' can also enlarge
other windows by calling `enlarge_window' which should not delete any
window (but I'm not 100% sure about that). Also `resize_mini_window'
saves the original sizes of windows shrunk/enlarged in the
`orig_total_lines' and `orig_top_line' slots and uses these to restore
the original values when it's job is done (something like a built-in
version of saving and restoring the window configuration)
With the exception of `resize_mini_window' similar behaviors apply for
resizing W horizontally.
Even if we don't implement resizing in Elisp the following issues have
not been discussed yet:
- Whether resizing may delete other windows depends on the interface to
size_window chosen. We can easily make `enlarge-window' not delete
other windows by giving it an optional `no-delete' argument. It's not
clear though whether `size_window' does handle the NODELETE argument
always correctly.
- Many parts of Emacs might rely on the ability of `enlarge-window' to
delete other windows. (It's hard to say which because there are too
many.) So some intelligent way of deleting other windows might be
needed anyway if we wanted `enlarge-window' to not delete any windows.
- Ideally, we would have one function doing the job of `size_window' and
that function could be used by `resize_mini_window' as well. That
function would probably take all the arguments `size_window' currently
does. And that function would have to handle fixed-size windows
correctly and re-resize windows using David's fractional heights and
widths.
martin
next prev parent reply other threads:[~2009-08-21 12:40 UTC|newest]
Thread overview: 130+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-07-27 8:32 moving window handling into lisp Miles Bader
2009-07-27 13:37 ` martin rudalics
2009-07-27 13:41 ` Lennart Borgman
2009-07-27 13:45 ` martin rudalics
2009-07-27 13:58 ` Lennart Borgman
2009-07-27 14:35 ` martin rudalics
2009-07-27 14:41 ` Lennart Borgman
2009-07-27 15:02 ` martin rudalics
2009-07-27 15:28 ` Lennart Borgman
2009-07-27 16:52 ` martin rudalics
2009-07-27 16:58 ` Lennart Borgman
2009-07-27 18:18 ` Stefan Monnier
2009-07-28 7:38 ` martin rudalics
2009-07-28 9:39 ` Lennart Borgman
2009-07-28 12:25 ` martin rudalics
[not found] ` <e01d8a50907280532kcff2d1w15567a430668a502@mail.gmail.com>
2009-07-28 13:23 ` martin rudalics
2009-07-28 13:44 ` Lennart Borgman
2009-07-29 9:04 ` martin rudalics
2009-07-28 13:47 ` Stefan Monnier
2009-07-28 14:11 ` Lennart Borgman
2009-07-29 9:05 ` martin rudalics
2009-07-29 14:05 ` Stefan Monnier
2009-08-01 2:20 ` Miles Bader
2009-08-03 21:29 ` Stefan Monnier
2009-08-11 9:18 ` martin rudalics
2009-08-11 19:16 ` Stefan Monnier
2009-08-11 19:29 ` Lennart Borgman
2009-08-12 8:57 ` martin rudalics
2009-08-12 9:02 ` Lennart Borgman
2009-08-12 13:33 ` martin rudalics
2009-08-12 15:57 ` Lennart Borgman
2009-08-12 17:05 ` martin rudalics
2009-08-12 19:39 ` Lennart Borgman
2009-08-12 21:10 ` Lennart Borgman
2009-08-13 9:55 ` martin rudalics
2009-08-13 9:57 ` Lennart Borgman
2009-08-13 10:25 ` Lennart Borgman
2009-08-13 11:32 ` Lennart Borgman
2009-08-13 12:49 ` Lennart Borgman
2009-08-13 13:56 ` martin rudalics
2009-08-13 16:43 ` Lennart Borgman
2009-08-13 18:07 ` martin rudalics
2009-08-14 1:13 ` Lennart Borgman
2009-08-14 7:18 ` martin rudalics
2009-08-14 11:21 ` Lennart Borgman
2009-08-14 13:21 ` martin rudalics
2009-08-12 8:56 ` martin rudalics
2009-08-13 2:32 ` Stefan Monnier
2009-08-13 9:54 ` martin rudalics
2009-08-13 17:00 ` Stefan Monnier
2009-08-13 18:09 ` martin rudalics
2009-08-14 1:47 ` Stephen J. Turnbull
2009-08-14 7:17 ` martin rudalics
2009-08-14 6:42 ` Richard Stallman
2009-08-14 7:18 ` martin rudalics
2009-08-14 20:56 ` Richard Stallman
2009-08-15 10:12 ` martin rudalics
2009-08-15 19:47 ` Stefan Monnier
2009-08-14 15:39 ` Stefan Monnier
2009-08-14 15:42 ` Lennart Borgman
2009-08-14 18:26 ` Stefan Monnier
2009-08-15 10:12 ` martin rudalics
2009-08-15 11:02 ` Lennart Borgman
2009-08-15 12:44 ` martin rudalics
2009-08-15 13:35 ` David Kastrup
2009-08-15 13:39 ` Lennart Borgman
2009-08-15 16:11 ` martin rudalics
2009-08-15 16:19 ` Lennart Borgman
2009-08-15 17:37 ` martin rudalics
2009-08-15 18:18 ` Lennart Borgman
2009-08-16 10:25 ` martin rudalics
2009-08-16 11:14 ` Lennart Borgman
2009-08-16 12:12 ` David Kastrup
2009-08-16 12:19 ` Lennart Borgman
2009-08-16 15:17 ` martin rudalics
2009-08-16 16:15 ` David Kastrup
2009-08-16 19:24 ` martin rudalics
2009-08-16 12:17 ` martin rudalics
2009-08-16 12:26 ` Lennart Borgman
2009-08-16 15:18 ` martin rudalics
2009-08-15 19:05 ` Stephen J. Turnbull
2009-08-16 10:26 ` martin rudalics
2009-08-16 11:16 ` Lennart Borgman
2009-08-16 12:17 ` martin rudalics
2009-08-16 12:29 ` Lennart Borgman
2009-08-16 15:18 ` martin rudalics
2009-08-16 14:49 ` Stephen J. Turnbull
2009-08-16 15:31 ` martin rudalics
2009-08-16 16:28 ` Stephen J. Turnbull
2009-08-16 19:25 ` martin rudalics
2009-08-15 15:07 ` Jan Djärv
2009-08-15 15:38 ` David Kastrup
2009-08-15 16:07 ` martin rudalics
2009-08-15 18:21 ` Stephen J. Turnbull
2009-08-16 10:25 ` martin rudalics
2009-08-15 19:51 ` Stefan Monnier
2009-08-16 10:26 ` martin rudalics
2009-08-16 11:18 ` Lennart Borgman
2009-08-16 12:17 ` martin rudalics
2009-08-16 12:30 ` Lennart Borgman
2009-07-27 14:00 ` Miles Bader
2009-07-27 14:36 ` martin rudalics
[not found] ` <4A87F8B8.6050102@gmx.at>
[not found] ` <e01d8a50908160523r12216cffm34060d2793943785@mail.gmail.com>
[not found] ` <4A882312.6020106@gmx.at>
[not found] ` <e01d8a50908191816p2d9e978dw6aa0623c79dd8699@mail.gmail.com>
[not found] ` <4A8D12B3.6070502@gmx.at>
[not found] ` <e01d8a50908200219o69f67900lb9fa9368e9aadf62@mail.gmail.com>
[not found] ` <4A8D46C9.1010108@gmx.at>
[not found] ` <e01d8a50908200622y101e5b2bq9fb5874cbb8c81fe@mail.gmail.com>
[not found] ` <4A8D66D5.3000600@gmx.at>
2009-08-20 15:41 ` Lennart Borgman
2009-08-20 18:15 ` martin rudalics
2009-08-20 23:08 ` Lennart Borgman
2009-08-21 12:40 ` martin rudalics
2009-08-21 13:58 ` Lennart Borgman
2009-08-22 11:00 ` martin rudalics
2009-08-22 13:45 ` Lennart Borgman
2009-08-22 14:17 ` martin rudalics
2009-08-21 19:34 ` Stefan Monnier
2009-08-22 11:01 ` martin rudalics
2009-08-21 0:19 ` Richard Stallman
2009-08-21 12:40 ` martin rudalics [this message]
-- strict thread matches above, loose matches on Subject: below --
2009-08-17 19:06 grischka
2009-08-18 7:13 ` martin rudalics
2009-08-18 11:38 ` Lennart Borgman
2009-08-19 9:15 ` grischka
2009-08-19 12:45 ` martin rudalics
2009-08-20 11:45 ` grischka
2009-08-20 12:51 ` martin rudalics
2009-08-20 13:05 ` David Kastrup
2009-08-20 15:08 ` martin rudalics
2009-08-20 19:35 ` grischka
2009-08-21 12:22 ` martin rudalics
2009-08-21 19:32 ` Stefan Monnier
2009-08-22 4:55 ` Stephen J. Turnbull
2009-08-23 1:01 ` Stefan Monnier
2009-08-24 13:10 ` grischka
2009-08-19 13:01 ` Lennart Borgman
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=4A8E95D1.7050009@gmx.at \
--to=rudalics@gmx.at \
--cc=emacs-devel@gnu.org \
--cc=lennart.borgman@gmail.com \
--cc=rms@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.