diff options
| author | Stefan Monnier | 2009-09-12 19:03:49 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2009-09-12 19:03:49 +0000 |
| commit | 0a4afea9b6d3b4283611ffabeb34f1fe1a737e45 (patch) | |
| tree | 95eae46eaf112c67b6b939b8460baf43cff1bb05 | |
| parent | bf01513fff1644d22b7db6864de1539db7438c5a (diff) | |
| download | emacs-0a4afea9b6d3b4283611ffabeb34f1fe1a737e45.tar.gz emacs-0a4afea9b6d3b4283611ffabeb34f1fe1a737e45.zip | |
(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.
| -rw-r--r-- | lisp/ChangeLog | 13 | ||||
| -rw-r--r-- | lisp/mwheel.el | 10 |
2 files changed, 17 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index aac2899a0ef..e50785feea4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2009-09-12 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * mwheel.el (mouse-wheel-mode): Make sure the new defvar doesn't | ||
| 4 | actually define the variable, but only silences the byte-compiler. | ||
| 5 | (mouse-wheel-change-button): Check whether mouse-wheel-mode is bound | ||
| 6 | before looking it up. | ||
| 7 | (mouse-wheel-scroll-amount): Also reset the bindings if this value | ||
| 8 | is changed. | ||
| 9 | |||
| 1 | 2009-09-12 Glenn Morris <rgm@gnu.org> | 10 | 2009-09-12 Glenn Morris <rgm@gnu.org> |
| 2 | 11 | ||
| 3 | * emacs-lisp/elint.el (elint-file): Make max-lisp-eval-depth at least | 12 | * emacs-lisp/elint.el (elint-file): Make max-lisp-eval-depth at least |
| @@ -19,8 +28,8 @@ | |||
| 19 | (epg-receive-keys, epg-import-keys-from-server) | 28 | (epg-receive-keys, epg-import-keys-from-server) |
| 20 | (epg-start-delete-keys, epg-delete-keys, epg-start-sign-keys) | 29 | (epg-start-delete-keys, epg-delete-keys, epg-start-sign-keys) |
| 21 | (epg-sign-keys, epg-start-generate-key) | 30 | (epg-sign-keys, epg-start-generate-key) |
| 22 | (epg-generate-key-from-file, epg-generate-key-from-string): Remove | 31 | (epg-generate-key-from-file, epg-generate-key-from-string): |
| 23 | autoload cookie. | 32 | Remove autoload cookie. |
| 24 | 33 | ||
| 25 | 2009-09-12 Eli Zaretskii <eliz@gnu.org> | 34 | 2009-09-12 Eli Zaretskii <eliz@gnu.org> |
| 26 | 35 | ||
diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 31e26c14487..ad500443b3e 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el | |||
| @@ -41,7 +41,7 @@ | |||
| 41 | (require 'custom) | 41 | (require 'custom) |
| 42 | (require 'timer) | 42 | (require 'timer) |
| 43 | 43 | ||
| 44 | (defvar mouse-wheel-mode nil) | 44 | (defvar mouse-wheel-mode) |
| 45 | 45 | ||
| 46 | ;; Setter function for mouse-button user-options. Switch Mouse Wheel | 46 | ;; Setter function for mouse-button user-options. Switch Mouse Wheel |
| 47 | ;; mode off and on again so that the old button is unbound and | 47 | ;; mode off and on again so that the old button is unbound and |
| @@ -50,7 +50,7 @@ | |||
| 50 | (defun mouse-wheel-change-button (var button) | 50 | (defun mouse-wheel-change-button (var button) |
| 51 | (set-default var button) | 51 | (set-default var button) |
| 52 | ;; Sync the bindings. | 52 | ;; Sync the bindings. |
| 53 | (when mouse-wheel-mode (mouse-wheel-mode 1))) | 53 | (when (bound-and-true-p mouse-wheel-mode) (mouse-wheel-mode 1))) |
| 54 | 54 | ||
| 55 | (defvar mouse-wheel-down-button 4) | 55 | (defvar mouse-wheel-down-button 4) |
| 56 | (make-obsolete-variable 'mouse-wheel-down-button | 56 | (make-obsolete-variable 'mouse-wheel-down-button |
| @@ -131,7 +131,8 @@ less than a full screen." | |||
| 131 | (choice :tag "scroll amount" | 131 | (choice :tag "scroll amount" |
| 132 | (const :tag "Full screen" :value nil) | 132 | (const :tag "Full screen" :value nil) |
| 133 | (integer :tag "Specific # of lines") | 133 | (integer :tag "Specific # of lines") |
| 134 | (float :tag "Fraction of window")))))) | 134 | (float :tag "Fraction of window"))))) |
| 135 | :set 'mouse-wheel-change-button) | ||
| 135 | 136 | ||
| 136 | (defcustom mouse-wheel-progressive-speed t | 137 | (defcustom mouse-wheel-progressive-speed t |
| 137 | "If non-nil, the faster the user moves the wheel, the faster the scrolling. | 138 | "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 | 242 | ||
| 242 | (defvar mwheel-installed-bindings nil) | 243 | (defvar mwheel-installed-bindings nil) |
| 243 | 244 | ||
| 245 | ;; preloaded ;;;###autoload | ||
| 244 | (define-minor-mode mouse-wheel-mode | 246 | (define-minor-mode mouse-wheel-mode |
| 245 | "Toggle mouse wheel support. | 247 | "Toggle mouse wheel support. |
| 246 | With prefix argument ARG, turn on if positive, otherwise off. | 248 | With prefix argument ARG, turn on if positive, otherwise off. |
| @@ -267,7 +269,7 @@ Return non-nil if the new state is enabled." | |||
| 267 | (push key mwheel-installed-bindings))))) | 269 | (push key mwheel-installed-bindings))))) |
| 268 | 270 | ||
| 269 | ;;; Compatibility entry point | 271 | ;;; Compatibility entry point |
| 270 | ;;;###autoload | 272 | ;; preloaded ;;;###autoload |
| 271 | (defun mwheel-install (&optional uninstall) | 273 | (defun mwheel-install (&optional uninstall) |
| 272 | "Enable mouse wheel support." | 274 | "Enable mouse wheel support." |
| 273 | (mouse-wheel-mode (if uninstall -1 1))) | 275 | (mouse-wheel-mode (if uninstall -1 1))) |