ahk-mode icon indicating copy to clipboard operation
ahk-mode copied to clipboard

Defaulted value for tab-width is ignored

Open blaenk opened this issue 8 years ago • 1 comments

I have (setq-default tab-width 2) but for some reason it's interpreted as being set to its out-of-the-box default value of 8. I realized I could fix this by setting ahk-indentation but I think it's a bug for this to be happening at all.

Looking at the source I notice a call to kill-all-local-variables which at least sounds like the culprit.

blaenk avatar Aug 10 '17 03:08 blaenk

That function's documentation states:

Switch to Fundamental mode by killing current buffer’s local variables.
Most local variable bindings are eliminated so that the default values
become effective once more.  Also, the syntax table is set from
‘standard-syntax-table’, the local keymap is set to nil,
and the abbrev table from ‘fundamental-mode-abbrev-table’.
This function also forces redisplay of the mode line.

Every function to select a new major mode starts by
calling this function.

It seems like it's already done implicitly when switching to another mode, before that new mode's code runs, so it's probably unnecessary to call it and actually problematic because we lose all local variables.

blaenk avatar Aug 10 '17 03:08 blaenk