bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#27103: Should show-trailing-whitespace highlight specified spaces?


From: Eli Zaretskii
Subject: bug#27103: Should show-trailing-whitespace highlight specified spaces?
Date: Sat, 27 May 2017 21:26:14 +0300

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 via email to

[Prev in Thread] Current Thread [Next in Thread]