all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Radey Shouman <shouman@comcast.net>
To: Dmitry Gutov <dgutov@yandex.ru>
Cc: 37820@debbugs.gnu.org, Radey Shouman <shouman@comcast.net>
Subject: bug#37820: 25.2; xref using etags incorrect case fold during completion
Date: Thu, 26 Dec 2019 15:56:07 -0500	[thread overview]
Message-ID: <24069.7783.536611.22349@mothra.home> (raw)
In-Reply-To: <f352cdf9-be85-5cf8-23b8-094bc11e052e@yandex.ru>

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?

-- 






  reply	other threads:[~2019-12-26 20:56 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-19  0:13 bug#37820: 25.2; xref using etags incorrect case fold during completion Radey Shouman
2019-10-19  6:53 ` Eli Zaretskii
2019-10-19  7:14   ` Dmitry Gutov
2019-10-19 17:40     ` Radey Shouman
2019-10-25 13:59     ` Radey Shouman
2019-12-25  0:45       ` Dmitry Gutov
2019-12-26 20:56         ` Radey Shouman [this message]
     [not found]           ` <abb85c0d-b89d-d82a-836e-f1e2755fa149@yandex.ru>
2020-01-17  8:28             ` Eli Zaretskii
2020-01-17 12:49               ` Dmitry Gutov
2020-01-17 13:39                 ` Eli Zaretskii
2020-01-17 21:29                   ` Dmitry Gutov
2020-01-17 15:34                 ` Radey Shouman
2020-01-17 21:28                   ` Dmitry Gutov
2020-01-18 22:33                     ` Radey Shouman
2019-10-19 17:34   ` Radey Shouman
2019-10-19 21:07     ` Drew Adams
2019-10-20 16:19     ` Dmitry Gutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24069.7783.536611.22349@mothra.home \
    --to=shouman@comcast.net \
    --cc=37820@debbugs.gnu.org \
    --cc=dgutov@yandex.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.