最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

emacs - Highlight org-heading depending on the content of its :PROPERTIES: - Stack Overflow

programmeradmin3浏览0评论

It would be useful to highlight any -heading if its :PROPERTIES: block contains property with certain names.

So in my case need visually separate class names from instances (memebers of class) in -subtree.

So if any -heading of the file contains property into :PROPERTIES: with names such as :subClassOf: or :equivalentTo: such headings should be highlighted.

Simpliest example.

* Fruits
:PROPERTIES:
:CREATED:  [2025-04-01 Tue 22:43]
:END:
+----------highlighted---------------+
|** Apple                            |
|:PROPERTIES:                        |
|:CREATED:  [2025-04-01 Tue 22:43]   |
|:subClassOf: Fruits                 |
|END:                                |
+------------------------------------+
*** Red tasteful apple
:PROPERTIES:
:CREATED:  [2025-04-01 Tue 22:44]
:END:
*** Green apple
:PROPERTIES:
:CREATED:  [2025-04-01 Tue 22:44]
:END:

+-----------highlighted------------+
|** Orange                         |
|:PROPERTIES:                      |
|:CREATED:  [2025-04-01 Tue 22:43] |
|:equivalentTo: Fruits             |
|END:                              |
+---------------------------------+
*** average orange
:PROPERTIES:
:CREATED:  [2025-04-01 Tue 22:46]
:END:

*** asian orange
:PROPERTIES:
:CREATED:  [2025-04-01 Tue 22:46]
:END:

From example Apple and Orange -headings with our targeted property names :equivalentTo: ; :subClassOf:. They are classes of fruits and should be highlighted.

Some similar answer is about highlighting heading depending on its level not property.

发布评论

评论列表(0)

  1. 暂无评论