From mboxrd@z Thu Jan 1 00:00:00 1970 From: Peter Salazar Subject: Re: how to org-refile to a target within the current file? Date: Sun, 8 May 2016 07:30:28 -0400 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=f46d04426fcee08e6d05325304ab Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41077) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azMuu-0000HU-JI for emacs-orgmode@gnu.org; Sun, 08 May 2016 07:30:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1azMus-0005FT-9j for emacs-orgmode@gnu.org; Sun, 08 May 2016 07:30:31 -0400 Received: from mail-ig0-x231.google.com ([2607:f8b0:4001:c05::231]:38726) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1azMus-0005Ev-2r for emacs-orgmode@gnu.org; Sun, 08 May 2016 07:30:30 -0400 Received: by mail-ig0-x231.google.com with SMTP id m9so72858911ige.1 for ; Sun, 08 May 2016 04:30:29 -0700 (PDT) In-Reply-To: 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" To: org-mode --f46d04426fcee08e6d05325304ab Content-Type: text/plain; charset=UTF-8 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 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) > get-file-buffer(nil) > org-find-base-buffer-visiting(nil) > org-get-agenda-file-buffer(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) > org-refile(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) > command-execute(execute-extended-command) > > Any suggestions on how to fix this? Thanks! > > --f46d04426fcee08e6d05325304ab Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Here's the solution:=C2=A0

(de= fun my-org-files-list ()
=C2=A0 (delq nil
=C2=A0 =C2=A0= (mapcar (lambda (buffer)
=C2=A0 =C2=A0 =C2=A0 (buffer-file-name = buffer))
=C2=A0 =C2=A0 =C2=A0 (org-buffer-list 'files t))))

O= n Wed, May 4, 2016 at 1:20 PM, Peter Salazar <cycleofsong@gmail.com> wrote:
Hel= lo, 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 ano= ther file I'm currently visiting.

I had a way of doi= ng this that was working correctly, but now has stopped working.=C2=A0I'= ;m not sure what I changed that broke it.=C2=A0

He= re's the code I'm using for org-refile:

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

(defun my= -org-files-list ()
=C2=A0(mapcar (lambda (buffer)
=C2= =A0 =C2=A0(buffer-file-name buffer))
=C2=A0 =C2=A0(org-buffer-lis= t 'files t)))=C2=A0

(setq org-refile-targets &= #39;((my-org-files-list :maxlevel . 3)))=C2=A0

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

Debugger entered--Lisp error: (wrong-type-argume= nt stringp nil)
=C2=A0 get-file-buffer(nil)
=C2=A0 org-= find-base-buffer-visiting(nil)
=C2=A0 org-get-agenda-file-buffer(= nil)
=C2=A0 org-refile-get-targets(nil (#("this" 0 4 (f= ontified t face org-level-1))))
=C2=A0 org-refile-get-location(&q= uot;Refile subtree \"this\" to" nil confirm nil)
= =C2=A0 org-refile(nil)
=C2=A0 call-interactively(org-refile recor= d nil)
=C2=A0 command-execute(org-refile record)
=C2=A0= execute-extended-command(nil "org-refile")
=C2=A0 call= -interactively(execute-extended-command nil nil)
=C2=A0 command-e= xecute(execute-extended-command)

Any suggest= ions on how to fix this? Thanks!


--f46d04426fcee08e6d05325304ab--