emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Better handling of window margins


From: Eli Zaretskii
Subject: Re: Better handling of window margins
Date: Fri, 04 Dec 2015 20:45:47 +0200

> From: Stefan Monnier <address@hidden>
> Cc: address@hidden
> Date: Fri, 04 Dec 2015 12:30:21 -0500
> 
> >> That's the point of having SIZING-DESCRIPTOR be a function: it receives
> >> a description of the margin chosen by "all other users" and adjusts it
> >> according to its own needs.
> > Then that function is not specific to any particular user of the margin,
> 
> To me it's obvious that it is specific.  So I think I lost you.

If the function needs to consider what other modes want, it is not
mode specific.  It should know enough about any other possible modes
that could need the margins.  Such functions should be provided by the
infrastructure, since no mode author is wiser than the Emacs
maintainers.

> Basically, package A uses the margin to place a few things in it.  So it
> needs a left margin that at least X pixels wide so its goodies
> are visible (i.e. its function will return the max between X and
> whatever else is decided).
> 
> Then comes package B which uses that same margin for other things of
> size Y.  Since its other things are placed elsewhere, it requests that
> the margin be the max of Y and whatever else is decided.
> 
> Then comes package C which adds something of size Z to every line in
> that same margin.  So it requests (with "depth") to be placed
> last, and its function returns the sum of Z and whatever else
> is decided.

My suggestion was to ask each package to provide 2 numbers, not one.
You provided only one for each package, so I don't know how to
interpret this within the model that I described.

(I also don't understand the "displayed elsewhere" part of package B.
What does "elsewhere" mean here?  Is that stuff displayed on the
margins or not?)

If you are saying that both numbers are the same for each of the
packages in your scenario, then the result under my suggestion will be
X+Y+Z, and we don't need to rely on any package for this wisdom, or
request them to understand how we allocate space for the margins.

> PS: Clearly, this is related to the issue of how to share the margin
> itself (rather than how to cooperate in setting the margin's width).

Under the model I suggested, the two parameters determine both the
margin width and how that width is shared.

> Currently, this is done arbitrarily by the display engine, but we should
> instead provide new functions which perform this combination in Elisp
> and then place a single `display' property for the margin.

How can you provide a single display property when the original
properties are in different buffer locations?  (I also don't
understand why should we bother to produce a single property, but
that's a separate issue.)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]