emacs-devel
[Top][All Lists]
Advanced

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

Re: Simple isearch concerns


From: Eli Zaretskii
Subject: Re: Simple isearch concerns
Date: Sun, 11 Apr 2021 10:07:31 +0300

> From: Juri Linkov <juri@linkov.net>
> Cc: Eli Zaretskii <eliz@gnu.org>,  spacibba@aol.com,  emacs-devel@gnu.org
> Date: Sun, 11 Apr 2021 01:12:28 +0300
> 
> > +(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.

That's your personal preference wrt how much of the context should be
left on the screen; it is well known that there are other preferences
regarding this aspect.  Gregory's code provides the default Emacs
experience of recentering, so it is the right default.  If we want to
cater to other preferences, we need to make the 1st argument to
recenter depend on scroll-related options, or maybe introduce a new
user option.



reply via email to

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