Function: mouse-drag-region
mouse-drag-region is an interactive and byte-compiled function defined
in mouse.el.gz.
Signature
(mouse-drag-region START-EVENT)
Documentation
Set the region to the text that the mouse is dragged over.
Highlight the drag area as you move the mouse. This must be bound to a button-down mouse event. In Transient Mark mode, the highlighting remains as long as the mark remains active. Otherwise, it remains until the next input event.
When the region already exists and mouse-drag-and-drop-region(var)/mouse-drag-and-drop-region(fun)
is non-nil, this moves the entire region of text to where mouse
is dragged over to.
Probably introduced at or before Emacs version 27.1.
Key Bindings
Source Code
;; Defined in /usr/src/emacs/lisp/mouse.el.gz
(defun mouse-drag-region (start-event)
"Set the region to the text that the mouse is dragged over.
Highlight the drag area as you move the mouse.
This must be bound to a button-down mouse event.
In Transient Mark mode, the highlighting remains as long as the mark
remains active. Otherwise, it remains until the next input event.
When the region already exists and `mouse-drag-and-drop-region'
is non-nil, this moves the entire region of text to where mouse
is dragged over to."
(interactive "e")
(if (and mouse-drag-and-drop-region
(not (member 'triple (event-modifiers start-event)))
(equal (mouse-posn-property (event-start start-event) 'face) 'region))
(mouse-drag-and-drop-region start-event)
;; Give temporary modes such as isearch a chance to turn off.
(run-hooks 'mouse-leave-buffer-hook)
(ignore-preserving-kill-region)
(mouse-drag-track start-event)))