Function: rst-toc-follow-link

rst-toc-follow-link is an interactive and byte-compiled function defined in rst.el.gz.

Signature

(rst-toc-follow-link LINK-BUF LINK-PNT KILL)

Documentation

Follow the link to the section at LINK-PNT in LINK-BUF.

LINK-PNT and LINK-BUF default to the point in the current buffer. With prefix argument KILL a TOC buffer is destroyed. Throw an error if there is no working link at the given position.

Key Bindings

Aliases

rst-goto-section

Source Code

;; Defined in /usr/src/emacs/lisp/textmodes/rst.el.gz
(defun rst-toc-follow-link (link-buf link-pnt kill)
  ;; testcover: ok.
  "Follow the link to the section at LINK-PNT in LINK-BUF.
LINK-PNT and LINK-BUF default to the point in the current buffer.
With prefix argument KILL a TOC buffer is destroyed.  Throw an
error if there is no working link at the given position."
  (interactive "i\nd\nP")
  (unless link-buf
    (setq link-buf (current-buffer)))
  ;; Do not catch errors from `rst-toc-get-link' because otherwise the error is
  ;; suppressed and invisible in interactive use.
  (let ((mrkr (rst-toc-get-link link-buf link-pnt)))
    (condition-case nil
	(rst-toc-mode-return kill)
      ;; Catch errors when not in `toc-mode'.
      (error nil))
    (pop-to-buffer (marker-buffer mrkr))
    (goto-char mrkr)
    ;; FIXME: Should be a customizable number of lines from beginning or end of
    ;;        window just like the argument to 'recenter'. It would be ideal if
    ;;        the adornment is always completely visible.
    (recenter 5)))