Nicolas Martyanoff on Nostr: TIL that to use a face (e.g. created with DEFFACE) in FONT-LOCK-KEYWORDS (#Emacs), ...
TIL that to use a face (e.g. created with DEFFACE) in FONT-LOCK-KEYWORDS (#Emacs), you need to declare a binding whose value is the name of the face. So for a face named FOO-FACE, just add (DEFVAR FOO-FACE 'FOO-FACE). This happens because Font Lock expects faces in FONT-LOCK-KEYWORDS lists to be symbol whose value is the face to use.
I would love to know why Font Lock cannot realize that the symbol is the name of a face and use it directly.
Published at
2025-03-15 22:33:26Event JSON
{
"id": "8252af55c26cbb1875bf7bcc5ac28b1425ac48ade8e7be6c244dc46ab54a4fd7",
"pubkey": "6d91e7b056ab18986298e04a8b278a5e070a726487fd30a599427c79db9070e9",
"created_at": 1742078006,
"kind": 1,
"tags": [
[
"t",
"emacs"
],
[
"proxy",
"https://fosstodon.org/users/galdor/statuses/114168824239686146",
"activitypub"
]
],
"content": "TIL that to use a face (e.g. created with DEFFACE) in FONT-LOCK-KEYWORDS (#Emacs), you need to declare a binding whose value is the name of the face. So for a face named FOO-FACE, just add (DEFVAR FOO-FACE 'FOO-FACE). This happens because Font Lock expects faces in FONT-LOCK-KEYWORDS lists to be symbol whose value is the face to use.\n\nI would love to know why Font Lock cannot realize that the symbol is the name of a face and use it directly.",
"sig": "8c599f40d7d88e2064366bfc72cd31fe11a9024828e5bff033f94f633b20d08c8aa0fde3a40f65c6c7c4a92d18024299f0c3e29d283096808f8970028f71229e"
}