moderninterpreters / markup

MARKUP provides a reader-macro to read HTML tags inside of Common Lisp code
Apache License 2.0
70 stars 8 forks source link

Parenthesis matching for (< 3 2) #6

Closed tdrhq closed 4 years ago

tdrhq commented 4 years ago

Emacs seems to be matching the ')' with '<' in the expressin (< 3 2).

In particular paredit-mode fails because it things there are unmatched parenthesis.

I'm going to look into it, but was hoping you'd have a much more quicker answer :)

charJe commented 4 years ago

does forward-sexp work? I havent used paredit-mode. also what is the result of (syntax-after (point)) when the cursor is on <

tdrhq commented 4 years ago

I disabled paredit-mode, for these:

with buffer (< 3 2) and point at <, forward-sexp goes to ), so that's incorrect.

(syntax-after (point)) gives (4).

charJe commented 4 years ago

You can close this issue if that solved your problem.

tdrhq commented 4 years ago

@charJe So if I open a new emacs session, this seems to be behaving better. I'm not able to make it work on my existing Emacs session, so I'm just going to restart it. It would be nice if we could make this a minor-mode so that we can turn it on and off for debugging purposes.

charJe commented 4 years ago

You should be able to fix the current session by with

(modify-syntax-entry ?< "w" lisp-mode-syntax-table)
(modify-syntax-entry ?> "w" lisp-mode-syntax-table)

The nature of syntax tables is very imperative. If I made it a minor mode, I guess having it's own syntax table would mitigate some of these issues.

tdrhq commented 4 years ago

Aweomse, thanks, I'll close out this task for now, and I'll reopen if I do find any more issues. Thanks for the quick response on this! You saved me a lot of time trying to debug this myself!