[Top][All Lists]

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

Re: Simple isearch concerns

From: Juri Linkov
Subject: Re: Simple isearch concerns
Date: Sun, 11 Apr 2021 01:12:28 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> +(put 'scroll-up-command 'isearch-motion
> +     '((lambda () (goto-char (window-end))) . forward))
> +(put 'scroll-down-command 'isearch-motion
> +     '((lambda () (goto-char (window-start)) (recenter nil t)) . backward))

These definitions have such a problem that after going to the next screen,
it's recentered, so the upper half of the screen displays old matches
already seen on the previous screen.

I get much better scrolling experience with these properties:

(put 'scroll-up-command 'isearch-motion
     '((lambda () (goto-char (window-end)) (recenter 1 t)) . forward))
(put 'scroll-down-command 'isearch-motion
     '((lambda () (goto-char (window-start)) (recenter -1 t)) . backward))

so only new unseen matches are highlighted.

> +        (when (and isearch-success (not isearch-motion-changes-direction))
> +          (unless (eq direction current-direction)
> +            (let ((isearch-repeat-on-direction-change nil))
> +              (isearch-repeat current-direction))))

This 'isearch-repeat' is broken when the new option
'isearch-repeat-on-direction-change' is customized to t.

Also in this case the old commands isearch-beginning-of-buffer
and isearch-end-of-buffer are broken too.  Maybe you need to wrap
their calls of 'isearch-repeat' with

    (let ((isearch-repeat-on-direction-change nil))
      (isearch-repeat 'forward arg))

reply via email to

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