all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: "Clément Pit--Claudel" <clement.pitclaudel@live.com>
Cc: 27103@debbugs.gnu.org
Subject: bug#27103: Should show-trailing-whitespace highlight specified spaces?
Date: Sat, 27 May 2017 21:26:14 +0300	[thread overview]
Message-ID: <83poeugnqx.fsf@gnu.org> (raw)
In-Reply-To: <8b0fc51c-288c-cf31-1054-07bd13ce91a0@live.com> (message from Clément Pit--Claudel on Sat, 27 May 2017 12:47:40 -0400)

tags 27103 notabug
thanks

> From: Clément Pit--Claudel <clement.pitclaudel@live.com>
> Date: Sat, 27 May 2017 12:47:40 -0400
> 
> I'm trying to display "/// " comment markers as a thin vertical line. At first, I went for something like the following font-lock rule:
> 
>   '(face my-vertical-line-face display (space :width 0.5))
> 
> This worked fine, until I decided to add a fringe icon, too:
> 
>   '(face my-vertical-line-face display [(space :width 0.5) (left-margin left-arrow)])
> 
> Now (with show-trailing-whitespace set to t) Emacs highlight lines that just contain "///" in bright red.  Here's a quick way to reproduce this:
> 
>   (dotimes (_ 25) (insert (propertize "///" 'display '((space :width 10) (left-fringe left-arrow))) "\n"))
> 
> Contrast with this, which doesn't show trailing-whitespace highlights:
> 
>   (dotimes (_ 25) (insert (propertize "///" 'display '(space :width 10)) "\n"))
> 
> Am I doing something wrong?

I think you are hitting on undefined behavior: mixing different
replacing specs in the same display property is not generally
supported.

> Is there a way to disable the trailing whitespace highlighting here?

You could swap the order of 'space' and 'left-fringe' specs, but the
fact that this works is sheer luck, and I wouldn't recommend relying
on that.

The rule is to use at most one replacing spec in a display property.





  reply	other threads:[~2017-05-27 18:26 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27 16:47 bug#27103: Should show-trailing-whitespace highlight specified spaces? Clément Pit--Claudel
2017-05-27 18:26 ` Eli Zaretskii [this message]
2017-05-27 19:14   ` Clément Pit--Claudel
2017-05-27 19:42     ` Eli Zaretskii
2017-05-27 19:52       ` Clément Pit--Claudel
2017-05-28 16:28         ` Eli Zaretskii
2017-05-28 16:43           ` Clément Pit--Claudel
2017-05-28 17:44             ` Eli Zaretskii
2017-05-28 17:53               ` Clément Pit--Claudel
2017-05-28 18:14                 ` Eli Zaretskii
2017-05-28 19:43                   ` Clément Pit--Claudel
2017-05-28 19:51                     ` Eli Zaretskii
2017-05-28 20:18                       ` Clément Pit--Claudel
2017-05-29  2:30                         ` Eli Zaretskii
2017-05-29  2:33                           ` Clément Pit--Claudel
2017-05-29 17:28                             ` 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=83poeugnqx.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=27103@debbugs.gnu.org \
    --cc=clement.pitclaudel@live.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.