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

From: [email-masked]
Date: Mon, 11 Sep 2017 14:48:10 -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.

Actually, sh-script.el isn't strictly needed because it's just a
documentation patch.

> 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.

Do you have something like this in your .emacs?

    (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)
     '(smie-config (quote ((sh-mode (-2 :before "then" 0))))))

If not, note that `smie-config-save' doesn't save the rules in a
persistent way, you have to save the `smie-config' variable via the
customize interface for that (this is another thing that should probably
be clarified in the docstring).

> From: Wiseman,R,Richard,TUK2 R
> Sent: 11 September 2017 08:44
> To: [email-masked]; [email-masked]
> =, [email-masked]
> Subject: Re: bug#24848: [sh-script] How to save "Local rules set" result from sh-learn-buffer-indent?
>
> You're quite right: my smie library is gzipped.  I had no idea that might be the case!
>
> I tried your suggestion of putting the code into my .emacs file but it didn't seem to like that...
>
>
> Warning (initialization): An error occurred while loading `/home/richard/.emacs':
>
> Symbol's value as variable is void: smie-config--modefuns

Oh right, I forgot about all the dependencies.  Well, I guess patching
directly like you've tried above is the most straightforward way.