Function: reftex-index-show-entry

reftex-index-show-entry is an autoloaded and byte-compiled function defined in reftex-index.el.gz.

Signature

(reftex-index-show-entry DATA &optional NO-REVISIT)

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-index.el.gz
;;;###autoload
(defun reftex-index-show-entry (data &optional no-revisit)
  ;; Find an index entry associated with DATA and display it highlighted
  ;; in another window.  NO-REVISIT means we are not allowed to visit
  ;; files for this.
  ;; Note:  This function just looks for the nearest match of the
  ;; context string and may fail if the entry moved and an identical
  ;; entry is close to the old position.  Frequent rescans make this
  ;; safer.
  (let* ((file (nth 3 data))
         (literal (nth 2 data))
         (pos (nth 4 data))
         (re (regexp-quote literal))
         (match
          (cond
           ((or (not no-revisit)
                (find-buffer-visiting file))
            (switch-to-buffer-other-window
             (reftex-get-file-buffer-force file nil))
            (goto-char (or pos (point-min)))
            (or (looking-at re)
                (reftex-nearest-match re (length literal))))
           (t (message "%s" reftex-no-follow-message) nil))))
    (when match
      (goto-char (match-beginning 0))
      (recenter '(4))
      (reftex-highlight 0 (match-beginning 0) (match-end 0) (current-buffer)))
    match))