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#54177: 28.0.91; project-find-regexp misbehaves with ripgrep over tramp/sudo Date: Sun, 27 Feb 2022 04:45:14 +0200 Message-ID: <09caba9f-d927-352c-3a34-a28a414a0236@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16862"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 To: 54177@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Feb 27 03:46:14 2022 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 1nO9Zd-0004HZ-Ts for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 27 Feb 2022 03:46:13 +0100 Original-Received: from localhost ([::1]:42918 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nO9Zc-0001K5-Gp for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 26 Feb 2022 21:46:12 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43662) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nO9ZS-0001Jw-FP for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 21:46:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:34489) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nO9ZS-0007sE-5Y for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 21:46:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1nO9ZS-0004X0-1v for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 21:46:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 27 Feb 2022 02:46:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 54177 X-GNU-PR-Package: emacs X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.164592992217362 (code B ref -1); Sun, 27 Feb 2022 02:46:01 +0000 Original-Received: (at submit) by debbugs.gnu.org; 27 Feb 2022 02:45:22 +0000 Original-Received: from localhost ([127.0.0.1]:56619 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Yn-0004Vy-Pk for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:45:22 -0500 Original-Received: from lists.gnu.org ([209.51.188.17]:33368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1nO9Ym-0004Vr-HD for submit@debbugs.gnu.org; Sat, 26 Feb 2022 21:45:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43642) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nO9Ym-0001CA-9v for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 21:45:20 -0500 Original-Received: from [2a00:1450:4864:20::333] (port=38548 helo=mail-wm1-x333.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nO9Yk-0007ic-JC for bug-gnu-emacs@gnu.org; Sat, 26 Feb 2022 21:45:20 -0500 Original-Received: by mail-wm1-x333.google.com with SMTP id 10-20020a05600c26ca00b003814df019c2so1035037wmv.3 for ; Sat, 26 Feb 2022 18:45:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:message-id:date:mime-version:user-agent:to:subject :content-language:from:content-transfer-encoding; bh=sUncxTSoeOgqHu5MrjY29Dd5O++A3ejMncN8cEJgSlw=; b=Vzy5kVkqgpoySZFTxWp0rGi7MM7y5wmvxsw+v94d8DoT0KtahvoT0Z8WKvc5pIoe5D LmC+xuD4i2SGTMzO6az15WgPEx8p/dJ1ofwBPXWGNLO5zNMyTNP26T+4XqcTSc+tPxxq QHR/RfgTzHQW8WhIvBxN0K+e/Vb9yaa+/rsG1Wq1cnmclQZEp/bCWdz/FH1fHd6UA02M OuJqrrQxEM7UNr5NgpRtnllrPowBfXEmygOM+kJU0WtTEQdwI28WpxY/90X+nRvDHApX eafp8IYR/TngpmQI5yimWt+zRNZWgBz1TD2P4C0UZ3Qd4lrIM9P+UMhW7rG2/ONmVK0N rVXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:message-id:date:mime-version:user-agent :to:subject:content-language:from:content-transfer-encoding; bh=sUncxTSoeOgqHu5MrjY29Dd5O++A3ejMncN8cEJgSlw=; b=XPNJhpvmlVoO/k7tJ4QzOxo936F8xbxsGUbG2DQ87vUekEek8fltO6pH+H0QHzrWz3 VpuntKJPuwqvamwAI4M6TIRvU449vO/UHb/MIrdCRIOv8uL6H2gnDLHS8B1kwQ/W9QJK mOufp9kCNDm5fK+ITuT/JWMUgUkPloeRh4gUiOWYCizL0f+BYmiG2ZzyixHeEuPwdOFz Ovoux0awoALQBXQsJYyy52OHVS1pnbPdxYWEa4tlyxWN88+/FETXG2cgpbwQbWr1Cj5B ofo/K6CYmiY1IKu4RfpKYqzOhNxHl2cbIDlkDkvscjmtxvsPpIi3ooh+vWCAunGyshMl 9GAg== X-Gm-Message-State: AOAM533THd81LF1BRub3yoE26S2zXZgyOTJd6TOJIj+7RlegXTuUKmUx 3wXxxVgFtFxWO/YEW1BTnLedHPb1FyQ= X-Google-Smtp-Source: ABdhPJwHXoWSv5adbO0KOgvg5qutRQcwfWpwhRKU+Fv8LWPTThSBpcSXPnOfumiFuj/96/yucXjJnQ== X-Received: by 2002:a05:600c:651:b0:381:3d7b:40e0 with SMTP id p17-20020a05600c065100b003813d7b40e0mr7306504wmm.17.1645929916448; Sat, 26 Feb 2022 18:45:16 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id g17-20020a5d5411000000b001e688b4ee6asm7266846wrv.35.2022.02.26.18.45.15 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Feb 2022 18:45:16 -0800 (PST) Content-Language: en-US X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::333 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::333; envelope-from=raaahh@gmail.com; helo=mail-wm1-x333.google.com X-Spam_score_int: 0 X-Spam_score: -0.1 X-Spam_bar: / X-Spam_report: (-0.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no autolearn_force=no X-Spam_action: no action 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:227693 Archived-At: It shows only one match per file, apparently because the process invocations over the 'sudo' transport are recognized as working in a terminal. At least by ripgrep. To repro: 1. (setq xref-search-program 'ripgrep) 2. C-x C-f /sudo:dgutov@localhost:vc/emacs/ RET 3. M-x project-find-regexp RET associative RET 4. Note seeing only one match per file. FWIW, the fix is really simple: diff --git a/lisp/progmodes/xref.el b/lisp/progmodes/xref.el index 0ee7dd5cad..2fd5e19237 100644 --- a/lisp/progmodes/xref.el +++ b/lisp/progmodes/xref.el @@ -1626,7 +1626,7 @@ xref-search-program-alist (ripgrep . ;; '!*/' is there to filter out dirs (e.g. submodules). - "xargs -0 rg --null -nH --no-messages -g '!*/' -e " + "xargs -0 rg --null -nH --no-heading --no-messages -g '!*/' -e " )) "Associative list mapping program identifiers to command templates. Is this okay for Emacs 28? The problem might affect other Tramp transports as well (for all I know), or maybe even other platforms. The risk for the fix seems minimal.