Skip to content

Conversation

@vspinu
Copy link
Contributor

@vspinu vspinu commented Sep 18, 2014

Useful in scratch buffers with no ns.

@bbatsov
Copy link
Member

bbatsov commented Sep 18, 2014

I can see the usefulness of this, but I'm worried that it won't be very obvious to the users how we're determining the ns to use. Perhaps we should have commands about setting the scratch buffer ns and displaying it (or something similar).

@vspinu
Copy link
Contributor Author

vspinu commented Sep 18, 2014

How about a message "Using XXX namespace"?

@vspinu
Copy link
Contributor Author

vspinu commented Sep 18, 2014

Perhaps we should have commands about setting the scratch buffer ns and displaying it (or something similar).

How about C-c M-n to behave in scratch buffers like in the repl and interactively ask for the namespace.

@bbatsov
Copy link
Member

bbatsov commented Sep 18, 2014

Might be a bit annoying to get this message for each evaluation.

@bbatsov
Copy link
Member

bbatsov commented Sep 18, 2014

Yes, that's a good idea.

@bbatsov
Copy link
Member

bbatsov commented Sep 18, 2014

We should also display the current namespace in the mode line.

@vspinu vspinu force-pushed the scratch-ns branch 2 times, most recently from ea9e614 to 938675a Compare September 20, 2014 01:41
@vspinu
Copy link
Contributor Author

vspinu commented Sep 20, 2014

I have added the stripping of :reload/:reload-all and made cider-repl-set-ns ask interactively for the ns in buffers with no ns form.

To wrap up, the semantics of the interactive evaluation is that all evaluation pins on current ns form. If no such form found, use REPL's current ns instead. I think all other tools should better have the same semantics. nrepl-buffer-ns should eventually go away.

@bbatsov
Copy link
Member

bbatsov commented Sep 20, 2014

To wrap up, the semantics of the interactive evaluation is that all evaluation pins on current ns form. If no such form found, use REPL's current ns instead. I think all other tools should better have the same semantics. nrepl-buffer-ns should eventually go away.

Yes, nrepl-buffer-ns should go away. It's legacy from the oldest days of the project.

- Use "(ns $repl-ns)" in dummy file when ns form not found
- Use (buffer-name) as file name in buffers not visiting a file
- Take into account buffer names in cider-find-file (useful for buffers not
  visiting a file)
@vspinu
Copy link
Contributor Author

vspinu commented Sep 20, 2014

I am finished with this one. All changes in the first commit are aimed towards improving interactive eval functionality in various non-standard contexts (*cider-scratch* buffer, not yet saved clojure buffers, cider-read-eval). See the commit message for more.

bbatsov added a commit that referenced this pull request Sep 20, 2014
Use "(ns $repl-ns)" in dummy file when ns form not found
@bbatsov bbatsov merged commit f587820 into clojure-emacs:master Sep 20, 2014
@bbatsov
Copy link
Member

bbatsov commented Sep 20, 2014

👍

@vspinu vspinu deleted the scratch-ns branch September 20, 2014 22:11
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

Successfully merging this pull request may close these issues.

2 participants