emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Adam Porter <adam@alphapapa.net>
To: emacs-orgmode@gnu.org
Subject: Re: Exporting agendas as org-mode files?
Date: Thu, 14 Nov 2019 06:03:25 -0600	[thread overview]
Message-ID: <87y2wiu0ky.fsf@alphapapa.net> (raw)
In-Reply-To: 87a790uj9m.fsf@eml.cc

Mikhail Skorzhinskii <mskorzhinskiy@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	other threads:[~2019-11-14 12:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 15:46 Exporting agendas as org-mode files? John Sturdy
2019-11-13  2:50 ` Adam Porter
2019-11-13 11:07   ` Mikhail Skorzhinskii
2019-11-14 12:03     ` Adam Porter [this message]
2019-11-18 12:11     ` John Sturdy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87y2wiu0ky.fsf@alphapapa.net \
    --to=adam@alphapapa.net \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).