diff options
author | Kyle Meyer <kyle@kyleam.com> | 2014-04-13 16:44:20 -0400 |
---|---|---|
committer | Kyle Meyer <kyle@kyleam.com> | 2014-04-13 16:44:20 -0400 |
commit | 0e2bd2322887b9aa953383b80ba2bdef83574c50 (patch) | |
tree | 5c2d51ce6ac4947f677880a55d13e4cccc666c19 /lisp | |
parent | a204a37d002b5f6fabaaa99819f07f8351bbbbcb (diff) | |
download | emacs.d-0e2bd2322887b9aa953383b80ba2bdef83574c50.tar.gz |
Simplify km/org-refile-to-other-org-buffer
- Call `km/org-refile-to-other-file' non-interactively instead of
repeating logic.
- Move org buffer completion to separate function.
Diffstat (limited to 'lisp')
-rw-r--r-- | lisp/init-org.el | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/lisp/init-org.el b/lisp/init-org.el index c4746b0..7cf0421 100644 --- a/lisp/init-org.el +++ b/lisp/init-org.el @@ -207,17 +207,12 @@ A numeric prefix can be given to set MAXLEVEL (defaults to 2)." (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 - (org-icompleting-read "Buffer: " - (mapcar 'buffer-name - (org-buffer-list 'files))))) - (let* ((maxlevel (if current-prefix-arg - (prefix-numeric-value current-prefix-arg) - 2)) - (org-refile-targets - `((,(substring-no-properties (buffer-file-name (get-buffer buffer))) - :maxlevel . ,maxlevel)))) - (org-refile))) + (interactive (list (km/get-org-file-buffer))) + (km/org-refile-to-other-file (buffer-file-name (get-buffer buffer)))) + +(defun km/get-org-file-buffer () + (org-icompleting-read "Buffer: " (mapcar 'buffer-name + (org-buffer-list 'files)))) (eval-after-load 'org '(add-to-list 'org-mode-hook |