Constant_Try_2065 · 2022-12-31 16:15
I found that org-mode has `org-quote`, `org-verse,` and `org-block` (default for all other faces) faces.
I want to create faces for `#+begin_notes`, and `#+begin_comment` blocks.
I know how to create faces using `defface`, but I do not know how to integrate it with org-mode.
yantar92 · 2022-12-31 18:38
Just create `org-block-<block_name>` face. In your case, `org-block-notes`. I am not sure if you can do it for comment blocks.
Constant_Try_2065 · 2022-12-31 19:41
sorry, does not seem to work. Here is my code:
`(defface org-block-notes`
`'((t :foreground "#F2666C"`
`))`
`"face notes block"`
`)`
yantar92 · 2022-12-31 19:48
You also need to add "notes" to `org-protecting-blocks` (this will no longer be needed in future).
Constant_Try_2065 · 2022-12-31 19:55
sorry, still no luck. I tried this:
`(add-to-list 'org-protecting-blocks "notes")`
yantar92 · 2022-12-31 20:35
Hmm. You are right. I forgot that this feature is only available in not-yet-released patch. Then, you have to use font-lock-keywords directly before the new fontification system lands upstream.
github-alphapapa · 2022-12-31 21:25
BTW, it's really cool how these features in Org are becoming more modularized and configurable. Thanks for your work on this.
Constant_Try_2065 · 2022-12-31 21:52
Thank you for your time.
Can you please give me an example? I am not familiar with font-lock-keywords.