all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alex <agrambot@gmail.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: help-gnu-emacs@gnu.org
Subject: Re: Using :align-to with non-spaces
Date: Tue, 10 Oct 2017 18:41:35 -0600	[thread overview]
Message-ID: <871smacy80.fsf@gmail.com> (raw)
In-Reply-To: <83bmlepya4.fsf@gnu.org> (Eli Zaretskii's message of "Tue, 10 Oct 2017 23:01:55 +0300")

Eli Zaretskii <eliz@gnu.org> writes:

>> Right, I misspoke. What would be nice is to have the above 'align-to
>> display property prepend a stretch space that ends at an :align-to
>> expression.
>
> Then the stretch would have no buffer/string position on it, and the
> code which processes glyphs would become more complex.  IMO, the gain
> is too small to justify the complexity.

Sure, it's not worth it if the solution is complex.

>> I would consider it not recognizing {line,wrap}-prefix to be a bug as
>> well (either in behaviour or documentation).
>
> Everything in the text area counts: images, stretches, line numbers,
> etc.  This was always so, since Emacs 21.

Hmm, then I think that "(elisp) Pixel Specification" should include more
elements to account for these.

>> > The "text area" is everything inside the fringes/display margins
>> > (whichever comes last), so it includes the space used for the
>> > line-number display.
>> 
>> >From a user perspective, I don't think the prefix/line-numbers should be
>> considered as part of the text area.  At the very least, not the
>> line-numbers.
>
> That's your linum-mode experience talking ;-)  It takes time to get
> used to a different view of this.

I suppose so.

Still, I think that if it's not considered as part of the "text area",
then there should be some notion of `text area modulo
prefix/line-numbers' that :align-to/:width (and other parts of display,
perhaps) could use.

Then, I believe the default offset in "(elisp) Pixel Specification"
should be changed to the start of this construct (i.e., column 0). I
believe it would be a more user-friendly default.

>> > The solution I can suggest is to use the value returned by
>> > line-number-display-width.
>> 
>> Right, but shouldn't it be recomputed at the same times that the other
>> element's widths are (i.e., toggling display-line-numbers should
>> automatically change the display width of relevant :align-to/:width
>> spaces)?
>
> We discussed that briefly on emacs-devel, and decided not to, mainly
> due to the line/wrap-prefix precedent.  I still don't see any reason
> to revise that decision, the few problems that are caused for that
> were solved relatively easily.

What do you mean by "that"? I don't recall a discussion on this; the
closest I could find was:
https://lists.gnu.org/archive/html/emacs-devel/2017-06/msg00525.html

I think we misunderstand each other here (see below).

>> So even if `left' doesn't mean column 0 (I find this poor behaviour,
>> though), then one can use `(:align-to (+ left prefix)' or something of
>> the sort to always mean column 0, even if there are
>> prefixes/line-numbers displayed.
>
> I think you underestimate the number of different "things" that could
> precede the leftmost text character.  We have so many display features
> that can put stuff to the left of the leftmost character that we will
> have hard time deciding what should and shouldn't be considered
> 'prefix'.  It is easier to write a function that computes their
> summary width, if that's what you need.

Wouldn't anything between the left fringe and column 0 be considered
"prefix"?

Any "thing" that is in this area and applies to all lines should be
accounted for in "(elisp) Pixel Specification", IMO.

> More generally, doing layout in Lisp (which is what I think you are
> trying) isn't easy, and was never supposed to be.  It is better to
> extend the display engine to do layout for you, if that makes sense.

There appears to be some miscommunication here; I thought I was arguing
to extend the display engine (i.e., adding new values for `space'
display specifications).



  reply	other threads:[~2017-10-11  0:41 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-09  5:22 Using :align-to with non-spaces Alex
2017-10-10  6:40 ` Eli Zaretskii
2017-10-10 18:09   ` Alex
2017-10-10 18:27     ` Eli Zaretskii
2017-10-10 19:18       ` Alex
2017-10-10 20:01         ` Eli Zaretskii
2017-10-11  0:41           ` Alex [this message]
2017-10-11 10:38             ` Eli Zaretskii
2017-10-12  0:47               ` Stefan Monnier
2017-10-12  7:10                 ` 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=871smacy80.fsf@gmail.com \
    --to=agrambot@gmail.com \
    --cc=eliz@gnu.org \
    --cc=help-gnu-emacs@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.