在的.emacs我添加鏈接ORG-文件ORG-議程文件
(org-agenda-files (quote ("d:/GTD/a.org" "d:/GTD/b.org" "d:/GTD/c.org")))
在這三種文件,我可以有鏈接到其他組織文件。是否有可能(使用當前的緩衝區)掃描a.org,b.org,c.org並添加鏈接到org-agenda-files?
更新1
有一種可能性。鏈接文件位於幾個定義良好的文件夾中。在How to add .org files under org-directory to agenda是如何添加所有文件的說明。有什麼方法可以將僅鏈接到a.org,b.org,c.org?中的鏈接添加到組織機構的議程文件中。
更新2
我不知道爲什麼,但功能的增加(互動)之後,在Emacs變得可見。該函數的全碼:
(defun add-links-to-org-agenda-files()
(interactive)
(org-element-map
(org-element-parse-buffer)
'link
(lambda (x)
(if (equal (org-element-property :type x) "file")
(add-to-list 'org-agenda-files (org-element-property :path x))))))
問候
Krzysiek
重新:交互式 - 一個交互功能(也叫做「命令」)可使用'的Mx command'被執行,而一個非交互功能只能使用'M-被執行:(功能)' - 看到的Emacs Lisp手冊瞭解更多細節,特別是[本節](https://www.gnu.org/software/emacs/manual/html_node/elisp/Using-Interactive.html#Using-Interactive)和[這個SO問題](http ://stackoverflow.com/questions/12585670/relationship-between-emacs-functions-and-commands)。 – Nick