[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Exporting agendas as org-mode files?
From: |
Adam Porter |
Subject: |
Re: Exporting agendas as org-mode files? |
Date: |
Thu, 14 Nov 2019 06:03:25 -0600 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.3 (gnu/linux) |
Mikhail Skorzhinskii <address@hidden> 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. :)