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

Save all project files when cider-refresh is invoked #1990

Closed
rymndhng opened this issue May 15, 2017 · 5 comments
Closed

Save all project files when cider-refresh is invoked #1990

rymndhng opened this issue May 15, 2017 · 5 comments

Comments

@rymndhng
Copy link
Contributor

When developing on CIDER, I often invoke cider-refresh. cider-refresh reads the files from the filesystem and sometimes in Emacs, you may not have saved all the files you've touched. As a result, you may see a confusing compilation error message.

Is it possible to add the ability to autosave open buffers when cider-refresh is invoked?

@dpsutton
Copy link
Contributor

emacs is super extensible in itself. This could easily be accomplished with

(defun my-save-function ()
  (interactive)
  (save-some-buffers)
  (cider-refresh))

or something along the lines. Does this feature really need to be baked into emacs?

@rymndhng
Copy link
Contributor Author

@dpsutton I don't disagree with you w.r.t. to being able to do it ourselves.

I I think it's a hidden "gotcha" that can make the experience frustrating for new users (and possibly experienced users), since the error message around this is very cryptic. I'm hoping to start a discussion here to see if other users have this issue. If many folks experience this problem, then I think it would be valuable to add into cider (rather than advocate everyone to have their own workaround).

@dpsutton
Copy link
Contributor

I didn't mean to be trite, sorry about that. But reaching into emacs and saving buffers really should be a user operation. The problem is that we certainly cannot just save all buffers as this violates the principle of least surprise. Then we would have to filter down to just clj/c/s and edn buffers, but we also need to discriminate down to just the current project, so that we don't go saving modified buffers in other projects.

@rymndhng
Copy link
Contributor Author

I don't fully agree with this suggestion not following the principle of least surprise (for the end user). This feature is inspired from magit. When you invoke magit-status, it prompts you to to save files to prevent users from being surprised by missing changes in the UI.

I do agree that there could be complexity with how we find said files to save. I don't know enough of the internals of cider.

@bbatsov
Copy link
Member

bbatsov commented May 20, 2017

The suggestion makes sense to me. At the very least this should similarly to what we do for file compilation.

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

No branches or pull requests

3 participants