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: Dmitry Gutov <dmitry <at> gutov.dev>
To: Ihor Radchenko <yantar92 <at> posteo.net>, Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: 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: Wed, 13 Dec 2023 01:47:59 +0200
On 13/12/2023 01:43, Ihor Radchenko wrote:
> 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.

That's a good data point, but since I don't understand why anybody would 
make (or does make) case-fold-search buffer-local, I'm not going to 
hurry to fix those cases.

> 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.

That sounds attractive (ignoring all buffer-locals when let-bound?), but 
I'm guessing there are enough valid use cases for this behavior.




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

Previous Next


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