emacs-devel
[Top][All Lists]
Advanced

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

Re: Simple isearch concerns


From: Gregory Heytings
Subject: Re: Simple isearch concerns
Date: Thu, 08 Apr 2021 08:48:56 +0000


I'm not sure this would work, because it's not always (isearch-repeat 'forward). For example with M-v it would be 'backward, regardless of the current direction of the search. So I guess it means that another symbol property would be necessary.

A function attached to a symbol could return its search direction. Indeed, the definitions will be slightly longer, but still this is better than defining new commands. So this could look like:

 (put 'beginning-of-buffer 'isearch-match-scroll (lambda () (goto-char 
(point-min))) 'forward)
 (put 'end-of-buffer 'isearch-match-scroll (lambda () (goto-char (point-max)) 
'backward))
 (put 'scroll-up-command 'isearch-match-scroll (lambda () (goto-char 
(window-end)) 'forward))
 (put 'scroll-down-command 'isearch-match-scroll (lambda () (goto-char 
(window-start)) 'backward))


Thank you!  Indeed that should work, I'll try to do that.

With C-p it's not clear (to me) if it should depend on the current direction of the search or not. Should C-s C-p change the direction to a backward search, or move to previous line and restart a forward search?

The same question applies to scroll-up-command and scroll-down-command, e.g. in a forward search using scroll-up-command should change the direction?


For scroll-up-command and scroll-down-command that would not make sense: it would mean that you start searching at window-end and search backward.



reply via email to

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