Skip to content

Commit

Permalink
Rename cider-prompt-save-file-on-load to cider-save-file-on-load
Browse files Browse the repository at this point in the history
This also adjusts its supported values accordingly - the default now is
`'prompt` and `'always-save` is now simply `t`.
  • Loading branch information
bbatsov committed May 25, 2017
1 parent cbad6b2 commit f42b262
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
* Drop support for Emacs 24.3.
* Don't try to use ssh automatically when connecting to remote hosts and a direct connection fails. See `nrepl-use-ssh-fallback-for-remote-hosts`.
* [#1945](https://github.com/clojure-emacs/cider/pull/1945): Start nREPL servers bound to `::` by default using `cider-jack-in`.
* Renamed `cider-prompt-save-file-on-load` to `cider-save-file-on-load` and adjust its supported values accordingly (the default now is `'prompt` and `'always-save` is now simply `t`).

### Bugs Fixed

Expand Down
16 changes: 9 additions & 7 deletions cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -100,17 +100,19 @@ ns forms manually themselves."
:group 'cider
:package-version '(cider . "0.15.0"))

(defcustom cider-prompt-save-file-on-load t
(defcustom cider-save-file-on-load 'prompt
"Controls whether to prompt to save the file when loading a buffer.
If nil, files are not saved.
If t, the user is prompted to save the file if it's been modified.
If the symbol `always-save', save the file without confirmation."
:type '(choice (const t :tag "Prompt to save the file if it's been modified")
If 'prompt, the user is prompted to save the file if it's been modified.
If t, save the file without confirmation."
:type '(choice (const prompt :tag "Prompt to save the file if it's been modified")
(const nil :tag "Don't save the file")
(const always-save :tag "Save the file without confirmation"))
(const t :tag "Save the file without confirmation"))
:group 'cider
:package-version '(cider . "0.6.0"))

(define-obsolete-variable-alias 'cider-prompt-save-file-on-load 'cider-save-file-on-load "0.15.0")

(defcustom cider-prompt-save-files-on-cider-refresh t
"Controls whether to prompt to save Clojure files on `cider-refresh'.
If nil, files are not saved.
Expand Down Expand Up @@ -1611,9 +1613,9 @@ ClojureScript REPL exists for the project, it is evaluated in both REPLs."
(with-current-buffer buffer
(unless buffer-file-name
(user-error "Buffer `%s' is not associated with a file" (current-buffer)))
(when (and cider-prompt-save-file-on-load
(when (and cider-save-file-on-load
(buffer-modified-p)
(or (eq cider-prompt-save-file-on-load 'always-save)
(or (eq cider-save-file-on-load t)
(y-or-n-p (format "Save file %s? " buffer-file-name))))
(save-buffer))
(remove-overlays nil nil 'cider-temporary t)
Expand Down
4 changes: 2 additions & 2 deletions doc/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ make the hidden buffers visible. They'll always be visible in

```el
;; Don't prompt and don't save
(setq cider-prompt-save-file-on-load nil)
(setq cider-save-file-on-load nil)
;; Just save without prompting
(setq cider-prompt-save-file-on-load 'always-save)
(setq cider-save-file-on-load t)
```

* Change the result prefix for interactive evaluation (by default it's `=> `):
Expand Down

0 comments on commit f42b262

Please sign in to comment.