From: Joost Kremers <joostkremers@fastmail.fm>
To: Eli Zaretskii <eliz@gnu.org>
Cc: rudalics@gmx.at, emacs-devel@gnu.org
Subject: Re: Window splitting issues with margins
Date: Mon, 16 Nov 2015 17:56:55 +0100 [thread overview]
Message-ID: <87mvudlw6g.fsf@fastmail.fm> (raw)
In-Reply-To: <836112c554.fsf@gnu.org>
On Mo, Nov 16 2015, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: Joost Kremers <joostkremers@fastmail.fm>
>> Date: Sat, 14 Nov 2015 21:34:09 +0100
>> Cc: martin rudalics <rudalics@gmx.at>, emacs-devel@gnu.org
>>
>> It's just that I think both issues could be solved by the same
>> mechanism: allowing a (minor) mode to lock the margins to a certain
>> minimum width. window-splittable-p could then assume that those parts of
>> the margins that are not locked can be reduced along with the text area,
>> unlike now, where the underlying assumption seems to be that if the
>> margins are > 0, there's probably a reason for it and they shouldn't be
>> reduced.
>>
>> At the same time, it would allow linum-mode and writeroom-mode to play
>> nice together: instead of setting the margin to the size it requires for
>> line numbers, linum-mode could set a minimum size, allowing other
>> packages to make them wider. writeroom-mode then would not be allowed to
>> set margins to less than the minimum size.
>
> But this will only work in a very special case: when only one mode
> actually displays something in the margin. Once another mode wants to
> put something there, all bets are off. Right?
Yes, but isn't that currently the case as well?
Of course, to do it right, you'd have to come up with a scheme that
allows any number of modes to play nice. Perhaps a function
`add-to-window-margin N SYM' that a mode can use to add N columns to the
margin and have SYM added as a property of some sort or a window
parameter indicating which column(s) were added, and a similar function
`remove-from-window-margin SYM', which removes those columns again.
Modes could then manage their own part of the margins without stomping
on other modes. (A mode would simply request a number of columns, it
wouldn't need to know if it gets columns 1-4, or 5-6, etc., although it
could find that out by examining the SYM property/parameter.) Columns
that have such an associated SYM property are not considered reducible
by `window-splittable-p'.
It would still have to be possible for modes like writeroom-mode to set
the margin to a specific width without setting a property, but those
margins would be considered reducible by `window-splittable-p'.
Furthermore, it shouldn't be possible to set a width that is smaller
than what other modes have set. This could either be enforced by the API
or writeroom-mode would have to ensure this itself.
Anyway, it seems something similar is being discussed in the thread on
the linum patch, although as a more general option.
--
Joost Kremers
Life has its moments
next prev parent reply other threads:[~2015-11-16 16:56 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-11-12 13:04 Window splitting issues with margins Joost Kremers
2015-11-12 14:31 ` martin rudalics
2015-11-12 16:28 ` Eli Zaretskii
2015-11-12 21:38 ` Joost Kremers
2015-11-13 8:04 ` martin rudalics
2015-11-13 8:40 ` Eli Zaretskii
2015-11-13 10:01 ` martin rudalics
2015-11-13 13:54 ` Eli Zaretskii
2015-11-13 14:53 ` martin rudalics
2015-11-13 18:34 ` Eli Zaretskii
2015-11-12 22:14 ` Joost Kremers
2015-11-13 8:04 ` martin rudalics
2015-11-13 8:43 ` Eli Zaretskii
2015-11-13 10:02 ` martin rudalics
2015-11-14 20:34 ` Joost Kremers
2015-11-16 15:53 ` Eli Zaretskii
2015-11-16 16:56 ` Joost Kremers [this message]
2015-11-16 18:56 ` martin rudalics
2015-11-16 20:11 ` Joost Kremers
2015-11-17 8:35 ` martin rudalics
2015-11-19 13:46 ` Joost Kremers
2015-11-20 8:21 ` martin rudalics
2015-11-25 13:10 ` Joost Kremers
2015-11-24 12:59 ` Joost Kremers
2015-11-24 19:26 ` martin rudalics
2015-11-25 19:53 ` Joost Kremers
2015-11-26 8:23 ` martin rudalics
2015-11-26 15:46 ` Eli Zaretskii
2015-11-26 16:58 ` martin rudalics
2015-11-26 17:13 ` Eli Zaretskii
2015-11-26 18:04 ` martin rudalics
2015-11-26 18:32 ` Eli Zaretskii
2015-11-27 8:26 ` martin rudalics
2015-11-27 9:00 ` Eli Zaretskii
2015-11-28 10:22 ` martin rudalics
2015-11-28 11:13 ` Eli Zaretskii
2015-11-14 20:47 ` Joost Kremers
2015-11-16 17:02 ` John Wiegley
2015-11-16 10:51 ` Yuri Khan
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=87mvudlw6g.fsf@fastmail.fm \
--to=joostkremers@fastmail.fm \
--cc=eliz@gnu.org \
--cc=emacs-devel@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 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.