I forgot to include in the snippet, that I would do something like

(def live-repl-client (cljs.repl/channel-repl repl-env))

When you say channel-repl/cider-function, do you mean user/live-repl-client?

I don't quite understand what you mean by (prefix).

What I want is just to be able to evaluate clojurescript code in a buffer 
just like I do with regular clojure code. This way I get the same access to 
large chunks of scratch code that I can only easily access when I have it 
in an emacs buffer.

I don't really know much about piggieback or austin. I'd prefer to stay as 
close to upstream/vanilla clojurescript as possible.

On Tuesday, July 22, 2014 9:36:56 PM UTC-4, frye wrote:
>
> Ooh, this looks interesting. Afraid I don't know enough elisp to be 
> useful. But it looks like you're already prompting the caller for the 
> *channel-repl/cider-function* name. Is there a reason you're not using it 
> (*prefix*) ? 
>
> Also can I ask how / where you plan to use this? Or is it just a generic 
> piece of code that will fit into a processing pipeline. 
>
> Is this something you would integrate with piggieback 
> <https://github.com/cemerick/piggieback> or austin 
> <https://github.com/cemerick/austin>? 
>
>
> Tim Washington 
> Interruptsoftware.com <http://interruptsoftware.com> 
>  
>
> On Mon, Jul 21, 2014 at 1:31 PM, Brent Millare <brent....@gmail.com 
> <javascript:>> wrote:
>
>> As a work in progress, here is the code I came up with, it hard codes the 
>>> function name:
>>>
>>
>> (defun cider-eval-cljs-defun-at-point (&optional prefix)
>>   "Evaluate the current toplevel form, and print result in the minibuffer.
>> With a PREFIX argument, print the result in the current buffer."
>>   (interactive "P")
>>   (let ((form (concat "(user/live-repl-client \""
>>                       (replace-regexp-in-string (regexp-quote "\"")
>> (regexp-quote "\\\"")
>>  (replace-regexp-in-string (regexp-quote "\\")
>>   (regexp-quote "\\\\")
>>   (cider-defun-at-point)))
>>                       "\")")))
>>     (if prefix
>>         (cider-interactive-eval-print form)
>>       (cider-interactive-eval form))))
>>
>> (define-key cider-mode-map (kbd "C-c C-v") 
>> 'cider-eval-cljs-defun-at-point)
>>  
>>  
>> -- 
>> You received this message because you are subscribed to the Google
>> Groups "Clojure" group.
>> To post to this group, send email to clo...@googlegroups.com 
>> <javascript:>
>> Note that posts from new members are moderated - please be patient with 
>> your first post.
>> To unsubscribe from this group, send email to
>> clojure+u...@googlegroups.com <javascript:>
>> For more options, visit this group at
>> http://groups.google.com/group/clojure?hl=en
>> --- 
>> You received this message because you are subscribed to the Google Groups 
>> "Clojure" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to clojure+u...@googlegroups.com <javascript:>.
>> For more options, visit https://groups.google.com/d/optout.
>>
>
>

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to