Function: hmouse-posn-set-point

hmouse-posn-set-point is a byte-compiled function defined in hmouse-sh.el.

Signature

(hmouse-posn-set-point POSITION)

Documentation

Move point to POSITION, an event posn.

Select the corresponding window as well.

Source Code

;; Defined in ~/.emacs.d/elpa/hyperbole-20260414.325/hmouse-sh.el
;; Based on a function from Emacs mouse.el.
(defun hmouse-posn-set-point (position)
  "Move point to POSITION, an event posn.
Select the corresponding window as well."
  (if (framep (posn-window position))
      (progn (if (not (windowp (frame-selected-window (posn-window position))))
		 (error "Position not in text area of window"))
	     (select-window (frame-selected-window (posn-window position))))
    (unless (windowp (posn-window position))
      (error "Position not in text area of window"))
    (select-window (posn-window position)))
  (let ((pos-point (posn-point position)))
    ;; Need all these checks for vertico-mode
    (when (and (numberp pos-point)
	       (>= pos-point (point-min))
	       (<= pos-point (point-max)))
      (goto-char pos-point))))