diff options
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 2 | ||||
| -rw-r--r-- | lisp/mouse.el | 18 |
2 files changed, 19 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 3d3de0b1efe..959d1fb246b 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,7 @@ | |||
| 1 | 2009-01-31 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2009-01-31 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * mouse.el (mouse-drag-mode-line-1): Obey mouse-1-click-follows-link. | ||
| 4 | |||
| 3 | * progmodes/ebrowse.el: | 5 | * progmodes/ebrowse.el: |
| 4 | * international/robin.el: | 6 | * international/robin.el: |
| 5 | * emulation/viper-util.el: | 7 | * emulation/viper-util.el: |
diff --git a/lisp/mouse.el b/lisp/mouse.el index 5eef35de097..cdb89caeeca 100644 --- a/lisp/mouse.el +++ b/lisp/mouse.el | |||
| @@ -419,6 +419,10 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line." | |||
| 419 | (start-event-window (posn-window start)) | 419 | (start-event-window (posn-window start)) |
| 420 | (start-event-frame (window-frame start-event-window)) | 420 | (start-event-frame (window-frame start-event-window)) |
| 421 | (start-nwindows (count-windows t)) | 421 | (start-nwindows (count-windows t)) |
| 422 | (on-link (and mouse-1-click-follows-link | ||
| 423 | (or mouse-1-click-in-non-selected-windows | ||
| 424 | (eq (posn-window start) (selected-window))) | ||
| 425 | (mouse-on-link-p start))) | ||
| 422 | (minibuffer (frame-parameter nil 'minibuffer)) | 426 | (minibuffer (frame-parameter nil 'minibuffer)) |
| 423 | should-enlarge-minibuffer event mouse y top bot edges wconfig growth) | 427 | should-enlarge-minibuffer event mouse y top bot edges wconfig growth) |
| 424 | (track-mouse | 428 | (track-mouse |
| @@ -491,6 +495,11 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line." | |||
| 491 | (one-window-p t)) | 495 | (one-window-p t)) |
| 492 | (error "Attempt to resize sole window")) | 496 | (error "Attempt to resize sole window")) |
| 493 | 497 | ||
| 498 | ;; If we ever move, make sure we don't mistakenly treat | ||
| 499 | ;; some unexpected `mouse-1' final event as a sign that | ||
| 500 | ;; this whole drag was nothing more than a click. | ||
| 501 | (if (/= growth 0) (setq on-link nil)) | ||
| 502 | |||
| 494 | ;; grow/shrink minibuffer? | 503 | ;; grow/shrink minibuffer? |
| 495 | (if should-enlarge-minibuffer | 504 | (if should-enlarge-minibuffer |
| 496 | (unless resize-mini-windows | 505 | (unless resize-mini-windows |
| @@ -519,7 +528,14 @@ MODE-LINE-P non-nil means dragging a mode line; nil means a header line." | |||
| 519 | (nth 1 (window-edges | 528 | (nth 1 (window-edges |
| 520 | ;; Choose right window. | 529 | ;; Choose right window. |
| 521 | start-event-window))))) | 530 | start-event-window))))) |
| 522 | (set-window-configuration wconfig))))))))) | 531 | (set-window-configuration wconfig))))) |
| 532 | |||
| 533 | ;; Presumably if this was just a click, the last event should | ||
| 534 | ;; be `mouse-1', whereas if this did move the mouse, it should be | ||
| 535 | ;; a `drag-mouse-1'. In any case `on-link' would have been nulled | ||
| 536 | ;; above if there had been any significant mouse movement. | ||
| 537 | (when (and on-link (eq 'mouse-1 (car-safe event))) | ||
| 538 | (push (cons 'mouse-2 (cdr event)) unread-command-events)))))) | ||
| 523 | 539 | ||
| 524 | (defun mouse-drag-mode-line (start-event) | 540 | (defun mouse-drag-mode-line (start-event) |
| 525 | "Change the height of a window by dragging on the mode line." | 541 | "Change the height of a window by dragging on the mode line." |