Closed dochang closed 4 years ago
Can you please explain what this does? If I understand the code correctly, this restricts loading the mode to buffers where indent-tabs-mode
is set and (eq ,offset tab-width)
is true—but what does that last expression mean?
I’m considering to rewrite the commit message thus:
Conditionally bypass the advice
In a buffer where
indent-tabs-mode
is nil, smart-tabs-mode is irrelevant, so don’t load it.Closes #27.
Have I correctly understood the purpose of this pull-request?
Almost every mode has its own indent variable. It may not be equal to tab-width
, which smarttabs use to indent.
If (eq ,offset tab-width)
is false, smarttabs will break the indent setting of the mode.
That's why the advice should check it, IMHO.
I think the commit message could be:
Indent as smarttabs only if the file enables
indent-tabs-mode
and its indent variable is equal totab-width
.
Adding the ((and smart-tabs-mode indent-tabs-mode (eq ,offset tab-width))
expression has made my life a lot less frustrating. Any chance this will ever be merged?
Every buffer has its own indent setting. The advice should not override it. Instead, run or bypass the advice based on the setting.
Closes jcsalomon#27.