1. Disable show-paren-mode if it's enabled. 2. Evalute the attached .el file (which defined a major mode). 3. Create a new bufferand type M-x foo-mode. 4. Type 'def foo do' (without quotes) and press RET. 5. Cursor will hang around on the first line even after the newline is inserted. Key moments: ?o is not in smie-blink-matching-triggers because the grammar also defines a closer 'dop'. smie-blink-matching-inners is t (which it is by default). Here's an old bug report for elixir-mode which, unfortunately, didn't reach the end of the investigation before the author opted for a workaround instead: https://github.com/elixir-editors/emacs-elixir/issues/363 What would be the better workaround, by the way? I'm thinking of simply disabling smie-blink-matching-inners. In GNU Emacs 27.0.50 (build 52, x86_64-pc-linux-gnu, GTK+ Version 3.22.30) of 2019-04-28 built on zappa Repository revision: 80822917736edbab77969c4a18dfb8dd20fe3a88 Repository branch: master Windowing system distributor 'The X.Org Foundation', version 11.0.12001000 System Description: Ubuntu 18.04.2 LTS