From 1fac3a885d13680d60f161ed29cae1b2b3281f5d Mon Sep 17 00:00:00 2001 From: Aleksey Sakovets <60353629+asakovets@users.noreply.github.com> Date: Sun, 23 Nov 2025 23:17:39 +0300 Subject: 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. --- CHANGELOG.md | 4 ++++ apheleia-formatters.el | 3 +++ 2 files changed, 7 insertions(+) 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) -- cgit v1.0