Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to scroll in isearch mode?

Tags:

emacs

elisp

Is there a way to scroll through a document without exiting isearch mode? I have isearch-allow-scroll set to t, but that limits my scroll range to make sure the current isearch match is visible in the buffer. Ideally, I would like to be able to scroll with the mousewheel, having all the isearch matches highlighted as I scroll.

I am aware of M-x occur, but a lot of the time simply being able to scroll in isearch mode would be more efficient (in addition, M-x occur does not play well with folding mode).

like image 450
Leo Alekseyev Avatar asked Mar 18 '10 05:03

Leo Alekseyev


2 Answers

There's also highlight-regexp if you want. It will highlight regexps and you can scroll as usual.

like image 189
Noufal Ibrahim Avatar answered Oct 24 '22 06:10

Noufal Ibrahim


It looks like what you want is not possible in general. From the documentation inside isearch.el:

;; scrolling within Isearch mode.  Alan Mackenzie ([email protected]), 2003/2/24
;;
;; The idea here is that certain vertical scrolling commands (like C-l
;; `recenter') should be usable WITHIN Isearch mode.  For a command to be
;; suitable, it must NOT alter the buffer, swap to another buffer or frame,
;; tamper with isearch's state, or move point.  It is unacceptable for the
;; search string to be scrolled out of the current window.  If a command
;; attempts this, we scroll the text back again.

In other words, it's not possible to scroll far enough that the search string moves out of the window.

like image 2
Trey Jackson Avatar answered Oct 24 '22 06:10

Trey Jackson