Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

with syntax causes problems with show-paren-mode #440

Closed
jclosure opened this issue Jul 1, 2019 · 1 comment · Fixed by #449
Closed

with syntax causes problems with show-paren-mode #440

jclosure opened this issue Jul 1, 2019 · 1 comment · Fixed by #449

Comments

@jclosure
Copy link

jclosure commented Jul 1, 2019

with syntax confuses show-paren-mode. Jarring visual artifact (large highlighted blocks of show-matching-paren face) when point is positioned in column 0, to the left of the with statement.

Config:

(show-paren-mode 1)
(setq show-paren-delay 0)

Elixir Code:

defmodule Example do

  def example do
    with a = 1,
         b = 2,
         c = 3,
         d = 4
    do
      IO.puts("weird")
    end
  end

end

image

Is this an addressable bug in elixir-mode or show-paren-mode?

@dgutov
Copy link
Contributor

dgutov commented Nov 28, 2019

Some of it is a bug, and some of it is unfortunately intended behavior (in SMIE).

I think we'd be best off installing the following workaround:

diff --git a/elixir-mode.el b/elixir-mode.el
index 2c3f29b..d1302c6 100644
--- a/elixir-mode.el
+++ b/elixir-mode.el
@@ -538,7 +538,10 @@ just return nil."
 
   (smie-setup elixir-smie-grammar 'verbose-elixir-smie-rules
               :forward-token 'elixir-smie-forward-token
-              :backward-token 'elixir-smie-backward-token))
+              :backward-token 'elixir-smie-backward-token)
+  ;; https://github.com/elixir-editors/emacs-elixir/issues/363
+  ;; http://debbugs.gnu.org/cgi/bugreport.cgi?bug=35496
+  (set (make-local-variable 'smie-blink-matching-inners) nil))
 
 ;; Invoke elixir-mode when appropriate
 

dgutov added a commit to dgutov/emacs-elixir that referenced this issue Nov 28, 2019
Re-fixes elixir-editors#363 ("hang after RET") in a better way and fixes elixir-editors#440.

It's a subtle bug in SMIE which is triggered by SMIE's grammar having
both "do" and "do:". No fix in sight, and we have to support older
Emacs anyway.
Trevoke added a commit that referenced this issue Dec 3, 2019
Re-fixes #363 ("hang after RET") in a better way and fixes #440.

It's a subtle bug in SMIE which is triggered by SMIE's grammar having
both "do" and "do:". No fix in sight, and we have to support older
Emacs anyway.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants