Function: evil-mouse--drag-set-mark-and-point

evil-mouse--drag-set-mark-and-point is a byte-compiled function defined in evil-commands.el.

Signature

(evil-mouse--drag-set-mark-and-point START CLICK CLICK-COUNT)

Source Code

;; Defined in ~/.emacs.d/elpa/evil-20251108.138/evil-commands.el
;; This function is a plain copy of `mouse--drag-set-mark-and-point',
;; which is only available in Emacs 24
(defun evil-mouse--drag-set-mark-and-point (start click click-count)
  (let* ((range (evil-mouse-start-end start click click-count))
         (beg (nth 0 range))
         (end (nth 1 range)))
    (cond ((eq (mark) beg)
           (goto-char end))
          ((eq (mark) end)
           (goto-char beg))
          ((< click (mark))
           (set-mark end)
           (goto-char beg))
          (t
           (set-mark beg)
           (goto-char end)))))