[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Orgmode] Re: Refile to a different Org file?
From: |
Sébastien Vauban |
Subject: |
[Orgmode] Re: Refile to a different Org file? |
Date: |
Wed, 24 Nov 2010 22:44:53 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (windows-nt) |
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