all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* refiling, ido-mode, and creating projects
@ 2012-11-20  8:25 Alan Schmitt
  2012-11-24 20:07 ` Bernt Hansen
  0 siblings, 1 reply; 2+ messages in thread
From: Alan Schmitt @ 2012-11-20  8:25 UTC (permalink / raw)
  To: emacs-orgmode

Hello,

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?

Thanks,

Alan

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: refiling, ido-mode, and creating projects
  2012-11-20  8:25 refiling, ido-mode, and creating projects Alan Schmitt
@ 2012-11-24 20:07 ` Bernt Hansen
  0 siblings, 0 replies; 2+ messages in thread
From: Bernt Hansen @ 2012-11-24 20:07 UTC (permalink / raw)
  To: Alan Schmitt; +Cc: emacs-orgmode

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-11-24 20:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-20  8:25 refiling, ido-mode, and creating projects Alan Schmitt
2012-11-24 20:07 ` Bernt Hansen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.