emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Sébastien Vauban" <wxhgmqzgwmuf-geNee64TY+gS+FvcfC7Uqw@public.gmane.org>
To: emacs-orgmode-mXXj517/zsQ@public.gmane.org
Subject: Re: Refile to a different Org file?
Date: Wed, 24 Nov 2010 22:44:53 +0100	[thread overview]
Message-ID: <80k4k2jt0q.fsf@missioncriticalit.com> (raw)
In-Reply-To: A59E60614F994236A1BBA47B5F3F0E8F@PHONON.COM

Hi Raymond,

"Raymond Zeitler" wrote:
> I'm trying to change the value of org-refile-targets to enable me to refile
> to the other files that make up my agenda view.  Its value started out as
> just nil, which worked exactly right for one file because I was able to
> refile to all the *categories* in ~/todo.org, using tab completion, and it
> didn't get confused by tags or heading names.
>
> So far I've used customization to put this into the appropriate section of
> my .emacs:
>
>  '(org-refile-targets (quote ((org-agenda-files :maxlevel . 1) (nil
> :maxlevel . 1))))
>
> This doesn't work the way I expect.  I figured out that I can refile if I
> specify the heading "Tasks" and the filename.  But I cannot refile to any
> categories other than the ones in ~/todo.org.  And sometimes I get choices
> that I don't want where the heading starts with the same text as the
> category name.  BTW, I use unique category names across all files.

This is what I'm using:

#+begin_src emacs-lisp
;; any headline with level <= 2 is a target
(setq org-refile-targets '((nil :maxlevel . 2)
                                ; all top-level headlines in the
                                ; current buffer are used (first) as a
                                ; refile target
                           (org-agenda-files :maxlevel . 2)))

;; provide refile targets as paths, including the file name
;; (without directory) as level 1 of the path
(setq org-refile-use-outline-path 'file)

;; allow to create new nodes (must be confirmed by the user) as
;; refile targets
(setq org-refile-allow-creating-parent-nodes 'confirm)

;; refile only within the current buffer
(defun my/org-refile-within-current-buffer ()
  "Move the entry at point to another heading in the current buffer."
  (interactive)
  (let ((org-refile-targets '((nil :maxlevel . 5))))
    (org-refile)))
#+end_src

In particular, the file notation allows me to easily refile to any Org file
(from the agenda ones):

    Work.org/Appointments

or

    Perso.org/Appointments

Does this answer your concern, or did I miss your point?

Best regards,
  Seb

-- 
Sébastien Vauban


_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode-mXXj517/zsQ@public.gmane.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

  reply	other threads:[~2010-11-24 21:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <201011241714.oAOHE4bs026263@hormel5.ieee.org>
2010-11-24 21:26 ` Refile to a different Org file? Raymond Zeitler
2010-11-24 21:44   ` Sébastien Vauban [this message]
     [not found] <201011251701.oAPH1gbM032630@hormel5.ieee.org>
2010-11-29 18:49 ` Raymond Zeitler
2010-12-06 12:45   ` Matt Lundin
2010-12-06 15:52     ` Raymond Zeitler

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=80k4k2jt0q.fsf@missioncriticalit.com \
    --to=wxhgmqzgwmuf-genee64ty+gs+fvcfc7uqw@public.gmane.org \
    --cc=emacs-orgmode-mXXj517/zsQ@public.gmane.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).