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: Tue, 02 Jan 2024 11:08:22 +0000 Message-ID: <87r0j03sd5.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> <878r5953ux.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="4559"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66117@debbugs.gnu.org, dmitry@gutov.dev, Eli Zaretskii , mattias.engdegard@gmail.com, Stefan Monnier 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 Tue Jan 02 12:06:26 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 1rKcbK-0000ye-1o for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 02 Jan 2024 12:06:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rKcax-0003eE-Q1; Tue, 02 Jan 2024 06:06:03 -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 1rKcau-0003dz-N6 for bug-gnu-emacs@gnu.org; Tue, 02 Jan 2024 06:06:00 -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 1rKcau-0007k1-EK for bug-gnu-emacs@gnu.org; Tue, 02 Jan 2024 06:06:00 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rKcaw-0000a6-Ew for bug-gnu-emacs@gnu.org; Tue, 02 Jan 2024 06:06:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 02 Jan 2024 11:06: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.17041935222176 (code B ref 66117); Tue, 02 Jan 2024 11:06:02 +0000 Original-Received: (at 66117) by debbugs.gnu.org; 2 Jan 2024 11:05:22 +0000 Original-Received: from localhost ([127.0.0.1]:49492 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKcaH-0000Z2-WD for submit@debbugs.gnu.org; Tue, 02 Jan 2024 06:05:22 -0500 Original-Received: from mout01.posteo.de ([185.67.36.65]:47453) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rKcaG-0000Yn-Ls for 66117@debbugs.gnu.org; Tue, 02 Jan 2024 06:05:21 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id A9E9D240027 for <66117@debbugs.gnu.org>; Tue, 2 Jan 2024 12:05:12 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1704193512; bh=znWKfkZvdSI22F/DlFmUPPDPCSdtFdnC93ArbE3dAs0=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:From; b=MhQpHUbdgggUJ+8x+QJKy7EmvwzPtE+oKWJFD62O4FZHMCVQda6lQmS9YaIWj9LLB XDYz7EShOVprOCSAbmVWZN4jr5BxhSCp4maz16ktI5bCFMwqCQrymkD82XD+Z+34h2 c1sNtkvjHDyz6cJ2IW+Gh4S3E4XNUZ094VdrzLOUx9jlqqekU+nBBOXqScJeJh/lGm z3ab8Kfa4knlD7u1HhSm4K7YB22bbxTw60vnqUYNGWSGNkHBijEfpLuOX0krVqctNt BpGzP/+VTyroEzUYVo7P2h9PT6s8XAbkzjv896xrgKsQ8F3fJILS+c34wGUbFECkth 4UcjiG1mNnpMA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4T49475cklz6txd; Tue, 2 Jan 2024 12:05:11 +0100 (CET) In-Reply-To: <878r5953ux.fsf@localhost> 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:277224 Archived-At: --=-=-= Content-Type: text/plain Ihor Radchenko writes: > See the following two almost identical snippets that yield completely > different results depending on the present of `setq-default': > ... I believe that I now understand enough to add a new meaningful test. See the attached. Please check the comments in the test to make sure that they make sense. --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-test-src-eval-tests.el-eval-tests-default-value-Add-.patch >From dfc6dbcd844fbd8b8634b056fb441848b86311ca Mon Sep 17 00:00:00 2001 Message-ID: From: Ihor Radchenko Date: Tue, 2 Jan 2024 12:06:16 +0100 Subject: [PATCH] test/src/eval-tests.el (eval-tests/default-value): Add new test case --- test/src/eval-tests.el | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/test/src/eval-tests.el b/test/src/eval-tests.el index c1219591e40..5cf9d4e2188 100644 --- a/test/src/eval-tests.el +++ b/test/src/eval-tests.el @@ -282,25 +282,38 @@ eval-tests-defvaralias (should-error (defvaralias 'eval-tests--my-c 'eval-tests--my-d) :type 'cyclic-variable-indirection)) -(defvar eval-tests/global-var 'value) -(defvar-local eval-tests/buffer-local-var 'value) +(defvar eval-tests/global-var 'global-value) +(defvar-local eval-tests/buffer-local-var 'default-value) (ert-deftest eval-tests/default-value () ;; `let' overrides the default value for global variables. (should (default-boundp 'eval-tests/global-var)) - (should (eq 'value (default-value 'eval-tests/global-var))) - (should (eq 'value eval-tests/global-var)) - (let ((eval-tests/global-var 'bar)) - (should (eq 'bar (default-value 'eval-tests/global-var))) - (should (eq 'bar eval-tests/global-var))) + (should (eq 'global-value (default-value 'eval-tests/global-var))) + (should (eq 'global-value eval-tests/global-var)) + (let ((eval-tests/global-var 'let-value)) + (should (eq 'let-value (default-value 'eval-tests/global-var))) + (should (eq 'let-value eval-tests/global-var))) ;; `let' overrides the default value everywhere, but leaves ;; buffer-local values unchanged in current buffer and in the ;; buffers where there is no explicitly set buffer-local value. (should (default-boundp 'eval-tests/buffer-local-var)) - (should (eq 'value (default-value 'eval-tests/buffer-local-var))) - (should (eq 'value eval-tests/buffer-local-var)) + (should (eq 'default-value (default-value 'eval-tests/buffer-local-var))) + (should (eq 'default-value eval-tests/buffer-local-var)) (with-temp-buffer - (let ((eval-tests/buffer-local-var 'bar)) - (should (eq 'bar (default-value 'eval-tests/buffer-local-var))) - (should (eq 'bar eval-tests/buffer-local-var))))) + (let ((eval-tests/buffer-local-var 'let-value)) + (should (eq 'let-value (default-value 'eval-tests/buffer-local-var))) + (should (eq 'let-value eval-tests/buffer-local-var)))) + ;; When current buffer has explicit buffer-local binding, `let' does + ;; not alter the default binding. + (with-temp-buffer + (setq-local eval-tests/buffer-local-var 'local-value) + (let ((eval-tests/buffer-local-var 'let-value)) + ;; Let in a buffer with local binding does not change the + ;; default value for variable. + (should (eq 'default-value (default-value 'eval-tests/buffer-local-var))) + (should (eq 'let-value eval-tests/buffer-local-var)) + (with-temp-buffer + ;; We are in a new buffer - `eval-tests/buffer-local-var' has its global default value. + (should (eq 'default-value (default-value 'eval-tests/buffer-local-var))) + (should (eq 'default-value eval-tests/buffer-local-var)))))) ;;; eval-tests.el ends here -- 2.42.0 --=-=-= Content-Type: text/plain -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at --=-=-=--