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

cider-eval-last-sexp-and-replace can't handle bare keyword #774

Closed
fordsfords opened this issue Sep 4, 2014 · 3 comments
Closed

cider-eval-last-sexp-and-replace can't handle bare keyword #774

fordsfords opened this issue Sep 4, 2014 · 3 comments

Comments

@fordsfords
Copy link

Start with this line in your clojure buffer:

:foo

Execute cider-eval-last-sexp (C-x C-e). The result properly displays as:

:foo

Now try cider-eval-last-sexp-and-replace (C-c C-w) on it. It pops up the cider-error buffer with:

clojure.lang.Compiler$CompilerException: java.lang.RuntimeException: Unable to resolve symbol: foo in this context, compiling:(NO_SOURCE_PATH:0:0)

Interestingly, if I try it on "[:foo]", it all works fine. It looks like cider is stripping the colon if it is the first character in the sexp (an unlikely use case, to be sure).

@bbatsov
Copy link
Member

bbatsov commented Sep 5, 2014

What version of cider are you using? I can't reproduce this with the current master.

@fordsfords
Copy link
Author

CIDER 0.8.0snapshot (package: 20140903.908)

I did a package-refresh-contents of melpa a few hours after you fixed #772.

(pause)

... um ... hmm ... (blush) ... OK, I wasted some of your time, which I am very sorry about. I've been taking notes in a normal .txt file, in which clojure mode is NOT set. But I've found that I can still jack in and use cider to execute little code fragments from the text buffer. It's been working fine, and I kind of forgot that I'm using cider in an unnatural way. (no comments from the peanut gallery)

I just tried it again editing a .clj file with clojure mode, and lo and behold, it works fine. Edit a .txt file and it fails.

So it's not your code, it's a strange interaction with text mode. Feel free to close this as PEBKAC (see title text). I'll be sure in the future to retry problems under a supported use case.

P.S. - thanks for your Clojure style guide. Good stuff in there. I even learned for the first time about the double-space-between-sentences controversy. Yeah, I'm old as dirt and took a typing class in the 70's; it might take me another 40 years to un-learn that one. :-)

@bbatsov
Copy link
Member

bbatsov commented Sep 5, 2014

I just tried it again editing a .clj file with clojure mode, and lo and behold, it works fine. Edit a .txt file and it fails.

sexp navigation doesn't work properly in text-mode, therefore the problem you've experienced.

P.S. - thanks for your Clojure style guide. Good stuff in there. I even learned for the first time about the double-space-between-sentences controversy. Yeah, I'm old as dirt and took a typing class in the 70's; it might take me another 40 years to un-learn that one. :-)

You're welcome! :-)

@bbatsov bbatsov closed this as completed Sep 5, 2014
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

2 participants