summaryrefslogtreecommitdiff
path: root/lisp/mouse.el
diff options
context:
space:
mode:
authorStefan Monnier <monnier@iro.umontreal.ca>2011-07-01 13:58:14 -0400
committerStefan Monnier <monnier@iro.umontreal.ca>2011-07-01 13:58:14 -0400
commitfe3f64d575814a931657875749ede200f7b15edc (patch)
tree9a29f7035b59e4ef376f87d59259ceaa36339cea /lisp/mouse.el
parent3279eb878e4b1699f5da8b8817cf03806b3fa35b (diff)
downloademacs-fe3f64d575814a931657875749ede200f7b15edc.tar.gz
* lisp/mouse.el (mouse--strip-first-event): New function.
(function-key-map): Use it to map fringe clicks to normal clicks by default.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r--lisp/mouse.el16
1 files changed, 9 insertions, 7 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el
index f35069763bd..4de3e175a4a 100644
--- a/lisp/mouse.el
+++ b/lisp/mouse.el
@@ -2092,17 +2092,19 @@ choose a font."
(global-set-key [double-mouse-1] 'mouse-set-point)
(global-set-key [triple-mouse-1] 'mouse-set-point)
-;; Clicking on the fringes causes hscrolling:
-(global-set-key [left-fringe mouse-1] 'mouse-set-point)
-(global-set-key [right-fringe mouse-1] 'mouse-set-point)
+(defun mouse--strip-first-event (_prompt)
+ (substring (this-single-command-raw-keys) 1))
+
+(define-key function-key-map [left-fringe mouse-1] 'mouse--strip-first-event)
+(define-key function-key-map [right-fringe mouse-1] 'mouse--strip-first-event)
(global-set-key [mouse-2] 'mouse-yank-primary)
;; Allow yanking also when the corresponding cursor is "in the fringe".
-(global-set-key [right-fringe mouse-2] 'mouse-yank-at-click)
-(global-set-key [left-fringe mouse-2] 'mouse-yank-at-click)
+(define-key function-key-map [right-fringe mouse-2] 'mouse--strip-first-event)
+(define-key function-key-map [left-fringe mouse-2] 'mouse--strip-first-event)
(global-set-key [mouse-3] 'mouse-save-then-kill)
-(global-set-key [right-fringe mouse-3] 'mouse-save-then-kill)
-(global-set-key [left-fringe mouse-3] 'mouse-save-then-kill)
+(define-key function-key-map [right-fringe mouse-3] 'mouse--strip-first-event)
+(define-key function-key-map [left-fringe mouse-3] 'mouse--strip-first-event)
;; By binding these to down-going events, we let the user use the up-going
;; event to make the selection, saving a click.