Is there are general clean minor-mode or other way to avoid writing
this combination in general?
Hi Ulrich,
If you want emacs to always insert spaces instead of tabs then you can put
(setq indent-tabs-mode nil)
in your .emacs.
This needs to be set for each buffer, so it should be put in a hook like
(add-hook 'c-mode-hook '(lambda ()
(setq indent-tabs-mode nil)))
You'll need to replace 'c-mode-hook with the correct hook for the
editing mode you use. Most of them are named after the mode's main
function.
HTH,
Colin S. Miller
--
Replace the obvious in my email address with the first three letters of the hostname to reply.
(setq-default indent-tabs-mode t)
The files/tabbing conventions are not mine, I just edit (tiny) parts of
the files. That's how those extra spaces actually appear.
I am considering rolling it on my own with after-save-hook.
(defun no-space-tab ()
(interactive)
(let
((point (point)))
(save-match-data
(goto-char (point-min))
(cond
((search-forward " \t" nil t)
(backward-char 1)
(error "SPACE found prior to TAB! Press Backspace"))
(t (goto-char point))))))
(add-hook 'after-save-hook 'no-space-tab)
`C-h f untabify'