From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: TAGS completion with (setq-local completion-ignore-case t) Date: Sat, 09 Mar 2024 16:36:32 +0200 Message-ID: <864jdfxyj3.fsf@gnu.org> References: <87frx2qu8z.fsf@ice9.digital> <868r2u2x4u.fsf@gnu.org> <87bk7qqsdk.fsf@ice9.digital> <865xxy2u6y.fsf@gnu.org> <877cieqnm0.fsf@ice9.digital> <8634szzvtv.fsf@gnu.org> <87il1vk08z.fsf@ice9.digital> <868r2ry1l2.fsf@gnu.org> <87a5n7jy8g.fsf@ice9.digital> <865xxvxyzo.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="36464"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: morgan@ice9.digital Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Mar 09 15:37:01 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rixoq-0009Gn-E2 for ged-emacs-devel@m.gmane-mx.org; Sat, 09 Mar 2024 15:37:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rixoU-0004zS-SG; Sat, 09 Mar 2024 09:36:38 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rixoS-0004z0-1B for emacs-devel@gnu.org; Sat, 09 Mar 2024 09:36:36 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rixoR-0006oC-61; Sat, 09 Mar 2024 09:36:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=rR+3AqX+FtcIrbAztYm4D+0UyvlnqAvr6OQXchSQAKs=; b=hS3jq9aA6mD3 EfBTlNztLxdC/8KWP8gt9bMPoMRxFCcAo/wvEfeVlZa3moposQILgXVBN0/6ZiIueNGy2jDjCZ7xx umEir1Jy9IcG52Qs+sYcWxiPccNo3lmRysExTDvEMEspaDhqM219pNXXZQNTGUjqNKHuyJxJ4Y4D6 9UblUAoysthEoGXTn6ZO4iVS13lG6kfHzp9/taZ9A6y/0jrmYIyt+ESjkQIPQkv+k/kvPMVGhspeZ mfqidzAbHfEtRHa/w221iw1WH4ZOD7vOVcG5Tf/Fq1LYRyd7o1v/EBLoEaeoCq6jMyfC/xqPpdB0D 58R7ccqP2l9YgMY/IiGOKA==; In-Reply-To: <865xxvxyzo.fsf@gnu.org> (message from Eli Zaretskii on Sat, 09 Mar 2024 16:26:35 +0200) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:316952 Archived-At: > Date: Sat, 09 Mar 2024 16:26:35 +0200 > From: Eli Zaretskii > Cc: emacs-devel@gnu.org > > > Setting tags-case-fold-search to t (buffer-local or not) doesn't seem to > > have any effect when completion-ignore-case is also set to t. > > > > emacs -Q --eval "(progn \ > > (pop-to-buffer (get-buffer-create \"test\")) \ > > (setq-local completion-ignore-case t) \ > > (setq-local tags-case-fold-search t) \ > > Don't use setq-local, use setq. Or let-bind it, like this: > > (progn > (pop-to-buffer (get-buffer-create "test")) > (let ((tags-case-fold-search t)) > (insert "is") > (complete-tag) > (complete-tag))) > > > I would still need to set completion-ignore-case to t because that is > > still relevant for other capf backends for the buffer (but not for all > > buffers). > > That's fine, and should not interfere. Actually, I take that back: you are well advised NOT to give completion-ignore-case buffer-local bindings. That's because many Emacs commands let-bind that variable to produce the desired behavior, and let-binding of a buffer-local variable can have strange effects when the code inside the let-binding switches to a different buffer (as etags commands do, because they switch to the TAGS buffer). Why exactly do you need to have a buffer-local value of completion-ignore-case? This is not a user option, and is meant to be either set globally or let-bound for specific code. > > It also pretty strange that setting completion-ignore-case to t has done > > the opposite of what it advertises. That's the effect of what I describe above, I think.