From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers Date: Mon, 01 Jan 2024 18:02:30 +0000 Message-ID: <878r5953ux.fsf@localhost> References: <878r919qfh.fsf@localhost> <871qboprh3.fsf@localhost> <87y1dwobey.fsf@localhost> <878r5v20gu.fsf@localhost> <83bkapl5zh.fsf@gnu.org> <83zfy9jkoh.fsf@gnu.org> <878r5tglwp.fsf@localhost> <83ttohjet0.fsf@gnu.org> <83sf41jed7.fsf@gnu.org> <87y1dtyu4y.fsf@localhost> <83plz5jdgj.fsf@gnu.org> <87v88xyt2a.fsf@localhost> <83o7epjaon.fsf@gnu.org> <87edfipbpf.fsf@localhost> <877cl7n0ux.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3423"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dmitry@gutov.dev, Eli Zaretskii , mattias.engdegard@gmail.com, Stefan Monnier , 66117@debbugs.gnu.org To: Gerd =?UTF-8?Q?M=C3=B6llmann?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jan 01 19:00:17 2024 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 1rKMaE-0000fn-8y for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 01 Jan 2024 19:00:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKMa7-0001RP-Tj; Mon, 01 Jan 2024 13:00:07 -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 1rKMa2-0001R1-TI for bug-gnu-emacs@gnu.org; Mon, 01 Jan 2024 13:00:02 -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 1rKMa1-0006h3-5L for bug-gnu-emacs@gnu.org; Mon, 01 Jan 2024 13:00:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rKMa3-00057r-0y for bug-gnu-emacs@gnu.org; Mon, 01 Jan 2024 13:00:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 Jan 2024 18:00: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.170413197419628 (code B ref 66117); Mon, 01 Jan 2024 18:00:02 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 1 Jan 2024 17:59:34 +0000 Original-Received: from localhost ([127.0.0.1]:48715 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKMZa-00056V-Ao for submit@debbugs.gnu.org; Mon, 01 Jan 2024 12:59:34 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:38401) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKMZX-00056H-Sz for 66117@debbugs.gnu.org; Mon, 01 Jan 2024 12:59:32 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 59A06240029 for <66117@debbugs.gnu.org>; Mon, 1 Jan 2024 18:59:24 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704131964; bh=Uh7wWR9KMo1YuewvGhzQB4ZfuUEyeur/LhZ1lj0vJC4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=R2K0hV1IcDqny94ND6PJz8iY4KUFBXgIi30UPsUzE3idhSiLPRl1bnr8xxjiyMyf1 //1gGHKBI6PoCPUhmIfUMmIoPhoSPxN0jRpYaxaCzJ+FcmU/C3ja2dSpDwzKjqrV6/ qwJzoyrqK3P+0aMxN0lfnVB+YV7QKynVxHGbo6ASHXNhCZ/MxQ6iZyzAT/JT/h4GZc QfW7KLd0u3jUAMjlNrqq9aOunRReeru1p4ATTpVUTDp796YbMxV6C2izyQ6ddZYMLq UAStrP2NIUzNGV3DCDIaHkJy37GOnl2B/nEf/2ZJpXRh9jt6HI9GRtUWY0GkSeliDY mBTM1wbhVt2HQ== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T3kJV3Mp0z6tmv; Mon, 1 Jan 2024 18:59:22 +0100 (CET) In-Reply-To: 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:277189 Archived-At: Gerd M=C3=B6llmann writes: >> (defvar-local let-tests-buffer-local-var 'value) >> (with-temp-buffer >> (setq-local let-tests-buffer-local-var 'baz) >> (let ((let-tests-buffer-local-var 'bar)) >> ;; This is failing. >> (should (eq 'bar (default-value 'let-tests-buffer-local-var))) > > C-h f default-value explains this: > > Return SYMBOL=E2=80=99s default value. > This is the value that is seen in buffers that do not have their own va= lues > for this variable. Are you saying that `let' never changes `default-value' output? Unfortunately, no. I first expected (by reading the C sources) that the default value is changed by `let', but it actually looks like `let' sometimes does change the default value and sometimes does not. See the following two almost identical snippets that yield completely different results depending on the present of `setq-default': (defvar-local let-tests-buffer-local-var 'value) ;; default value is 'value (with-temp-buffer (let ((existing-buffer (current-buffer))) (with-temp-buffer (setq-local let-tests-buffer-local-var 'baz) (let ((let-tests-buffer-local-var 'bar)) ;; Let does not change the default value for variable. (should (eq 'value (default-value 'let-tests-buffer-local-var))) (should (eq 'bar let-tests-buffer-local-var)) (with-temp-buffer ;; We are in a new buffer - `let-tests-buffer-local-var' has its global = default value. (should (eq 'value (default-value 'let-tests-buffer-local-var))) (should (eq 'value let-tests-buffer-local-var))) (with-current-buffer existing-buffer ;; The above let DOES NOT change the current value in all the buf= fer ;; _existing_ when `let' is invoked. (should (eq 'value let-tests-buffer-local-var)) ;; Global default value is still unchanged. (should (eq 'value (default-value 'let-tests-buffer-local-var))))= )))) (with-temp-buffer (let ((existing-buffer (current-buffer))) (with-temp-buffer ;; !!! After commenting out this line, the behaviour changes. ;; (setq-local let-tests-buffer-local-var 'baz) (let ((let-tests-buffer-local-var 'bar)) ;; Now, let DOES change the default value for variable. (should (eq 'bar (default-value 'let-tests-buffer-local-var))) (should (eq 'bar let-tests-buffer-local-var)) (with-temp-buffer ;; We are in a new buffer - `let-tests-buffer-local-var' still has ;; let-bound global and local values. (should (eq 'bar (default-value 'let-tests-buffer-local-var))) (should (eq 'bar let-tests-buffer-local-var))) (with-current-buffer existing-buffer ;; The above let DOES change the current value in all the buffer ;; _existing_ when `let' is invoked. (should (eq 'bar let-tests-buffer-local-var)) ;; Global default value is still let-bound. (should (eq 'bar (default-value 'let-tests-buffer-local-var))))))= )) --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at