I've spent many, many hours now trying to get any sort of SMIE indentation rule/grammar/thing working.
Are there any examples of a small, toy or skeleton SMIE-based mode with documentation on how it actually works, or any discussion anywhere about how to use it? Something that, say, defines an expression as a string of tokens ending in semi-colon and a block as some expressions between brackets and nothing else. Really, really simple?
Specific questions: when using smie-config-show-indent 90% of the time I get the response ':list-intro "" -> nil'. What is list-intro basing its definition of an expression or a list of expressions on? Why does it say nil and still indent the following lines? How do I change it?
Secondly: is there any relationship between my grammar and my smie-rules? I assume there is because they are both passed into smie-setup, but I can't find any way of saying, "when you see a 'block', indent the contents", for example, based on a grammar that identifies a block.
Thirdly, SMIE seems to have lots of rules "baked in". Just kicking it off gives a general handling of brackets, braces, and parenthesis for instance. Is there any way of seeing these rules or modifying them? Or is it that the syntax table is doing all this and SMIE is literally doing nothing at all (which I'm starting to suspect).
Finally, when trying to debug SMIE I try to do an "edit, eval mode buffer, go to example code in other buffer, M-X <my mode>, test" cycle but it seems that each trip around does not clear out the rules from the previous cycle. How can I be sure that define-derived-mode starts from a clean sheet? I have (kill-all-local-variables) in there but it doesn't seem to be enough and I end up having to close emacs.
I'm not posting any examples of what I have because I have nothing that even vaguely works, aside from highlighting (using font-lock-defaults, so it's not even really SMIE I guess). I need some real baby steps.
lisp/progmodes/sh-script.el
seem to usesmie.el
rather extensively. They also seem to document their use of it so perhaps that may be a somewhat better example?