unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Benjamin Riefenstahl <b.riefenstahl@turtle-trading.net>
To: Juri Linkov <juri@linkov.net>
Cc: Dmitry Gutov <dgutov@yandex.ru>,
	Benjamin Riefenstahl <Riefenstahl@mecom.de>,
	Stefan Monnier <monnier@IRO.UMontreal.CA>,
	42136@debbugs.gnu.org
Subject: bug#42136: 26.1.90; rgrep uses a directory that was not actually given
Date: Fri, 03 Jul 2020 16:10:54 +0200	[thread overview]
Message-ID: <87h7uo7kpd.fsf@turtle-trading.net> (raw)
In-Reply-To: <87pn9edi3l.fsf@mail.linkov.net> (Juri Linkov's message of "Thu,  02 Jul 2020 00:46:06 +0300")

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





      reply	other threads:[~2020-07-03 14:10 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-30 10:45 bug#42136: 26.1.90; rgrep uses a directory that was not actually given Benjamin Riefenstahl
2020-06-30 12:26 ` Dmitry Gutov
2020-06-30 12:51   ` Benjamin Riefenstahl
2020-07-01 21:46     ` Juri Linkov
2020-07-03 14:10       ` Benjamin Riefenstahl [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h7uo7kpd.fsf@turtle-trading.net \
    --to=b.riefenstahl@turtle-trading.net \
    --cc=42136@debbugs.gnu.org \
    --cc=Riefenstahl@mecom.de \
    --cc=dgutov@yandex.ru \
    --cc=juri@linkov.net \
    --cc=monnier@IRO.UMontreal.CA \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).