all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Alex <agrambot@gmail.com>
Cc: 28771@debbugs.gnu.org
Subject: bug#28771: 26.0.60; A couple space display property feature requests
Date: Tue, 10 Oct 2017 22:12:39 +0300	[thread overview]
Message-ID: <83k202q0k8.fsf@gnu.org> (raw)
In-Reply-To: <87tvz6dh26.fsf@gmail.com> (message from Alex on Tue, 10 Oct 2017 11:54:41 -0600)

> From: Alex <agrambot@gmail.com>
> Cc: 28771@debbugs.gnu.org
> Date: Tue, 10 Oct 2017 11:54:41 -0600
> 
> 1. There is currently no robust way to specify a pixel width to the
>    center or left/right edge of the text area in the 'space' display spec.

There's some kind of miscommunication here.  For starters, what do you
mean by "text area"?  For me, "text area" is the area of the window
inside the fringes, see the definition in "(elisp)Frame Layout".  But
you must mean something else, because with my interpretation,
specifying pixel width of the text area makes no sense: it is
determined by the window dimensions.

>    This is because there's no way to tell what's before the left edge of
>    the text area. If there's a left-side scroll-bar, then its width
>    should be included; but if it's on the right, its width shouldn't be.

This is only true for a header-line and mode-line, right?  Because the
rest of the window lines don't change their alignment when the scroll
bar switches sides, as their pixel count starts where the left fringe
ends, whether or not there's a scroll bar to the left of the fringe.

>    As for an example, try this in a graphical emacs -Q:
> 
> (setq header-line-format
>       (propertize
>        (concat (propertize " "
>                            'display
>                            '(space :align-to 0))
>                "Test"
>                (propertize " "
>                            'display
>                            '(space :width (+ left-fringe left-margin))))
>        'face 'highlight))
> 
>   
>    By default, the spaces before and after test are equally sized.

Again, there's some misunderstanding here, because this example shows
"Text" in the header-line flushed all the way to the left, with only
one space before "Test", to account for the left fringe (if I turn off
fringe-mode, that space disappears).  That's not what you are
describing, so I guess the example needs some change?

>    if you disable fringe-mode or enable margins (e.g. linum-mode), the
>    spaces are equal. However, try setting the scroll-bar to appear on
>    the left. Now, the left space is noticeably bigger than the right.

And again, this is limited to header-line, right?

> 2. Suppose you want to align a string to the right edge of the window.

What is "the right edge of the window" in this context?

> Can you put overlays in the header-line?

No, header-line (as any other Lisp string) can only have text
properties.

> That's my use-case at the moment.

If you are talking only about header lines, maybe the solution (if we
need one) doesn't have to be such a general one.  Are there similar
problems with other lines in a window?

> Is there currently no display spec that allows for appending/prepending
> (or would it be hard to add)?

Appending/prepending what and to what kind of text/object?  Sorry,
maybe it's too late, but I have trouble following your
descriptions :-(






  reply	other threads:[~2017-10-10 19:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-10  0:20 bug#28771: 26.0.60; A couple space display property feature requests Alex
2017-10-10  2:02 ` Alex
2017-10-10  6:47 ` Eli Zaretskii
2017-10-10 17:54   ` Alex
2017-10-10 19:12     ` Eli Zaretskii [this message]
2017-10-10 21:27       ` Alex
2017-10-11 12:59         ` Eli Zaretskii
2017-10-11 15:37           ` 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=83k202q0k8.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=28771@debbugs.gnu.org \
    --cc=agrambot@gmail.com \
    /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.