emacs-devel
[Top][All Lists]
Advanced

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

Re: Colour selection in shr


From: Wolfgang Jenkner
Subject: Re: Colour selection in shr
Date: Wed, 05 Nov 2014 12:40:40 +0100
User-agent: Gnus/5.130012 (Ma Gnus v0.12) Emacs/25.0.50 (berkeley-unix)

On Tue, Nov 04 2014, Stefan Monnier wrote:

>> Again, I have no idea what you mean by that.  How would you use
>> `font-lock-mode' to put colours on an HTML document based on CSS?
>
> I'm not suggesting to use font-lock-keywords to put the colors.
> I'm suggesting to use the `font-lock-mode' setting (a boolean variable)
> to decide whether to do highlighting or not.
>
> You could even do it dynamically/automatically by using the
> `font-lock-face' instead of the `face' property.

The thread was about turning off colours while preserving other face
attributes, I think.  But using `font-lock-face' for colour settings and
`face' for the rest doesn't work for this, viz. with the following code
snippet, "bar" appears underlined but not coloured.

(with-current-buffer (generate-new-buffer "*test*")
  (insert "foobarquux")
  (put-text-property 1 7 'face '(:underline t))
  (put-text-property 4 11 'font-lock-face '(:foreground "red"))
  (font-lock-mode)
  (pop-to-buffer (current-buffer)))

Wolfgang



reply via email to

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