From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Radey Shouman Newsgroups: gmane.emacs.bugs Subject: bug#37820: 25.2; xref using etags incorrect case fold during completion Date: Thu, 26 Dec 2019 15:56:07 -0500 Message-ID: <24069.7783.536611.22349@mothra.home> References: <23978.21803.951348.841457@mothra.home> <83wod16xa0.fsf@gnu.org> <86f40cb1-dc31-c130-5480-e04fdc934d12@yandex.ru> <23986.65471.30294.547230@mothra.home> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="139285"; mail-complaints-to="usenet@blaine.gmane.org" Cc: 37820@debbugs.gnu.org, Radey Shouman To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Dec 26 21:57:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1ikaBy-000a6w-Oh for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2019 21:57:10 +0100 Original-Received: from localhost ([::1]:56636 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikaBx-0002Wk-09 for geb-bug-gnu-emacs@m.gmane.org; Thu, 26 Dec 2019 15:57:09 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48924) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ikaBr-0002VQ-Uo for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 15:57:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ikaBq-0000ju-GU for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 15:57:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:50330) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ikaBq-0000jp-Dq for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 15:57:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ikaBq-0006GS-Cn for bug-gnu-emacs@gnu.org; Thu, 26 Dec 2019 15:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Radey Shouman Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 26 Dec 2019 20:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 37820 X-GNU-PR-Package: emacs Original-Received: via spool by 37820-submit@debbugs.gnu.org id=B37820.157739377723988 (code B ref 37820); Thu, 26 Dec 2019 20:57:02 +0000 Original-Received: (at 37820) by debbugs.gnu.org; 26 Dec 2019 20:56:17 +0000 Original-Received: from localhost ([127.0.0.1]:56303 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikaB7-0006Eq-5i for submit@debbugs.gnu.org; Thu, 26 Dec 2019 15:56:17 -0500 Original-Received: from resqmta-ch2-01v.sys.comcast.net ([69.252.207.33]:45510) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ikaB5-0006EU-3n for 37820@debbugs.gnu.org; Thu, 26 Dec 2019 15:56:15 -0500 Original-Received: from resomta-ch2-02v.sys.comcast.net ([69.252.207.98]) by resqmta-ch2-01v.sys.comcast.net with ESMTP id kZxhilraCxZxAkaAziUSQA; Thu, 26 Dec 2019 20:56:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1577393769; bh=ylYoEsGETaFUjDZgJh0OdrupJMe6Hut3beMufZowWt4=; h=Received:Received:Received:MIME-Version:Content-Type:Message-ID: Date:From:To:Subject; b=o+hyycBQ+J/PHJrm/bDXYrvwMZa2anuqnGfi7ita6fuOSYrE1S9OWzQRbcMVXQq27 KfKRfcKRmjAJGjW0TwOIBpoE4wNYWAan1WLm2bA4jLSt4+hATHI+VAljKkX9NEjk+L LmXubU5upfNUhmEoUmaC36ua2BBavfY2hGRijAxIH/+y0qPyAslE6ax9cqBygAvgsk d3fvBRiyrJbxQZdfv7xtkInX+mThIbKZPBeIZXm2TnclHh9Dd1oqEu+YAWncRtPMGv TgK37IY5p/NhkIERUhzGIuHI3NtuGuVCNOYKef4TPN1uuCR7npOHbj9ky5gtb1ZN6L xflID/O9Mo30Q== Original-Received: from mothra.home ([IPv6:2601:18c:cd80:eef0:329c:23ff:fea1:8693]) by resomta-ch2-02v.sys.comcast.net with ESMTPA id kaAyiFH3YgGLCkaAyiaoFg; Thu, 26 Dec 2019 20:56:09 +0000 X-Xfinity-VMeta: sc=-100.00;st=legit Original-Received: from localhost ([127.0.0.1] helo=mothra) by mothra.home with esmtp (Exim 4.92) (envelope-from ) id 1ikaAx-0004gR-K7; Thu, 26 Dec 2019 15:56:07 -0500 In-Reply-To: X-Mailer: VM 8.1.2 under 25.2.2 (x86_64-pc-linux-gnu) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:173793 Archived-At: Dmitry Gutov writes: > Hi Radey, > > sorry for the late reply. Not at all. > On 25.10.2019 16:59, Radey Shouman wrote: > > The only variable I customize is tags-case-fold-search, I leave > > completion-ignore-case with the default value. I heartily regret > > even mentioning the latter variable, it is a red herring. > > Don't regret it because it's entirely pertinent. > > So, do we really have meaningful scenarios where the user will want > tags-case-fold-search set to t while completion-ignore-case *should* > remain nil? No. I believe that completion-ignore-case should always be bound to the value of tags-case-fold-search when doing a tags completion. If this is not so then completion is not consistent with the tags search, which is the bug in question. > I suppose we could add a new method to xref backends just for that, but > we shouldn't do that without understanding the use cases. Like, why/how > other backends would choose to return different values. > > > There are at least two reasons to change tags-case-fold-search: > > > > 1) Some programming languages are not case sensitive in normal use, > > eg Common Lisp, Fortran, Cobol, R[45]RS Scheme ... For these languages > > case-insensitive search should be the default. > > How does using one or the other variable help with that distinction? >From what I could see searching the lisp tree, tags-case-fold-search is intended for user customization of tags search (and partly carried over to xref). completion-ignore-case is used for dynamic control of completion, and is not a sensible variable for user customization. > When someone uses tags, they often use them with a multitude of > languages. Whether you employ tags-case-fold-search, or an xref-specific > variable Eli suggested to add, that would affect all languages anyway, > right? Yes. It is possible to mix languages even in a single tags table. Personal preference also plays a role. > > 2) For many code bases the rules of CamelCasing are so vague, or their > > observance so lax, that it's hard to predict what the capitalization > > of an identifier will be. It's useful in these cases to use > > completion that is not case sensitive. > > We can make completion-ignore-case a safe local variable, so that you > can set it in dir-locals depending on the code base. I'm not sure that's useful, because the default value of completion-ignore-case is hardly ever used. For example, even if ignoring case for tags searches, one would probably not want to ignore case when completing input for describe-key. On the other hand, it might well be useful to make tags-case-fold-search or any xref replacement a safe local variable. BTW, how might one find the list of safe local variables? --