One of the ideas or nrepl is that functionality can be provided by
middleware libraries. On the clojure side, this just necessitates adding
the middleware to the nrepl server's handler function. On the nrepl.el
side of things however, any new functionality can not be activated
without some form of elisp code.
I'm wondering if you have already given some thought to providing a
standard way of plugging elisp functionality into nrepl.el. Maybe
something related to swank-cloure's jack-in injection of elisp?
On Tue, Aug 28, 2012 at 9:43 AM, Hugo Duncan <h...@hugoduncan.org> wrote:
> I'm wondering if you have already given some thought to providing a
> standard way of plugging elisp functionality into nrepl.el. Maybe
> something related to swank-cloure's jack-in injection of elisp?
> Hi Hugo,
I hadn't given it much thought yet, since I have been focused on getting
the core functionality working.
You are talking about the bootstrapping elisp that are sent from
swank-clojure to emacs, right?
Seems like we could take a similar approach.
Another idea off the top of my head is to use the eval-in-emacs approach
that Sam Aaron was talking about in earlier post.
I have started thinking about implementing that but I don't have anything
working yet.
Tim King <king...@gmail.com> writes:
> On Tue, Aug 28, 2012 at 9:43 AM, Hugo Duncan <h...@hugoduncan.org> wrote:
>> I'm wondering if you have already given some thought to providing a
>> standard way of plugging elisp functionality into nrepl.el. Maybe
>> something related to swank-cloure's jack-in injection of elisp?
> You are talking about the bootstrapping elisp that are sent from
> swank-clojure to emacs, right?
> Seems like we could take a similar approach.
jack-in works by having elisp launch the java process and then parse the
output for text marker guards around the elisp to load. This has the
advantage of isolating the point at which code injection can occur.
> Another idea off the top of my head is to use the eval-in-emacs approach
> that Sam Aaron was talking about in earlier post.
> I have started thinking about implementing that but I don't have anything
> working yet.
eval-in-emacs would probably be the simplest solution. There are perhaps
security implications on having that enabled by default though (in slime
it defaults to disabled).
One way might be to have a nrepl op that can request setup info
middleware. e.g. sending a "client-setup" op with "client" "nrepl.el"
key could cause a reply from every middleware with an "elisp" key with
code to eval. This would require pass-through of the op by every
middleware, so might require some support in the base nrepl server to
avoid the command being reported as unsupported.
Hugo Duncan writes:
> One way might be to have a nrepl op that can request setup info
> middleware. e.g. sending a "client-setup" op with "client" "nrepl.el"
> key could cause a reply from every middleware with an "elisp" key with
> code to eval. This would require pass-through of the op by every
> middleware, so might require some support in the base nrepl server to
> avoid the command being reported as unsupported.
Another may be to add a `:elisp` key to the results returned by the
"describe" op. Are you planning on using the "describe" op in the latest
nREPL?
2012 at 9:30 AM, Hugo Duncan <duncan.h...@gmail.com> wrote:
> Another may be to add a `:elisp` key to the results returned by the
> "describe" op. Are you planning on using the "describe" op in the latest
> nREPL?
Yes, I think we should add support for the describe op.
Among other things, I think we will need it to figure out what operations
are available on the server.
I also want to look at using the load-file op.
On Tue, Sep 4, 2012 at 9:43 AM, Tim King <king...@gmail.com> wrote:
> 2012 at 9:30 AM, Hugo Duncan <duncan.h...@gmail.com> wrote:
>> Another may be to add a `:elisp` key to the results returned by the
>> "describe" op. Are you planning on using the "describe" op in the latest
>> nREPL?
> Yes, I think we should add support for the describe op.
> Among other things, I think we will need it to figure out what operations
> are available on the server.
> I also want to look at using the load-file op.
> Cheers,
> Tim
I've got a local copy of master using :op load-file. I had to do it
to get C-c C-k working for clojurescript w/ piggieback. An additional
benefit is that since I started using it I've not seen
https://github.com/kingtim/nrepl.el/issues/86, even with a normal clj
repl.
I had plans to finish cleanup and make it into a pull request, but
won't be able to get to it until saturday.
On Tue, Sep 4, 2012 at 7:48 AM, Nelson Morris <nmor...@nelsonmorris.net>wrote:
> I've got a local copy of master using :op load-file. I had to do it
> to get C-c C-k working for clojurescript w/ piggieback. An additional
> benefit is that since I started using it I've not seen
> https://github.com/kingtim/nrepl.el/issues/86, even with a normal clj
> repl.
> I had plans to finish cleanup and make it into a pull request, but
> won't be able to get to it until saturday.