unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#35496: 27.0.50; smie-blink-matching-open blinks token before point after RET
@ 2019-04-29 20:57 Dmitry Gutov
  2019-05-07 22:38 ` Dmitry Gutov
  2019-05-08  1:44 ` Stefan Monnier
  0 siblings, 2 replies; 8+ messages in thread
From: Dmitry Gutov @ 2019-04-29 20:57 UTC (permalink / raw)
  To: 35496

[-- Attachment #1: Type: text/plain, Size: 1086 bytes --]

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

[-- Attachment #2: smie-blink-matching-inners.el --]
[-- Type: text/x-emacs-lisp, Size: 470 bytes --]

(require 'smie)

(defvar foo-smie-grammar
  (smie-prec2->grammar
   (smie-bnf->prec2
    '((statements (statement)
                  (statement ";" statements))
      (statement ("def" non-block-expr "do" statements "end")
                 ("def" non-block-expr "COMMA" "dop" non-block-expr))
      (non-block-expr ("STRING"))))))

(define-derived-mode foo-mode prog-mode "Foo"
  (set (make-local-variable 'comment-start) "# ")
  (smie-setup foo-smie-grammar #'ignore))

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2021-09-22 23:12 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-29 20:57 bug#35496: 27.0.50; smie-blink-matching-open blinks token before point after RET Dmitry Gutov
2019-05-07 22:38 ` Dmitry Gutov
2019-05-08  1:44 ` Stefan Monnier
2019-05-08  9:51   ` Dmitry Gutov
2019-05-08 17:42     ` Stefan Monnier
2019-05-13  0:52       ` Dmitry Gutov
2021-09-22 21:34         ` Lars Ingebrigtsen
2021-09-22 23:12           ` Dmitry Gutov

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).