Use this instead of org-roam-refile

once you have a lot of nodes, org-roam-refile is not very usable because you can’t provide a function to filter the nodes. It also does something that org-refile already does. So I wrote this function with you might find useful. THe function uses org-refile. If the first parameter is true, it places point in the destination. An optional filter function can be used. This way you can significantly narrow the potential destinations (e.g. I have several “Archival” files with filetag archival.

 (defun dmg-org-roam-refile (&optional p-visit filter-function)
   "refile current header as a child of a node.
 
 if P_VISIT is t, place point a destination.
 FILTER-FUNCTION allows you to narrow the potential destinations. See org-roam-node-find for an explanation of how it works.

 See org-refile for further configuration (e.g. location where subtree is placed within destionation)
"
(interactive)
(let* (  ;
    (node   (org-roam-node-read nil filter-function nil 'require-match))
    (file   (org-roam-node-file node))
    (title   (org-roam-node-title node))
    (point  (org-roam-node-point node))
    )
  (org-refile nil nil (list title file nil point))
  (if p-visit 
    (org-refile '(16) ))
 ))
1 Like

Hi Professeur - I want to ask what problems does org-roam-refile have in your opinion - I never knew of this functionality just got to know about it, it pushes a headline along with its contents to a node it seems, what kind of problem does it possess for large node size?

Please call me Daniel. The main problem is that it does not allow for filter-node function (like org-roam-node-find). My use case is the following: I want to move nodes from my inbox (where I quickly add them) and then later decide where they go. But I only have a very small number of potential destionations (Projects and Areas–I use a hybrid of PARA/GTD). This way I can filter nodes and only show the Projects or Areas nodes. Does it make sense?

1 Like

Yes it does ofcourse. Thanks :slight_smile: