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.bugs Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers Date: Thu, 14 Dec 2023 22:24:39 +0200 Message-ID: <83le9wpm60.fsf@gnu.org> References: <878r919qfh.fsf@localhost> <87plzbxtxa.fsf@localhost> <87y1dzvvf0.fsf@localhost> <83plzas3pg.fsf@gnu.org> <87r0jqw8u9.fsf@localhost> <83jzpis08a.fsf@gnu.org> <87il52w744.fsf@localhost> <83fs06rz10.fsf@gnu.org> <87fs06w4ui.fsf@localhost> <83bkaurut9.fsf@gnu.org> <87o7esq319.fsf@localhost> <83bkasrb3f.fsf@gnu.org> <83wmtgpuyf.fsf@gnu.org> <83r0jopqk1.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="17694"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, yantar92@posteo.net, mattias.engdegard@gmail.com, 66117@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 21:25:19 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1rDsGl-0004Qm-9C for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 21:25:19 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDsGX-0005W9-Tj; Thu, 14 Dec 2023 15:25:05 -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 1rDsGV-0005W0-9m for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 15:25:03 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rDsGV-0002Wj-1J for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 15:25:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDsGT-0004Os-Vk for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 15:25:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2023 20:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66117 X-GNU-PR-Package: emacs Original-Received: via spool by 66117-submit@debbugs.gnu.org id=B66117.170258548916879 (code B ref 66117); Thu, 14 Dec 2023 20:25:01 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 14 Dec 2023 20:24:49 +0000 Original-Received: from localhost ([127.0.0.1]:51010 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDsGH-0004O9-2r for submit@debbugs.gnu.org; Thu, 14 Dec 2023 15:24:49 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41732) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDsGE-0004Nu-2N for 66117@debbugs.gnu.org; Thu, 14 Dec 2023 15:24:47 -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 1rDsG9-0002VQ-0f; Thu, 14 Dec 2023 15:24:41 -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=w0OIgHkglPn3UFBKWmatPMAn/7pW+rDbqY0BAIk65Sg=; b=pxtJPDimrVfC V1140HGWaoJCXz1Rm9X7x36mkJ/F7j7Cj48vrYGVKyxIhSAO9dj4fv9Pkimarc/NAONT14Vsorf3O lARYKcTwK90RNAlisS1SUyRDnvDR3P896IqGtIkjKccBwX/ivgsLVIJ0QDfbZIzvad3igbD2Ryx1M BJ/IdKu2CstiFPmRZI/DxbvEmSCouVriYSyA2iDRUd1C84t5sYGfLgCg6ZkCOv4uvbj1ts5V0pZe/ 4/259Hk+nb2V4q9C/rrIDI9WaLXrngzRwC7fycNXAx6Vnii5YR1VjrBPJFFkQFy7vVACe3QdQtPzD zvjHQHJeiexsG1Stz3+1dA==; In-Reply-To: (message from Stefan Monnier on Thu, 14 Dec 2023 14:49:54 -0500) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:276218 Archived-At: > From: Stefan Monnier > Cc: yantar92@posteo.net, dmitry@gutov.dev, 66117@debbugs.gnu.org, > mattias.engdegard@gmail.com > Date: Thu, 14 Dec 2023 14:49:54 -0500 > > >> As mentioned elsewhere in this bug-report we can make `case-fold-search` > >> into a `DEFVAR_LISP`: it would have no visible impact to ELisp and would > >> avoid the costly let-bindings. > > Didn't we just agree that would be a breaking change? > > No, when? where? > > You might be confusing that proposition to my proposition to make it > always-buffer-local (like `mode-name` or `buffer-file-name`). Maybe. This discussion has enough confusion to confuse everyone. > >> > It also won't be a defcustom, so let-binding it will not step on the > >> > user's preferences. > >> Hmm... when/where do existing let-bindings of `case-fold-search` step on > >> user settings of that var? > > Each time we let-bind it in code used in searching and/or matching > > commands. > > I don't think that true of all those let-binding. Not all, just some. > Obviously the mere fact that the let-binding takes precedence means that > we override the user's setting, but that's just an internal technical > detail. To "step on the user's preference" we additionally need > a situation where the user-visible result is not what the user wanted. Yes, and you are sure there aren't such cases, what with our willy-nilly binding this variable whenever we need that? > AFAICT most/all the times we do that, it's because we do a search that's > "internal" to some operation and has thus no reason to obey the custom > setting ,which AFAICT is meant to affect interactive uses like Isearch > (tho Isearch doesn't Isearch doesn't pay attention to > `case-fold-search`, AFAICT, so really the user-visible effect of setting > `case-fold-search` is quite limited). This is wishful thinking not based by any data. > >> IME the problem is rather the opposite: most calls to search functions > >> don't explicitly let-bind `case-fold-search` and instead rely naively on > >> the default value and are thus susceptible to bugs if/when someone sets > >> the custom var (globally or buffer-locally). > > > > I don't see that as a bug: the user said he/she wants the search to be > > case-insensitive, so they should get what they asked for. > > But that's only true if the user runs a search command. That's what I had in mind, and even said so. > If the search is done within a non-search command (e.g. indentation), > then the result is often not what the user wanted. My point is that we use case-fold-search for two different purposes, and so it is good to have 2 variables, one each for every purpose.