Function: mouse-set-point

mouse-set-point is an interactive and byte-compiled function defined in mouse.el.gz.

Signature

(mouse-set-point EVENT &optional PROMOTE-TO-REGION)

Documentation

Move point to the position clicked on with the mouse.

This should be bound to a mouse click event type. If PROMOTE-TO-REGION is non-nil and event is a multiple-click, select the corresponding element around point, with the resulting position of point determined by mouse-select-region-move-to-beginning.

View in manual

Probably introduced at or before Emacs version 22.1.

Key Bindings

Source Code

;; Defined in /usr/src/emacs/lisp/mouse.el.gz
(defun mouse-set-point (event &optional promote-to-region)
  "Move point to the position clicked on with the mouse.
This should be bound to a mouse click event type.
If PROMOTE-TO-REGION is non-nil and event is a multiple-click, select
the corresponding element around point, with the resulting position of
point determined by `mouse-select-region-move-to-beginning'."
  (interactive "e\np")
  (mouse-minibuffer-check event)
  (if (and promote-to-region (> (event-click-count event) 1))
      (progn
        (mouse-set-region event)
        (when mouse-select-region-move-to-beginning
          (when (> (posn-point (event-start event)) (region-beginning))
            (exchange-point-and-mark))))
    ;; Use event-end in case called from mouse-drag-region.
    ;; If EVENT is a click, event-end and event-start give same value.
    (posn-set-point (event-end event))))