Function: doc-view-search-previous-match

doc-view-search-previous-match is an interactive and byte-compiled function defined in doc-view.el.gz.

Signature

(doc-view-search-previous-match ARG)

Documentation

Go to the ARGth previous matching page.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/doc-view.el.gz
(defun doc-view-search-previous-match (arg)
  "Go to the ARGth previous matching page."
  (interactive "p")
  (let* ((prev-pages (cl-remove-if
		      (lambda (i) (>= (car i) (doc-view-current-page)))
		      doc-view--current-search-matches))
	 (page (car (nth (1- arg) (nreverse prev-pages)))))
    (if page
	(doc-view-goto-page page)
      (when (and
	     doc-view--current-search-matches
	     (y-or-n-p "No more matches before current page.  Wrap to last match? "))
	(doc-view-goto-page (caar (last doc-view--current-search-matches)))))))