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#49836: Support ripgrep in semantic-symref-tool-grep Date: Mon, 20 Sep 2021 20:04:35 +0300 Message-ID: <96b5e4e9-d94d-e8e0-c79b-4d381707654a@yandex.ru> References: <34778BC0-8D97-4266-8B1F-9D1839E858B5@acm.org> <702a8028-3c6e-1d32-3a35-0b208fa356a4@gmail.com> <4dfd4633-e1dc-c573-c481-8fbba25270e4@gmail.com> 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="38894"; 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 Cc: Lars Ingebrigtsen , 49836@debbugs.gnu.org, Juri Linkov To: Jim Porter , Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Sep 20 19:09: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 1mSMn3-0009sw-P2 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Sep 2021 19:09:13 +0200 Original-Received: from localhost ([::1]:56624 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mSMn2-0003Gq-29 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 20 Sep 2021 13:09:12 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46050) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mSMj0-0006Ci-EO for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 13:05:09 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:60636) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mSMj0-00046H-4C for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 13:05:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mSMiz-0005Dd-Oy for bug-gnu-emacs@gnu.org; Mon, 20 Sep 2021 13:05:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 20 Sep 2021 17:05:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 49836 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 49836-submit@debbugs.gnu.org id=B49836.163215748720032 (code B ref 49836); Mon, 20 Sep 2021 17:05:01 +0000 Original-Received: (at 49836) by debbugs.gnu.org; 20 Sep 2021 17:04:47 +0000 Original-Received: from localhost ([127.0.0.1]:43949 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSMil-0005D1-6D for submit@debbugs.gnu.org; Mon, 20 Sep 2021 13:04:47 -0400 Original-Received: from mail-wr1-f41.google.com ([209.85.221.41]:44854) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mSMij-0005Ck-AH for 49836@debbugs.gnu.org; Mon, 20 Sep 2021 13:04:45 -0400 Original-Received: by mail-wr1-f41.google.com with SMTP id d6so31523334wrc.11 for <49836@debbugs.gnu.org>; Mon, 20 Sep 2021 10:04:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=QY1GcnlvsyXty9spg/qRoqqcJ08WZjlDTfaazzI9yNM=; b=a6ecgzZtLThEf8JZf0ROAgHHFmBYxnUBuY5PRAAjdQdbKn9r97BdSE2MpLPslTqr+G E3lBKNslMf/i+TxyTQJxZhJQh5dUmv2GnOPomGQUPnWNC5sIOEElpXZe7IfmlyPTruPC AayNOGuIeNADhzn9f/RQQOuTkovo2AT42wTTIffGJuDKG2Oxf1YUshpF4DxSxaPl8oAR P/+off1bt49gJ3QVIhRfhOeMQSxVSt22IE2fYUbijVFk+6zN9qAEm1Y7Fv5lMPtY8Yxu mw4BHBRJCdW/6Bef9ok2N5k3CYt279qcJpXOVBvsJG25gl0X0qdq9pkeHTP7vyFcvSqp NqHw== 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:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=QY1GcnlvsyXty9spg/qRoqqcJ08WZjlDTfaazzI9yNM=; b=mt0en/44RYr6d4gbzfT1/PNnFYJ2MbYQ4HveF2NZjEVB/KVkgY47SI2Yd8E+3x/kTU S2lbDz/TGsAyJinhxQIJfJGvS9UnrdULbPPWrEyNkacmQQj6VmVQAXJktjZNSMxs2AM6 Rh0/vKXYYbR3Y8smqGdU6iY53WV89x7Y6LWjyxFQUgvkFcDcpF6Az/ZnbwsPlCvIVCVx 8yMft5HVvwTgzeNJ6Xk/ZbzcHBpF1MkyhZlCHDAFLZnWeJapK2GMSEhopPlDSw241jNr yktKSc+WsF4zIGU4lvWbSoOerN4PpyNxmtRRGbbqwUn36FS8RL2n2geoy7aToQmHImhI cI5Q== X-Gm-Message-State: AOAM531ddI3d7XPHuZVmfDFCDf1Mnj7vebVWu6LIKS5t25vsxWtWDyAV hhkLyJQea+pxy4K91jJtV0g= X-Google-Smtp-Source: ABdhPJxm2kspz579PYhOwb6UmpTL/6X2KgB3z3cS6VN4eK/s79KQerMNOy1J2RWTzVl5IUQ0dqM1Hg== X-Received: by 2002:a1c:f713:: with SMTP id v19mr68758wmh.188.1632157479299; Mon, 20 Sep 2021 10:04:39 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id i67sm77375wmi.41.2021.09.20.10.04.37 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 20 Sep 2021 10:04:38 -0700 (PDT) In-Reply-To: <4dfd4633-e1dc-c573-c481-8fbba25270e4@gmail.com> 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:214877 Archived-At: On 20.09.2021 08:09, Jim Porter wrote: > On 9/19/2021 5:14 PM, Dmitry Gutov wrote: >> On 19.09.2021 13:11, Mattias EngdegÄrd wrote: >>> even if the goals are slightly different >> >> Are the goals different? > > I think in the long run, the goals are very much the same. But in the > short run, my goal with urgrep was just to make something that would > work like `rgrep', but support multiple tools. There are already a > multitude of Emacs packages that provide `rgrep'-like functionality for > a particular tool, but I wanted something that worked (almost) the same > no matter what happens to be installed on the system. > >> I'm not sure it's flexible enough to be used in both >> xref-matches-in-files and semantic/symref (yet?), but when I tried to >> imagine a package that would, it looked fairly similar. > > If there are any (useful) commands that can't be generated with > `urgrep-command', but which most grep-like tools support, I definitely > want to add that capability. The current set of options is really just > what I use semi-regularly, so there's bound to be stuff I missed, > especially regarding semantic/symref. semantic/symref/grep is not too complicated in that regard: the command looks like, for example find -H ~/vc/emacs-master -type f \( -name \*..\*emacs -o -name \*.ede -o -name \*.el \) -exec grep -nw -nH --null -e mhtml-mode \{\} + xref's use is slightly different, but ultimately simpler: it assumes files are piped from stdin. So it's either xargs -0 rg -i -nH --no-messages -g '!*/' -e xref-search-program or xargs -0 grep -i -snHE -e And the xargs prefix can be just added on outside of your package. > That said, I don't want to slow things down too much in this bug. Maybe > for Emacs 29 though, it would make sense to put (parts of?) urgrep into > Emacs, since a unified solution would probably be helpful. I'll try to > find some time to post a message to emacs-devel to discuss this and get > some feedback. Sure. Thank you.