Subject: bug#37820: 25.2; xref using etags incorrect case fold during completion

From: Dmitry Gutov <[email-masked]>
Date: Wed, 25 Dec 2019 02:45:24 +0200

Hi Radey,

sorry for the late reply.

On 25.10.2019 16:59, Radey Shouman wrote:
> Please copy me on any messages to which you expect a response.
> I have not subscribed to the mailing list.

Sure. That's the default etiquette here anyway.

> 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?

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?

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?

> 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.