Fork me on GitHub

(defun my-eval-outer-helper (handler)
	 (let ((beg-loc (point))
	       (mid-loc (point))
	       (end-loc (point))
	       (ss "")) 
	     (search-backward-regexp "(do \"[*]") (setq beg-loc (point))
	     (setq ss (cider-sexp-at-point))
	       (clojure-mode) (lispy-mode) (lispyville-mode) (insert ss)
	       (lispyville-delete (- mid-loc beg-loc) (point-max))
	       (setq ss (buffer-substring (point-min) (point-max)))
	       (message "sub exp: >>>\n%s\n<<<" ss))) 
	   (cider-interactive-eval ss handler )))

       (defun my-cider-eval-outer ()
	 (my-eval-outer-helper (cider-eval-print-handler) ))

This almost works, except that cider-eval-print-handler INSERTS RESULT INTO BUFFER, MODIFYING IT. How do I get the default behaviour of "displays it in an overlay that vanishes on keypress" ?


@bozhidar: ^ insights ? 🙂


figured it out, bounds needs to be no nikl


@bozhidar i’m working on and pretty close to complete, but i’m now facing some issues on cider. I getting this error:

cider-profile-display-stats: Wrong number of arguments: ((cider-special-mode-truncate-lines cider-buffer-ns cl-struct-nrepl-response-queue-tags t) (request connection &optional abort-on-input tooling) "Send REQUEST to the nREPL server synchronously using CONNECTION.
Hold till final \"done\" message has arrived and join all response messages
of the same \"op\" that came along.
If ABORT-ON-INPUT is non-nil, the function will return nil at the first
sign of user input, so as not to hang the interface.
If TOOLING, use the tooling session rather than the standard session." (let* ((time0 (current-time)) (response (cons (quote dict) nil)) (nrepl-ongoing-sync-request t) status) (nrepl-send-request request (function (lambda (resp) (nrepl--merge response resp))) connection tooling) (while (and (not (member "done" status)) (not (and abort-on-input (input-pending-p)))) (setq status (nrepl-dict-get response "status")) (if (member "need-input" status) (progn (cider-need-input (current-buffer)) (setq time0 (current-time))) (if (and nrepl-sync-request-timeout (> (car (cdr (time-subtract ... time0))) nrepl-sync-request-timeout)) (progn (error "Sync nREPL request timed out %s" request)))) (nrepl-dict-put response "status" (remove "need-input" status)) (accept-process-output nil 0.01)) (if (member "done" status) (progn (let ((ex (nrepl-dict-get response "ex")) (err (nrepl-dict-get response "err")) (eval-error (nrepl-dict-get response "eval-error")) (pp-stacktrace (nrepl-dict-get response "pp-stacktrace")) (id (nrepl-dict-get response "id"))) (if (and ex err) (progn (cond (eval-error (funcall nrepl-err-handler)) (pp-stacktrace (cider--render-stacktrace-causes pp-stacktrace ...))))) (if id (progn (save-current-buffer (set-buffer connection) (nrepl--mark-id-completed id)))) response))))), 1


Seems the signature of some function got changed, but I it’s hard for me to tell which one when the stacktrace is formatted this way.


Can you send me a link to the source?


Or some better formatted backtrace?


how can i get a better stacktrace? i am just pasting what i got on the messages buffer (sorry, really a newbie on emacs/elips dev)


@jmayaalv I meant better formatted. I simply can’t tell apart the stack frames in this.


I also can’t figure out where exactly si the problem happening.


ok, let me clean in it up a bit manually then. 🙂


Btw, also feel free to open PRs even now and we can discuss some things on the diff.


If I had to guess - either the signature of nrepl-send-sync-request or cider-nrepl-send-request is outdated. Just consult the current CIDER code to see what’s the proper signature there.


Great, thanks, i will look into those and open the PR.