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:
Eli Zaretskii 2018-02-14 21:00:59 +02:00
parent 78426b84e8
commit 53511f9147
5 changed files with 65 additions and 57 deletions

View file

@ -2567,11 +2567,3 @@ instance:
@noindent
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.

View file

@ -73,23 +73,27 @@ mode for the C programming language is @code{c-mode}.
@cindex Python mode
@cindex Ruby mode
@cindex Simula mode
@cindex Verilog mode
@cindex VHDL mode
@cindex M4 mode
@cindex Shell-script mode
@cindex Scheme mode
@cindex OPascal mode
@cindex PostScript mode
@cindex Conf mode
@cindex DNS mode
@cindex Javascript mode
@cindex Awk mode
Emacs has programming language modes for Lisp, Scheme, the
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, 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, and MS-DOS/MS-Windows @samp{BAT} files, and for makefiles,
DNS master files, and various sorts of configuration files.
(@TeX{}'s companion for font creation), Modula2, Object Pascal,
Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python,
Ruby, Simula, SQL, Tcl, Verilog, 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, and MS-DOS/MS-Windows
@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
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
In most programming languages, indentation should vary from line to
line to illustrate the structure of the program. Therefore, in most
programming language modes, typing @key{TAB} updates the indentation
of the current line (@pxref{Program Indent}). Furthermore, @key{DEL}
is usually bound to @code{backward-delete-char-untabify}, which
deletes backward treating each tab as if it were the equivalent number
of spaces, so that you can delete one column of indentation without
worrying whether the whitespace consists of spaces or tabs.
programming language modes, typing @kbd{@key{TAB}} updates the
indentation of the current line (@pxref{Program Indent}).
Furthermore, @kbd{@key{DEL}} is usually bound to
@code{backward-delete-char-untabify}, which deletes backward treating
each tab as if it were the equivalent number of spaces, so that you
can delete one column of indentation without worrying whether the
whitespace consists of spaces or tabs.
@cindex mode hook, and major modes
@vindex c-mode-hook
@ -122,13 +127,14 @@ For instance, entering C mode runs the hooks @code{prog-mode-hook} and
@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}).
IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}), Octave, VHDL,
and IDLWAVE (@pxref{Top,, IDLWAVE, idlwave, IDLWAVE User Manual}).
@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, @pxref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
Ada, C/C++/Objective C/Java/Corba IDL/Pike/AWK, Octave, VHDL, and
IDLWAVE@. For Fortran mode, @pxref{Fortran,,, emacs-xtra, Specialized
Emacs Features}.
@end iftex
@node Defuns
@ -362,6 +368,7 @@ language modes.
@cindex pretty-printer
Emacs also provides a Lisp pretty-printer in the @code{pp} package,
which reformats Lisp objects with nice-looking indentation.
@xref{Output Functions, pp,, elisp, The Emacs Lisp Reference Manual}.
@node Basic Indent
@subsection Basic Program Indentation Commands
@ -376,16 +383,18 @@ Insert a newline, then adjust indentation of following line
@kindex TAB @r{(programming modes)}
@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
@ref{Indentation}. In programming language modes, @key{TAB} indents
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.
@ref{Indentation}. In programming language modes, @kbd{@key{TAB}}
indents the current line, based on the indentation and syntactic
content of the preceding lines; if the region is active,
@kbd{@key{TAB}} indents each line within the region, not just the
current line.
The command @key{RET} (@code{newline}), which was documented 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.
The command @kbd{@key{RET}} (@code{newline}), which was documented
in @ref{Inserting Text}, does the same as @kbd{C-j} followed by
@kbd{@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
@ -406,7 +415,7 @@ Paren}.
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
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
every line in the region, whether or not the mark is active
(@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
@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,
etc. To correct the overall indentation as well, type @key{TAB}
etc. To correct the overall indentation as well, type @kbd{@key{TAB}}
first.
@kindex C-u TAB
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
@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,
then reindents by the same amount all the lines in the parenthetical
grouping starting on the current line. It is clever, though, and does
not alter lines that start inside strings. Neither does it alter C
preprocessor lines when in C mode, but it does reindent any
continuation lines that may be attached to them.
@kbd{@key{TAB}} with a numeric argument reindents the current line as
usual, then reindents by the same amount all the lines in the
parenthetical grouping starting on the current line. It is clever,
though, and does not alter lines that start inside strings. Neither
does it alter C preprocessor lines when in C mode, but it does
reindent any continuation lines that may be attached to them.
@findex indent-code-rigidly
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
functions, according to the @code{lisp-indent-function} property of
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}.
@node C Indent
@ -496,7 +505,7 @@ Emacs Lisp Reference Manual}.
Here are special features for indentation in C mode and related modes:
@table @code
@table @kbd
@item C-c C-q
@kindex C-c C-q @r{(C mode)}
@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
starting with three semicolons are supposed to be aligned to the left
margin and are often used for sectioning purposes. Emacs understand
these conventions; for instance, typing @key{TAB} on a comment line
will indent the comment to the appropriate position.
these conventions; for instance, typing @kbd{@key{TAB}} on a comment
line will indent the comment to the appropriate position.
@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}).
@item @kbd{C-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}.
@item @kbd{M-x comment-region}
@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
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
@kbd{@key{TAB}} would indent to (@pxref{Basic Indent}). If the line
is non-blank, the comment is placed after the last non-whitespace
character on the line; normally, Emacs tries putting it at the column
specified by the variable @code{comment-column} (@pxref{Options for
Comments}), but if the line already extends past that column, it puts

View file

@ -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
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},
because these keys are reserved to terminate interactive commands.
because these keys are reserved for quitting (@pxref{Quitting}).
@findex view-register
A register can store a position, a piece of text, a rectangle, a

View file

@ -1,3 +1,4 @@
@c -*- coding: utf-8 -*-
@c This is part of the Emacs manual.
@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2018 Free Software
@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
intermixed freely with individual characters, as in @samp{[a-z$%.]},
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
character set. A @samp{[:} and balancing @samp{:]} enclose a

View file

@ -6966,14 +6966,16 @@ means to use the default for that slot, as stated below.
@table @asis
@item 0
The glyph for the end of a truncated screen line (the default for this
is @samp{$}). @xref{Glyphs}. On graphical terminals, Emacs uses
arrows in the fringes to indicate truncation, so the display table has
no effect.
is @samp{$}). @xref{Glyphs}. On graphical terminals, Emacs by
default uses arrows in the fringes to indicate truncation, so the
display table has no effect, unless you disable the fringes
(@pxref{Fringes,, Window Fringes, emacs, the Gnu Emacs Manual}).
@item 1
The glyph for the end of a continued line (the default is @samp{\}).
On graphical terminals, Emacs uses curved arrows in the fringes to
indicate continuation, so the display table has no effect.
On graphical terminals, Emacs by default uses curved arrows in the
fringes to indicate continuation, so the display table has no effect,
unless you disable the fringes.
@item 2
The glyph for indicating a character displayed as an octal character
@ -6988,9 +6990,12 @@ default is @samp{...}). @xref{Selective Display}.
@item 5
The glyph used to draw the border between side-by-side windows (the
default is @samp{|}). @xref{Splitting Windows}. This takes effect only
when there are no scroll bars; if scroll bars are supported and in use,
a scroll bar separates the two windows.
default is @samp{|}). @xref{Splitting Windows}. This currently has
effect only on text terminals; on graphical terminals, if vertical
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
For example, here is how to construct a display table that mimics