]> git.eshelyaron.com Git - emacs.git/commitdiff
; .clang-format: Support macros in comp.c, align operands correctly.
authorVibhav Pant <vibhavp@gmail.com>
Tue, 15 Nov 2022 14:36:56 +0000 (20:06 +0530)
committerVibhav Pant <vibhavp@gmail.com>
Tue, 15 Nov 2022 14:48:44 +0000 (20:18 +0530)
* .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

index 464375bd418b1a1f0c2bc6a52e298a7cce121be6..2208240a66917003baeda1022c44112af8512d54 100644 (file)
@@ -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