From: Stefan Monnier Date: Fri, 1 Jul 2011 17:58:14 +0000 (-0400) Subject: * lisp/mouse.el (mouse--strip-first-event): New function. X-Git-Tag: emacs-pretest-24.0.90~104^2~152^2~262 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fe3f64d575814a931657875749ede200f7b15edc;p=emacs.git * lisp/mouse.el (mouse--strip-first-event): New function. (function-key-map): Use it to map fringe clicks to normal clicks by default. --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index df8aa7e8845..066f56a653b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,5 +1,9 @@ 2011-07-01 Stefan Monnier + * mouse.el (mouse--strip-first-event): New function. + (function-key-map): Use it to map fringe clicks to normal clicks + by default. + * vc/vc-bzr.el (vc-bzr-revision-keywords): Update. (vc-bzr-revision-completion-table): Add support for annotate and date. 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.