GNU bug report logs - #32512
xref--read-identifier using etags backend should honor case-fold-search

Previous Next

Package: emacs;

Reported by: Ludovic Brenta <ludovic <at> ludovic-brenta.org>

Date: Thu, 23 Aug 2018 16:12:02 UTC

Severity: wishlist

Tags: moreinfo

Found in version 26.1

Done: Lars Ingebrigtsen <larsi <at> gnus.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 32512 in the body.
You can then email your comments to 32512 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Thu, 23 Aug 2018 16:12:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Ludovic Brenta <ludovic <at> ludovic-brenta.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Thu, 23 Aug 2018 16:12:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
To: <bug-gnu-emacs <at> gnu.org>
Subject: xref--read-identifier using etags backend should honor
 case-fold-search
Date: Thu, 23 Aug 2018 17:11:18 +0100
Package: emacs
Version: 26.1
Severity: wishlist

Hello,

Suppose I have a file named foo-bar.adb containing:

package Foo.Bar is
end Foo.Bar;

and this has been tagged with etags, which is the backend in use for 
xref.

Now:
(a)
M-. foo.bar/b => jumps to foo-bar.adb line 1, "package Foo.Bar is".

but

(b)
M-. foo.bar <TAB> => "no match"

In (a), xref-find-definition took whatever my input was and honored
case-fold-search, which is t, to find the definition of the package.

But when I type <TAB> asking for possible completions, 
xref--read-identifier
is case-sensitive whether I like it or not.  Indeed:

(c)
M-. Foo.Bar <TAB> => produces the desired completion Foo.Bar/b

The inconsistency between (a) and (b) is anti-ergonomic.

I looked for a variable, separate from case-fold-search, that would
control the case sensitivity of completion in this case, but I couldn't
find one.

-- 
Ludovic Brenta.





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Thu, 23 Aug 2018 17:31:01 GMT) Full text and rfc822 format available.

Message #8 received at 32512 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
Cc: 32512 <at> debbugs.gnu.org
Subject: Re: bug#32512: xref--read-identifier using etags backend should honor
 case-fold-search
Date: Thu, 23 Aug 2018 20:29:55 +0300
> Date: Thu, 23 Aug 2018 17:11:18 +0100
> From: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
> 
> (a)
> M-. foo.bar/b => jumps to foo-bar.adb line 1, "package Foo.Bar is".
> 
> but
> 
> (b)
> M-. foo.bar <TAB> => "no match"
> 
> In (a), xref-find-definition took whatever my input was and honored
> case-fold-search, which is t, to find the definition of the package.
> 
> But when I type <TAB> asking for possible completions, 
> xref--read-identifier
> is case-sensitive whether I like it or not.  Indeed:
> 
> (c)
> M-. Foo.Bar <TAB> => produces the desired completion Foo.Bar/b
> 
> The inconsistency between (a) and (b) is anti-ergonomic.
> 
> I looked for a variable, separate from case-fold-search, that would
> control the case sensitivity of completion in this case, but I couldn't
> find one.

I think one of explicit goals of Xref development was to make it much
more accurate than etags is, which is why it explicitly disables some
loose match methods etags offers (and was using when its front-end was
invoked by M-.).  With that in mind, folding case would go against
that goal, so I'm not sure it's a step in the right direction.

Is the problem the inconsistency between (a) and (b), or is the
problem that you _want_ xref-find-definition to be case-insensitive?
If the former, perhaps we should instead make (a) fail as well?

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Fri, 24 Aug 2018 10:36:02 GMT) Full text and rfc822 format available.

Message #11 received at 32512 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
To: 32512 <at> debbugs.gnu.org
Subject: Re: bug#32512: xref--read-identifier using etags backend should honor
 case-fold-search
Date: Fri, 24 Aug 2018 12:35:08 +0200
Eli Zaretskii <eliz <at> gnu.org> writes:
> Is the problem the inconsistency between (a) and (b), or is the
> problem that you _want_ xref-find-definition to be case-insensitive?
> If the former, perhaps we should instead make (a) fail as well?

Well the inconsistency is definitely a problem but additionally I want
to *control* whether or not case is sensitive in completions; preferably
using case-fold-search, if that is really the variable used for complete
matches.

Thanks for your reply.

--
Ludovic Brenta.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Fri, 24 Aug 2018 12:36:02 GMT) Full text and rfc822 format available.

Message #14 received at 32512 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
To: 32512 <at> debbugs.gnu.org
Subject: Re: bug#32512: xref--read-identifier using etags backend should honor
 case-fold-search
Date: Fri, 24 Aug 2018 14:35:14 +0200
Also I would like to add that some programming languages, notably Ada
and Pascal, are case-insensitive; in these languages, "being as exact as
possible" implies respecting this case-inensitivity.  This is why I
think it would be a good idea to make the case sensitivity
user-controllable (not mode-controllable, as you may want to look for an
Ada subprogram from a buffer visiting e.g. a shell script).

--
Ludovic Brenta.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Fri, 24 Aug 2018 14:37:02 GMT) Full text and rfc822 format available.

Message #17 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: Re: bug#32512: xref--read-identifier using etags backend should honor
 case-fold-search
Date: Fri, 24 Aug 2018 16:35:40 +0200
On Fri, Aug 24 2018, Ludovic Brenta wrote:

> Also I would like to add that some programming languages, notably Ada
> and Pascal, are case-insensitive; in these languages, "being as exact as
> possible" implies respecting this case-inensitivity.  This is why I
> think it would be a good idea to make the case sensitivity
> user-controllable (not mode-controllable, as you may want to look for an
> Ada subprogram from a buffer visiting e.g. a shell script).

xref--read-identifier basically calls 'completing-read' with some
arguments that it gets from the backend.

Setting 'completion-ignore-case' should make it case-insensitive.  Have
you tried that?

The etags backed uses 'tags-lazy-completion-table' to create the
possible completions.  I think that was not changed when the xref was
added.

Helmut





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Wed, 01 Sep 2021 09:48:02 GMT) Full text and rfc822 format available.

Message #20 received at 32512 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 32512 <at> debbugs.gnu.org, Ludovic Brenta <ludovic <at> ludovic-brenta.org>
Subject: Re: bug#32512: xref--read-identifier using etags backend should
 honor case-fold-search
Date: Wed, 01 Sep 2021 11:47:08 +0200
Helmut Eller <eller.helmut <at> gmail.com> writes:

> xref--read-identifier basically calls 'completing-read' with some
> arguments that it gets from the backend.
>
> Setting 'completion-ignore-case' should make it case-insensitive.  Have
> you tried that?

(I'm going through old bug reports that unfortunately weren't resolved
at the time.)

There wasn't any further followup after this -- Ludovic, does setting
`completion-ignore-case' fix this use case for you?

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




Added tag(s) moreinfo. Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Wed, 01 Sep 2021 09:48:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Wed, 01 Sep 2021 17:43:01 GMT) Full text and rfc822 format available.

Message #25 received at 32512 <at> debbugs.gnu.org (full text, mbox):

From: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
To: Lars Ingebrigtsen <larsi <at> gnus.org>
Cc: 32512 <at> debbugs.gnu.org, Helmut Eller <eller.helmut <at> gmail.com>
Subject: Re: bug#32512: xref--read-identifier using etags backend should
 honor case-fold-search
Date: Wed, 01 Sep 2021 19:42:26 +0200
Just checked.  Yes, setting completion-ignore-case works.  Thanks for
following up (the last mail sent to me was probably while I was on
vacation and I missed it).

-- 
Ludovic Brenta.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#32512; Package emacs. (Thu, 02 Sep 2021 07:46:01 GMT) Full text and rfc822 format available.

Message #28 received at 32512 <at> debbugs.gnu.org (full text, mbox):

From: Lars Ingebrigtsen <larsi <at> gnus.org>
To: Ludovic Brenta <ludovic <at> ludovic-brenta.org>
Cc: 32512 <at> debbugs.gnu.org, Helmut Eller <eller.helmut <at> gmail.com>
Subject: Re: bug#32512: xref--read-identifier using etags backend should
 honor case-fold-search
Date: Thu, 02 Sep 2021 09:45:27 +0200
Ludovic Brenta <ludovic <at> ludovic-brenta.org> writes:

> Just checked.  Yes, setting completion-ignore-case works.  Thanks for
> following up (the last mail sent to me was probably while I was on
> vacation and I missed it).

Thanks for checking; closing this bug report, then.

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




bug closed, send any further explanations to 32512 <at> debbugs.gnu.org and Ludovic Brenta <ludovic <at> ludovic-brenta.org> Request was from Lars Ingebrigtsen <larsi <at> gnus.org> to control <at> debbugs.gnu.org. (Thu, 02 Sep 2021 07:46:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 30 Sep 2021 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 2 years and 180 days ago.

Previous Next


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