如何使自动添加到议程列表中的文件夹下的所有组织文件? [英] How to make all org-files under a folder added in agenda-list automatically?

查看:156
本文介绍了如何使自动添加到议程列表中的文件夹下的所有组织文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用组织模式编写笔记和组织议程来组织所有笔记,特别是搜索一些信息。通过关键字或标签

I am using org-mode to write notes and org-agenda to organize all notes, especially to search some info. by keyword or tag.

Cc am 可以按照输入的标签搜索一些文件, Cc为但是,我需要手动将组织文件添加到议程列表中。

C-c a m can search some files by tag inputed, C-c a s by keyword ,those functions from org-agenda are well to utilize, however, I need to add org-file into the agenda-list by hand.

我将一些代码添加到 .emacs ,例如

I added some codes into .emacs, such as

(setq org-agenda-files (list "path/folder/*.org"))

(setq org-agenda-files (file-expand-wildcards "path/folder/*.org"))

但是,无法自动将指定到议程列表的文件夹下添加文件,因此我无法在这些组织文件中搜索关键字或标签,除非我打开组织文件并输入 Cc [将其添加到议程列表中。

but, both failed to add files under the folder specified into agenda-list automatically, so I can't search keyword or tag among those org-files, unless that I open a org-file and type C-c [ to add it into agenda-list.

如何使文件夹中的所有组织文件自动添加到议程中?

How can I make all org-files under a folder automatically added in agenda?

推荐答案

只需命名目录即可。例如,这对我来说很好:

Just naming the directory should be enough. For example this works for me very well:

(setq org-agenda-files '("~/org"))

另外看一下 org-agenda-文本搜索额外文件;它允许您
添加额外的文件仅包括在文本搜索。一个典型的值可能是
be,

Also take a look at org-agenda-text-search-extra-files; it lets you add extra files included only in text searches. A typical value might be,

(setq org-agenda-text-search-extra-files
      '(agenda-archives
        "~/org/subdir/textfile1.txt"
        "~/org/subdir/textfile1.txt"))

编辑:要在附加文件列表中包含具有一定扩展名的所有文件,您可以尝试功能 sa-find-org-file -recursively 我写了一段时间。你可以这样使用:

To include all files with a certain extension in the extra files list you can try the function sa-find-org-file-recursively I wrote sometime back. You can use it like this:

(setq org-agenda-text-search-extra-files
      (append (sa-find-org-file-recursively "~/org/dir1/" "txt")
              (sa-find-org-file-recursively "~/org/dir2/" "tex")))

警告:如果您添加文件在启动
Emacs之后,它将不会被包含。

Caveat: If you add a file to the directory after you have started Emacs, it will not be included.

这篇关于如何使自动添加到议程列表中的文件夹下的所有组织文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆