emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Bernt Hansen <bernt@norang.ca>
To: Alan Schmitt <alan.schmitt@polytechnique.org>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: refiling, ido-mode, and creating projects
Date: Sat, 24 Nov 2012 15:07:08 -0500	[thread overview]
Message-ID: <87txsepxxv.fsf@norang.ca> (raw)
In-Reply-To: <m21ufovfyn.fsf@polytechnique.org> (Alan Schmitt's message of "Tue, 20 Nov 2012 09:25:20 +0100")

Alan Schmitt <alan.schmitt@polytechnique.org> 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 <j.cubizolles@free.fr> 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

      reply	other threads:[~2012-11-24 20:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-11-20  8:25 refiling, ido-mode, and creating projects Alan Schmitt
2012-11-24 20:07 ` Bernt Hansen [this message]

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=87txsepxxv.fsf@norang.ca \
    --to=bernt@norang.ca \
    --cc=alan.schmitt@polytechnique.org \
    --cc=emacs-orgmode@gnu.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).