Mercurial > emacs
comparison man/cc-mode.texi @ 26490:2b08d829af86
Fix complaints from makeinfo 4.0.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Thu, 18 Nov 1999 16:00:03 +0000 |
parents | ac7e9e5e2ccb |
children | a19be798eaea |
comparison
equal
deleted
inserted
replaced
26489:1a438767af51 | 26490:2b08d829af86 |
---|---|
661 @code{brace-list-intro}, @code{brace-list-entry}, @code{block-open}, | 661 @code{brace-list-intro}, @code{brace-list-entry}, @code{block-open}, |
662 @code{block-close}, @code{substatement-open}, | 662 @code{block-close}, @code{substatement-open}, |
663 @code{statement-case-open}, | 663 @code{statement-case-open}, |
664 @code{extern-lang-open}, @code{extern-lang-close}, | 664 @code{extern-lang-open}, @code{extern-lang-close}, |
665 @code{namespace-open}, and @code{namespace-close}. | 665 @code{namespace-open}, and @code{namespace-close}. |
666 @xref{Syntactic Symbols} for a more | 666 @xref{Syntactic Symbols}, for a more |
667 detailed description of these syntactic symbols. | 667 detailed description of these syntactic symbols. |
668 | 668 |
669 @cindex Custom Indentation Functions | 669 @cindex Custom Indentation Functions |
670 The value associated with each syntactic symbol in this association list | 670 The value associated with each syntactic symbol in this association list |
671 is called an @var{ACTION} which can be either a function or a list. | 671 is called an @var{ACTION} which can be either a function or a list. |
672 @xref{Custom Brace and Colon Hanging} for a more detailed discussion of | 672 @xref{Custom Brace and Colon Hanging}, for a more detailed discussion of |
673 using a function as a brace hanging @var{ACTION}. | 673 using a function as a brace hanging @var{ACTION}. |
674 | 674 |
675 When the @var{ACTION} is a list, it can contain any combination of the | 675 When the @var{ACTION} is a list, it can contain any combination of the |
676 symbols @code{before} and @code{after}, directing @ccmode{} where to | 676 symbols @code{before} and @code{after}, directing @ccmode{} where to |
677 put newlines in relationship to the brace being inserted. Thus, if the | 677 put newlines in relationship to the brace being inserted. Thus, if the |
718 | 718 |
719 A word of caution: it is not a good idea to hang top-level construct | 719 A word of caution: it is not a good idea to hang top-level construct |
720 introducing braces, such as @code{class-open} or @code{defun-open}. | 720 introducing braces, such as @code{class-open} or @code{defun-open}. |
721 Emacs makes an assumption that such braces will always appear in column | 721 Emacs makes an assumption that such braces will always appear in column |
722 zero, hanging such braces can introduce performance problems. | 722 zero, hanging such braces can introduce performance problems. |
723 @xref{Performance Issues} for more information. | 723 @xref{Performance Issues}, for more information. |
724 | 724 |
725 | 725 |
726 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 726 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
727 @node Hanging Colons, Hanging Semi-colons and commas, Hanging Braces, Auto-newline insertion | 727 @node Hanging Colons, Hanging Semi-colons and commas, Hanging Braces, Auto-newline insertion |
728 @comment node-name, next, previous,up | 728 @comment node-name, next, previous,up |
744 | 744 |
745 @cindex Clean-ups | 745 @cindex Clean-ups |
746 In C++, double-colons are used as a scope operator but because these | 746 In C++, double-colons are used as a scope operator but because these |
747 colons always appear right next to each other, newlines before and after | 747 colons always appear right next to each other, newlines before and after |
748 them are controlled by a different mechanism, called @dfn{clean-ups} in | 748 them are controlled by a different mechanism, called @dfn{clean-ups} in |
749 @ccmode{}. @xref{Clean-ups} for details. | 749 @ccmode{}. @xref{Clean-ups}, for details. |
750 | 750 |
751 | 751 |
752 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 752 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
753 @node Hanging Semi-colons and commas, Other electric commands, Hanging Colons, Auto-newline insertion | 753 @node Hanging Semi-colons and commas, Other electric commands, Hanging Colons, Auto-newline insertion |
754 @comment node-name, next, previous,up | 754 @comment node-name, next, previous,up |
759 | 759 |
760 Semicolons and commas are also electric in @ccmode{}, but since | 760 Semicolons and commas are also electric in @ccmode{}, but since |
761 these characters do not correspond directly to syntactic symbols, a | 761 these characters do not correspond directly to syntactic symbols, a |
762 different mechanism is used to determine whether newlines should be | 762 different mechanism is used to determine whether newlines should be |
763 automatically inserted after these characters. @xref{Customizing | 763 automatically inserted after these characters. @xref{Customizing |
764 Semi-colons and Commas} for details. | 764 Semi-colons and Commas}, for details. |
765 | 765 |
766 | 766 |
767 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | 767 @comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! |
768 @node Other electric commands, Clean-ups, Hanging Semi-colons and commas, Auto-newline insertion | 768 @node Other electric commands, Clean-ups, Hanging Semi-colons and commas, Auto-newline insertion |
769 @comment node-name, next, previous,up | 769 @comment node-name, next, previous,up |
1146 @code{nil} to inhibit progress messages, including messages normally | 1146 @code{nil} to inhibit progress messages, including messages normally |
1147 printed when indentation is started and completed. | 1147 printed when indentation is started and completed. |
1148 | 1148 |
1149 Also, except as noted below, re-indentation is always driven by the | 1149 Also, except as noted below, re-indentation is always driven by the |
1150 same mechanisms that control on-the-fly indentation of code. @xref{New | 1150 same mechanisms that control on-the-fly indentation of code. @xref{New |
1151 Indentation Engine} for details. | 1151 Indentation Engine}, for details. |
1152 | 1152 |
1153 @findex c-indent-command | 1153 @findex c-indent-command |
1154 @findex indent-command (c-) | 1154 @findex indent-command (c-) |
1155 @vindex c-tab-always-indent | 1155 @vindex c-tab-always-indent |
1156 @vindex tab-always-indent (c-) | 1156 @vindex tab-always-indent (c-) |
1400 C-o} (@code{c-set-offset}) as the way to set offsets, both interactively | 1400 C-o} (@code{c-set-offset}) as the way to set offsets, both interactively |
1401 and from your mode hook. Also, you can set up @emph{styles} of | 1401 and from your mode hook. Also, you can set up @emph{styles} of |
1402 indentatio. Most likely, you'll | 1402 indentatio. Most likely, you'll |
1403 find one of the pre-defined styles will suit your needs, but if not, | 1403 find one of the pre-defined styles will suit your needs, but if not, |
1404 this section will describe how to set up basic editing configurations. | 1404 this section will describe how to set up basic editing configurations. |
1405 @xref{Styles} for an explanation of how to set up named styles. | 1405 @xref{Styles}, for an explanation of how to set up named styles. |
1406 | 1406 |
1407 @cindex c-basic-offset | 1407 @cindex c-basic-offset |
1408 @cindex basic-offset (c-) | 1408 @cindex basic-offset (c-) |
1409 As mentioned previously, the variable @code{c-offsets-alist} is an | 1409 As mentioned previously, the variable @code{c-offsets-alist} is an |
1410 association list of syntactic symbols and the offsets to be applied for | 1410 association list of syntactic symbols and the offsets to be applied for |
1679 | 1679 |
1680 Here's a simplified example of what you can add to your @file{.emacs} | 1680 Here's a simplified example of what you can add to your @file{.emacs} |
1681 file to make the changes described in the previous section | 1681 file to make the changes described in the previous section |
1682 (@ref{Interactive Customization}) more permanent. See the Emacs manuals | 1682 (@ref{Interactive Customization}) more permanent. See the Emacs manuals |
1683 for more information on customizing Emacs via hooks. @xref{Sample | 1683 for more information on customizing Emacs via hooks. @xref{Sample |
1684 .emacs File} for a more complete sample @file{.emacs} file. | 1684 .emacs File}, for a more complete sample @file{.emacs} file. |
1685 @example | 1685 @example |
1686 @group | 1686 @group |
1687 | 1687 |
1688 (defun my-c-mode-common-hook () | 1688 (defun my-c-mode-common-hook () |
1689 ;; my customizations for all of c-mode and related modes | 1689 ;; my customizations for all of c-mode and related modes |
1793 @code{user} --- This is a special style for several reasons. First, if | 1793 @code{user} --- This is a special style for several reasons. First, if |
1794 you customize @ccmode{} by using either the new Custom interface or by | 1794 you customize @ccmode{} by using either the new Custom interface or by |
1795 doing @code{setq}'s at the top level of your @file{.emacs} file, these | 1795 doing @code{setq}'s at the top level of your @file{.emacs} file, these |
1796 settings will be captured in the @code{user} style. Also, all other | 1796 settings will be captured in the @code{user} style. Also, all other |
1797 styles implicitly inherit their settings from @code{user} style. This | 1797 styles implicitly inherit their settings from @code{user} style. This |
1798 means that for any styles you add via @code{c-add-style} (@xref{Adding | 1798 means that for any styles you add via @code{c-add-style} (@pxref{Adding |
1799 Styles}) you need only define the differences between your new style and | 1799 Styles}) you need only define the differences between your new style and |
1800 @code{user} style. | 1800 @code{user} style. |
1801 | 1801 |
1802 Note however that @code{user} style is @emph{not} the default style. | 1802 Note however that @code{user} style is @emph{not} the default style. |
1803 @code{gnu} is the default style for all newly created buffers, but you | 1803 @code{gnu} is the default style for all newly created buffers, but you |