emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Li Zhuo <fantanstic@gmail.com>
To: emacs-orgmode@gnu.org
Subject: possible org-refile bug fix
Date: Sun, 22 Dec 2013 17:22:16 +0800	[thread overview]
Message-ID: <CA+viYUSDndyTye3XJXX7zCD-LWsB5jDYbED_qNMfkBa6mNpNHA@mail.gmail.com> (raw)


[-- 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


             reply	other threads:[~2013-12-22  9:22 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-22  9:22 Li Zhuo [this message]
2014-01-04 14:07 ` possible org-refile bug fix Bastien

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=CA+viYUSDndyTye3XJXX7zCD-LWsB5jDYbED_qNMfkBa6mNpNHA@mail.gmail.com \
    --to=fantanstic@gmail.com \
    --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).