emacs-devel
[Top][All Lists]
Advanced

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

Re: Idea: Allow faces to have text-like properties


From: Kim F. Storm
Subject: Re: Idea: Allow faces to have text-like properties
Date: 28 Feb 2002 14:15:31 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.2.50

Per Abrahamsen <address@hidden> writes:

> Couldn't the same effect be achieved if font lock used categories
> instead of faces?  
> 

You are right.  That is the generic (i.e. proper) approach to doing
this.


Actually, the changes needed to change font-lock to use categories
instead of faces seem to be fairly trivial, if we do it like this
(illustrated by font-lock-comment-face):

(defface font-lock-comment-face ...)  ;; as now

(defvar font-lock-comment-face 'font-lock-comment-face)   ;; as now

(put 'font-lock-comment-face 'face font-lock-comment-face) ;; new

and then replace all

( .... 'face font-lock-comment-face)

with

( .... 'category 'font-lock-comment-face)

[this is an oversimplification as the properties are not
set in that way ... but I hope you get the idea].


However, the problem with this approach is that setting the
font-lock-comment-face variable to another face is not reflected in
the `face' property of font-lock-comment-face, so it will not longer
have any effect.   Any ideas how to overcome that problem?

-- 
Kim F. Storm <address@hidden> http://www.cua.dk




reply via email to

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