6

Possible Duplicate:
Emacs code to automatically set indent-tabs-mode according to existing code

When I'm editing old files in a group where other people may work on them tomorrow or ten years from now, I like to adopt the file's existing tab or space indentation scheme for my additions/changes - that's just being polite, but it's currently something of a hassle. Does anyone have a way for emacs to look for the current indentation scheme in the file or at least the neighboring lines and use that for Tab indentation?

Community
  • 1
  • 1
Bill White
  • 1,769
  • 14
  • 14
  • Yep, it's a duplicate - thanks for tracking that down. – Bill White Mar 08 '12 at 04:16
  • Despite the author himself consider it's a duplicate, I think his question doesn't only deal with `indent-tabs-mode` (what about `c-basic-offset`, `tab-width` and/or other indentation configurations ?). This question and phils answer deserve more attention/discussion. – Yves Lhuillier Jun 13 '17 at 12:31

1 Answers1

3

The following sound promising:

A comparison/review would be interesting.

phils
  • 71,335
  • 11
  • 153
  • 198
  • Dang, I bow to your superior search-fu! I missed those completely. – Bill White Mar 08 '12 at 04:18
  • I was pretty sure I'd seen something relevant in CategoryIndentation at the Wiki, so that made it easy :) I'd forgotten about dtrt-indent, but I'm sure that cropped up elsewhere recently, and I'd meant to look into it more at the time. – phils Mar 08 '12 at 05:01