GNU bug report logs - #42136
26.1.90; rgrep uses a directory that was not actually given

Previous Next

Package: emacs;

Reported by: Benjamin Riefenstahl <Riefenstahl <at> mecom.de>

Date: Tue, 30 Jun 2020 11:08:02 UTC

Severity: normal

Found in version 26.1.90

Full log


View this message in rfc822 format

From: Benjamin Riefenstahl <b.riefenstahl <at> turtle-trading.net>
To: Juri Linkov <juri <at> linkov.net>
Cc: 42136 <at> debbugs.gnu.org, Benjamin Riefenstahl <Riefenstahl <at> mecom.de>, Stefan Monnier <monnier <at> IRO.UMontreal.CA>, Dmitry Gutov <dgutov <at> yandex.ru>
Subject: bug#42136: 26.1.90; rgrep uses a directory that was not actually given
Date: Fri, 03 Jul 2020 16:10:54 +0200
Hi Juri,

Juri Linkov writes:
> (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.

Thanks for the suggestion.  Sadly this seems to make things worse:

* emacs -Q (in ~)
* Eval your advice. 
* M-x make-directory RET /tmp/test RET
* M-x rgrep RET [...] /tmp/te RET
* Result: No confirmation, the search runs in "~" (!)

I tried read-directory-name with all variations of MUSTMATCH, and I
believe none of them helps me here.  I guess I want an additional mode,
like 'confirm-automatic-completion, which handles TAB as before, but
with RET it would require confirmation before changing the result.

benny




This bug report was last modified 4 years and 348 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.