Subject: Re: bug#42136: 26.1.90; rgrep uses a directory that was not actually given

From: Juri Linkov <[email-masked]>
Date: Thu, 02 Jul 2020 00:46:06 +0300

> Also I wanted to hear if anybody has a tip about some customization that
> I was missing.

Maybe some advice might help you:

(advice-add 'read-directory-name :around
            (lambda (orig-fun prompt &optional dir default-dirname
			      mustmatch initial)
              (cond
	       ((equal prompt "Base directory: ")
		(funcall orig-fun prompt dir default-dirname
			 nil initial))
               (t
		(funcall orig-fun prompt dir default-dirname
			 mustmatch initial))))
            '((name . read-directory-name-no-mustmatch)))

It overrides the MUSTMATCH argument of read-directory-name in rgrep.