Re: add linked files to agenda files

2020-11-16 Thread Alan Schmitt
Hello Nick,

On 2020-11-16 16:33, Nick Dokos  writes:

> Just guessing at this point, I would imagine you'd want something like
> this:
>
> --8<---cut here---start->8---
> (defun path-from-link (link)
>(org-element-property :path link))
>
> (setq org-agenda-files (with-current-buffer
>  (find-file-noselect "master.org")
>  (org-element-map (org-element-parse-buffer)
>   '(link)
>   #'path-from-link)))
> --8<---cut here---end--->8---

Thanks a lot, this is most useful! I did not think it could be this
simple.

Best,

Alan


signature.asc
Description: PGP signature


Re: add linked files to agenda files

2020-11-16 Thread Nick Dokos
Alan Schmitt  writes:

> Hello,
>
> I'm experimenting with a setup where each project is its own org file,
> and where I have a master file linking to active projects. How can I
> configure org to add every linked file of that master file to the
> org-agenda-files?
>

You'll probably have to write a custom function to do that, but it
depends on how exactly your master file is set-up, so providing some
details on that would help.

Just guessing at this point, I would imagine you'd want something like
this:

--8<---cut here---start->8---
(defun path-from-link (link)
   (org-element-property :path link))

(setq org-agenda-files (with-current-buffer
 (find-file-noselect "master.org")
 (org-element-map (org-element-parse-buffer)
  '(link)
  #'path-from-link)))
--8<---cut here---end--->8---

but the details might make a difference.

-- 
Nick

"There are only two hard problems in computer science: cache
invalidation, naming things, and off-by-one errors." -Martin Fowler




add linked files to agenda files

2020-11-14 Thread Alan Schmitt
Hello,

I'm experimenting with a setup where each project is its own org file,
and where I have a master file linking to active projects. How can I
configure org to add every linked file of that master file to the
org-agenda-files?

Thanks,

Alan


signature.asc
Description: PGP signature