mark is active; furthermore, if `use-empty-active-region' is nil,
the region must not be empty. Otherwise, the return value is nil.
+If `use-empty-active-region' is non-nil, there is one further
+caveat: If the user has used `mouse-1' to set point, but used the
+mouse to move point to a different character yet, this function
+returns nil.
+
For some commands, it may be appropriate to ignore the value of
`use-empty-active-region'; in that case, use `region-active-p'.
`use-region-end', which may be handy when writing `interactive'
specs."
(and (region-active-p)
- (or use-empty-active-region (> (region-end) (region-beginning)))
- t))
+ (or (> (region-end) (region-beginning))
+ (and use-empty-active-region
+ (not (eq (car-safe last-input-event) 'down-mouse-1))
+ (not (mouse-movement-p last-input-event))))))
(defun region-active-p ()
"Return t if Transient Mark mode is enabled and the mark is active.