Function: View-goto-line

View-goto-line is an interactive and byte-compiled function defined in view.el.gz.

Signature

(View-goto-line &optional LINE)

Documentation

Move to first (or prefix LINE) line in View mode.

Display is centered at LINE. Also set the mark at the position where point was.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/view.el.gz
;; (defun View-goto-line-last (&optional line)
;; "Move to last (or prefix LINE) line in View mode.
;; Display is centered at LINE.
;; Sets mark at starting position and pushes mark ring."
;;  (interactive "P")
;;  (push-mark)
;;  (if line (goto-line (prefix-numeric-value line))
;;    (goto-char (point-max))
;;    (beginning-of-line))
;;  (view-recenter))

(defun View-goto-line (&optional line)
  "Move to first (or prefix LINE) line in View mode.
Display is centered at LINE.
Also set the mark at the position where point was."
  (interactive "p")
  (push-mark)
  (goto-char (point-min))
  (forward-line (1- line))
  (view-recenter))