emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* possible org-refile bug fix
@ 2013-12-22  9:22 Li Zhuo
  2014-01-04 14:07 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Li Zhuo @ 2013-12-22  9:22 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 193 bytes --]

Dear maintainers,
   I may have found a bug relate to org-refile function,though I have not
push privileges,I submit a patch using git format-patch.
   Wait for your review, awesome Org mode!!

[-- Attachment #1.2: Type: text/html, Size: 238 bytes --]

[-- Attachment #2: 0001-check-refile-position-when-the-position-is-not-nil.patch --]
[-- Type: text/x-patch, Size: 1531 bytes --]

From 866b7be3536d92eb7d7b04cdd48a8b806b9b7253 Mon Sep 17 00:00:00 2001
From: Vacker <fantanstic@gmail.com>
Date: Sun, 22 Dec 2013 16:33:28 +0800
Subject: [PATCH] check refile position when the position is not nil

# background
  when use ido-mode to refile,type a unexist heading always trigger error
'Please indicate a target file in the refile path'
even after set org-refile-allow-creating-parent-nodes to 'confirm
or 'file.

# debugging result see the code comments
---
 lisp/org.el | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lisp/org.el b/lisp/org.el
index 1f20bfd..84f2a60 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -11801,12 +11801,16 @@ this is used for the GOTO interface."
 				  (concat " (default " cbnex ")"))) ": "))
 	 pa answ parent-target child parent old-hist)
     (setq old-hist org-refile-history)
+    ;;answ will be the new (not exist) heading you type through org-icompleting-read
     (setq answ (funcall cfunc prompt tbl nil (not new-nodes)
 			nil 'org-refile-history (or cdef (car org-refile-history))))
+    ;;but tbl is fixed not containing the new heading,
+    ;;so pa is always nil
+    ;;we could let org-refile-check-position work when pa is not nil
     (setq pa (or (assoc answ tbl) (assoc (concat answ "/") tbl)))
-    (org-refile-check-position pa)
     (if pa
 	(progn
+	  (org-refile-check-position pa)
 	  (when (or (not org-refile-history)
 		    (not (eq old-hist org-refile-history))
 		    (not (equal (car pa) (car org-refile-history))))
-- 
1.8.5.2


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

* Re: possible org-refile bug fix
  2013-12-22  9:22 possible org-refile bug fix Li Zhuo
@ 2014-01-04 14:07 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2014-01-04 14:07 UTC (permalink / raw)
  To: Li Zhuo; +Cc: emacs-orgmode

Hi Li,

Li Zhuo <fantanstic@gmail.com> writes:

> I may have found a bug relate to org-refile function,though I have
> not push privileges,I submit a patch using git format-patch.

Thanks for the patch and the bug report: note that the bug was more
general, it also appeared if you don't use ido at all.  I fixed this
in maint.

Please see http://orgmode.org/cgit.cgi/org-mode.git/commit/?id=45b0d2
for an example on how to format commit messages, and thanks again for
the patch!

Best,

-- 
 Bastien

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

end of thread, other threads:[~2014-01-04 14:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-22  9:22 possible org-refile bug fix Li Zhuo
2014-01-04 14:07 ` Bastien

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).