unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
@ 2018-08-23 16:11 Ludovic Brenta
  2018-08-23 17:29 ` Eli Zaretskii
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Brenta @ 2018-08-23 16:11 UTC (permalink / raw)
  To: 32512

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.






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
  2018-08-23 16:11 bug#32512: xref--read-identifier using etags backend should honor case-fold-search Ludovic Brenta
@ 2018-08-23 17:29 ` Eli Zaretskii
  2018-08-24 10:35   ` Ludovic Brenta
  0 siblings, 1 reply; 8+ messages in thread
From: Eli Zaretskii @ 2018-08-23 17:29 UTC (permalink / raw)
  To: Ludovic Brenta; +Cc: 32512

> Date: Thu, 23 Aug 2018 17:11:18 +0100
> From: Ludovic Brenta <ludovic@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
  2018-08-23 17:29 ` Eli Zaretskii
@ 2018-08-24 10:35   ` Ludovic Brenta
  2018-08-24 12:35     ` Ludovic Brenta
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Brenta @ 2018-08-24 10:35 UTC (permalink / raw)
  To: 32512

Eli Zaretskii <eliz@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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
  2018-08-24 10:35   ` Ludovic Brenta
@ 2018-08-24 12:35     ` Ludovic Brenta
  2018-08-24 14:35       ` Helmut Eller
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Brenta @ 2018-08-24 12:35 UTC (permalink / raw)
  To: 32512

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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
  2018-08-24 12:35     ` Ludovic Brenta
@ 2018-08-24 14:35       ` Helmut Eller
  2021-09-01  9:47         ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Helmut Eller @ 2018-08-24 14:35 UTC (permalink / raw)
  To: 32512

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






^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
  2018-08-24 14:35       ` Helmut Eller
@ 2021-09-01  9:47         ` Lars Ingebrigtsen
  2021-09-01 17:42           ` Ludovic Brenta
  0 siblings, 1 reply; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-01  9:47 UTC (permalink / raw)
  To: Helmut Eller; +Cc: 32512, Ludovic Brenta

Helmut Eller <eller.helmut@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
  2021-09-01  9:47         ` Lars Ingebrigtsen
@ 2021-09-01 17:42           ` Ludovic Brenta
  2021-09-02  7:45             ` Lars Ingebrigtsen
  0 siblings, 1 reply; 8+ messages in thread
From: Ludovic Brenta @ 2021-09-01 17:42 UTC (permalink / raw)
  To: Lars Ingebrigtsen; +Cc: 32512, Helmut Eller

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.





^ permalink raw reply	[flat|nested] 8+ messages in thread

* bug#32512: xref--read-identifier using etags backend should honor case-fold-search
  2021-09-01 17:42           ` Ludovic Brenta
@ 2021-09-02  7:45             ` Lars Ingebrigtsen
  0 siblings, 0 replies; 8+ messages in thread
From: Lars Ingebrigtsen @ 2021-09-02  7:45 UTC (permalink / raw)
  To: Ludovic Brenta; +Cc: 32512, Helmut Eller

Ludovic Brenta <ludovic@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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-02  7:45 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-23 16:11 bug#32512: xref--read-identifier using etags backend should honor case-fold-search Ludovic Brenta
2018-08-23 17:29 ` Eli Zaretskii
2018-08-24 10:35   ` Ludovic Brenta
2018-08-24 12:35     ` Ludovic Brenta
2018-08-24 14:35       ` Helmut Eller
2021-09-01  9:47         ` Lars Ingebrigtsen
2021-09-01 17:42           ` Ludovic Brenta
2021-09-02  7:45             ` Lars Ingebrigtsen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).