Another set of changes for the manual
* doc/emacs/programs.texi (Program Indent): Add a cross-reference to elisp's description of 'pp'. (Program Modes): Add a few more programming modes. Add index entries. (Basic Indent, Multi-line Indent, C Indent, Comment Commands) (Manipulating Comments): Fix markup of keyboard commands. * doc/emacs/search.texi (Regexps): Add an example with non-ASCII characters. Suggested by Michael Albinus <michael.albinus@gmx.de> in emacs-manual-bugs@gnu.org. * doc/lispref/display.texi (Display Tables): Fix the description of the 5th extra slot of the display table. (Bug#13473) * doc/emacs/regs.texi (Registers): Simplify wording. * doc/emacs/custom.texi (Init Non-ASCII): Remove outdated text about perils of encoded keyboard input.
This commit is contained in:
parent
78426b84e8
commit
53511f9147
5 changed files with 65 additions and 57 deletions
|
@ -2567,11 +2567,3 @@ instance:
|
||||||
|
|
||||||
@noindent
|
@noindent
|
||||||
Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}.
|
Type @kbd{C-q}, followed by the key you want to bind, to insert @var{char}.
|
||||||
|
|
||||||
@strong{Warning:} if you change the keyboard encoding, or change
|
|
||||||
between multibyte and unibyte mode, or anything that would alter which
|
|
||||||
code @kbd{C-q} would insert for that character, this key binding may
|
|
||||||
stop working. It is therefore advisable to use one and only one
|
|
||||||
coding system, for your init file as well as the files you edit. For
|
|
||||||
example, don't mix the @samp{latin-1} and @samp{latin-9} coding
|
|
||||||
systems.
|
|
||||||
|
|
|
@ -73,23 +73,27 @@ mode for the C programming language is @code{c-mode}.
|
||||||
@cindex Python mode
|
@cindex Python mode
|
||||||
@cindex Ruby mode
|
@cindex Ruby mode
|
||||||
@cindex Simula mode
|
@cindex Simula mode
|
||||||
|
@cindex Verilog mode
|
||||||
@cindex VHDL mode
|
@cindex VHDL mode
|
||||||
@cindex M4 mode
|
@cindex M4 mode
|
||||||
@cindex Shell-script mode
|
@cindex Shell-script mode
|
||||||
|
@cindex Scheme mode
|
||||||
@cindex OPascal mode
|
@cindex OPascal mode
|
||||||
@cindex PostScript mode
|
@cindex PostScript mode
|
||||||
@cindex Conf mode
|
@cindex Conf mode
|
||||||
@cindex DNS mode
|
@cindex DNS mode
|
||||||
@cindex Javascript mode
|
@cindex Javascript mode
|
||||||
|
@cindex Awk mode
|
||||||
Emacs has programming language modes for Lisp, Scheme, the
|
Emacs has programming language modes for Lisp, Scheme, the
|
||||||
Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++,
|
Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++,
|
||||||
Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, Metafont
|
Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, Metafont
|
||||||
(@TeX{}'s companion for font creation), Modula2, Object Pascal, Objective-C,
|
(@TeX{}'s companion for font creation), Modula2, Object Pascal,
|
||||||
Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, Tcl,
|
Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python,
|
||||||
and VHDL@. An alternative mode for Perl is called CPerl mode. Modes are
|
Ruby, Simula, SQL, Tcl, Verilog, and VHDL@. An alternative mode for
|
||||||
also available for the scripting languages of the common GNU and Unix
|
Perl is called CPerl mode. Modes are also available for the scripting
|
||||||
shells, and MS-DOS/MS-Windows @samp{BAT} files, and for makefiles,
|
languages of the common GNU and Unix shells, and MS-DOS/MS-Windows
|
||||||
DNS master files, and various sorts of configuration files.
|
@samp{BAT} files, and for makefiles, DNS master files, and various
|
||||||
|
sorts of configuration files.
|
||||||
|
|
||||||
Ideally, Emacs should have a major mode for each programming
|
Ideally, Emacs should have a major mode for each programming
|
||||||
language that you might want to edit. If it doesn't have a mode for
|
language that you might want to edit. If it doesn't have a mode for
|
||||||
|
@ -100,12 +104,13 @@ distributed with Emacs (@pxref{Packages}); or you can contribute one.
|
||||||
@findex backward-delete-char-untabify
|
@findex backward-delete-char-untabify
|
||||||
In most programming languages, indentation should vary from line to
|
In most programming languages, indentation should vary from line to
|
||||||
line to illustrate the structure of the program. Therefore, in most
|
line to illustrate the structure of the program. Therefore, in most
|
||||||
programming language modes, typing @key{TAB} updates the indentation
|
programming language modes, typing @kbd{@key{TAB}} updates the
|
||||||
of the current line (@pxref{Program Indent}). Furthermore, @key{DEL}
|
indentation of the current line (@pxref{Program Indent}).
|
||||||
is usually bound to @code{backward-delete-char-untabify}, which
|
Furthermore, @kbd{@key{DEL}} is usually bound to
|
||||||
deletes backward treating each tab as if it were the equivalent number
|
@code{backward-delete-char-untabify}, which deletes backward treating
|
||||||
of spaces, so that you can delete one column of indentation without
|
each tab as if it were the equivalent number of spaces, so that you
|
||||||
worrying whether the whitespace consists of spaces or tabs.
|
can delete one column of indentation without worrying whether the
|
||||||
|
whitespace consists of spaces or tabs.
|
||||||
|
|
||||||
@cindex mode hook, and major modes
|
@cindex mode hook, and major modes
|
||||||
@vindex c-mode-hook
|
@vindex c-mode-hook
|
||||||
|
@ -122,13 +127,14 @@ For instance, entering C mode runs the hooks @code{prog-mode-hook} and
|
||||||
@ifnottex
|
@ifnottex
|
||||||
Separate manuals are available for the modes for Ada (@pxref{Top,,
|
Separate manuals are available for the modes for Ada (@pxref{Top,,
|
||||||
Ada Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba
|
Ada Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba
|
||||||
IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}), and IDLWAVE
|
IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}), Octave, VHDL,
|
||||||
(@pxref{Top,, IDLWAVE, idlwave, IDLWAVE User Manual}).
|
and IDLWAVE (@pxref{Top,, IDLWAVE, idlwave, IDLWAVE User Manual}).
|
||||||
@end ifnottex
|
@end ifnottex
|
||||||
@iftex
|
@iftex
|
||||||
The Emacs distribution contains Info manuals for the major modes for
|
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, Octave, VHDL, and
|
||||||
Fortran mode, @pxref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
|
IDLWAVE@. For Fortran mode, @pxref{Fortran,,, emacs-xtra, Specialized
|
||||||
|
Emacs Features}.
|
||||||
@end iftex
|
@end iftex
|
||||||
|
|
||||||
@node Defuns
|
@node Defuns
|
||||||
|
@ -362,6 +368,7 @@ language modes.
|
||||||
@cindex pretty-printer
|
@cindex pretty-printer
|
||||||
Emacs also provides a Lisp pretty-printer in the @code{pp} package,
|
Emacs also provides a Lisp pretty-printer in the @code{pp} package,
|
||||||
which reformats Lisp objects with nice-looking indentation.
|
which reformats Lisp objects with nice-looking indentation.
|
||||||
|
@xref{Output Functions, pp,, elisp, The Emacs Lisp Reference Manual}.
|
||||||
|
|
||||||
@node Basic Indent
|
@node Basic Indent
|
||||||
@subsection Basic Program Indentation Commands
|
@subsection Basic Program Indentation Commands
|
||||||
|
@ -376,16 +383,18 @@ Insert a newline, then adjust indentation of following line
|
||||||
|
|
||||||
@kindex TAB @r{(programming modes)}
|
@kindex TAB @r{(programming modes)}
|
||||||
@findex indent-line-function
|
@findex indent-line-function
|
||||||
The basic indentation command is @key{TAB}
|
The basic indentation command is @kbd{@key{TAB}}
|
||||||
(@code{indent-for-tab-command}), which was documented in
|
(@code{indent-for-tab-command}), which was documented in
|
||||||
@ref{Indentation}. In programming language modes, @key{TAB} indents
|
@ref{Indentation}. In programming language modes, @kbd{@key{TAB}}
|
||||||
the current line, based on the indentation and syntactic content of
|
indents the current line, based on the indentation and syntactic
|
||||||
the preceding lines; if the region is active, @key{TAB} indents each
|
content of the preceding lines; if the region is active,
|
||||||
line within the region, not just the current line.
|
@kbd{@key{TAB}} indents each line within the region, not just the
|
||||||
|
current line.
|
||||||
|
|
||||||
The command @key{RET} (@code{newline}), which was documented in
|
The command @kbd{@key{RET}} (@code{newline}), which was documented
|
||||||
@ref{Inserting Text}, does the same as @kbd{C-j} followed by
|
in @ref{Inserting Text}, does the same as @kbd{C-j} followed by
|
||||||
@key{TAB}: it inserts a new line, then adjusts the line's indentation.
|
@kbd{@key{TAB}}: it inserts a new line, then adjusts the line's
|
||||||
|
indentation.
|
||||||
|
|
||||||
When indenting a line that starts within a parenthetical grouping,
|
When indenting a line that starts within a parenthetical grouping,
|
||||||
Emacs usually places the start of the line under the preceding line
|
Emacs usually places the start of the line under the preceding line
|
||||||
|
@ -406,7 +415,7 @@ Paren}.
|
||||||
|
|
||||||
Sometimes, you may want to reindent several lines of code at a time.
|
Sometimes, you may want to reindent several lines of code at a time.
|
||||||
One way to do this is to use the mark; when the mark is active and the
|
One way to do this is to use the mark; when the mark is active and the
|
||||||
region is non-empty, @key{TAB} indents every line in the region.
|
region is non-empty, @kbd{@key{TAB}} indents every line in the region.
|
||||||
Alternatively, the command @kbd{C-M-\} (@code{indent-region}) indents
|
Alternatively, the command @kbd{C-M-\} (@code{indent-region}) indents
|
||||||
every line in the region, whether or not the mark is active
|
every line in the region, whether or not the mark is active
|
||||||
(@pxref{Indentation Commands}).
|
(@pxref{Indentation Commands}).
|
||||||
|
@ -434,19 +443,19 @@ grouping, without affecting its overall indentation (i.e., the
|
||||||
indentation of the line where the grouping starts). The function that
|
indentation of the line where the grouping starts). The function that
|
||||||
@kbd{C-M-q} runs depends on the major mode; it is
|
@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,
|
@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode,
|
||||||
etc. To correct the overall indentation as well, type @key{TAB}
|
etc. To correct the overall indentation as well, type @kbd{@key{TAB}}
|
||||||
first.
|
first.
|
||||||
|
|
||||||
@kindex C-u TAB
|
@kindex C-u TAB
|
||||||
If you like the relative indentation within a grouping but not the
|
If you like the relative indentation within a grouping but not the
|
||||||
indentation of its first line, move point to that first line and type
|
indentation of its first line, move point to that first line and type
|
||||||
@kbd{C-u @key{TAB}}. In Lisp, C, and some other major modes,
|
@kbd{C-u @key{TAB}}. In Lisp, C, and some other major modes,
|
||||||
@key{TAB} with a numeric argument reindents the current line as usual,
|
@kbd{@key{TAB}} with a numeric argument reindents the current line as
|
||||||
then reindents by the same amount all the lines in the parenthetical
|
usual, then reindents by the same amount all the lines in the
|
||||||
grouping starting on the current line. It is clever, though, and does
|
parenthetical grouping starting on the current line. It is clever,
|
||||||
not alter lines that start inside strings. Neither does it alter C
|
though, and does not alter lines that start inside strings. Neither
|
||||||
preprocessor lines when in C mode, but it does reindent any
|
does it alter C preprocessor lines when in C mode, but it does
|
||||||
continuation lines that may be attached to them.
|
reindent any continuation lines that may be attached to them.
|
||||||
|
|
||||||
@findex indent-code-rigidly
|
@findex indent-code-rigidly
|
||||||
The command @kbd{M-x indent-code-rigidly} rigidly shifts all the
|
The command @kbd{M-x indent-code-rigidly} rigidly shifts all the
|
||||||
|
@ -488,7 +497,7 @@ expression.
|
||||||
You can override the standard pattern in various ways for individual
|
You can override the standard pattern in various ways for individual
|
||||||
functions, according to the @code{lisp-indent-function} property of
|
functions, according to the @code{lisp-indent-function} property of
|
||||||
the function name. This is normally done for macro definitions, using
|
the function name. This is normally done for macro definitions, using
|
||||||
the @code{declare} construct. @xref{Defining Macros,,, elisp, the
|
the @code{declare} construct. @xref{Defining Macros,,, elisp, The
|
||||||
Emacs Lisp Reference Manual}.
|
Emacs Lisp Reference Manual}.
|
||||||
|
|
||||||
@node C Indent
|
@node C Indent
|
||||||
|
@ -496,7 +505,7 @@ Emacs Lisp Reference Manual}.
|
||||||
|
|
||||||
Here are special features for indentation in C mode and related modes:
|
Here are special features for indentation in C mode and related modes:
|
||||||
|
|
||||||
@table @code
|
@table @kbd
|
||||||
@item C-c C-q
|
@item C-c C-q
|
||||||
@kindex C-c C-q @r{(C mode)}
|
@kindex C-c C-q @r{(C mode)}
|
||||||
@findex c-indent-defun
|
@findex c-indent-defun
|
||||||
|
@ -919,8 +928,8 @@ comments. For example, in Lisp code, comments starting with two
|
||||||
semicolons are indented as if they were lines of code, while those
|
semicolons are indented as if they were lines of code, while those
|
||||||
starting with three semicolons are supposed to be aligned to the left
|
starting with three semicolons are supposed to be aligned to the left
|
||||||
margin and are often used for sectioning purposes. Emacs understand
|
margin and are often used for sectioning purposes. Emacs understand
|
||||||
these conventions; for instance, typing @key{TAB} on a comment line
|
these conventions; for instance, typing @kbd{@key{TAB}} on a comment
|
||||||
will indent the comment to the appropriate position.
|
line will indent the comment to the appropriate position.
|
||||||
|
|
||||||
@example
|
@example
|
||||||
;; This function is just an example.
|
;; This function is just an example.
|
||||||
|
@ -956,7 +965,7 @@ Kill comment on current line (@code{comment-kill}).
|
||||||
Set comment column (@code{comment-set-column}).
|
Set comment column (@code{comment-set-column}).
|
||||||
@item @kbd{C-M-j}
|
@item @kbd{C-M-j}
|
||||||
@itemx @kbd{M-j}
|
@itemx @kbd{M-j}
|
||||||
Like @key{RET} followed by inserting and aligning a comment
|
Like @kbd{@key{RET}} followed by inserting and aligning a comment
|
||||||
(@code{comment-indent-new-line}). @xref{Multi-Line Comments}.
|
(@code{comment-indent-new-line}). @xref{Multi-Line Comments}.
|
||||||
@item @kbd{M-x comment-region}
|
@item @kbd{M-x comment-region}
|
||||||
@itemx @kbd{C-c C-c} (in C-like modes)
|
@itemx @kbd{C-c C-c} (in C-like modes)
|
||||||
|
@ -986,8 +995,8 @@ negative argument @var{-n} removes @var{n} delimiters.
|
||||||
current line, @kbd{M-;} adds a new comment to the current line. If
|
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
|
characters), the comment is indented to the same position where
|
||||||
@key{TAB} would indent to (@pxref{Basic Indent}). If the line is
|
@kbd{@key{TAB}} would indent to (@pxref{Basic Indent}). If the line
|
||||||
non-blank, the comment is placed after the last non-whitespace
|
is non-blank, the comment is placed after the last non-whitespace
|
||||||
character on the line; normally, Emacs tries putting it at the column
|
character on the line; normally, Emacs tries putting it at the column
|
||||||
specified by the variable @code{comment-column} (@pxref{Options for
|
specified by the variable @code{comment-column} (@pxref{Options for
|
||||||
Comments}), but if the line already extends past that column, it puts
|
Comments}), but if the line already extends past that column, it puts
|
||||||
|
|
|
@ -18,7 +18,7 @@ or a number (such as @samp{1}); case matters, so register @samp{a} is
|
||||||
not the same as register @samp{A}. You can also set a register in
|
not the same as register @samp{A}. You can also set a register in
|
||||||
non-alphanumeric characters, for instance @samp{*} or @samp{C-d}.
|
non-alphanumeric characters, for instance @samp{*} or @samp{C-d}.
|
||||||
Note, it's not possible to set a register in @samp{C-g} or @samp{ESC},
|
Note, it's not possible to set a register in @samp{C-g} or @samp{ESC},
|
||||||
because these keys are reserved to terminate interactive commands.
|
because these keys are reserved for quitting (@pxref{Quitting}).
|
||||||
|
|
||||||
@findex view-register
|
@findex view-register
|
||||||
A register can store a position, a piece of text, a rectangle, a
|
A register can store a position, a piece of text, a rectangle, a
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
@c -*- coding: utf-8 -*-
|
||||||
@c This is part of the Emacs manual.
|
@c This is part of the Emacs manual.
|
||||||
@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2018 Free Software
|
@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2018 Free Software
|
||||||
@c Foundation, Inc.
|
@c Foundation, Inc.
|
||||||
|
@ -902,7 +903,8 @@ starting and ending characters with a @samp{-} between them. Thus,
|
||||||
@samp{[a-z]} matches any lower-case @acronym{ASCII} letter. Ranges may be
|
@samp{[a-z]} matches any lower-case @acronym{ASCII} letter. Ranges may be
|
||||||
intermixed freely with individual characters, as in @samp{[a-z$%.]},
|
intermixed freely with individual characters, as in @samp{[a-z$%.]},
|
||||||
which matches any lower-case @acronym{ASCII} letter or @samp{$}, @samp{%} or
|
which matches any lower-case @acronym{ASCII} letter or @samp{$}, @samp{%} or
|
||||||
period.
|
period. As another example, @samp{[α-ωί]} matches all lower-case
|
||||||
|
Greek letters.
|
||||||
|
|
||||||
You can also include certain special @dfn{character classes} in a
|
You can also include certain special @dfn{character classes} in a
|
||||||
character set. A @samp{[:} and balancing @samp{:]} enclose a
|
character set. A @samp{[:} and balancing @samp{:]} enclose a
|
||||||
|
|
|
@ -6966,14 +6966,16 @@ means to use the default for that slot, as stated below.
|
||||||
@table @asis
|
@table @asis
|
||||||
@item 0
|
@item 0
|
||||||
The glyph for the end of a truncated screen line (the default for this
|
The glyph for the end of a truncated screen line (the default for this
|
||||||
is @samp{$}). @xref{Glyphs}. On graphical terminals, Emacs uses
|
is @samp{$}). @xref{Glyphs}. On graphical terminals, Emacs by
|
||||||
arrows in the fringes to indicate truncation, so the display table has
|
default uses arrows in the fringes to indicate truncation, so the
|
||||||
no effect.
|
display table has no effect, unless you disable the fringes
|
||||||
|
(@pxref{Fringes,, Window Fringes, emacs, the Gnu Emacs Manual}).
|
||||||
|
|
||||||
@item 1
|
@item 1
|
||||||
The glyph for the end of a continued line (the default is @samp{\}).
|
The glyph for the end of a continued line (the default is @samp{\}).
|
||||||
On graphical terminals, Emacs uses curved arrows in the fringes to
|
On graphical terminals, Emacs by default uses curved arrows in the
|
||||||
indicate continuation, so the display table has no effect.
|
fringes to indicate continuation, so the display table has no effect,
|
||||||
|
unless you disable the fringes.
|
||||||
|
|
||||||
@item 2
|
@item 2
|
||||||
The glyph for indicating a character displayed as an octal character
|
The glyph for indicating a character displayed as an octal character
|
||||||
|
@ -6988,9 +6990,12 @@ default is @samp{...}). @xref{Selective Display}.
|
||||||
|
|
||||||
@item 5
|
@item 5
|
||||||
The glyph used to draw the border between side-by-side windows (the
|
The glyph used to draw the border between side-by-side windows (the
|
||||||
default is @samp{|}). @xref{Splitting Windows}. This takes effect only
|
default is @samp{|}). @xref{Splitting Windows}. This currently has
|
||||||
when there are no scroll bars; if scroll bars are supported and in use,
|
effect only on text terminals; on graphical terminals, if vertical
|
||||||
a scroll bar separates the two windows.
|
scroll bars are supported and in use, a scroll bar separates the two
|
||||||
|
windows, and if there are no vertical scroll bars and no dividers
|
||||||
|
(@pxref{Window Dividers}), Emacs uses a thin line to indicate the
|
||||||
|
border.
|
||||||
@end table
|
@end table
|
||||||
|
|
||||||
For example, here is how to construct a display table that mimics
|
For example, here is how to construct a display table that mimics
|
||||||
|
|
Loading…
Add table
Reference in a new issue