summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang-tools-extra/include-fixer/tool/clang-include-fixer.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang-tools-extra/include-fixer/tool/clang-include-fixer.el b/clang-tools-extra/include-fixer/tool/clang-include-fixer.el
index f704b30311c..4cd0dd1a6ef 100644
--- a/clang-tools-extra/include-fixer/tool/clang-include-fixer.el
+++ b/clang-tools-extra/include-fixer/tool/clang-include-fixer.el
@@ -88,6 +88,8 @@ The current file name is passed after ARGS as last argument. If
the call was successful the returned result is stored in a
temporary buffer, and CALLBACK is called with the temporary
buffer as only argument."
+ (unless buffer-file-name
+ (user-error "clang-include-fixer works only in buffers that visit a file"))
(let ((process (if (fboundp 'make-process)
;; Prefer using ‘make-process’ if available, because
;; ‘start-process’ doesn’t allow us to separate the
OpenPOWER on IntegriCloud