From debbugs-submit-bounces@debbugs.gnu.org Tue Nov 09 05:03:00 2021 Received: (at submit) by debbugs.gnu.org; 9 Nov 2021 10:03:00 +0000 Received: from localhost ([127.0.0.1]:60875 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkNy0-0000GK-3S for submit@debbugs.gnu.org; Tue, 09 Nov 2021 05:03:00 -0500 Received: from lists.gnu.org ([209.51.188.17]:45634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkNxv-0000G8-56 for submit@debbugs.gnu.org; Tue, 09 Nov 2021 05:02:57 -0500 Received: from eggs.gnu.org ([209.51.188.92]:52994) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkNxu-0006dH-Vz for bug-gnu-emacs@gnu.org; Tue, 09 Nov 2021 05:02:55 -0500 Received: from smtp-2.orcon.net.nz ([60.234.4.43]:37135) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mkNxt-0001E4-Cl for bug-gnu-emacs@gnu.org; Tue, 09 Nov 2021 05:02:54 -0500 Received: from [10.253.37.70] (port=64610 helo=webmail.orcon.net.nz) by smtp-2.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1mkNxj-0005Ab-F8; Tue, 09 Nov 2021 23:02:44 +1300 Received: from ip-115-69-175-77.kinect.net.nz ([115.69.175.77]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Tue, 09 Nov 2021 23:02:43 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 09 Nov 2021 23:02:43 +1300 From: Phil Sainty To: bug-gnu-emacs@gnu.org Subject: 28.0.60; rgrep fails to pass the search directory to rgrep-default-command Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- Received-SPF: pass client-ip=60.234.4.43; envelope-from=psainty@orcon.net.nz; helo=smtp-2.orcon.net.nz X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -0.3 (/) X-Debbugs-Envelope-To: submit Cc: Dmitry Gutov X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.6 (--) 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. 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. CCing Dmitry. Can you recall specifically why that line was changed? -Phil In GNU Emacs 28.0.60 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo version 1.15.10, Xaw scroll bars) of 2021-10-07 built on phil-lp Repository revision: f7e6c199bf5b915e000bad964f3be2323d07647e Repository branch: emacs-28 Windowing system distributor 'The X.Org Foundation', version 11.0.12008000 System Description: Ubuntu 18.04.6 LTS From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 10 19:18:01 2021 Received: (at 51711) by debbugs.gnu.org; 11 Nov 2021 00:18:01 +0000 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 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 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) 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) Subject: Re: bug#51711: 28.0.60; rgrep fails to pass the search directory to rgrep-default-command To: Phil Sainty , 51711@debbugs.gnu.org References: From: Dmitry Gutov Message-ID: Date: Thu, 11 Nov 2021 03:17:46 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: 0.4 (/) X-Debbugs-Envelope-To: 51711 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -0.6 (/) 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 From debbugs-submit-bounces@debbugs.gnu.org Wed Nov 10 20:48:19 2021 Received: (at 51711) by debbugs.gnu.org; 11 Nov 2021 01:48:19 +0000 Received: from localhost ([127.0.0.1]:39577 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkzCN-0003L5-LP for submit@debbugs.gnu.org; Wed, 10 Nov 2021 20:48:19 -0500 Received: from smtp-1.orcon.net.nz ([60.234.4.34]:42683) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mkzCI-0003Kt-VP for 51711@debbugs.gnu.org; Wed, 10 Nov 2021 20:48:18 -0500 Received: from [10.253.37.70] (port=30723 helo=webmail.orcon.net.nz) by smtp-1.orcon.net.nz with esmtpa (Exim 4.90_1) (envelope-from ) id 1mkzCG-0002le-Gq; Thu, 11 Nov 2021 14:48:12 +1300 Received: from ip-115-69-175-77.kinect.net.nz ([115.69.175.77]) via [10.253.37.253] by webmail.orcon.net.nz with HTTP (HTTP/1.1 POST); Thu, 11 Nov 2021 14:48:12 +1300 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 11 Nov 2021 14:48:12 +1300 From: Phil Sainty To: Dmitry Gutov Subject: Re: bug#51711: 28.0.60; rgrep fails to pass the search directory to rgrep-default-command In-Reply-To: References: Message-ID: X-Sender: psainty@orcon.net.nz User-Agent: Orcon Webmail X-GeoIP: -- X-Spam_score: -2.9 X-Spam_score_int: -28 X-Spam_bar: -- X-Spam-Score: -0.7 (/) X-Debbugs-Envelope-To: 51711 Cc: 51711@debbugs.gnu.org, DG X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.7 (-) On 2021-11-11 13:17, Dmitry Gutov wrote: > This only matters when grep-find-ignored-directories or > grep-find-ignored-files have been customized to cons values > with functions, right? Yes, I believe so. > Does the below patch work for you? I suppose the answer depends > on whether the functions in the customized car values will know > what to do with ".". Unfortunately I think "." will (at best) be recognised as the default-directory for the buffer from which the rgrep command was initiated -- there's no way for it to derive the specified search directory from that.