unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Morgan Willcock <morgan@ice9.digital>
Cc: emacs-devel@gnu.org
Subject: Re: TAGS completion with (setq-local completion-ignore-case t)
Date: Sat, 09 Mar 2024 15:30:33 +0200	[thread overview]
Message-ID: <868r2ry1l2.fsf@gnu.org> (raw)
In-Reply-To: <87il1vk08z.fsf@ice9.digital> (message from Morgan Willcock on Sat, 09 Mar 2024 13:23:08 +0000)

> From: Morgan Willcock <morgan@ice9.digital>
> Cc: emacs-devel@gnu.org
> Date: Sat, 09 Mar 2024 13:23:08 +0000
> 
> Eli Zaretskii <eliz@gnu.org> writes:
> 
> > Does the patch below give good results?
> >
> > diff --git a/lisp/progmodes/etags.el b/lisp/progmodes/etags.el
> > index 476037e..5976121 100644
> > --- a/lisp/progmodes/etags.el
> > +++ b/lisp/progmodes/etags.el
> > @@ -2065,7 +2065,8 @@ complete-tag
> >        (user-error "%s"
> >                    (substitute-command-keys
> >                     "No tags table loaded; try \\[visit-tags-table]")))
> > -  (let ((comp-data (tags-completion-at-point-function)))
> > +  (let ((comp-data (tags-completion-at-point-function))
> > +        (completion-ignore-case (find-tag--completion-ignore-case)))
> >      (if (null comp-data)
> >  	(user-error "Nothing to complete")
> >        (completion-in-region (car comp-data) (cadr comp-data)
> 
> I rebuilt from the latest commit on the master branch to incorporate the
> patch.  Unfortunately, I do not see any change in the result of the
> failing test case; the completion still appears to be case-sensitive.
> 
>   printf "Function IsSingle\nFunction IsString\n" > functions
>   etags --lang=none --regex='/^function[ \t]+\([0-9A-Za-z:_]+\)/\1/i' functions
>   emacs -Q --eval "(progn \
>                      (pop-to-buffer (get-buffer-create \"test\")) \
>                      (setq-local completion-ignore-case t) \
>                      (visit-tags-table \"TAGS\") \
>                      (insert \"is\") \
>                      (complete-tag) \
>                      (complete-tag))"
> 
>   # No completions.

You need to set tags-case-fold-search, not the buffer-local value of
completion-ignore-case.  That's because the commands in etags.el look
at tags-case-fold-search to decide whether they should ignore
letter-case.



  reply	other threads:[~2024-03-09 13:30 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-07  9:14 TAGS completion with (setq-local completion-ignore-case t) Morgan Willcock
2024-03-07  9:45 ` Eli Zaretskii
2024-03-07  9:54   ` Morgan Willcock
2024-03-07 10:49     ` Eli Zaretskii
2024-03-07 11:37       ` Morgan Willcock
2024-03-09  7:51         ` Eli Zaretskii
2024-03-09 13:23           ` Morgan Willcock
2024-03-09 13:30             ` Eli Zaretskii [this message]
2024-03-09 14:06               ` Morgan Willcock
2024-03-09 14:26                 ` Eli Zaretskii
2024-03-09 14:33                   ` Morgan Willcock
2024-03-09 14:46                     ` Eli Zaretskii
2024-03-09 14:36                   ` Eli Zaretskii
2024-03-09 14:57                     ` Morgan Willcock
2024-03-09 15:49                       ` Eli Zaretskii
2024-03-09 15:56                         ` Eli Zaretskii
2024-03-13  0:09                         ` Morgan Willcock

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

  List information: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=868r2ry1l2.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    --cc=morgan@ice9.digital \
    /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 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).