@c This is part of the Emacs manual.
-@c Copyright (C) 1985-1987, 1993-1995, 1997, 1999-2012
-@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
@chapter Editing Programs
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
+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.
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
+Ada, C/C++/Objective C/Java/Corba IDL/Pike/AWK, and IDLWAVE@. For
Fortran mode, @pxref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
-@end ifnotinfo
+@end iftex
@node Defuns
@section Top-Level Definitions, or Defuns
@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
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
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,
@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.
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-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
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
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
@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
@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:
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
+(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