Hi,
If I understand you correctly, you want to import into your current
Org document tasks from other Org files that match a certain tag.
Here's one attempt; I'm sure there are better solutions, and solutions
involving Agenda commands, which I don't understand very well.
Assuming all items are in agenda files: Evaluate the following, place
point where you want the items, then call my/org-import-tasks and
answer "nnpublish" at the prompt.
#+begin_src emacs-lisp
(defun my/org-import-tasks (match)
"Import tasks with MATCH from all agenda files into present
buffer at point."
(interactive "MMatch: ")
(let ((files (org-agenda-files))
(this (current-buffer)))
(while files
(find-file (car files))
(org-map-entries
(lambda ()
(org-copy-subtree)
(with-current-buffer this (yank)))
match)
(kill-buffer)
(setq files (cdr files)))))
#+end_src
Yours,
Christian
On 8/4/11 2:40 AM, Michael Gilbert wrote:
Hi —
Here's my challenge:
I manage a lot of complex, overlapping projects. One of these
projects is a regular newsletter. Half of the content that goes out
in this newsletter is created by the newsletter program itself. The
other half is the result of several other projects, which produce
reports and articles that get published in the newsletter. The
publishing task in all those other projects are tagged with an
'nnpublish' tag.
I want to be able to work on the newsletter project in one place. I
don't want to maintain duplicate tasks in wildly different places.
(You can imagine how out of hand this would get.) What I want to do
is INCLUDE all of the other publishing tasks programmatically in
the org file that I use to manage the newsletter. I am completely
stymied as to how to do this.
The only information that I've had a change to look at that touches
on the matter of including other files is in section 11.4 of the
manual. If I'm not mistaken, it applies only to export. And the
only processing that can be applied to the file being included is a
limitation on which lines to include. Unless I'm missing something,
this isn't going to meet my needs. I'm wondering if perhaps I need
to be looking at code blocks. Maybe something that uses agenda code
to grab items and then renders them in place. Oh hell, I don't
know.
I'm pretty lost as to how to pursue this. Any thoughts?
TIA!
— Michael