unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Dmitry Gutov <dgutov@yandex.ru>
To: Phil Sainty <psainty@orcon.net.nz>, 51711@debbugs.gnu.org
Subject: bug#51711: 28.0.60; rgrep fails to pass the search directory to rgrep-default-command
Date: Thu, 11 Nov 2021 03:17:46 +0300	[thread overview]
Message-ID: <f5ed4fdf-eb77-241b-2ac6-ca946b1d2aeb@yandex.ru> (raw)
In-Reply-To: <c017062a8164a018eeafb47e81edbeea@webmail.orcon.net.nz>

Hi!

On 09.11.2021 13:02, Phil Sainty wrote:
> This was intentionally changed in commit c6ee95ddeef:
> 
> https://git.savannah.gnu.org/cgit/emacs.git/commit?id=c6ee95ddeefc17410e15090539d0cb220ab6947c 
> 
> 
>         (setq dir (file-name-as-directory (expand-file-name dir)))
> -      (let ((command (rgrep-default-command regexp files dir)))
> +      (let ((command (rgrep-default-command regexp files nil)))
> 
> It's not clear to me why this was done, but rgrep-default-command
> cannot produce the correct output if it isn't given the search
> directory.  In particular, rgrep-find-ignored-directories and
> rgrep-find-ignored-files no longer work as expected, if the
> directory is not passed, for grep-find-ignored-directories and
> grep-find-ignored-files values using the cons cell format, as
> the functions specified need to know the search directory.

The effect on the *-ignores function is something we all have missed, alas.

This only matters when grep-find-ignored-directories or 
grep-find-ignored-files have been customized to cons values with 
functions, right?

> https://debbugs.gnu.org/cgi/bugreport.cgi?bug=20719#22 may be the
> justification ("it makes the last argument to rgrep-default-command
> look superfluous."), but that's definitely not true.
> 
> I don't have my head around the other changes made for bug#20719
> and so it's not clear to me whether fixing this is as simple as
> reverting that one line, or if doing so will cause some other
> regression.

It would replace "." in the resulting command with the absolute name of 
the directory, which would affect the output, for one thing.

> CCing Dmitry.  Can you recall specifically why that line was changed?

Does the below patch work for you? I suppose the answer depends on 
whether the functions in the customized car values will known what to do 
with ".".


diff --git a/lisp/progmodes/grep.el b/lisp/progmodes/grep.el
index ec2850737c..8cc3e57378 100644
--- a/lisp/progmodes/grep.el
+++ b/lisp/progmodes/grep.el
@@ -1218,7 +1218,7 @@ rgrep
  				   grep-find-command)))
  	    (compilation-start regexp 'grep-mode))
        (setq dir (file-name-as-directory (expand-file-name dir)))
-      (let ((command (rgrep-default-command regexp files nil)))
+      (let ((command (rgrep-default-command regexp files ".")))
  	(when command
  	  (if confirm
  	      (setq command





  reply	other threads:[~2021-11-11  0:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-09 10:02 bug#51711: 28.0.60; rgrep fails to pass the search directory to rgrep-default-command Phil Sainty
2021-11-11  0:17 ` Dmitry Gutov [this message]
2021-11-11  1:48   ` Phil Sainty

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=f5ed4fdf-eb77-241b-2ac6-ca946b1d2aeb@yandex.ru \
    --to=dgutov@yandex.ru \
    --cc=51711@debbugs.gnu.org \
    --cc=psainty@orcon.net.nz \
    /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).