aboutsummaryrefslogtreecommitdiffstats
path: root/doc/misc
diff options
context:
space:
mode:
authorAlan Mackenzie2023-11-24 10:03:33 +0000
committerAlan Mackenzie2023-11-24 10:03:33 +0000
commit36d9b8ce84afc8aaae3ce067fd24e172c0f631cf (patch)
treef2226bc646a8cdbc1a7b04033c29a675842bfcd6 /doc/misc
parent0858d10aebed44f7d66548d061af03b3cb136d04 (diff)
downloademacs-36d9b8ce84afc8aaae3ce067fd24e172c0f631cf.tar.gz
emacs-36d9b8ce84afc8aaae3ce067fd24e172c0f631cf.zip
CC Mode: Add second anchor point to class-open and class-close
This fixes the second (last) part of bug#66911. The new second anchor points allow the indentation of braces in template classes to be anchored on the keyword 'class' rather than the `template' at the beginning of the statement. * lisp/progmodes/cc-engine.el (c-add-class-syntax): Add &rest args parameter for additional anchor points. Pass these to c-add-syntax. (c-guess-continued-construct): CASE B.1: Note return value from c-looking-at-decl-block and pass this to c-add-syntax for a class-open construct. (c-guess-basic-syntax): CASE 4: Duplicate anchor position for class-open. (c-guess-basic-syntax): CASE 5A.2: Note return value of c-looking-at-decl-block and pass it as extra argument to c-add-syntax for a class-open construct. (c-guess-basic-syntax): CASE 5G: Call c-looking-at-decl-block to determine the second anchor point for a class-close, and pass it to c-add-class-syntax. * doc/misc/cc-mode.texi (Class Symbols): Document the anchor points for class-open and class-close.
Diffstat (limited to 'doc/misc')
-rw-r--r--doc/misc/cc-mode.texi7
1 files changed, 7 insertions, 0 deletions
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index 4ab95798468..8bc19235516 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -4507,6 +4507,13 @@ languages are syntactically equivalent to classes. Note however that
4507the keyword @code{class} is meaningless in C and Objective-C.}. 4507the keyword @code{class} is meaningless in C and Objective-C.}.
4508Similarly, line 18 is assigned @code{class-close} syntax. 4508Similarly, line 18 is assigned @code{class-close} syntax.
4509 4509
4510Note that @code{class-open} and @code{class-close} syntactic elements
4511have two anchor points. The first is the position of the beginning of
4512the statement, the second is the position of the keyword which defines
4513the construct (e.g. @code{class}). These are usually the same
4514position, but differ when the statement starts off with
4515@code{template} (C++ Mode) or @code{generic} (Java Mode) or similar.
4516
4510@ssindex inher-intro 4517@ssindex inher-intro
4511@ssindex inher-cont 4518@ssindex inher-cont
4512Line 2 introduces the inheritance list for the class so it is assigned 4519Line 2 introduces the inheritance list for the class so it is assigned