From 28e025dbefd43d5faaf1bffac33b0bc0a1bc7df6 Mon Sep 17 00:00:00 2001 From: Chas Emerick Date: Wed, 5 Feb 2014 08:03:12 -0500 Subject: [PATCH] add option to control whether loading a buffer prompts you to save the corresponding file fixes gh-469 --- cider-interaction.el | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cider-interaction.el b/cider-interaction.el index ea08e1bac..8999eda98 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -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)) @@ -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)))