From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: add a whole directory as one item to refile targets Date: Mon, 12 Oct 2009 16:15:32 +0200 Message-ID: <657EC5D2-50AD-4A3A-B135-F0EC5984614C@gmail.com> References: <938fae2d0910041530v51cdaac4jb8db88b6cb1a8b56@mail.gmail.com> <938fae2d0910101448j2c39d67aw4950c7899c3307a1@mail.gmail.com> <87ocoeq4xw.fsf@gollum.intra.norang.ca> <938fae2d0910120648t5147b4d9y3339d3f06bc732e7@mail.gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MxLge-0002cD-Ie for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 10:15:44 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MxLgY-0002XG-AM for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 10:15:43 -0400 Received: from [199.232.76.173] (port=42717 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MxLgY-0002X7-0p for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 10:15:38 -0400 Received: from mail-ew0-f228.google.com ([209.85.219.228]:37989) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MxLgX-00052Z-HD for emacs-orgmode@gnu.org; Mon, 12 Oct 2009 10:15:37 -0400 Received: by ewy28 with SMTP id 28so16147743ewy.42 for ; Mon, 12 Oct 2009 07:15:36 -0700 (PDT) In-Reply-To: <938fae2d0910120648t5147b4d9y3339d3f06bc732e7@mail.gmail.com> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Eraldo Helal Cc: Bernt Hansen , Org-Mode On Oct 12, 2009, at 3:48 PM, Eraldo Helal wrote: >> What is Reference/ supposed to be in this case -- a directory? >> Refiling >> only works to headings (or top level headings) in files in org-mode >> IIRC. > Yes it is supposed to be a directory... > > I have org files in many directorys... about like so: > reference/emacs/emacs.org > reference/eros/eros.org > reference/Avalon/Avalon.org > reference/Gimp/Gimp.org > reference/office/office.org > reference/home/home.org > reference/poems/poems.org > ... > > What would be a smart way to get a headline from the file inbox.org > named "* Erich Fried poems" to poems.org? > Considering that poems.org is not part of the agenda nor a refile > target. Well, you need to make it a refile target, that is the whole point of defining refiling targets. If you want, you can make yourself a special refile function that temporarily installs a long list of files in org-refile-targets. You can use `let' to bind org-refile-targets, and directory-files to get the files. For example (untested) (defun my-refile-to-reference () (interactive) (let ((org-refile-targets (list (directory-files "~/Reference/ 'full "*.org") '(:maxlevel . 1)))) (call-interactively 'org-refile))) Would offer all top-level headlines in any org files in the ~/ Reference directory HTH - Carsten > > What I am doing until now is: > folding the headline (tab) > cutting the headline (C-k) > making a split screen (C-x 2) > changing buffer (C-x o) > opening poems.org (C-x C-f "reference/poems/poems.org") > pasting headline (C-y) > changing buffer (C-x o) > removing split view (C-x 1) > > Poems.org is not part of the agenda because it is reference material > and not an active file. > It is also not a refile target because I would have to make every .org > file in all subdirectories a refile target and sometimes the > appropriate file does not yet exist, in which case I need to create > it. > > Any ideas? > Do I need to further try to make clear what I mean? > > Greetings, > Eraldo - Carsten