From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: Re: refiling, ido-mode, and creating projects Date: Sat, 24 Nov 2012 15:07:08 -0500 Message-ID: <87txsepxxv.fsf@norang.ca> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from eggs.gnu.org ([208.118.235.92]:50665) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcM0Q-0003wl-QN for emacs-orgmode@gnu.org; Sat, 24 Nov 2012 15:07:16 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1TcM0O-0003c5-LE for emacs-orgmode@gnu.org; Sat, 24 Nov 2012 15:07:14 -0500 Received: from mho-04-ewr.mailhop.org ([204.13.248.74]:62744 helo=mho-02-ewr.mailhop.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1TcM0O-0003bw-HN for emacs-orgmode@gnu.org; Sat, 24 Nov 2012 15:07:12 -0500 In-Reply-To: (Alan Schmitt's message of "Tue, 20 Nov 2012 09:25:20 +0100") 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-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Alan Schmitt Cc: emacs-orgmode Alan Schmitt writes: > I found out that using ido-mode is very useful for refiling. However > there is one thing I don't know how to do: how to create a parent node > in this setup. > > Here is my configuration (straight from the usual > http://doc.norang.ca/org-mode.html) > > #+BEGIN_SRC elisp > ; Use full outline paths for refile targets - we file directly with IDO > (setq org-refile-use-outline-path t) > > ; Targets complete directly with IDO > (setq org-outline-path-complete-in-steps nil) > > ; Allow refile to create parent tasks with confirmation > (setq org-refile-allow-creating-parent-nodes (quote confirm)) > > ; Use IDO for both buffer and file completion and ido-everywhere to t > (setq org-completion-use-ido t) > (setq ido-everywhere t) > (setq ido-max-directory-size 100000) > (ido-mode (quote both)) > #+END_SRC > > Let's say I already have an entry "Work/Trips" and I want to refile some > task to a new "Paris" project under "Trips". If I "C-c C-w" and type > "Trips", I can see that the entry is selected. However, I don't know how > to say "select this entry and let me type some more to add to it". If I > continue typing "/Paris" I get a "no match" and an error > "org-refile-check-position: Please save the buffer to a file before > refiling" (which probably happens because I'm inside the agenda, and the > refiling target "Trpis/Paris" makes no sense). > > I tried doing a "C-f" as when using ido with find-file, but it does not > do anything. > > Any suggestion? I haven't been able to make this work with my setup after switching to IDO. My current workaround is visit the target with C-u C-c C-w and create the new target heading, then return and refile to that -- but it's not very elegant. My attempts are refiling and creating with IDO give the following error: --8<---------------cut here---------------start------------->8--- Debugger entered--Lisp error: (error "Please save the buffer to a file before refiling") signal(error ("Please save the buffer to a file before refiling")) error("Please save the buffer to a file before refiling") (if (and (not ...) (not file)) (error "Please save the buffer to a file before refiling") (when (org-string-nw-p re) (setq buffer ...) (with-current-buffer buffer ...))) (let* ((file ...) (re ...) (pos ...) buffer) (if (and ... ...) (error "Please save the buffer to a file before refiling") (when ... ... ...))) org-refile-check-position(nil) (let* ((cbuf ...) (partial-completion-mode nil) (cfn ...) (cfunc ...) (extra ...) (cbnex ...) (filename ...) (tbl ...) (completion-ignore-case t) cdef (prompt ...) pa answ parent-target child parent old-hist) (setq old-hist org-refile-history) (setq answ (funcall cfunc prompt tbl nil ... nil ... ...)) (setq pa (or ... ...)) (org-refile-check-position pa) (if pa (progn ... pa) (if ... ... ...))) org-refile-get-location("Refile subtree \"Respond to Julien Cubizolles on Re: org-agenda-ignore-scheduled not taken into account in custom agenda blocks?\" to" nil confirm nil) (save-excursion (unless goto (org-back-to-heading t) (setq heading-text ...)) (org-refile-get-location (cond ... ... ...) default-buffer (and ... org-refile-allow-creating-parent-nodes) goto)) (let (heading-text) (save-excursion (unless goto ... ...) (org-refile-get-location ... default-buffer ... goto))) (or rfloc (let (heading-text) (save-excursion ... ...))) (setq it (or rfloc (let ... ...))) (or (and (equal goto 2) org-clock-hd-marker (marker-buffer org-clock-hd-marker) (prog1 ... ...)) (setq it (or rfloc ...))) (if (or (and ... org-clock-hd-marker ... ...) (setq it ...)) (progn (setq file ... re ... pos ...) (if ... ...) (setq nbuf ...) (if goto ... ... ... ... ... ... ...))) (when (or (and ... org-clock-hd-marker ... ...) (setq it ...)) (setq file (nth 1 it) re (nth 2 it) pos (nth 3 it)) (if (and ... pos ... ...) (error "Cannot refile to position inside the tree or region")) (setq nbuf (or ... ...)) (if goto (progn ... ... ...) (if regionp ... ...) (with-current-buffer ... ... ...) (unless org-refile-keep ...) (when ... ...) (setq org-markers-to-move nil) (message ... ... file))) (if (equal goto (quote ...)) (org-refile-goto-last-stored) (when (or ... ...) (setq file ... re ... pos ...) (if ... ...) (setq nbuf ...) (if goto ... ... ... ... ... ... ...))) (let* ((actionmsg ...) (cbuf ...) (regionp ...) (region-start ...) (region-end ...) (region-length ...) (filename ...) pos it nbuf file re level reversed) (setq last-command nil) (when regionp (goto-char region-start) (or ... ...) (setq region-start ...) (unless ... ...)) (if (equal goto ...) (org-refile-goto-last-stored) (when ... ... ... ... ...))) (if (member goto (quote ...)) (org-refile-cache-clear) (let* (... ... ... ... ... ... ... pos it nbuf file re level reversed) (setq last-command nil) (when regionp ... ... ... ...) (if ... ... ...))) org-refile(nil) call-interactively(org-refile nil nil) --8<---------------cut here---------------end--------------->8--- and to get that I have to type the entire target with a trailing slash like this: Tasks/Organization/foo/ (todo.org) to try to create foo as a 3rd level heading under Tasks/Organization in todo.org but that doesn't work for me. I haven't found a way to edit the IDO completion so I can just add foo/ to it in the appropriate place. Sorry that's not much help :/ Regards, Bernt