bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#29360: 26.0; Add full-buffer choice for `isearch-lazy-highlight'


From: Juri Linkov
Subject: bug#29360: 26.0; Add full-buffer choice for `isearch-lazy-highlight'
Date: Fri, 19 Oct 2018 01:18:21 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (x86_64-pc-linux-gnu)

> It would really be good if this enhancement were made - for the
> reasons I gave in bug #21092, and for other reasons. You asked me
> (in bug #21092) to file this bug if I thought we needed such a
> full-buffer possibility. This enhancement request was the result.

Actually, a full-buffer lazy-highlighting possibility already exists:

  (setq lazy-highlight-cleanup nil)
  (add-hook 'isearch-mode-end-hook
            (lambda ()
              (setq window-group-start-function (lambda (_w) (point-min)))
              (setq window-group-end-function (lambda (_w _u) (point-max)))))

But I agree that more straightforward customization would be better
with a clear value of the customizable variable.

> Did you not have a patch that took care of this? IIRC you then found
> a problem with it wrt `follow-mode', but I thought you had a solution
> for that too. (I thought the latter solution was provided by Artur's
> `all-windows' value for `isearch-lazy-highlight' etc., which was added.)

That patch was installed more than a year ago.

> What's the status of this feature? Can we add it to Emacs now?
> I hope so.

The reason why it's not yet finished is because it was unclear how to
integrate it with another similar feature of matches-counting (that counts
the number of matches in the full buffer).  The reasoning is the following:
both features require using the same loop in isearch-lazy-highlight
extending it to operate on the full buffer.  I know you will argue that
these are unrelated features and should be treated separately.
But implementation-wise they have only one difference:

1. buffer-matches-highlighting visits all matches and highlights them;

2. buffer-matches-counting visits all matches but doesn't highlight them
   (only counts)

Both need special treatment for possible slowdown in a
large buffer, so for performance reasons we need to add
a new customizable variable like lazy-buffer-max-at-a-time,
separate not to conflict with lazy-highlight-max-at-a-time.
The latter applies to the matches on the screen, the former
to the matches in the full buffer.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]