New directory
[bpt/emacs.git] / lisp / mwheel.el
index 478b778..47ec9a0 100644 (file)
@@ -35,7 +35,7 @@
 ;; To enable this code, simply put this at the top of your .emacs
 ;; file:
 ;;
-;; (mwheel-install)
+;; (mouse-wheel-mode 1)
 
 ;;; Code:
 
     (set-default var button)
     (when active (mouse-wheel-mode 1))))
 
-(defvar mouse-wheel-down-button 4
-  "Obsolete.  Use `mouse-wheel-down-event'.")
+(defvar mouse-wheel-down-button 4)
+(make-obsolete-variable 'mouse-wheel-down-button
+                        'mouse-wheel-down-event)
 (defcustom mouse-wheel-down-event
   ;; In the latest versions of XEmacs, we could just use mouse-%s as well.
-  (intern (format (if (featurep 'xemacs) "button%s" "mouse-%s")
-                 mouse-wheel-down-button))
+  (if (memq system-type '(windows-nt macos darwin))
+      'wheel-up
+    (intern (format (if (featurep 'xemacs) "button%s" "mouse-%s")
+                   mouse-wheel-down-button)))
   "Event used for scrolling down."
   :group 'mouse
   :type 'symbol
   :set 'mouse-wheel-change-button)
 
-(defvar mouse-wheel-up-button 5
-  "Obsolete.  Use `mouse-wheel-up-event'.")
+(defvar mouse-wheel-up-button 5)
+(make-obsolete-variable 'mouse-wheel-up-button
+                        'mouse-wheel-up-event)
 (defcustom mouse-wheel-up-event
   ;; In the latest versions of XEmacs, we could just use mouse-%s as well.
-  (intern (format (if (featurep 'xemacs) "button%s" "mouse-%s")
-                 mouse-wheel-up-button))
+  (if (memq system-type '(windows-nt macos darwin))
+      'wheel-down
+    (intern (format (if (featurep 'xemacs) "button%s" "mouse-%s")
+                   mouse-wheel-up-button)))
   "Event used for scrolling down."
   :group 'mouse
   :type 'symbol
   :set 'mouse-wheel-change-button)
 
-(defvar mouse-wheel-click-button 2
-  "Obsolete.  Use `mouse-wheel-click-event'.")
+(defvar mouse-wheel-click-button 2)
+(make-obsolete-variable 'mouse-wheel-click-button
+                        'mouse-wheel-click-event)
 (defcustom mouse-wheel-click-event
   ;; In the latest versions of XEmacs, we could just use mouse-%s as well.
   (intern (format (if (featurep 'xemacs) "button%s" "mouse-%s")
@@ -93,7 +100,7 @@ set to the event sent when clicking on the mouse wheel button."
 (defcustom mouse-wheel-inhibit-click-time 0.35
   "Time in seconds to inhibit clicking on mouse wheel button after scroll."
   :group 'mouse
-  :type 'float)
+  :type 'number)
 
 (defcustom mouse-wheel-scroll-amount '(5 ((shift) . 1) ((control) . nil))
   "Amount to scroll windows by when spinning the mouse wheel.
@@ -102,7 +109,7 @@ the wheel is moved with the modifier key depressed.
 Elements of the list have the form (MODIFIERS . AMOUNT) or just AMOUNT if
 MODIFIERS is nil.
 
-AMOUNT should be the number of lines to scroll, or `nil' for near full
+AMOUNT should be the number of lines to scroll, or nil for near full
 screen.  It can also be a floating point number, specifying the fraction of
 a full screen to scroll.  A near full screen is `next-screen-context-lines'
 less than a full screen."
@@ -204,7 +211,7 @@ This should only be bound to mouse buttons 4 and 5."
     (if mwheel-inhibit-click-event-timer
        (cancel-timer mwheel-inhibit-click-event-timer)
       (add-hook 'pre-command-hook 'mwheel-filter-click-events))
-    (setq mwheel-inhibit-click-event-timer 
+    (setq mwheel-inhibit-click-event-timer
          (run-with-timer mouse-wheel-inhibit-click-time nil
                          'mwheel-inhibit-click-timeout))))