Skip to content

Commit

Permalink
add option to control whether loading a buffer prompts you to save th…
Browse files Browse the repository at this point in the history
…e corresponding file

fixes clojure-emacsgh-469
  • Loading branch information
cemerick committed Feb 5, 2014
1 parent 2f99279 commit 28e025d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cider-interaction.el
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ which will use the default REPL connection."
:type 'symbol
:group 'cider)

(defcustom cider-prompt-save-file-on-load t
"Controls whether to prompt to save the file when loading a buffer.")

(defface cider-error-highlight-face
'((((supports :underline (:style wave)))
(:underline (:style wave :color "red") :inherit unspecified))
Expand Down Expand Up @@ -1242,7 +1245,8 @@ under point, prompts for a var."
(check-parens)
(unless buffer-file-name
(error "Buffer %s is not associated with a file" (buffer-name)))
(when (and (buffer-modified-p)
(when (and cider-prompt-save-file-on-load
(buffer-modified-p)
(y-or-n-p (format "Save file %s? " (buffer-file-name))))
(save-buffer))
(cider-load-file (buffer-file-name)))
Expand Down

0 comments on commit 28e025d

Please sign in to comment.