Take node as argument to #'org-roam-refile (#2388)

This commit is contained in:
Benson Chu
2024-10-07 12:04:46 -05:00
committed by GitHub
parent 9fd7c87b5b
commit 2a630476b3

View File

@ -886,14 +886,14 @@ node."
(org-roam-db-update-file))))
;;;###autoload
(defun org-roam-refile ()
(defun org-roam-refile (node)
"Refile node at point to an Org-roam node.
If region is active, then use it instead of the node at point."
(interactive)
(interactive
(list (org-roam-node-read nil nil nil 'require-match)))
(let* ((regionp (org-region-active-p))
(region-start (and regionp (region-beginning)))
(region-end (and regionp (region-end)))
(node (org-roam-node-read nil nil nil 'require-match))
(file (org-roam-node-file node))
(nbuf (or (find-buffer-visiting file)
(find-file-noselect file)))