changeset 13253:a8126303dc0f

(calculate-c++-indent): Skip over paren-group when looking back to determine context of a top-level line. Don't treat a line starting with } as a continuation.
author Richard M. Stallman <rms@gnu.org>
date Thu, 19 Oct 1995 22:04:18 +0000
parents 0701fab73d81
children 7ed0775e99af
files lisp/progmodes/cplus-md.el
diffstat 1 files changed, 10 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/cplus-md.el	Thu Oct 19 13:36:56 1995 +0000
+++ b/lisp/progmodes/cplus-md.el	Thu Oct 19 22:04:18 1995 +0000
@@ -563,6 +563,8 @@
 		     (backward-char 1))
 		 (if (= (preceding-char) ?})
 		     0
+		   (if (= (preceding-char) ?\))
+		       (forward-list -1))
 		   (beginning-of-line)	; continued arg decls or member inits
 		   (skip-chars-forward " \t")
 		   (if (= (following-char) ?:)
@@ -608,7 +610,14 @@
 	     ;; Statement.  Find previous non-comment character.
 	     (goto-char indent-point)
 	     (c++-backward-to-noncomment containing-sexp)
-	     (if (not (memq (preceding-char) '(nil ?\, ?\; ?} ?: ?\{)))
+	     (if (and (not (memq (preceding-char) '(0 ?\, ?\; ?\} ?\{)))
+		      ;; But don't treat a line with a close-brace
+		      ;; as a continuation.  It is probably the
+		      ;; end of an enum type declaration.
+		      (save-excursion
+			(goto-char indent-point)
+			(skip-chars-forward " \t")
+			(not (= (following-char) ?}))))
 		 ;; This line is continuation of preceding line's statement;
 		 ;; indent  c-continued-statement-offset  more than the
 		 ;; previous line of the statement.