Commit 0a4afea9 authored by Stefan Monnier's avatar Stefan Monnier
Browse files

(mouse-wheel-mode): Make sure the new defvar doesn't

actually define the variable, but only silences the byte-compiler.
(mouse-wheel-change-button): Check whether mouse-wheel-mode is bound
before looking it up.
(mouse-wheel-scroll-amount): Also reset the bindings if this value is changed.
parent bf01513f
2009-09-12 Stefan Monnier <monnier@iro.umontreal.ca>
* mwheel.el (mouse-wheel-mode): Make sure the new defvar doesn't
actually define the variable, but only silences the byte-compiler.
(mouse-wheel-change-button): Check whether mouse-wheel-mode is bound
before looking it up.
(mouse-wheel-scroll-amount): Also reset the bindings if this value
is changed.
2009-09-12 Glenn Morris <rgm@gnu.org> 2009-09-12 Glenn Morris <rgm@gnu.org>
* emacs-lisp/elint.el (elint-file): Make max-lisp-eval-depth at least * emacs-lisp/elint.el (elint-file): Make max-lisp-eval-depth at least
...@@ -19,8 +28,8 @@ ...@@ -19,8 +28,8 @@
(epg-receive-keys, epg-import-keys-from-server) (epg-receive-keys, epg-import-keys-from-server)
(epg-start-delete-keys, epg-delete-keys, epg-start-sign-keys) (epg-start-delete-keys, epg-delete-keys, epg-start-sign-keys)
(epg-sign-keys, epg-start-generate-key) (epg-sign-keys, epg-start-generate-key)
(epg-generate-key-from-file, epg-generate-key-from-string): Remove (epg-generate-key-from-file, epg-generate-key-from-string):
autoload cookie. Remove autoload cookie.
2009-09-12 Eli Zaretskii <eliz@gnu.org> 2009-09-12 Eli Zaretskii <eliz@gnu.org>
......
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
(require 'custom) (require 'custom)
(require 'timer) (require 'timer)
(defvar mouse-wheel-mode nil) (defvar mouse-wheel-mode)
;; Setter function for mouse-button user-options. Switch Mouse Wheel ;; Setter function for mouse-button user-options. Switch Mouse Wheel
;; mode off and on again so that the old button is unbound and ;; mode off and on again so that the old button is unbound and
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
(defun mouse-wheel-change-button (var button) (defun mouse-wheel-change-button (var button)
(set-default var button) (set-default var button)
;; Sync the bindings. ;; Sync the bindings.
(when mouse-wheel-mode (mouse-wheel-mode 1))) (when (bound-and-true-p mouse-wheel-mode) (mouse-wheel-mode 1)))
(defvar mouse-wheel-down-button 4) (defvar mouse-wheel-down-button 4)
(make-obsolete-variable 'mouse-wheel-down-button (make-obsolete-variable 'mouse-wheel-down-button
...@@ -131,7 +131,8 @@ less than a full screen." ...@@ -131,7 +131,8 @@ less than a full screen."
(choice :tag "scroll amount" (choice :tag "scroll amount"
(const :tag "Full screen" :value nil) (const :tag "Full screen" :value nil)
(integer :tag "Specific # of lines") (integer :tag "Specific # of lines")
(float :tag "Fraction of window")))))) (float :tag "Fraction of window")))))
:set 'mouse-wheel-change-button)
(defcustom mouse-wheel-progressive-speed t (defcustom mouse-wheel-progressive-speed t
"If non-nil, the faster the user moves the wheel, the faster the scrolling. "If non-nil, the faster the user moves the wheel, the faster the scrolling.
...@@ -241,6 +242,7 @@ This should only be bound to mouse buttons 4 and 5." ...@@ -241,6 +242,7 @@ This should only be bound to mouse buttons 4 and 5."
(defvar mwheel-installed-bindings nil) (defvar mwheel-installed-bindings nil)
;; preloaded ;;;###autoload
(define-minor-mode mouse-wheel-mode (define-minor-mode mouse-wheel-mode
"Toggle mouse wheel support. "Toggle mouse wheel support.
With prefix argument ARG, turn on if positive, otherwise off. With prefix argument ARG, turn on if positive, otherwise off.
...@@ -267,7 +269,7 @@ Return non-nil if the new state is enabled." ...@@ -267,7 +269,7 @@ Return non-nil if the new state is enabled."
(push key mwheel-installed-bindings))))) (push key mwheel-installed-bindings)))))
;;; Compatibility entry point ;;; Compatibility entry point
;;;###autoload ;; preloaded ;;;###autoload
(defun mwheel-install (&optional uninstall) (defun mwheel-install (&optional uninstall)
"Enable mouse wheel support." "Enable mouse wheel support."
(mouse-wheel-mode (if uninstall -1 1))) (mouse-wheel-mode (if uninstall -1 1)))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment