[MLton] Tabs in source files

Vesa Karvonen vesa.karvonen@cs.helsinki.fi
Tue, 26 Jul 2005 16:52:02 +0300

Quoting Matthew Fluet <fluet@cs.cornell.edu>:
> indent-tabs-mode is unknown by my emacs (21.2.1).

It is known by my (GNU) emacs (21.4.1 installed from Debian testing).

[I have a recollection that the feature might have existed by a
different name in older versions of (GNU) emacs.]

> How do you keep tabs from appearing in MLton source code, but allow a
> developer to use tabs freely in other projects/documents?

I personally don't use tabs for indentation in source files unless it is
required by the language (or project).

In Emacs, you could probably use hooks (e.g. sml-mode-hook) to turn the
option on/off depending on mode.

CVS has a feature to run pre/post commit scripts. I have previously used
a script that rejected commits containing tabs and automatically removed
trailing whitespace (to keep the sources clean).

Scripts can be written to convert tabs to spaces.

> How do you do this without requiring a developer to use Emacs?

I think that most programmer's editors have an option to not use tabs.

> Will my Emacs auto-indentation for formatting still work?

Yes. Indentation simply inserts spaces instead of tabs.