all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 29279@debbugs.gnu.org, joostkremers@fastmail.fm
Subject: bug#29279: Sharing the margins
Date: Wed, 15 Nov 2017 23:49:05 +0200	[thread overview]
Message-ID: <9bbfd79b-9e80-db5a-fe57-d0d629477d5d@yandex.ru> (raw)
In-Reply-To: <83a7znjuc5.fsf@gnu.org>

On 11/15/17 8:00 PM, Eli Zaretskii wrote:

>>> Yes, but "being the rightmost" might mean "being right next to the
>>> text", for whatever purposes.
>>
>> So far, I doubt it's going to come up as a real, hard requirement. But
>> we'll probably see.
> 
> I could think of something similar to overlay-arrow, only using the
> margin.  Such a feature will want the arrow to be as close to buffer
> text as possible.

Yeah, OK.

>> If not, let's put all padding on the outside and be done with that concern.
> 
> This is doable, but the implementation will be more complex.
> Remember: the display engine lays out stuff left to right.  So padding
> what's left after we are done with all of the "columns" is easy;
> padding _before_ requires that you either compute all the widths in
> advance, or that you come back after laying out the columns and insert
> the stretch before it, moving all the glyphs to the right.

Sounds straightforward to me. Since we know the sizes of all the columns 
in advance, we can just substract them from the target total width, and 
pad with the resulting number of spaces.

Having extra padding between columns (your original idea) would be more 
complex to implement, IIUC.

>>> Again, as long as the text-area dimensions didn't change, it could be
>>> argued that the hook shouldn't run.
>>
>> That's some creative nomenclature lawyering. :-)
> 
> It isn't.  It's just how the implementation works.

Still. To the user, the line numbers column is more like an extra margin 
than anything else.

Further, even though we have a separate accessor for its width 
(line-number-display-width), if a package depends on it and needs to 
draw something based on its value, it should want to be notified when 
there is a change (*). window-configuration-change-hook seems natural. 
Unless we have a separate hook for that?

>> OK then, what's the practical problem with saying that margins are also
>> part of "text-area dimensions"?
> 
> It's hard to implement.  window-configuration-change-hook currently
> runs from functions that change window dimensions or the buffer
> displayed in it; those never run inside redisplay.  What you (and some
> others) propose will have to run in the middle of redisplaying a
> window, and who knows what running arbitrary Lisp at that point will
> or could do?

Not necessarily. Can't you save the necessary data to a variable, finish 
redisplay, and then run the hook (if the data says so)?

> In addition, it will require us to record somewhere (probably, in the
> window object) the last used width for number display, so we could
> compare that with the new one.  This is not as simple as it sounds,
> because most redisplay cycles avoid redrawing the entire window, so
> determining just where in the code to perform this comparison is a
> non-trivial decision.

*resigned shrug*

> So I'd like to avoid this if possible.

It's somewhat hypothetical, but I'd like to refer to (*) above. That is, 
somebody will probably ask for that anyway, sooner or later.





  reply	other threads:[~2017-11-15 21:49 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
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 [this message]
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=9bbfd79b-9e80-db5a-fe57-d0d629477d5d@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=29279@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    --cc=joostkremers@fastmail.fm \
    /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.