emacs-diffs
[Top][All Lists]
Advanced

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

emacs-29 d7010d64b21: Add declaration_list to c-ts-common-indent-type-re


From: Theodor Thornhill
Subject: emacs-29 d7010d64b21: Add declaration_list to c-ts-common-indent-type-regexp-alist
Date: Mon, 20 Feb 2023 09:08:46 -0500 (EST)

branch: emacs-29
commit d7010d64b216b3adf7dd5adcc9bb62c7208b8d43
Author: Daniel Martín <mardani29@yahoo.es>
Commit: Theodor Thornhill <theo@thornhill.no>

    Add declaration_list to c-ts-common-indent-type-regexp-alist
    
    * lisp/progmodes/c-ts-mode.el (c-ts-base-mode): Consider a
    "declaration_list" a block. (Bug#61635)
    * test/lisp/progmodes/c-ts-mode-resources/indent.erts (Code): Add a
    test case.
---
 lisp/progmodes/c-ts-mode.el                         |  3 ++-
 test/lisp/progmodes/c-ts-mode-resources/indent.erts | 16 ++++++++++++++++
 2 files changed, 18 insertions(+), 1 deletion(-)

diff --git a/lisp/progmodes/c-ts-mode.el b/lisp/progmodes/c-ts-mode.el
index 76c80d9a068..6d70dc3198e 100644
--- a/lisp/progmodes/c-ts-mode.el
+++ b/lisp/progmodes/c-ts-mode.el
@@ -814,7 +814,8 @@ the semicolon.  This function skips the semicolon."
               `((block . ,(rx (or "compound_statement"
                                   "field_declaration_list"
                                   "enumerator_list"
-                                  "initializer_list")))
+                                  "initializer_list"
+                                  "declaration_list")))
                 (if . "if_statement")
                 (else . ("if_statement" . "alternative"))
                 (do . "do_statement")
diff --git a/test/lisp/progmodes/c-ts-mode-resources/indent.erts 
b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
index 09c8ebcec44..36d7af4faf1 100644
--- a/test/lisp/progmodes/c-ts-mode-resources/indent.erts
+++ b/test/lisp/progmodes/c-ts-mode-resources/indent.erts
@@ -369,3 +369,19 @@ int main()
   };
 }
 =-=-=
+
+Code:
+  (lambda ()
+    (c++-ts-mode)
+    (setq-local indent-tabs-mode nil)
+    (setq-local c-ts-mode-indent-offset 2)
+    (indent-region (point-min) (point-max)))
+
+Name: Declaration List (Namespace) (Bug#61635)
+
+=-=
+namespace test {
+  class Name {
+  };
+}
+=-=-=



reply via email to

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