I use the following smart-tab defun in my .emacs for either completion on a word or just to do a standard tab:
(global-set-key [(tab)] 'smart-tab)
(defun smart-tab ()
"This smart tab is minibuffer compliant: it acts as usual in
the minibuffer. Else, if mark is active, indents region. Else if
point is at the end of a symbol, expands it. Else indents the
current line."
(interactive)
(if (minibufferp)
(unless (minibuffer-complete)
(dabbrev-expand nil))
(if mark-active
(indent-region (region-beginning)
(region-end))
(if (looking-at "\\_>")
(dabbrev-expand nil)
(indent-for-tab-command)))))
However, when I'm using magit-status
for git Git integration, I could previously select a file that has had a modification, hit tab, and instantly see a diff on that file to see what's been modified. However, whenever I attempt a tab now, I get the following error in my mini-buffer.
indent-relative: Buffer is read-only: #<buffer *magit: my_project*
Any thoughts on approaching this and maybe applying smart-tab above to certain modes only?
Thanks!