]> code.delx.au - gnu-emacs/blobdiff - doc/emacs/programs.texi
Minor edits for Face Attributes section of display.texi
[gnu-emacs] / doc / emacs / programs.texi
index c88535a076b8000748dc1020942be705c87e6e5b..3c9611a05a023e11d90d8b67a25526c54ffae43f 100644 (file)
@@ -1,15 +1,15 @@
 @c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 1999-2011
+@c Copyright (C) 1985-1987, 1993-1995, 1997, 1999-2012
 @c   Free Software 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
@@ -38,8 +38,8 @@ Highlight program syntax (@pxref{Font Lock}).
 * Glasses::             Making identifiersLikeThis more readable.
 * Semantic::            Suite of editing tools based on source code parsing.
 * 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.
@@ -128,8 +128,7 @@ IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}), and IDLWAVE
 @ifnotinfo
   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.
+Fortran mode, @pxref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
 @end ifnotinfo
 
 @node Defuns
@@ -186,15 +185,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
@@ -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
 
@@ -944,7 +949,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).
@@ -1076,8 +1081,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,14 +1106,14 @@ 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.
 
 @node Man Page
 @subsection Man Page Lookup
 
-@cindex manual page
+@cindex man page
   On Unix, the main form of on-line documentation was the @dfn{manual
 page} or @dfn{man page}.  In the GNU operating system, we aim to
 replace man pages with better-organized manuals that you can browse
@@ -1118,71 +1122,51 @@ still useful to read manual pages.
 
 @findex manual-entry
   You can read the man page for an operating system command, library
-function, or system call, with the @kbd{M-x man} command.  It
-runs the @code{man} program to format the man page; if the system
-permits, it runs @code{man} asynchronously, so that you can keep on
-editing while the page is being formatted.  (On MS-DOS and MS-Windows
-3, you cannot edit while Emacs waits for @code{man} to finish.)  The
-result goes in a buffer named @samp{*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 page buffer.
+function, or system call, with the @kbd{M-x man} command.  This
+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 @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.
 
 @cindex sections of manual pages
   Each man page belongs to one of ten or more @dfn{sections}, each
-named by a digit or by a digit and a letter.  Sometimes there are
-multiple man pages with the same name in different sections.  To read
-a man page from a specific section, type
-@samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}}
-when @kbd{M-x manual-entry} prompts for the topic.  For example, to
-read the man page for the C library function @code{chmod} (as opposed
-to a command of the same name), type @kbd{M-x manual-entry @key{RET}
-chmod(2) @key{RET}}.  (@code{chmod} is a system call, so it is in
-section @samp{2}.)
+named by a digit or by a digit and a letter.  Sometimes there are man
+pages with the same name in different sections.  To read a man page
+from a specific section, type @samp{@var{topic}(@var{section})} or
+@samp{@var{section} @var{topic}} when @kbd{M-x manual-entry} prompts
+for the topic.  For example, the man page for the C library function
+@code{chmod} is in section 2, but there is a shell command of the same
+name, whose man page is in section 1; to view the former, type
+@kbd{M-x manual-entry @key{RET} chmod(2) @key{RET}}.
 
 @vindex Man-switches
-  If you do not specify a section, the results depend on how the
-@code{man} program works on your system.  Some of them display only
-the first man page they find.  Others display all man pages that have
-the specified name, so you can move between them with the @kbd{M-n}
-and @kbd{M-p} keys@footnote{On some systems, the @code{man} program
-accepts a @samp{-a} command-line option which tells it to display all
-the man pages for the specified topic.  If you want this behavior, you
-can add this option to the value of the variable @code{Man-switches}.}.
-The mode line shows how many manual pages are present in the Man buffer.
-
-@vindex Man-fontify-manpage-flag
-  By default, Emacs highlights the text in man pages.  For a long man
-page, highlighting can take substantial time.  You can turn off
-highlighting of man pages by setting the variable
-@code{Man-fontify-manpage-flag} to @code{nil}.
-
-@findex Man-fontify-manpage
-  If you insert the text of a man page into an Emacs buffer in some
-other fashion, you can use the command @kbd{M-x Man-fontify-manpage} to
-perform the same conversions that @kbd{M-x manual-entry} does.
+@kindex M-n @r{(Man mode)}
+@kindex M-p @r{(Man mode)}
+  If you do not specify a section, @kbd{M-x man} normally displays
+only the first man page found.  On some systems, the @code{man}
+program accepts a @samp{-a} command-line option, which tells it to
+display all the man pages for the specified topic.  To make use of
+this, change the value of the variable @code{Man-switches} to
+@samp{"-a"}.  Then, in the Man mode buffer, you can type @kbd{M-n} and
+@kbd{M-p} to switch between man pages in different sections.  The mode
+line shows how many manual pages are available.
 
 @findex woman
 @cindex manual pages, on MS-DOS/MS-Windows
   An alternative way of reading manual pages is the @kbd{M-x woman}
-command@footnote{The name of the command, @code{woman}, is an acronym
-for ``w/o (without) man,'' since it doesn't use the @code{man}
-program.}.  Unlike @kbd{M-x man}, it does not run any external
-programs to format and display the man pages; instead it does the job
-in Emacs Lisp, so it works on systems such as MS-Windows, where the
-@code{man} program (and other programs it uses) are not generally
-available.
-
-  @kbd{M-x woman} prompts for a name of a manual page, and provides
-completion based on the list of manual pages that are installed on
-your machine; the list of available manual pages is computed
-automatically the first time you invoke @code{woman}.  The word at
-point in the current buffer is used to suggest the default for the
-name of the manual page.
-
-  With a numeric argument, @kbd{M-x woman} recomputes the list of the
-manual pages used for completion.  This is useful if you add or delete
-manual pages.
+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 @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
+this list; this is useful if you add or delete manual pages.
 
   If you type a name of a manual page and @kbd{M-x woman} finds that
 several manual pages by the same name exist in different sections, it
@@ -1201,42 +1185,40 @@ the WoMan Info manual, which is distributed with Emacs.
 @node Lisp Doc
 @subsection Emacs Lisp Documentation Lookup
 
-  As you edit Lisp code to be run in Emacs, you can use the commands
-@kbd{C-h f} (@code{describe-function}) and @kbd{C-h v}
-(@code{describe-variable}) to view documentation of functions and
-variables that you want to use.  These commands use the minibuffer to
-read the name of a function or variable to document, and display the
-documentation in a window.  Their default arguments are based on the
-code in the neighborhood of point.  For @kbd{C-h f}, the default is
-the function called in the innermost list containing point.  @kbd{C-h
-v} uses the symbol name around or adjacent to point as its default.
+  When editing Emacs Lisp code, you can use the commands @kbd{C-h f}
+(@code{describe-function}) and @kbd{C-h v} (@code{describe-variable})
+to view the built-in documentation for the Lisp functions and
+variables that you want to use.  @xref{Name Help}.
 
 @cindex Eldoc mode
 @findex eldoc-mode
-  A more automatic but less powerful method is Eldoc mode.  This minor
-mode constantly displays in the echo area the argument list for the
-function being called at point.  (In other words, it finds the
-function call that point is contained in, and displays the argument
-list of that function.)  If point is over a documented variable, it
-shows the first line of the variable's docstring.  Eldoc mode applies
-in Emacs Lisp and Lisp Interaction modes, and perhaps a few others
-that provide special support for looking up doc strings.  Use the
-command @kbd{M-x eldoc-mode} to enable or disable this feature.
+  Eldoc is a buffer-local minor mode that helps with looking up Lisp
+documention.  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
+toggle Eldoc mode, type @kbd{M-x eldoc-mode}.  Eldoc mode can be used
+with the Emacs Lisp and Lisp Interaction major modes.
 
 @node Hideshow
 @section Hideshow minor mode
+@cindex Hideshow mode
+@cindex mode, Hideshow
 
 @findex hs-minor-mode
-  Hideshow minor mode provides selective display of portions of a
-program, known as @dfn{blocks}.  You can use @kbd{M-x hs-minor-mode}
-to enable or disable this mode, or add @code{hs-minor-mode} to the
-mode hook for certain major modes in order to enable it automatically
-for those modes.
+  Hideshow mode is a buffer-local minor mode that allows you to
+selectively display portions of a program, which are referred to as
+@dfn{blocks}.  Type @kbd{M-x hs-minor-mode} to toggle this minor mode
+(@pxref{Minor Modes}).
+
+  When you use Hideshow mode to hide a block, the block disappears
+from the screen, to be replaced by an ellipsis (three periods in a
+row).  Just what constitutes a block depends on the major mode.  In C
+mode and related modes, blocks are delimited by braces, while in Lisp
+mode they are delimited by parentheses.  Multi-line comments also
+count as blocks.
 
-  Just what constitutes a block depends on the major mode.  In C mode
-or C++ mode, they are delimited by braces, while in Lisp mode and
-similar modes they are delimited by parentheses.  Multi-line comments
-also count as blocks.
+  Hideshow mode provides the following commands:
 
 @findex hs-hide-all
 @findex hs-hide-block
@@ -1260,11 +1242,11 @@ Show the current block (@code{hs-show-block}).
 @item C-c @@ C-c
 Either hide or show the current block (@code{hs-toggle-hiding}).
 @item S-Mouse-2
-Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}).
+Toggle hiding for the block you click on (@code{hs-mouse-toggle-hiding}).
 @item C-c @@ C-M-h
 Hide all top-level blocks (@code{hs-hide-all}).
 @item C-c @@ C-M-s
-Show everything in the buffer (@code{hs-show-all}).
+Show all blocks in the buffer (@code{hs-show-all}).
 @item C-c @@ C-l
 Hide all blocks @var{n} levels below this block
 (@code{hs-hide-level}).
@@ -1273,80 +1255,55 @@ Hide all blocks @var{n} levels below this block
 @vindex hs-hide-comments-when-hiding-all
 @vindex hs-isearch-open
 @vindex hs-special-modes-alist
-  These variables exist for customizing Hideshow mode.
+  These variables can be used to customize Hideshow mode:
 
 @table @code
 @item hs-hide-comments-when-hiding-all
-Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too.
+If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides
+comments too.
 
 @item hs-isearch-open
-Specifies what kind of hidden blocks incremental search should make
-visible.  The value should be one of these four symbols:
-
-@table @code
-@item code
-Open only code blocks.
-@item comment
-Open only comments.
-@item t
-Open both code blocks and comments.
-@item nil
-Open neither code blocks nor comments.
-@end table
-
-@item hs-special-modes-alist
-A list of elements, each specifying how to initialize Hideshow
-variables for one major mode.  See the variable's documentation string
-for more information.
+This variable specifies the conditions under which incremental search
+should unhide a hidden block when matching text occurs within the
+block.  Its value should be either @code{code} (unhide only code
+blocks), @code{comment} (unhide only comments), @code{t} (unhide both
+code blocks and comments), or @code{nil} (unhide neither code blocks
+nor comments).  The default value is @code{code}.
 @end table
 
 @node Symbol Completion
 @section Completion for Symbol Names
 @cindex completion (symbol names)
 
-  In Emacs, completion is something you normally do in the minibuffer
-(@pxref{Completion}).  But one kind of completion is available in all
-buffers: completion for symbol names.
+  Completion is normally done in the minibuffer (@pxref{Completion}),
+but you can also complete symbol names in ordinary Emacs buffers.
 
 @kindex M-TAB
-  The character @kbd{M-@key{TAB}} runs a command to complete the
-partial symbol before point against the set of meaningful symbol
-names.  This command inserts at point any additional characters that
-it can determine from the partial name.
-
-  If your window manager defines @kbd{M-@key{TAB}} to switch windows,
-you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead.
-However, most window managers let you customize these shortcuts, so
-you can change any that interfere with the way you use Emacs.
-
-  If the partial name in the buffer has multiple possible completions
-that differ in the very next character, so that it is impossible to
-complete even one more character, @kbd{M-@key{TAB}} displays a list of
-all possible completions in another window.
+@kindex C-M-i
+  In programming language modes, type @kbd{C-M-i} or @kbd{M-@key{TAB}}
+to complete the partial symbol before point.  On graphical displays,
+the @kbd{M-@key{TAB}} key is usually reserved by the window manager
+for switching graphical windows, so you should type @kbd{C-M-i} or
+@kbd{@key{ESC} @key{TAB}} instead.
 
 @cindex tags-based completion
-@cindex Info index completion
-@findex complete-symbol
-  In most programming language major modes, @kbd{M-@key{TAB}} runs the
-command @code{complete-symbol}, which provides two kinds of completion.
-Normally it does completion based on a tags table (@pxref{Tags}); with a
-numeric argument (regardless of the value), it does completion based on
-the names listed in the Info file indexes for your language.  Thus, to
-complete the name of a symbol defined in your own program, use
-@kbd{M-@key{TAB}} with no argument; to complete the name of a standard
-library function, use @kbd{C-u M-@key{TAB}}.  Of course, Info-based
-completion works only if there is an Info file for the standard library
-functions of your language, and only if it is installed at your site.
-
+@findex completion-at-point
 @cindex Lisp symbol completion
 @cindex completion (Lisp symbols)
-@findex lisp-complete-symbol
-  In Emacs-Lisp mode, the name space for completion normally consists of
-nontrivial symbols present in Emacs---those that have function
-definitions, values or properties.  However, if there is an
-open-parenthesis immediately before the beginning of the partial symbol,
-only symbols with function definitions are considered as completions.
-The command which implements this is @code{lisp-complete-symbol}.
+  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
+unique symbol, it displays a list of completion alternatives in
+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}.
@@ -1354,20 +1311,20 @@ based on the spell-checker's dictionary.  @xref{Spelling}.
 @node Glasses
 @section Glasses minor mode
 @cindex Glasses mode
-@cindex identifiers, making long ones readable
-@cindex StudlyCaps, making them readable
-@findex glasses-mode
-
-  Glasses minor mode makes @samp{unreadableIdentifiersLikeThis}
-readable by altering the way they display.  It knows two different
-ways to do this: by displaying underscores between a lower-case letter
-and the following capital letter, and by emboldening the capital
-letters.  It does not alter the buffer text, only the way they
-display, so you can use it even on read-only buffers.  You can use the
-command @kbd{M-x glasses-mode} to enable or disable the mode in the
-current buffer; you can also add @code{glasses-mode} to the mode hook
-of the programming language major modes in which you normally want
-to use Glasses mode.
+@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.
+
+  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}}.
 
 @node Semantic
 @section Semantic
@@ -1383,14 +1340,16 @@ see @ref{Top, Semantic,, semantic, Semantic}.
 see the Semantic Info manual, which is distributed with Emacs.
 @end iftex
 
-  Most of the ``language aware'' features in Emacs, such as font lock
-(@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular
+  Most of the ``language aware'' features in Emacs, such as Font Lock
+mode (@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular
 expressions and syntax tables.} that usually give good results but are
 never completely exact.  In contrast, the parsers used by Semantic
 have an exact understanding of programming language syntax.  This
 allows Semantic to provide search, navigation, and completion commands
 that are powerful and precise.
 
+@cindex Semantic mode
+@cindex mode, Semantic
   To begin using Semantic, type @kbd{M-x semantic-mode} or click on
 the menu item named @samp{Source Code Parsers (Semantic)} in the
 @samp{Tools} menu.  This enables Semantic mode, a global minor mode.
@@ -1438,27 +1397,31 @@ is idle.
 @node Misc for Programs
 @section Other Features Useful for Editing Programs
 
-  A number of Emacs commands that aren't designed specifically for
-editing programs are useful for that nonetheless.
+  Some Emacs commands that aren't designed specifically for editing
+programs are useful for that nonetheless.
 
   The Emacs commands that operate on words, sentences and paragraphs
 are useful for editing code.  Most symbols names contain words
-(@pxref{Words}); sentences can be found in strings and comments
-(@pxref{Sentences}).  Paragraphs in the strict sense can be found in
-program code (in long comments), but the paragraph commands are useful
-in other places too, because programming language major modes define
-paragraphs to begin and end at blank lines (@pxref{Paragraphs}).
-Judicious use of blank lines to make the program clearer will also
-provide useful chunks of text for the paragraph commands to work on.
-Auto Fill mode, if enabled in a programming language major mode,
-indents the new lines which it creates.
-
-  The selective display feature is useful for looking at the overall
-structure of a function (@pxref{Selective Display}).  This feature
-hides the lines that are indented more than a specified amount.
-Programming modes often support Outline minor mode (@pxref{Outline
-Mode}).  The Foldout package provides folding-editor features
-(@pxref{Foldout}).
+(@pxref{Words}), while sentences can be found in strings and comments
+(@pxref{Sentences}).  As for paragraphs, they are defined in most
+programming language modes to begin and end at blank lines
+(@pxref{Paragraphs}).  Therefore, judicious use of blank lines to make
+the program clearer will also provide useful chunks of text for the
+paragraph commands to work on.  Auto Fill mode, if enabled in a
+programming language major mode, indents the new lines which it
+creates.
+
+@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
+support Outline minor mode (@pxref{Outline Mode}), which can be used
+with the Foldout package (@pxref{Foldout}).
 
 @ifinfo
   The ``automatic typing'' features may be useful for writing programs.
@@ -1485,7 +1448,7 @@ Mode}).  The Foldout package provides folding-editor features
 
   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
@@ -1509,17 +1472,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)}
@@ -1587,8 +1550,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
@@ -1625,8 +1588,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}
@@ -1635,8 +1597,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
@@ -1649,9 +1610,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
@@ -1690,11 +1649,11 @@ 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
 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))
 (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
@@ -1739,7 +1698,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