Function: vc-revision-other-window

vc-revision-other-window is an autoloaded, interactive and byte-compiled function defined in vc.el.gz.

Signature

(vc-revision-other-window REV)

Documentation

Visit revision REV of the current file in another window.

If the current file is named F, the revision is named F.~REV~. If F.~REV~ already exists, use it instead of checking it out again.

If this command needs to split the current window, it by default obeys the user options split-height-threshold and split-width-threshold, when it decides whether to split the window horizontally or vertically.

View in manual

Key Bindings

Aliases

ediff-vc-revision-other-window (obsolete since 28.1)

Source Code

;; Defined in /usr/src/emacs/lisp/vc/vc.el.gz
;;;###autoload
(defun vc-revision-other-window (rev)
  "Visit revision REV of the current file in another window.
If the current file is named `F', the revision is named `F.~REV~'.
If `F.~REV~' already exists, use it instead of checking it out again.

If this command needs to split the current window, it by default obeys
the user options `split-height-threshold' and `split-width-threshold',
when it decides whether to split the window horizontally or vertically."
  (interactive
   (with-current-buffer (or (buffer-base-buffer) (current-buffer))
     (vc-ensure-vc-buffer)
     (list
      (vc-read-revision (format-prompt "Revision to visit" "working revision")
                        (list buffer-file-name)))))
  (set-buffer (or (buffer-base-buffer) (current-buffer)))
  (vc-ensure-vc-buffer)
  (let* ((file buffer-file-name)
	 (revision (if (string-empty-p rev)
		       (vc-symbolic-working-revision file)
		     rev)))
    (switch-to-buffer-other-window (vc-find-revision file revision))))