aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksey Sakovets <60353629+asakovets@users.noreply.github.com>2025-11-23 23:17:39 +0300
committerGitHub <noreply@github.com>2025-11-23 12:17:39 -0800
commit1fac3a885d13680d60f161ed29cae1b2b3281f5d (patch)
tree77fe5725b744b593e0e165749defb86f4b33fc27
parentb4bdc8fdbd40d10937fd9458231815f6703cd2f6 (diff)
Use clang-format for formatting Objective-C/C++ (#378)
Hi, This adds formatting of Objective-C/C++ files via clang-format. I was unsure about adding support for Objective-C++ (*.mm) since Emacs doesn't have a dedicated mode for such files and regexp association in `apheleia-mode-alist` feels a bit out of place. Please, correct me if this is wrong.
-rw-r--r--CHANGELOG.md4
-rw-r--r--apheleia-formatters.el3
2 files changed, 7 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 7a80007..2df4c32 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -3,6 +3,10 @@
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog].
+## Unreleased
+### Formatters
+* Use clang-format for formatting Objective-C/C++ files ([#378]).
+
## 4.4.2 (released 2025-11-21)
### Bugs fixed
* apheleia-formatters-indent did not handle yaml-ts-mode; added with
diff --git a/apheleia-formatters.el b/apheleia-formatters.el
index e847716..65c0b15 100644
--- a/apheleia-formatters.el
+++ b/apheleia-formatters.el
@@ -379,6 +379,9 @@ rather than using this system."
(nix-mode . nixfmt)
(nix-ts-mode . nixfmt)
(nomad-mode . nomad)
+ (objc-mode . clang-format)
+ ;; Emacs doesn't yet have a mode for Objective-C++
+ ("\\.mm\\'" . clang-format)
(perl-mode . perltidy)
(php-mode . phpcs)
(purescript-mode . purs-tidy)