Function: touch-screen-scroll-point-to-y

touch-screen-scroll-point-to-y is a byte-compiled function defined in touch-screen.el.gz.

Signature

(touch-screen-scroll-point-to-y TARGET-POINT TARGET-Y)

Documentation

Move the row surrounding TARGET-POINT to TARGET-Y.

Scroll the current window such that the position of TARGET-POINT within it on the Y axis approaches TARGET-Y.

Source Code

;; Defined in /usr/src/emacs/lisp/touch-screen.el.gz
(defun touch-screen-scroll-point-to-y (target-point target-y)
  "Move the row surrounding TARGET-POINT to TARGET-Y.
Scroll the current window such that the position of TARGET-POINT
within it on the Y axis approaches TARGET-Y."
  (condition-case nil
      (let* ((last-point (point))
	     (current-y (cadr (pos-visible-in-window-p target-point
                                                       nil t)))
	     (direction (if (if current-y
                                (< target-y current-y)
			      (< (window-start) target-point))
			    -1 1)))
	(while (< 0 (* direction (if current-y
				     (- target-y current-y)
				   (- (window-start) target-point))))
	  (scroll-down direction)
	  (setq last-point (point))
	  (setq current-y (cadr (pos-visible-in-window-p target-point nil t))))
	(unless (and (< direction 0) current-y)
	  (scroll-up direction)
	  (goto-char last-point)))
    ;; Ignore BOB and EOB.
    ((beginning-of-buffer end-of-buffer) nil)))