           (ad-deactivate 'delete-window)
           (ad-deactivate 'delete-other-windows)
           (ad-deactivate 'balance-windows)
+          (ad-deactivate 'mwheel-scroll)
           (ad-deactivate 'select-window)
-          ;;(ad-deactivate 'windmove-do-window-select)
-          ;;(ad-deactivate 'evil-window-rotate-upwards)
-          ;;(ad-deactivate 'evil-window-rotate-downwards)
-          ;;(ad-deactivate 'kill-buffer)
-          ;;(ad-deactivate 'quit-window)
+          (ad-deactivate 'gdb)
           (smartwin-hide)
           ))
     (with-no-warnings

              (if smart-win
                  (if (eq window smart-win)
                      (smartwin-enlarge-window smart-win)
                    (minimize-window smart-win))))))))

(defadvice balance-windows (around smartwin-balance-window-ignore)
  "When `balance-windows', ignore smart window."


(defun smartwin-match-buffer (buffer-or-name)
  "Judge whether to use smartwin to show BUFFER-OR-NAME."
  (let ((buffer (if (stringp buffer-or-name)
                    (get-buffer buffer-or-name)
                  buffer-or-name)))
    (if buffer
        (let ((name (buffer-name buffer))
              (mode (buffer-local-value 'major-mode buffer)))
          (catch 'break
            (dolist (config smartwin-buffers)
              (let ((pattern (if (consp config) (car config) config))
                    (keywords (if (consp config) (cadr config) nil)))
                (if (cond ((eq pattern t) (not (buffer-file-name buffer)))
                          ((and (stringp pattern) (plist-get keywords :regexp))
                           (string-match pattern name))
                          ((stringp pattern)
                           (string= pattern name))
                          ((symbolp pattern)
                           (eq pattern mode))
                          ((functionp pattern)
                           (funcall pattern buffer))
                          (t (error "Invalid pattern: %s" pattern)))
                    (throw 'break config)))))))))

(defun smartwin-smart-window-p (window)
  "To judge whether WINDOW is smart window or not."
