Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lispy-eval reports "No buffer named ... " #115

Closed
looselytyped opened this issue Sep 2, 2015 · 7 comments
Closed

lispy-eval reports "No buffer named ... " #115

looselytyped opened this issue Sep 2, 2015 · 7 comments

Comments

@looselytyped
Copy link

I recently upgraded a few packages, and then e in lispy stopped worked. e in lispy-mode with CIDER reports nrepl-send-request: No buffer named com.mycompany.job

I set toggle-debug-on-error and came across this stacktrace

Debugger entered--Lisp error: (error "No buffer named com.mycompany.job")
  nrepl-next-request-id("com.mycompany.job")
  nrepl-send-request(("op" "eval" "session" "35012f9a-491b-43a1-91bb-d183920b74fb" "code" "(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})") #[257 "\301\300�\"\207" [(dict) nrepl--merge] 4 "\n\n(fn RESP)"] "com.mycompany.job")
  nrepl-send-sync-request(("op" "eval" "session" "35012f9a-491b-43a1-91bb-d183920b74fb" "code" "(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})") "com.mycompany.job")
  nrepl-sync-request:eval("(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})" "com.mycompany.job" "35012f9a-491b-43a1-91bb-d183920b74fb")
  lispy--eval-clojure("(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})" t t)
  (closure ((add-output . t) (e-str . "(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})") cl--bind-enquote cl--bind-block cl--bind-defs cl--bind-forms cl--bind-lets aw-dispatch-always cider-eval-result-duration t) (x) (lispy--eval-clojure x add-output t))("(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})")
  funcall((closure ((add-output . t) (e-str . "(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})") cl--bind-enquote cl--bind-block cl--bind-defs cl--bind-forms cl--bind-lets aw-dispatch-always cider-eval-result-duration t) (x) (lispy--eval-clojure x add-output t)) "(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})")
  lispy--eval("(def oneops\n    {:url \"http://172.16.116.197:8080\"\n     ;;  :url \"http://localhost:8080\"\n     :auth \":\"\n     :debug true})" t)
  (replace-regexp-in-string "%" "%%" (lispy--eval (lispy--string-dwim) t))
  (let ((result (replace-regexp-in-string "%" "%%" (lispy--eval (lispy--string-dwim) t)))) (if (eq lispy-eval-display-style (quote message)) (message result) (if (fboundp (quote cider--display-interactive-eval-result)) (cider--display-interactive-eval-result result (point)) (error "Please install CIDER 0.10 to display overlay"))))
  (save-excursion (if (or (lispy-right-p) (region-active-p)) nil (lispy-forward 1)) (let ((result (replace-regexp-in-string "%" "%%" (lispy--eval (lispy--string-dwim) t)))) (if (eq lispy-eval-display-style (quote message)) (message result) (if (fboundp (quote cider--display-interactive-eval-result)) (cider--display-interactive-eval-result result (point)) (error "Please install CIDER 0.10 to display overlay")))))
  (if (eq arg 2) (lispy-eval-and-comment) (save-excursion (if (or (lispy-right-p) (region-active-p)) nil (lispy-forward 1)) (let ((result (replace-regexp-in-string "%" "%%" (lispy--eval (lispy--string-dwim) t)))) (if (eq lispy-eval-display-style (quote message)) (message result) (if (fboundp (quote cider--display-interactive-eval-result)) (cider--display-interactive-eval-result result (point)) (error "Please install CIDER 0.10 to display overlay"))))))
  lispy-eval(1)
  #<subr call-interactively>(lispy-eval nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> lispy-eval)
  apply(ad-Advice-call-interactively #<subr call-interactively> lispy-eval)
  call-interactively(lispy-eval)
  (cond ((lispy--edebug-commandp) (call-interactively lispy--edebug-command)) ((region-active-p) (call-interactively (quote lispy-eval))) ((lispy--in-string-or-comment-p) (call-interactively (quote self-insert-command))) ((or (lispy-left-p) (lispy-right-p) (and (lispy-bolp) (looking-at ";"))) (call-interactively (quote lispy-eval))) (t (setq this-command (quote self-insert-command)) (call-interactively (quote self-insert-command))))
  special-lispy-eval()
  #<subr call-interactively>(special-lispy-eval nil nil)
  ad-Advice-call-interactively(#<subr call-interactively> special-lispy-eval nil nil)
  apply(ad-Advice-call-interactively #<subr call-interactively> (special-lispy-eval nil nil))
  call-interactively(special-lispy-eval nil nil)
  command-execute(special-lispy-eval)

Currently running GNU Emacs 24.5.1 with

cider 20150901.1605
lispy 20150901.550

Please let me know if there is anything else I can provide.

@looselytyped
Copy link
Author

Two more points of note

  • It seems that for some reason the name of the buffer is being returns as the full ns and not just the buffer name
  • I am seeing the same behaviour with lispy-follow (F) - http://oremacs.com/lispy/#lispy-follow

@abo-abo
Copy link
Owner

abo-abo commented Sep 2, 2015

This is a breakage in CIDER and it should be fixed there, I think. Even the most basic eval request fails now:

(nrepl-sync-request:eval
 "(+ 2 2)"
 (cider-current-ns)
 (nrepl-current-session))

@looselytyped
Copy link
Author

@abo-abo - Thanks! I will post an issue there. Really appreciate the quick response.

However, I do believe that it has to do with the buffer name. My buffer name is job.clj - but (cider-current-ns) returns the namespace - not the name of the buffer. That's why I posted an issue here.

@bbatsov
Copy link

bbatsov commented Sep 2, 2015

It's a breaking API change and it will stay as it currently is CIDER. We're decoupling nrepl-client from CIDER, which required this and many other similar changes. It's unfortunate, but unavoidable.

@bcarrell
Copy link
Contributor

bcarrell commented Sep 2, 2015

Looks like the signature just needs an update. @abo-abo should be able to fix it really quickly. If he's busy, I can send the PR.

@abo-abo abo-abo closed this as completed in 43957f8 Sep 2, 2015
@abo-abo
Copy link
Owner

abo-abo commented Sep 2, 2015

Thanks, please test if it works correctly now.

Unfortunately, we're now incompatible with any version of CIDER that's different from the one that's in MELPA now.

@looselytyped
Copy link
Author

@abo-abo I just tried it. Both e and F work in lispy.el! Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants