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

[Fix #2045] *cider-scratch* is no longer an ancillary buffer #2067

Merged
merged 2 commits into from
Aug 29, 2017

Conversation

vspinu
Copy link
Contributor

@vspinu vspinu commented Jul 31, 2017

AFAICS the only function of ancillary buffers right now is to be killed on cider-quit, so this simple change seems to be just what's needed.

@vspinu
Copy link
Contributor Author

vspinu commented Jul 31, 2017

One test failed for unrelated reason.

@bbatsov
Copy link
Member

bbatsov commented Jul 31, 2017

Seems to me after this they won't also be killed on quit-all. It's also unclear what should we do on restart or with buffers without connections in general.

@vspinu
Copy link
Contributor Author

vspinu commented Jul 31, 2017

I think scratch buffer should never be killed. It's up to the user to decide what to do with that buffer. Just like with emacs' *scratch*, or any other buffer that contains user's work of some kind.

or with buffers without connections in general.

Which are those? You mean all those buffers now called "ancillary"?

@bbatsov
Copy link
Member

bbatsov commented Aug 1, 2017

I think scratch buffer should never be killed. It's up to the user to decide what to do with that buffer. Just like with emacs' scratch, or any other buffer that contains user's work of some kind.

But in Emacs this buffer will always be working. On complete CIDER quit we should not leave anything around I think.

Which are those? You mean all those buffers now called "ancillary"?

I meant scratch buffers - IMO if we don't kill them they should be treated similarly to REPL buffers and get "reconnected" (or something like this). In general I don't like it that we don't explicitly link scratch buffers to some project and REPL type and things with them become quickly confusing for some people.

@vspinu
Copy link
Contributor Author

vspinu commented Aug 1, 2017

On complete CIDER quit we should not leave anything around I think.

You can quit all connections and restart them later and be willing to re-use the scratch buffer. For me scratch buffers are just like ordinary files with a mode providing some extra evaluation functionality. It's entirely up to the user what to do with it. I don't see it as part of the CIDER connection ecosystem per se, more like an ordinary clojure buffer.

f we don't kill them they should be treated similarly to REPL buffers and get "reconnected" (or something like this).

They are loosely connected in the sense that they will send code to the most recent connection. I think people using scratch buffers expect precisely this semantics.

In general I don't like it that we don't explicitly link scratch buffers to some project and REPL type and things with them become quickly confusing for some people.

I think this is a more general issue with cider connection management. There must be a more user friendly way to associated buffers, directories and entire projects to connections. I hope to provide a PR on this in the following weeks, so we can discuss this in more concrete terms.

As far as scratch buffer is concerned, if scratches are allowed to be associated with projects, their implementation would inevitably become more complex. At least, one should be able to create multiple scratch-buffers.

@vspinu vspinu closed this Aug 1, 2017
@vspinu vspinu deleted the scratch branch August 1, 2017 10:48
@vspinu vspinu restored the scratch branch August 1, 2017 17:03
@vspinu
Copy link
Contributor Author

vspinu commented Aug 1, 2017

Uff, I accidentally deleted this branch. Restoring.

@vspinu vspinu reopened this Aug 1, 2017
@bbatsov
Copy link
Member

bbatsov commented Aug 1, 2017

They are loosely connected in the sense that they will send code to the most recent connection. I think people using scratch buffers expect precisely this semantics.

Based on some tickets filed by users I'm not quite certain that's true. 😃

I think this is a more general issue with cider connection management. There must be a more user friendly way to associated buffers, directories and entire projects to connections. I hope to provide a PR on this in the following weeks, so we can discuss this in more concrete terms.

Looking forward to it.

As for this PR - let's just kill the buffer on cider-quit-all and I'll accept it. I really don't want to leave CIDER buffers laying around after a complete shutdown.

@vspinu
Copy link
Contributor Author

vspinu commented Aug 5, 2017

As for this PR - let's just kill the buffer on cider-quit-all and I'll accept it.

I am afraid this one has to wait a bit till #2069 is sorted out.

@vspinu
Copy link
Contributor Author

vspinu commented Aug 26, 2017

I have reabased this one for 0.15.1. As per your suggestion, killing the scratch on quit-all but with obligatory user's consent.

@vspinu
Copy link
Contributor Author

vspinu commented Aug 26, 2017

Also documenting here my recent changes to cider-nrepl to avoid changelog conflicts. I asume you will be pulling clojure-emacs/cider-nrepl#435 for 0.15.1.

With this, I have completed my part for 0.15.1.

@bbatsov bbatsov merged commit 7a53a92 into clojure-emacs:master Aug 29, 2017
@bbatsov
Copy link
Member

bbatsov commented Aug 29, 2017

👍

@vspinu vspinu deleted the scratch branch June 20, 2018 10:38
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