                        (region-end))
       ;; Are we at the end of a word?
       (if (looking-at "\\_>")
-          (progn
-           (if smart-tab-always-indent
-               (indent-for-tab-command) nil)
-           (if (long-enough-p)
-               (dabbrev-expand nil) nil))
+          (if (long-enough-p)
+              (dabbrev-expand nil)
+            (if (override-p)
+                (progn
+                  (dabbrev--reset-global-variables)
+                  (dabbrev-expand nil))
+              nil))
         (indent-for-tab-command)))))
 ;; Make dabbrev-replace case insensitive.
 (setq dabbrev-case-replace nil)
 ;; Replace dabbrev-expand with hippie-expand.
-(global-set-key (kbd "M-/") 'hippie-expand)
+;; (global-set-key (kbd "M-/") 'hippie-expand)
 ;; Bind to tab.
 (global-set-key (kbd "C-i") 'smart-tab)
 ;; Function to enable autosave.


;; Make yank indent.
;; Modified from: http://emacswiki.org/emacs/AutoIndentation
(setq yank-no-indent-modes '())

;; (dolist (command '(yank yank-pop))
;;   (eval `(defadvice ,command (after indent-region activate)
;;            (not current-prefix-arg)

;; Features to make emacs more competitive with IDEs.
(require 'dabbrev)

;; Make "home" work like in most IDEs.
(defun smart-beginning-of-line ()
