Function: org-agenda-refile
org-agenda-refile is an interactive and byte-compiled function defined
in org-agenda.el.gz.
Signature
(org-agenda-refile &optional GOTO RFLOC NO-UPDATE)
Documentation
Refile the item at point.
When called with C-u (universal-argument) C-u (universal-argument), go to the location of the last
refiled item.
When called with C-u (universal-argument) C-u (universal-argument) C-u (universal-argument) prefix or when GOTO is 0, clear
the refile cache.
RFLOC can be a refile location obtained in a different way.
When NO-UPDATE is non-nil, don't redo the agenda buffer.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/org/org-agenda.el.gz
(defun org-agenda-refile (&optional goto rfloc no-update)
"Refile the item at point.
When called with `\\[universal-argument] \\[universal-argument]', \
go to the location of the last
refiled item.
When called with `\\[universal-argument] \\[universal-argument] \
\\[universal-argument]' prefix or when GOTO is 0, clear
the refile cache.
RFLOC can be a refile location obtained in a different way.
When NO-UPDATE is non-nil, don't redo the agenda buffer."
(interactive "P")
(cond
((member goto '(0 (64)))
(org-refile-cache-clear))
((equal goto '(16))
(org-refile-goto-last-stored))
(t
(let* ((buffer-orig (buffer-name))
(marker (or (org-get-at-bol 'org-hd-marker)
(org-agenda-error)))
(buffer (marker-buffer marker))
;; (pos (marker-position marker))
(rfloc (or rfloc
(org-refile-get-location
(if goto "Goto" "Refile to") buffer
org-refile-allow-creating-parent-nodes))))
(with-current-buffer buffer
(org-with-wide-buffer
(goto-char marker)
(let ((org-agenda-buffer-name buffer-orig))
(org-remove-subtree-entries-from-agenda))
(org-refile goto buffer rfloc))))
(unless no-update (org-agenda-redo)))))