[PATCH] D120408: clang-format.el: Make clang-format work in indirect buffers.

Sam McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 23 08:00:35 PST 2022


This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2f906683ed14: clang-format.el: Make clang-format work in indirect buffers. (authored by phst, committed by sammccall).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D120408/new/

https://reviews.llvm.org/D120408

Files:
  clang/tools/clang-format/clang-format.el


Index: clang/tools/clang-format/clang-format.el
===================================================================
--- clang/tools/clang-format/clang-format.el
+++ clang/tools/clang-format/clang-format.el
@@ -147,7 +147,7 @@
     (setq style clang-format-style))
 
   (unless assume-file-name
-    (setq assume-file-name buffer-file-name))
+    (setq assume-file-name (buffer-file-name (buffer-base-buffer))))
 
   (let ((file-start (clang-format--bufferpos-to-filepos start 'approximate
                                                         'utf-8-unix))


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D120408.410832.patch
Type: text/x-patch
Size: 560 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20220223/13eebb0e/attachment-0001.bin>


More information about the cfe-commits mailing list