.
[bpt/emacs.git] / lisp / mouse.el
index f59890c..6896ff8 100644 (file)
@@ -300,7 +300,7 @@ MODE-LINE-P non-nil means a mode line is dragged."
                       (enlarge-window (- growth))
                       (select-window start-event-window))
                   ;; no.  grow/shrink the selected window
-                  (message "growth = %d" growth)
+                  ;; (message "growth = %d" growth)
                   (enlarge-window growth))
                 
                 ;; if this window's growth caused another
@@ -554,6 +554,7 @@ remains active.  Otherwise, it remains until the next input event."
         (start-point (posn-point start-posn))
         (start-window (posn-window start-posn))
         (start-frame (window-frame start-window))
+        (start-hscroll (window-hscroll start-window))
         (bounds (window-edges start-window))
         (top (nth 1 bounds))
         (bottom (if (window-minibuffer-p start-window)
@@ -676,9 +677,10 @@ remains active.  Otherwise, it remains until the next input event."
                         (mouse-set-region-1))))
              (delete-overlay mouse-drag-overlay)
              ;; Run the binding of the terminating up-event.
-             (if (fboundp fun)
-                 (setq unread-command-events
-                       (cons event unread-command-events)))))
+             (when (and (fboundp fun)
+                        (= start-hscroll (window-hscroll start-window)))
+               (setq unread-command-events
+                     (cons event unread-command-events)))))
        (delete-overlay mouse-drag-overlay)))))
 \f
 ;; Commands to handle xterm-style multiple clicks.
@@ -834,7 +836,7 @@ If DIR is positive skip forward; if negative, skip backward."
              event events key ignore
              x-lost-selection-hooks)
          (add-hook 'x-lost-selection-hooks
-                   '(lambda (seltype)
+                   (lambda (seltype)
                       (if (eq seltype 'PRIMARY)
                           (progn (setq ignore t)
                                  (throw 'mouse-show-mark t)))))
@@ -910,7 +912,8 @@ The text is saved in the kill ring, as with \\[kill-region]."
 
 (defun mouse-yank-at-click (click arg)
   "Insert the last stretch of killed text at the position clicked on.
-Also move point to one end of the text thus inserted (normally the end).
+Also move point to one end of the text thus inserted (normally the end),
+and set mark at the beginning..
 Prefix arguments are interpreted as with \\[yank].
 If `mouse-yank-at-point' is non-nil, insert at point
 regardless of where you click."
@@ -950,14 +953,12 @@ This does not delete the region; it acts like \\[kill-ring-save]."
     ;; Delete, but make the undo-list entry share with the kill ring.
     ;; First, delete just one char, so in case buffer is being modified
     ;; for the first time, the undo list records that fact.
-    (let (before-change-function after-change-function
-         before-change-functions after-change-functions)
+    (let (before-change-functions after-change-functions)
       (delete-region beg
                     (+ beg (if (> end beg) 1 -1))))
     (let ((buffer-undo-list buffer-undo-list))
       ;; Undo that deletion--but don't change the undo list!
-      (let (before-change-function after-change-function
-           before-change-functions after-change-functions)
+      (let (before-change-functions after-change-functions)
        (primitive-undo 1 buffer-undo-list))
       ;; Now delete the rest of the specified region,
       ;; but don't record it.
@@ -2053,8 +2054,8 @@ and selects that window."
 ;; This file contains the functionality of the old mldrag.el.
 (defalias 'mldrag-drag-mode-line 'mouse-drag-mode-line)
 (defalias 'mldrag-drag-vertical-line 'mouse-drag-vertical-line)
-(make-obsolete 'mldrag-drag-mode-line 'mouse-drag-mode-line)
-(make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line)
+(make-obsolete 'mldrag-drag-mode-line 'mouse-drag-mode-line "21.1")
+(make-obsolete 'mldrag-drag-vertical-line 'mouse-drag-vertical-line "21.1")
 (provide 'mldrag)
 
 ;;; mouse.el ends here