# HG changeset patch # User Richard M. Stallman # Date 864773551 0 # Node ID 56f88318699ceef2e00d68417ee85310cfe4d4e2 # Parent 24b81a90c347e91b319542f699834df0e8526257 (mouse-undouble-last-event): Return nil if the event is not double or triple to start with. (mouse-show-mark): Handle scroll-bar events here. diff -r 24b81a90c347 -r 56f88318699c lisp/mouse.el --- a/lisp/mouse.el Tue May 27 21:26:13 1997 +0000 +++ b/lisp/mouse.el Tue May 27 22:52:31 1997 +0000 @@ -732,14 +732,16 @@ (last (nthcdr index events)) (event (car last)) (basic (event-basic-type event)) - (modifiers (delq 'double (delq 'triple (copy-sequence (event-modifiers event))))) + (old-modifiers (event-modifiers event)) + (modifiers (delq 'double (delq 'triple (copy-sequence old-modifiers)))) (new (if (consp event) - (cons (event-convert-list (nreverse (cons basic modifiers))) + (cons (event-convert-list (nreverse (cons basic old-modifiers))) (cdr event)) event))) (setcar last new) - (if (key-binding (apply 'vector events)) + (if (and (not (equal modifiers old-modifiers)) + (key-binding (apply 'vector events))) t (setcar last event) nil))) @@ -765,13 +767,27 @@ (throw 'mouse-show-mark t))))) (move-overlay mouse-drag-overlay (point) (mark t)) (catch 'mouse-show-mark + ;; In this loop, read and execute scroll bar events. + ;; Otherwise, if we (while (progn (setq event (read-event)) (setq events (append events (list event))) (setq key (apply 'vector events)) - (and (memq 'down (event-modifiers event)) - (not (key-binding key)) - (not (member key mouse-region-delete-keys)) - (not (mouse-undouble-last-event events)))))) + (or (and (consp event) + (eq (posn-point (event-end event)) + 'vertical-scroll-bar)) + (and (memq 'down (event-modifiers event)) + (not (key-binding key)) + (not (mouse-undouble-last-event events)) + (not (member key mouse-region-delete-keys))))) + (and (consp event) + (eq (posn-point (event-end event)) + 'vertical-scroll-bar) + (let ((keys (vector 'vertical-scroll-bar event))) + (and (key-binding keys) + (progn + (call-interactively (key-binding keys) + nil keys) + (setq events nil))))))) ;; If we lost the selection, just turn off the highlighting. (if ignore nil