all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Morgan Willcock <morgan@ice9.digital>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: TAGS completion with (setq-local completion-ignore-case t)
Date: Thu, 07 Mar 2024 11:37:27 +0000	[thread overview]
Message-ID: <877cieqnm0.fsf@ice9.digital> (raw)
In-Reply-To: <865xxy2u6y.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 07 Mar 2024 12:49:09 +0200")

Eli Zaretskii <eliz@gnu.org> writes:

>> From: Morgan Willcock <morgan@ice9.digital>
>> Cc: emacs-devel@gnu.org
>> Date: Thu, 07 Mar 2024 09:54:31 +0000
>> 
>> Eli Zaretskii <eliz@gnu.org> writes:
>> 
>> >> Is there a technical reason why TAGS completion cannot use the value of
>> >> completion-ignore-case that is set in the buffer where completion is
>> >> initiated, or is this a bug in the implementation?
>> >
>> > If you mean completion when you type "M-.", then this has its own user
>> > option, tags-case-fold-search.  Is that what you want?
>> 
>> I am talking about completion as initiated by the complete-tag command.
>> 
>> (Setting tags-case-fold-search to t does not change the result, whether
>> set buffer-local or globally).
>
> Can you show a complete recipe, starting from "emacs -Q", to reproduce
> the issue?

I've included a script below which should demonstrate the problem,
i.e. no completions are generated when the buffer-local value of
completion-ignore-case is t until the value of completion-ignore-case is
also set to t for the TAGS buffer.

> And what version of Emacs is that?

I've tested on 29.2 and the master branch (as of a few hours ago).

  ## Generate a TAGS file.
  printf "Function IsSingle\nFunction IsString\n" > functions
  etags --lang=none --regex='/^function[ \t]+\([0-9A-Za-z:_]+\)/\1/i' functions


  ## Test default completion (case-sensitive).
  emacs -Q --eval "(progn \
                    (pop-to-buffer (get-buffer-create \"test\")) \
                    (visit-tags-table \"TAGS\") \
                    (insert \"Is\") \
                    (complete-tag) \
                    (complete-tag))"

  # 2 possible completions:
  # IsSingle
  # IsString


  ## Test case-insensitive completion (global).
  emacs -Q --eval "(progn \
                    (pop-to-buffer (get-buffer-create \"test\")) \
                    (setq completion-ignore-case t) \
                    (visit-tags-table \"TAGS\") \
                    (insert \"is\") \
                    (complete-tag) \
                    (complete-tag))"

  # 2 possible completions:
  # IsSingle
  # IsString


  ## Test case-insensitive completion (buffer-local).
  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.


  ## Test case-insensitive completion (buffer-local, including TAGS buffer).
  emacs -Q --eval "(progn \
                    (pop-to-buffer (get-buffer-create \"test\")) \
                    (setq-local completion-ignore-case t) \
                    (visit-tags-table \"TAGS\") \
                    (with-current-buffer \"TAGS\" \
                      (setq-local completion-ignore-case t)) \
                    (insert \"is\") \
                    (complete-tag) \
                    (complete-tag))"

  # 2 possible completions:
  # IsSingle
  # IsString

-- 
Morgan Willcock



  reply	other threads:[~2024-03-07 11:37 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 [this message]
2024-03-09  7:51         ` Eli Zaretskii
2024-03-09 13:23           ` Morgan Willcock
2024-03-09 13:30             ` Eli Zaretskii
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

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

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