如何将org文件夹中的.org文件添加到议程中 [英] How to add .org files under org-directory to agenda
问题描述
我正面临以下问题:组织模式具有可定制的变量 org-agenda-files
。此变量下的绝对路径列出的文件用于构建组织议程窗口。如果列表中的元素是一个目录,则处理与 org-agenda-regex
匹配的所有 .org
文件被处理建立议程视图。另一方面,还有另一个可自定义的变量: org-directory
。令人震惊的是,如果 org-agenda-files
未定义,则议程视图不会尝试使用匹配的 .org
org-directory
下的文件。另外,不接受在 org-agenda-files
中列出议程文件相对于 org-directory
的路径,因为它抱怨文件没有找到。
I am facing the following problem: Org mode has the customizable variable org-agenda-files
. The files listed by absolute path under this variable are used for building the org agenda window. If an element in the list is a directory, then all .org
files matching the org-agenda-regex
are processed to build the agenda view. On the other hand there is also another customizable variable: org-directory
. Shockingly though, if org-agenda-files
is undefined, the agenda view does not try to use the matching .org
files under org-directory
. Also, listing the paths of the agenda files relative to org-directory
in org-agenda-files
is not accepted, as it complains that the files are not found.
我的问题是,有一个相当优雅的方式来使用 org-directory
查询议程文件,通过使用它作为默认查找所有.org文件,或者描述具有相对路径 org-directory
?
My question is, is there an reasonably elegant way to make use of the org-directory
in the lookup of agenda files, either by using it as the default to look for all .org files, or to describe the agenda files list with relative paths to org-directory
?
推荐答案
其实刚刚设法让它按照我想要的方式工作。所以这是相关的配置代码应该如下所示:
Actually just managed to get it working the way I wanted. So this is how the relevant config code should look like:
(custom-set-variables
'(org-directory "~/Documents/org")
'(org-agenda-files (list org-directory)))
这样一来,议程将从组织目录
下的所有 .org
文件中读取,当 org-directory
更改它时。只是我正在寻找;)
This way the agenda reads from all .org
files under the org-directory
, and when org-directory
changes it follows it. Just what I was looking for ;)
这篇关于如何将org文件夹中的.org文件添加到议程中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!