Mikhail Skorzhinskii <mskorzhins...@eml.cc> writes:

> Here is the snippet I am currently using to export all subtress directly
> tagged with :info: to the separate file. (Sorry for the lack of proper
> parametrisation).
>
> #+begin_src emacs-lisp
> (defun org-user/store-info ()
>   (let ((file "~/org/cals/info.org")
>         (heading (org-format-outline-path (org-get-outline-path t))))
>     (save-excursion
>       (org-copy-subtree)
>       (find-file file)
>       (end-of-buffer)
>       (org-paste-subtree)
>       (org-edit-headline heading))))
>
> (defun org-user/export-info ()
>   "Export all information entries into one file."
>   (find-file "~/org/cals/info.org")
>   (erase-buffer)
>   (insert "#+TITLE: Information")
>   (org-ql-select
>     (org-agenda-files)
>     '(tags-local "info")
>     :action #'org-user/store-info)
>   (save-buffer))
> #+end_src

Thanks, Mikhail, it's like you read my mind.  :)


Reply via email to