From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs 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 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="12966"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 To: Phil Sainty , 51711@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 11 01:19:13 2021 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkxo8-00039H-L3 for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 11 Nov 2021 01:19:12 +0100 Original-Received: from localhost ([::1]:60482 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mkxo7-0000N0-P6 for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 10 Nov 2021 19:19:11 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:39616) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkxny-0000Ms-Ky for bug-gnu-emacs@gnu.org; Wed, 10 Nov 2021 19:19:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:56192) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mkxny-0000S5-Cd for bug-gnu-emacs@gnu.org; Wed, 10 Nov 2021 19:19:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mkxnx-0006ks-Lx for bug-gnu-emacs@gnu.org; Wed, 10 Nov 2021 19:19:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 11 Nov 2021 00:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 51711 X-GNU-PR-Package: emacs Original-Received: via spool by 51711-submit@debbugs.gnu.org id=B51711.163658988125888 (code B ref 51711); Thu, 11 Nov 2021 00:19:01 +0000 Original-Received: (at 51711) by debbugs.gnu.org; 11 Nov 2021 00:18:01 +0000 Original-Received: from localhost ([127.0.0.1]:39505 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkxmz-0006jH-5v for submit@debbugs.gnu.org; Wed, 10 Nov 2021 19:18:01 -0500 Original-Received: from mail-lj1-f170.google.com ([209.85.208.170]:34589) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkxmx-0006j0-L5 for 51711@debbugs.gnu.org; Wed, 10 Nov 2021 19:18:00 -0500 Original-Received: by mail-lj1-f170.google.com with SMTP id h11so8593276ljk.1 for <51711@debbugs.gnu.org>; Wed, 10 Nov 2021 16:17:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=GM7mFqGdvm5RJdwOLdxVuNyeuYQT/Vwp9oZJTc0T3DU=; b=gfYWgD9WT0mfXaGLcP9tb+H9A1nnn8UCz2yU1GCE/tw2CexKFFZVrFqRR7LmAEiu89 auThv+c1QTNuMY7QLuO8Z3zgYI+Cm9Cy/yb5U77QB3gxa0TEWR3YLuLHb4lHvKpWq7nF F0q61vSRxId4vedpvbCMBhVUF9hJ+wUS3owxaBaNve9pc80k+CAnj/Ap4Sy9YC9TtcwX KqwB+K4acbdX0RhhiHfhNBe0BncK7TKuZ+6QJWNQiQAYB8mg/VSvwCJlfpgUwcGLEBLL 6gWcE4DY2A8zzAcsAHBWsLCHGUz5HPzeP/mRAdf5bKCLiCBigwLpUh8+Fq3ns1kVjA5l gb8A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=GM7mFqGdvm5RJdwOLdxVuNyeuYQT/Vwp9oZJTc0T3DU=; b=WEYmUa5FjOHPtgg9QtH9i8AfNo6argM7AJT8Q9vOkcj71lBAeG/hLt9UDHOxQlAd09 5abvH4Vckaw3FJbJ9ABhSbLhxYcInGtBZOJg06deR/laGV5fa7KpYV03Iwx2PgZdgIki N0KFUTpuYyp8h/9LegjPRmt4PL9zMUbfIhm0McYs4CDL6u5hjaBO9pMOCZgZlRH+FFV/ XBj4W/Nq7vVNTwNkM5A5Ck7paz+uz6p36ClG7vO8Lbg42b5xoU2Iay9IVFQ9nnTK/BsZ jAXb+1whyP7wiZYvOHDGJfuV1AtG3IOa8nRemnYiZjrD0009mGKdf+ZKiZ886ZI6a37k mviQ== X-Gm-Message-State: AOAM530NUKaLbYFsuUWC5Fgk8KFX2SnwjhKALfBZ5b+Ip4SXVj4Rz1Hd fe6ttwoQ0x8h5HDKWHRRU0YIFKDVhmU= X-Google-Smtp-Source: ABdhPJxDa/wk9ZMPmQaOHti5Vw/FbecaqriuVfmJAX7YVbe1aQOGtcW7WJD9jjb3NZ9TRMAhUJ9xtA== X-Received: by 2002:a2e:b8cf:: with SMTP id s15mr2978780ljp.364.1636589873408; Wed, 10 Nov 2021 16:17:53 -0800 (PST) Original-Received: from [192.168.0.103] ([5.18.235.131]) by smtp.googlemail.com with ESMTPSA id f3sm126824lfu.133.2021.11.10.16.17.52 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 Nov 2021 16:17:52 -0800 (PST) In-Reply-To: Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:219564 Archived-At: 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