From mboxrd@z Thu Jan 1 00:00:00 1970 From: Christian Moe Subject: Re: how to include items (filtered) from other org files? Date: Thu, 04 Aug 2011 10:26:37 +0200 Message-ID: <4E3A57BD.7000201@christianmoe.com> References: <3C5C49D0-44E9-4F0D-A37C-9C7D74A05514@gilbert.org> Reply-To: mail@christianmoe.com Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([140.186.70.92]:44541) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QotD2-0007k5-4O for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 04:23:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QotD0-0005RP-NA for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 04:23:16 -0400 Received: from mail-forward2.uio.no ([129.240.10.71]:60894) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QotD0-0005L5-BP for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 04:23:14 -0400 Received: from exim by mail-out2.uio.no with local-bsmtp (Exim 4.75) (envelope-from ) id 1QotCO-0000ac-IP for emacs-orgmode@gnu.org; Thu, 04 Aug 2011 10:22:36 +0200 In-Reply-To: <3C5C49D0-44E9-4F0D-A37C-9C7D74A05514@gilbert.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Michael Gilbert Cc: emacs-orgmode Mailinglist 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 > > > >