Small changes to the org-pdftools-complete-link function, by temporarily replace the read-file-name-function variable to make org-link-complete-file use the function it points to instead, which, you can see what I've added to the function's body was two anonymous functions, pdf-or-dir-p and a wrapper function whose whole purpose is to pass every arguement to the replaced function but with the PREDICATE being pdf-or-dir-p. The result is the minibuffer that org-link-complete-file called only provides a completion for directory and pdf files, ignoring everything else.
Small changes to the
org-pdftools-complete-link
function, by temporarily replace theread-file-name-function
variable to makeorg-link-complete-file
use the function it points to instead, which, you can see what I've added to the function's body was two anonymous functions,pdf-or-dir-p
and a wrapper function whose whole purpose is to pass every arguement to the replaced function but with the PREDICATE beingpdf-or-dir-p
. The result is the minibuffer thatorg-link-complete-file
called only provides a completion for directory and pdf files, ignoring everything else.