]> code.delx.au - gnu-emacs/blobdiff - lisp/mouse-drag.el
Fix cps--gensym
[gnu-emacs] / lisp / mouse-drag.el
index ac99a34e64c9bedb69dba20ef99ed1b51f45a5e1..88838edaaede2035d6324790bbce94964f180a0d 100644 (file)
@@ -1,6 +1,6 @@
 ;;; mouse-drag.el --- use mouse-2 to do a new style of scrolling
 
 ;;; mouse-drag.el --- use mouse-2 to do a new style of scrolling
 
-;; Copyright (C) 1996-1997, 2001-201 Free Software Foundation, Inc.
+;; Copyright (C) 1996-1997, 2001-2015 Free Software Foundation, Inc.
 
 ;; Author: John Heidemann <johnh@ISI.EDU>
 ;; Keywords: mouse
 
 ;; Author: John Heidemann <johnh@ISI.EDU>
 ;; Keywords: mouse
@@ -46,7 +46,7 @@
 ;; If you like mouse-drag, you should also check out mouse-copy
 ;; for ``one-click text copy and move''.
 ;;
 ;; If you like mouse-drag, you should also check out mouse-copy
 ;; for ``one-click text copy and move''.
 ;;
-;; To use mouse-drag, place the following in your .emacs file:
+;; To use mouse-drag, place the following in your init file:
 ;; -either-
 ;;     (global-set-key [down-mouse-2] 'mouse-drag-throw)
 ;; -or-
 ;; -either-
 ;;     (global-set-key [down-mouse-2] 'mouse-drag-throw)
 ;; -or-
@@ -156,7 +156,7 @@ Keep the cursor on the screen as needed."
   "Determine if it's wise to enable col-scrolling for the current window.
 Basically, we check for existing horizontal scrolling."
   (or truncate-lines
   "Determine if it's wise to enable col-scrolling for the current window.
 Basically, we check for existing horizontal scrolling."
   (or truncate-lines
-      (> (window-hscroll (selected-window)) 0)
+      (> (window-hscroll) 0)
       (not (window-full-width-p))
       (and
        mouse-drag-electric-col-scrolling
       (not (window-full-width-p))
       (and
        mouse-drag-electric-col-scrolling
@@ -169,7 +169,7 @@ Basically, we check for existing horizontal scrolling."
             nil))))))
 
 (defvar mouse-throw-with-scroll-bar nil
             nil))))))
 
 (defvar mouse-throw-with-scroll-bar nil
-  "*Set direction of mouse-throwing.
+  "Set direction of mouse-throwing.
 If nil, the text moves in the direction the mouse moves.
 If t, the scroll bar moves in the direction the mouse moves.")
 (defconst mouse-throw-magnifier-min -6)
 If nil, the text moves in the direction the mouse moves.
 If t, the scroll bar moves in the direction the mouse moves.")
 (defconst mouse-throw-magnifier-min -6)
@@ -194,7 +194,7 @@ from the original mouse click to the current mouse location.  Try it;
 you'll like it.  It's easier to observe than to explain.
 
 If the mouse is clicked and released in the same place of time we
 you'll like it.  It's easier to observe than to explain.
 
 If the mouse is clicked and released in the same place of time we
-assume that the user didn't want to scdebugroll but wanted to whatever
+assume that the user didn't want to scroll but wanted to whatever
 mouse-2 used to do, so we pass it through.
 
 Throw scrolling was inspired (but is not identical to) the \"hand\"
 mouse-2 used to do, so we pass it through.
 
 Throw scrolling was inspired (but is not identical to) the \"hand\"
@@ -214,13 +214,10 @@ To test this function, evaluate:
         (start-row (cdr (posn-col-row start-posn)))
         (start-col (car (posn-col-row start-posn)))
         (old-selected-window (selected-window))
         (start-row (cdr (posn-col-row start-posn)))
         (start-col (car (posn-col-row start-posn)))
         (old-selected-window (selected-window))
-        event end row mouse-delta scroll-delta
+        event end row scroll-delta
         have-scrolled
         have-scrolled
-        window-last-row
-        col mouse-col-delta window-last-col
+        col
         (scroll-col-delta 0)
         (scroll-col-delta 0)
-        adjusted-mouse-col-delta
-        adjusted-mouse-delta
         ;; be conservative about allowing horizontal scrolling
         (col-scrolling-p (mouse-drag-should-do-col-scrolling)))
     (select-window start-window)
         ;; be conservative about allowing horizontal scrolling
         (col-scrolling-p (mouse-drag-should-do-col-scrolling)))
     (select-window start-window)
@@ -275,10 +272,10 @@ To test this function, evaluate:
         (start-row (cdr (posn-col-row start-posn)))
         (start-col (car (posn-col-row start-posn)))
         (old-selected-window (selected-window))
         (start-row (cdr (posn-col-row start-posn)))
         (start-col (car (posn-col-row start-posn)))
         (old-selected-window (selected-window))
-        event end row mouse-delta scroll-delta
+        event end row scroll-delta
         have-scrolled
         window-last-row
         have-scrolled
         window-last-row
-        col mouse-col-delta window-last-col
+        col window-last-col
         (scroll-col-delta 0)
         ;; be conservative about allowing horizontal scrolling
         (col-scrolling-p (mouse-drag-should-do-col-scrolling)))
         (scroll-col-delta 0)
         ;; be conservative about allowing horizontal scrolling
         (col-scrolling-p (mouse-drag-should-do-col-scrolling)))
@@ -294,7 +291,7 @@ To test this function, evaluate:
               (or (mouse-movement-p event)
                   (eq (car-safe event) 'switch-frame)))
        ;; Scroll if see if we're on the edge.
               (or (mouse-movement-p event)
                   (eq (car-safe event) 'switch-frame)))
        ;; Scroll if see if we're on the edge.
-       ;; NEEDSWORK: should handle mouse-in-other window.
+       ;; FIXME: should handle mouse-in-other window.
        (cond
         ((not (eq start-window (posn-window end)))
          t) ; wait for return to original window
        (cond
         ((not (eq start-window (posn-window end)))
          t) ; wait for return to original window