In .emacs I have
(org-agenda-files (quote ("d:/GTD/a.org" "d:/GTD/b.org" "d:/GTD/c.org")))
In this three file I can have links to other org files. Is it possible (on the fly, using current buffers) scan a.org, b.org, c.org and add links to org-agenda-files?
Update 1.
There is one possibility. Linked files are in several well-defined folders. On How to add .org files under org-directory to agenda is instructions on how to add all file. Is there any way to add to the org-agenda-files only those that are linked in a.org, b.org, c.org?.
Update 2.
I don't know why, but function became visible in emacs after the addition of (interactive). Full code of that function:
(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))))))
Regards
Krzysiek