Question

I recently ran into some trouble with cron and crontab because the text editor I use, emacs, inserts several spaces instead of a tab, when I press the tab key. This issue persists throughout all the major modes, regardless of the tab width set for each mode.

How can emacs be forced to use the tab character instead of tabs composed of multiple spaces?

Was it helpful?

Solution

If you want to insert a TAB character, then use C-q TAB. The TAB key is used for a different purpose (mostly to indent/align text/code according to various rules, tho it's also used for various other purposes such as performing completion, skipping from one field to another, etc...).

OTHER TIPS

Set the variable indent-tabs-mode. You can do that by customizing the variable with M-x customize-variable, on the fly with M-x set-variable, or in Elisp with the setq function.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top