diff options
author | Richard M. Stallman <rms@gnu.org> | 1997-05-27 22:52:31 +0000 |
---|---|---|
committer | Richard M. Stallman <rms@gnu.org> | 1997-05-27 22:52:31 +0000 |
commit | 397a88f3c99cadf431c9c9218359f71b4434af31 (patch) | |
tree | de7cac9fef6c42ea95a39cccdf9d5840ec5a55fa /lisp/mouse.el | |
parent | 3efc86effb8613c33fc15414a772ea466e717738 (diff) | |
download | emacs-397a88f3c99cadf431c9c9218359f71b4434af31.tar.gz |
(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.
Diffstat (limited to 'lisp/mouse.el')
-rw-r--r-- | lisp/mouse.el | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/lisp/mouse.el b/lisp/mouse.el index d2f76cd138c..410a9ff6b19 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el @@ -732,14 +732,16 @@ If DIR is positive skip forward; if negative, skip backward." (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 @@ If DIR is positive skip forward; if negative, skip backward." (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 |