Closed justrajdeep closed 2 months ago
Maybe something simple non-consulty like this would be good enough:
(defun open-my-file ()
"Open one of the files listed in ~/filelist_alpha2."
(find-file
(completing-read
"Open: "
(with-temp-buffer
(insert-file-contents "~/filelist_alpha2")
(string-lines (buffer-string))))))
Wow that was so simple ... why i was trying to use consult was for the next part where i want to modify consult-ripgrep
to take this list ~/filelist_alpha2
and perform ripgrep
only on files in that list ...
i think my defcustom was not right
(defcustom consult-bat-args
'(
;; (if (executable-find "cat" 'remote) "cat"
;; (if (executable-find "bat" 'remote) "bat"
;; (error "Executable not found")))
"bat /home/rmondal/filelist_alpha2 | rg" "--color=never"
)
"Command line arguments for fd, see `consult-fd'.
The dynamically computed arguments are appended.
Can be either a string, or a list of strings or expressions."
:type '(choice string (repeat (choice string sexp))))
this gives me the list of files from /home/rmondal/filelist_alpha2
but i get this error
[31m[bat error][0m: '|': No such file or directory (os error 2)
My end goal is to do something like this?
https://emacs.stackexchange.com/a/47447/20230
(defun swiper-files (&rest files)
(let* ((swiper-multi-buffers nil)
(swiper-multi-candidates nil)
(this-command 'ivy-done))
(mapc 'swiper-multi-action-1 (mapcar
(lambda (f)
(buffer-name (find-file-noselect f)))
files))
(ivy-read "Swiper: " swiper-multi-candidates
:action #'swiper-multi-action-2
:unwind #'swiper--cleanup
:caller 'swiper-multi)))
(swiper-files "f1.org" "f2.org")
where those two files are computed somehow.
and i want to do that with consult-ripgrep ...
Wow that was so simple ... why i was trying to use consult was for the next part where i want to modify
consult-ripgrep
to take this list~/filelist_alpha2
and performripgrep
only on files in that list ...
consult-grep
and similar functions can take a list of files to search. (It's not obvious from the docstring of consult-ripgrep
, but at least it tells you to read the docstring for consult-grep
that explains that DIR can also be a list of files.)
Thanks ...
Hi
Firstly i want to thank you for the amazing plugin!!!
i want to reuse
consult-fd
to find files in a list of files instead of using fd. the list of valid file names are present in/home/justrajdeep/filelist_alpha2
So i created
After that i modified
consult--fd-make-builder
after that i can get the list of files from
/home/justrajdeep/filelist_alpha2
but i am not able to filter it ... Am i doing something wrong?Sorry maybe this is a very basic question ... and i am new to emacs lisp.