Function: ediff-scroll-vertically

ediff-scroll-vertically is an interactive and byte-compiled function defined in ediff-util.el.gz.

Signature

(ediff-scroll-vertically &optional ARG)

Documentation

Vertically scroll buffers A, B (and C if appropriate).

With optional argument ARG, scroll ARG lines; otherwise scroll by nearly the one half of the height of window-A.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/vc/ediff-util.el.gz
(defun ediff-scroll-vertically (&optional arg)
  "Vertically scroll buffers A, B (and C if appropriate).
With optional argument ARG, scroll ARG lines; otherwise scroll by nearly
the one half of the height of window-A."
  (interactive "P")
  (ediff-barf-if-not-control-buffer)

  ;; make sure windows aren't dead
  (if (not (and (window-live-p ediff-window-A) (window-live-p ediff-window-B)))
      (ediff-recenter 'no-rehighlight))
  (if (not (and (ediff-buffer-live-p ediff-buffer-A)
		(ediff-buffer-live-p ediff-buffer-B)
		(or (not ediff-3way-job)
		    (ediff-buffer-live-p ediff-buffer-C))
                (or (not ediff-merge-with-ancestor-job)
                    (not ediff-show-ancestor)
		    (ediff-buffer-live-p ediff-ancestor-buffer))
		))
      (error ediff-KILLED-VITAL-BUFFER))

  (ediff-operate-on-windows
   (if (memq last-command-event '(?v ?\C-v))
       #'scroll-up
     #'scroll-down)
   ;; calculate argument to scroll-up/down
   ;; if there is an explicit argument
   (if (and arg (not (equal arg '-)))
       ;; use it
       (prefix-numeric-value arg)
     ;; if not, see if we can determine a default amount (the window height)
     (let (default-amount)
       (setq default-amount
	     (- (/ (min (window-height ediff-window-A)
			(window-height ediff-window-B)
			(if ediff-3way-job
			    (window-height ediff-window-C)
			  500) ; some large number
                        (if (and ediff-merge-with-ancestor-job
                                 ediff-show-ancestor)
			    (window-height ediff-window-Ancestor)
			  500)) ; some large number
		   2)
		1 next-screen-context-lines))
       ;; window found
       (if arg
	   ;; C-u as argument means half of default amount
	   (/ default-amount 2)
	 ;; no argument means default amount
	 default-amount)))))