]> granicus.if.org Git - clang/commitdiff
clang-format: Make emacs integration work with narrowed buffers.
authorDaniel Jasper <djasper@google.com>
Mon, 12 Sep 2016 10:02:46 +0000 (10:02 +0000)
committerDaniel Jasper <djasper@google.com>
Mon, 12 Sep 2016 10:02:46 +0000 (10:02 +0000)
Use (call-process region nil ...) instead of (point-min) so that the
call works in narrowed buffers.

Patch by Philipp Stephani, thank you!

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@281203 91177308-0d34-0410-b5e6-96231b3b80d8

tools/clang-format/clang-format.el

index ca461444e22684186ed64aa16d10b226fce881a6..4d6007925fb5989a474c08e6d41b62ff23533e1c 100644 (file)
@@ -122,7 +122,7 @@ is no active region.  If no style is given uses `clang-format-style'."
         (let (status stderr operations)
           (setq status
                 (call-process-region
-                 (point-min) (point-max) clang-format-executable
+                 nil nil clang-format-executable
                  nil `(,temp-buffer ,temp-file) nil
 
                  "-output-replacements-xml"