SquircleSpace / shcl

SHell in Common Lisp
Apache License 2.0
318 stars 17 forks source link

Elisp Splices #25

Open SquircleSpace opened 5 years ago

SquircleSpace commented 5 years ago

When running a shell command from Emacs (e.g. M-!), it would be handy if the lisp splice syntax (i.e. ,) didn't evaluate the lisp form as Common Lisp in SHCL, but instead evaluated it as Emacs Lisp within Emacs.

There are a couple of ways this can be accomplished.

  1. SHCL is just running inside Emacs. If SHCL is linked by Emacs then SHCL should be able to call out to Emacs Lisp somehow. Practically speaking this means SHCL will need to build as an ECL library or something. Alternatively, we could implement Common Lisp in Emacs Lisp...

  2. SHCL uses emacsclient to get Emacs to evaluate the expression. This requires Emacs to be running a server, but that shouldn't be too hard. It seems like Emacs Lisp's syntax is a strict subset of Common Lisp's syntax, so SHCL could use READ like it does today. Instead of evaluating the form it would hand emacsclient a string containing the input that READ consumed.