在议程视图中匹配属性 [英] matching property in agenda view
问题描述
我想要收集并创建一个包含标题的块,标题中只有ID属性。
I want collect and create a block containing headlines which only has "ID" property in the headlines.
ie要过滤的标题看起来像
i.e The headlines to be filtered looks like
* Headline
:PROPERTIES:
:ID: my-id
:END:
我正在使用以下代码配置不起作用的自定义议程命令
I am using the following code to configure the custom agenda command which does not work
(setq org-agenda-custom-commands
'(("c" "MY Agenda"
((tags "ID")))))
我已阅读组织手册 http://orgmode.org/manual/Matching-tags-and- properties.html#Matching-tags-and-properties ,但仍然无法弄清楚如何做到。
I have read the org manual http://orgmode.org/manual/Matching-tags-and-properties.html#Matching-tags-and-properties but still unable to figure out how to do it.
推荐答案
您的代码就是要求它找到所有标题为:ID:
ta在标题上。要查找属性,您必须使用链接的手册页上列出的属性匹配功能。
Your code as such is asking it to find all headlines that have a :ID:
tag on the headline. To look for properties you have to use the property match feature which is listed a bit lower on the linked manual page.
由于我假设您需要匹配任何ID,而不仅仅是一个特定的ID,您必须使用正则符号匹配( =
)或不匹配(<> / code>)正则表达式后面是大括号。
Since I'm assuming you need it to match any ID and not just a specific ID you'll have to use the regexp matching by either matching (=
) or not matching (<>
) the regexp that follows in curly brackets.
要匹配您的ID属性,您需要正则表达式为 ID = {+}
。如果您使用。*
作为匹配,它也将匹配标题,没有任何ID属性。如果您有一些要匹配的ID,那么您可以调整正则表达式来匹配它们。
To match your ID property you'll need the regexp to be ID={.+}
. If you used .*
as the match it would also match headlines without any ID property. If you have some a set of IDs you want to match that have something in common you can adjust the regexp to match them.
所以你的自定义议程命令必须是:
So your custom agenda command will have to be:
(setq org-agenda-custom-commands
'(("c" "MY Agenda"
((tags "ID={.+}")))))
这篇关于在议程视图中匹配属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!