emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 7d5cf08de9: ; .clang-format: Support macros in comp.c, align oper


From: Vibhav Pant
Subject: master 7d5cf08de9: ; .clang-format: Support macros in comp.c, align operands correctly.
Date: Tue, 15 Nov 2022 09:49:17 -0500 (EST)

branch: master
commit 7d5cf08de946f5486ba9db16b28d2367307dcbf9
Author: Vibhav Pant <vibhavp@gmail.com>
Commit: Vibhav Pant <vibhavp@gmail.com>

    ; .clang-format: Support macros in comp.c, align operands correctly.
    
    * .clang-format (WhitespaceSensitiveMacros): Add comp.c macros that
    stringify arguments, telling clang-format to not format them.
    (AlignOperands): Set to Align, to make clang-format correctly align
    multi-line expressions involving binary and ternary expressions.
    (ForEachMacros): Add FOR_EACH_ALIST_VALUE.
---
 .clang-format | 16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/.clang-format b/.clang-format
index 464375bd41..2208240a66 100644
--- a/.clang-format
+++ b/.clang-format
@@ -1,15 +1,18 @@
 Language: Cpp
 BasedOnStyle: GNU
 AlignEscapedNewlinesLeft: true
+AlignOperands: Align
 AlwaysBreakAfterReturnType: TopLevelDefinitions
 BreakBeforeBinaryOperators: All
 BreakBeforeBraces: GNU
 ColumnLimit: 70
 ContinuationIndentWidth: 2
-ForEachMacros: [FOR_EACH_TAIL,
-                FOR_EACH_TAIL_SAFE,
-                FOR_EACH_LIVE_BUFFER,
-                ITREE_FOREACH]
+ForEachMacros:
+  - FOR_EACH_TAIL
+  - FOR_EACH_TAIL_SAFE
+  - FOR_EACH_LIVE_BUFFER
+  - ITREE_FOREACH
+  - FOR_EACH_ALIST_VALUE
 IncludeCategories:
   - Regex: '^<config\.h>$'
     Priority: -1
@@ -19,6 +22,11 @@ IncludeCategories:
     Priority: 2
   - Regex: '.*'
     Priority: 3
+WhitespaceSensitiveMacros:
+  - STR
+  - CALL1I
+  - CALL2I
+  - STR_VALUE
 KeepEmptyLinesAtTheStartOfBlocks: false
 MaxEmptyLinesToKeep: 1
 PenaltyBreakBeforeFirstCallParameter: 2000



reply via email to

[Prev in Thread] Current Thread [Next in Thread]