Function: vcursor-move

vcursor-move is a byte-compiled function defined in vcursor.el.gz.

Signature

(vcursor-move PT &optional LEAVE-B LEAVE-W)

Documentation

Move the virtual cursor to the character to the right of PT.

PT is an absolute location in the current buffer. With optional LEAVE-B, PT is in the same buffer the vcursor is currently in.

If the new virtual cursor location would not be visible, display it in another window. With LEAVE-W, use the current vcursor-window.

Source Code

;; Defined in /usr/src/emacs/lisp/vcursor.el.gz
(defun vcursor-move (pt &optional leave-b leave-w)
  "Move the virtual cursor to the character to the right of PT.
PT is an absolute location in the current buffer.  With optional
LEAVE-B, PT is in the same buffer the vcursor is currently in.

If the new virtual cursor location would not be visible, display it in
another window.  With LEAVE-W, use the current `vcursor-window'."
  ;; this works even if we're on-mass-shell, but usually we won't be.

  (save-excursion
    (and leave-b (vcursor-check t)
	 (set-buffer (overlay-buffer vcursor-overlay)))
    (if (eq pt (point-max))
	  (setq pt (1- pt)))
    (if (vcursor-check t)
	(move-overlay vcursor-overlay pt (+ pt 1) (current-buffer))
      (setq vcursor-overlay (make-overlay pt (+ pt 1)))
      (or window-system
	  (display-color-p)
	  (overlay-put vcursor-overlay 'before-string vcursor-string))
      (overlay-put vcursor-overlay 'face 'vcursor)
      ;; 200 is purely an arbitrary "high" number.  See bug#9663.
      (overlay-put vcursor-overlay 'priority 200))
    (or leave-w (vcursor-find-window nil t))
    ;; vcursor-window now contains the right buffer
    (or (pos-visible-in-window-p pt vcursor-window)
	(set-window-point vcursor-window pt))))