[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] how to org-refile to a target within the current file?

From: Peter Salazar
Subject: Re: [O] how to org-refile to a target within the current file?
Date: Sun, 8 May 2016 07:30:28 -0400

Here's the solution: 

(defun my-org-files-list ()
  (delq nil
    (mapcar (lambda (buffer)
      (buffer-file-name buffer))
      (org-buffer-list 'files t))))

On Wed, May 4, 2016 at 1:20 PM, Peter Salazar <address@hidden> wrote:
Hello, I use org-refile quite a bit, but for my use-case, I want to refile my org-mode subtrees not to an org-agenda file, but to the current file or another file I'm currently visiting.

I had a way of doing this that was working correctly, but now has stopped working. I'm not sure what I changed that broke it. 

Here's the code I'm using for org-refile:

(setq org-outline-path-complete-in-steps nil) ; Refile in a single go 
(setq org-completion-use-ido nil) 
(setq org-refile-use-outline-path t) ; Show full paths for refiling 
(setq org-refile-allow-creating-parent-nodes (quote confirm)) ; allow refile to create parent tasks with confirmation

(defun my-org-files-list ()
 (mapcar (lambda (buffer)
   (buffer-file-name buffer))
   (org-buffer-list 'files t))) 

(setq org-refile-targets '((my-org-files-list :maxlevel . 3))) 

Again, this used to work. But now when I run org-refile, I get this:

Debugger entered--Lisp error: (wrong-type-argument stringp nil)
  org-refile-get-targets(nil (#("this" 0 4 (fontified t face org-level-1))))
  org-refile-get-location("Refile subtree \"this\" to" nil confirm nil)
  call-interactively(org-refile record nil)
  command-execute(org-refile record)
  execute-extended-command(nil "org-refile")
  call-interactively(execute-extended-command nil nil)

Any suggestions on how to fix this? Thanks!

reply via email to

[Prev in Thread] Current Thread [Next in Thread]