diff --git a/smart-tab.el b/smart-tab.el index 1d3e62e..c1f3ca5 100644 --- a/smart-tab.el +++ b/smart-tab.el @@ -74,15 +74,24 @@ the region or the current line (if the mark is not active)." (if smart-tab-using-hippie-expand (hippie-expand nil) (dabbrev-expand nil)) - (smart-indent))) + (smart-tab-default))) -(defun smart-indent () +(defun smart-tab-default () "Indents region if mark is active, or current line otherwise." (interactive) (if mark-active (indent-region (region-beginning) (region-end)) - (indent-for-tab-command))) + + (call-interactively + (or + ;; Minor mode maps for tab (without smart-tab-mode) + (cdar (assq-delete-all 'smart-tab-mode (minor-mode-key-binding "\t"))) + (cdar (assq-delete-all 'smart-tab-mode (minor-mode-key-binding [(tab)]))) + (local-key-binding "\t") + (local-key-binding [(tab)]) + (global-key-binding "\t") + (global-key-binding [(tab)]))))) (defun smart-tab-must-expand (&optional prefix) "If PREFIX is \\[universal-argument] or the mark is active, do not expand.