Closed cpitclaudel closed 1 week ago
Not sure. I'm no elisp expert, but a brief look made it seem as though only the face can be changed with font lock.
I like the idea, though.
I like the idea, though.
Cool :) It's definitely feasible, and it should be pretty easy. Font-lock supports arbitrary text properties, not just face; Look at prettify-symbols-mode
, nameless
, or glasses-mode
for examples.
From the docs:
font-lock-keywords is a variable defined in ‘font-lock.el’.
...
Documentation:
A list of the keywords to highlight.
...
MATCH-HIGHLIGHT should be of the form:
(SUBEXP FACENAME [OVERRIDE [LAXMATCH]])
...
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. In
such a case, you will most likely want to put those properties in
‘font-lock-extra-managed-props’ or to override
‘font-lock-unfontify-region-function’.
I will. Thanks for the pointer.
Great, thanks!
I am closing this as beyond the scope of the package, but thanks for the suggestion.
Could this be integrated with font-lock? Numbers would be given a display property that adds the separators, without actual modifications to the buffer.