Stefan Monnier writes: >> After spending quite some time to make isearch working I have given >> up. It seems to be rather complicated, so I only changed the current >> search facility to use an isearch-like UI. Now you hit C-s and enter >> the regexp and each additional C-s or C-r jumps to the next/previous >> match. To enter a new regexp, you have to provide a prefix arg to >> C-s or C-r. > > The patch you sent earlier seemed to work (more or less), so please > add a big comment in the code describing as much as you can of your > experience: what you did and what were the problems you encountered. I attach the latest version of doc-view.el using the isearch approach. The problem was that the function doing the search (doc-view-search-forward) was called in a loop when entering something at the isearch-prompt, e.g. I enter "p" at the prompt and then isearch-search-string calls the function in isearch-search-fun-function (doc-view-isearch-function) which calls doc-view-search-forward endlessly. I don't know why, but I don't know how isearch works exactly. But even if we'd get that working no real isearch feeling comes up due to the missing match highlighting. Currently I display all lines containing a match in a tooltip and each C-s or C-r jumps directly to the next/previous page with a match. With isearch we could only display the current match. So we had to decide if another C-s jumps to the next page with a match (thus only the first match in a page will be displayed in a tooltip) or to the next match, which would do nothing visible (except the tooltip) if the next match is on the same page. And it's much slower than the current search facility, because isearch really searches for each step forward or backward wheras the current approach searches once and then it knows to which pages to jump.