The doc string for the variable
- a specification of the files to be considered, either a list of files,
or a symbol whose function or variable value will be used to retrieve
a file name or a list of file names. If you use ‘org-agenda-files’ for
that, all agenda files will be scanned for targets. Nil means consider
headings in the current buffer.
So you can define a variable whose value is a list of the filenames of interest or a function that returns that list and use it in defining a new entry for
Take the case of an org directory that contains a bunch of
.org files (in a single level) that you want to be targets for refiling. Here's a function that returns a list of them:
(defun ndk/org-refile-candidates ()
(directory-files "/path/to/some/directory/org" t ".*\\.org$"))
You'll have to tweak the path according to your circumstances.
If the set of files is static, it might be easier to define a variable instead. If you want a recursive traversal, you'll need to modify the function accordingly.
Then you can add this to
org-refile-targets with something like this:
(add-to-list 'org-refile-targets '(ndk/org-refile-candidates :maxlevel . 3))
I should note that this is mostly untested, but it should work (ahem).