Last active
March 3, 2017 08:45
-
-
Save gpittarelli/52ae21e8d0add764ac83b083d142529e to your computer and use it in GitHub Desktop.
Revisions
-
gpittarelli revised this gist
Mar 3, 2017 . 2 changed files with 21 additions and 10 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,10 +0,0 @@ This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ (defun mwheel-scroll (event) (interactive (list last-input-event)) (let ((button (mwheel-event-button event))) (cond ((eq button mouse-wheel-down-event) (undo-tree-undo)) ((eq button mouse-wheel-up-event) (undo-tree-redo))))) ;; ^ global override for all scrollwheel events ;; to do it only for shift+scroll, try: (defun mwheel-scroll-through-time (event) (interactive (list last-input-event)) (let ((button (mwheel-event-button event))) (cond ((eq button mouse-wheel-down-event) (undo-tree-undo)) ((eq button mouse-wheel-up-event) (undo-tree-redo))))) (global-set-key (kbd "<S-mouse-4>") 'mwheel-scroll-through-time) (global-set-key (kbd "<S-mouse-5>") 'mwheel-scroll-through-time) -
gpittarelli created this gist
Mar 3, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,10 @@ (defun mwheel-scroll (event) "Scroll up or down according to the EVENT. This should be bound only to mouse buttons 4 and 5 on non-Windows systems." (interactive (list last-input-event)) (let ((button (mwheel-event-button event))) (cond ((eq button mouse-wheel-down-event) (undo-tree-undo)) ((eq button mouse-wheel-up-event) (undo-tree-redo)))))