From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29279@debbugs.gnu.org
Subject: bug#29279: Sharing the margins
Date: Mon, 13 Nov 2017 19:54:45 +0200 [thread overview]
Message-ID: <bcfec133-44a0-cc87-1966-5f6f862bbf01@yandex.ru> (raw)
In-Reply-To: <83375imbaa.fsf@gnu.org>
On 11/13/17 5:46 PM, Eli Zaretskii wrote:
> I tend to like better the proposal originally made by Joost Kremers in
> http://lists.gnu.org/archive/html/emacs-devel/2015-11/msg01540.html.
> Here it is with slight variations of my own:
Overall, it seems like a friendlier API over fairly similar structures
as what I suggested (just replace left-margin-columns-alist with
left-margin-params). Except SYMBOL is not given a meaningful name (they
are "columns" in my description).
> We add 3 new functions:
>
> (defun window-margin-add (window side symbol cols &optional ordinal)
> "Request allocation of COLS columns of WINDOW's marginal area.
> WINDOW must be a live window and defaults to the selected one.
> SIDE is the window side, either `left' or `right', in whose margin
> the allocation is requested.
> SYMBOL identifies the request, in case the allocation needs to be
> changed or deleted.
> ORDINAL is the optional ordinal number of the requested area, counted
> from left to right. Negative ordinal numbers count from right to
> left. Zero means the value of COLS is the maximum width of the
> marginal area, and no separate allocation is requested.
ORDINAL meaning the same as "order priority"? And the lower the value
is, the more "left" the column should be positioned? Sounds OK to me.
I'm not sure I understand the "Zero means ..." passage, though.
In addition to signifying a neutral position, does it supposed to switch
the meaning of this function into something that
set-right-margin/set-left-margin can call, for backward compatibility?
Seems like a wart, using ORDINAL this way. And what's going to happen
when somebody else calls window-margin-add with non-zero ORDINAL? Will
the end result depend on which call happens first?
> Value is the actual positive ordinal number of the allocated area."
Return value?
> If the stuff (text, image, etc.) to be displayed in a specified
> portion of the marginal area is too wide and doesn't fit the width of
> the portion, it will be truncated; if it is narrower, it will be
> padded.
Padded from the left or from the right? :)
> This keeps the display engine design intact, and I think will allow
> relatively straightforward implementation (although some non-trivial
> changes in management of the glyph matrices will be necessary). It
> can also be implemented in a way that keeps backward compatibility
> with the current APIs.
>
> WDYT?
Aside from the ORDINAL edge case, it sounds good to me.
Here's an interesting question: after such an API is added, will it be
feasible to re-implement display-line-numbers-mode using a margin
column, instead of the special separate area?
And if not, how can we make this API better that you could?
next prev parent reply other threads:[~2017-11-13 17:54 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-12 23:51 bug#29279: Sharing the margins Dmitry Gutov
2017-11-13 15:43 ` Eli Zaretskii
2017-11-13 17:24 ` Dmitry Gutov
2017-11-13 18:15 ` Eli Zaretskii
2017-11-13 19:02 ` Dmitry Gutov
2017-11-13 19:22 ` Eli Zaretskii
2017-11-13 19:33 ` Dmitry Gutov
2017-11-13 15:46 ` Eli Zaretskii
2017-11-13 17:54 ` Dmitry Gutov [this message]
2017-11-13 18:29 ` Eli Zaretskii
2017-11-13 19:16 ` Dmitry Gutov
2017-11-13 19:32 ` Eli Zaretskii
2017-11-13 21:16 ` Dmitry Gutov
2017-11-14 15:30 ` Eli Zaretskii
2017-11-14 22:39 ` Dmitry Gutov
2017-11-15 3:42 ` Eli Zaretskii
2017-11-15 14:23 ` Dmitry Gutov
2017-11-15 18:00 ` Eli Zaretskii
2017-11-15 21:49 ` Dmitry Gutov
2017-11-16 15:50 ` Eli Zaretskii
2017-11-18 23:55 ` Dmitry Gutov
2017-11-19 15:34 ` Eli Zaretskii
2017-11-20 22:23 ` Dmitry Gutov
2017-11-21 15:40 ` Eli Zaretskii
2017-11-15 18:51 ` martin rudalics
2017-11-15 20:03 ` Eli Zaretskii
2017-11-15 21:09 ` Dmitry Gutov
2017-11-16 15:39 ` Eli Zaretskii
2017-11-18 23:46 ` Dmitry Gutov
2017-11-19 15:30 ` Eli Zaretskii
2017-11-19 0:47 ` Joost Kremers
2017-11-19 9:20 ` Dmitry Gutov
2017-11-14 9:54 ` martin rudalics
2017-11-14 15:51 ` Eli Zaretskii
2017-11-15 18:50 ` martin rudalics
2017-11-14 9:54 ` martin rudalics
2017-11-14 15:51 ` Eli Zaretskii
2017-11-14 18:30 ` martin rudalics
2017-11-14 19:05 ` Eli Zaretskii
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=bcfec133-44a0-cc87-1966-5f6f862bbf01@yandex.ru \
--to=dgutov@yandex.ru \
--cc=29279@debbugs.gnu.org \
--cc=eliz@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.