org-search-view中添加已归档文件
Often, the set of files one would like to search by keyword is larger than one's set of active agenda files. For instance, one might archive old projects in separate files so that they no longer contribute to the agenda. Yet one would still like to search the reference material in these projects by keyword/regexp.
The solution lies in the variable org-agenda-text-search-extra-files. Adding a list of files to this variable instructs org-search-view to query those files in addition to the agenda files. Note that setting org-agenda-text-search-extra-files has no effect on other types of agenda commands, such as todo and tags/property searches.
参考文档,需要配置org-agenda-text-search-extra-files变量。并且该变量只对org-search-view函数生效。另外可以使用org-archive-location指定归档位置和文件名。
(setq org-agenda-text-search-extra-files (append (directory-files (expand-file-name "~/org/archive/") "full-name" "\\.org_archive$") (directory-files (expand-file-name "~/Work/360/AndroidProject/archive/") "full-name" "\\.org_archive$") )) (setq org-archive-location (concat "archive/archive-" (format-time-string "%Y%m" (current-time)) ".org_archive::"))