emacs-devel
[Top][All Lists]
Advanced

[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: Mon, 12 Apr 2021 01:09:58 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu)

> +(put 'beginning-of-buffer 'isearch-motion
> +     '((lambda () (goto-char (point-min))) . forward))
> +(put 'end-of-buffer 'isearch-motion
> +     '((lambda () (goto-char (point-max))) . backward))
> +(put 'scroll-up-command 'isearch-motion
> +     '((lambda () (goto-char (window-end))) . forward))
> +(put 'scroll-down-command 'isearch-motion
> +     '((lambda () (goto-char (window-start))
> +         (when isearch-motion-recenter (recenter nil t)))
> +       . backward))
> ...
> +        (if (not isearch-motion-recenter)
> +            (recenter (if (eq direction 'forward) 1 -1) t))

This 'recenter' should affect only 'scroll-up-command' and 'scroll-down-command'
like you used 'recenter' in the 'isearch-motion' property of 
'scroll-down-command'
above.  Otherwise, this recentering has adverse effect in such definitions:

(put 'next-line 'isearch-motion '(forward-line . forward))
(put 'previous-line 'isearch-motion '((lambda () (forward-line 0)) . backward))



reply via email to

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