diff options
author | Michael Griffiths <mikey@cich.li> | 2015-03-20 20:21:59 +0000 |
---|---|---|
committer | Michael Griffiths <mikey@cich.li> | 2015-03-21 00:51:45 +0000 |
commit | 39926048686baa4ed75cd216662acc1b071acc3b (patch) | |
tree | 84953e3d776278d07e066c93161e9efeee5449a5 | |
parent | 4a28fbbf808a4e32c707a66d10a8aea8a57bba03 (diff) |
Allow buffers with no file to be formatted
-rw-r--r-- | cider-interaction.el | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/cider-interaction.el b/cider-interaction.el index d6f64e08..b9f7099a 100644 --- a/cider-interaction.el +++ b/cider-interaction.el @@ -1879,9 +1879,7 @@ If no buffer is provided the command acts on the current buffer." Uses FORMATTER, a function of one argument, to convert the string contents of the buffer into a formatted string." - (unless buffer-file-name - (error "Buffer %s is not associated with a file" (buffer-name))) - (let* ((original (cider-file-string buffer-file-name)) + (let* ((original (substring-no-properties (buffer-string))) (formatted (funcall formatter original))) (unless (equal original formatted) (erase-buffer) |