clojure-emacs / ac-nrepl

[DEPRECATED] Emacs auto-complete backend for nrepl completions
74 stars 11 forks source link

Build clojure expressions as elisp sexps, then print them compatibly to strings #15

Closed purcell closed 11 years ago

purcell commented 12 years ago

Hey @samaaron, I thought you might find this interesting.

Those strings full of clojure inside ac-nrepl bugged me, so I started wondering if we could just send sexps. Turns out that it's possible; you just have to avoid some Clojure reader syntaxes (like "#{}") which are incompatible with Elisp's reader.

This trick makes assembling the sexps much easier, because they can just be backquoted together rather than relying on "format".

The downside was that it required some custom printing trickery to work around the fact that Elisp normally prints symbols like clojure.core/map as clojure\.core/map. A further minor downside is that the elisp indentation doesn't understand Clojure's indentation rules.

I'd be interested to hear what you think.

-Steve

samaaron commented 12 years ago

Looks nice, although the strings full of Clojure should bug us! They scream out "push me somewhere upstream!"

Additionally, although paredit friendly, I wonder whether this approach might introduce subtle bugs that might be hard to locate and squash...

purcell commented 12 years ago

Yeah, I'm on the fence about this one too. :-)