Function: reftex-isearch-switch-to-next-file
reftex-isearch-switch-to-next-file is a byte-compiled function defined
in reftex-global.el.gz.
Signature
(reftex-isearch-switch-to-next-file CRT-BUF &optional WRAPP)
Source Code
;; Defined in /usr/src/emacs/lisp/textmodes/reftex-global.el.gz
;; This function is called when isearch reaches the end of a
;; buffer. For reftex what we want to do is not wrap to the
;; beginning, but switch to the next buffer in the logical order of
;; the document. This function looks through list of files in the
;; document (reftex-all-document-files), searches for the current
;; buffer and switches to the next/previous one in the logical order
;; of the document. If WRAPP is true then wrap the search to the
;; beginning/end of the file list, depending of the search direction.
(defun reftex-isearch-switch-to-next-file (crt-buf &optional wrapp)
(reftex-access-scan-info)
(let ((cb (reftex--get-buffer-identifier crt-buf))
(flist (reftex-all-document-files)))
(when flist
(if wrapp
(unless isearch-forward
(setq flist (last flist)))
(unless isearch-forward
(setq flist (reverse flist)))
(while (not (equal (car flist) cb))
(setq flist (cdr flist)))
(setq flist (cdr flist)))
(when flist
(find-file-noselect (car flist))))))