;;; mouse.el --- window system-independent mouse support
-;; Copyright (C) 1993-1995, 1999-2011 Free Software Foundation, Inc.
+;; Copyright (C) 1993-1995, 1999-2012 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: hardware, mouse
If value is an integer, the time elapsed between pressing and
releasing the mouse button determines whether to follow the link
or perform the normal Mouse-1 action (typically set point).
-The absolute numeric value specifices the maximum duration of a
+The absolute numeric value specifies the maximum duration of a
\"short click\" in milliseconds. A positive value means that a
short click follows the link, and a longer click performs the
normal action. A negative value gives the opposite behavior.
(defun mouse-yank-primary (click)
"Insert the primary selection at the position clicked on.
-Move point to the end of the inserted text.
-If `mouse-yank-at-point' is non-nil, insert at point
+Move point to the end of the inserted text, and set mark at
+beginning. If `mouse-yank-at-point' is non-nil, insert at point
regardless of where you click."
(interactive "e")
;; Give temporary modes such as isearch a chance to turn off.
;; FIXME: What about xterm-mouse-mode etc.?
(t
(x-get-selection 'PRIMARY)))))
- (if primary
- (insert primary)
- (error "No selection is available"))))
+ (unless primary
+ (error "No selection is available"))
+ (push-mark (point))
+ (insert primary)))
(defun mouse-kill-ring-save (click)
"Copy the region between point and the mouse click in the kill ring.