Skip to content

Commit 53458df

Browse files
committed
Merge pull request #470 from cemerick/master
add option to control whether loading a buffer prompts you to save the corresponding file
2 parents 2f99279 + 1948664 commit 53458df

File tree

3 files changed

+16
-2
lines changed

3 files changed

+16
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@
44

55
### New features
66

7-
* [#460](https://github.com/clojure-emacs/cider/issues/316) Support for cider-nrepl's complete middleware for CLJ/CLJS autocomplete.
7+
* [#460](https://github.com/clojure-emacs/cider/issues/316) Support for
8+
cider-nrepl's complete middleware for CLJ/CLJS autocomplete.
9+
* [#469](https://github.com/clojure-emacs/cider/issues/469) Add option
10+
`cider-prompt-save-file-on-load`.
811
* New interactive command `cider-insert-defun-in-repl`.
912
* New interactive command `cider-insert-ns-form-in-repl`.
1013

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,13 @@ Buffer name will look like *cider-repl project-name:port*.
211211
(setq cider-repl-print-length 100) ; the default is nil, no limit
212212
```
213213

214+
* Prevent <kbd>C-c C-k</kbd> from prompting to save the file corresponding to
215+
the buffer being loaded, if it's modified:
216+
217+
```el
218+
(setq cider-prompt-save-file-on-load nil)
219+
```
220+
214221
* Change the result prefix for REPL evaluation (by default there's no prefix):
215222

216223
```el

cider-interaction.el

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ which will use the default REPL connection."
8787
:type 'symbol
8888
:group 'cider)
8989

90+
(defcustom cider-prompt-save-file-on-load t
91+
"Controls whether to prompt to save the file when loading a buffer.")
92+
9093
(defface cider-error-highlight-face
9194
'((((supports :underline (:style wave)))
9295
(:underline (:style wave :color "red") :inherit unspecified))
@@ -1242,7 +1245,8 @@ under point, prompts for a var."
12421245
(check-parens)
12431246
(unless buffer-file-name
12441247
(error "Buffer %s is not associated with a file" (buffer-name)))
1245-
(when (and (buffer-modified-p)
1248+
(when (and cider-prompt-save-file-on-load
1249+
(buffer-modified-p)
12461250
(y-or-n-p (format "Save file %s? " (buffer-file-name))))
12471251
(save-buffer))
12481252
(cider-load-file (buffer-file-name)))

0 commit comments

Comments
 (0)