diff options
| author | Alan Mackenzie | 2010-08-01 18:07:10 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2010-08-01 18:07:10 +0000 |
| commit | 5cee0a9c166b43936adebdd410e9846741ff741f (patch) | |
| tree | b555a11c16afcca9ec8508ea03e1628c11a0eedd | |
| parent | 26ee77a613915fcf7f73b2976a9b113332652d9a (diff) | |
| download | emacs-5cee0a9c166b43936adebdd410e9846741ff741f.tar.gz emacs-5cee0a9c166b43936adebdd410e9846741ff741f.zip | |
Enhance CC Mode manual to cover the new Java features.
| -rw-r--r-- | doc/misc/ChangeLog | 9 | ||||
| -rw-r--r-- | doc/misc/cc-mode.texi | 97 |
2 files changed, 66 insertions, 40 deletions
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog index cebddcba018..81b89b98a2e 100644 --- a/doc/misc/ChangeLog +++ b/doc/misc/ChangeLog | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | 2010-08-01 Alan Mackenzie <acm@muc.de> | ||
| 2 | |||
| 3 | Enhance the manual for the latest Java Mode. | ||
| 4 | |||
| 5 | * cc-mode.texi (Syntactic Symbols): New symbols annotation-top-cont and | ||
| 6 | annotation-var-cont. | ||
| 7 | (Java Symbols): Page renamed from Anonymous Class Symbol. Document the | ||
| 8 | two new symbols. | ||
| 9 | |||
| 1 | 2010-07-28 Michael Albinus <michael.albinus@gmx.de> | 10 | 2010-07-28 Michael Albinus <michael.albinus@gmx.de> |
| 2 | 11 | ||
| 3 | * tramp.texi (Traces and Profiles): Describe verbose level 9. | 12 | * tramp.texi (Traces and Profiles): Describe verbose level 9. |
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi index c1d8db80dae..73ee0e107d3 100644 --- a/doc/misc/cc-mode.texi +++ b/doc/misc/cc-mode.texi | |||
| @@ -312,19 +312,19 @@ Indentation Engine Basics | |||
| 312 | 312 | ||
| 313 | Syntactic Symbols | 313 | Syntactic Symbols |
| 314 | 314 | ||
| 315 | * Function Symbols:: | 315 | * Function Symbols:: |
| 316 | * Class Symbols:: | 316 | * Class Symbols:: |
| 317 | * Conditional Construct Symbols:: | 317 | * Conditional Construct Symbols:: |
| 318 | * Switch Statement Symbols:: | 318 | * Switch Statement Symbols:: |
| 319 | * Brace List Symbols:: | 319 | * Brace List Symbols:: |
| 320 | * External Scope Symbols:: | 320 | * External Scope Symbols:: |
| 321 | * Paren List Symbols:: | 321 | * Paren List Symbols:: |
| 322 | * Literal Symbols:: | 322 | * Literal Symbols:: |
| 323 | * Multiline Macro Symbols:: | 323 | * Multiline Macro Symbols:: |
| 324 | * Objective-C Method Symbols:: | 324 | * Objective-C Method Symbols:: |
| 325 | * Anonymous Class Symbol:: | 325 | * Java Symbols:: |
| 326 | * Statement Block Symbols:: | 326 | * Statement Block Symbols:: |
| 327 | * K&R Symbols:: | 327 | * K&R Symbols:: |
| 328 | 328 | ||
| 329 | Customizing Indentation | 329 | Customizing Indentation |
| 330 | 330 | ||
| @@ -3971,6 +3971,9 @@ The first line in a ``topmost'' definition. @ref{Function Symbols}. | |||
| 3971 | Topmost definition continuation lines. This is only used in the parts | 3971 | Topmost definition continuation lines. This is only used in the parts |
| 3972 | that aren't covered by other symbols such as @code{func-decl-cont} and | 3972 | that aren't covered by other symbols such as @code{func-decl-cont} and |
| 3973 | @code{knr-argdecl}. @ref{Function Symbols}. | 3973 | @code{knr-argdecl}. @ref{Function Symbols}. |
| 3974 | @item annotation-top-cont | ||
| 3975 | Topmost definition continuation lines where all previous items are | ||
| 3976 | annotations. @ref{Java Symbols}. | ||
| 3974 | @item member-init-intro | 3977 | @item member-init-intro |
| 3975 | First line in a member initialization list. @ref{Class Symbols}. | 3978 | First line in a member initialization list. @ref{Class Symbols}. |
| 3976 | @item member-init-cont | 3979 | @item member-init-cont |
| @@ -3999,6 +4002,9 @@ with an open brace. @ref{Brace List Symbols}. | |||
| 3999 | A statement. @ref{Function Symbols}. | 4002 | A statement. @ref{Function Symbols}. |
| 4000 | @item statement-cont | 4003 | @item statement-cont |
| 4001 | A continuation of a statement. @ref{Function Symbols}. | 4004 | A continuation of a statement. @ref{Function Symbols}. |
| 4005 | @item annotation-var-cont | ||
| 4006 | A continuation of a statement where all previous items are | ||
| 4007 | annotations. @ref{Java Symbols}. | ||
| 4002 | @item statement-block-intro | 4008 | @item statement-block-intro |
| 4003 | The first line in a new statement block. @ref{Conditional Construct | 4009 | The first line in a new statement block. @ref{Conditional Construct |
| 4004 | Symbols}. | 4010 | Symbols}. |
| @@ -4112,23 +4118,23 @@ Symbols}. | |||
| 4112 | @item inexpr-class | 4118 | @item inexpr-class |
| 4113 | A class definition inside an expression. This is used for anonymous | 4119 | A class definition inside an expression. This is used for anonymous |
| 4114 | classes in Java. It's also used for anonymous array initializers in | 4120 | classes in Java. It's also used for anonymous array initializers in |
| 4115 | Java. @ref{Anonymous Class Symbol}. | 4121 | Java. @ref{Java Symbols}. |
| 4116 | @end table | 4122 | @end table |
| 4117 | 4123 | ||
| 4118 | @menu | 4124 | @menu |
| 4119 | * Function Symbols:: | 4125 | * Function Symbols:: |
| 4120 | * Class Symbols:: | 4126 | * Class Symbols:: |
| 4121 | * Conditional Construct Symbols:: | 4127 | * Conditional Construct Symbols:: |
| 4122 | * Switch Statement Symbols:: | 4128 | * Switch Statement Symbols:: |
| 4123 | * Brace List Symbols:: | 4129 | * Brace List Symbols:: |
| 4124 | * External Scope Symbols:: | 4130 | * External Scope Symbols:: |
| 4125 | * Paren List Symbols:: | 4131 | * Paren List Symbols:: |
| 4126 | * Literal Symbols:: | 4132 | * Literal Symbols:: |
| 4127 | * Multiline Macro Symbols:: | 4133 | * Multiline Macro Symbols:: |
| 4128 | * Objective-C Method Symbols:: | 4134 | * Objective-C Method Symbols:: |
| 4129 | * Anonymous Class Symbol:: | 4135 | * Java Symbols:: |
| 4130 | * Statement Block Symbols:: | 4136 | * Statement Block Symbols:: |
| 4131 | * K&R Symbols:: | 4137 | * K&R Symbols:: |
| 4132 | @end menu | 4138 | @end menu |
| 4133 | 4139 | ||
| 4134 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4140 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| @@ -4233,7 +4239,7 @@ Hitting @kbd{C-c C-s} on line 5 shows the following analysis: | |||
| 4233 | 4239 | ||
| 4234 | @noindent | 4240 | @noindent |
| 4235 | The primary syntactic symbol for this line is @code{access-label} as | 4241 | The primary syntactic symbol for this line is @code{access-label} as |
| 4236 | this a label keyword that specifies access protection in C++. However, | 4242 | this is a label keyword that specifies access protection in C++. However, |
| 4237 | because this line is also a top-level construct inside a class | 4243 | because this line is also a top-level construct inside a class |
| 4238 | definition, the analysis actually shows two syntactic symbols. The | 4244 | definition, the analysis actually shows two syntactic symbols. The |
| 4239 | other syntactic symbol assigned to this line is @code{inclass}. | 4245 | other syntactic symbol assigned to this line is @code{inclass}. |
| @@ -4740,7 +4746,7 @@ macros.}. | |||
| 4740 | @xref{Custom Macros}, for more info about the treatment of macros. | 4746 | @xref{Custom Macros}, for more info about the treatment of macros. |
| 4741 | 4747 | ||
| 4742 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4748 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 4743 | @node Objective-C Method Symbols, Anonymous Class Symbol, Multiline Macro Symbols, Syntactic Symbols | 4749 | @node Objective-C Method Symbols, Java Symbols, Multiline Macro Symbols, Syntactic Symbols |
| 4744 | @comment node-name, next, previous, up | 4750 | @comment node-name, next, previous, up |
| 4745 | @subsection Objective-C Method Symbols | 4751 | @subsection Objective-C Method Symbols |
| 4746 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4752 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| @@ -4767,34 +4773,45 @@ assigned @code{objc-method-args-cont} syntax. Lines 5 and 6 are both | |||
| 4767 | assigned @code{objc-method-call-cont} syntax. | 4773 | assigned @code{objc-method-call-cont} syntax. |
| 4768 | 4774 | ||
| 4769 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4775 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 4770 | @node Anonymous Class Symbol, Statement Block Symbols, Objective-C Method Symbols, Syntactic Symbols | 4776 | @node Java Symbols, Statement Block Symbols, Objective-C Method Symbols, Syntactic Symbols |
| 4771 | @comment node-name, next, previous, up | 4777 | @comment node-name, next, previous, up |
| 4772 | @subsection Anonymous Class Symbol (Java) | 4778 | @subsection Java Symbols |
| 4773 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4779 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 4774 | 4780 | ||
| 4775 | Java has a concept of anonymous classes which can look something like | 4781 | Java has a concept of anonymous classes which can look something like |
| 4776 | this: | 4782 | this: |
| 4777 | 4783 | ||
| 4778 | @example | 4784 | @example |
| 4779 | 1: public void watch(Observable o) @{ | 4785 | 1: @@Test |
| 4780 | 2: o.addObserver(new Observer() @{ | 4786 | 2: public void watch(Observable o) @{ |
| 4781 | 3: public void update(Observable o, Object arg) @{ | 4787 | 3: @@NonNull |
| 4782 | 4: history.addElement(arg); | 4788 | 4: Observer obs = new Observer() @{ |
| 4783 | 5: @} | 4789 | 5: public void update(Observable o, Object arg) @{ |
| 4784 | 6: @}); | 4790 | 6: history.addElement(arg); |
| 4785 | 7: @} | 4791 | 7: @} |
| 4792 | 8: @}; | ||
| 4793 | 9: o.addObserver(obs); | ||
| 4794 | 10: @} | ||
| 4786 | @end example | 4795 | @end example |
| 4787 | 4796 | ||
| 4788 | @ssindex inexpr-class | 4797 | @ssindex inexpr-class |
| 4789 | The brace following the @code{new} operator opens the anonymous class. | 4798 | The brace following the @code{new} operator opens the anonymous class. |
| 4790 | Lines 3 and 6 are assigned the @code{inexpr-class} syntax, besides the | 4799 | Lines 5 and 8 are assigned the @code{inexpr-class} syntax, besides the |
| 4791 | @code{inclass} symbol used in normal classes. Thus, the class will be | 4800 | @code{inclass} symbol used in normal classes. Thus, the class will be |
| 4792 | indented just like a normal class, with the added indentation given to | 4801 | indented just like a normal class, with the added indentation given to |
| 4793 | @code{inexpr-class}. An @code{inexpr-class} syntactic element doesn't | 4802 | @code{inexpr-class}. An @code{inexpr-class} syntactic element doesn't |
| 4794 | have an anchor position. | 4803 | have an anchor position. |
| 4795 | 4804 | ||
| 4805 | @ssindex annotation-top-cont | ||
| 4806 | @ssindex annotation-var-cont | ||
| 4807 | Line 2 is assigned the @code{annotation-top-cont} syntax, due to it being a | ||
| 4808 | continuation of a topmost introduction with an annotation symbol preceding | ||
| 4809 | the current line. Similarly, line 4 is assigned the @code{annotation-var-cont} | ||
| 4810 | syntax due to it being a continuation of a variable declaration where preceding | ||
| 4811 | the declaration is an annotation. | ||
| 4812 | |||
| 4796 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4813 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
| 4797 | @node Statement Block Symbols, K&R Symbols, Anonymous Class Symbol, Syntactic Symbols | 4814 | @node Statement Block Symbols, K&R Symbols, Java Symbols, Syntactic Symbols |
| 4798 | @comment node-name, next, previous, up | 4815 | @comment node-name, next, previous, up |
| 4799 | @subsection Statement Block Symbols | 4816 | @subsection Statement Block Symbols |
| 4800 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 4817 | @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |