all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: David Edmondson <dme@dme.org>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Chong Yidong <cyd@stupidchicken.com>, Miles Bader <miles@gnu.org>
Cc: 10395@debbugs.gnu.org
Subject: bug#10395: 24.0.92; line-prefix text inherits face properties from the preceding line	rather than following text
Date: Sat, 31 Dec 2011 16:09:41 +0200	[thread overview]
Message-ID: <83obuosuhm.fsf@gnu.org> (raw)
In-Reply-To: <cunaa6csw15.fsf@hotblack-desiato.hh.sledj.net>

> From: David Edmondson <dme@dme.org>
> Date: Wed, 28 Dec 2011 12:47:18 +0000
> 
> If a line-prefix property is added to a region of a buffer, the
> displayed line-prefix region inherits the face properties from the
> preceding line rather than from the first character on the line, except
> if the region so propertised starts at the beginning of the
> buffer.

As I suspected, this happens simply because we don't change the face
used for display until we process the first character that has a
different face, in this case the first character on the line.

It is possible to change that, but we need to decide first whether the
current behavior is wrong or not.

IOW, why would the user expect that the line-prefix be rendered using
the face that begins _after_ the prefix?  This would be unlike
anything else in the Emacs display operation.  Is this case really
different?  What if the different face starts on some character that
is not the line's first character -- would you, David, expect the
line-prefix use that different face? if not, why do so when the
different face begins at the line's beginning?

Conceptually, a line-prefix and wrap-prefix are just display strings,
only specified differently.  They therefore behave just like display
strings, in that they inherit the face of the _preceding_ text.  If
you don't want that, you will have to specify face properties for the
line-prefix.  (This is, btw, the workaround for the problem you had.)

So my vote is to leave this as it works now, and maybe document this
to avoid surprises.

If the decision is nevertheless to change the behavior as David
expected, then we need to consider additional issues/complications:

 . what, if anything, should we do with wrap-prefix? should it also
   "inherit" the face of the first character of the continuation line?

 . would the result look as TRT when bidirectional text is involved?
   If the line with a prefix begins with right-to-left text, the first
   character of the line will not be the first (leftmost) character on
   display, while the leftmost character on display might then have a
   face that is different from that of line-prefix, which will look
   odd to say the least.

 . should this "inheritance" be limited to faces, or should other text
   properties behave like that as well? e.g., what about `mouse-face'
   or `pointer' properties?

Comments are welcome.





  parent reply	other threads:[~2011-12-31 14:09 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-12-28 12:47 bug#10395: 24.0.92; line-prefix text inherits face properties from the preceding line rather than following text David Edmondson
2011-12-29 14:02 ` Eli Zaretskii
2011-12-31 14:09 ` Eli Zaretskii [this message]
2012-01-03 10:15   ` David Edmondson
2012-01-03 11:12     ` Eli Zaretskii
2012-01-07  7:30   ` Chong Yidong
2012-01-07  8:12     ` Eli Zaretskii
2012-03-22  7:32     ` Chong Yidong
2012-03-22 17:11       ` 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=83obuosuhm.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=10395@debbugs.gnu.org \
    --cc=cyd@stupidchicken.com \
    --cc=dme@dme.org \
    --cc=miles@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.