diff options
| author | Radon Rosborough <radon.neon@gmail.com> | 2022-01-04 20:57:39 -0800 |
|---|---|---|
| committer | Radon Rosborough <radon.neon@gmail.com> | 2022-01-04 20:57:39 -0800 |
| commit | c073299a5618b05fb09e925c12ac622135f09a44 (patch) | |
| tree | d46d1d4457ec92eb794095f2bea761bb410a17c4 | |
| parent | 4da2898ffd41b96de27595e44620b32add3f000e (diff) | |
[#52] Fix handling of non-file buffers
| -rw-r--r-- | apheleia.el | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/apheleia.el b/apheleia.el index a0d9e31..c6168fe 100644 --- a/apheleia.el +++ b/apheleia.el @@ -598,7 +598,14 @@ sequence unless it's first in the sequence")) (setq stdin nil)) (if (memq arg '(file filepath)) (prog1 file-name - (when (buffer-modified-p) + ;; If `buffer-file-name' is + ;; nil then there is no + ;; backing file, so + ;; `buffer-modified-p' should + ;; be ignored (it always + ;; returns non-nil). + (when (and (buffer-modified-p) + buffer-file-name) (cl-return))) arg)) command)))) |
