1

I'm editing a text-document styled on its own way of which Emacs doesn't recognize the markup, and opens it in fundamental-mode. Tab indentation is the most problematic behaviour.

Can I fix tab width with a runtime command, only for the current session?

Particularly I'd avoid any permanent in-file configuration.

2
  • Also, when you say you wish to avoid in-file configuration, do you only mean the document file you are editing, or does that include your own Emacs configuration as well? (the latter could be made to automatically configure behaviour for a specified file without changing the default behaviour).
    – phils
    Apr 4, 2012 at 1:44
  • 1
    That will change the displayed width of tabs, but do note that it has no bearing on what happens when you type a tab. Fundamental mode uses indent-relative which moves point to align with the contents of the previous line, and uses the tab-stop-list variable otherwise.
    – phils
    Apr 4, 2012 at 3:04

1 Answer 1

1

You can use M-x set-variable to set variables at runtime and only for that buffer and session, ideally you can set the offset variable (for instance in c-common-mode it's c-basic-offset) and you can change this value to the desired tab width (although I recommend you use spaces instead of tabs for consistency as tab characters \t are usually 8 spaces wide.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.