]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/programs.texi
Tweak previous NEWS change
[gnu-emacs] / doc / emacs / programs.texi
index bb62ad67b2af6357e73c325a65a8044b544bb0ba..55031e673dce88e91198457bdc5508a86af3741c 100644 (file)
@@ -1,15 +1,16 @@
+@c -*- coding: utf-8 -*-
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 1999-2011
-@c   Free Software Foundation, Inc.
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 1999-2014 Free Software
+@c Foundation, Inc.
 @c See file emacs.texi for copying conditions.
-@node Programs, Building, Text, Top
+@node Programs
 @chapter Editing Programs
 @cindex Lisp editing
 @cindex C editing
 @cindex program editing
 
   This chapter describes Emacs features for facilitating editing
-programs.  Some of these features can:
+programs.  Some of the things these features can do are:
 
 @itemize @bullet
 @item
@@ -35,11 +36,12 @@ Highlight program syntax (@pxref{Font Lock}).
 * Documentation::       Getting documentation of functions you plan to call.
 * Hideshow::            Displaying blocks selectively.
 * Symbol Completion::   Completion on symbol names of your program or language.
-* Glasses::             Making identifiersLikeThis more readable.
+* MixedCase Words::     Dealing with identifiersLikeThis.
 * Semantic::            Suite of editing tools based on source code parsing.
+* Prettifying Symbols:: Display symbols as composed characters.
 * Misc for Programs::   Other Emacs features useful for editing programs.
-* C Modes::             Special commands of C, C++, Objective-C,
-                          Java, and Pike modes.
+* C Modes::             Special commands of C, C++, Objective-C, Java,
+                          IDL, Pike and AWK modes.
 * Asm Mode::            Asm mode and its special features.
 @ifnottex
 * Fortran::             Fortran mode and its special features.
@@ -75,17 +77,17 @@ mode for the C programming language is @code{c-mode}.
 @cindex VHDL mode
 @cindex M4 mode
 @cindex Shell-script mode
-@cindex Delphi mode
+@cindex OPascal mode
 @cindex PostScript mode
 @cindex Conf mode
 @cindex DNS mode
 @cindex Javascript mode
   Emacs has programming language modes for Lisp, Scheme, the
-Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++, Delphi,
+Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++,
 Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, Metafont
-(@TeX{}'s companion for font creation), Modula2, Objective-C, Octave,
-Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, Tcl, and
-VHDL.  An alternative mode for Perl is called CPerl mode.  Modes are
+(@TeX{}'s companion for font creation), Modula2, Object Pascal, Objective-C,
+Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, Tcl,
+and VHDL@.  An alternative mode for Perl is called CPerl mode.  Modes are
 also available for the scripting languages of the common GNU and Unix
 shells, VMS DCL, and MS-DOS/MS-Windows @samp{BAT} files, and for
 makefiles, DNS master files, and various sorts of configuration files.
@@ -119,18 +121,17 @@ those specified in the mode's own mode hook (@pxref{Major Modes}).
 For instance, entering C mode runs the hooks @code{prog-mode-hook} and
 @code{c-mode-hook}.  @xref{Hooks}, for information about hooks.
 
-@ifinfo
+@ifnottex
   Separate manuals are available for the modes for Ada (@pxref{Top,,
 Ada Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba
 IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}), and IDLWAVE
 (@pxref{Top,, IDLWAVE, idlwave, IDLWAVE User Manual}).
-@end ifinfo
-@ifnotinfo
+@end ifnottex
+@iftex
   The Emacs distribution contains Info manuals for the major modes for
-Ada, C/C++/Objective C/Java/Corba IDL/Pike/AWK, and IDLWAVE.  For
-Fortran mode, see the ``Fortran'' section in the Info version of the
-Emacs manual, which is not included in this printed version.
-@end ifnotinfo
+Ada, C/C++/Objective C/Java/Corba IDL/Pike/AWK, and IDLWAVE@.  For
+Fortran mode, @pxref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
+@end iftex
 
 @node Defuns
 @section Top-Level Definitions, or Defuns
@@ -186,15 +187,13 @@ delimiter from starting a defun.  Here's an example:
 highlights confusing opening delimiters (those that ought to be
 quoted) in bold red.
 
+@vindex open-paren-in-column-0-is-defun-start
   If you need to override this convention, you can do so by setting
-this user option:
-
-@defvar open-paren-in-column-0-is-defun-start
+the variable @code{open-paren-in-column-0-is-defun-start}.
 If this user option is set to @code{t} (the default), opening
-parentheses or braces at column zero always start defuns.  When it's
+parentheses or braces at column zero always start defuns.  When it is
 @code{nil}, defuns are found by searching for parens or braces at the
 outermost level.
-@end defvar
 
   Usually, you should leave this option at its default value of
 @code{t}.  If your buffer contains parentheses or braces in column
@@ -329,12 +328,13 @@ as you move around in a buffer.
 @findex which-function-mode
 @vindex which-func-modes
   To either enable or disable Which Function mode, use the command
-@kbd{M-x which-function-mode}.  Although Which Function mode is a
-global minor mode, it takes effect only in certain major modes: those
-listed in the variable @code{which-func-modes}.  If the value of
-@code{which-func-modes} is @code{t} rather than a list of modes, then
-Which Function mode applies to all major modes that know how to
-support it---in other words, all the major modes that support Imenu.
+@kbd{M-x which-function-mode}.  Which Function mode is a global minor
+mode.  By default, it takes effect in all major modes major modes that
+know how to support it (i.e., all the major modes that support
+Imenu).  You can restrict it to a specific list of major modes by
+changing the value of the variable @code{which-func-modes} from
+@code{t} (which means to support all available major modes) to a list
+of major mode names.
 
 @node Program Indent
 @section Indentation for Programs
@@ -367,9 +367,9 @@ which reformats Lisp objects with nice-looking indentation.
 @table @kbd
 @item @key{TAB}
 Adjust indentation of current line (@code{indent-for-tab-command}).
-@item C-j
+@item @key{RET}
 Insert a newline, then adjust indentation of following line
-(@code{newline-and-indent}).
+(@code{newline}).
 @end table
 
 @kindex TAB @r{(programming modes)}
@@ -383,17 +383,14 @@ the current line, based on the indentation and syntactic content of
 the preceding lines; if the region is active, @key{TAB} indents each
 line within the region, not just the current line.
 
-@kindex C-j @r{(indenting source code)}
-@findex newline-and-indent
-  The command @kbd{C-j} (@code{newline-and-indent}), which was
-documented in @ref{Indentation Commands}, does the same as @key{RET}
-followed by @key{TAB}: it inserts a new line, then adjusts the line's
-indentation.
+  The command @key{RET} (@code{newline}), which was documented in
+@ref{Inserting Text}, does the same as @key{C-j} followed by
+@key{TAB}: it inserts a new line, then adjusts the line's indentation.
 
   When indenting a line that starts within a parenthetical grouping,
 Emacs usually places the start of the line under the preceding line
 within the group, or under the text after the parenthesis.  If you
-manually give one of these lines a nonstandard indentation (e.g.@: for
+manually give one of these lines a nonstandard indentation (e.g., for
 aesthetic purposes), the lines below will follow it.
 
   The indentation commands for most programming language modes assume
@@ -433,7 +430,7 @@ lines that start inside comments and strings.
   To reindent the contents of a single parenthetical grouping,
 position point before the beginning of the grouping and type
 @kbd{C-M-q}.  This changes the relative indentation within the
-grouping, without affecting its overall indentation (i.e.@: the
+grouping, without affecting its overall indentation (i.e., the
 indentation of the line where the grouping starts).  The function that
 @kbd{C-M-q} runs depends on the major mode; it is
 @code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode,
@@ -606,6 +603,14 @@ information on customizing indentation for C and related modes,
 including how to override parts of an existing style and how to define
 your own styles.
 
+@findex c-guess
+@findex c-guess-install
+  As an alternative to specifying a style, you can tell Emacs to guess
+a style by typing @kbd{M-x c-guess} in a sample code buffer.  You can
+then apply the guessed style to other buffers with @kbd{M-x
+c-guess-install}.  @xref{Guessing the Style,,, ccmode, the CC Mode
+Manual}, for details.
+
 @node Parentheses
 @section Commands for Editing with Parentheses
 
@@ -666,7 +671,7 @@ Put mark after following expression (@code{mark-sexp}).
 @findex backward-sexp
   To move forward over a balanced expression, use @kbd{C-M-f}
 (@code{forward-sexp}).  If the first significant character after point
-is an opening delimiter (e.g.@: @samp{(}, @samp{[} or @samp{@{} in C),
+is an opening delimiter (e.g., @samp{(}, @samp{[} or @samp{@{} in C),
 this command moves past the matching closing delimiter.  If the
 character begins a symbol, string, or number, the command moves over
 that.
@@ -793,12 +798,12 @@ make it easy to see how and whether parentheses (or other delimiters)
 match up.
 
   Whenever you type a self-inserting character that is a closing
-delimiter, the cursor moves momentarily to the location of the
-matching opening delimiter, provided that is on the screen.  If it is
-not on the screen, Emacs displays some of the text near it in the echo
-area.  Either way, you can tell which grouping you are closing off.
-If the opening delimiter and closing delimiter are mismatched---such
-as in @samp{[x)}---a warning message is displayed in the echo area.
+delimiter, Emacs briefly indicates the location of the matching
+opening delimiter, provided that is on the screen.  If it is not on
+the screen, Emacs displays some of the text near it in the echo area.
+Either way, you can tell which grouping you are closing off.  If the
+opening delimiter and closing delimiter are mismatched---such as in
+@samp{[x)}---a warning message is displayed in the echo area.
 
 @vindex blink-matching-paren
 @vindex blink-matching-paren-distance
@@ -808,13 +813,14 @@ as in @samp{[x)}---a warning message is displayed in the echo area.
 @itemize @bullet
 @item
 @code{blink-matching-paren} turns the feature on or off: @code{nil}
-disables it, but the default is @code{t} to enable it.
+disables it, but the default is @code{t} to enable it.  Set it to
+@code{jump} to make indication work by momentarily moving the cursor
+to the matching opening delimiter.
 
 @item
-@code{blink-matching-delay} says how many seconds to leave the cursor
-on the matching opening delimiter, before bringing it back to the real
-location of point.  This may be an integer or floating-point number;
-the default is 1.
+@code{blink-matching-delay} says how many seconds to keep indicating
+the matching opening delimiter.  This may be an integer or
+floating-point number; the default is 1.
 
 @item
 @code{blink-matching-paren-distance} specifies how many characters
@@ -838,8 +844,34 @@ show-paren-mode}.
   Electric Pair mode, a global minor mode, provides a way to easily
 insert matching delimiters.  Whenever you insert an opening delimiter,
 the matching closing delimiter is automatically inserted as well,
-leaving point between the two.  To toggle Electric Pair mode, type
-@kbd{M-x electric-pair-mode}.
+leaving point between the two. Conversely, when you insert a closing
+delimiter over an existing one, no inserting takes places and that
+position is simply skipped over. These variables control additional
+features of Electric Pair mode:
+
+@itemize @bullet
+@item
+@code{electric-pair-preserve-balance}, when non-@code{nil}, makes the
+default pairing logic balance out the number of opening and closing
+delimiters.
+
+@item
+@code{electric-pair-delete-adjacent-pairs}, when non-@code{nil}, makes
+backspacing between two adjacent delimiters also automatically delete
+the closing delimiter.
+
+@item
+@code{electric-pair-open-newline-between-pairs}, when non-@code{nil},
+makes inserting inserting a newline between two adjacent pairs also
+automatically open and extra newline after point.
+
+@item
+@code{electric-pair-skip-whitespace}, when non-@code{nil}, causes the minor
+mode to skip whitespace forward before deciding whether to skip over
+the closing delimiter.
+@end itemize
+
+To toggle Electric Pair mode, type @kbd{M-x electric-pair-mode}.
 
 @node Comments
 @section Manipulating Comments
@@ -918,7 +950,7 @@ negative argument @var{-n} removes @var{n} delimiters.
 
   If the region is not active, and there is no existing comment on the
 current line, @kbd{M-;} adds a new comment to the current line.  If
-the line is blank (i.e.@: empty or containing only whitespace
+the line is blank (i.e., empty or containing only whitespace
 characters), the comment is indented to the same position where
 @key{TAB} would indent to (@pxref{Basic Indent}).  If the line is
 non-blank, the comment is placed after the last non-whitespace
@@ -944,7 +976,7 @@ comment text.
 comment on the current line, along with the whitespace before it.
 Since the comment is saved to the kill ring, you can reinsert it on
 another line by moving to the end of that line, doing @kbd{C-y}, and
-then @kbd{M-;} to realign the command.  You can achieve the same
+then @kbd{M-;} to realign the comment.  You can achieve the same
 effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill}
 (@code{comment-dwim} actually calls @code{comment-kill} as a
 subroutine when it is given a prefix argument).
@@ -981,7 +1013,7 @@ type @kbd{M-j} or @kbd{C-M-j} (@code{comment-indent-new-line}).  This
 breaks the current line, and inserts the necessary comment delimiters
 and indentation to continue the comment.
 
-  For languages with closing comment delimiters (e.g.@: @samp{*/} in
+  For languages with closing comment delimiters (e.g., @samp{*/} in
 C), the exact behavior of @kbd{M-j} depends on the value of the
 variable @code{comment-multi-line}.  If the value is @code{nil}, the
 command closes the comment on the old line and starts a new comment on
@@ -1076,8 +1108,7 @@ documentation of functions, variables and commands that you plan to
 use in your program.
 
 @menu
-* Info Lookup::         Looking up library functions and commands
-                          in Info files.
+* Info Lookup::         Looking up library functions and commands in Info files.
 * Man Page::            Looking up man pages of library functions and commands.
 * Lisp Doc::            Looking up Emacs Lisp functions, etc.
 @end menu
@@ -1102,7 +1133,7 @@ You can also use @kbd{M-x info-lookup-file} to look for documentation
 for a file name.
 
   If you use @kbd{C-h S} in a major mode that does not support it,
-it asks you to specify the ``symbol help mode.''  You should enter
+it asks you to specify the ``symbol help mode''.  You should enter
 a command such as @code{c-mode} that would select a major
 mode which @kbd{C-h S} does support.
 
@@ -1123,7 +1154,7 @@ prompts for a topic, with completion (@pxref{Completion}), and runs
 the @command{man} program to format the corresponding man page.  If
 the system permits, it runs @command{man} asynchronously, so that you
 can keep on editing while the page is being formatted.  The result
-goes in a buffer named @samp{*Man @var{topic}*}.  These buffers use a
+goes in a buffer named @file{*Man @var{topic}*}.  These buffers use a
 special major mode, Man mode, that facilitates scrolling and jumping
 to other manual pages.  For details, type @kbd{C-h m} while in a Man
 mode buffer.
@@ -1158,7 +1189,7 @@ command.  Unlike @kbd{M-x man}, it does not run any external programs
 to format and display the man pages; the formatting is done by Emacs,
 so it works on systems such as MS-Windows where the @command{man}
 program may be unavailable.  It prompts for a man page, and displays
-it in a buffer named @samp{*WoMan @var{section} @var{topic}}.
+it in a buffer named @file{*WoMan @var{section} @var{topic}}.
 
   @kbd{M-x woman} computes the completion list for manpages the first
 time you invoke the command.  With a numeric argument, it recomputes
@@ -1189,7 +1220,7 @@ variables that you want to use.  @xref{Name Help}.
 @cindex Eldoc mode
 @findex eldoc-mode
   Eldoc is a buffer-local minor mode that helps with looking up Lisp
-documention.  When it is enabled, the echo area displays some useful
+documentation.  When it is enabled, the echo area displays some useful
 information whenever there is a Lisp function or variable at point;
 for a function, it shows the argument list, and for a variable it
 shows the first line of the variable's documentation string.  To
@@ -1283,18 +1314,18 @@ for switching graphical windows, so you should type @kbd{C-M-i} or
 @kbd{@key{ESC} @key{TAB}} instead.
 
 @cindex tags-based completion
-  In-buffer symbol completion generates its completion list in a
-number of different ways.  If Semantic mode is enabled, Emacs tries to
-use the Semantic parser data for completion (@pxref{Semantic}).  If
-Semantic mode is not enabled or it fails at performing completion,
-Emacs normally tries to complete using a tags table (@pxref{Tags}).
-
+@findex completion-at-point
 @cindex Lisp symbol completion
 @cindex completion (Lisp symbols)
-  In Emacs Lisp mode, completion is performed using the function,
-variable, and property names defined in the current Emacs session.  If
-there is an open parenthesis immediately before the beginning of the
-partial symbol, only symbols with function definitions are considered.
+  In most programming language modes, @kbd{C-M-i} (or
+@kbd{M-@key{TAB}}) invokes the command @code{completion-at-point},
+which generates its completion list in a flexible way.  If Semantic
+mode is enabled, it tries to use the Semantic parser data for
+completion (@pxref{Semantic}).  If Semantic mode is not enabled or
+fails at performing completion, it tries to complete using the
+selected tags table (@pxref{Tags}).  If in Emacs Lisp mode, it
+performs completion using the function, variable, or property names
+defined in the current Emacs session.
 
   In all other respects, in-buffer symbol completion behaves like
 minibuffer completion.  For instance, if Emacs cannot complete to a
@@ -1304,24 +1335,37 @@ another window.  @xref{Completion}.
   In Text mode and related modes, @kbd{M-@key{TAB}} completes words
 based on the spell-checker's dictionary.  @xref{Spelling}.
 
-@node Glasses
-@section Glasses minor mode
-@cindex Glasses mode
+@node MixedCase Words
+@section MixedCase Words
 @cindex camel case
-@findex mode, Glasses
 
-  Glasses mode is a buffer-local minor mode that makes it easier to
-read mixed-case (or ``CamelCase'') symbols like
-@samp{unReadableSymbol}, by altering how they are displayed.  By
-default, it displays extra underscores between each lower-case letter
-and the following capital letter.  This does not alter the buffer
-text, only how it is displayed.
+  Some programming styles make use of mixed-case (or ``CamelCase'')
+symbols like @samp{unReadableSymbol}.  (In the GNU project, we recommend
+using underscores to separate words within an identifier, rather than
+using case distinctions.)  Emacs has various features to make it easier
+to deal with such symbols.
+
+@cindex Glasses mode
+@findex mode, Glasses
+  Glasses mode is a buffer-local minor mode that makes it easier to read
+such symbols, by altering how they are displayed.  By default, it
+displays extra underscores between each lower-case letter and the
+following capital letter.  This does not alter the buffer text, only how
+it is displayed.
 
   To toggle Glasses mode, type @kbd{M-x glasses-mode} (@pxref{Minor
 Modes}).  When Glasses mode is enabled, the minor mode indicator
 @samp{o^o} appears in the mode line.  For more information about
 Glasses mode, type @kbd{C-h P glasses @key{RET}}.
 
+@cindex Subword mode
+@findex subword-mode
+  Subword mode is another buffer-local minor mode.  In subword mode,
+Emacs's word commands recognize upper case letters in
+@samp{StudlyCapsIdentifiers} as word boundaries.  When Subword mode is
+enabled, the minor mode indicator @samp{,} appears in the mode line.
+See also the similar @code{superword-mode} (@pxref{Misc for Programs}).
+
 @node Semantic
 @section Semantic
 @cindex Semantic package
@@ -1351,7 +1395,7 @@ the menu item named @samp{Source Code Parsers (Semantic)} in the
 @samp{Tools} menu.  This enables Semantic mode, a global minor mode.
 
    When Semantic mode is enabled, Emacs automatically attempts to
-parses each file you visit.  Currently, Semantic understands C, C++,
+parse each file you visit.  Currently, Semantic understands C, C++,
 Scheme, Javascript, Java, HTML, and Make.  Within each parsed buffer,
 the following commands are available:
 
@@ -1390,6 +1434,37 @@ is idle.
 @xref{Top, Semantic,, semantic, Semantic}, for details.
 @end ifnottex
 
+@node Prettifying Symbols
+@section Prettifying Symbols
+@cindex prettifying symbols
+@cindex symbol, prettifying
+
+@code{prettify-symbols-mode} and @code{global-prettify-symbols-mode}
+are two minor modes (@pxref{Minor Modes}) that can display specified
+symbols as composed characters.  For instance, in Emacs Lisp mode
+(@pxref{Lisp Eval}), this mode will replace the string ``lambda'' with
+the Greek lambda character.
+
+@findex prettify-symbols-mode
+@vindex prettify-symbols-alist
+When Prettify Symbols mode and Font Lock mode (@pxref{Font Lock}) are
+enabled, symbols are prettified (displayed as composed characters)
+according to the rules in @code{prettify-symbols-alist}, which are
+locally defined by major modes (@pxref{Major Modes}) supporting
+prettifying.  To add further customizations for a given major mode,
+you can modify @code{prettify-symbols-alist}.  For example:
+
+@example
+(add-hook 'emacs-lisp-mode-hook
+         (lambda ()
+           (push '("<=" . ?≤) prettify-symbols-alist)))
+@end example
+
+@findex global-prettify-symbols-mode
+You can enable this mode locally in desired buffers, or use
+@code{global-prettify-symbols-mode} to enable it for all modes that
+support it.
+
 @node Misc for Programs
 @section Other Features Useful for Editing Programs
 
@@ -1407,6 +1482,25 @@ paragraph commands to work on.  Auto Fill mode, if enabled in a
 programming language major mode, indents the new lines which it
 creates.
 
+@findex superword-mode
+ Superword mode is a buffer-local minor mode that causes editing and
+motion commands to treat symbols (e.g., @samp{this_is_a_symbol}) as words.
+When Subword mode is enabled, the minor mode indicator
+@iftex
+@samp{@math{^2}}
+@end iftex
+@ifnottex
+@samp{²}
+@end ifnottex
+appears in the mode line.  See also the similar @code{subword-mode}
+(@pxref{MixedCase Words}).
+
+@findex electric-layout-mode
+  Electric Layout mode (@kbd{M-x electric-layout-mode}) is a global
+minor mode that automatically inserts newlines when you type certain
+characters; for example, @samp{@{}, @samp{@}} and @samp{;} in Javascript
+mode.
+
   Apart from Hideshow mode (@pxref{Hideshow}), another way to
 selectively display parts of a program is to use the selective display
 feature (@pxref{Selective Display}).  Programming modes often also
@@ -1438,7 +1532,7 @@ with the Foldout package (@pxref{Foldout}).
 
   This section gives a brief description of the special features
 available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes.
-(These are called ``C mode and related modes.'')
+(These are called ``C mode and related modes''.)
 @ifinfo
 @xref{Top,, CC Mode, ccmode, CC Mode}, for more details.
 @end ifinfo
@@ -1462,17 +1556,17 @@ with Emacs.
 related modes.
 
 @table @code
-@item M-x c-beginning-of-defun
-@itemx M-x c-end-of-defun
+@item C-M-a
+@itemx C-M-e
 @findex c-beginning-of-defun
 @findex c-end-of-defun
 Move point to the beginning or end of the current function or
-top-level definition.  These are found by searching for the least
+top-level definition.  In languages with enclosing scopes (such as
+C++'s classes) the @dfn{current function} is the immediate one,
+possibly inside a scope.  Otherwise it is the one defined by the least
 enclosing braces.  (By contrast, @code{beginning-of-defun} and
-@code{end-of-defun} search for braces in column zero.)  If you are
-editing code where the opening brace of a function isn't placed in
-column zero, you may wish to bind @code{C-M-a} and @code{C-M-e} to
-these commands.  @xref{Moving by Defuns}.
+@code{end-of-defun} search for braces in column zero.)  @xref{Moving
+by Defuns}.
 
 @item C-c C-u
 @kindex C-c C-u @r{(C mode)}
@@ -1540,8 +1634,8 @@ after the mode name:
 @kindex C-c C-l @r{(C mode)}
 @findex c-toggle-electric-state
 Toggle electric action (@code{c-toggle-electric-state}).  With a
-prefix argument, this command enables electric action if the argument
-is positive, disables it if it is negative.
+positive prefix argument, this command enables electric action, with a
+negative one it disables it.
 @end table
 
   Electric characters insert newlines only when, in addition to the
@@ -1578,8 +1672,7 @@ preprocessor commands.
 @findex c-hungry-delete-backwards
 @kindex C-c C-@key{DEL} (C Mode)
 @kindex C-c @key{DEL} (C Mode)
-@code{c-hungry-delete-backwards}---Delete the entire block of whitespace
-preceding point.
+Delete the entire block of whitespace preceding point (@code{c-hungry-delete-backwards}).
 
 @item C-c C-d
 @itemx C-c C-@key{DELETE}
@@ -1588,8 +1681,7 @@ preceding point.
 @kindex C-c C-d (C Mode)
 @kindex C-c C-@key{DELETE} (C Mode)
 @kindex C-c @key{DELETE} (C Mode)
-@code{c-hungry-delete-forward}---Delete the entire block of whitespace
-following point.
+Delete the entire block of whitespace after point (@code{c-hungry-delete-forward}).
 @end table
 
   As an alternative to the above commands, you can enable @dfn{hungry
@@ -1602,9 +1694,7 @@ preceding whitespace, not just one space, and a single @kbd{C-c C-d}
 @item M-x c-toggle-hungry-state
 @findex c-toggle-hungry-state
 Toggle the hungry-delete feature
-(@code{c-toggle-hungry-state})@footnote{This command had the binding
-@kbd{C-c C-d} in earlier versions of Emacs.  @kbd{C-c C-d} is now
-bound to @code{c-hungry-delete-forward}.}.  With a prefix argument,
+(@code{c-toggle-hungry-state}).  With a prefix argument,
 this command turns the hungry-delete feature on if the argument is
 positive, and off if it is negative.
 @end table
@@ -1617,37 +1707,25 @@ hungry-delete feature is enabled.
 @subsection Other Commands for C Mode
 
 @table @kbd
-@item C-c C-w
-@itemx M-x subword-mode
-@findex subword-mode
-Enable (or disable) @dfn{subword mode}.  In subword mode, Emacs's word
-commands recognize upper case letters in
-@samp{StudlyCapsIdentifiers} as word boundaries.  This is indicated by
-the flag @samp{/w} on the mode line after the mode name
-(e.g. @samp{C/law}).  You can even use @kbd{M-x subword-mode} in
-non-CC Mode buffers.
-
-In the GNU project, we recommend using underscores to separate words
-within an identifier in C or C++, rather than using case distinctions.
-
 @item M-x c-context-line-break
 @findex c-context-line-break
 This command inserts a line break and indents the new line in a manner
 appropriate to the context.  In normal code, it does the work of
-@kbd{C-j} (@code{newline-and-indent}), in a C preprocessor line it
-additionally inserts a @samp{\} at the line break, and within comments
-it's like @kbd{M-j} (@code{c-indent-new-comment-line}).
+@key{RET} (@code{newline}), in a C preprocessor line it additionally
+inserts a @samp{\} at the line break, and within comments it's like
+@kbd{M-j} (@code{c-indent-new-comment-line}).
 
 @code{c-context-line-break} isn't bound to a key by default, but it
 needs a binding to be useful.  The following code will bind it to
-@kbd{C-j}.  We use @code{c-initialization-hook} here to make sure
+@kbd{RET}.  We use @code{c-initialization-hook} here to make sure
 the keymap is loaded before we try to change it.
 
-@smallexample
+@example
 (defun my-bind-clb ()
-  (define-key c-mode-base-map "\C-j" 'c-context-line-break))
+  (define-key c-mode-base-map "\C-m"
+              'c-context-line-break))
 (add-hook 'c-initialization-hook 'my-bind-clb)
-@end smallexample
+@end example
 
 @item C-M-h
 Put mark at the end of a function definition, and put point at the
@@ -1692,7 +1770,7 @@ inserted on that line, and any @samp{\} there is deleted.
 @cindex preprocessor highlighting
 @findex cpp-highlight-buffer
 Highlight parts of the text according to its preprocessor conditionals.
-This command displays another buffer named @samp{*CPP Edit*}, which
+This command displays another buffer named @file{*CPP Edit*}, which
 serves as a graphic menu for selecting how to display particular kinds
 of conditionals and their contents.  After changing various settings,
 click on @samp{[A]pply these settings} (or go to that buffer and type
@@ -1764,6 +1842,7 @@ defines these commands:
 @table @kbd
 @item @key{TAB}
 @code{tab-to-tab-stop}.
+@c FIXME: Maybe this should be consistent with other programming modes.
 @item C-j
 Insert a newline and then indent using @code{tab-to-tab-stop}.
 @item :