diff options
| author | Sam Steingold | 2002-02-19 17:53:07 +0000 |
|---|---|---|
| committer | Sam Steingold | 2002-02-19 17:53:07 +0000 |
| commit | a2372cfd069f9828ecff0fa94a5e02ee3d5e704c (patch) | |
| tree | 250240f00438dc47b0071cf119a284503d45ab8e | |
| parent | cf92160d3dc2b7c9ee1b7edb1ec31948ebef1515 (diff) | |
| download | emacs-a2372cfd069f9828ecff0fa94a5e02ee3d5e704c.tar.gz emacs-a2372cfd069f9828ecff0fa94a5e02ee3d5e704c.zip | |
Can specify different scroll amounts for different modifiers now.
| -rw-r--r-- | lisp/ChangeLog | 32 | ||||
| -rw-r--r-- | lisp/mwheel.el | 52 |
2 files changed, 48 insertions, 36 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index b679bd218e3..9ff7107dc0d 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2002-02-19 Sam Steingold <sds@gnu.org> | ||
| 2 | |||
| 3 | * mwheel.el (mouse-wheel-scroll-amount): Can specify different | ||
| 4 | scroll amounts for different modifiers now. | ||
| 5 | (mwheel-scroll): Handle the new `mouse-wheel-scroll-amount' | ||
| 6 | format properly. | ||
| 7 | (mouse-wheel-mode): Ditto. | ||
| 8 | |||
| 1 | 2002-02-19 Eli Zaretskii <eliz@is.elta.co.il> | 9 | 2002-02-19 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 10 | ||
| 3 | * textmodes/bibtex.el (bibtex-parse-keys): Put save-match-data | 11 | * textmodes/bibtex.el (bibtex-parse-keys): Put save-match-data |
| @@ -208,11 +216,11 @@ | |||
| 208 | (describe-text-category): New command. | 216 | (describe-text-category): New command. |
| 209 | (describe-text-at): New command. | 217 | (describe-text-at): New command. |
| 210 | (facemenu-menu): Replace `list-text-properties-at' with | 218 | (facemenu-menu): Replace `list-text-properties-at' with |
| 211 | `describe-text-at' in the menu. | 219 | `describe-text-at' in the menu. |
| 212 | 220 | ||
| 213 | * wid-edit.el (widgetp): New function. | 221 | * wid-edit.el (widgetp): New function. |
| 214 | * wid-edit.el (widget-keymap, widget-insert, widget-setup): | 222 | * wid-edit.el (widget-keymap, widget-insert, widget-setup): |
| 215 | Autoloaded. | 223 | Autoloaded. |
| 216 | 224 | ||
| 217 | * emacs-lisp/pp.el (pp-to-string): Autoloaded. | 225 | * emacs-lisp/pp.el (pp-to-string): Autoloaded. |
| 218 | 226 | ||
| @@ -258,7 +266,7 @@ | |||
| 258 | 266 | ||
| 259 | * menu-bar.el (menu-bar-options-save): Removed `truncate-lines'. | 267 | * menu-bar.el (menu-bar-options-save): Removed `truncate-lines'. |
| 260 | (menu-bar-options-menu): Don't set default value for | 268 | (menu-bar-options-menu): Don't set default value for |
| 261 | `truncate-lines'. | 269 | `truncate-lines'. |
| 262 | 270 | ||
| 263 | 2002-02-12 Per Abrahamsen <abraham@dina.kvl.dk> | 271 | 2002-02-12 Per Abrahamsen <abraham@dina.kvl.dk> |
| 264 | 272 | ||
| @@ -294,14 +302,14 @@ | |||
| 294 | (menu-bar-showhide-menu): Ditto. | 302 | (menu-bar-showhide-menu): Ditto. |
| 295 | (menu-bar-options-menu): Ditto. | 303 | (menu-bar-options-menu): Ditto. |
| 296 | (menu-bar-scroll-bar-right, menu-bar-scroll-bar-left, | 304 | (menu-bar-scroll-bar-right, menu-bar-scroll-bar-left, |
| 297 | menu-bar-scroll-bar-none): Removed. | 305 | menu-bar-scroll-bar-none): Removed. |
| 298 | (menu-bar-showhide-scroll-bar-menu): Use customize aware lambda | 306 | (menu-bar-showhide-scroll-bar-menu): Use customize aware lambda |
| 299 | expressions instead. | 307 | expressions instead. |
| 300 | 308 | ||
| 301 | * cus-edit.el (customize-set-value): Return value. | 309 | * cus-edit.el (customize-set-value): Return value. |
| 302 | (customize-set-variable): Ditto. | 310 | (customize-set-variable): Ditto. |
| 303 | (customize-save-variable): Ditto. | 311 | (customize-save-variable): Ditto. |
| 304 | (customize-set-variable): Load dependencies before setting value. | 312 | (customize-set-variable): Load dependencies before setting value. |
| 305 | (custom-load-symbol): Autoload it. | 313 | (custom-load-symbol): Autoload it. |
| 306 | (customize-mark-as-set): New function. | 314 | (customize-mark-as-set): New function. |
| 307 | 315 | ||
| @@ -342,24 +350,24 @@ | |||
| 342 | toggling. | 350 | toggling. |
| 343 | 351 | ||
| 344 | 2002-02-10 Michael Kifer <kifer@cs.stonybrook.edu> | 352 | 2002-02-10 Michael Kifer <kifer@cs.stonybrook.edu> |
| 345 | 353 | ||
| 346 | * viper-util.el (viper-read-key-sequence): fixed so it'll read | 354 | * viper-util.el (viper-read-key-sequence): fixed so it'll read |
| 347 | fast key sequences in emacs native mode | 355 | fast key sequences in emacs native mode |
| 348 | (viper-events-to-keys): deleted | 356 | (viper-events-to-keys): deleted |
| 349 | 357 | ||
| 350 | * viper.el (describe-key, describe-key-briefly): get rid of | 358 | * viper.el (describe-key, describe-key-briefly): get rid of |
| 351 | viper-events-to-keys. | 359 | viper-events-to-keys. |
| 352 | 360 | ||
| 353 | * ediff-init.el (ediff-has-gutter-support): Steven Turnbull's patch. | 361 | * ediff-init.el (ediff-has-gutter-support): Steven Turnbull's patch. |
| 354 | 362 | ||
| 355 | * ediff-wind.el (ediff-setup-control-frame): Use | 363 | * ediff-wind.el (ediff-setup-control-frame): Use |
| 356 | ediff-has-gutter-support. | 364 | ediff-has-gutter-support. |
| 357 | 365 | ||
| 358 | * ediff-util.el (ediff-dispose-of-variant-according-to-user): | 366 | * ediff-util.el (ediff-dispose-of-variant-according-to-user): |
| 359 | check if buff is alive. | 367 | check if buff is alive. |
| 360 | 368 | ||
| 361 | * ediff.el: typo in comment. | 369 | * ediff.el: typo in comment. |
| 362 | 370 | ||
| 363 | 2002-02-09 Pavel Jan,Bm(Bk <Pavel@Janik.cz> | 371 | 2002-02-09 Pavel Jan,Bm(Bk <Pavel@Janik.cz> |
| 364 | 372 | ||
| 365 | * menu-bar.el (menu-bar-options-save): Take care of | 373 | * menu-bar.el (menu-bar-options-save): Take care of |
diff --git a/lisp/mwheel.el b/lisp/mwheel.el index 6f2fe95eb72..7cb5058e063 100644 --- a/lisp/mwheel.el +++ b/lisp/mwheel.el | |||
| @@ -63,11 +63,11 @@ | |||
| 63 | :type 'integer | 63 | :type 'integer |
| 64 | :set 'mouse-wheel-change-button) | 64 | :set 'mouse-wheel-change-button) |
| 65 | 65 | ||
| 66 | (defcustom mouse-wheel-scroll-amount '(5 . 1) | 66 | (defcustom mouse-wheel-scroll-amount '(5 ((shift) . 1) ((control) . nil)) |
| 67 | "Amount to scroll windows by when spinning the mouse wheel. | 67 | "Amount to scroll windows by when spinning the mouse wheel. |
| 68 | This is actually a cons cell, where the first item is the amount to scroll | 68 | This is actually a cons cell, where the first item is the amount to scroll |
| 69 | on a normal wheel event, and the second is the amount to scroll when the | 69 | on a normal wheel event, and the rest is an alist mapping the modifier key |
| 70 | wheel is moved with the shift key depressed. | 70 | to the amount to scroll when the wheel is moved with the modifier key depressed. |
| 71 | 71 | ||
| 72 | Each item should be the number of lines to scroll, or `nil' for near | 72 | Each item should be the number of lines to scroll, or `nil' for near |
| 73 | full screen. It can also be a floating point number, specifying | 73 | full screen. It can also be a floating point number, specifying |
| @@ -79,10 +79,14 @@ A near full screen is `next-screen-context-lines' less than a full screen." | |||
| 79 | (const :tag "Full screen" :value nil) | 79 | (const :tag "Full screen" :value nil) |
| 80 | (integer :tag "Specific # of lines") | 80 | (integer :tag "Specific # of lines") |
| 81 | (float :tag "Fraction of window")) | 81 | (float :tag "Fraction of window")) |
| 82 | (choice :tag "Shifted" | 82 | (repeat |
| 83 | (const :tag "Full screen" :value nil) | 83 | (cons |
| 84 | (integer :tag "Specific # of lines") | 84 | (repeat (choice :tag "modifier" (const alt) (const control) (const hyper) |
| 85 | (float :tag "Fraction of window")))) | 85 | (const meta) (const shift) (const super))) |
| 86 | (choice :tag "scroll amount" | ||
| 87 | (const :tag "Full screen" :value nil) | ||
| 88 | (integer :tag "Specific # of lines") | ||
| 89 | (float :tag "Fraction of window")))))) | ||
| 86 | 90 | ||
| 87 | (defcustom mouse-wheel-progessive-speed t | 91 | (defcustom mouse-wheel-progessive-speed t |
| 88 | "If non-nil, the faster the user moves the wheel, the faster the scrolling. | 92 | "If non-nil, the faster the user moves the wheel, the faster the scrolling. |
| @@ -114,13 +118,14 @@ This can be slightly disconcerting, but some people may prefer it." | |||
| 114 | "Scroll up or down according to the EVENT. | 118 | "Scroll up or down according to the EVENT. |
| 115 | This should only be bound to mouse buttons 4 and 5." | 119 | This should only be bound to mouse buttons 4 and 5." |
| 116 | (interactive "e") | 120 | (interactive "e") |
| 117 | (let ((curwin (if mouse-wheel-follow-mouse | 121 | (let* ((curwin (if mouse-wheel-follow-mouse |
| 118 | (prog1 | 122 | (prog1 |
| 119 | (selected-window) | 123 | (selected-window) |
| 120 | (select-window (mwheel-event-window event))))) | 124 | (select-window (mwheel-event-window event))))) |
| 121 | (amt (if (memq 'shift (event-modifiers event)) | 125 | (mods (delete 'click (event-modifiers event))) |
| 122 | (cdr mouse-wheel-scroll-amount) | 126 | (amt (if mods |
| 123 | (car mouse-wheel-scroll-amount)))) | 127 | (cdr (assoc mods (cdr mouse-wheel-scroll-amount))) |
| 128 | (car mouse-wheel-scroll-amount)))) | ||
| 124 | (if (floatp amt) (setq amt (1+ (truncate (* amt (window-height)))))) | 129 | (if (floatp amt) (setq amt (1+ (truncate (* amt (window-height)))))) |
| 125 | (when (and mouse-wheel-progessive-speed (numberp amt)) | 130 | (when (and mouse-wheel-progessive-speed (numberp amt)) |
| 126 | ;; When the double-mouse-N comes in, a mouse-N has been executed already, | 131 | ;; When the double-mouse-N comes in, a mouse-N has been executed already, |
| @@ -145,16 +150,15 @@ Returns non-nil if the new state is enabled." | |||
| 145 | ;; (S-)*mouse-[45], since those are aliases for the button | 150 | ;; (S-)*mouse-[45], since those are aliases for the button |
| 146 | ;; equivalents in XEmacs, but I want this to work in as many | 151 | ;; equivalents in XEmacs, but I want this to work in as many |
| 147 | ;; versions of XEmacs as it can. | 152 | ;; versions of XEmacs as it can. |
| 148 | (let ((keys | 153 | (let* ((prefix (if (featurep 'xemacs) "button%d" "mouse-%d")) |
| 149 | (if (featurep 'xemacs) | 154 | (dn (intern (format prefix mouse-wheel-down-button))) |
| 150 | (let ((down (intern (format "button%d" mouse-wheel-down-button))) | 155 | (up (intern (format prefix mouse-wheel-up-button))) |
| 151 | (up (intern (format "button%d" mouse-wheel-up-button)))) | 156 | (keys |
| 152 | `(,down [(shift ,down)] ,up [(shift ,up)])) | 157 | (nconc (list dn up) |
| 153 | (let ((down (intern (format "mouse-%d" mouse-wheel-down-button))) | 158 | (mapcar (lambda (amt) `[(,@(car amt) ,up)]) |
| 154 | (s-down (intern (format "S-mouse-%d" mouse-wheel-down-button))) | 159 | (cdr mouse-wheel-scroll-amount)) |
| 155 | (up (intern (format "mouse-%d" mouse-wheel-up-button))) | 160 | (mapcar (lambda (amt) `[(,@(car amt) ,dn)]) |
| 156 | (s-up (intern (format "S-mouse-%d" mouse-wheel-up-button)))) | 161 | (cdr mouse-wheel-scroll-amount))))) |
| 157 | `([,down] [,s-down] [,up] [,s-up]))))) | ||
| 158 | ;; This condition-case is here because Emacs 19 will throw an error | 162 | ;; This condition-case is here because Emacs 19 will throw an error |
| 159 | ;; if you try to define a key that it does not know about. I for one | 163 | ;; if you try to define a key that it does not know about. I for one |
| 160 | ;; prefer to just unconditionally do a mwheel-install in my .emacs, so | 164 | ;; prefer to just unconditionally do a mwheel-install in my .emacs, so |