   ("<M-mouse-4>" . scroll-other-window-down-dont-move-point) ; M + wheel up
   ("<M-mouse-5>" . scroll-other-window-up-dont-move-point)) ; M + wheel down
 
-;; Commented out this piece of code as it is giving the below error:
-;; byte-code: Wrong number of arguments: (lambda (arg)
-;; (mwheel-scroll-all-function-all (quote scroll-up) arg)), 0
-;; ;; Allow scrolling of all buffers using mouse-wheel in scroll-all-mode
-;; ;; (by default scroll-all-mode doesn't do that)
-;; ;; http://www.emacswiki.org/emacs/ScrollAllMode
-;; (defun mwheel-scroll-all-function-all (func arg)
-;;   (if scroll-all-mode
-;;       (save-selected-window
-;;         (walk-windows
-;;          (lambda (win)
-;;            (select-window win)
-;;            (condition-case nil
-;;                (funcall func arg)
-;;              (error nil)))))
-;;     (funcall func arg)))
-
-;; (defun mwheel-scroll-all-scroll-up-all (arg)
-;;   (mwheel-scroll-all-function-all 'scroll-up arg))
-
-;; (defun mwheel-scroll-all-scroll-down-all (arg)
-;;   (mwheel-scroll-all-function-all 'scroll-down arg))
-
-;; (setq mwheel-scroll-up-function   'mwheel-scroll-all-scroll-up-all)
-;; (setq mwheel-scroll-down-function 'mwheel-scroll-all-scroll-down-all)
-
-(setq mwheel-scroll-up-function   'scroll-up)
-(setq mwheel-scroll-down-function 'scroll-down)
+;; Allow scrolling of all buffers using mouse-wheel in `scroll-all-mode'.
+;; By default, `scroll-all-mode' works only with C-v/M-v.
+(defun modi/advice-mwhell-scroll-all (orig-fun &rest args)
+  "Execute ORIG-FUN in all the windows."
+  (let (ret)
+    (if scroll-all-mode
+        (save-selected-window (walk-windows (lambda (win)
+                                              (select-window win)
+                                              (condition-case nil
+                                                  (setq ret (apply orig-fun args))
+                                                (error nil)))))
+      (setq ret (apply orig-fun args)))
+    ret))
+(advice-add 'scroll-up   :around #'modi/advice-mwhell-scroll-all)
+(advice-add 'scroll-down :around #'modi/advice-mwhell-scroll-all)
 
 ;; Ediff
 (use-package ediff

;; Time-stamp: <2016-02-15 14:59:30 kmodi>

;; Functions to manipulate windows and buffers


          (message file-name))
      (error "Buffer not visiting a file"))))

;; Revert All Buffers
(defun revert-all-buffers ()
  "Refreshes all open buffers from their respective files"
