It does work - but your MATCHER
is not correct - the result of the match is not stored. This, for example does not work:
(font-lock-add-keywords
nil '(("goodbye lenin"
(0 (progn (put-text-property (match-beginning 1) (match-end 1)
'display "GL")
nil)))))
while this does:
(font-lock-add-keywords
nil '(("\\(goodbye lenin\\)"
. (progn (put-text-property (match-beginning 1) (match-end 1)
'display "GL")
nil))))
The documentation says: "FACENAME
is an expression whose value is the face name to use.
Instead of a face, FACENAME
can evaluate to a property list
of the form (face FACE PROP1 VAL1 PROP2 VAL2 ...)
in which case all the listed text-properties will be set rather than
just FACE
."
Here, the FACENAME
expression (progn
) evaluates to nil
, so no properties or faces are being set - the only effect that caused by put-text-property
.