Replies: 3 comments 4 replies
-
Actually |
Beta Was this translation helpful? Give feedback.
-
Not always. I just tested What I'm doing is make a grep command for all org files, in various predetermined directories on the filesystem, so I'm providing full paths. Then the results are full paths. But in consult--grep it's still shown as relative. Often with very long "../../../../../../.." strings. And again, I don't know if it's consult doing that conversion (guess not) or some underlying stuff. |
Beta Was this translation helpful? Give feedback.
-
OK, that "No such file or directory" isn't about the override. It occurs if I just redefine Will probably keep looking into this later. At least I have a starting point. EDIT: In the meantime, I do get good full paths with (cl-letf (((symbol-function #'file-relative-name)
(lambda (name &optional _dir) name)))
(consult--grep "Grep in several hardcoded directories"
#'consult--grep-make-builder
'("~/.emacs.d/" "~/Documents" "~/Downloads/")
nil))) so that is solved. Abbreviating them is just an extra. |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm writing a command that greps in several directories (set in a variable). I'm trying to track down what is causing filenames to print as relative paths in the
consult-grep
results. I'd like full paths.Here's a test command
At first I used
#'consult--ripgrep-make-builder
and thought it was ripgrep responsible for the file path format, but no, ripgrep and vanilla grep will return full paths. It's something either in consult, or in the underlying Emacs completion systems.I tracked down that the filename is stored in
'prefix-group
text property of each match, and this is fetched by the functionconsult--prefix-group
, which doesn't transform the filename but gives it verbatim tocomplete-with-action
. So I am a bit lost as to where it is happening.Beta Was this translation helpful? Give feedback.
All reactions