[clang] [emacs][clang-format] Add elisp API for clang-format on git diffs (PR #112792)

Campbell Barton via cfe-commits cfe-commits at lists.llvm.org
Sat Nov 2 20:56:32 PDT 2024


================
@@ -205,14 +288,60 @@ uses the function `buffer-file-name'."
       (delete-file temp-file)
       (when (buffer-name temp-buffer) (kill-buffer temp-buffer)))))
 
+;;;###autoload
+(defun clang-format-git-diffs (&optional style assume-file-name)
----------------
ideasman42 wrote:

A more general point, would it make sense to call this `clang-format-vc-diffs` - which currently only supports git?

This way we wouldn't need `clang-format-hg-diffs` or separate commands to support other version control systems in the future.

https://github.com/llvm/llvm-project/pull/112792


More information about the cfe-commits mailing list