Subject: bug#24848: [sh-script] How to save "Local rules set" result from sh-learn-buffer-indent?

From: Noam Postavsky <[email-masked]>
Date: Fri, 22 Sep 2017 18:46:19 -0400

<[email-masked]> writes:

> I've added the code to an unzipped version of smie.el and to
> sh-script.el and byte-compiled both.  Emacs loads without errors now,
> but to be honest, I'm unsure how to check that it now loads
> smie-config properly!  I load a script file and check the value of
> smie-config and it says it's set for the current session only but its
> value is nil.

Well, the best way to check would to remove the setting of
sh-indentation and make sure you still get the indentation you want.
However, since you're saying smie-config is nil, it seems something went
wrong.  Do you have the patched smie.elc on your load-path (i.e., does
M-x locate-library RET smie RET point to the patched version)?

> My ~/.emacs contains, amongst many other things:
>
> (custom-set-variables
>  ;; custom-set-variables was added by Custom.
>  ;; If you edit it by hand, you could mess it up, so be careful.
>  ;; Your init file should contain only one such instance.
>  ;; If there is more than one, they won't work right.
>  '(sh-basic-offset 2)
>  '(sh-indentation 2)
>  '(smie-config (quote ((sh-mode (2 :elem basic 4)))))
>  '(tab-width 2))

Since you have the smie-config set in your custom variable block, I
can't quite see how it ended up as nil.  Is it possible something else
in your config is resetting it?