GNU bug report logs - #66117
30.0.50; `find-buffer-visiting' is slow when opening large number of buffers

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Wed, 20 Sep 2023 08:53:02 UTC

Severity: minor

Found in version 30.0.50

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Ihor Radchenko <yantar92 <at> posteo.net>
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: Dmitry Gutov <dmitry <at> gutov.dev>, Eli Zaretskii <eliz <at> gnu.org>, 66117 <at> debbugs.gnu.org
Subject: bug#66117: 30.0.50; `find-buffer-visiting' is slow when opening large number of buffers
Date: Tue, 12 Dec 2023 23:43:47 +0000
Stefan Monnier <monnier <at> iro.umontreal.ca> writes:

>> E.g. company-dabbrev-code creates a dynamic binding for case-fold-search in
>> one place and then calls a function (company-dabbrev--search) that iterates
>> across all buffers with re-search-forward.
>
> BTW, that `company-dabbrev-code` function may not do what you expect
> in those buffers that have set `case-fold-search` buffer-locally.

Yup.

Steps to reproduce:

1. emacs -Q
2. M-: (setq-local case-fold-search nil)
3. C-x b <RET> (to *Messages*)
4. M-: (let ((case-fold-search t)) (with-current-buffer (get-buffer "*scratch*") (search-forward "CREATE")))
5. Observe search failing

If step (2) is omitted, search succeeds.

Although, I am not sure if I like that let-binding is not reliable for
buffer-locals. It is simply confusing from the point of view of let
usage; even if documented. I'd rather go for `let' becoming more consistent.

-- 
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




This bug report was last modified 1 year and 136 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.