all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Keith David Bershatsky <esq@lawlist.com>
Cc: emacs-devel@gnu.org
Subject: Re: Placing eol glyph (buffer-display-table) before an overlay after-string.
Date: Sat, 12 Aug 2017 09:56:26 +0300	[thread overview]
Message-ID: <83efshqnol.fsf@gnu.org> (raw)
In-Reply-To: <m2shgxfh2w.wl%esq@lawlist.com> (message from Keith David Bershatsky on Fri, 11 Aug 2017 23:14:31 -0700)

> Date: Fri, 11 Aug 2017 23:14:31 -0700
> From: Keith David Bershatsky <esq@lawlist.com>
> 
> Is it feasible to reverse the order such that the eol glyph is laid before the overlays containing the after-string property?

Not really.  The Emacs display engine considers a screen line ended at
the last glyph before the newline, disregarding the source of that
newline, which could be buffer text, a display or overlay string, or a
display table.  When the display engine finds itself at the end of a
screen line, it performs a set of bookkeeping operations and decisions
that are important for text layout, and must be done immediately prior
to the layout of the next screen line.  Displaying anything after that
bookkeeping, or somehow deferring this bookkeeping to later, would
need extensive changes in what is already very complex piece of code,
which handles several important issues, like
overflow-newline-into-fringe.  Current code assumes that no glyphs are
produced on the current screen line after the end-of-line was
consumed.

> A hint as to the locations (in the C code) where I would start working on reversing the order would be greatly appreciated.

There are 2 places: one in display_line, the other
move_it_in_display_line_to and move_it_to.  In all of those places,
look for uses of the macro ITERATOR_AT_END_OF_LINE_P.

Once again, I advise against such changes.

> If there is a better way to handle this than trying to reverse the order in which things are happening, any insight would be helpful.

Something like the workaround you use now:

> WORKAROUND:  I have been using a custom XPM image of a pilcrow that is the beginning of the after-string, and I change its coloration (foreground/background) as needed.  The problem with this approach is that the XPM does not look as good as a native eol glpyh, and the XPM would need to be adjusted depending upon the font and size of the font.

Why not use the real pilcrow character, e.g. as display string on the
first character of your overlay string?



  reply	other threads:[~2017-08-12  6:56 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-08-12  6:14 Placing eol glyph (buffer-display-table) before an overlay after-string Keith David Bershatsky
2017-08-12  6:56 ` Eli Zaretskii [this message]
2017-08-12  9:26 ` Yuri Khan
2017-08-12  9:52   ` Eli Zaretskii
2017-08-12 10:18     ` Yuri Khan
2017-08-12 10:32       ` Eli Zaretskii
  -- strict thread matches above, loose matches on Subject: below --
2017-08-12 19:03 Keith David Bershatsky

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=83efshqnol.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=esq@lawlist.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.