Function: vcursor-window-funcall

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

Signature

(vcursor-window-funcall FUNC &rest ARGS)

Documentation

Call FUNC with ARGS ... in a virtual cursor window.

A window other than the currently-selected one will always be used. The virtual cursor is moved to the value of point when the function returns.

If FUNC is a list, call the car of the list interactively, ignoring ARGS. In this case, a new window will not be created if the vcursor is visible in the current one.

Source Code

;; Defined in /usr/src/emacs/lisp/vcursor.el.gz
(defun vcursor-window-funcall (func &rest args)
  "Call FUNC with ARGS ... in a virtual cursor window.
A window other than the currently-selected one will always be used.
The virtual cursor is moved to the value of point when the function
returns.

If FUNC is a list, call the car of the list interactively, ignoring
ARGS.  In this case, a new window will not be created if the vcursor
is visible in the current one."
;; that's to avoid messing up compatibility with old versions
;; by introducing a new argument, which would have to come before ARGS.
  (vcursor-find-window (not (and (listp func) (vcursor-check t))) t)
  (save-excursion
    (let ((sw (selected-window)) text)
      ;; We can't use save-window-excursion because that would restore
      ;; the original display in the window we may want to alter.
      (unwind-protect
	  (let ((here (point)))
	    (select-window vcursor-window)
	    (vcursor-locate)
	    (if (listp func)
		(call-interactively (car func))
	      (apply func args))
	    (setq vcursor-window (selected-window))
	    (and vcursor-copy-flag
		 (eq (current-buffer) (overlay-buffer vcursor-overlay))
		 (setq text (buffer-substring here (point))))
	    ;; vcursor-window and the current buffer are definitely
	    ;; right, so make sure vcursor-move doesn't pick others.
	    (vcursor-move (point) nil t))
	(select-window sw))
      (if text (vcursor-insert text))))
  (setq vcursor-last-command t)
  )