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

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

Re: Faces don't work in overlays


From: Stefan Monnier
Subject: Re: Faces don't work in overlays
Date: 17 Jul 2001 12:55:09 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.105

>>>>> "Pascal" == Pascal Wassong <address@hidden> writes:
>       (let ((eol-overlay (make-overlay arg (1+ arg))))
>       (overlay-put eol-overlay 'after-string "some text")
>       (overlay-put eol-overlay 'face 'font-lock-comment-face))
> I create an overlay and want to show it in a specific face.
> This does not work.

I don't know how many times, I've said it, but here it goes again:
"does not work" is not a useful description.

Anyway, using my crystal ball, I suspect that the face is correctly
applied to the text between arg and arg+1 but that you'd like it to apply
to the after-string instead.  If so, then you want to do

   (let ((ol (make-overlay arg (1+ arg)))
         (str "some text"))
     (put-text-property 0 (length str) 'face 'font-lock-comment-face str)
     (overlay-put ol 'after-string str))


-- Stefan



reply via email to

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