From c6a0f6e91241e877d5896e331fbe4c799015db36 Mon Sep 17 00:00:00 2001
From: Kyle Meyer <kyle@kyleam.com>
Date: Sun, 13 Apr 2014 22:57:19 -0400
Subject: Cosmetic changes to Org refile functions

---
 lisp/init-org.el | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

(limited to 'lisp')

diff --git a/lisp/init-org.el b/lisp/init-org.el
index 7cf0421..1e9ab6b 100644
--- a/lisp/init-org.el
+++ b/lisp/init-org.el
@@ -196,23 +196,23 @@ be restored properly."
 (defun km/org-refile-to-other-file (file &optional maxlevel)
   "Refile with `org-refile-targets' set to FILE.
 A numeric prefix can be given to set MAXLEVEL (defaults to 2)."
-  (interactive "fFile:")
-  (let* ((maxlevel (if current-prefix-arg
-                       (prefix-numeric-value current-prefix-arg)
-                     2))
-         (org-refile-targets
-          `((,(substring-no-properties file) :maxlevel . ,maxlevel))))
+  (interactive "fFile: \nP")
+  (let* ((maxlevel (prefix-numeric-value (or maxlevel 2)))
+         (file (substring-no-properties file))
+         (org-refile-targets `((,file :maxlevel . ,maxlevel))))
     (org-refile)))
 
 (defun km/org-refile-to-other-org-buffer (buffer &optional maxlevel)
   "Refile with `org-refile-targets' set to BUFFER file name.
 A numeric prefix can be given to set MAXLEVEL (defaults to 2)."
-  (interactive (list (km/get-org-file-buffer)))
-  (km/org-refile-to-other-file (buffer-file-name (get-buffer buffer))))
+  (interactive (list (km/get-org-file-buffer) current-prefix-arg))
+  (let ((buffer-file (buffer-file-name buffer)))
+    (km/org-refile-to-other-file buffer-file maxlevel)))
 
 (defun km/get-org-file-buffer ()
-  (org-icompleting-read "Buffer: " (mapcar 'buffer-name
-                                           (org-buffer-list 'files))))
+  (get-buffer
+   (org-icompleting-read "Buffer: " (mapcar 'buffer-name
+                                            (org-buffer-list 'files)))))
 
 (eval-after-load 'org
   '(add-to-list 'org-mode-hook
-- 
cgit v1.2.3