jscheid / dtrt-indent

A minor mode that guesses the indentation offset originally used for creating source code files and transparently adjusts the corresponding settings in Emacs, making it more convenient to edit foreign files.
187 stars 31 forks source link

dtrt-indent-try-set-offset doesn't set generic indent variables #41

Closed hlissner closed 6 years ago

hlissner commented 6 years ago

On lines 923-924 of dtrt-indent-try-set-offset, the following check

(not (eq (symbol-value indent-offset-variable)
         best-indent-offset))

prevents other variables in dtrt-indent-hook-generic-mapping-list from being set, even if they don't match the best guess.

i.e. I want evil-shift-width to be set to the best guess, but if the mode's offset variable (say, ruby-indent-level) already matches the guess, it won't bother.

I'm guessing this wasn't intentional, so I suggest either removing the check or checking if all indent-offset-variables match the best guess before short circuiting. (Shall I PR this?)

rrthomas commented 6 years ago

Thanks! I'd be happy with the simplest option (remove the check); please do submit a PR.