According to the documentation :
(rgrep REGEXP &optional FILES DIR CONFIRM)
Recursively grep for
REGEXP
inFILES
in directory tree rooted atDIR
.[...]
But when I call it in some Elisp code like this :
(rgrep "test" "*\\.org" "\\~/Org")
It ends up neglecting the third argument DIR
and instead uses the current directory.
The corresponding output and the find
command of the above code is :
-*- mode: grep; default-directory: <current_directory> -*-
Grep started at Fri May 1 14:24:46
find . <exclude_expr> -type f \( -name \*\\.org \) -exec grep --color -i -nH --null -e test \{\} +
but the output I obtained interactively with M-X rgrep
-*- mode: grep; default-directory: ~/Org -*-
Grep started at Fri May 1 14:24:46
find . <exclude_expr> -type f \( -name \*\\.org \) -exec grep --color -i -nH --null -e test \{\} +
is expected.
Note: GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.8, cairo version 1.16.0) of 2020-01-13