Function: viper-mouse-click-get-word

viper-mouse-click-get-word is a byte-compiled function defined in viper-mous.el.gz.

Signature

(viper-mouse-click-get-word CLICK COUNT CLICK-COUNT)

Documentation

Return word surrounding the position of a mouse click.

Click may be in another window. Current window and buffer isn't changed. On single or double click, returns the word as determined by viper-surrounding-word-function.

Source Code

;; Defined in /usr/src/emacs/lisp/emulation/viper-mous.el.gz
(defun viper-mouse-click-get-word (click count click-count)
  "Return word surrounding the position of a mouse click.
Click may be in another window.  Current window and buffer isn't changed.
On single or double click, returns the word as determined by
`viper-surrounding-word-function'."

  (let ((click-word "")
	(click-pos (posn-point (event-start click)))
	(click-buf (viper-mouse-click-window-buffer click)))
    (or (natnump count) (setq count 1))
    (or (natnump click-count) (setq click-count 1))

    (save-excursion
      (save-window-excursion
	(if click-pos
	    (progn
	      (set-buffer click-buf)

	      (goto-char click-pos)
	      (setq click-word
		    (funcall viper-surrounding-word-function count click-count)))
	  (error "Click must be over a window"))
	click-word))))