GNU bug report logs - #43086
[PATCH] Allow tags backend to not query for TAGS file

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: "Philip K." <philipk@HIDDEN>; Keywords: patch; dated Fri, 28 Aug 2020 12:51:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 43086 <at> debbugs.gnu.org:


Received: (at 43086) by debbugs.gnu.org; 11 Sep 2022 11:36:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 11 07:36:41 2022
Received: from localhost ([127.0.0.1]:40975 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1oXLGT-0005sX-4Q
	for submit <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:36:41 -0400
Received: from quimby.gnus.org ([95.216.78.240]:39638)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1oXLGR-0005sE-KE
 for 43086 <at> debbugs.gnu.org; Sun, 11 Sep 2022 07:36:40 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:Date:References:
 In-Reply-To:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=DRsrnBG4W1eYtbZXKpjYsJv5nBnXBENxiRmkKvwJh7w=; b=CMxHwv0b21sS7UJQG86Sgrlfw9
 3z7bxjVir7crArI+lNEWdohtIhZEMLR1CGLkIhGIOG0PWCMB+bE8TSHKTq7j/4yDQJueyw4TPFFry
 hbCfPxF6Bf+e7IlsgPmFELvrNKS6xsuHN+VBBJ0B0Bf/DlGCA0S4qChTuEXRDymQXQZs=;
Received: from [84.212.220.105] (helo=joga)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1oXLGJ-0003vt-FM; Sun, 11 Sep 2022 13:36:33 +0200
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Philip Kaludercic <philipk@HIDDEN>
Subject: Re: bug#43086: [PATCH] Allow tags backend to not query for TAGS file
In-Reply-To: <87v90veha7.fsf@HIDDEN> (Philip Kaludercic's message of "Sun, 
 14 Nov 2021 00:02:08 +0000")
References: <87d02yefr5.fsf@HIDDEN>
 <f225337a-23d4-0aaf-a178-1fe1f9826749@HIDDEN>
 <87r1blu6eu.fsf@HIDDEN> <87v90veha7.fsf@HIDDEN>
X-Now-Playing: Insides's _Euphoria_: "Further Distractions"
Date: Sun, 11 Sep 2022 13:36:30 +0200
Message-ID: <87edwif8ht.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Philip Kaludercic <philipk@HIDDEN> writes: >> This was
 over a year ago, and it's unclear whether we wanted to do in >> Philip's
 patch's direction or not? > > What exactly was the issue with my suggestion?
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43086
Cc: 43086 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Philip Kaludercic <philipk@HIDDEN> writes:

>> This was over a year ago, and it's unclear whether we wanted to do in
>> Philip's patch's direction or not?  
>
> What exactly was the issue with my suggestion?

Dmitry said:

> I set etags-query-file to nil and call xref-find-references with
> ido-mode enabled. And still get queried for a tags file.
> 
> Because etags--xref-backend still returns 'etags, but then
> xref-backend-identifier-completion-table calls
> tags-lazy-completion-table, which does the prompting.
> 
> If I make etags--xref-backend return nil, I simply get "No applicable
> method: xref-backend-identifier-completion-table, nil" instead.
> 
> So a deeper change is needed.





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43086; Package emacs. Full text available.

Message received at 43086 <at> debbugs.gnu.org:


Received: (at 43086) by debbugs.gnu.org; 14 Nov 2021 00:02:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Nov 13 19:02:22 2021
Received: from localhost ([127.0.0.1]:48491 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mm2yU-0003fj-0Y
	for submit <at> debbugs.gnu.org; Sat, 13 Nov 2021 19:02:22 -0500
Received: from mout01.posteo.de ([185.67.36.65]:57745)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1mm2yP-0003fP-43
 for 43086 <at> debbugs.gnu.org; Sat, 13 Nov 2021 19:02:20 -0500
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id C9FB9240027
 for <43086 <at> debbugs.gnu.org>; Sun, 14 Nov 2021 01:02:10 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1636848130; bh=7fr3Nyo3kaQZHalZ2hHr6n7v4ccxwk1S8ED03j/lLSo=;
 h=From:To:Cc:Subject:Autocrypt:Date:From;
 b=oBG9FNpHDqeafuUbeEnEnp1MLlD4JWZsQRiyvPTuIBc8n+q4DS+43t/989GjY7j23
 SSKah4Mg8kPEsDR+5Vc6MnV56VoVK5mwd0n3Hg9issYpZC0ogcrbTbtNa8pSaBjMrU
 32UoiPX2ltfE6tqvJ0bw5nQZCF+V5sZojZUgnd17E1HDq1QwCucE+l7n9OofrfLxwO
 2TO4dAMPbw2sqC9znP5XEDUuHU9m8VTN9lLAkl2iY26xkvAD1fdKiKsx2Mer58NGpN
 wJ6J5JOaxnU0SJDvK5mWaqUKo/HAykFwH0J637fOUQSYyFIe/tGDHysO8RUqw4bYxe
 UgcmoZEk+cFvA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4HsCDd3vnfz9rwg;
 Sun, 14 Nov 2021 01:02:09 +0100 (CET)
From: Philip Kaludercic <philipk@HIDDEN>
To: Lars Ingebrigtsen <larsi@HIDDEN>
Subject: Re: bug#43086: [PATCH] Allow tags backend to not query for TAGS file
References: <87d02yefr5.fsf@HIDDEN>
 <f225337a-23d4-0aaf-a178-1fe1f9826749@HIDDEN>
 <87r1blu6eu.fsf@HIDDEN>
Autocrypt: addr=philipk@HIDDEN; prefer-encrypt=nopreference; keydata=
 mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ
 CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh
 io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF
 AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo
 Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS
 g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB
Date: Sun, 14 Nov 2021 00:02:08 +0000
In-Reply-To: <87r1blu6eu.fsf@HIDDEN> (Lars Ingebrigtsen's message of "Fri,
 12 Nov 2021 09:25:45 +0100")
Message-ID: <87v90veha7.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43086
Cc: 43086 <at> debbugs.gnu.org, Dmitry Gutov <dgutov@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Lars Ingebrigtsen <larsi@HIDDEN> writes:

> Dmitry Gutov <dgutov@HIDDEN> writes:
>
>>>> - The possible values all look pretty clever, but there are a lot of
>>>> them! Do we expect them all to be in demand? Ideally, I'd only leave 2-3
>>>> of them, to reduce the number of workflows we need to care about.
>>> I'm ok with that, the variable could also be turned into a hook if
>>> reducing preconfigured options while making it easy to add new
>>> behaviours.
>>
>> Not sure how the direct conversion to a hook would look like.
>>
>> In any case, when I talked about using a hook (find-file-hook in
>> particular), the main benefit I had in mind is that the effect would
>> cover all uses of etags.el. Meaning, also
>> tags-completion-at-point-function.
>
> This was over a year ago, and it's unclear whether we wanted to do in
> Philip's patch's direction or not?  

What exactly was the issue with my suggestion?

-- 
	Philip Kaludercic




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43086; Package emacs. Full text available.

Message received at 43086 <at> debbugs.gnu.org:


Received: (at 43086) by debbugs.gnu.org; 12 Nov 2021 08:25:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Nov 12 03:25:56 2021
Received: from localhost ([127.0.0.1]:43388 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1mlRsi-0008Qf-GI
	for submit <at> debbugs.gnu.org; Fri, 12 Nov 2021 03:25:56 -0500
Received: from quimby.gnus.org ([95.216.78.240]:34844)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <larsi@HIDDEN>) id 1mlRsg-0008QS-Dy
 for 43086 <at> debbugs.gnu.org; Fri, 12 Nov 2021 03:25:55 -0500
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnus.org;
 s=20200322; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date:
 References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding:
 Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender:
 Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:
 List-Subscribe:List-Post:List-Owner:List-Archive;
 bh=PlMOEx0PBhLQvVFtZlyzkYCcPKvpQ4HZGbtOgbfJINA=; b=W110D3bybfY380R6VQHbSCO016
 g0xBndVBmijqH8io/wgMrZsA56t3dPNviAhyOOdQh/1ZNv6QFMpzwES1NPU53Ztvu+RyuWFCbTc49
 KlXlzrNnSjSJLbAbWKWX9idKZWef920kxyNXQ1hnXcNQ+c7Mr3DY+oTBatoMdVM11t7A=;
Received: from [84.212.220.105] (helo=xo)
 by quimby.gnus.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.92) (envelope-from <larsi@HIDDEN>)
 id 1mlRsY-0005i4-2v; Fri, 12 Nov 2021 09:25:48 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#43086: [PATCH] Allow tags backend to not query for TAGS file
References: <87d02yefr5.fsf@HIDDEN>
 <f225337a-23d4-0aaf-a178-1fe1f9826749@HIDDEN>
X-Now-Playing: Sonic Youth's _NYC Ghosts & Flowers_: "NYC Ghosts & Flowers"
Date: Fri, 12 Nov 2021 09:25:45 +0100
In-Reply-To: <f225337a-23d4-0aaf-a178-1fe1f9826749@HIDDEN> (Dmitry Gutov's
 message of "Wed, 16 Sep 2020 13:53:46 +0300")
Message-ID: <87r1blu6eu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Report: Spam detection software, running on the system "quimby.gnus.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 @@CONTACT_ADDRESS@@ for details.
 Content preview:  Dmitry Gutov <dgutov@HIDDEN> writes: >>> - The possible
 values all look pretty clever, but there are a lot of >>> them! Do we expect
 them all to be in demand? Ideally, I'd only leave 2-3 >>> of them, to reduce
 the number of workflows we [...] 
 Content analysis details:   (-2.9 points, 5.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -1.0 ALL_TRUSTED            Passed through trusted hosts only via SMTP
 -1.9 BAYES_00               BODY: Bayes spam probability is 0 to 1%
 [score: 0.0000]
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 43086
Cc: "Philip K." <philipk@HIDDEN>, 43086 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

Dmitry Gutov <dgutov@HIDDEN> writes:

>>> - The possible values all look pretty clever, but there are a lot of
>>> them! Do we expect them all to be in demand? Ideally, I'd only leave 2-3
>>> of them, to reduce the number of workflows we need to care about.
>> I'm ok with that, the variable could also be turned into a hook if
>> reducing preconfigured options while making it easy to add new
>> behaviours.
>
> Not sure how the direct conversion to a hook would look like.
>
> In any case, when I talked about using a hook (find-file-hook in
> particular), the main benefit I had in mind is that the effect would
> cover all uses of etags.el. Meaning, also
> tags-completion-at-point-function.

This was over a year ago, and it's unclear whether we wanted to do in
Philip's patch's direction or not?  

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43086; Package emacs. Full text available.

Message received at 43086 <at> debbugs.gnu.org:


Received: (at 43086) by debbugs.gnu.org; 16 Sep 2020 10:53:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Sep 16 06:53:59 2020
Received: from localhost ([127.0.0.1]:33347 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kIV4Z-0000ny-01
	for submit <at> debbugs.gnu.org; Wed, 16 Sep 2020 06:53:59 -0400
Received: from mail-lj1-f196.google.com ([209.85.208.196]:35616)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kIV4U-0000ni-Lj
 for 43086 <at> debbugs.gnu.org; Wed, 16 Sep 2020 06:53:57 -0400
Received: by mail-lj1-f196.google.com with SMTP id a15so5546517ljk.2
 for <43086 <at> debbugs.gnu.org>; Wed, 16 Sep 2020 03:53:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:cc:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language;
 bh=WT3R+nuzcW4G+qXPJwXKEoBrFBOXIkk/kc4nSNFComo=;
 b=gFQqQghXhJ1UdxcKoqbtBp2ofhCzKmEXyGnl6w6LIq8fTomi1it74TR62sOvm5/VHw
 yE7R6mxcSKaiTNM8W3O70Nv/igBbIU+TnAcy+Sbx8Gkue2APOJEwCematDhxoWO+lrSX
 WkfO+xQbcmB2xAKYDUkPsGVQV7wUYy0GhCGAn4Az3IN89G7SFYXcG4eXHouKfJ3rB31A
 mXYhp6SijlQcJ8156bABGex07OZHKuMV5OCIFAbNTW4ketyrI+wJQl/Cw5lnfxfYCUTL
 eEdso6vyYqzMebPpC38F7wr6HPry5ea0By1oBaVxfFokogizCmN3PaiyFgWDNpfIWhEk
 4H8Q==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:sender:subject:to:cc:references:from:message-id
 :date:user-agent:mime-version:in-reply-to:content-language;
 bh=WT3R+nuzcW4G+qXPJwXKEoBrFBOXIkk/kc4nSNFComo=;
 b=UMlcQwKZTgwHYLbnmrcBGB56/7p2HE5qTiZGu+RPcX1BvoXnU2eVeGqNMKRvDxyWe6
 JGEX4SoPkNRQilY4lAf6A1XnYFcUPrpAU6J5t6jawbr7XrysAwPHScDnmgpwAix6r5wr
 7ffbcgF1Z8uphMqcX0n5vD36I+KR6TwOtebyuNvIIrBWXlbmaAYLY4zgZsgIzsFEYdYL
 JaO8V5e4vNB0+pW1lR7B7y030AtdInGArf32Kv3DiJc6/nizgjWi+txWrv9tzxt0//OM
 Xj2JwmuI1JY/IcgX+HdHeDKImrR7zoH2wJIxU8agSaepDaDTT+Ip2Vi9fntr6UOlZiMp
 nBEg==
X-Gm-Message-State: AOAM532auVontSyQzKkBkrn3AbbANjD/p61e5qjj+Uvs292dTfa5b0VX
 4gOtN65v7nUVu+YD9arzxTTPhQurzMQ=
X-Google-Smtp-Source: ABdhPJyKOOjMKB0zCXe9GNmtA8ninklQffuhgSYiWtTJB21d6IAU+zdPV9MZAmcSTJeVWq7StMBdTA==
X-Received: by 2002:a2e:b174:: with SMTP id a20mr8061560ljm.407.1600253628153; 
 Wed, 16 Sep 2020 03:53:48 -0700 (PDT)
Received: from [192.168.0.104] ([94.229.108.16])
 by smtp.googlemail.com with ESMTPSA id e9sm4495268lfn.237.2020.09.16.03.53.46
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Wed, 16 Sep 2020 03:53:47 -0700 (PDT)
Subject: Re: bug#43086: [PATCH] Allow tags backend to not query for TAGS file
To: "Philip K." <philipk@HIDDEN>
References: <87d02yefr5.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <f225337a-23d4-0aaf-a178-1fe1f9826749@HIDDEN>
Date: Wed, 16 Sep 2020 13:53:46 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <87d02yefr5.fsf@HIDDEN>
Content-Type: multipart/mixed; boundary="------------10F7F4AC33FDB703B10FCBB2"
Content-Language: en-US
X-Spam-Score: 0.4 (/)
X-Debbugs-Envelope-To: 43086
Cc: 43086 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -0.6 (/)

This is a multi-part message in MIME format.
--------------10F7F4AC33FDB703B10FCBB2
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit

On 07.09.2020 00:50, Philip K. wrote:
> Dmitry Gutov <dgutov@HIDDEN> writes:
> 
>> Hi!
>>
>> On 28.08.2020 15:50, Philip K. wrote:
>>
>>> the xref backend for etags can be annoying at times, especially in
>>> combination with other backends. This patch should improve the
>>> situation, by allowing the user to configure how and when the etags
>>> backend is activated. The new user option etags-query-file would allow
>>> the backend to never query a TAGS file, or conditionally, depending on
>>> the existence of a TAGS file (in which case it can also be automatically
>>> loaded).
>>
>> This is a interesting patch, but it calls for some discussion:
>>
>> - The possible values all look pretty clever, but there are a lot of
>> them! Do we expect them all to be in demand? Ideally, I'd only leave 2-3
>> of them, to reduce the number of workflows we need to care about.
> 
> I'm ok with that, the variable could also be turned into a hook if
> reducing preconfigured options while making it easy to add new
> behaviours.

Not sure how the direct conversion to a hook would look like.

In any case, when I talked about using a hook (find-file-hook in 
particular), the main benefit I had in mind is that the effect would 
cover all uses of etags.el. Meaning, also tags-completion-at-point-function.

>> The rest could probably be set up in individual user configurations in
>> find-file-hook (like Projectile does).
> 
> I'm not familiar with how Projectile does this, or how this would work
> in general? Could you give an example?

projectile-mode adds projectile-find-file-hook-function to 
find-file-hook, which, upon visiting any file, looks for 
projectile-tags-file-name (usually "TAGS")'s presence in the root of the 
project. When such file exists, it calls (visit-tags-table tags-file t), 
to visit the tags table "locally".

Since project.el does not have a minor mode, and out of general 
(admittedly handwavy) considerations of performance, we don't do that. 
But a user could customize their find-file-hook with a similar logic. If 
you like, you could also add a pre-existing function like that to 
project.el that a user could then just add to find-file-hook.

>> - The variable name implies it affects how etags.el works globally, but
>> the actual effect seems limited to the xref backend function. We should
>> either rename it to something like etags-xref-query-file, or consider
>> having it affect tags-completion-at-point-function as well.
> 
> I'm fine with either, but the first option seems simpler, unless there
> is still interest in maintaining the non-xref interface.

There might be some other benefit to the latter, but it doesn't seem 
trivial, so the former sounds fine to me as well.

>> - One current persistent annoyance is that currently
>> xref-find-references doesn't work well in many files where the xref
>> backend is the default one (etags) when ido-mode or icomplete-mode are
>> enabled because it prompts for the tags file to do identifier
>> completion. I wonder if the "no query" option will help with this, too.
> 
> Unless I'm misunderstanding something, that's exactly the situation
> that motivated me to write these patches (just because of Ivy not Ido).

I set etags-query-file to nil and call xref-find-references with 
ido-mode enabled. And still get queried for a tags file.

Because etags--xref-backend still returns 'etags, but then 
xref-backend-identifier-completion-table calls 
tags-lazy-completion-table, which does the prompting.

If I make etags--xref-backend return nil, I simply get "No applicable 
method: xref-backend-identifier-completion-table, nil" instead.

So a deeper change is needed.

>>> I could imagine this might be extended to allow an auto-generate option,
>>> but that feature seems out of scope of this patch, and probably would
>>> require some interoperation with project.el.
>>
>> Indeed. Actually, I have an old, WIP patch for tag file auto-generation
>> which, yes, uses project.el. I can post it again if you're curious.
> 
> Sure, why not?

Here it is. It might even be functional.

The reason it's not installed yet, is I was looking to create a seamless 
user experience with it, when they don't need to know which tags file is 
visited, and when. And with tags being quickly updated after a file is 
changed and saved.

The related discussion about necessary changes to etags fizzled out, 
however.

--------------10F7F4AC33FDB703B10FCBB2
Content-Type: text/x-patch; charset=UTF-8;
 name="etags-project.diff"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
 filename="etags-project.diff"

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index a31668e1ba..9da2143525 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2109,7 +2109,9 @@ etags-xref-find-definitions-tag-order
   "Tag order used in `xref-backend-definitions' to look for definitions.")
 
 ;;;###autoload
-(defun etags--xref-backend () 'etags)
+(defun etags--xref-backend ()
+  (etags--maybe-use-project-tags)
+  'etags)
 
 (cl-defmethod xref-backend-identifier-at-point ((_backend (eql etags)))
   (find-tag--default))
@@ -2180,6 +2182,58 @@ xref-make-etags-location
     (nth 1 tag-info)))
 
 
+;;; Simple tags generation, with automatic invalidation
+
+(defvar etags--project-tags-file nil)
+(defvar etags--project-tags-root nil)
+
+(defun etags--maybe-use-project-tags ()
+  (let (proj)
+    (when (and etags--project-tags-root
+               (not (file-in-directory-p default-directory
+                                         etags--project-tags-root)))
+      (etags--project-tags-cleanup))
+    (when (and (not (or tags-file-name
+                        tags-table-list))
+               (setq proj (project-current)))
+      (etags--project-tags-generate proj)
+      ;; Invalidate the scanned tags after any change is written to disk.
+      (add-hook 'after-save-hook #'etags--project-tags-cleanup)
+      (visit-tags-table etags--project-tags-file))))
+
+(defun etags--project-tags-generate (proj)
+  (let* ((root (cl-find default-directory
+                        (project-roots proj)
+                        :test #'file-in-directory-p))
+         (default-directory root)
+         (files (all-completions "" (project-file-completion-table proj (list root))))
+         (etags-command (executable-find "etags"))
+         ;; FIXME: List all extensions, or wait for etags fix.
+         ;; http://lists.gnu.org/archive/html/emacs-devel/2018-01/msg00323.html
+         (extensions '("rb" "js" "py" "pl" "el" "c" "cpp" "cc" "h" "hh" "hpp"
+                       "java" "go" "cl" "lisp" "prolog" "php" "erl" "hrl"
+                       "F" "f" "f90" "for" "cs" "a" "asm" "ads" "adb" "ada"))
+         (file-regexp (format "\\.%s\\'" (regexp-opt extensions))))
+    (setq etags--project-tags-file (make-temp-file "emacs-project-tags-")
+          etags--project-tags-root root)
+    (with-temp-buffer
+      (mapc (lambda (f)
+              (when (string-match-p file-regexp f)
+                (insert f "\n")))
+            files)
+      (shell-command-on-region (point-min) (point-max)
+                               (format "%s - -o %s" etags-command etags--project-tags-file)
+                               nil nil "*etags-project-tags-errors*" t))))
+
+(defun etags--project-tags-cleanup ()
+  (when etags--project-tags-file
+    (delete-file etags--project-tags-file)
+    (setq tags-file-name nil
+          tags-table-list nil
+          etags--project-tags-file nil
+          etags--project-tags-root nil))
+  (remove-hook 'after-save-hook #'etags--project-tags-cleanup))
+
 (provide 'etags)
 
 ;;; etags.el ends here

--------------10F7F4AC33FDB703B10FCBB2--




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43086; Package emacs. Full text available.

Message received at 43086 <at> debbugs.gnu.org:


Received: (at 43086) by debbugs.gnu.org; 6 Sep 2020 21:51:03 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Sep 06 17:51:03 2020
Received: from localhost ([127.0.0.1]:47290 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kF2Yx-0003jT-Ds
	for submit <at> debbugs.gnu.org; Sun, 06 Sep 2020 17:51:03 -0400
Received: from mout01.posteo.de ([185.67.36.65]:58609)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1kF2Yv-0003ir-Rv
 for 43086 <at> debbugs.gnu.org; Sun, 06 Sep 2020 17:51:02 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 52EBD16005F
 for <43086 <at> debbugs.gnu.org>; Sun,  6 Sep 2020 23:50:55 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1599429055; bh=rI9e75aLrSeMl/qDX758PRbiO09uVO+/wp9SzueLifI=;
 h=From:To:Cc:Subject:Date:From;
 b=ekiw8IjTaudMSZzRhJQrZX6Bjg6UV5/nIfhhoPq3z7nG/NQfSwr4DkLWYKXjYaIMu
 Hk2a04dhkXnrAzT9LVoHwea5tqXu0FUlwxXNk4agdEPnR6xdB52EFm3YIJs4fgs4JP
 SBqvqfTfv5iVoytY9in0EZOhTaEKLfzKx91Wxg4iy6m1wEMWv+6lcGu6Emb5NQNKKY
 8aUCP0olBsXRgtb6XaLZLItgBisXV7II1PCC1H7fIYQ0//aSimiBQqksiRFNITbEpG
 RL+6IKwjE8XVQ5cDD5LtrcBF4X55W/qzWr2nG0YLntiTIdPQPRaXy0Qwt9S09rwR9H
 lTzLKa8ZGQK3A==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Bl4q24kMBz9rxD;
 Sun,  6 Sep 2020 23:50:54 +0200 (CEST)
From: "Philip K." <philipk@HIDDEN>
To: Dmitry Gutov <dgutov@HIDDEN>
Subject: Re: bug#43086: [PATCH] Allow tags backend to not query for TAGS file
In-Reply-To: <cfd9096b-6787-236e-7780-df2aa63a94d3@HIDDEN> (message from
 Dmitry Gutov on Sat, 5 Sep 2020 03:45:17 +0300)
Date: Sun, 06 Sep 2020 23:50:54 +0200
Message-ID: <87d02yefr5.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 43086
Cc: 43086 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Dmitry Gutov <dgutov@HIDDEN> writes:

> Hi!
>
> On 28.08.2020 15:50, Philip K. wrote:
>
>> the xref backend for etags can be annoying at times, especially in
>> combination with other backends. This patch should improve the
>> situation, by allowing the user to configure how and when the etags
>> backend is activated. The new user option etags-query-file would allow
>> the backend to never query a TAGS file, or conditionally, depending on
>> the existence of a TAGS file (in which case it can also be automatically
>> loaded).
>
> This is a interesting patch, but it calls for some discussion:
>
> - The possible values all look pretty clever, but there are a lot of 
> them! Do we expect them all to be in demand? Ideally, I'd only leave 2-3 
> of them, to reduce the number of workflows we need to care about.

I'm ok with that, the variable could also be turned into a hook if
reducing preconfigured options while making it easy to add new
behaviours.

> The rest could probably be set up in individual user configurations in
> find-file-hook (like Projectile does).

I'm not familiar with how Projectile does this, or how this would work
in general? Could you give an example?

> - The variable name implies it affects how etags.el works globally, but 
> the actual effect seems limited to the xref backend function. We should 
> either rename it to something like etags-xref-query-file, or consider 
> having it affect tags-completion-at-point-function as well.

I'm fine with either, but the first option seems simpler, unless there
is still interest in maintaining the non-xref interface.

> - One current persistent annoyance is that currently 
> xref-find-references doesn't work well in many files where the xref 
> backend is the default one (etags) when ido-mode or icomplete-mode are 
> enabled because it prompts for the tags file to do identifier 
> completion. I wonder if the "no query" option will help with this, too.

Unless I'm misunderstanding something, that's exactly the situation
that motivated me to write these patches (just because of Ivy not Ido).

>> I could imagine this might be extended to allow an auto-generate option,
>> but that feature seems out of scope of this patch, and probably would
>> require some interoperation with project.el.
>
> Indeed. Actually, I have an old, WIP patch for tag file auto-generation 
> which, yes, uses project.el. I can post it again if you're curious.

Sure, why not?

-- 
	Philip K.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43086; Package emacs. Full text available.

Message received at 43086 <at> debbugs.gnu.org:


Received: (at 43086) by debbugs.gnu.org; 5 Sep 2020 00:45:27 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Sep 04 20:45:27 2020
Received: from localhost ([127.0.0.1]:41128 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kEMKd-0006Ym-EP
	for submit <at> debbugs.gnu.org; Fri, 04 Sep 2020 20:45:27 -0400
Received: from mail-lj1-f193.google.com ([209.85.208.193]:44576)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <raaahh@HIDDEN>) id 1kEMKb-0006SE-PX
 for 43086 <at> debbugs.gnu.org; Fri, 04 Sep 2020 20:45:26 -0400
Received: by mail-lj1-f193.google.com with SMTP id b19so9915835lji.11
 for <43086 <at> debbugs.gnu.org>; Fri, 04 Sep 2020 17:45:25 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=sender:subject:to:references:from:message-id:date:user-agent
 :mime-version:in-reply-to:content-language:content-transfer-encoding;
 bh=IluDPIU6rKGmhoN7sPWtYnIfhxG5v4LWAP9u3p8/FNM=;
 b=p8oOZyBjQhkCK9CnzwzrS+TzpEAKupodGNkqsOYb7HFfN7bt7KxU/EG4Pxr3KAAqS9
 5gEWh0WDMGmmBl6JJthd9LZXvbkGv4TA2fX3eJKwDMrBrLvS61F5rZpQVP6kCtqiI2ld
 dExc+9bJUDmyYKkzJM48hhIu+H1a369rbgVtWHIyrc3krNcFQC9V6JvZNf8C80zYWiHl
 SNQyV9qtryqOeyMHphylU9n9ePEp72RaOtPzRgp/BIRDGpIOksOwo4zln1WCzMRw9kx9
 goBsuoSL1zt6oIFsFUCkFNsKs6xVpldkfpGEpsVucoZTK/YorSNBrKSYFzX8k6PCjHB4
 Q/Tw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 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=IluDPIU6rKGmhoN7sPWtYnIfhxG5v4LWAP9u3p8/FNM=;
 b=oCwIK2jIV0d45xoIJFvDwdSGMkXbUwU+AtmPNGGOZyOw1LSBvZik6f+tnKWH7f7A7G
 OfFuyqMFO5qVuh6bJ0bWMUq9cNucUBmEmZlhICDHHuseGEaH9+jrWvOKUKMUIPq1nT8R
 H1lo/MEeJrfK0AL9cumUD4p8/8+2xS+Jdg8KjQcQbiSYFbePkYygQ+ayw1bYVPadwnYt
 3t80r03EMeuq2KMtqesD17AQ03UGFOTgV58Wd5D5p3unFaYLU5ENIRTHgLwKFnk8fqt5
 hV6VVe53+qehW2chb1J2XbppC9/Kxp2x9QpU1S9SBWzgOjfAEvh+2gggzy7AgaOTAWlf
 QWsA==
X-Gm-Message-State: AOAM531nsH3X00qgEGk0UQtgAd5NlGgKPtbfowSnA9RECpi8gLvEc3F4
 K49Pn/TAyFQ1L2gLNMVmaHprZ9uRmR0=
X-Google-Smtp-Source: ABdhPJzSm5Qyn4F6imKS2WiD+3r5m5QTXqqPV3niP7vB/L0lGETiDK2EE3lwvd9oeOavorsv2QKinQ==
X-Received: by 2002:a2e:2241:: with SMTP id i62mr5428791lji.265.1599266719378; 
 Fri, 04 Sep 2020 17:45:19 -0700 (PDT)
Received: from [192.168.0.104] ([94.229.108.16])
 by smtp.googlemail.com with ESMTPSA id x20sm1531628ljc.38.2020.09.04.17.45.18
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Fri, 04 Sep 2020 17:45:18 -0700 (PDT)
Subject: Re: bug#43086: [PATCH] Allow tags backend to not query for TAGS file
To: "Philip K." <philipk@HIDDEN>, 43086 <at> debbugs.gnu.org
References: <87k0xjue75.fsf@HIDDEN>
From: Dmitry Gutov <dgutov@HIDDEN>
Message-ID: <cfd9096b-6787-236e-7780-df2aa63a94d3@HIDDEN>
Date: Sat, 5 Sep 2020 03:45:17 +0300
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101
 Thunderbird/68.10.0
MIME-Version: 1.0
In-Reply-To: <87k0xjue75.fsf@HIDDEN>
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Language: en-US
Content-Transfer-Encoding: 7bit
X-Spam-Score: 3.7 (+++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 Content preview:  Hi! On 28.08.2020 15:50, Philip K. wrote: > the xref backend
 for etags can be annoying at times, especially in > combination with other
 backends. This patch should improve the > situation, by allowing the user
 to configure how and when the et [...] 
 Content analysis details:   (3.7 points, 10.0 required)
 pts rule name              description
 ---- ---------------------- --------------------------------------------------
 0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
 provider (raaahh[at]gmail.com)
 0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
 mail domains are different
 0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
 [94.229.108.16 listed in zen.spamhaus.org]
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
 [209.85.208.193 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
 no trust [209.85.208.193 listed in list.dnswl.org]
 0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
 EnvelopeFrom freemail headers are different
 -0.1 NICE_REPLY_A           Looks like a legit reply (A)
X-Debbugs-Envelope-To: 43086
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 2.7 (++)
X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org",
 has NOT identified this incoming email as spam.  The original
 message has been attached to this so you can view it or label
 similar future email.  If you have any questions, see
 the administrator of that system for details.
 
 Content preview:  Hi! On 28.08.2020 15:50, Philip K. wrote: > the xref backend
    for etags can be annoying at times, especially in > combination with other
    backends. This patch should improve the > situation, by allowing the user
    to configure how and when the et [...] 
 
 Content analysis details:   (2.7 points, 10.0 required)
 
  pts rule name              description
 ---- ---------------------- --------------------------------------------------
 -0.0 RCVD_IN_MSPIKE_H2      RBL: Average reputation (+2)
                             [209.85.208.193 listed in wl.mailspike.net]
 -0.0 RCVD_IN_DNSWL_NONE     RBL: Sender listed at https://www.dnswl.org/,
                              no trust
                             [209.85.208.193 listed in list.dnswl.org]
  3.6 RCVD_IN_SBL_CSS        RBL: Received via a relay in Spamhaus SBL-CSS
                             [94.229.108.16 listed in zen.spamhaus.org]
  0.0 FREEMAIL_FROM          Sender email is commonly abused enduser mail
                             provider (dgutov[at]yandex.ru)
  0.0 HEADER_FROM_DIFFERENT_DOMAINS From and EnvelopeFrom 2nd level
                             mail domains are different
  0.0 SPF_HELO_NONE          SPF: HELO does not publish an SPF Record
 -0.0 SPF_PASS               SPF: sender matches SPF record
 -1.0 MAILING_LIST_MULTI     Multiple indicators imply a widely-seen list
                             manager
  0.2 FREEMAIL_FORGED_FROMDOMAIN 2nd level domains in From and
                             EnvelopeFrom freemail headers are
                             different
 -0.1 NICE_REPLY_A           Looks like a legit reply (A)

Hi!

On 28.08.2020 15:50, Philip K. wrote:

> the xref backend for etags can be annoying at times, especially in
> combination with other backends. This patch should improve the
> situation, by allowing the user to configure how and when the etags
> backend is activated. The new user option etags-query-file would allow
> the backend to never query a TAGS file, or conditionally, depending on
> the existence of a TAGS file (in which case it can also be automatically
> loaded).

This is a interesting patch, but it calls for some discussion:

- The possible values all look pretty clever, but there are a lot of 
them! Do we expect them all to be in demand? Ideally, I'd only leave 2-3 
of them, to reduce the number of workflows we need to care about. The 
rest could probably be set up in individual user configurations in 
find-file-hook (like Projectile does).

- The variable name implies it affects how etags.el works globally, but 
the actual effect seems limited to the xref backend function. We should 
either rename it to something like etags-xref-query-file, or consider 
having it affect tags-completion-at-point-function as well. Maybe 
find-tag too. But given that tags-completion-at-point-function has for a 
long time behaved in the "never query" fashion, perhaps the easiest and 
most backward-compatible option is the former.

- One current persistent annoyance is that currently 
xref-find-references doesn't work well in many files where the xref 
backend is the default one (etags) when ido-mode or icomplete-mode are 
enabled because it prompts for the tags file to do identifier 
completion. I wonder if the "no query" option will help with this, too.

> I could imagine this might be extended to allow an auto-generate option,
> but that feature seems out of scope of this patch, and probably would
> require some interoperation with project.el.

Indeed. Actually, I have an old, WIP patch for tag file auto-generation 
which, yes, uses project.el. I can post it again if you're curious.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#43086; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 28 Aug 2020 12:50:51 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri Aug 28 08:50:51 2020
Received: from localhost ([127.0.0.1]:45468 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1kBdqF-0004Uo-AP
	for submit <at> debbugs.gnu.org; Fri, 28 Aug 2020 08:50:51 -0400
Received: from lists.gnu.org ([209.51.188.17]:41920)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@HIDDEN>) id 1kBdqB-0004Uc-IR
 for submit <at> debbugs.gnu.org; Fri, 28 Aug 2020 08:50:50 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:42080)
 by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1kBdqB-0006dG-6b
 for bug-gnu-emacs@HIDDEN; Fri, 28 Aug 2020 08:50:47 -0400
Received: from mout02.posteo.de ([185.67.36.66]:41395)
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <philipk@HIDDEN>)
 id 1kBdq7-00070u-PH
 for bug-gnu-emacs@HIDDEN; Fri, 28 Aug 2020 08:50:46 -0400
Received: from submission (posteo.de [89.146.220.130]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 770582400FE
 for <bug-gnu-emacs@HIDDEN>; Fri, 28 Aug 2020 14:50:40 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1598619040; bh=Uq73Ld46Rn2qmkaodImXFtCkzzSX2oK61+unup3UqvY=;
 h=From:To:Subject:Date:From;
 b=MqoNx1fb4Djm5f4K7WhqaG/kgy/bBDYWOa95maTzcYpndQVFdiKOSuXawZdTL3v72
 HiTLQQpTJMenPX8x0vGm7ERsg/oH+RdEkVf4uWCKyqgqRtY9ow/6F5O1v5qFObCppl
 5HO8rLNT3u/fF0RWlRajZieCjcNtD7XrFnGRacQCrxOhahksJFKZKJKReDW4SOhYAv
 TjRFQgQYmaTlOGQrVKcxV24FjJSfhscPjytU3NtQbCvtdWiwCtzu2jUHxF63MQMcD5
 QYCpzOBDFP5s97W0w7Tzivz+FB9DsktHB9yDSdlqSefxWNCNwuOyiazPzzviKVa5U5
 Ns7o2mSyC325g==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4BdKFq66fqz6tmZ
 for <bug-gnu-emacs@HIDDEN>; Fri, 28 Aug 2020 14:50:39 +0200 (CEST)
From: "Philip K." <philipk@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: [PATCH] Allow tags backend to not query for TAGS file
Date: Fri, 28 Aug 2020 14:50:38 +0200
Message-ID: <87k0xjue75.fsf@HIDDEN>
MIME-Version: 1.0
Content-Type: multipart/mixed; boundary="=-=-="
Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@HIDDEN;
 helo=mout02.posteo.de
X-detected-operating-system: by eggs.gnu.org: First seen = 2020/08/28 08:27:43
X-ACL-Warn: Detected OS   = Linux 3.11 and newer
X-Spam_score_int: -27
X-Spam_score: -2.8
X-Spam_bar: --
X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.3 (-)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.3 (--)

--=-=-=
Content-Type: text/plain


Hi,

the xref backend for etags can be annoying at times, especially in
combination with other backends. This patch should improve the
situation, by allowing the user to configure how and when the etags
backend is activated. The new user option etags-query-file would allow
the backend to never query a TAGS file, or conditionally, depending on
the existence of a TAGS file (in which case it can also be automatically
loaded).

I could imagine this might be extended to allow an auto-generate option,
but that feature seems out of scope of this patch, and probably would
require some interoperation with project.el.

-- 
	Philip K.


--=-=-=
Content-Type: text/x-patch
Content-Disposition: inline;
 filename=0001-Allow-tags-backend-to-not-query-for-TAGS-file.patch

From 6b141be5123d4cf37d743a9a12818442333658ed Mon Sep 17 00:00:00 2001
From: Philip K <philipk@HIDDEN>
Date: Fri, 28 Aug 2020 14:20:56 +0200
Subject: [PATCH] Allow tags backend to not query for TAGS file

* lisp/progmodes/etags.el (etags-query-file): Add variable
(etags--xref-backend): Respect etags-query-file
---
 lisp/progmodes/etags.el | 33 ++++++++++++++++++++++++++++++++-
 1 file changed, 32 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
index 2c5c36504a..60b162f19e 100644
--- a/lisp/progmodes/etags.el
+++ b/lisp/progmodes/etags.el
@@ -2069,8 +2069,39 @@ etags-xref-find-definitions-tag-order
 If you want `xref-find-definitions' to find the tagged files by their
 file name, add `tag-partial-file-name-match-p' to the list value.")
 
+(defcustom etags-query-file t
+  "Specify how and when to query TAGS file.
+If t, always query if no tags file has been loaded.
+If `check', only query if a TAGS file exists.
+If `check-and-set', automatically set TAGS file if exists, and don't
+query otherwise.
+If `set-or-check', set TAGS file if exists, or query user if not.
+If nil, a new table can be loaded using `visit-tags-table'."
+  :type '(choice (const :tag "Always query" t)
+                 (const :tag "Never query" nil)
+                 (const :tag "Query if exists" check)
+                 (const :tag "Set if exists" check-and-set)
+                 (const :tag "Query if not exists" set-or-check))
+  :version "28.1")
+
 ;;;###autoload
-(defun etags--xref-backend () 'etags)
+(defun etags--xref-backend ()
+  (and (cond ((or (null etags-query-file)
+                  tags-table-computed-list))
+             ((eq etags-query-file 'check)
+              (locate-dominating-file default-directory "TAGS"))
+             ((eq etags-query-file 'check-and-set)
+              (let ((dir (locate-dominating-file default-directory "TAGS")))
+                (when dir
+                  (visit-tags-table dir)
+                  t)))
+             ((eq etags-query-file 'set-or-check)
+              (let ((dir (locate-dominating-file default-directory "TAGS")))
+                (when dir
+                  (visit-tags-table dir))
+                t))
+             (etags-query-file))
+       'etags))
 
 (cl-defmethod xref-backend-identifier-at-point ((_backend (eql etags)))
   (find-tag--default))
-- 
2.26.2


--=-=-=--




Acknowledgement sent to "Philip K." <philipk@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#43086; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Sun, 11 Sep 2022 11:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.