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

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

Re: narrow color bar using display properties


From: Michael Heerdegen
Subject: Re: narrow color bar using display properties
Date: Tue, 05 Mar 2013 15:33:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

Eric Abrahamsen <eric@ericabrahamsen.net> writes:

> I've got my cursor-type set to a colored bar, and looking at it today I
> thought it would be very nice if I could create a similar effect with
> code: presumably using text properties (I'm guessing the display
> property) to lay a bar of color (either background color or a
> transparent foreground color) over existing text, only a couple of
> pixels wide and aligned left, without otherwise disturbing the placement
> of the text beneath.
>
> Right now the most promising approach seems to be the image display
> property (presumably I could use the :data specification just to draw a
> block of colored pixels), except that if I understand it correctly that
> will replace the underlying text, not add to it.
>
> Does anyone have advice on achieving this?

You may want to try using faces using the stipple attribute (see (elisp)
Face Attributes) and use them in text properties or overlays.

Using stipple is easy, e.g. like this:

  (defface test '((t (:stipple "hlines2"))) "Doc...")

The downside: stipple doesn't work in Windows AFAIK.


Regards,

Michael.



reply via email to

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