Repository navigation
Is there any way to ignore unreadable files? #3575
|
I'm using ripgrep in Emacs with But I don't care about the unreadable file, I want to search the other files. I can remove the error message with Would it be possible to add a flag that tells ripgrep to treat unreadable files as if they do not exist? |
Replies: 1 comment 1 reply
|
rg already searches the readable files and prints their matches, it just also exits 2, and it's counsel that drops the output: #!/bin/sh
rg --no-messages "$@"; rc=$?; [ $rc -eq 2 ] && exit 0; exit $rcA bad regex then shows up as rg's error text in the list, fair trade. |
rg already searches the readable files and prints their matches, it just also exits 2, and it's counsel that drops the output:
counsel--sync-sentinel-on-exitreplaces the candidate list with "error code 2" on a non-zero exit. So fix it on the Emacs side: a wrapper in PATH, withcounsel-rg-base-commandpointing at it instead of rg.A bad regex then shows up as rg's error text in the list, fair trade.