From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" 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 14:56:18 -0500 Message-ID: References: <878r919qfh.fsf@localhost> <83msuftr0i.fsf@gnu.org> <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> <87r0jooatf.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39590"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: dmitry@gutov.dev, Eli Zaretskii , mattias.engdegard@gmail.com, 66117@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 14 20:57:26 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 1rDrpl-000A8b-HP for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 14 Dec 2023 20:57:25 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rDrpR-0005LN-5v; Thu, 14 Dec 2023 14:57: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 1rDrpP-0005LB-CG for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 14:57: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 1rDrpP-0007U6-3w for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 14:57:03 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rDrpO-0006rf-Fq for bug-gnu-emacs@gnu.org; Thu, 14 Dec 2023 14:57:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 14 Dec 2023 19:57:02 +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.170258378726326 (code B ref 66117); Thu, 14 Dec 2023 19:57:02 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 14 Dec 2023 19:56:27 +0000 Original-Received: from localhost ([127.0.0.1]:50986 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDrop-0006qY-Ec for submit@debbugs.gnu.org; Thu, 14 Dec 2023 14:56:27 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:44941) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rDron-0006qG-Nw for 66117@debbugs.gnu.org; Thu, 14 Dec 2023 14:56:26 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id A89814419F1; Thu, 14 Dec 2023 14:56:20 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1702583779; bh=Qkpi6vVXIr965fHD7iDuCM8hMac0RPuOMugXKnqIXDw=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Q4Zk8qrc4X19PpIcOelm215duUT+k4bF3iX1GVywRpSSdPZp9O6Ctn60wXFkViNFg fWkfV52rvowT/k9oXPJmOic9qmfgiSrwK+gViSEsksOYw/Jxa5pjmmixkI2mTM8OCI m6erxEZ3qLOvf+Ad//mN0zvUhqDTrkt6YJF72SDyD/Ay6OJ3WZevMEpxheRrfQwlmq cchnZ520mRYpC1KddnzeNs100ICyLYjRu++IJCGK+JZK0pqC8LcqVeGJ5Z+AWq5RPI Sq32IFFGTsm91HwjPBjN39BxH7Mjieh0AxDIAWOBI32b7fTd6qKnnOBD6I+U6o0nNr qW2kiBRZHg66g== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 3C3684419E5; Thu, 14 Dec 2023 14:56:19 -0500 (EST) Original-Received: from pastel (65-110-221-238.cpe.pppoe.ca [65.110.221.238]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 0716F120D37; Thu, 14 Dec 2023 14:56:19 -0500 (EST) In-Reply-To: <87r0jooatf.fsf@localhost> (Ihor Radchenko's message of "Thu, 14 Dec 2023 19:15:08 +0000") 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:276217 Archived-At: >>> I must say I don't understand the reasoning behind this. >>> What would it do different from `case-fold-search`? >> It won't be buffer-local-if-changed, so binding it will not be costly. >> It also won't be a defcustom, so let-binding it will not step on the >> user's preferences. > In my mind, another benefit is that the new variable will not be > affected by buffer-local values - (let (case-fold-search-override value) ...) > will be guaranteed to use VALUE everywhere, even if current buffer is > changed. This will make the case I described in > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=66117#208 more predictable > (and, since it is a new variable, will not break any existing code). But of course, as always it cuts both ways. E.g. if you do (let ((case-fold-search-override t)) (dolist (buf (buffer-list)) (when (string-match "foo" buffer-file-name) (do-something)))) your `case-fold-search-override` will override all the careful `case-fold-search` let-bindings used during the execution of `do-something` which will likely lead to new bugs. [ Say, if `do-something` ends up calling `syntax-ppss` which ends up running `syntax-propertize` which often needs to perform case-sensitive searches. ] Stefan