[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] master 99a93da: Correctly indent C++ brace lists in member
From: |
Alan Mackenzie |
Subject: |
[Emacs-diffs] master 99a93da: Correctly indent C++ brace lists in member init lists. |
Date: |
Thu, 26 Jul 2018 16:00:56 -0400 (EDT) |
branch: master
commit 99a93dae241b3f779bdf9484a54f1096785c6f84
Author: Alan Mackenzie <address@hidden>
Commit: Alan Mackenzie <address@hidden>
Correctly indent C++ brace lists in member init lists.
* lisp/progmodes/cc-engine.el (c-guess-basic-syntax; CASE 9B, CASE 9C): Set
a
limit for a backward search to the ":" introducing the member init list,
when
there is one, rather than the enclosing "{" or nil.
---
lisp/progmodes/cc-engine.el | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/lisp/progmodes/cc-engine.el b/lisp/progmodes/cc-engine.el
index 3961ea6..d1eb3c3 100644
--- a/lisp/progmodes/cc-engine.el
+++ b/lisp/progmodes/cc-engine.el
@@ -12607,7 +12607,11 @@ comment at the start of cc-engine.el for more info."
(= (point) containing-sexp)))
(if (eq (point) (c-point 'boi))
(c-add-syntax 'brace-list-close (point))
- (setq lim (c-most-enclosing-brace state-cache (point)))
+ (setq lim (or (save-excursion
+ (and
+ (c-back-over-member-initializers)
+ (point)))
+ (c-most-enclosing-brace state-cache (point))))
(c-beginning-of-statement-1 lim nil nil t)
(c-add-stmt-syntax 'brace-list-close nil t lim paren-state)))
@@ -12636,7 +12640,11 @@ comment at the start of cc-engine.el for more info."
(goto-char containing-sexp))
(if (eq (point) (c-point 'boi))
(c-add-syntax 'brace-list-intro (point))
- (setq lim (c-most-enclosing-brace state-cache (point)))
+ (setq lim (or (save-excursion
+ (and
+ (c-back-over-member-initializers)
+ (point)))
+ (c-most-enclosing-brace state-cache (point))))
(c-beginning-of-statement-1 lim)
(c-add-stmt-syntax 'brace-list-intro nil t lim paren-state)))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] master 99a93da: Correctly indent C++ brace lists in member init lists.,
Alan Mackenzie <=