-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Common Lisp formatting changes the code #648
Comments
Please check if #642 fixes the OTOH, what is |
EDIT: It's not clisp, it's common lisp. Or rather coalton, but it's just regular common lisp. It's a custom macro, ref https://github.com/coalton-lang/coalton/blob/main/src/language-macros.lisp#L41 But should lispy format ever change/escape the code? |
Correct me if I'm wrong, but isn't "clisp" just an acronym for common lisp? At least that was my impression because I think "Emacs Lisp" ≈ "elisp" and therefore "Common Lisp" ≈ "clisp"? From the look of your issue, I'm pretty sure lispy reads the s-exp correctly, while deciding that quoting the "." is necessary when it is about to convert its internal data structure back to (formatted) common lisp code. Since I currently don't have access to a functional Emacs, can you confirm the following two for me:
should return a string containing the Then, go to a spare buffer, and run:
And observe that it outputs the same incorrect result as in your initial report. This means some logic should be tweaked in |
Might well be, I'm not that into Common Lisp. Thinking about it, I've heard
It doesn't,
This keeps the escaped dot, yes: |
Yes, thanks, upgrading lispy worked! |
Not sure if it helps, but here are some test-cases
|
Found the issue. Everything is fine in I think the solution is to identify unconventional yet valid symbol names, then wrap them with The problem remains, though, that different variants define valid symbols differently -- but maybe we can err on the side of caution and say that any valid symbol according to the syntax table in effect, but containing any chars that might have special reader syntax (like "#", ".", ",", "@", "?", etc), should be wrapped. Thoughts? |
Fixes abo-abo#648. * lispy.el lispy--symbol-safe-chars-regexp: define safe chars. (lispy--read): protect against unsafe chars in a symbol.
Fixes abo-abo#648. * lispy.el lispy--symbol-safe-chars-regexp: define safe chars. (lispy--read): protect against unsafe chars in a symbol.
Fixes abo-abo#648. * lispy.el lispy--symbol-safe-chars-regexp: define safe chars. (lispy--read): protect against unsafe chars in a symbol. lispy-left lispy-right: also match for beginning and end of symbol.
Fixes abo-abo#648. * lispy.el lispy--symbol-safe-chars-regexp: define safe chars. (lispy--read): protect against unsafe chars in a symbol. lispy-left lispy-right: also match for beginning and end of symbol.
There's something strange when formatting my lisp code. Certain characters is
escaped, and some is split. Notice how
(.>)
becomes(\.>)
and#\space
becomes
#\s pace
.The text was updated successfully, but these errors were encountered: