Function: embark-org-refile-here

embark-org-refile-here is a byte-compiled function defined in embark-org.el.

Signature

(embark-org-refile-here TARGET)

Documentation

Refile the heading at point in the source window to TARGET.

If TARGET is an agenda item and other-window-for-scrolling is displaying an org mode buffer, then that is the source window. If TARGET is a minibuffer completion candidate, then the source window is the window selected before the command that opened the minibuffer ran.

Source Code

;; Defined in ~/.emacs.d/elpa/embark-20260610.302/embark-org.el
(defun embark-org-refile-here (target)
  "Refile the heading at point in the source window to TARGET.

If TARGET is an agenda item and `other-window-for-scrolling' is
displaying an org mode buffer, then that is the source window.
If TARGET is a minibuffer completion candidate, then the source
window is the window selected before the command that opened the
minibuffer ran."
  (embark-org--in-source-window target
    (lambda (marker)
      (org-refile nil nil
                  ;; The RFLOC argument:
                  (list
                   ;; Name
                   (org-with-point-at marker
                     (nth 4 (org-heading-components)))
                   ;; File
                   (buffer-file-name (marker-buffer marker))
                   ;; nil
                   nil
                   ;; Position
                   marker)))))