Function: reftex-toc-recenter

reftex-toc-recenter is an autoloaded, interactive and byte-compiled function defined in reftex-toc.el.gz.

Signature

(reftex-toc-recenter &optional ARG)

Documentation

Display the TOC window and highlight line corresponding to current position.

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/reftex-toc.el.gz
;;;###autoload
(defun reftex-toc-recenter (&optional arg)
  "Display the TOC window and highlight line corresponding to current position."
  (interactive "P")
  (let ((buf (current-buffer))
        (frame (selected-frame)))
    (reftex-toc arg t)
    (if (= (count-lines 1 (point)) 2)
        (let ((current-prefix-arg nil))
          (select-window (get-buffer-window buf frame))
          (reftex-toc nil t)))
    (and (> (point) 1) ;FIXME: Is this point-min or do we care about narrowing?
         (not (get-text-property (point) 'cursor-intangible))
         (memq reftex-highlight-selection '(cursor both))
         (reftex-highlight 2
                           (or (previous-single-property-change
                                (min (point-max) (1+ (point))) :data)
                               (point-min))
                           (or (next-single-property-change (point) :data)
                               (point-max))))
    (select-window (get-buffer-window buf frame))))