aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJoakim Verona2011-07-15 04:39:29 +0200
committerJoakim Verona2011-07-15 04:39:29 +0200
commit4f616a2e7ed1db28da98df90266e9751a8ae9ee1 (patch)
tree74a9dcbe13e945e712ae04a4a94c2202ca720591 /doc
parentff2be00005c3aeda6e11d7ed264ce86f02b60958 (diff)
parentec2bc542a4d0127425625e8cb458684bd825675a (diff)
downloademacs-4f616a2e7ed1db28da98df90266e9751a8ae9ee1.tar.gz
emacs-4f616a2e7ed1db28da98df90266e9751a8ae9ee1.zip
merge from upstream
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog158
-rw-r--r--doc/emacs/Makefile.in2
-rw-r--r--doc/emacs/ack.texi18
-rw-r--r--doc/emacs/cmdargs.texi31
-rw-r--r--doc/emacs/custom.texi189
-rw-r--r--doc/emacs/dired.texi18
-rw-r--r--doc/emacs/display.texi8
-rw-r--r--doc/emacs/emacs.texi74
-rw-r--r--doc/emacs/fortran-xtra.texi9
-rw-r--r--doc/emacs/frames.texi223
-rw-r--r--doc/emacs/glossary.texi5
-rw-r--r--doc/emacs/help.texi13
-rw-r--r--doc/emacs/indent.texi2
-rw-r--r--doc/emacs/killing.texi344
-rw-r--r--doc/emacs/kmacro.texi4
-rw-r--r--doc/emacs/major.texi237
-rw-r--r--doc/emacs/makefile.w32-in2
-rw-r--r--doc/emacs/mark.texi15
-rw-r--r--doc/emacs/misc.texi178
-rw-r--r--doc/emacs/modes.texi410
-rw-r--r--doc/emacs/msdog.texi8
-rw-r--r--doc/emacs/mule.texi5
-rw-r--r--doc/emacs/picture-xtra.texi3
-rw-r--r--doc/emacs/programs.texi5
-rw-r--r--doc/emacs/regs.texi26
-rw-r--r--doc/emacs/screen.texi32
-rw-r--r--doc/emacs/search.texi13
-rw-r--r--doc/emacs/text.texi103
-rw-r--r--doc/emacs/trouble.texi11
-rw-r--r--doc/lispref/ChangeLog135
-rw-r--r--doc/lispref/commands.texi35
-rw-r--r--doc/lispref/customize.texi233
-rw-r--r--doc/lispref/display.texi59
-rw-r--r--doc/lispref/elisp.texi6
-rw-r--r--doc/lispref/frames.texi78
-rw-r--r--doc/lispref/functions.texi13
-rw-r--r--doc/lispref/help.texi11
-rw-r--r--doc/lispref/keymaps.texi11
-rw-r--r--doc/lispref/modes.texi24
-rw-r--r--doc/lispref/objects.texi4
-rw-r--r--doc/lispref/searching.texi6
-rw-r--r--doc/lispref/streams.texi6
-rw-r--r--doc/lispref/strings.texi14
-rw-r--r--doc/lispref/syntax.texi2
-rw-r--r--doc/lispref/text.texi22
-rw-r--r--doc/lispref/variables.texi52
-rw-r--r--doc/lispref/vol1.texi2
-rw-r--r--doc/lispref/vol2.texi2
-rw-r--r--doc/man/ChangeLog4
-rw-r--r--doc/man/emacsclient.13
-rw-r--r--doc/misc/ChangeLog56
-rw-r--r--doc/misc/cc-mode.texi150
-rw-r--r--doc/misc/cl.texi42
-rw-r--r--doc/misc/ediff.texi12
-rw-r--r--doc/misc/gnus.texi46
-rw-r--r--doc/misc/org.texi20
-rw-r--r--doc/misc/tramp.texi6
-rw-r--r--doc/misc/widget.texi1
58 files changed, 1820 insertions, 1381 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index 26cce9b2ac9..531bf206a80 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,161 @@
12011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * trouble.texi (Checklist): Use an `M-x' example instead of an
4 Emacs Lisp form to switch on the dribble file (bug#8056).
5
62011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
7
8 * custom.texi (Hooks): Mention buffer-local hooks (bug#6218).
9
102011-07-13 Glenn Morris <rgm@gnu.org>
11
12 * dired.texi (Dired Enter): Mention --dired. (Bug#9039)
13
142011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
15
16 * mark.texi (Mark Ring): Clarify how many locations are saved
17 (bug#5770).
18 (Global Mark Ring): Ditto.
19
202011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
21
22 * text.texi (Table Recognition): Use "at point" instead of "under
23 point" (bug#4345).
24
25 * display.texi (Cursor Display): Mention `cursor-type'.
26
27 * screen.texi (Point): Clarify that it's only if you use a block
28 cursor that it appears to be on a character (bug#4345).
29
302011-07-12 Chong Yidong <cyd@stupidchicken.com>
31
32 * misc.texi (Amusements): Move dissociated press here, from its
33 own section.
34
35 * emacs.texi (Top): Update node listing.
36
372011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
38
39 * emacs.texi (Top): Change "inferiors" to "subnodes" for greater
40 clarity (bug#3523).
41
422011-07-12 Chong Yidong <cyd@stupidchicken.com>
43
44 * cmdargs.texi (Initial Options): Document --no-site-lisp.
45 (Misc X): Document --parent-id.
46
47 * frames.texi (Frame Commands): Note that focus-follows-mouse now
48 defaults to nil.
49
50 * misc.texi (emacsclient Options): Document --parent-id.
51
52 * msdog.texi (Windows HOME): Document _emacs as obsolete.
53
542011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
55
56 * emacs.texi: Use "..." instead of ``...'' in the menus
57 (bug#3503).
58
592011-07-11 Chong Yidong <cyd@stupidchicken.com>
60
61 * killing.texi (Primary Selection): Document `only' setting for
62 select-active-regions.
63
64 * mark.texi (Setting Mark): Reference Shift Selection node.
65
66 * frames.texi (Mouse Commands): Document mouse-yank-primary.
67
682011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
69
70 * mark.texi (Setting Mark): Clarify what's meant by "Shifted
71 motion keys" (bug#3503).
72
73 * emacs.texi: Change all the register node names from "RegPos"
74 (etc.) to "Positional Registers" (etc.) (bug#3314).
75
762011-07-11 Chong Yidong <cyd@stupidchicken.com>
77
78 * killing.texi (Killing, Deletion and Killing, Killing by Lines)
79 (Other Kill Commands, Kill Options): Copyedits.
80 (Deletion and Killing, Kill Ring): Kill/yank now use clipboard.
81 (Yanking): Move yank-excluded properties discussion here.
82 (Cut and Paste): Move from frames.texi. Update subnodes to
83 describe x-select-enable-clipboard case.
84
85 * frames.texi: Move Cut and Paste node and subnodes into
86 killing.texi, except Mouse Commands and Word and Line Mouse.
87
882011-07-10 Andy Moreton <andrewjmoreton@gmail.com> (tiny change)
89
90 * makefile.w32-in (EMACSSOURCES): Replace major.texi with modes.texi.
91
922011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
93
94 * screen.texi (Mode Line): Clarify that coding systems are
95 characters, not letters (bug#1749).
96
97 * cmdargs.texi (Environment): Mention removing variables
98 (bug#1615). Text suggested by Kevin Rodgers.
99
1002011-07-10 Chong Yidong <cyd@stupidchicken.com>
101
102 * misc.texi (Amusements): Don't mention Yow; it's crippled.
103
104 * modes.texi: Rename from major.texi.
105 (Modes): New node. Make Major Modes and Minor Modes subsections
106 of this. All callers changed.
107
108 * custom.texi (Minor Modes): Move to modes.texi.
109
1102011-07-10 Chong Yidong <cyd@stupidchicken.com>
111
112 * custom.texi (Syntax): Node deleted.
113
114 * help.texi (Help Summary):
115 * major.texi (Major Modes):
116 * programs.texi (Parentheses):
117 * search.texi (Regexp Backslash, Regexp Backslash)
118 (Regexp Backslash):
119 * text.texi (Words): Callers changed.
120
121 * text.texi (Refill, Longlines): Delete nodes.
122
123 * ack.texi (Acknowledgments): Longlines removed from manual.
124
125 * emacs.texi (Top): Update node listing.
126
1272011-07-09 Glenn Morris <rgm@gnu.org>
128
129 * fortran-xtra.texi (Fortran): Update handled extensions.
130
1312011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
132
133 * display.texi (Scrolling): `C-v' (etc) are now bound to
134 `scroll-*-command' (bug#8349).
135
1362011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
137
138 * dired.texi (Subdirectories in Dired): Clarify that `C-u k'
139 doesn't actually delete any files (bug#7125).
140
141 * picture-xtra.texi (Rectangles in Picture): Clarify the prefix
142 argument for `C-c C-k' (bug#7391).
143
144 * frames.texi (Fonts): Mention "C-u C-x =" to find out what font
145 you're currently using (bug#8489).
146
1472011-07-01 Eli Zaretskii <eliz@gnu.org>
148
149 * mule.texi (Coding Systems): Move index entries from the previous
150 change into their proper places.
151
1522011-07-01 Lars Magne Ingebrigtsen <larsi@gnus.org>
153
154 * help.texi (Help Files): Document view-external-packages (bug#8902).
155
156 * mule.texi (Coding Systems): Put a few more of the coding systems
157 into the index (bug#8900).
158
12011-06-26 Glenn Morris <rgm@gnu.org> 1592011-06-26 Glenn Morris <rgm@gnu.org>
2 160
3 * fortran-xtra.texi (Fortran): F90 mode is also for F2008. 161 * fortran-xtra.texi (Fortran): F90 mode is also for F2008.
diff --git a/doc/emacs/Makefile.in b/doc/emacs/Makefile.in
index aca17ce817d..9465c726eba 100644
--- a/doc/emacs/Makefile.in
+++ b/doc/emacs/Makefile.in
@@ -84,7 +84,7 @@ EMACSSOURCES= \
84 ${srcdir}/windows.texi \ 84 ${srcdir}/windows.texi \
85 ${srcdir}/frames.texi \ 85 ${srcdir}/frames.texi \
86 ${srcdir}/mule.texi \ 86 ${srcdir}/mule.texi \
87 ${srcdir}/major.texi \ 87 ${srcdir}/modes.texi \
88 ${srcdir}/indent.texi \ 88 ${srcdir}/indent.texi \
89 ${srcdir}/text.texi \ 89 ${srcdir}/text.texi \
90 ${srcdir}/programs.texi \ 90 ${srcdir}/programs.texi \
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index e554c71703f..1cfb3d9ffe9 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -190,9 +190,7 @@ prior to Emacs 23 for Mac OS.
190 190
191@item 191@item
192Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many 192Chong Yidong was the Emacs co-maintainer for Emacs 23. He made many
193improvements to the Emacs display engine; and, together with Kai 193improvements to the Emacs display engine.
194Großjohann and Alex Schroeder, wrote @file{longlines.el}, a minor
195mode for wrapping long lines.
196 194
197@item 195@item
198James Clark wrote SGML mode, a mode for editing SGML documents; and 196James Clark wrote SGML mode, a mode for editing SGML documents; and
@@ -689,14 +687,12 @@ the current window on which point is; @file{cap-words.el}, a minor mode
689for motion in ``CapitalizedWordIdentifiers''; @file{latin1-disp.el}, a 687for motion in ``CapitalizedWordIdentifiers''; @file{latin1-disp.el}, a
690package that lets you display ISO 8859 characters on Latin-1 terminals 688package that lets you display ISO 8859 characters on Latin-1 terminals
691by setting up appropriate display tables; @file{python.el}, a major mode 689by setting up appropriate display tables; @file{python.el}, a major mode
692for the Python programming language; @file{refill.el}, a mode for 690for the Python programming language; @file{smiley.el}, a facility for
693automatic paragraph refilling, akin to typical word processors; 691displaying smiley faces; @file{sym-comp.el}, a library for performing
694@file{smiley.el}, a facility for displaying smiley faces; 692mode-dependent symbol completion; @file{benchmark.el} for timing code
695@file{sym-comp.el}, a library for performing mode-dependent symbol 693execution; and @file{tool-bar.el}, a mode to control the display of
696completion; @file{benchmark.el} for timing code execution; and 694the Emacs tool bar. With Riccardo Murri he wrote @file{vc-bzr.el},
697@file{tool-bar.el}, a mode to control the display of the Emacs tool bar. 695support for the Bazaar version control system.
698With Riccardo Murri he wrote @file{vc-bzr.el}, support for the Bazaar
699version control system.
700 696
701@item 697@item
702Eric Ludlam wrote the Speedbar package; @file{checkdoc.el}, for checking 698Eric Ludlam wrote the Speedbar package; @file{checkdoc.el}, for checking
diff --git a/doc/emacs/cmdargs.texi b/doc/emacs/cmdargs.texi
index 1c3b85559d2..2a19e1b009d 100644
--- a/doc/emacs/cmdargs.texi
+++ b/doc/emacs/cmdargs.texi
@@ -289,9 +289,14 @@ like this, the Customize facility does not allow options to be saved
289@item --no-site-file 289@item --no-site-file
290@opindex --no-site-file 290@opindex --no-site-file
291@cindex @file{site-start.el} file, not loading 291@cindex @file{site-start.el} file, not loading
292Do not load @file{site-start.el}. The options @samp{-q}, @samp{-u} 292Do not load @file{site-start.el} (@pxref{Init File}). The @samp{-Q}
293and @samp{--batch} have no effect on the loading of this file---this 293option does this too, but other options like @samp{-q} do not.
294option and @samp{-Q} are the only options that block it. 294
295@item --no-site-lisp
296@opindex --no-site-lisp
297@cindex @file{site-start.el} file, not loading
298Do not include the @file{site-lisp} directories in @code{load-path}
299(@pxref{Init File}). The @samp{-Q} option does this too.
295 300
296@item --no-splash 301@item --no-splash
297@opindex --no-splash 302@opindex --no-splash
@@ -307,9 +312,9 @@ in your initialization file (@pxref{Entering Emacs}).
307@itemx --quick 312@itemx --quick
308@opindex --quick 313@opindex --quick
309Start emacs with minimum customizations, similar to using @samp{-q}, 314Start emacs with minimum customizations, similar to using @samp{-q},
310@samp{--no-site-file}, and @samp{--no-splash} together. This also 315@samp{--no-site-file}, @samp{--no-site-lisp}, and @samp{--no-splash}
311stops Emacs from processing X resources by setting 316together. This also stops Emacs from processing X resources by
312@code{inhibit-x-resources} to @code{t} (@pxref{Resources}). 317setting @code{inhibit-x-resources} to @code{t} (@pxref{Resources}).
313 318
314@item -daemon 319@item -daemon
315@opindex -daemon 320@opindex -daemon
@@ -427,10 +432,11 @@ software) inherit the environment from Emacs, too.
427@vindex initial-environment 432@vindex initial-environment
428 Inside Emacs, the command @kbd{M-x getenv} gets the value of an 433 Inside Emacs, the command @kbd{M-x getenv} gets the value of an
429environment variable. @kbd{M-x setenv} sets a variable in the Emacs 434environment variable. @kbd{M-x setenv} sets a variable in the Emacs
430environment. (Environment variable substitutions with @samp{$} work 435environment, and @kbd{C-u M-x setenv} removes a variable.
431in the value just as in file names; see @ref{File Names with $}.) The 436(Environment variable substitutions with @samp{$} work in the value
432variable @code{initial-environment} stores the initial environment 437just as in file names; see @ref{File Names with $}.) The variable
433inherited by Emacs. 438@code{initial-environment} stores the initial environment inherited by
439Emacs.
434 440
435 The way to set environment variables outside of Emacs depends on the 441 The way to set environment variables outside of Emacs depends on the
436operating system, and especially the shell that you are using. For 442operating system, and especially the shell that you are using. For
@@ -1130,6 +1136,11 @@ use---usually just a small rectangle containing the frame's title.
1130@c Enable horizontal scroll bars. Since horizontal scroll bars 1136@c Enable horizontal scroll bars. Since horizontal scroll bars
1131@c are not yet implemented, this actually does nothing. 1137@c are not yet implemented, this actually does nothing.
1132 1138
1139@item --parent-id @var{ID}
1140Open Emacs as a client X window via the XEmbed protocol, with @var{ID}
1141as the parent X window id. Currently, this option is mainly useful
1142for developers.
1143
1133@item -vb 1144@item -vb
1134@opindex -vb 1145@opindex -vb
1135@itemx --vertical-scroll-bars 1146@itemx --vertical-scroll-bars
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 434c574ac42..6a6d465438d 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -23,169 +23,16 @@ Reference Manual}.
23@end ifnottex 23@end ifnottex
24 24
25@menu 25@menu
26* Minor Modes:: Each minor mode is a feature you can turn on
27 independently of any others.
28* Easy Customization:: Convenient way to browse and change settings. 26* Easy Customization:: Convenient way to browse and change settings.
29* Variables:: Many Emacs commands examine Emacs variables 27* Variables:: Many Emacs commands examine Emacs variables
30 to decide what to do; by setting variables, 28 to decide what to do; by setting variables,
31 you can control their functioning. 29 you can control their functioning.
32* Key Bindings:: The keymaps say what command each key runs. 30* Key Bindings:: The keymaps say what command each key runs.
33 By changing them, you can "redefine keys". 31 By changing them, you can "redefine keys".
34* Syntax:: The syntax table controls how words and
35 expressions are parsed.
36* Init File:: How to write common customizations in the 32* Init File:: How to write common customizations in the
37 @file{.emacs} file. 33 @file{.emacs} file.
38@end menu 34@end menu
39 35
40@node Minor Modes
41@section Minor Modes
42@cindex minor modes
43@cindex mode, minor
44
45 Minor modes are optional features which you can turn on or off. For
46example, Auto Fill mode is a minor mode in which @key{SPC} breaks
47lines between words as you type. Minor modes are independent of one
48another and of the selected major mode. Most minor modes say in the
49mode line when they are enabled; for example, @samp{Fill} in the mode
50line means that Auto Fill mode is enabled.
51
52 Each minor mode is associated with a command, called the @dfn{mode
53command}, which turns it on or off. The name of this command consists
54of the name of the minor mode, followed by @samp{-mode}; for instance,
55the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling
56the minor mode command with no prefix argument @dfn{toggles} the mode,
57turning it on if it was off, and off if it was on. A positive
58argument always turns the mode on, and a zero or negative argument
59always turns it off. Mode commands are usually invoked with
60@kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key
61Bindings}).
62
63 Most minor modes also have a @dfn{mode variable}, with the same name
64as the mode command. Its value is non-@code{nil} if the mode is
65enabled, and @code{nil} if it is disabled. In some minor modes---but
66not all---the value of the variable alone determines whether the mode
67is active: the mode command works simply by setting the variable, and
68changing the value of the variable has the same effect as calling the
69mode command. Because not all minor modes work this way, we recommend
70that you avoid changing the mode variables directly; use the mode
71commands instead.
72
73 Some minor modes are @dfn{buffer-local}: they apply only to the
74current buffer, so you can enable the mode in certain buffers and not
75others. Other minor modes are @dfn{global}: while enabled, they
76affect everything you do in the Emacs session, in all buffers. Some
77global minor modes are enabled by default.
78
79 The following is a list of some buffer-local minor modes:
80
81@itemize @bullet
82@item
83Abbrev mode automatically expands text based on pre-defined
84abbreviation definitions. @xref{Abbrevs}.
85
86@item
87Auto Fill mode inserts newlines as you type to prevent lines from
88becoming too long. @xref{Filling}.
89
90@item
91Auto Save mode saves the buffer contents periodically to reduce the
92amount of work you can lose in case of a crash. @xref{Auto Save}.
93
94@item
95Enriched mode enables editing and saving of formatted text.
96@xref{Formatted Text}.
97
98@item
99Flyspell mode automatically highlights misspelled words.
100@xref{Spelling}.
101
102@item
103Font-Lock mode automatically highlights certain textual units found in
104programs. It is enabled globally by default, but you can disable it
105in individual buffers. @xref{Faces}.
106
107@findex linum-mode
108@cindex Linum mode
109@item
110Linum mode displays each line's line number in the window's left
111margin. Its mode command is @code{linum-mode}.
112
113@item
114Outline minor mode provides similar facilities to the major mode
115called Outline mode. @xref{Outline Mode}.
116
117@cindex Overwrite mode
118@cindex mode, Overwrite
119@findex overwrite-mode
120@kindex INSERT
121@item
122Overwrite mode causes ordinary printing characters to replace existing
123text instead of shoving it to the right. For example, if point is in
124front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing
125a @kbd{G} changes it to @samp{FOOGAR}, instead of producing
126@samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q}
127inserts the next character whatever it may be, even if it is a
128digit---this gives you a way to insert a character instead of
129replacing an existing character. The mode command,
130@code{overwrite-mode}, is bound to the @key{Insert} key.
131
132@findex binary-overwrite-mode
133@item
134Binary Overwrite mode is a variant of Overwrite mode for editing
135binary files; it treats newlines and tabs like other characters, so
136that they overwrite other characters and can be overwritten by them.
137In Binary Overwrite mode, digits after @kbd{C-q} specify an octal
138character code, as usual.
139
140@item
141Visual Line mode performs ``word wrapping'', causing long lines to be
142wrapped at word boundaries. @xref{Visual Line Mode}.
143@end itemize
144
145 Here are some useful global minor modes. Since Line Number mode and
146Transient Mark mode can be enabled or disabled just by setting the
147value of the minor mode variable, you @emph{can} set them differently
148for particular buffers, by explicitly making the corresponding
149variable local in those buffers. @xref{Locals}.
150
151@itemize @bullet
152@item
153Column Number mode enables display of the current column number in the
154mode line. @xref{Mode Line}.
155
156@item
157Delete Selection mode causes text insertion to first delete the text
158in the region, if the region is active. @xref{Using Region}.
159
160@item
161Icomplete mode displays an indication of available completions when
162you are in the minibuffer and completion is active. @xref{Completion
163Options}.
164
165@item
166Line Number mode enables display of the current line number in the
167mode line. It is enabled by default. @xref{Mode Line}.
168
169@item
170Menu Bar mode gives each frame a menu bar. It is enabled by default.
171@xref{Menu Bars}.
172
173@item
174Scroll Bar mode gives each window a scroll bar. It is enabled by
175default, but the scroll bar is only displayed on graphical terminals.
176@xref{Scroll Bars}.
177
178@item
179Tool Bar mode gives each frame a tool bar. It is enabled by default,
180but the tool bar is only displayed on graphical terminals. @xref{Tool
181Bars}.
182
183@item
184Transient Mark mode highlights the region, and makes many Emacs
185commands operate on the region when the mark is active. It is enabled
186by default. @xref{Mark}.
187@end itemize
188
189@node Easy Customization 36@node Easy Customization
190@section Easy Customization Interface 37@section Easy Customization Interface
191 38
@@ -973,6 +820,12 @@ the versions you added will remain in the hook variable together. You
973can clear out individual functions by calling @code{remove-hook}, or 820can clear out individual functions by calling @code{remove-hook}, or
974do @code{(setq @var{hook-variable} nil)} to remove everything. 821do @code{(setq @var{hook-variable} nil)} to remove everything.
975 822
823@cindex buffer-local hooks
824 If the hook variable is buffer-local, the buffer-local variable will
825be used instead of the global variable. However, if the buffer-local
826variable contains the element @code{t}, the global hook variable will
827be run as well.
828
976@node Locals 829@node Locals
977@subsection Local Variables 830@subsection Local Variables
978 831
@@ -2085,36 +1938,6 @@ invoke it; disabling also applies if the command is invoked using
2085@kbd{M-x}. However, disabling a command has no effect on calling it 1938@kbd{M-x}. However, disabling a command has no effect on calling it
2086as a function from Lisp programs. 1939as a function from Lisp programs.
2087 1940
2088@node Syntax
2089@section The Syntax Table
2090@cindex syntax table
2091
2092 All the Emacs commands which parse words or balance parentheses are
2093controlled by the @dfn{syntax table}. The syntax table says which
2094characters are opening delimiters, which are parts of words, which are
2095string quotes, and so on. It does this by assigning each character to
2096one of fifteen-odd @dfn{syntax classes}. In some cases it specifies
2097some additional information also.
2098
2099 Each major mode has its own syntax table (though related major modes
2100sometimes share one syntax table), which it installs in each buffer
2101that uses the mode. The syntax table installed in the current buffer
2102is the one that all commands use, so we call it ``the'' syntax table.
2103
2104@kindex C-h s
2105@findex describe-syntax
2106 To display a description of the contents of the current syntax
2107table, type @kbd{C-h s} (@code{describe-syntax}). The description of
2108each character includes the string you would have to give to
2109@code{modify-syntax-entry} to set up that character's current syntax,
2110starting with the character which designates its syntax class, plus
2111some English text to explain its meaning.
2112
2113 A syntax table is actually a Lisp object, a char-table, whose
2114elements are cons cells. For full information on the syntax table,
2115see @ref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp
2116Reference Manual}.
2117
2118@node Init File 1941@node Init File
2119@section The Init File, @file{~/.emacs} 1942@section The Init File, @file{~/.emacs}
2120@cindex init file 1943@cindex init file
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index 2f274d7a324..501c4152e6a 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -81,6 +81,13 @@ specified, the @code{ls} switches can include short options (that is,
81single characters) requiring no arguments, and long options (starting 81single characters) requiring no arguments, and long options (starting
82with @samp{--}) whose arguments are specified with @samp{=}. 82with @samp{--}) whose arguments are specified with @samp{=}.
83 83
84@vindex dired-use-ls-dired
85 Note that Dired automatically adds the option @samp{--dired}, if
86your @code{ls} program supports it, unless you explicitly set
87the variable @code{dired-use-ls-dired} to @code{nil}. Without this
88option, Dired will have trouble parsing some @samp{unusual} file-names.
89See the documentation of @code{dired-use-ls-dired} for more details.
90
84 On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls}; 91 On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls};
85see @ref{ls in Lisp}, for options and peculiarities of that emulation. 92see @ref{ls in Lisp}, for options and peculiarities of that emulation.
86 93
@@ -984,8 +991,9 @@ to the parent directory in the same Dired buffer.
984 991
985Use the @kbd{l} command (@code{dired-do-redisplay}) to update the 992Use the @kbd{l} command (@code{dired-do-redisplay}) to update the
986subdirectory's contents. Use @kbd{C-u k} on the subdirectory header 993subdirectory's contents. Use @kbd{C-u k} on the subdirectory header
987line to delete the subdirectory (@pxref{Dired Updating}). You can also 994line to remove the subdirectory listing (@pxref{Dired Updating}). You
988hide and show inserted subdirectories (@pxref{Hiding Subdirectories}). 995can also hide and show inserted subdirectories (@pxref{Hiding
996Subdirectories}).
989 997
990@ifnottex 998@ifnottex
991@include dired-xtra.texi 999@include dired-xtra.texi
@@ -1145,9 +1153,9 @@ current file as a last resort.
1145 1153
1146 If you use @kbd{k} with a numeric prefix argument to kill the line 1154 If you use @kbd{k} with a numeric prefix argument to kill the line
1147for a file that is a directory, which you have inserted in the Dired 1155for a file that is a directory, which you have inserted in the Dired
1148buffer as a subdirectory, it deletes that subdirectory from the buffer 1156buffer as a subdirectory, it removed that subdirectory line from the
1149as well. Typing @kbd{C-u k} on the header line for a subdirectory 1157buffer as well. Typing @kbd{C-u k} on the header line for a
1150also deletes the subdirectory from the Dired buffer. 1158subdirectory also removes the subdirectory line from the Dired buffer.
1151 1159
1152 The @kbd{g} command brings back any individual lines that you have 1160 The @kbd{g} command brings back any individual lines that you have
1153killed in this way, but not subdirectories---you must use @kbd{i} to 1161killed in this way, but not subdirectories---you must use @kbd{i} to
diff --git a/doc/emacs/display.texi b/doc/emacs/display.texi
index 3cec3e8fb8b..bfbfb355c9c 100644
--- a/doc/emacs/display.texi
+++ b/doc/emacs/display.texi
@@ -61,11 +61,11 @@ order; also, maybe redisplay the screen (@code{recenter-top-bottom}).
61@item C-v 61@item C-v
62@itemx @key{next} 62@itemx @key{next}
63@itemx @key{PageDown} 63@itemx @key{PageDown}
64Scroll forward by nearly a full window (@code{scroll-up}). 64Scroll forward by nearly a full window (@code{scroll-up-command}).
65@item M-v 65@item M-v
66@itemx @key{prior} 66@itemx @key{prior}
67@itemx @key{PageUp} 67@itemx @key{PageUp}
68Scroll backward (@code{scroll-down}). 68Scroll backward (@code{scroll-down-command}).
69@item C-M-l 69@item C-M-l
70Scroll heuristically to bring useful information onto the screen 70Scroll heuristically to bring useful information onto the screen
71(@code{reposition-window}). 71(@code{reposition-window}).
@@ -1211,6 +1211,10 @@ terminal itself blinks the cursor, and Emacs has no control over it.)
1211You can control how the cursor appears when it blinks off by setting 1211You can control how the cursor appears when it blinks off by setting
1212the variable @code{blink-cursor-alist}. 1212the variable @code{blink-cursor-alist}.
1213 1213
1214@vindex cursor-type
1215 You can change the shape of the cursor from the default ``box'' look
1216to a bar by altering the @code{cursor-type} variable.
1217
1214@vindex visible-cursor 1218@vindex visible-cursor
1215 Some text terminals offer two different cursors: the normal cursor 1219 Some text terminals offer two different cursors: the normal cursor
1216and the very visible cursor, where the latter may be e.g. bigger or 1220and the very visible cursor, where the latter may be e.g. bigger or
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index ed7d48877e5..e8fb42db0bb 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -164,19 +164,18 @@ Fundamental Editing Commands
164* Help:: Commands for asking Emacs about its commands. 164* Help:: Commands for asking Emacs about its commands.
165 165
166Important Text-Changing Commands 166Important Text-Changing Commands
167* Mark:: The mark: how to delimit a ``region'' of text. 167* Mark:: The mark: how to delimit a "region" of text.
168* Killing:: Killing (cutting) text. 168* Killing:: Killing (cutting) text.
169* Yanking:: Recovering killed text. Moving text. (Pasting.) 169* Yanking:: Recovering killed text. Moving text. (Pasting.)
170* Cut and Paste:: Clipboard and selections on graphical displays.
170* Accumulating Text:: Other ways of copying text. 171* Accumulating Text:: Other ways of copying text.
171* Rectangles:: Operating on the text inside a rectangle on the screen. 172* Rectangles:: Operating on text in rectangular areas.
172* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} for copy 173* CUA Bindings:: Using @kbd{C-x}, @kbd{C-c}, @kbd{C-v} to kill and yank.
173 and paste, with enhanced rectangle support.
174* Registers:: Saving a text string or a location in the buffer. 174* Registers:: Saving a text string or a location in the buffer.
175* Display:: Controlling what text is displayed. 175* Display:: Controlling what text is displayed.
176* Search:: Finding or replacing occurrences of a string. 176* Search:: Finding or replacing occurrences of a string.
177* Fixit:: Commands especially useful for fixing typos. 177* Fixit:: Commands especially useful for fixing typos.
178* Keyboard Macros:: A keyboard macro records a sequence of 178* Keyboard Macros:: Recording a sequence of keystrokes to be replayed.
179 keystrokes to be replayed with a single command.
180 179
181Major Structures of Emacs 180Major Structures of Emacs
182* Files:: All about handling files. 181* Files:: All about handling files.
@@ -186,13 +185,13 @@ Major Structures of Emacs
186* International:: Using non-@acronym{ASCII} character sets. 185* International:: Using non-@acronym{ASCII} character sets.
187 186
188Advanced Features 187Advanced Features
189* Major Modes:: Text mode vs. Lisp mode vs. C mode... 188* Modes:: Major and minor modes alter Emacs' basic behavior.
190* Indentation:: Editing the white space at the beginnings of lines. 189* Indentation:: Editing the white space at the beginnings of lines.
191* Text:: Commands and modes for editing English. 190* Text:: Commands and modes for editing English.
192* Programs:: Commands and modes for editing programs. 191* Programs:: Commands and modes for editing programs.
193* Building:: Compiling, running and debugging programs. 192* Building:: Compiling, running and debugging programs.
194* Maintaining:: Features for maintaining large programs. 193* Maintaining:: Features for maintaining large programs.
195* Abbrevs:: How to define text abbreviations to reduce 194* Abbrevs:: Defining text abbreviations to reduce
196 the number of characters you must type. 195 the number of characters you must type.
197@c AFAICS, the tex stuff generates its own index and does not use this one. 196@c AFAICS, the tex stuff generates its own index and does not use this one.
198@ifnottex 197@ifnottex
@@ -201,12 +200,12 @@ Advanced Features
201@end ifnottex 200@end ifnottex
202* Sending Mail:: Sending mail in Emacs. 201* Sending Mail:: Sending mail in Emacs.
203* Rmail:: Reading mail in Emacs. 202* Rmail:: Reading mail in Emacs.
204* Dired:: You can ``edit'' a directory to manage files in it. 203* Dired:: You can "edit" a directory to manage files in it.
205* Calendar/Diary:: The calendar and diary facilities. 204* Calendar/Diary:: The calendar and diary facilities.
206* Document View:: Viewing PDF, PS and DVI files. 205* Document View:: Viewing PDF, PS and DVI files.
207* Gnus:: How to read netnews with Emacs. 206* Gnus:: A flexible mail and news reader.
208* Shell:: Executing shell commands from Emacs. 207* Shell:: Executing shell commands from Emacs.
209* Emacs Server:: Using Emacs as an editing server for @code{mail}, etc. 208* Emacs Server:: Using Emacs as an editing server.
210* Printing:: Printing hardcopies of buffers or regions. 209* Printing:: Printing hardcopies of buffers or regions.
211* Sorting:: Sorting lines, paragraphs or pages within Emacs. 210* Sorting:: Sorting lines, paragraphs or pages within Emacs.
212* Narrowing:: Restricting display and editing to a portion 211* Narrowing:: Restricting display and editing to a portion
@@ -220,7 +219,6 @@ Advanced Features
220 "recursive editing level". 219 "recursive editing level".
221* Emulation:: Emulating some other editors with Emacs. 220* Emulation:: Emulating some other editors with Emacs.
222* Hyperlinking:: Following links in buffers. 221* Hyperlinking:: Following links in buffers.
223* Dissociated Press:: Dissociating text for fun.
224* Amusements:: Various games and hacks. 222* Amusements:: Various games and hacks.
225* Customization:: Modifying the behavior of Emacs. 223* Customization:: Modifying the behavior of Emacs.
226 224
@@ -252,7 +250,7 @@ Appendices
252 --- The Detailed Node Listing --- 250 --- The Detailed Node Listing ---
253 --------------------------------- 251 ---------------------------------
254 252
255Here are some other nodes which are really inferiors of the ones 253Here are some other nodes which are really subnodes of the ones
256already listed, mentioned here so you can get to them in one step: 254already listed, mentioned here so you can get to them in one step:
257 255
258The Organization of the Screen 256The Organization of the Screen
@@ -331,15 +329,21 @@ Yanking
331* Appending Kills:: Several kills in a row all yank together. 329* Appending Kills:: Several kills in a row all yank together.
332* Earlier Kills:: Yanking something killed some time ago. 330* Earlier Kills:: Yanking something killed some time ago.
333 331
332Killing and Yanking on Graphical Displays
333
334* Clipboard:: How Emacs interacts with the system clipboard.
335* Primary Selection:: The temporarily selected text selection.
336* Secondary Selection:: Cutting without altering point and mark.
337
334Registers 338Registers
335 339
336* RegPos:: Saving positions in registers. 340* Position Registers:: Saving positions in registers.
337* RegText:: Saving text in registers. 341* Text Registers:: Saving text in registers.
338* RegRect:: Saving rectangles in registers. 342* Rectangle Registers:: Saving rectangles in registers.
339* RegConfig:: Saving window configurations in registers. 343* Configuration Registers:: Saving window configurations in registers.
340* RegNumbers:: Numbers in registers. 344* Number Registers:: Numbers in registers.
341* RegFiles:: File names in registers. 345* File Registers:: File names in registers.
342* Bookmarks:: Bookmarks are like registers, but persistent. 346* Bookmarks:: Bookmarks are like registers, but persistent.
343 347
344Controlling the Display 348Controlling the Display
345 349
@@ -495,7 +499,8 @@ Multiple Windows
495 499
496Frames and Graphical Displays 500Frames and Graphical Displays
497 501
498* Cut and Paste:: Mouse commands for cut and paste. 502* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
503* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
499* Mouse References:: Using the mouse to select an item from a list. 504* Mouse References:: Using the mouse to select an item from a list.
500* Menu Mouse Clicks:: Mouse clicks that bring up menus. 505* Menu Mouse Clicks:: Mouse clicks that bring up menus.
501* Mode Line Mouse:: Mouse clicks on the mode line. 506* Mode Line Mouse:: Mouse clicks on the mode line.
@@ -517,14 +522,6 @@ Frames and Graphical Displays
517* Non-Window Terminals:: Multiple frames on terminals that show only one. 522* Non-Window Terminals:: Multiple frames on terminals that show only one.
518* Text-Only Mouse:: Using the mouse in text-only terminals. 523* Text-Only Mouse:: Using the mouse in text-only terminals.
519 524
520Killing and Yanking on Graphical Displays
521
522* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
523* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
524* Cut/Paste Other App:: Transfering text between Emacs and other apps.
525* Secondary Selection:: Cutting without altering point and mark.
526* Clipboard:: Using the clipboard for selections.
527
528International Character Set Support 525International Character Set Support
529 526
530* International Chars:: Basic concepts of multibyte characters. 527* International Chars:: Basic concepts of multibyte characters.
@@ -551,9 +548,12 @@ International Character Set Support
551 to use without multibyte characters. 548 to use without multibyte characters.
552* Charsets:: How Emacs groups its internal character codes. 549* Charsets:: How Emacs groups its internal character codes.
553 550
554Major Modes 551Modes
555 552
556* Choosing Modes:: How major modes are specified or chosen. 553* Major Modes:: Text mode vs. Lisp mode vs. C mode...
554* Minor Modes:: Each minor mode is a feature you can turn on
555 independently of any others.
556* Choosing Modes:: How modes are chosen when visiting files.
557 557
558Indentation 558Indentation
559 559
@@ -585,8 +585,6 @@ Filling Text
585* Fill Prefix:: Filling paragraphs that are indented 585* Fill Prefix:: Filling paragraphs that are indented
586 or in a comment, etc. 586 or in a comment, etc.
587* Adaptive Fill:: How Emacs can determine the fill prefix automatically. 587* Adaptive Fill:: How Emacs can determine the fill prefix automatically.
588* Refill:: Keeping paragraphs filled.
589* Longlines:: Editing text with very long lines.
590 588
591Outline Mode 589Outline Mode
592 590
@@ -1062,16 +1060,12 @@ Hyperlinking and Navigation Features
1062 1060
1063Customization 1061Customization
1064 1062
1065* Minor Modes:: Each minor mode is a feature you can turn on
1066 independently of any others.
1067* Easy Customization:: Convenient way to browse and change settings. 1063* Easy Customization:: Convenient way to browse and change settings.
1068* Variables:: Many Emacs commands examine Emacs variables 1064* Variables:: Many Emacs commands examine Emacs variables
1069 to decide what to do; by setting variables, 1065 to decide what to do; by setting variables,
1070 you can control their functioning. 1066 you can control their functioning.
1071* Key Bindings:: The keymaps say what command each key runs. 1067* Key Bindings:: Keymaps say what command each key runs.
1072 By changing them, you can "redefine keys". 1068 By changing them, you can "redefine" keys.
1073* Syntax:: The syntax table controls how words and
1074 expressions are parsed.
1075* Init File:: How to write common customizations in the 1069* Init File:: How to write common customizations in the
1076 @file{.emacs} file. 1070 @file{.emacs} file.
1077 1071
@@ -1491,7 +1485,7 @@ Lisp programming.
1491@include windows.texi 1485@include windows.texi
1492@include frames.texi 1486@include frames.texi
1493@include mule.texi 1487@include mule.texi
1494@include major.texi 1488@include modes.texi
1495@include indent.texi 1489@include indent.texi
1496@include text.texi 1490@include text.texi
1497@c Includes fortran-xtra. 1491@c Includes fortran-xtra.
diff --git a/doc/emacs/fortran-xtra.texi b/doc/emacs/fortran-xtra.texi
index b7a4ef973ea..ee417624120 100644
--- a/doc/emacs/fortran-xtra.texi
+++ b/doc/emacs/fortran-xtra.texi
@@ -18,10 +18,11 @@ format'') source code (normally Fortran 77). For editing more modern
18``free form'' source code (Fortran 90, 95, 2003, 2008), use F90 mode 18``free form'' source code (Fortran 90, 95, 2003, 2008), use F90 mode
19(@code{f90-mode}). Emacs normally uses Fortran mode for files with 19(@code{f90-mode}). Emacs normally uses Fortran mode for files with
20extension @samp{.f}, @samp{.F} or @samp{.for}, and F90 mode for the 20extension @samp{.f}, @samp{.F} or @samp{.for}, and F90 mode for the
21extensions @samp{.f90} and @samp{.f95}. Customize 21extensions @samp{.f90}, @samp{.f95}, @samp{.f03} and @samp{.f08}.
22@code{auto-mode-alist} to add more extensions. GNU Fortran supports 22Customize @code{auto-mode-alist} to add more extensions. GNU Fortran
23both free and fixed form. This manual mainly documents Fortran mode, 23supports both free and fixed form. This manual mainly documents Fortran
24but the corresponding F90 mode features are mentioned when revelant. 24mode, but the corresponding F90 mode features are mentioned when
25revelant.
25 26
26 Fortran mode provides special motion commands for Fortran statements 27 Fortran mode provides special motion commands for Fortran statements
27and subprograms, and indentation commands that understand Fortran 28and subprograms, and indentation commands that understand Fortran
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 298a7d4598b..b9b56670988 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -33,7 +33,8 @@ so that you can use many of the features described in this chapter.
33@end ifnottex 33@end ifnottex
34 34
35@menu 35@menu
36* Cut and Paste:: Mouse commands for cut and paste. 36* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
37* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
37* Mouse References:: Using the mouse to select an item from a list. 38* Mouse References:: Using the mouse to select an item from a list.
38* Menu Mouse Clicks:: Mouse clicks that bring up menus. 39* Menu Mouse Clicks:: Mouse clicks that bring up menus.
39* Mode Line Mouse:: Mouse clicks on the mode line. 40* Mode Line Mouse:: Mouse clicks on the mode line.
@@ -56,22 +57,8 @@ so that you can use many of the features described in this chapter.
56* Text-Only Mouse:: Using the mouse in text-only terminals. 57* Text-Only Mouse:: Using the mouse in text-only terminals.
57@end menu 58@end menu
58 59
59@node Cut and Paste
60@section Cutting and Pasting on Graphical Displays
61
62 This section describes commands for selecting a region, cutting, and
63pasting using the mouse.
64
65@menu
66* Mouse Commands:: Moving, cutting, and pasting, with the mouse.
67* Word and Line Mouse:: Mouse commands for selecting whole words or lines.
68* Cut/Paste Other App:: Transfering text between Emacs and other apps.
69* Secondary Selection:: Cutting without altering point and mark.
70* Clipboard:: Using the clipboard for selections.
71@end menu
72
73@node Mouse Commands 60@node Mouse Commands
74@subsection Mouse Commands for Editing 61@section Mouse Commands for Editing
75@cindex mouse buttons (what they do) 62@cindex mouse buttons (what they do)
76 63
77@kindex Mouse-1 64@kindex Mouse-1
@@ -132,16 +119,21 @@ entirely on the screen. The number of lines scrolled per step depends
132on how far away from the window edge the mouse has gone; the variable 119on how far away from the window edge the mouse has gone; the variable
133@code{mouse-scroll-min-lines} specifies a minimum step size. 120@code{mouse-scroll-min-lines} specifies a minimum step size.
134 121
122@findex mouse-yank-primary
135@findex mouse-yank-at-click 123@findex mouse-yank-at-click
136@vindex mouse-yank-at-point
137 Clicking with the middle mouse button, @kbd{Mouse-2}, moves point to 124 Clicking with the middle mouse button, @kbd{Mouse-2}, moves point to
138the position where you clicked and performs a yank 125the position where you clicked and inserts the contents of the primary
139(@code{mouse-yank-at-click}). @xref{Yanking}. If you change the 126selection (@code{mouse-yank-primary}). @xref{Primary Selection}.
140variable @code{mouse-yank-at-point} to a non-@code{nil} value, 127This behavior is consistent with other X applications; alternatively,
141@kbd{Mouse-2} does not move point. Then it does not matter where you 128you can rebind @kbd{Mouse-2} to @code{mouse-yank-at-click}, which
142click, or even which of the frame's windows you click on; the yank 129performs a yank at point.
143occurs at the existing point. This variable also affects yanking the 130
144primary and secondary selections (@pxref{Cut/Paste Other App}). 131@vindex mouse-yank-at-point
132 If you change the variable @code{mouse-yank-at-point} to a
133non-@code{nil} value, @kbd{Mouse-2} does not move point; it inserts
134the text at point, regardless of where you clicked or even which of
135the frame's windows you clicked on. This variable affects both
136@code{mouse-yank-primary} and @code{mouse-yank-at-click}.
145 137
146@findex mouse-save-then-kill 138@findex mouse-save-then-kill
147 Clicking with the right mouse button, @kbd{Mouse-3}, runs the 139 Clicking with the right mouse button, @kbd{Mouse-3}, runs the
@@ -195,7 +187,7 @@ make Emacs behave this way by enabling Delete Selection mode.
195@xref{Using Region}. 187@xref{Using Region}.
196 188
197@node Word and Line Mouse 189@node Word and Line Mouse
198@subsection Mouse Commands for Words and Lines 190@section Mouse Commands for Words and Lines
199 191
200 These variants of @kbd{Mouse-1} select entire words or lines at a 192 These variants of @kbd{Mouse-1} select entire words or lines at a
201time. Emacs activates the region around the selected text, which is 193time. Emacs activates the region around the selected text, which is
@@ -224,164 +216,6 @@ Select the line you click on.
224Select the text you drag across, in the form of whole lines. 216Select the text you drag across, in the form of whole lines.
225@end table 217@end table
226 218
227@node Cut/Paste Other App
228@subsection Cut and Paste with Other Window Applications
229
230@cindex X cutting and pasting
231@cindex X selection
232@cindex primary selection
233@cindex selection, primary
234 When running Emacs under the X window system, you can easily
235transfer text between Emacs and other X applications using the
236@dfn{primary selection} (also called the @dfn{X selection}). This is
237@emph{not} the same thing as the @dfn{clipboard}, which is a separate
238facility used on desktop environments such as Gnome, and on operating
239systems such as Microsoft Windows (@pxref{Clipboard}).
240
241 Under X, whenever you select some text in Emacs by dragging or
242clicking the mouse (@pxref{Mouse Commands}), it is also saved in the
243primary selection. You can then @dfn{paste} that text into any other
244X application, usually by clicking @kbd{Mouse-2} in that application.
245Unlike the Emacs kill ring (@pxref{Kill Ring}), the primary selection
246has no ``memory'': each time you save something in the primary
247selection, either in Emacs or in another X application, the previous
248contents of the primary selection are lost.
249
250@cindex MS-Windows, and primary selection
251 MS-Windows provides no primary selection, but Emacs emulates it
252within a single Emacs session, by storing the selected text
253internally. Therefore, all the features and commands related to the
254primary selection work on Windows as they do on X, for cutting and
255pasting within the same session, but not across Emacs sessions or with
256other applications.
257
258 Whenever you kill some text using a command such as @kbd{C-w}
259(@code{kill-region}), or copy it into the kill ring using a command
260such as @kbd{M-w} (@code{kill-ring-save}), that text is also saved in
261the primary selection. @xref{Killing}.
262
263@vindex select-active-regions
264 If you set the region using the keyboard---for instance, by typing
265@kbd{C-@key{SPC}} and moving point away from the mark---the text in
266the region is not normally saved to the primary selection. However,
267if you change the variable @code{select-active-regions} to @code{t},
268the region is saved to the primary selection whenever you activate the
269mark. Each change to the region also updates the primary selection.
270
271@vindex yank-pop-change-selection
272 If you change @code{yank-pop-change-selection} to @code{t}, rotating
273the kill ring with @kbd{M-y} (@code{yank-pop}) also saves the new yank
274to the primary selection (@pxref{Yanking}).
275
276@vindex save-interprogram-paste-before-kill
277 If you change @code{save-interprogram-paste-before-kill} to
278@code{t}, each kill command first saves the existing selection onto
279the kill ring. This prevents you from losing the existing selection,
280at the risk of large memory consumption if other applications generate
281large selections.
282
283 You can yank the primary selection into Emacs using the usual yank
284commands, such as @kbd{C-y} (@code{yank}) and @kbd{Mouse-2}
285(@code{mouse-yank-at-click}). These commands actually check the
286primary selection before referring to the kill ring; if no primary
287selection is available, the kill ring contents are used. To prevent
288yank commands from accessing the primary selection, set the variable
289@code{x-select-enable-primary} to @code{nil}.
290
291 The standard coding system for the primary selection is
292@code{compound-text-with-extensions}. You may find that the pasted
293text is not what you expected. In such a case, you can specify
294another coding system for the selection by typing @kbd{C-x @key{RET}
295x} or @kbd{C-x @key{RET} X}. Alternatively, you can request a
296different data type by modifying the variable
297@code{x-select-request-type}. @xref{Communication Coding}.
298
299@node Secondary Selection
300@subsection Secondary Selection
301@cindex secondary selection
302
303 In addition to the primary selection, the X Window System provides a
304second similar facility known as the @dfn{secondary selection}.
305Nowadays, few X applications make use of the secondary selection, but
306you can access it using the following Emacs commands:
307
308@table @kbd
309@findex mouse-set-secondary
310@kindex M-Drag-Mouse-1
311@item M-Drag-Mouse-1
312Set the secondary selection, with one end at the place where you press
313down the button, and the other end at the place where you release it
314(@code{mouse-set-secondary}). The selected text is highlighted, using
315the @code{secondary-selection} face, as you drag. The window scrolls
316automatically if you drag the mouse off the top or bottom of the
317window, just like @code{mouse-set-region} (@pxref{Mouse Commands}).
318
319This command does not alter the kill ring.
320
321@findex mouse-start-secondary
322@kindex M-Mouse-1
323@item M-Mouse-1
324Set one endpoint for the @dfn{secondary selection}
325(@code{mouse-start-secondary}).
326
327@findex mouse-secondary-save-then-kill
328@kindex M-Mouse-3
329@item M-Mouse-3
330Set the secondary selection, with one end at the position clicked and
331the other at the position specified with @kbd{M-Mouse-1}
332(@code{mouse-secondary-save-then-kill}). This also puts the selected
333text in the kill ring. A second @kbd{M-Mouse-3} at the same place
334kills the secondary selection just made.
335
336@findex mouse-yank-secondary
337@kindex M-Mouse-2
338@item M-Mouse-2
339Insert the secondary selection where you click, placing point at the
340end of the yanked text (@code{mouse-yank-secondary}).
341@end table
342
343Double or triple clicking of @kbd{M-Mouse-1} operates on words and
344lines, much like @kbd{Mouse-1}.
345
346If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks
347at point. Then it does not matter precisely where you click, or even
348which of the frame's windows you click on. @xref{Mouse Commands}.
349
350@node Clipboard
351@subsection Using the Clipboard
352@cindex clipboard
353
354 In desktop environments such as Gnome, and operating systems such as
355Microsoft Windows and Mac OS X, you can transfer data (usually text)
356between different applications using the @dfn{clipboard}. The
357clipboard is distinct from the primary selection and secondary
358selection discussed earlier. You can access the clipboard through the
359@samp{Edit} menu of the menu bar (@pxref{Menu Bar}).
360
361@cindex cut
362@findex clipboard-kill-region
363 The command @code{clipboard-kill-region}, which is bound to the
364@code{Cut} menu item, kills the region and saves it in the clipboard.
365
366@cindex copy
367@findex clipboard-kill-ring-save
368 The command @code{clipboard-kill-ring-save}, which is bound to the
369@code{Copy} menu item, copies the region to the kill ring and saves it
370in the clipboard.
371
372@findex clipboard-yank
373@cindex paste
374 The @code{Paste} menu item in the Edit menu yanks the contents of
375the clipboard at point (@code{clipboard-yank}).
376
377@vindex x-select-enable-clipboard
378 You can customize the variable @code{x-select-enable-clipboard} to
379make the Emacs yank functions consult the clipboard before the primary
380selection, and to make the kill functions to store in the clipboard as
381well as the primary selection. Otherwise, these commands do not
382access the clipboard at all. Using the clipboard is the default on
383MS-Windows and Mac OS, but not on other systems.
384
385@node Mouse References 219@node Mouse References
386@section Following References with the Mouse 220@section Following References with the Mouse
387@kindex Mouse-1 @r{(selection)} 221@kindex Mouse-1 @r{(selection)}
@@ -626,15 +460,15 @@ this case, @kbd{C-x 5 0} can delete the last interactive frame; you
626can use @command{emacsclient} to reconnect to the Emacs session. 460can use @command{emacsclient} to reconnect to the Emacs session.
627 461
628@vindex focus-follows-mouse 462@vindex focus-follows-mouse
629 On X, you may have to tell Emacs how the system (or the window 463 On X, you may have to tell Emacs how the window manager handles
630manager) handles focus-switching between windows, in order for the 464focus-switching between windows, in order for @kbd{C-x 5 o}
631command @kbd{C-x 5 o} (@code{other-frame}) to work properly. 465(@code{other-frame}) to work properly. Unfortunately, there is no way
632Unfortunately, there is no way for Emacs to detect this automatically, 466for Emacs to detect this automatically, so you should set the variable
633so you should set the variable @code{focus-follows-mouse}. If simply 467@code{focus-follows-mouse}. The default is @code{nil}, meaning you
634moving the mouse onto a window selects it and gives it focus, the 468have to click on the window to select it (the default for most modern
635variable should be @code{t}; if you have to click on the window to 469window managers). You should change it to @code{t} if your window
636select it, the variable should be @code{nil}. The default is 470manager selects and window and gives it focus anytime you move the
637@code{t}. 471mouse onto the window.
638 472
639 The window manager that is part of MS-Windows always gives focus to 473 The window manager that is part of MS-Windows always gives focus to
640a frame that raises, so this variable has no effect in the native 474a frame that raises, so this variable has no effect in the native
@@ -689,6 +523,11 @@ Use the command line option @samp{-fn} (or @samp{--font}). @xref{Font
689X}. 523X}.
690@end itemize 524@end itemize
691 525
526To check what font you're currently using, the @kbd{C-u C-x =}
527command can be helpful. It'll describe the character under point, and
528also say what font it's rendered in, if the window system you're
529running under supports that.
530
692@cindex fontconfig 531@cindex fontconfig
693 On X, there are four different ways to express a ``font name''. The 532 On X, there are four different ways to express a ``font name''. The
694first is to use a @dfn{Fontconfig pattern}. Fontconfig patterns have 533first is to use a @dfn{Fontconfig pattern}. Fontconfig patterns have
diff --git a/doc/emacs/glossary.texi b/doc/emacs/glossary.texi
index 3cf1cc522bf..e37e80bfab8 100644
--- a/doc/emacs/glossary.texi
+++ b/doc/emacs/glossary.texi
@@ -962,7 +962,7 @@ special Emacs commands for moving over and operating on paragraphs.
962@item Parsing 962@item Parsing
963We say that certain Emacs commands parse words or expressions in the 963We say that certain Emacs commands parse words or expressions in the
964text being edited. Really, all they know how to do is find the other 964text being edited. Really, all they know how to do is find the other
965end of a word or expression. @xref{Syntax}. 965end of a word or expression.
966 966
967@item Point 967@item Point
968Point is the place in the buffer at which insertion and deletion 968Point is the place in the buffer at which insertion and deletion
@@ -1212,7 +1212,8 @@ See `font lock.'
1212@item Syntax Table 1212@item Syntax Table
1213The syntax table tells Emacs which characters are part of a word, 1213The syntax table tells Emacs which characters are part of a word,
1214which characters balance each other like parentheses, etc. 1214which characters balance each other like parentheses, etc.
1215@xref{Syntax}. 1215@xref{Syntax Tables,, Syntax Tables, elisp, The Emacs Lisp Reference
1216Manual}.
1216 1217
1217@item Super 1218@item Super
1218Super is the name of a modifier bit that a keyboard input character may 1219Super is the name of a modifier bit that a keyboard input character may
diff --git a/doc/emacs/help.texi b/doc/emacs/help.texi
index 2c3630adba4..76a9f2413b1 100644
--- a/doc/emacs/help.texi
+++ b/doc/emacs/help.texi
@@ -139,8 +139,11 @@ command.
139@item C-h r 139@item C-h r
140Display the Emacs manual in Info (@code{info-emacs-manual}). 140Display the Emacs manual in Info (@code{info-emacs-manual}).
141@item C-h s 141@item C-h s
142Display the current contents of the syntax table, with an explanation of 142Display the current contents of the @dfn{syntax table}, with an
143what they mean (@code{describe-syntax}). @xref{Syntax}. 143explanation of what they mean (@code{describe-syntax}). The syntax
144table says which characters are opening delimiters, which are parts of
145words, which are string quotes, and so on. @xref{Syntax Tables,,
146Syntax Tables, elisp, The Emacs Lisp Reference Manual}, for details.
144@item C-h t 147@item C-h t
145Enter the Emacs interactive tutorial (@code{help-with-tutorial}). 148Enter the Emacs interactive tutorial (@code{help-with-tutorial}).
146@item C-h v @var{var} @key{RET} 149@item C-h v @var{var} @key{RET}
@@ -583,7 +586,8 @@ bindings now in effect: first the local bindings of the current minor
583modes, then the local bindings defined by the current major mode, and 586modes, then the local bindings defined by the current major mode, and
584finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s} 587finally the global bindings (@pxref{Key Bindings}). @kbd{C-h s}
585displays the contents of the syntax table, with explanations of each 588displays the contents of the syntax table, with explanations of each
586character's syntax (@pxref{Syntax}). 589character's syntax (@pxref{Syntax Tables,, Syntax Tables, elisp, The
590Emacs Lisp Reference Manual}).
587 591
588 You can get a list of subcommands for a particular prefix key by 592 You can get a list of subcommands for a particular prefix key by
589typing @kbd{C-h} after the prefix key. (There are a few prefix keys 593typing @kbd{C-h} after the prefix key. (There are a few prefix keys
@@ -630,6 +634,9 @@ Display the Emacs copying conditions (@code{describe-copying}).
630These are the rules under which you can copy and redistribute Emacs. 634These are the rules under which you can copy and redistribute Emacs.
631@item C-h C-d 635@item C-h C-d
632Display help for debugging Emacs (@code{view-emacs-debugging}). 636Display help for debugging Emacs (@code{view-emacs-debugging}).
637@item C-h C-e
638Display external packages and information about Emacs
639(@code{view-external-packages}).
633@item C-h C-f 640@item C-h C-f
634Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}). 641Display the Emacs frequently-answered-questions list (@code{view-emacs-FAQ}).
635@item C-h g 642@item C-h g
diff --git a/doc/emacs/indent.texi b/doc/emacs/indent.texi
index c4ef4781aaf..e13b2808f09 100644
--- a/doc/emacs/indent.texi
+++ b/doc/emacs/indent.texi
@@ -2,7 +2,7 @@
2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2011 2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2001-2011
3@c Free Software Foundation, Inc. 3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions. 4@c See file emacs.texi for copying conditions.
5@node Indentation, Text, Major Modes, Top 5@node Indentation, Text, Modes, Top
6@chapter Indentation 6@chapter Indentation
7@cindex indentation 7@cindex indentation
8@cindex tabs 8@cindex tabs
diff --git a/doc/emacs/killing.texi b/doc/emacs/killing.texi
index 41262e9c2d8..06839ce5187 100644
--- a/doc/emacs/killing.texi
+++ b/doc/emacs/killing.texi
@@ -6,20 +6,24 @@
6@node Killing, Registers, Mark, Top 6@node Killing, Registers, Mark, Top
7@chapter Killing and Moving Text 7@chapter Killing and Moving Text
8 8
9 @dfn{Killing} means erasing text and copying it into the @dfn{kill 9 In Emacs, @dfn{killing} means erasing text and copying it into the
10ring}, from which you can bring it back into the buffer by 10@dfn{kill ring}. @dfn{Yanking} means bringing text from the kill ring
11@dfn{yanking} it. (Some applications use the terms ``cutting'' and 11back into the buffer. (Some applications use the terms ``cutting''
12``pasting'' for similar operations.) This is the most common way of 12and ``pasting'' for similar operations.) The kill ring is so-named
13moving or copying text within Emacs. It is very versatile, because 13because it can be visualized as a set of blocks of text arranged in a
14there are commands for killing many different types of syntactic 14ring, which you can access in cyclic order. @xref{Kill Ring}.
15units. 15
16 Killing and yanking are the most common way to move or copy text
17within Emacs. It is very versatile, because there are commands for
18killing many different types of syntactic units.
16 19
17@menu 20@menu
18* Deletion and Killing:: Commands that remove text. 21* Deletion and Killing:: Commands that remove text.
19* Yanking:: Commands that insert text. 22* Yanking:: Commands that insert text.
23* Cut and Paste:: Clipboard and selections on graphical displays.
20* Accumulating Text:: Other methods to add text to the buffer. 24* Accumulating Text:: Other methods to add text to the buffer.
21* Rectangles:: Operating on text in rectangular areas. 25* Rectangles:: Operating on text in rectangular areas.
22* CUA Bindings:: Using C-x/C-c/C-v to kill and yank. 26* CUA Bindings:: Using @kbd{C-x}/@kbd{C-c}/@kbd{C-v} to kill and yank.
23@end menu 27@end menu
24 28
25@node Deletion and Killing 29@node Deletion and Killing
@@ -29,25 +33,28 @@ units.
29@cindex cutting text 33@cindex cutting text
30@cindex deletion 34@cindex deletion
31 Most commands which erase text from the buffer save it in the kill 35 Most commands which erase text from the buffer save it in the kill
32ring. These are known as @dfn{kill} commands. The kill ring stores 36ring. These are known as @dfn{kill} commands, and their names
33several recent kills, not just the last one, so killing is a very safe 37normally contain the word @samp{kill} (e.g. @code{kill-line}). The
34operation: when you make a new kill, you don't have to worry much 38kill ring stores several recent kills, not just the last one, so
35about losing text that you previously killed. 39killing is a very safe operation: you don't have to worry much about
40losing text that you previously killed. The kill ring is shared by
41all buffers, so text that is killed in one buffer can be yanked into
42another buffer.
43
44 When you use @kbd{C-/} (@code{undo}) to undo a kill command
45(@pxref{Undo}), that brings the killed text back into the buffer, but
46does not remove it from the kill ring.
36 47
37 You can yank text from the kill ring into any position in a buffer, 48 On graphical displays, killing text also copies it to the system
38including a position in a different buffer; the kill ring is shared by 49clipboard. @xref{Cut and Paste}.
39all buffers. The @kbd{C-/} (@code{undo}) command can undo both kill
40and delete commands (@pxref{Undo}); the importance of the kill ring is
41that you can yank the text in a different place.
42 50
43 Commands that erase text but do not save it in the kill ring are 51 Commands that erase text but do not save it in the kill ring are
44known as @dfn{delete} commands. These include @kbd{C-d} 52known as @dfn{delete} commands; their names usually contain the word
45(@code{delete-char}) and @key{DEL} (@code{delete-backward-char}), 53@samp{delete}. These include @kbd{C-d} (@code{delete-char}) and
46which delete only one character at a time, and those commands that 54@key{DEL} (@code{delete-backward-char}), which delete only one
47delete only spaces or newlines. Commands that can erase significant 55character at a time, and those commands that delete only spaces or
48amounts of nontrivial data generally do a kill operation instead. The 56newlines. Commands that can erase significant amounts of nontrivial
49commands' names and individual descriptions use the words @samp{kill} 57data generally do a kill operation instead.
50and @samp{delete} to say which kind of operation they perform.
51 58
52 You can also use the mouse to kill and yank. @xref{Cut and Paste}. 59 You can also use the mouse to kill and yank. @xref{Cut and Paste}.
53 60
@@ -127,21 +134,22 @@ Kill an entire line at once (@code{kill-whole-line})
127 134
128@kindex C-k 135@kindex C-k
129@findex kill-line 136@findex kill-line
130 The simplest kill command is @kbd{C-k}. If given at the beginning 137 The simplest kill command is @kbd{C-k} (@code{kill-line}). If used
131of a line, it kills all the text on the line@footnote{Here, ``line'' 138at the end of a line, it kills the line-ending newline character,
132means a logical text line, not a screen line. @xref{Continuation 139merging the next line into the current one (thus, a blank line is
133Lines}.}, leaving it blank. When used on a blank line, it kills the 140entirely removed). Otherwise, @kbd{C-k} kills all the text from point
134whole line including its newline. 141up to the end of the line; if point was originally at the beginning of
135 142the line, this leaves the line blank.
136 More precisely, @kbd{C-k} kills from point up to the end of the 143
137line, unless it is at the end of a line. In that case it kills the 144 Spaces and tabs at the end of the line are ignored when deciding
138newline following point, thus merging the next line into the current 145which case applies. As long as point is after the last visible
139one. Spaces and tabs at the end of the line are ignored when deciding
140which case applies, so as long as point is after the last visible
141character in the line, you can be sure that @kbd{C-k} will kill the 146character in the line, you can be sure that @kbd{C-k} will kill the
142newline. To kill an entire non-blank line, go to the beginning and 147newline. To kill an entire non-blank line, go to the beginning and
143type @kbd{C-k} twice. 148type @kbd{C-k} twice.
144 149
150 In this context, ``line'' means a logical text line, not a screen
151line (@pxref{Continuation Lines}).
152
145 When @kbd{C-k} is given a positive argument @var{n}, it kills 153 When @kbd{C-k} is given a positive argument @var{n}, it kills
146@var{n} lines and the newlines that follow them (text on the current 154@var{n} lines and the newlines that follow them (text on the current
147line before point is not killed). With a negative argument 155line before point is not killed). With a negative argument
@@ -157,10 +165,10 @@ following newline. This variable is normally @code{nil}.
157 165
158@kindex C-S-backspace 166@kindex C-S-backspace
159@findex kill-whole-line 167@findex kill-whole-line
160 @kbd{C-S-backspace} (@code{kill-whole-line}) will kill a whole line 168 @kbd{C-S-backspace} (@code{kill-whole-line}) kills a whole line
161including its newline regardless of the position of point within the 169including its newline, regardless of the position of point within the
162line. Note that many character terminals will prevent you from typing 170line. Note that many text terminals will prevent you from typing the
163the key sequence @kbd{C-S-backspace}. 171key sequence @kbd{C-S-backspace}.
164 172
165@node Other Kill Commands 173@node Other Kill Commands
166@subsection Other Kill Commands 174@subsection Other Kill Commands
@@ -196,10 +204,8 @@ last set. The mark is deactivated at the end of the command.
196 204
197@kindex M-w 205@kindex M-w
198@findex kill-ring-save 206@findex kill-ring-save
199 The command @kbd{M-w} (@code{kill-ring-save}) copies the region into 207 @kbd{M-w} (@code{kill-ring-save}) copies the region into the kill
200the kill ring without removing it from the buffer. This is 208ring without removing it from the buffer.
201approximately equivalent to @kbd{C-w} followed by @kbd{C-/}, except
202that @kbd{M-w} does not alter the undo history.
203 209
204 Emacs also provides commands to kill specific syntactic units: 210 Emacs also provides commands to kill specific syntactic units:
205words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced 211words, with @kbd{M-@key{DEL}} and @kbd{M-d} (@pxref{Words}); balanced
@@ -220,12 +226,10 @@ search backward and kill text before point.
220@vindex kill-read-only-ok 226@vindex kill-read-only-ok
221@cindex read-only text, killing 227@cindex read-only text, killing
222 Some specialized buffers contain @dfn{read-only text}, which cannot 228 Some specialized buffers contain @dfn{read-only text}, which cannot
223be modified and therefore cannot be killed. But some users like to 229be modified and therefore cannot be killed. The kill commands work
224use the kill commands to copy read-only text into the kill ring, 230specially in a read-only buffer: they move over text and copy it to
225without actually changing it. Therefore, the kill commands work
226specially in a read-only buffer: they move over text, and copy it to
227the kill ring, without actually deleting it from the buffer. 231the kill ring, without actually deleting it from the buffer.
228Normally, kill commands beep and display an error message when this 232Normally, they also beep and display an error message when this
229happens. But if you set the variable @code{kill-read-only-ok} to a 233happens. But if you set the variable @code{kill-read-only-ok} to a
230non-@code{nil} value, they just print a message in the echo area to 234non-@code{nil} value, they just print a message in the echo area to
231explain why the text has not been erased. 235explain why the text has not been erased.
@@ -257,10 +261,16 @@ Replace text just yanked with an earlier batch of killed text
257Append next kill to last batch of killed text (@code{append-next-kill}). 261Append next kill to last batch of killed text (@code{append-next-kill}).
258@end table 262@end table
259 263
260 On graphical displays with window systems, if there is a current 264@cindex yanking and text properties
261selection in some other application, and you selected it more recently 265@vindex yank-excluded-properties
262than you killed any text in Emacs, @kbd{C-y} copies the selection 266 The yank commands discard certain properties from the yanked text.
263instead of text killed within Emacs. 267These are properties that might lead to annoying results, such as
268causing the text to respond to the mouse or specifying key bindings.
269The list of properties to discard is stored in the variable
270@code{yank-excluded-properties}. These properties are also discarded
271when yanking register contents and rectangles. @xref{Text
272Properties,,, elisp, the Emacs Lisp Reference Manual}, for more
273information about text properties.
264 274
265@menu 275@menu
266* Kill Ring:: Where killed text is stored. Basic yanking. 276* Kill Ring:: Where killed text is stored. Basic yanking.
@@ -271,38 +281,34 @@ instead of text killed within Emacs.
271@node Kill Ring 281@node Kill Ring
272@subsection The Kill Ring 282@subsection The Kill Ring
273 283
274 All killed text is recorded in the @dfn{kill ring}, a list of blocks 284 The @dfn{kill ring} is a list of blocks of text that were previously
275of text that have been killed. There is only one kill ring, shared by 285killed. There is only one kill ring, shared by all buffers, so you
276all buffers, so you can kill text in one buffer and yank it in another 286can kill text in one buffer and yank it in another buffer. This is
277buffer. This is the usual way to move text from one file to another. 287the usual way to move text from one file to another. (There are
278(There are several other methods: for instance, you could store the 288several other methods: for instance, you could store the text in a
279text in a register. @xref{Registers}, for information about 289register; see @ref{Registers}. @xref{Accumulating Text}, for some
280registers. @xref{Accumulating Text}, for some other ways to move text 290other ways to move text around.)
281around.)
282 291
283@kindex C-y 292@kindex C-y
284@findex yank 293@findex yank
285 The command @kbd{C-y} (@code{yank}) reinserts the text of the most 294 @kbd{C-y} (@code{yank}) reinserts the text of the most recent kill,
286recent kill, leaving the cursor at the end of the text. It also adds 295leaving the cursor at the end of the text. It also adds the position
287the position of the beginning of the text to the mark ring, without 296of the beginning of the text to the mark ring, without activating the
288activating the mark; this allows you to jump easily to that position 297mark; this allows you to jump easily to that position with @kbd{C-x
289with @kbd{C-x C-x} (@pxref{Setting Mark}). With a plain prefix 298C-x} (@pxref{Setting Mark}).
290argument (@kbd{C-u C-y}), it instead leaves the cursor in front of the 299
291text, and adds the position of the end of the text to the mark ring. 300 On graphical displays, @kbd{C-y} first checks if another application
292Using other sort of prefix argument specifies an earlier kill; for 301has placed any text in the system clipboard more recently than the
293example, @kbd{C-u 4 C-y} reinserts the fourth most recent kill. 302last Emacs kill. If so, it inserts from the clipboard instead of the
294@xref{Earlier Kills}. 303kill ring. Conceptually, you can think of the clipboard as an
295 304``extra'' entry in the kill ring, which is present if you recently cut
296@cindex yanking and text properties 305or copied some text in another application. @xref{Cut and Paste}.
297@vindex yank-excluded-properties 306
298 The yank commands discard certain properties from the yanked text. 307 With a plain prefix argument (@kbd{C-u C-y}), the @code{yank}
299These are properties that might lead to annoying results, such as 308command instead leaves the cursor in front of the text, and adds the
300causing the text to respond to the mouse or specifying key bindings. 309position of the end of the text to the mark ring. Using any other
301The list of properties to discard is stored in the variable 310prefix argument specifies an earlier kill; for example, @kbd{C-u 4
302@code{yank-excluded-properties}. Yanking of register contents and 311C-y} reinserts the fourth most recent kill. @xref{Earlier Kills}.
303rectangles also discard these properties. @xref{Text Properties,,,
304elisp, the Emacs Lisp Reference Manual}, for more information about
305text properties.
306 312
307@node Appending Kills 313@node Appending Kills
308@subsection Appending Kills 314@subsection Appending Kills
@@ -418,6 +424,179 @@ saved.
418@code{kill-ring}; you can view the entire contents of the kill ring with 424@code{kill-ring}; you can view the entire contents of the kill ring with
419the command @kbd{C-h v kill-ring}. 425the command @kbd{C-h v kill-ring}.
420 426
427@node Cut and Paste
428@section ``Cut and Paste'' Operations on Graphical Displays
429@cindex cut
430@cindex copy
431@cindex paste
432
433 In most graphical desktop environments, you can transfer data
434(usually text) between different applications using a system facility
435called the @dfn{clipboard}. On X, two other similar facilities are
436available: the primary selection and the secondary selection. When
437Emacs is run on a graphical display, its kill and yank commands
438integrate with these facilities, so that you can easily transfer text
439between Emacs and other graphical applications.
440
441 By default, Emacs uses UTF-8 as the coding system for inter-program
442text transfers. If you find that the pasted text is not what you
443expected, you can specify another coding system by typing @kbd{C-x
444@key{RET} x} or @kbd{C-x @key{RET} X}. You can also request a
445different data type by customizing @code{x-select-request-type}.
446@xref{Communication Coding}.
447
448@menu
449* Clipboard:: How Emacs uses the system clipboard.
450* Primary Selection:: The temporarily selected text selection.
451* Secondary Selection:: Cutting without altering point and mark.
452@end menu
453
454@node Clipboard
455@subsection Using the Clipboard
456@cindex clipboard
457
458 The @dfn{clipboard} is the facility that most graphical applications
459use for ``cutting and pasting''. When the clipboard exists, the kill
460and yank commands in Emacs make use of it.
461
462 When you kill some text with a command such as @kbd{C-w}
463(@code{kill-region}), or copy it to the kill ring with a command such
464as @kbd{M-w} (@code{kill-ring-save}), that text is also put in the
465clipboard. @xref{Killing}.
466
467@vindex save-interprogram-paste-before-kill
468 When an Emacs kill command puts text in the clipboard, the existing
469clipboard contents are normally lost. Optionally, you can change
470@code{save-interprogram-paste-before-kill} to @code{t}. Then Emacs
471will first save the clipboard to its kill ring, preventing you from
472losing the old clipboard data---at the risk of high memory consumption
473if that data turns out to be large.
474
475 The usual yank commands, such as @kbd{C-y} (@code{yank}), also use
476the clipboard. If another application ``owns'' the clipboard---i.e.,
477if you cut or copied text there more recently than your last kill
478command in Emacs---then Emacs yanks from the clipboard instead of the
479kill ring. Otherwise, it yanks from the kill ring, as described in
480@ref{Yanking}.
481
482@vindex yank-pop-change-selection
483 Normally, rotating the kill ring with @kbd{M-y} (@code{yank-pop})
484does not alter the clipboard. However, if you change
485@code{yank-pop-change-selection} to @code{t}, then @kbd{M-y} saves the
486new yank to the clipboard.
487
488@vindex x-select-enable-clipboard
489 To prevent kill and yank commands from accessing the clipboard,
490change the variable @code{x-select-enable-clipboard} to @code{nil}.
491
492@vindex x-select-enable-primary
493@findex clipboard-kill-region
494@findex clipboard-kill-ring-save
495@findex clipboard-yank
496 Prior to Emacs 24, the kill and yank commands used the primary
497selection (@pxref{Primary Selection}), not the clipboard. If you
498prefer this behavior, change @code{x-select-enable-clipboard} to
499@code{nil}, @code{x-select-enable-primary} to @code{t}, and
500@code{mouse-drag-copy-region} to @code{t}. In this case, you can use
501the following commands to act explicitly on the clipboard:
502@code{clipboard-kill-region} kills the region and saves it to the
503clipboard; @code{clipboard-kill-ring-save} copies the region to the
504kill ring and saves it to the clipboard; and @code{clipboard-yank}
505yanks the contents of the clipboard at point.
506
507@node Primary Selection
508@subsection Cut and Paste with Other Window Applications
509@cindex X cutting and pasting
510@cindex X selection
511@cindex primary selection
512@cindex selection, primary
513
514 Under the X window system, there exists a @dfn{primary selection}
515containing the last stretch of text selected in an X application
516(usually by dragging the mouse). Typically, this text can be inserted
517into other X applications by @kbd{mouse-2} clicks. The primary
518selection is separate from the clipboard (@pxref{Clipboard}). Its
519contents are more ``fragile''; they are overwritten by any mouse
520selection, whereas the clipboard is only overwritten by explicit
521``cut'' or ``copy'' commands.
522
523 Under X, whenever you set an active region (@pxref{Mark}), Emacs
524saves the text in the active region to the primary selection. This
525applies to active regions made by dragging or clicking the mouse
526(@pxref{Mouse Commands}), and those made by keyboard commands (e.g. by
527typing @kbd{C-@key{SPC}} and moving point; see @ref{Setting Mark}).
528
529@vindex select-active-regions
530 If you change the variable @code{select-active-regions} to
531@code{only}, Emacs saves only temporarily active regions to the
532primary selection, i.e. those made with the mouse or with shift
533selection (@pxref{Shift Selection}). If you change
534@code{select-active-regions} to @code{nil}, Emacs avoids saving active
535regions to the primary selection entirely.
536
537 To insert the primary selection into an Emacs buffer, click
538@kbd{mouse-2} (@code{mouse-yank-primary}) where you want to insert it.
539@xref{Mouse Commands}.
540
541@cindex MS-Windows, and primary selection
542 MS-Windows provides no primary selection, but Emacs emulates it
543within a single Emacs session by storing the selected text internally.
544Therefore, all the features and commands related to the primary
545selection work on Windows as they do on X, for cutting and pasting
546within the same session, but not across Emacs sessions or with other
547applications.
548
549@node Secondary Selection
550@subsection Secondary Selection
551@cindex secondary selection
552
553 In addition to the primary selection, the X Window System provides a
554second similar facility known as the @dfn{secondary selection}.
555Nowadays, few X applications make use of the secondary selection, but
556you can access it using the following Emacs commands:
557
558@table @kbd
559@findex mouse-set-secondary
560@kindex M-Drag-Mouse-1
561@item M-Drag-Mouse-1
562Set the secondary selection, with one end at the place where you press
563down the button, and the other end at the place where you release it
564(@code{mouse-set-secondary}). The selected text is highlighted, using
565the @code{secondary-selection} face, as you drag. The window scrolls
566automatically if you drag the mouse off the top or bottom of the
567window, just like @code{mouse-set-region} (@pxref{Mouse Commands}).
568
569This command does not alter the kill ring.
570
571@findex mouse-start-secondary
572@kindex M-Mouse-1
573@item M-Mouse-1
574Set one endpoint for the @dfn{secondary selection}
575(@code{mouse-start-secondary}).
576
577@findex mouse-secondary-save-then-kill
578@kindex M-Mouse-3
579@item M-Mouse-3
580Set the secondary selection, with one end at the position clicked and
581the other at the position specified with @kbd{M-Mouse-1}
582(@code{mouse-secondary-save-then-kill}). This also puts the selected
583text in the kill ring. A second @kbd{M-Mouse-3} at the same place
584kills the secondary selection just made.
585
586@findex mouse-yank-secondary
587@kindex M-Mouse-2
588@item M-Mouse-2
589Insert the secondary selection where you click, placing point at the
590end of the yanked text (@code{mouse-yank-secondary}).
591@end table
592
593Double or triple clicking of @kbd{M-Mouse-1} operates on words and
594lines, much like @kbd{Mouse-1}.
595
596If @code{mouse-yank-at-point} is non-@code{nil}, @kbd{M-Mouse-2} yanks
597at point. Then it does not matter precisely where you click, or even
598which of the frame's windows you click on. @xref{Mouse Commands}.
599
421@node Accumulating Text 600@node Accumulating Text
422@section Accumulating Text 601@section Accumulating Text
423@findex append-to-buffer 602@findex append-to-buffer
@@ -581,8 +760,7 @@ rectangle and then yank it beside the first line of the list.
581@xref{Two-Column}, for another way to edit multi-column text. 760@xref{Two-Column}, for another way to edit multi-column text.
582 761
583 You can also copy rectangles into and out of registers with @kbd{C-x r 762 You can also copy rectangles into and out of registers with @kbd{C-x r
584r @var{r}} and @kbd{C-x r i @var{r}}. @xref{RegRect,,Rectangle 763r @var{r}} and @kbd{C-x r i @var{r}}. @xref{Rectangle Registers}.
585Registers}.
586 764
587@kindex C-x r o 765@kindex C-x r o
588@findex open-rectangle 766@findex open-rectangle
diff --git a/doc/emacs/kmacro.texi b/doc/emacs/kmacro.texi
index c52381a663c..ac81377aec9 100644
--- a/doc/emacs/kmacro.texi
+++ b/doc/emacs/kmacro.texi
@@ -332,8 +332,8 @@ numbers stored in registers.
332 332
333 If you use a register as a counter, incrementing it on each 333 If you use a register as a counter, incrementing it on each
334repetition of the macro, that accomplishes the same thing as a 334repetition of the macro, that accomplishes the same thing as a
335keyboard macro counter. @xref{RegNumbers}. For most purposes, it is 335keyboard macro counter. @xref{Number Registers}. For most purposes,
336simpler to use a keyboard macro counter. 336it is simpler to use a keyboard macro counter.
337 337
338@node Keyboard Macro Query 338@node Keyboard Macro Query
339@section Executing Macros with Variations 339@section Executing Macros with Variations
diff --git a/doc/emacs/major.texi b/doc/emacs/major.texi
deleted file mode 100644
index 9256c712f02..00000000000
--- a/doc/emacs/major.texi
+++ /dev/null
@@ -1,237 +0,0 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Major Modes, Indentation, International, Top
6@chapter Major Modes
7@cindex major modes
8@cindex mode, major
9@kindex TAB @r{(and major modes)}
10@kindex DEL @r{(and major modes)}
11@kindex C-j @r{(and major modes)}
12
13 Emacs provides many alternative @dfn{major modes}, each of which
14customizes Emacs for editing text of a particular sort. The major modes
15are mutually exclusive, and each buffer has one major mode at any time.
16The mode line normally shows the name of the current major mode, in
17parentheses (@pxref{Mode Line}).
18
19 The least specialized major mode is called @dfn{Fundamental mode}.
20This mode has no mode-specific redefinitions or variable settings, so
21that each Emacs command behaves in its most general manner, and each
22user option variable is in its default state. For editing text of a
23specific type that Emacs knows about, such as Lisp code or English
24text, you should switch to the appropriate major mode, such as Lisp
25mode or Text mode.
26
27 Selecting a major mode changes the meanings of a few keys to become
28more specifically adapted to the language being edited. The ones that
29are changed frequently are @key{TAB}, @key{DEL}, and @kbd{C-j}. The
30prefix key @kbd{C-c} normally contains mode-specific commands. In
31addition, the commands which handle comments use the mode to determine
32how comments are to be delimited. Many major modes redefine the
33syntactical properties of characters appearing in the buffer.
34@xref{Syntax}.
35
36 The major modes fall into three major groups. The first group
37contains modes for normal text, either plain or with mark-up. It
38includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline
39mode. The second group contains modes for specific programming
40languages. These include Lisp mode (which has several variants), C
41mode, Fortran mode, and others. The remaining major modes are not
42intended for use on users' files; they are used in buffers created for
43specific purposes by Emacs, such as Dired mode for buffers made by
44Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
45(@pxref{Sending Mail}), and Shell mode for buffers used for
46communicating with an inferior shell process (@pxref{Interactive
47Shell}).
48
49 Most programming-language major modes specify that only blank lines
50separate paragraphs. This is to make the paragraph commands useful.
51(@xref{Paragraphs}.) They also cause Auto Fill mode to use the
52definition of @key{TAB} to indent the new lines it creates. This is
53because most lines in a program are usually indented
54(@pxref{Indentation}).
55
56@menu
57* Choosing Modes:: How major modes are specified or chosen.
58@end menu
59
60@node Choosing Modes,,Major Modes,Major Modes
61@section How Major Modes are Chosen
62
63@cindex choosing a major mode
64 You can select a major mode explicitly for the current buffer, but
65most of the time Emacs determines which mode to use based on the file
66name or on special text in the file.
67
68 To explicitly select a new major, you use an @kbd{M-x} command.
69Take the name of a major mode and add @code{-mode} to get the name of
70the command to select that mode. Thus, you can enter Lisp mode by
71executing @kbd{M-x lisp-mode}.
72
73@vindex auto-mode-alist
74 When you visit a file, Emacs usually chooses the right major mode
75automatically. Normally, it makes the choice based on the file
76name---for example, files whose names end in @samp{.c} are normally
77edited in C mode---but sometimes it chooses the major mode based on
78the contents of the file. Here is the exact procedure:
79
80 First, Emacs checks whether the file contains a file-local variable
81that specifies the major mode. If so, it uses that major mode,
82ignoring all other criteria. @xref{File Variables}. There are
83several methods to specify a major mode using a file-local variable;
84the simplest is to put the mode name in the first nonblank line,
85preceded and followed by @samp{-*-}. Other text may appear on the
86line as well. For example,
87
88@example
89; -*-Lisp-*-
90@end example
91
92@noindent
93tells Emacs to use Lisp mode. Note how the semicolon is used to make
94Lisp treat this line as a comment. Alternatively, you could write
95
96@example
97; -*- mode: Lisp;-*-
98@end example
99
100@noindent
101The latter format allows you to specify local variables as well, like
102this:
103
104@example
105; -*- mode: Lisp; tab-width: 4; -*-
106@end example
107
108@vindex interpreter-mode-alist
109 Second, Emacs checks whether the file's contents begin with
110@samp{#!}. If so, that indicates that the file can serve as an
111executable shell command, which works by running an interpreter named
112on the file's first line (the rest of the file is used as input to the
113interpreter). Therefore, Emacs tries to use the interpreter name to
114choose a mode. For instance, a file that begins with
115@samp{#!/usr/bin/perl} is opened in Perl mode. The variable
116@code{interpreter-mode-alist} specifies the correspondence between
117interpreter program names and major modes.
118
119 When the first line starts with @samp{#!}, you usually cannot use
120the @samp{-*-} feature on the first line, because the system would get
121confused when running the interpreter. So Emacs looks for @samp{-*-}
122on the second line in such files as well as on the first line. The
123same is true for man pages which start with the magic string
124@samp{'\"} to specify a list of troff preprocessors.
125
126@vindex magic-mode-alist
127 Third, Emacs tries to determine the major mode by looking at the
128text at the start of the buffer, based on the variable
129@code{magic-mode-alist}. By default, this variable is @code{nil} (an
130empty list), so Emacs skips this step; however, you can customize it
131in your init file (@pxref{Init File}). The value should be a list of
132elements of the form
133
134@example
135(@var{regexp} . @var{mode-function})
136@end example
137
138@noindent
139where @var{regexp} is a regular expression (@pxref{Regexps}), and
140@var{mode-function} is a Lisp function that toggles a major mode. If
141the text at the beginning of the file matches @var{regexp}, Emacs
142chooses the major mode specified by @var{mode-function}.
143
144Alternatively, an element of @code{magic-mode-alist} may have the form
145
146@example
147(@var{match-function} . @var{mode-function})
148@end example
149
150@noindent
151where @var{match-function} is a Lisp function that is called at the
152beginning of the buffer; if the function returns non-@code{nil}, Emacs
153set the major mode wit @var{mode-function}.
154
155 Fourth---if Emacs still hasn't found a suitable major mode---it
156looks at the file's name. The correspondence between file names and
157major modes is controlled by the variable @code{auto-mode-alist}. Its
158value is a list in which each element has this form,
159
160@example
161(@var{regexp} . @var{mode-function})
162@end example
163
164@noindent
165or this form,
166
167@example
168(@var{regexp} @var{mode-function} @var{flag})
169@end example
170
171@noindent
172For example, one element normally found in the list has the form
173@code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C
174mode for files whose names end in @file{.c}. (Note that @samp{\\} is
175needed in Lisp syntax to include a @samp{\} in the string, which must
176be used to suppress the special meaning of @samp{.} in regexps.) If
177the element has the form @code{(@var{regexp} @var{mode-function}
178@var{flag})} and @var{flag} is non-@code{nil}, then after calling
179@var{mode-function}, Emacs discards the suffix that matched
180@var{regexp} and searches the list again for another match.
181
182@vindex auto-mode-case-fold
183 On systems with case-insensitive file names, such as Microsoft
184Windows, Emacs performs a single case-insensitive search through
185@code{auto-mode-alist}. On other systems, Emacs normally performs a
186single case-sensitive search through the alist. However, if you
187change the variable @code{auto-mode-case-fold} to @code{t}, Emacs
188performs a second case-insensitive search if the first search fails.
189
190@vindex magic-fallback-mode-alist
191 Finally, if Emacs @emph{still} hasn't found a major mode to use, it
192compares the text at the start of the buffer to the variable
193@code{magic-fallback-mode-alist}. This variable works like
194@code{magic-mode-alist}, described above, except that is consulted
195only after @code{auto-mode-alist}. By default,
196@code{magic-fallback-mode-alist} contains forms that check for image
197files, HTML/XML/SGML files, and Postscript files.
198
199@vindex major-mode
200 Once a major mode is chosen, Emacs sets the value of the variable
201@code{major-mode} to the symbol for that major mode (e.g.,
202@code{text-mode} for Text mode). This is a per-buffer variable
203(@pxref{Locals}); its buffer-local value is set automatically, and you
204should not change it yourself.
205
206 The default value of @code{major-mode} determines the major mode to
207use for files that do not specify a major mode, and for new buffers
208created with @kbd{C-x b}. Normally, this default value is the symbol
209@code{fundamental-mode}, which specifies Fundamental mode. You can
210change it via the Customization interface (@pxref{Easy
211Customization}), or by adding a line like this to your init file
212(@pxref{Init File}):
213
214@smallexample
215(setq-default major-mode 'text-mode)
216@end smallexample
217
218@noindent
219If the default value of @code{major-mode} is @code{nil}, the major
220mode is taken from the previously current buffer.
221
222@findex normal-mode
223 If you have changed the major mode of a buffer, you can return to
224the major mode Emacs would have chosen automatically, by typing
225@kbd{M-x normal-mode}. This is the same function that
226@code{find-file} calls to choose the major mode. It also processes
227the file's @samp{-*-} line or local variables list (if any).
228@xref{File Variables}.
229
230@vindex change-major-mode-with-file-name
231 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to
232a new major mode if the new file name implies a mode (@pxref{Saving}).
233(@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.)
234However, this does not happen if the buffer contents specify a major
235mode, and certain ``special'' major modes do not allow the mode to
236change. You can turn off this mode-changing feature by setting
237@code{change-major-mode-with-file-name} to @code{nil}.
diff --git a/doc/emacs/makefile.w32-in b/doc/emacs/makefile.w32-in
index ad976468be9..4064f4ef6a3 100644
--- a/doc/emacs/makefile.w32-in
+++ b/doc/emacs/makefile.w32-in
@@ -76,7 +76,7 @@ EMACSSOURCES= \
76 $(srcdir)/windows.texi \ 76 $(srcdir)/windows.texi \
77 $(srcdir)/frames.texi \ 77 $(srcdir)/frames.texi \
78 $(srcdir)/mule.texi \ 78 $(srcdir)/mule.texi \
79 $(srcdir)/major.texi \ 79 $(srcdir)/modes.texi \
80 $(srcdir)/indent.texi \ 80 $(srcdir)/indent.texi \
81 $(srcdir)/text.texi \ 81 $(srcdir)/text.texi \
82 $(srcdir)/programs.texi \ 82 $(srcdir)/programs.texi \
diff --git a/doc/emacs/mark.texi b/doc/emacs/mark.texi
index b426020b7c6..1a93f5b79c8 100644
--- a/doc/emacs/mark.texi
+++ b/doc/emacs/mark.texi
@@ -68,8 +68,9 @@ Set point and the mark around the text you drag across.
68@item Mouse-3 68@item Mouse-3
69Set the mark at point, then move point to where you click 69Set the mark at point, then move point to where you click
70(@code{mouse-save-then-kill}). 70(@code{mouse-save-then-kill}).
71@item @samp{Shifted motion keys} 71@item @samp{Shifted cursor motion keys}
72Set the mark at point if the mark is inactive, then move point. 72Set the mark at point if the mark is inactive, then move point.
73@xref{Shift Selection}.
73@end table 74@end table
74 75
75@kindex C-SPC 76@kindex C-SPC
@@ -252,7 +253,9 @@ Another effect of this mode is that some keys, such as @key{DEL} and
252@cindex mark ring 253@cindex mark ring
253 Aside from delimiting the region, the mark is also useful for 254 Aside from delimiting the region, the mark is also useful for
254remembering spots that you may want to go back to. Each buffer 255remembering spots that you may want to go back to. Each buffer
255remembers 16 previous locations of the mark, in the @dfn{mark ring}. 256remembers @code{mark-ring-max} previous locations of the mark, in the
257@dfn{mark ring}. This defaults to 16 locations.
258
256Commands that set the mark also push the old mark onto this ring. 259Commands that set the mark also push the old mark onto this ring.
257 260
258@table @kbd 261@table @kbd
@@ -307,17 +310,19 @@ is non-@code{nil} by default.
307 310
308 If you want to move back to the same place over and over, the mark 311 If you want to move back to the same place over and over, the mark
309ring may not be convenient enough. If so, you can record the position 312ring may not be convenient enough. If so, you can record the position
310in a register for later retrieval (@pxref{RegPos,, Saving Positions in 313in a register for later retrieval (@pxref{Position Registers,, Saving
311Registers}). 314Positions in Registers}).
312 315
313@node Global Mark Ring 316@node Global Mark Ring
314@section The Global Mark Ring 317@section The Global Mark Ring
315@cindex global mark ring 318@cindex global mark ring
316 319
320@vindex global-mark-ring-max
317 In addition to the ordinary mark ring that belongs to each buffer, 321 In addition to the ordinary mark ring that belongs to each buffer,
318Emacs has a single @dfn{global mark ring}. Each time you set a mark, 322Emacs has a single @dfn{global mark ring}. Each time you set a mark,
319in any buffer, this is recorded in the global mark ring in addition to 323in any buffer, this is recorded in the global mark ring in addition to
320the current buffer's own mark ring. 324the current buffer's own mark ring. The length of this ring can be
325controlled by @code{global-mark-ring-max}, and is 16 by default.
321 326
322@kindex C-x C-@key{SPC} 327@kindex C-x C-@key{SPC}
323@findex pop-global-mark 328@findex pop-global-mark
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index f83ac38469a..426610e65b9 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -1678,6 +1678,11 @@ all server buffers are finished. You can take as long as you like to
1678edit the server buffers within Emacs, and they are @emph{not} killed 1678edit the server buffers within Emacs, and they are @emph{not} killed
1679when you type @kbd{C-x #} in them. 1679when you type @kbd{C-x #} in them.
1680 1680
1681@item --parent-id @var{ID}
1682Open an @command{emacsclient} frame as a client frame in the parent X
1683window with id @var{ID}, via the XEmbed protocol. Currently, this
1684option is mainly useful for developers.
1685
1681@item -q 1686@item -q
1682@itemx --quiet 1687@itemx --quiet
1683Do not let @command{emacsclient} display messages about waiting for 1688Do not let @command{emacsclient} display messages about waiting for
@@ -2567,7 +2572,7 @@ not use it.
2567key bindings. 2572key bindings.
2568@end table 2573@end table
2569 2574
2570@node Hyperlinking, Dissociated Press, Emulation, Top 2575@node Hyperlinking, Amusements, Emulation, Top
2571@section Hyperlinking and Navigation Features 2576@section Hyperlinking and Navigation Features
2572 2577
2573@cindex hyperlinking 2578@cindex hyperlinking
@@ -2733,82 +2738,14 @@ Display a menu of files and URLs mentioned in current buffer, then
2733find the one you select (@code{ffap-menu}). 2738find the one you select (@code{ffap-menu}).
2734@end table 2739@end table
2735 2740
2736@node Dissociated Press, Amusements, Hyperlinking, Top 2741@node Amusements, Customization, Hyperlinking, Top
2737@section Dissociated Press
2738
2739@findex dissociated-press
2740 @kbd{M-x dissociated-press} is a command for scrambling a file of text
2741either word by word or character by character. Starting from a buffer of
2742straight English, it produces extremely amusing output. The input comes
2743from the current Emacs buffer. Dissociated Press writes its output in a
2744buffer named @samp{*Dissociation*}, and redisplays that buffer after every
2745couple of lines (approximately) so you can read the output as it comes out.
2746
2747 Dissociated Press asks every so often whether to continue generating
2748output. Answer @kbd{n} to stop it. You can also stop at any time by
2749typing @kbd{C-g}. The dissociation output remains in the
2750@samp{*Dissociation*} buffer for you to copy elsewhere if you wish.
2751
2752@cindex presidentagon
2753 Dissociated Press operates by jumping at random from one point in
2754the buffer to another. In order to produce plausible output rather
2755than gibberish, it insists on a certain amount of overlap between the
2756end of one run of consecutive words or characters and the start of the
2757next. That is, if it has just output `president' and then decides to
2758jump to a different point in the buffer, it might spot the `ent' in
2759`pentagon' and continue from there, producing `presidentagon'. Long
2760sample texts produce the best results.
2761
2762@cindex againformation
2763 A positive argument to @kbd{M-x dissociated-press} tells it to operate
2764character by character, and specifies the number of overlap characters. A
2765negative argument tells it to operate word by word, and specifies the number
2766of overlap words. In this mode, whole words are treated as the elements to
2767be permuted, rather than characters. No argument is equivalent to an
2768argument of two. For your againformation, the output goes only into the
2769buffer @samp{*Dissociation*}. The buffer you start with is not changed.
2770
2771@cindex Markov chain
2772@cindex ignoriginal
2773@cindex techniquitous
2774 Dissociated Press produces results fairly like those of a Markov
2775chain based on a frequency table constructed from the sample text. It
2776is, however, an independent, ignoriginal invention. Dissociated Press
2777techniquitously copies several consecutive characters from the sample
2778text between random jumps, unlike a Markov chain which would jump
2779randomly after each word or character. This makes for more plausible
2780sounding results, and runs faster.
2781
2782@cindex outragedy
2783@cindex buggestion
2784@cindex properbose
2785@cindex mustatement
2786@cindex developediment
2787@cindex userenced
2788 It is a mustatement that too much use of Dissociated Press can be a
2789developediment to your real work, sometimes to the point of outragedy.
2790And keep dissociwords out of your documentation, if you want it to be well
2791userenced and properbose. Have fun. Your buggestions are welcome.
2792
2793@node Amusements, Customization, Dissociated Press, Top
2794@section Other Amusements 2742@section Other Amusements
2795@cindex boredom 2743@cindex boredom
2796@findex hanoi
2797@findex yow
2798@findex gomoku
2799@cindex tower of Hanoi
2800 2744
2801 If you are a little bit bored, you can try @kbd{M-x hanoi}. If you are 2745@findex animate-birthday-present
2802considerably bored, give it a numeric argument. If you are very, very 2746@cindex animate
2803bored, try an argument of 9. Sit back and watch. 2747 The @code{animate} package makes text dance. For an example, try
2804 2748@kbd{M-x animate-birthday-present}.
2805@cindex Go Moku
2806 If you want a little more personal involvement, try @kbd{M-x gomoku},
2807which plays the game Go Moku with you.
2808
2809@findex bubbles
2810 @kbd{M-x bubbles} is a game in which the object is to remove as many
2811bubbles as you can in the smallest number of moves.
2812 2749
2813@findex blackbox 2750@findex blackbox
2814@findex mpuz 2751@findex mpuz
@@ -2821,73 +2758,82 @@ puzzle with letters standing for digits in a code that you must
2821guess---to guess a value, type a letter and then the digit you think it 2758guess---to guess a value, type a letter and then the digit you think it
2822stands for. The aim of @code{5x5} is to fill in all the squares. 2759stands for. The aim of @code{5x5} is to fill in all the squares.
2823 2760
2761@findex bubbles
2762 @kbd{M-x bubbles} is a game in which the object is to remove as many
2763bubbles as you can in the smallest number of moves.
2764
2824@findex decipher 2765@findex decipher
2825@cindex ciphers 2766@cindex ciphers
2826@cindex cryptanalysis 2767@cindex cryptanalysis
2827@kbd{M-x decipher} helps you to cryptanalyze a buffer which is encrypted 2768 @kbd{M-x decipher} helps you to cryptanalyze a buffer which is
2828in a simple monoalphabetic substitution cipher. 2769encrypted in a simple monoalphabetic substitution cipher.
2770
2771@findex dissociated-press
2772 @kbd{M-x dissociated-press} scrambles the text in the current Emacs
2773buffer, word by word or character by character, writing its output to
2774a buffer named @samp{*Dissociation*}. A positive argument tells it to
2775operate character by character, and specifies the number of overlap
2776characters. A negative argument tells it to operate word by word, and
2777specifies the number of overlap words. Dissociated Press produces
2778results fairly like those of a Markov chain, but is however, an
2779independent, ignoriginal invention; it techniquitously copies several
2780consecutive characters from the sample text between random jumps,
2781unlike a Markov chain which would jump randomly after each word or
2782character. Keep dissociwords out of your documentation, if you want
2783it to be well userenced and properbose.
2829 2784
2830@findex dunnet 2785@findex dunnet
2831 @kbd{M-x dunnet} runs an adventure-style exploration game, which is 2786 @kbd{M-x dunnet} runs an text-based adventure game.
2832a bigger sort of puzzle.
2833 2787
2834@findex lm 2788@findex gomoku
2835@cindex landmark game 2789@cindex Go Moku
2836@kbd{M-x lm} runs a relatively non-participatory game in which a robot 2790 If you want a little more personal involvement, try @kbd{M-x gomoku},
2837attempts to maneuver towards a tree at the center of the window based on 2791which plays the game Go Moku with you.
2838unique olfactory cues from each of the four directions. 2792
2793@cindex tower of Hanoi
2794@findex hanoi
2795 If you are a little bit bored, you can try @kbd{M-x hanoi}. If you are
2796considerably bored, give it a numeric argument. If you are very, very
2797bored, try an argument of 9. Sit back and watch.
2839 2798
2840@findex life 2799@findex life
2841@cindex Life 2800@cindex Life
2842@kbd{M-x life} runs Conway's ``Life'' cellular automaton. 2801 @kbd{M-x life} runs Conway's ``Life'' cellular automaton.
2802
2803@findex lm
2804@cindex landmark game
2805 @kbd{M-x lm} runs a relatively non-participatory game in which a
2806robot attempts to maneuver towards a tree at the center of the window
2807based on unique olfactory cues from each of the four directions.
2843 2808
2844@findex morse-region 2809@findex morse-region
2845@findex unmorse-region 2810@findex unmorse-region
2846@cindex Morse code 2811@cindex Morse code
2847@cindex --/---/.-./.../. 2812@cindex --/---/.-./.../.
2848@kbd{M-x morse-region} converts text in a region to Morse code and 2813 @kbd{M-x morse-region} converts text in a region to Morse code and
2849@kbd{M-x unmorse-region} converts it back. No cause for remorse. 2814@kbd{M-x unmorse-region} converts it back. No cause for remorse.
2850 2815
2851@findex pong 2816@findex pong
2852@cindex Pong game 2817@cindex Pong game
2853@kbd{M-x pong} plays a Pong-like game, bouncing the ball off opposing
2854bats.
2855
2856@findex solitaire
2857@cindex solitaire
2858@kbd{M-x solitaire} plays a game of solitaire in which you jump pegs
2859across other pegs.
2860
2861@findex animate-birthday-present
2862@cindex animate
2863The @code{animate} package makes text dance. For an example, try
2864@kbd{M-x animate-birthday-present}.
2865
2866@findex studlify-region
2867@cindex StudlyCaps
2868@kbd{M-x studlify-region} studlify-cases the region, producing
2869text like this:
2870
2871@example
2872M-x stUdlIfY-RegioN stUdlIfY-CaSeS thE region.
2873@end example
2874
2875@findex tetris 2818@findex tetris
2876@cindex Tetris 2819@cindex Tetris
2877@findex snake 2820@findex snake
2878@cindex Snake 2821@cindex Snake
2879@kbd{M-x tetris} runs an implementation of the well-known Tetris game. 2822 @kbd{M-x pong}, @kbd{M-x snake} and @kbd{M-x tetris} are
2880Likewise, @kbd{M-x snake} provides an implementation of Snake. 2823implementations of the well-known Pong, Snake and Tetris games.
2881 2824
2882 When you are frustrated, try the famous Eliza program. Just do 2825@findex solitaire
2883@kbd{M-x doctor}. End each input by typing @key{RET} twice. 2826@cindex solitaire
2884 2827 @kbd{M-x solitaire} plays a game of solitaire in which you jump pegs
2885@cindex Zippy 2828across other pegs.
2886 When you are feeling strange, type @kbd{M-x yow}.
2887 2829
2888@findex zone 2830@findex zone
2889The command @kbd{M-x zone} plays games with the display when Emacs is 2831 The command @kbd{M-x zone} plays games with the display when Emacs
2890idle. 2832is idle.
2833
2834 Finally, if you find yourself frustrated, try the famous Eliza
2835program. Just do @kbd{M-x doctor}. End each input by typing
2836@key{RET} twice.
2891 2837
2892@ifnottex 2838@ifnottex
2893@lowersections 2839@lowersections
diff --git a/doc/emacs/modes.texi b/doc/emacs/modes.texi
new file mode 100644
index 00000000000..314d5d4347e
--- /dev/null
+++ b/doc/emacs/modes.texi
@@ -0,0 +1,410 @@
1@c This is part of the Emacs manual.
2@c Copyright (C) 1985-1987, 1993-1995, 1997, 2000-2011
3@c Free Software Foundation, Inc.
4@c See file emacs.texi for copying conditions.
5@node Modes, Indentation, International, Top
6@chapter Editing Modes
7
8 Emacs contains many @dfn{editing modes}, each of which alters its
9basic behavior in useful ways. These are divided into @dfn{major
10modes} and @dfn{minor modes}.
11
12 Major modes provide specialized facilities for working on a
13particular file type, such as a C source file (@pxref{Programs}), or a
14particular type of non-file buffer, such as a shell buffer
15(@pxref{Shell}). Major modes are mutually exclusive; each buffer has
16one and only one major mode at any time.
17
18 Minor modes are optional features which you can turn on or off, not
19necessarily specific to a type of file or buffer. For example, Auto
20Fill mode is a minor mode in which @key{SPC} breaks lines between
21words as you type (@pxref{Auto Fill}). Minor modes are independent of
22one another, and of the selected major mode.
23
24@menu
25* Major Modes:: Text mode vs. Lisp mode vs. C mode...
26* Minor Modes:: Each minor mode is a feature you can turn on
27 independently of any others.
28* Choosing Modes:: How modes are chosen when visiting files.
29@end menu
30
31@node Major Modes
32@section Major Modes
33@cindex major modes
34@cindex mode, major
35@kindex TAB @r{(and major modes)}
36@kindex DEL @r{(and major modes)}
37@kindex C-j @r{(and major modes)}
38
39 Every buffer possesses a major mode, which determines the editing
40behavior of Emacs while that buffer is current. The mode line
41normally shows the name of the current major mode, in parentheses.
42@xref{Mode Line}.
43
44 Usually, the major mode is automatically set by Emacs, when you
45first visit a file or create a buffer. @xref{Choosing Modes}. You
46can explicitly select a new major mode by using an @kbd{M-x} command.
47Take the name of the mode and add @code{-mode} to get the name of the
48command to select that mode. Thus, you can enter Lisp mode with
49@kbd{M-x lisp-mode}.
50
51 The least specialized major mode is called @dfn{Fundamental mode}.
52This mode has no mode-specific redefinitions or variable settings, so
53that each Emacs command behaves in its most general manner, and each
54user option variable is in its default state.
55
56 For editing text of a specific type that Emacs knows about, such as
57Lisp code or English text, you typically use a more specialized major
58mode, such as Lisp mode or Text mode. Such major modes change the
59meanings of some keys to become more specifically adapted to the
60language being edited. The ones that are commonly changed are
61@key{TAB}, @key{DEL}, and @kbd{C-j}. The prefix key @kbd{C-c}
62normally contains mode-specific commands. In addition, the commands
63which handle comments use the mode to determine how comments are to be
64delimited. Many major modes redefine the syntactical properties of
65characters appearing in the buffer.
66
67 The major modes fall into three major groups. The first group
68contains modes for normal text, either plain or with mark-up. It
69includes Text mode, HTML mode, SGML mode, @TeX{} mode and Outline
70mode. The second group contains modes for specific programming
71languages. These include Lisp mode (which has several variants), C
72mode, Fortran mode, and others. The remaining major modes are not
73intended for use on users' files; they are used in buffers created for
74specific purposes by Emacs, such as Dired mode for buffers made by
75Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
76(@pxref{Sending Mail}), and Shell mode for buffers used for
77communicating with an inferior shell process (@pxref{Interactive
78Shell}).
79
80 Most programming-language major modes specify that only blank lines
81separate paragraphs. This is to make the paragraph commands useful.
82(@xref{Paragraphs}.) They also cause Auto Fill mode to use the
83definition of @key{TAB} to indent the new lines it creates. This is
84because most lines in a program are usually indented
85(@pxref{Indentation}).
86
87@node Minor Modes
88@section Minor Modes
89@cindex minor modes
90@cindex mode, minor
91
92 A minor mode is an optional editing modes that alters the behavior
93of Emacs in some well-defined way. Unlike major modes, any number of
94minor modes can be in effect at any time. Some minor modes are
95@dfn{buffer-local}: they apply only to the current buffer, so you can
96enable the mode in certain buffers and not others. Other minor modes
97are @dfn{global}: while enabled, they affect everything you do in the
98Emacs session, in all buffers. Some global minor modes are enabled by
99default.
100
101 Most minor modes say in the mode line when they are enabled, just
102after the major mode indicator. For example, @samp{Fill} in the mode
103line means that Auto Fill mode is enabled. @xref{Mode Line}.
104
105 Each minor mode is associated with a command, called the @dfn{mode
106command}, which turns it on or off. The name of this command consists
107of the name of the minor mode, followed by @samp{-mode}; for instance,
108the mode command for Auto Fill mode is @code{auto-fill-mode}. Calling
109the minor mode command with no prefix argument @dfn{toggles} the mode,
110turning it on if it was off, and off if it was on. A positive
111argument always turns the mode on, and a zero or negative argument
112always turns it off. Mode commands are usually invoked with
113@kbd{M-x}, but you can bind keys to them if you wish (@pxref{Key
114Bindings}).
115
116 Most minor modes also have a @dfn{mode variable}, with the same name
117as the mode command. Its value is non-@code{nil} if the mode is
118enabled, and @code{nil} if it is disabled. In some minor modes---but
119not all---the value of the variable alone determines whether the mode
120is active: the mode command works simply by setting the variable, and
121changing the value of the variable has the same effect as calling the
122mode command. Because not all minor modes work this way, we recommend
123that you avoid changing the mode variables directly; use the mode
124commands instead.
125
126 The following is a list of some buffer-local minor modes:
127
128@itemize @bullet
129@item
130Abbrev mode automatically expands text based on pre-defined
131abbreviation definitions. @xref{Abbrevs}.
132
133@item
134Auto Fill mode inserts newlines as you type to prevent lines from
135becoming too long. @xref{Filling}.
136
137@item
138Auto Save mode saves the buffer contents periodically to reduce the
139amount of work you can lose in case of a crash. @xref{Auto Save}.
140
141@item
142Enriched mode enables editing and saving of formatted text.
143@xref{Formatted Text}.
144
145@item
146Flyspell mode automatically highlights misspelled words.
147@xref{Spelling}.
148
149@item
150Font-Lock mode automatically highlights certain textual units found in
151programs. It is enabled globally by default, but you can disable it
152in individual buffers. @xref{Faces}.
153
154@findex linum-mode
155@cindex Linum mode
156@item
157Linum mode displays each line's line number in the window's left
158margin. Its mode command is @code{linum-mode}.
159
160@item
161Outline minor mode provides similar facilities to the major mode
162called Outline mode. @xref{Outline Mode}.
163
164@cindex Overwrite mode
165@cindex mode, Overwrite
166@findex overwrite-mode
167@kindex INSERT
168@item
169Overwrite mode causes ordinary printing characters to replace existing
170text instead of shoving it to the right. For example, if point is in
171front of the @samp{B} in @samp{FOOBAR}, then in Overwrite mode typing
172a @kbd{G} changes it to @samp{FOOGAR}, instead of producing
173@samp{FOOGBAR} as usual. In Overwrite mode, the command @kbd{C-q}
174inserts the next character whatever it may be, even if it is a
175digit---this gives you a way to insert a character instead of
176replacing an existing character. The mode command,
177@code{overwrite-mode}, is bound to the @key{Insert} key.
178
179@findex binary-overwrite-mode
180@item
181Binary Overwrite mode is a variant of Overwrite mode for editing
182binary files; it treats newlines and tabs like other characters, so
183that they overwrite other characters and can be overwritten by them.
184In Binary Overwrite mode, digits after @kbd{C-q} specify an octal
185character code, as usual.
186
187@item
188Visual Line mode performs ``word wrapping'', causing long lines to be
189wrapped at word boundaries. @xref{Visual Line Mode}.
190@end itemize
191
192 Here are some useful global minor modes. Since Line Number mode and
193Transient Mark mode can be enabled or disabled just by setting the
194value of the minor mode variable, you @emph{can} set them differently
195for particular buffers, by explicitly making the corresponding
196variable local in those buffers. @xref{Locals}.
197
198@itemize @bullet
199@item
200Column Number mode enables display of the current column number in the
201mode line. @xref{Mode Line}.
202
203@item
204Delete Selection mode causes text insertion to first delete the text
205in the region, if the region is active. @xref{Using Region}.
206
207@item
208Icomplete mode displays an indication of available completions when
209you are in the minibuffer and completion is active. @xref{Completion
210Options}.
211
212@item
213Line Number mode enables display of the current line number in the
214mode line. It is enabled by default. @xref{Mode Line}.
215
216@item
217Menu Bar mode gives each frame a menu bar. It is enabled by default.
218@xref{Menu Bars}.
219
220@item
221Scroll Bar mode gives each window a scroll bar. It is enabled by
222default, but the scroll bar is only displayed on graphical terminals.
223@xref{Scroll Bars}.
224
225@item
226Tool Bar mode gives each frame a tool bar. It is enabled by default,
227but the tool bar is only displayed on graphical terminals. @xref{Tool
228Bars}.
229
230@item
231Transient Mark mode highlights the region, and makes many Emacs
232commands operate on the region when the mark is active. It is enabled
233by default. @xref{Mark}.
234@end itemize
235
236@node Choosing Modes
237@section Choosing File Modes
238
239@cindex choosing a major mode
240@cindex choosing a minor mode
241@vindex auto-mode-alist
242 When you visit a file, Emacs chooses a major mode automatically.
243Normally, it makes the choice based on the file name---for example,
244files whose names end in @samp{.c} are normally edited in C mode---but
245sometimes it chooses the major mode based on special text in the file.
246This special text can also be used to enable buffer-local minor modes.
247
248 Here is the exact procedure:
249
250 First, Emacs checks whether the file contains file-local mode
251variables. @xref{File Variables}. If there is a file-local variable
252that specifies a major mode, then Emacs uses that major mode, ignoring
253all other criteria. There are several methods to specify a major mode
254using a file-local variable; the simplest is to put the mode name in
255the first nonblank line, preceded and followed by @samp{-*-}. Other
256text may appear on the line as well. For example,
257
258@example
259; -*-Lisp-*-
260@end example
261
262@noindent
263tells Emacs to use Lisp mode. Note how the semicolon is used to make
264Lisp treat this line as a comment. Alternatively, you could write
265
266@example
267; -*- mode: Lisp;-*-
268@end example
269
270@noindent
271The latter format allows you to specify local variables as well, like
272this:
273
274@example
275; -*- mode: Lisp; tab-width: 4; -*-
276@end example
277
278 If a file variable specifies a buffer-local minor mode, Emacs
279enables that minor mode in the buffer.
280
281@vindex interpreter-mode-alist
282 Second, if there is no file variable specifying a major mode, Emacs
283checks whether the file's contents begin with @samp{#!}. If so, that
284indicates that the file can serve as an executable shell command,
285which works by running an interpreter named on the file's first line
286(the rest of the file is used as input to the interpreter).
287Therefore, Emacs tries to use the interpreter name to choose a mode.
288For instance, a file that begins with @samp{#!/usr/bin/perl} is opened
289in Perl mode. The variable @code{interpreter-mode-alist} specifies
290the correspondence between interpreter program names and major modes.
291
292 When the first line starts with @samp{#!}, you usually cannot use
293the @samp{-*-} feature on the first line, because the system would get
294confused when running the interpreter. So Emacs looks for @samp{-*-}
295on the second line in such files as well as on the first line. The
296same is true for man pages which start with the magic string
297@samp{'\"} to specify a list of troff preprocessors.
298
299@vindex magic-mode-alist
300 Third, Emacs tries to determine the major mode by looking at the
301text at the start of the buffer, based on the variable
302@code{magic-mode-alist}. By default, this variable is @code{nil} (an
303empty list), so Emacs skips this step; however, you can customize it
304in your init file (@pxref{Init File}). The value should be a list of
305elements of the form
306
307@example
308(@var{regexp} . @var{mode-function})
309@end example
310
311@noindent
312where @var{regexp} is a regular expression (@pxref{Regexps}), and
313@var{mode-function} is a Lisp function that toggles a major mode. If
314the text at the beginning of the file matches @var{regexp}, Emacs
315chooses the major mode specified by @var{mode-function}.
316
317Alternatively, an element of @code{magic-mode-alist} may have the form
318
319@example
320(@var{match-function} . @var{mode-function})
321@end example
322
323@noindent
324where @var{match-function} is a Lisp function that is called at the
325beginning of the buffer; if the function returns non-@code{nil}, Emacs
326set the major mode wit @var{mode-function}.
327
328 Fourth---if Emacs still hasn't found a suitable major mode---it
329looks at the file's name. The correspondence between file names and
330major modes is controlled by the variable @code{auto-mode-alist}. Its
331value is a list in which each element has this form,
332
333@example
334(@var{regexp} . @var{mode-function})
335@end example
336
337@noindent
338or this form,
339
340@example
341(@var{regexp} @var{mode-function} @var{flag})
342@end example
343
344@noindent
345For example, one element normally found in the list has the form
346@code{(@t{"\\.c\\'"} . c-mode)}, and it is responsible for selecting C
347mode for files whose names end in @file{.c}. (Note that @samp{\\} is
348needed in Lisp syntax to include a @samp{\} in the string, which must
349be used to suppress the special meaning of @samp{.} in regexps.) If
350the element has the form @code{(@var{regexp} @var{mode-function}
351@var{flag})} and @var{flag} is non-@code{nil}, then after calling
352@var{mode-function}, Emacs discards the suffix that matched
353@var{regexp} and searches the list again for another match.
354
355@vindex auto-mode-case-fold
356 On systems with case-insensitive file names, such as Microsoft
357Windows, Emacs performs a single case-insensitive search through
358@code{auto-mode-alist}. On other systems, Emacs normally performs a
359single case-sensitive search through the alist. However, if you
360change the variable @code{auto-mode-case-fold} to @code{t}, Emacs
361performs a second case-insensitive search if the first search fails.
362
363@vindex magic-fallback-mode-alist
364 Finally, if Emacs @emph{still} hasn't found a major mode to use, it
365compares the text at the start of the buffer to the variable
366@code{magic-fallback-mode-alist}. This variable works like
367@code{magic-mode-alist}, described above, except that is consulted
368only after @code{auto-mode-alist}. By default,
369@code{magic-fallback-mode-alist} contains forms that check for image
370files, HTML/XML/SGML files, and Postscript files.
371
372@vindex major-mode
373 Once a major mode is chosen, Emacs sets the value of the variable
374@code{major-mode} to the symbol for that major mode (e.g.,
375@code{text-mode} for Text mode). This is a per-buffer variable
376(@pxref{Locals}); its buffer-local value is set automatically, and you
377should not change it yourself.
378
379 The default value of @code{major-mode} determines the major mode to
380use for files that do not specify a major mode, and for new buffers
381created with @kbd{C-x b}. Normally, this default value is the symbol
382@code{fundamental-mode}, which specifies Fundamental mode. You can
383change it via the Customization interface (@pxref{Easy
384Customization}), or by adding a line like this to your init file
385(@pxref{Init File}):
386
387@smallexample
388(setq-default major-mode 'text-mode)
389@end smallexample
390
391@noindent
392If the default value of @code{major-mode} is @code{nil}, the major
393mode is taken from the previously current buffer.
394
395@findex normal-mode
396 If you have changed the major mode of a buffer, you can return to
397the major mode Emacs would have chosen automatically, by typing
398@kbd{M-x normal-mode}. This is the same function that
399@code{find-file} calls to choose the major mode. It also processes
400the file's @samp{-*-} line or local variables list (if any).
401@xref{File Variables}.
402
403@vindex change-major-mode-with-file-name
404 The commands @kbd{C-x C-w} and @code{set-visited-file-name} change to
405a new major mode if the new file name implies a mode (@pxref{Saving}).
406(@kbd{C-x C-s} does this too, if the buffer wasn't visiting a file.)
407However, this does not happen if the buffer contents specify a major
408mode, and certain ``special'' major modes do not allow the mode to
409change. You can turn off this mode-changing feature by setting
410@code{change-major-mode-with-file-name} to @code{nil}.
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi
index 56fe20f0794..533872ddf61 100644
--- a/doc/emacs/msdog.texi
+++ b/doc/emacs/msdog.texi
@@ -445,10 +445,10 @@ any name mentioned in @ref{Init File}.
445 445
446@cindex @file{_emacs} init file, MS-Windows 446@cindex @file{_emacs} init file, MS-Windows
447 Because MS-DOS does not allow file names with leading dots, and 447 Because MS-DOS does not allow file names with leading dots, and
448because older Windows systems made it hard to create files with such 448older Windows systems made it hard to create files with such names,
449names, the Windows port of Emacs supports an alternative name 449the Windows port of Emacs supports an init file name @file{_emacs}, if
450@file{_emacs} as a fallback, if such a file exists in the home 450such a file exists in the home directory and @file{.emacs} does not.
451directory, whereas @file{.emacs} does not. 451This name is considered obsolete.
452 452
453@node Windows Keyboard 453@node Windows Keyboard
454@section Keyboard Usage on MS-Windows 454@section Keyboard Usage on MS-Windows
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index a721e0c204b..3c970ecb12c 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -1,7 +1,7 @@
1@c This is part of the Emacs manual. 1@c This is part of the Emacs manual.
2@c Copyright (C) 1997, 1999-2011 Free Software Foundation, Inc. 2@c Copyright (C) 1997, 1999-2011 Free Software Foundation, Inc.
3@c See file emacs.texi for copying conditions. 3@c See file emacs.texi for copying conditions.
4@node International, Major Modes, Frames, Top 4@node International, Modes, Frames, Top
5@chapter International Character Set Support 5@chapter International Character Set Support
6@c This node is referenced in the tutorial. When renaming or deleting 6@c This node is referenced in the tutorial. When renaming or deleting
7@c it, the tutorial needs to be adjusted. (TUTORIAL.de) 7@c it, the tutorial needs to be adjusted. (TUTORIAL.de)
@@ -761,6 +761,7 @@ aliases for @code{undecided-unix}, @code{undecided-dos}, and
761the end-of-line conversion, and leave the character code conversion to 761the end-of-line conversion, and leave the character code conversion to
762be deduced from the text itself. 762be deduced from the text itself.
763 763
764@cindex @code{raw-text}, coding system
764 The coding system @code{raw-text} is good for a file which is mainly 765 The coding system @code{raw-text} is good for a file which is mainly
765@acronym{ASCII} text, but may contain byte values above 127 which are 766@acronym{ASCII} text, but may contain byte values above 127 which are
766not meant to encode non-@acronym{ASCII} characters. With 767not meant to encode non-@acronym{ASCII} characters. With
@@ -771,6 +772,7 @@ end-of-line conversion in the usual way, based on the data
771encountered, and has the usual three variants to specify the kind of 772encountered, and has the usual three variants to specify the kind of
772end-of-line conversion to use. 773end-of-line conversion to use.
773 774
775@cindex @code{no-conversion}, coding system
774 In contrast, the coding system @code{no-conversion} specifies no 776 In contrast, the coding system @code{no-conversion} specifies no
775character code conversion at all---none for non-@acronym{ASCII} byte values and 777character code conversion at all---none for non-@acronym{ASCII} byte values and
776none for end of line. This is useful for reading or writing binary 778none for end of line. This is useful for reading or writing binary
@@ -782,6 +784,7 @@ the @kbd{M-x find-file-literally} command. This uses
782@code{no-conversion}, and also suppresses other Emacs features that 784@code{no-conversion}, and also suppresses other Emacs features that
783might convert the file contents before you see them. @xref{Visiting}. 785might convert the file contents before you see them. @xref{Visiting}.
784 786
787@cindex @code{emacs-internal}, coding system
785 The coding system @code{emacs-internal} (or @code{utf-8-emacs}, 788 The coding system @code{emacs-internal} (or @code{utf-8-emacs},
786which is equivalent) means that the file contains non-@acronym{ASCII} 789which is equivalent) means that the file contains non-@acronym{ASCII}
787characters stored with the internal Emacs encoding. This coding 790characters stored with the internal Emacs encoding. This coding
diff --git a/doc/emacs/picture-xtra.texi b/doc/emacs/picture-xtra.texi
index 7e72fb0acb6..0dcfc7a9627 100644
--- a/doc/emacs/picture-xtra.texi
+++ b/doc/emacs/picture-xtra.texi
@@ -245,7 +245,8 @@ rectangle commands may also be useful.
245@table @kbd 245@table @kbd
246@item C-c C-k 246@item C-c C-k
247Clear out the region-rectangle with spaces 247Clear out the region-rectangle with spaces
248(@code{picture-clear-rectangle}). With argument, delete the text. 248(@code{picture-clear-rectangle}). With a prefix argument, delete the
249text.
249@item C-c C-w @var{r} 250@item C-c C-w @var{r}
250Similar, but save rectangle contents in register @var{r} first 251Similar, but save rectangle contents in register @var{r} first
251(@code{picture-clear-rectangle-to-register}). 252(@code{picture-clear-rectangle-to-register}).
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 803f6b6ce49..870986d421a 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -643,8 +643,9 @@ balanced.
643 When talking about these facilities, the term ``parenthesis'' also 643 When talking about these facilities, the term ``parenthesis'' also
644includes braces, brackets, or whatever delimiters are defined to match 644includes braces, brackets, or whatever delimiters are defined to match
645in pairs. The major mode controls which delimiters are significant, 645in pairs. The major mode controls which delimiters are significant,
646through the syntax table (@pxref{Syntax}). In Lisp, only parentheses 646through the syntax table (@pxref{Syntax Tables,, Syntax Tables, elisp,
647count; in C, these commands apply to braces and brackets too. 647The Emacs Lisp Reference Manual}). In Lisp, only parentheses count;
648in C, these commands apply to braces and brackets too.
648 649
649 You can use @kbd{M-x check-parens} to find any unbalanced 650 You can use @kbd{M-x check-parens} to find any unbalanced
650parentheses and unbalanced string quotes in the buffer. 651parentheses and unbalanced string quotes in the buffer.
diff --git a/doc/emacs/regs.texi b/doc/emacs/regs.texi
index 42ce85c7ee1..b4b9fd252e1 100644
--- a/doc/emacs/regs.texi
+++ b/doc/emacs/regs.texi
@@ -35,16 +35,16 @@ Bookmarks are similar enough in spirit to registers that they
35seem to belong in this chapter. 35seem to belong in this chapter.
36 36
37@menu 37@menu
38* Position: RegPos. Saving positions in registers. 38* Position Registers:: Saving positions in registers.
39* Text: RegText. Saving text in registers. 39* Text Registers:: Saving text in registers.
40* Rectangle: RegRect. Saving rectangles in registers. 40* Rectangle Registers:: Saving rectangles in registers.
41* Configurations: RegConfig. Saving window configurations in registers. 41* Configuration Registers:: Saving window configurations in registers.
42* Numbers: RegNumbers. Numbers in registers. 42* Number Registers:: Numbers in registers.
43* Files: RegFiles. File names in registers. 43* File Registers:: File names in registers.
44* Bookmarks:: Bookmarks are like registers, but persistent. 44* Bookmarks:: Bookmarks are like registers, but persistent.
45@end menu 45@end menu
46 46
47@node RegPos 47@node Position Registers
48@section Saving Positions in Registers 48@section Saving Positions in Registers
49@cindex saving position in a register 49@cindex saving position in a register
50 50
@@ -76,7 +76,7 @@ was saved from has been killed, @kbd{C-x r j} tries to create the buffer
76again by visiting the same file. Of course, this works only for buffers 76again by visiting the same file. Of course, this works only for buffers
77that were visiting files. 77that were visiting files.
78 78
79@node RegText 79@node Text Registers
80@section Saving Text in Registers 80@section Saving Text in Registers
81@cindex saving text in a register 81@cindex saving text in a register
82 82
@@ -123,7 +123,7 @@ the region text to the text in the register instead of
123after, but with a numeric argument (@kbd{C-u}) it puts point after the 123after, but with a numeric argument (@kbd{C-u}) it puts point after the
124text and the mark before. 124text and the mark before.
125 125
126@node RegRect 126@node Rectangle Registers
127@section Saving Rectangles in Registers 127@section Saving Rectangles in Registers
128@cindex saving rectangle in a register 128@cindex saving rectangle in a register
129 129
@@ -150,7 +150,7 @@ one.
150 See also the command @code{sort-columns}, which you can think of 150 See also the command @code{sort-columns}, which you can think of
151as sorting a rectangle. @xref{Sorting}. 151as sorting a rectangle. @xref{Sorting}.
152 152
153@node RegConfig 153@node Configuration Registers
154@section Saving Window Configurations in Registers 154@section Saving Window Configurations in Registers
155@cindex saving window configuration in a register 155@cindex saving window configuration in a register
156 156
@@ -178,7 +178,7 @@ restore a frame configuration, any existing frames not included in the
178configuration become invisible. If you wish to delete these frames 178configuration become invisible. If you wish to delete these frames
179instead, use @kbd{C-u C-x r j @var{r}}. 179instead, use @kbd{C-u C-x r j @var{r}}.
180 180
181@node RegNumbers 181@node Number Registers
182@section Keeping Numbers in Registers 182@section Keeping Numbers in Registers
183@cindex saving number in a register 183@cindex saving number in a register
184 184
@@ -205,7 +205,7 @@ register contents into the buffer. @kbd{C-x r +} with no numeric
205argument increments the register value by 1; @kbd{C-x r n} with no 205argument increments the register value by 1; @kbd{C-x r n} with no
206numeric argument stores zero in the register. 206numeric argument stores zero in the register.
207 207
208@node RegFiles 208@node File Registers
209@section Keeping File Names in Registers 209@section Keeping File Names in Registers
210@cindex saving file name in a register 210@cindex saving file name in a register
211 211
diff --git a/doc/emacs/screen.texi b/doc/emacs/screen.texi
index 0bc3ce3db8c..59f65fac8af 100644
--- a/doc/emacs/screen.texi
+++ b/doc/emacs/screen.texi
@@ -73,14 +73,14 @@ different places in the buffer; for example, you can place point by
73clicking mouse button 1 (normally the left button) at the desired 73clicking mouse button 1 (normally the left button) at the desired
74location. 74location.
75 75
76 While the cursor appears to be @emph{on} a character, you should 76 If you use a block cursor, the cursor appears to be @emph{on} a
77think of point as @emph{between} two characters; it points @emph{before} 77character, but you should think of point as @emph{between} two
78the character that appears under the cursor. For example, if your text 78characters; it points @emph{before} the character that appears under
79looks like @samp{frob} with the cursor over the @samp{b}, then point is 79the cursor. For example, if your text looks like @samp{frob} with the
80between the @samp{o} and the @samp{b}. If you insert the character 80cursor over the @samp{b}, then point is between the @samp{o} and the
81@samp{!} at that position, the result is @samp{fro!b}, with point 81@samp{b}. If you insert the character @samp{!} at that position, the
82between the @samp{!} and the @samp{b}. Thus, the cursor remains over 82result is @samp{fro!b}, with point between the @samp{!} and the
83the @samp{b}, as before. 83@samp{b}. Thus, the cursor remains over the @samp{b}, as before.
84 84
85 Sometimes people speak of ``the cursor'' when they mean ``point,'' or 85 Sometimes people speak of ``the cursor'' when they mean ``point,'' or
86speak of commands that move point as ``cursor motion'' commands. 86speak of commands that move point as ``cursor motion'' commands.
@@ -92,12 +92,14 @@ it again later. When Emacs displays multiple windows, each window has
92its own point location. If the same buffer appears in more than one 92its own point location. If the same buffer appears in more than one
93window, each window has its own point position in that buffer. 93window, each window has its own point position in that buffer.
94 94
95 On a graphical display, Emacs shows a cursor in each window; the 95 On a graphical display, Emacs shows a cursor in each window. The
96selected window's cursor is solid and blinking, and the other cursors 96selected window's cursor will be blinking. If you use the default,
97are hollow. On a text-only terminal, there is just one cursor, in the 97@code{box} cursor type, the selected window's cursor will be solid,
98selected window; even though the unselected windows have their own 98and the other cursors are hollow. On a text-only terminal, there is
99point positions, they do not display a cursor. @xref{Cursor Display}, 99just one cursor, in the selected window; even though the unselected
100for customizable variables that control cursor display. 100windows have their own point positions, they do not display a cursor.
101@xref{Cursor Display}, for customizable variables that control cursor
102display.
101 103
102@node Echo Area 104@node Echo Area
103@section The Echo Area 105@section The Echo Area
@@ -190,7 +192,7 @@ sometimes useful to have this information.
190Systems}). If it is a dash (@samp{-}), that indicates the default 192Systems}). If it is a dash (@samp{-}), that indicates the default
191state of affairs: no special character set handling, except for the 193state of affairs: no special character set handling, except for the
192end-of-line translations described in the next paragraph. @samp{=} 194end-of-line translations described in the next paragraph. @samp{=}
193means no conversion whatsoever. Letters represent various nontrivial 195means no conversion whatsoever. Characters represent various nontrivial
194@dfn{coding systems}---for example, @samp{1} represents ISO Latin-1. 196@dfn{coding systems}---for example, @samp{1} represents ISO Latin-1.
195On a text-only terminal, @var{cs} is preceded by two additional 197On a text-only terminal, @var{cs} is preceded by two additional
196characters that describe the coding system for keyboard input and the 198characters that describe the coding system for keyboard input and the
diff --git a/doc/emacs/search.texi b/doc/emacs/search.texi
index b5d426210aa..015f9529b73 100644
--- a/doc/emacs/search.texi
+++ b/doc/emacs/search.texi
@@ -870,8 +870,9 @@ matches at the end of the buffer only if the contents end with a
870word-constituent character. 870word-constituent character.
871 871
872@item \w 872@item \w
873matches any word-constituent character. The syntax table 873matches any word-constituent character. The syntax table determines
874determines which characters these are. @xref{Syntax}. 874which characters these are. @xref{Syntax Tables,, Syntax Tables,
875elisp, The Emacs Lisp Reference Manual}.
875 876
876@item \W 877@item \W
877matches any character that is not a word-constituent. 878matches any character that is not a word-constituent.
@@ -892,7 +893,8 @@ symbol-constituent character.
892matches any character whose syntax is @var{c}. Here @var{c} is a 893matches any character whose syntax is @var{c}. Here @var{c} is a
893character that designates a particular syntax class: thus, @samp{w} 894character that designates a particular syntax class: thus, @samp{w}
894for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.} 895for word constituent, @samp{-} or @samp{ } for whitespace, @samp{.}
895for ordinary punctuation, etc. @xref{Syntax}. 896for ordinary punctuation, etc. @xref{Syntax Tables,, Syntax Tables,
897elisp, The Emacs Lisp Reference Manual}.
896 898
897@item \S@var{c} 899@item \S@var{c}
898matches any character whose syntax is not @var{c}. 900matches any character whose syntax is not @var{c}.
@@ -911,8 +913,9 @@ matches any character that does @emph{not} belong to category
911@var{c}. 913@var{c}.
912@end table 914@end table
913 915
914 The constructs that pertain to words and syntax are controlled by the 916 The constructs that pertain to words and syntax are controlled by
915setting of the syntax table (@pxref{Syntax}). 917the setting of the syntax table. @xref{Syntax Tables,, Syntax Tables,
918elisp, The Emacs Lisp Reference Manual}.
916 919
917@node Regexp Example 920@node Regexp Example
918@section Regular Expression Example 921@section Regular Expression Example
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index c0139c60557..e3f5c05d8da 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -154,9 +154,10 @@ the mark by one additional word. @kbd{M-@@} also accepts a numeric
154argument that says how many words to scan for the place to put the 154argument that says how many words to scan for the place to put the
155mark. 155mark.
156 156
157 The word commands' understanding of word boundaries is controlled 157 The word commands' understanding of word boundaries is controlled by
158by the syntax table. Any character can, for example, be declared to 158the syntax table. Any character can, for example, be declared to be a
159be a word delimiter. @xref{Syntax}. 159word delimiter. @xref{Syntax Tables,, Syntax Tables, elisp, The Emacs
160Lisp Reference Manual}.
160 161
161@node Sentences 162@node Sentences
162@section Sentences 163@section Sentences
@@ -406,8 +407,6 @@ Text}).
406* Fill Commands:: Commands to refill paragraphs and center lines. 407* Fill Commands:: Commands to refill paragraphs and center lines.
407* Fill Prefix:: Filling paragraphs that are indented or in a comment, etc. 408* Fill Prefix:: Filling paragraphs that are indented or in a comment, etc.
408* Adaptive Fill:: How Emacs can determine the fill prefix automatically. 409* Adaptive Fill:: How Emacs can determine the fill prefix automatically.
409* Refill:: Keeping paragraphs filled.
410* Longlines:: Editing text with very long lines.
411@end menu 410@end menu
412 411
413@node Auto Fill 412@node Auto Fill
@@ -722,92 +721,6 @@ line, and it should return the appropriate fill prefix based on that
722line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets 721line. If it returns @code{nil}, @code{adaptive-fill-regexp} gets
723a chance to find a prefix. 722a chance to find a prefix.
724 723
725@node Refill
726@subsection Refill Mode
727@cindex refilling text, word processor style
728@cindex modes, Refill
729@cindex Refill minor mode
730
731 Refill minor mode provides support for keeping paragraphs filled as
732you type or modify them in other ways. It provides an effect similar
733to typical word processor behavior. This works by running a
734paragraph-filling command at suitable times.
735
736 To toggle the use of Refill mode in the current buffer, type
737@kbd{M-x refill-mode}. When you are typing text, only characters
738which normally trigger auto filling, like the space character, will
739trigger refilling. This is to avoid making it too slow. Apart from
740self-inserting characters, other commands which modify the text cause
741refilling.
742
743 The current implementation is preliminary and not robust. You can
744get better ``line wrapping'' behavior using Longlines mode.
745@xref{Longlines}. However, Longlines mode has an important
746side-effect: the newlines that it inserts for you are not saved to
747disk, so the files that you make with Longlines mode will appear to be
748completely unfilled if you edit them without Longlines mode.
749
750@node Longlines
751@subsection Long Lines Mode
752@cindex refilling text, word processor style
753@cindex modes, Long Lines
754@cindex word wrap
755@cindex Long Lines minor mode
756
757 Sometimes, you may come across ``unfilled'' text files, which Emacs
758normally displays as a bunch of extremely long lines. Comfortably
759reading and editing such files normally requires ``word wrap'', a
760feature that breaks up each long text line into multiple screen lines
761in a readable manner---by putting the breaks at word boundaries. Many
762text editors, such as those built into many web browsers, perform word
763wrapping by default.
764
765 There are two different minor modes in Emacs that perform word
766wrapping. The first is Visual Line mode, which does it by altering
767the behavior of screen line continuation. @xref{Visual Line Mode},
768for information about Visual Line mode.
769
770@findex longlines-mode
771 Instead of using Visual Line mode, you can use a minor mode called
772Long Lines mode. Long Lines mode wraps lines by inserting or deleting
773@dfn{soft newlines} as you type (@pxref{Hard and Soft Newlines}).
774These soft newlines won't show up when you save the buffer into a
775file, or when you copy the text into the kill ring, clipboard, or a
776register. Unlike Visual Line mode, Lone Lines mode breaks long lines
777at the fill column (@pxref{Fill Commands}), rather than the right
778window edge. To enable Long Lines mode, type @kbd{M-x
779longlines-mode}. If the text is full of long lines, this also
780immediately ``wraps'' them all.
781
782@findex longlines-auto-wrap
783 The word wrap performed by Long Lines mode is @emph{not} the same as
784ordinary filling (@pxref{Fill Commands}). It does not contract
785multiple spaces into a single space, recognize fill prefixes
786(@pxref{Fill Prefix}), or perform adaptive filling (@pxref{Adaptive
787Fill}). The reason for this is that a wrapped line is still,
788conceptually, a single line. Each soft newline is equivalent to
789exactly one space in that long line, and vice versa. However, you can
790still call filling functions such as @kbd{M-q}, and these will work as
791expected, inserting soft newlines that won't show up on disk or when
792the text is copied. You can even rely entirely on the normal fill
793commands by turning off automatic line wrapping, with @kbd{C-u M-x
794longlines-auto-wrap}. To turn automatic line wrapping back on, type
795@kbd{M-x longlines-auto-wrap}.
796
797@findex longlines-show-hard-newlines
798 Type @kbd{RET} to insert a hard newline, one which automatic
799refilling will not remove. If you want to see where all the hard
800newlines are, type @kbd{M-x longlines-show-hard-newlines}. This will
801mark each hard newline with a special symbol. The same command with a
802prefix argument turns this display off.
803
804 Long Lines mode does not change normal text files that are already
805filled, since the existing newlines are considered hard newlines.
806Before Long Lines can do anything, you need to transform each
807paragraph into a long line. One way is to set @code{fill-column} to a
808large number (e.g., @kbd{C-u 9999 C-x f}), re-fill all the paragraphs,
809and then set @code{fill-column} back to its original value.
810
811@node Case 724@node Case
812@section Case Conversion Commands 725@section Case Conversion Commands
813@cindex case conversion 726@cindex case conversion
@@ -2593,16 +2506,16 @@ Recognize tables within the current region and activate them.
2593Deactivate tables within the current region. 2506Deactivate tables within the current region.
2594@findex table-recognize-table 2507@findex table-recognize-table
2595@item M-x table-recognize-table 2508@item M-x table-recognize-table
2596Recognize the table under point and activate it. 2509Recognize the table at point and activate it.
2597@findex table-unrecognize-table 2510@findex table-unrecognize-table
2598@item M-x table-unrecognize-table 2511@item M-x table-unrecognize-table
2599Deactivate the table under point. 2512Deactivate the table at point.
2600@findex table-recognize-cell 2513@findex table-recognize-cell
2601@item M-x table-recognize-cell 2514@item M-x table-recognize-cell
2602Recognize the cell under point and activate it. 2515Recognize the cell at point and activate it.
2603@findex table-unrecognize-cell 2516@findex table-unrecognize-cell
2604@item M-x table-unrecognize-cell 2517@item M-x table-unrecognize-cell
2605Deactivate the cell under point. 2518Deactivate the cell at point.
2606@end table 2519@end table
2607 2520
2608 For another way of converting text into tables, see @ref{Table 2521 For another way of converting text into tables, see @ref{Table
diff --git a/doc/emacs/trouble.texi b/doc/emacs/trouble.texi
index 28c0285cf03..4be892639fc 100644
--- a/doc/emacs/trouble.texi
+++ b/doc/emacs/trouble.texi
@@ -698,15 +698,8 @@ If at all possible, give a full recipe for an Emacs started with the
698@cindex dribble file 698@cindex dribble file
699@cindex logging keystrokes 699@cindex logging keystrokes
700One way to record the input to Emacs precisely is to write a dribble 700One way to record the input to Emacs precisely is to write a dribble
701file. To start the file, execute the Lisp expression 701file. To start the file, use the @kbd{M-x open-dribble-file
702 702@key{RET}} command. From then on, Emacs copies all your input to the
703@example
704(open-dribble-file "~/dribble")
705@end example
706
707@noindent
708using @kbd{M-:} or from the @samp{*scratch*} buffer just after
709starting Emacs. From then on, Emacs copies all your input to the
710specified dribble file until the Emacs process is killed. 703specified dribble file until the Emacs process is killed.
711 704
712@item 705@item
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 7946e4b91ff..153d7e839c3 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,138 @@
12011-07-14 Eli Zaretskii <eliz@gnu.org>
2
3 * display.texi (Other Display Specs): Document that `left-fringe'
4 and `right-fringe' display specifications are of the "replacing"
5 kind.
6
72011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
8
9 * help.texi (Documentation Basics): Add a link to the Function
10 Documentation node (bug#6580).
11
122011-07-13 Lars Magne Ingebrigtsen <larsi@gnus.org>
13
14 * keymaps.texi (Menu Bar): Mention :visible and :enable
15 (bug#6344). Text by Drew Adams.
16
17 * modes.texi (Running Hooks): Mention buffer-local hook variables
18 (bug#6218).
19
20 * objects.texi (General Escape Syntax): "a with grave accent" is
21 ?xe0, not ?x8e0 (bug#5259).
22
232011-07-12 Chong Yidong <cyd@stupidchicken.com>
24
25 * display.texi (Face Attributes, Font Selection): Add references
26 to the Fonts node in the Emacs manual (Bug#4178).
27
282011-07-12 Chong Yidong <cyd@stupidchicken.com>
29
30 * display.texi (Window Systems): `window-system' is
31 terminal-local.
32
33 * frames.texi (Frame Parameters, Parameter Access): Don't mention
34 frame-local variables.
35
36 * variables.texi (Buffer-Local Variables): Don't mention obsolete
37 frame-local variables.
38 (Frame-Local Variables): Node deleted.
39
40 * elisp.texi (Top): Update node listing.
41
422011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
43
44 * elisp.texi: Change "inferiors" to "subnodes" in three places
45 (bug#3523).
46
472011-07-11 Chong Yidong <cyd@stupidchicken.com>
48
49 * frames.texi (Window System Selections): Discussion of
50 x-select-enable-clipboard moved to Emacs manual.
51
522011-07-11 Deniz Dogan <deniz@dogan.se>
53
54 * commands.texi (Prefix Command Arguments): Remove excessive
55 apostrophe.
56
572011-07-11 Lars Magne Ingebrigtsen <larsi@gnus.org>
58
59 * syntax.texi (Syntax Descriptors): Clarify that the ". 23" syntax
60 description is a string (bug#3313).
61
62 * frames.texi (Display Feature Testing): Try to explain what all
63 the visual classes mean (bug#3042).
64
652011-07-10 Lars Magne Ingebrigtsen <larsi@gnus.org>
66
67 * modes.texi (Mode Line Variables): Document `mode-line-remote'
68 and `mode-line-client' (bug#2974).
69
70 * text.texi (Insertion): Clarify marker movements (bug#1651).
71 Text from Drew Adams.
72
732011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
74
75 * text.texi (Special Properties): Clarify the format of `face'
76 (bug#1375).
77
78 * commands.texi (Interactive Call): Add a `call-interactively'
79 example (bug#1010).
80
812011-07-06 Lars Magne Ingebrigtsen <larsi@gnus.org>
82
83 * functions.texi (Calling Functions): Link to the "Interactive
84 Call" node (bug#1001).
85
862011-07-06 Chong Yidong <cyd@stupidchicken.com>
87
88 * customize.texi (Composite Types): Move alist and plist to here
89 from Simple Types (Bug#7545).
90
91 * elisp.texi (Top): Update menu description.
92
93 * display.texi (Face Attributes): Document negative line widths
94 (Bug#6113).
95
962011-07-03 Tobias C. Rittweiler <tcr@freebits.de> (tiny change)
97
98 * searching.texi (Match Data): Note that match data can be
99 overwritten by most functions (bug#2499).
100
1012011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
102
103 * strings.texi (Formatting Strings): Clarify what the "-" and "0"
104 flags mean (bug#6659).
105
106 * functions.texi (What Is a Function): Document the autoload
107 object (bug#6496).
108
1092011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
110
111 * customize.texi (Variable Definitions): Clarify that SETFUNCTION
112 is only used in the Customize user interface (bug#6089).
113
114 * display.texi (Showing Images): Mention the point of sliced
115 images (bug#7836).
116
1172011-07-02 Eli Zaretskii <eliz@gnu.org>
118
119 * variables.texi (Defining Variables, Void Variables)
120 (Constant Variables): Fix incorrect usage of @kindex.
121
1222011-07-02 Lars Magne Ingebrigtsen <larsi@gnus.org>
123
124 * variables.texi (Defining Variables): Add an index entry for
125 `set-variable' (bug#7262).
126 (Defining Variables): Use @findex for functions.
127
128 * frames.texi (Basic Parameters): Document the `explicit-name'
129 parameter (bug#6951).
130
131 * customize.texi (Type Keywords): Clarify that :value provides a
132 default value for all types (bug#7386).
133
134 * streams.texi (Output Functions): Document `pp'.
135
12011-06-25 Chong Yidong <cyd@stupidchicken.com> 1362011-06-25 Chong Yidong <cyd@stupidchicken.com>
2 137
3 * keymaps.texi (Searching Keymaps): 138 * keymaps.texi (Searching Keymaps):
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index eb42ddb11a4..e76b2bafd79 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -597,13 +597,32 @@ realistic example of using @code{commandp}.
597 597
598@defun call-interactively command &optional record-flag keys 598@defun call-interactively command &optional record-flag keys
599This function calls the interactively callable function @var{command}, 599This function calls the interactively callable function @var{command},
600reading arguments according to its interactive calling specifications. 600providing arguments according to its interactive calling specifications.
601It returns whatever @var{command} returns. An error is signaled if 601It returns whatever @var{command} returns.
602@var{command} is not a function or if it cannot be called 602
603interactively (i.e., is not a command). Note that keyboard macros 603If, for instance, you have a function with the following signature:
604(strings and vectors) are not accepted, even though they are 604
605considered commands, because they are not functions. If @var{command} 605@example
606is a symbol, then @code{call-interactively} uses its function definition. 606(defun foo (begin end)
607 (interactive "r")
608 ...)
609@end example
610
611then saying
612
613@example
614(call-interactively 'foo)
615@end example
616
617will call @code{foo} with the region (@code{point} and @code{mark}) as
618the arguments.
619
620An error is signaled if @var{command} is not a function or if it
621cannot be called interactively (i.e., is not a command). Note that
622keyboard macros (strings and vectors) are not accepted, even though
623they are considered commands, because they are not functions. If
624@var{command} is a symbol, then @code{call-interactively} uses its
625function definition.
607 626
608@cindex record command history 627@cindex record command history
609If @var{record-flag} is non-@code{nil}, then this command and its 628If @var{record-flag} is non-@code{nil}, then this command and its
@@ -2993,7 +3012,7 @@ An integer, which stands for itself.
2993 3012
2994@item 3013@item
2995A list of one element, which is an integer. This form of prefix 3014A list of one element, which is an integer. This form of prefix
2996argument results from one or a succession of @kbd{C-u}'s with no 3015argument results from one or a succession of @kbd{C-u}s with no
2997digits. The numeric value is the integer in the list, but some 3016digits. The numeric value is the integer in the list, but some
2998commands make a distinction between such a list and an integer alone. 3017commands make a distinction between such a list and an integer alone.
2999 3018
diff --git a/doc/lispref/customize.texi b/doc/lispref/customize.texi
index e58c8c298c9..868edaa5bd4 100644
--- a/doc/lispref/customize.texi
+++ b/doc/lispref/customize.texi
@@ -326,11 +326,12 @@ individual types for a description of how to use @code{:options}.
326@item :set @var{setfunction} 326@item :set @var{setfunction}
327@kindex set@r{, @code{defcustom} keyword} 327@kindex set@r{, @code{defcustom} keyword}
328Specify @var{setfunction} as the way to change the value of this 328Specify @var{setfunction} as the way to change the value of this
329option. The function @var{setfunction} should take two arguments, a 329option when using the Customize user interface. The function
330symbol (the option name) and the new value, and should do whatever is 330@var{setfunction} should take two arguments, a symbol (the option
331necessary to update the value properly for this option (which may not 331name) and the new value, and should do whatever is necessary to update
332mean simply setting the option as a Lisp variable). The default for 332the value properly for this option (which may not mean simply setting
333@var{setfunction} is @code{set-default}. 333the option as a Lisp variable). The default for @var{setfunction} is
334@code{set-default}.
334 335
335@item :get @var{getfunction} 336@item :get @var{getfunction}
336@kindex get@r{, @code{defcustom} keyword} 337@kindex get@r{, @code{defcustom} keyword}
@@ -512,8 +513,7 @@ equivalent to @code{(string)}.
512Introduction, widget, The Emacs Widget Library}, for details. 513Introduction, widget, The Emacs Widget Library}, for details.
513 514
514@menu 515@menu
515* Simple Types:: Simple customization types: sexp, integer, number, 516* Simple Types:: Simple customization types: sexp, integer, etc.
516 string, file, directory, alist.
517* Composite Types:: Build new types from other types or data. 517* Composite Types:: Build new types from other types or data.
518* Splicing into Lists:: Splice elements into list with @code{:inline}. 518* Splicing into Lists:: Splice elements into list with @code{:inline}.
519* Type Keywords:: Keyword-argument pairs in a customization type. 519* Type Keywords:: Keyword-argument pairs in a customization type.
@@ -576,22 +576,103 @@ You can use the @code{:options} keyword in a hook variable's
576@code{defcustom} to specify a list of functions recommended for use in 576@code{defcustom} to specify a list of functions recommended for use in
577the hook; see @ref{Variable Definitions}. 577the hook; see @ref{Variable Definitions}.
578 578
579@item alist 579@item symbol
580The value must be a list of cons-cells, the @sc{car} of each cell 580The value must be a symbol. It appears in the customization buffer as
581representing a key, and the @sc{cdr} of the same cell representing an 581the name of the symbol.
582associated value. The user can add and delete key/value pairs, and
583edit both the key and the value of each pair.
584 582
585You can specify the key and value types like this: 583@item function
584The value must be either a lambda expression or a function name. When
585it is a function name, you can do completion with @kbd{M-@key{TAB}}.
586 586
587@smallexample 587@item variable
588(alist :key-type @var{key-type} :value-type @var{value-type}) 588The value must be a variable name, and you can do completion with
589@end smallexample 589@kbd{M-@key{TAB}}.
590
591@item face
592The value must be a symbol which is a face name, and you can do
593completion with @kbd{M-@key{TAB}}.
594
595@item boolean
596The value is boolean---either @code{nil} or @code{t}. Note that by
597using @code{choice} and @code{const} together (see the next section),
598you can specify that the value must be @code{nil} or @code{t}, but also
599specify the text to describe each value in a way that fits the specific
600meaning of the alternative.
601
602@item coding-system
603The value must be a coding-system name, and you can do completion with
604@kbd{M-@key{TAB}}.
605
606@item color
607The value must be a valid color name, and you can do completion with
608@kbd{M-@key{TAB}}. A sample is provided.
609@end table
610
611@node Composite Types
612@subsection Composite Types
613@cindex composite types (customization)
614
615 When none of the simple types is appropriate, you can use composite
616types, which build new types from other types or from specified data.
617The specified types or data are called the @dfn{arguments} of the
618composite type. The composite type normally looks like this:
619
620@example
621(@var{constructor} @var{arguments}@dots{})
622@end example
590 623
591@noindent 624@noindent
592where @var{key-type} and @var{value-type} are customization type 625but you can also add keyword-value pairs before the arguments, like
593specifications. The default key type is @code{sexp}, and the default 626this:
594value type is @code{sexp}. 627
628@example
629(@var{constructor} @r{@{}@var{keyword} @var{value}@r{@}}@dots{} @var{arguments}@dots{})
630@end example
631
632 Here is a table of constructors and how to use them to write
633composite types:
634
635@table @code
636@item (cons @var{car-type} @var{cdr-type})
637The value must be a cons cell, its @sc{car} must fit @var{car-type}, and
638its @sc{cdr} must fit @var{cdr-type}. For example, @code{(cons string
639symbol)} is a customization type which matches values such as
640@code{("foo" . foo)}.
641
642In the customization buffer, the @sc{car} and the @sc{cdr} are
643displayed and edited separately, each according to the type
644that you specify for it.
645
646@item (list @var{element-types}@dots{})
647The value must be a list with exactly as many elements as the
648@var{element-types} given; and each element must fit the
649corresponding @var{element-type}.
650
651For example, @code{(list integer string function)} describes a list of
652three elements; the first element must be an integer, the second a
653string, and the third a function.
654
655In the customization buffer, each element is displayed and edited
656separately, according to the type specified for it.
657
658@item (group @var{element-types}@dots{})
659This works like @code{list} except for the formatting
660of text in the Custom buffer. @code{list} labels each
661element value with its tag; @code{group} does not.
662
663@item (vector @var{element-types}@dots{})
664Like @code{list} except that the value must be a vector instead of a
665list. The elements work the same as in @code{list}.
666
667@item (alist :key-type @var{key-type} :value-type @var{value-type})
668The value must be a list of cons-cells, the @sc{car} of each cell
669representing a key of customization type @var{key-type}, and the
670@sc{cdr} of the same cell representing a value of customization type
671@var{value-type}. The user can add and delete key/value pairs, and
672edit both the key and the value of each pair.
673
674If omitted, @var{key-type} and @var{value-type} default to
675@code{sexp}.
595 676
596The user can add any key matching the specified key type, but you can 677The user can add any key matching the specified key type, but you can
597give some keys a preferential treatment by specifying them with the 678give some keys a preferential treatment by specifying them with the
@@ -686,105 +767,11 @@ and the VALUE is a list of that person's pets."
686 :type '(alist :value-type (repeat string))) 767 :type '(alist :value-type (repeat string)))
687@end smallexample 768@end smallexample
688 769
689@item plist 770@item (plist :key-type @var{key-type} :value-type @var{value-type})
690The @code{plist} custom type is similar to the @code{alist} (see above), 771This customization type is similar to @code{alist} (see above), except
691except that the information is stored as a property list, i.e. a list of 772that (i) the information is stored as a property list,
692this form: 773(@pxref{Property Lists}), and (ii) @var{key-type}, if omitted,
693 774defaults to @code{symbol} rather than @code{sexp}.
694@smallexample
695(@var{key} @var{value} @var{key} @var{value} @var{key} @var{value} @dots{})
696@end smallexample
697
698The default @code{:key-type} for @code{plist} is @code{symbol},
699rather than @code{sexp}.
700
701@item symbol
702The value must be a symbol. It appears in the customization buffer as
703the name of the symbol.
704
705@item function
706The value must be either a lambda expression or a function name. When
707it is a function name, you can do completion with @kbd{M-@key{TAB}}.
708
709@item variable
710The value must be a variable name, and you can do completion with
711@kbd{M-@key{TAB}}.
712
713@item face
714The value must be a symbol which is a face name, and you can do
715completion with @kbd{M-@key{TAB}}.
716
717@item boolean
718The value is boolean---either @code{nil} or @code{t}. Note that by
719using @code{choice} and @code{const} together (see the next section),
720you can specify that the value must be @code{nil} or @code{t}, but also
721specify the text to describe each value in a way that fits the specific
722meaning of the alternative.
723
724@item coding-system
725The value must be a coding-system name, and you can do completion with
726@kbd{M-@key{TAB}}.
727
728@item color
729The value must be a valid color name, and you can do completion with
730@kbd{M-@key{TAB}}. A sample is provided.
731@end table
732
733@node Composite Types
734@subsection Composite Types
735@cindex composite types (customization)
736
737 When none of the simple types is appropriate, you can use composite
738types, which build new types from other types or from specified data.
739The specified types or data are called the @dfn{arguments} of the
740composite type. The composite type normally looks like this:
741
742@example
743(@var{constructor} @var{arguments}@dots{})
744@end example
745
746@noindent
747but you can also add keyword-value pairs before the arguments, like
748this:
749
750@example
751(@var{constructor} @r{@{}@var{keyword} @var{value}@r{@}}@dots{} @var{arguments}@dots{})
752@end example
753
754 Here is a table of constructors and how to use them to write
755composite types:
756
757@table @code
758@item (cons @var{car-type} @var{cdr-type})
759The value must be a cons cell, its @sc{car} must fit @var{car-type}, and
760its @sc{cdr} must fit @var{cdr-type}. For example, @code{(cons string
761symbol)} is a customization type which matches values such as
762@code{("foo" . foo)}.
763
764In the customization buffer, the @sc{car} and the @sc{cdr} are
765displayed and edited separately, each according to the type
766that you specify for it.
767
768@item (list @var{element-types}@dots{})
769The value must be a list with exactly as many elements as the
770@var{element-types} given; and each element must fit the
771corresponding @var{element-type}.
772
773For example, @code{(list integer string function)} describes a list of
774three elements; the first element must be an integer, the second a
775string, and the third a function.
776
777In the customization buffer, each element is displayed and edited
778separately, according to the type specified for it.
779
780@item (group @var{element-types}@dots{})
781This works like @code{list} except for the formatting
782of text in the Custom buffer. @code{list} labels each
783element value with its tag; @code{group} does not.
784
785@item (vector @var{element-types}@dots{})
786Like @code{list} except that the value must be a vector instead of a
787list. The elements work the same as in @code{list}.
788 775
789@item (choice @var{alternative-types}@dots{}) 776@item (choice @var{alternative-types}@dots{})
790The value must fit at least one of @var{alternative-types}. 777The value must fit at least one of @var{alternative-types}.
@@ -1035,7 +1022,12 @@ meanings:
1035 1022
1036@table @code 1023@table @code
1037@item :value @var{default} 1024@item :value @var{default}
1038This is used for a type that appears as an alternative inside of 1025Provide a default value.
1026
1027If @code{nil} is not a valid value for the alternative, then it is
1028essential to specify a valid default with @code{:value}.
1029
1030If you use this for a type that appears as an alternative inside of
1039@code{choice}; it specifies the default value to use, at first, if and 1031@code{choice}; it specifies the default value to use, at first, if and
1040when the user selects this alternative with the menu in the 1032when the user selects this alternative with the menu in the
1041customization buffer. 1033customization buffer.
@@ -1043,9 +1035,6 @@ customization buffer.
1043Of course, if the actual value of the option fits this alternative, it 1035Of course, if the actual value of the option fits this alternative, it
1044will appear showing the actual value, not @var{default}. 1036will appear showing the actual value, not @var{default}.
1045 1037
1046If @code{nil} is not a valid value for the alternative, then it is
1047essential to specify a valid default with @code{:value}.
1048
1049@item :format @var{format-string} 1038@item :format @var{format-string}
1050@kindex format@r{, customization keyword} 1039@kindex format@r{, customization keyword}
1051This string will be inserted in the buffer to represent the value 1040This string will be inserted in the buffer to represent the value
diff --git a/doc/lispref/display.texi b/doc/lispref/display.texi
index 069b3c91d7b..d8be424a69f 100644
--- a/doc/lispref/display.texi
+++ b/doc/lispref/display.texi
@@ -1800,9 +1800,9 @@ height.
1800@cindex faces 1800@cindex faces
1801 1801
1802 A @dfn{face} is a collection of graphical attributes for displaying 1802 A @dfn{face} is a collection of graphical attributes for displaying
1803text: font family, foreground color, background color, optional 1803text: font, foreground color, background color, optional underlining,
1804underlining, and so on. Faces control how buffer text is displayed, 1804and so on. Faces control how buffer text is displayed, and how some
1805and how some parts of the frame, such as the mode-line, are displayed. 1805parts of the frame, such as the mode-line, are displayed.
1806@xref{Standard Faces,,, emacs, The GNU Emacs Manual}, for the list of 1806@xref{Standard Faces,,, emacs, The GNU Emacs Manual}, for the list of
1807faces Emacs normally comes with. 1807faces Emacs normally comes with.
1808 1808
@@ -2001,16 +2001,17 @@ attribute is ignored.
2001 2001
2002@table @code 2002@table @code
2003@item :family 2003@item :family
2004Font family name or fontset name (a string). If you specify a font 2004Font family or fontset (a string). @xref{Fonts,,, emacs, The GNU
2005family name, the wild-card characters @samp{*} and @samp{?} are 2005Emacs Manual}. If you specify a font family name, the wild-card
2006allowed. The function @code{font-family-list}, described below, 2006characters @samp{*} and @samp{?} are allowed. The function
2007returns a list of available family names. @xref{Fontsets}, for 2007@code{font-family-list}, described below, returns a list of available
2008information about fontsets. 2008family names. @xref{Fontsets}, for information about fontsets.
2009 2009
2010@item :foundry 2010@item :foundry
2011The name of the @dfn{font foundry} in which the font family specified 2011The name of the @dfn{font foundry} for the font family specified by
2012by the @code{:family} attribute is located (a string). The wild-card 2012the @code{:family} attribute (a string). The wild-card characters
2013characters @samp{*} and @samp{?} are allowed. 2013@samp{*} and @samp{?} are allowed. @xref{Fonts,,, emacs, The GNU
2014Emacs Manual}.
2014 2015
2015@item :width 2016@item :width
2016Relative proportionate character width, also known as the character 2017Relative proportionate character width, also known as the character
@@ -2092,7 +2093,10 @@ Draw a box with lines of width 1, in color @var{color}.
2092 2093
2093@item @code{(:line-width @var{width} :color @var{color} :style @var{style})} 2094@item @code{(:line-width @var{width} :color @var{color} :style @var{style})}
2094This way you can explicitly specify all aspects of the box. The value 2095This way you can explicitly specify all aspects of the box. The value
2095@var{width} specifies the width of the lines to draw; it defaults to 1. 2096@var{width} specifies the width of the lines to draw; it defaults to
20971. A negative width @var{-n} means to draw a line of width @var{n}
2098that occupies the space of the underlying text, thus avoiding any
2099increase in the character height or width.
2096 2100
2097The value @var{color} specifies the color to draw with. The default is 2101The value @var{color} specifies the color to draw with. The default is
2098the foreground color of the face for simple boxes, and the background 2102the foreground color of the face for simple boxes, and the background
@@ -2681,14 +2685,15 @@ usually assign faces to around 400 to 600 characters at each call.
2681 Before Emacs can draw a character on a particular display, it must 2685 Before Emacs can draw a character on a particular display, it must
2682select a @dfn{font} for that character@footnote{In this context, the 2686select a @dfn{font} for that character@footnote{In this context, the
2683term @dfn{font} has nothing to do with Font Lock (@pxref{Font Lock 2687term @dfn{font} has nothing to do with Font Lock (@pxref{Font Lock
2684Mode}).}. Normally, Emacs automatically chooses a font based on the 2688Mode}).}. @xref{Fonts,,, emacs, The GNU Emacs Manual}. Normally,
2685faces assigned to that character---specifically, the face attributes 2689Emacs automatically chooses a font based on the faces assigned to that
2686@code{:family}, @code{:weight}, @code{:slant}, and @code{:width} 2690character---specifically, the face attributes @code{:family},
2687(@pxref{Face Attributes}). The choice of font also depends on the 2691@code{:weight}, @code{:slant}, and @code{:width} (@pxref{Face
2688character to be displayed; some fonts can only display a limited set 2692Attributes}). The choice of font also depends on the character to be
2689of characters. If no available font exactly fits the requirements, 2693displayed; some fonts can only display a limited set of characters.
2690Emacs looks for the @dfn{closest matching font}. The variables in 2694If no available font exactly fits the requirements, Emacs looks for
2691this section control how Emacs makes this selection. 2695the @dfn{closest matching font}. The variables in this section
2696control how Emacs makes this selection.
2692 2697
2693@defopt face-font-family-alternatives 2698@defopt face-font-family-alternatives
2694If a given family is specified but does not exist, this variable 2699If a given family is specified but does not exist, this variable
@@ -3894,7 +3899,8 @@ Margins}).
3894@itemx (right-fringe @var{bitmap} @r{[}@var{face}@r{]}) 3899@itemx (right-fringe @var{bitmap} @r{[}@var{face}@r{]})
3895This display specification on any character of a line of text causes 3900This display specification on any character of a line of text causes
3896the specified @var{bitmap} be displayed in the left or right fringes 3901the specified @var{bitmap} be displayed in the left or right fringes
3897for that line. The optional @var{face} specifies the colors to be 3902for that line, instead of the characters that have the display
3903specification. The optional @var{face} specifies the colors to be
3898used for the bitmap. @xref{Fringe Bitmaps}, for the details. 3904used for the bitmap. @xref{Fringe Bitmaps}, for the details.
3899 3905
3900@item (space-width @var{factor}) 3906@item (space-width @var{factor})
@@ -4700,10 +4706,17 @@ it a @code{display} property which specifies @var{image}. @xref{Display
4700Property}. 4706Property}.
4701@end defun 4707@end defun
4702 4708
4709@cindex slice, image
4710@cindex image slice
4703@defun insert-sliced-image image &optional string area rows cols 4711@defun insert-sliced-image image &optional string area rows cols
4704This function inserts @var{image} in the current buffer at point, like 4712This function inserts @var{image} in the current buffer at point, like
4705@code{insert-image}, but splits the image into @var{rows}x@var{cols} 4713@code{insert-image}, but splits the image into @var{rows}x@var{cols}
4706equally sized slices. 4714equally sized slices.
4715
4716If an image is inserted ``sliced'', then the Emacs display engine will
4717treat each slice as a separate image, and allow more intuitive
4718scrolling up/down, instead of jumping up/down the entire image when
4719paging through a buffer that displays (large) images.
4707@end defun 4720@end defun
4708 4721
4709@defun put-image image pos &optional string area 4722@defun put-image image pos &optional string area
@@ -5900,8 +5913,8 @@ differently. An Emacs frame is a single window as far as X is
5900concerned; the individual Emacs windows are not known to X at all. 5913concerned; the individual Emacs windows are not known to X at all.
5901 5914
5902@defvar window-system 5915@defvar window-system
5903This frame-local variable tells Lisp programs what window system Emacs is using 5916This terminal-local variable tells Lisp programs what window system
5904for displaying the frame. The possible values are 5917Emacs is using for displaying the frame. The possible values are
5905 5918
5906@table @code 5919@table @code
5907@item x 5920@item x
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index 264d63511bc..bb05f1b4a0b 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -193,7 +193,7 @@ Appendices
193 --- The Detailed Node Listing --- 193 --- The Detailed Node Listing ---
194 --------------------------------- 194 ---------------------------------
195 195
196Here are other nodes that are inferiors of those already listed, 196Here are other nodes that are subnodes of those already listed,
197mentioned here so you can get to them in one step: 197mentioned here so you can get to them in one step:
198 198
199Introduction 199Introduction
@@ -430,7 +430,6 @@ Variables
430* File Local Variables:: Handling local variable lists in files. 430* File Local Variables:: Handling local variable lists in files.
431* Directory Local Variables:: Local variables common to all files in a 431* Directory Local Variables:: Local variables common to all files in a
432 directory. 432 directory.
433* Frame-Local Variables:: Frame-local bindings for variables.
434* Variable Aliases:: Variables that are aliases for other variables. 433* Variable Aliases:: Variables that are aliases for other variables.
435* Variables with Restricted Values:: Non-constant variables whose value can 434* Variables with Restricted Values:: Non-constant variables whose value can
436 @emph{not} be an arbitrary Lisp object. 435 @emph{not} be an arbitrary Lisp object.
@@ -508,8 +507,7 @@ Writing Customization Definitions
508 507
509Customization Types 508Customization Types
510 509
511* Simple Types:: Simple customization types: sexp, integer, number, 510* Simple Types:: Simple customization types: sexp, integer, etc.
512 string, file, directory, alist.
513* Composite Types:: Build new types from other types or data. 511* Composite Types:: Build new types from other types or data.
514* Splicing into Lists:: Splice elements into list with @code{:inline}. 512* Splicing into Lists:: Splice elements into list with @code{:inline}.
515* Type Keywords:: Keyword-argument pairs in a customization type. 513* Type Keywords:: Keyword-argument pairs in a customization type.
diff --git a/doc/lispref/frames.texi b/doc/lispref/frames.texi
index c5136456177..b6012a4dd53 100644
--- a/doc/lispref/frames.texi
+++ b/doc/lispref/frames.texi
@@ -337,9 +337,6 @@ parameters @code{foreground-color}, @code{background-color},
337If the terminal supports frame transparency, the parameter 337If the terminal supports frame transparency, the parameter
338@code{alpha} is also meaningful. 338@code{alpha} is also meaningful.
339 339
340 You can use frame parameters to define frame-local bindings for
341variables. @xref{Frame-Local Variables}.
342
343@menu 340@menu
344* Parameter Access:: How to change a frame's parameters. 341* Parameter Access:: How to change a frame's parameters.
345* Initial Parameters:: Specifying frame parameters when you make a frame. 342* Initial Parameters:: Specifying frame parameters when you make a frame.
@@ -374,9 +371,6 @@ elements of @var{alist}. Each element of @var{alist} has the form
374parameter. If you don't mention a parameter in @var{alist}, its value 371parameter. If you don't mention a parameter in @var{alist}, its value
375doesn't change. If @var{frame} is @code{nil}, it defaults to the selected 372doesn't change. If @var{frame} is @code{nil}, it defaults to the selected
376frame. 373frame.
377
378You can use this function to define frame-local bindings for
379variables, see @ref{Frame-Local Variables}.
380@end defun 374@end defun
381 375
382@defun set-frame-parameter frame parm value 376@defun set-frame-parameter frame parm value
@@ -520,6 +514,11 @@ you don't specify a name, Emacs sets the frame name automatically
520If you specify the frame name explicitly when you create the frame, the 514If you specify the frame name explicitly when you create the frame, the
521name is also used (instead of the name of the Emacs executable) when 515name is also used (instead of the name of the Emacs executable) when
522looking up X resources for the frame. 516looking up X resources for the frame.
517
518@item explicit-name
519If the frame name was specified explicitly when the frame was created,
520this parameter will be that name. If the frame wasn't explicitly
521named, this parameter will be @code{nil}.
523@end table 522@end table
524 523
525@node Position Parameters 524@node Position Parameters
@@ -1954,30 +1953,34 @@ defined in the file @file{lisp/term/x-win.el}. Use @kbd{M-x apropos
1954@node Window System Selections 1953@node Window System Selections
1955@section Window System Selections 1954@section Window System Selections
1956@cindex selection (for window systems) 1955@cindex selection (for window systems)
1957 1956@cindex clipboard
1958The X server records a set of @dfn{selections} which permit transfer of 1957@cindex primary selection
1959data between application programs. The various selections are 1958@cindex secondary selection
1960distinguished by @dfn{selection types}, represented in Emacs by 1959
1961symbols. X clients including Emacs can read or set the selection for 1960 In the X window system, data can be transferred between different
1962any given type. 1961applications by means of @dfn{selections}. X defines an arbitrary
1962number of @dfn{selection types}, each of which can store its own data;
1963however, only three are commonly used: the @dfn{clipboard},
1964@dfn{primary selection}, and @dfn{secondary selection}. @xref{Cut and
1965Paste,, Cut and Paste, emacs, The GNU Emacs Manual}, for Emacs
1966commands that make use of these selections. This section documents
1967the low-level functions for reading and setting X selections.
1963 1968
1964@deffn Command x-set-selection type data 1969@deffn Command x-set-selection type data
1965This function sets a ``selection'' in the X server. It takes two 1970This function sets an X selection. It takes two arguments: a
1966arguments: a selection type @var{type}, and the value to assign to it, 1971selection type @var{type}, and the value to assign to it, @var{data}.
1967@var{data}. If @var{data} is @code{nil}, it means to clear out the 1972
1968selection. Otherwise, @var{data} may be a string, a symbol, an integer 1973@var{type} should be a symbol; it is usually one of @code{PRIMARY},
1969(or a cons of two integers or list of two integers), an overlay, or a 1974@code{SECONDARY} or @code{CLIPBOARD}. These are symbols with
1970cons of two markers pointing to the same buffer. An overlay or a pair 1975upper-case names, in accord with X Window System conventions. If
1971of markers stands for text in the overlay or between the markers. 1976@var{type} is @code{nil}, that stands for @code{PRIMARY}.
1972 1977
1973The argument @var{data} may also be a vector of valid non-vector 1978If @var{data} is @code{nil}, it means to clear out the selection.
1974selection values. 1979Otherwise, @var{data} may be a string, a symbol, an integer (or a cons
1975 1980of two integers or list of two integers), an overlay, or a cons of two
1976Each possible @var{type} has its own selection value, which changes 1981markers pointing to the same buffer. An overlay or a pair of markers
1977independently. The usual values of @var{type} are @code{PRIMARY}, 1982stands for text in the overlay or between the markers. The argument
1978@code{SECONDARY} and @code{CLIPBOARD}; these are symbols with upper-case 1983@var{data} may also be a vector of valid non-vector selection values.
1979names, in accord with X Window System conventions. If @var{type} is
1980@code{nil}, that stands for @code{PRIMARY}.
1981 1984
1982This function returns @var{data}. 1985This function returns @var{data}.
1983@end deffn 1986@end deffn
@@ -2014,14 +2017,6 @@ and @code{x-set-selection} on MS-Windows support the text data type
2014only; if the clipboard holds other types of data, Emacs treats the 2017only; if the clipboard holds other types of data, Emacs treats the
2015clipboard as empty. 2018clipboard as empty.
2016 2019
2017@defopt x-select-enable-clipboard
2018If this is non-@code{nil}, the Emacs yank functions consult the
2019clipboard before the primary selection, and the kill functions store in
2020the clipboard as well as the primary selection. Otherwise they do not
2021access the clipboard at all. The default is @code{t} on systems with
2022clipboards.
2023@end defopt
2024
2025@node Drag and Drop 2020@node Drag and Drop
2026@section Drag and Drop 2021@section Drag and Drop
2027 2022
@@ -2441,10 +2436,13 @@ For a tty display, it is log to base two of the number of colors supported.
2441@end defun 2436@end defun
2442 2437
2443@defun display-visual-class &optional display 2438@defun display-visual-class &optional display
2444This function returns the visual class for the screen. The value is one 2439This function returns the visual class for the screen. The value is
2445of the symbols @code{static-gray}, @code{gray-scale}, 2440one of the symbols @code{static-gray} (a limited, unchangeable number
2446@code{static-color}, @code{pseudo-color}, @code{true-color}, and 2441of grays), @code{gray-scale} (a full range of grays),
2447@code{direct-color}. 2442@code{static-color} (a limited, unchangeable number of colors),
2443@code{pseudo-color} (a limited number of colors), @code{true-color} (a
2444full range of colors), and @code{direct-color} (a full range of
2445colors).
2448@end defun 2446@end defun
2449 2447
2450@defun display-color-cells &optional display 2448@defun display-color-cells &optional display
diff --git a/doc/lispref/functions.texi b/doc/lispref/functions.texi
index 974487382c8..f3b2375b61d 100644
--- a/doc/lispref/functions.texi
+++ b/doc/lispref/functions.texi
@@ -112,6 +112,13 @@ editors; for Lisp programs, the distinction is normally unimportant.
112@item byte-code function 112@item byte-code function
113A @dfn{byte-code function} is a function that has been compiled by the 113A @dfn{byte-code function} is a function that has been compiled by the
114byte compiler. @xref{Byte-Code Type}. 114byte compiler. @xref{Byte-Code Type}.
115
116@item autoload object
117@cindex autoload object
118An @dfn{autoload object} is a place-holder for a real function. If
119the autoload object is called, it will make Emacs load the file
120containing the definition of the real function, and then call the real
121function instead.
115@end table 122@end table
116 123
117@defun functionp object 124@defun functionp object
@@ -783,6 +790,12 @@ This function returns @var{arg} and has no side effects.
783This function ignores any arguments and returns @code{nil}. 790This function ignores any arguments and returns @code{nil}.
784@end defun 791@end defun
785 792
793 Emacs Lisp functions can also be user-visible @dfn{commands}. A
794command is a function that has an @dfn{interactive} specification.
795You may want to call these functions as if they were called
796interactively. See @ref{Interactive Call} for details on how to do
797that.
798
786@node Mapping Functions 799@node Mapping Functions
787@section Mapping Functions 800@section Mapping Functions
788@cindex mapping functions 801@cindex mapping functions
diff --git a/doc/lispref/help.texi b/doc/lispref/help.texi
index 63fc06c929b..0ce05d55a07 100644
--- a/doc/lispref/help.texi
+++ b/doc/lispref/help.texi
@@ -78,11 +78,12 @@ function or variable that it describes:
78@item 78@item
79@kindex function-documentation 79@kindex function-documentation
80The documentation for a function is usually stored in the function 80The documentation for a function is usually stored in the function
81definition itself (@pxref{Lambda Expressions}). The function 81definition itself (@pxref{Lambda Expressions} and @pxref{Function
82@code{documentation} knows how to extract it. You can also put 82Documentation}). The function @code{documentation} knows how to
83function documentation in the @code{function-documentation} property 83extract it. You can also put function documentation in the
84of the function name. That is useful with definitions such as 84@code{function-documentation} property of the function name. That is
85keyboard macros that can't hold a documentation string. 85useful with definitions such as keyboard macros that can't hold a
86documentation string.
86 87
87@item 88@item
88@kindex variable-documentation 89@kindex variable-documentation
diff --git a/doc/lispref/keymaps.texi b/doc/lispref/keymaps.texi
index cf1db5b7fce..15b2f2079ba 100644
--- a/doc/lispref/keymaps.texi
+++ b/doc/lispref/keymaps.texi
@@ -2262,6 +2262,17 @@ the double-dash and replacing each single dash with capitalization of
2262the following word. Thus, @code{"--:singleLine"}, is equivalent to 2262the following word. Thus, @code{"--:singleLine"}, is equivalent to
2263@code{"--single-line"}. 2263@code{"--single-line"}.
2264 2264
2265 You can use a longer form to specify keywords such as @code{:enable}
2266and @code{:visible} for a menu separator:
2267
2268@code{(menu-item @var{separator-type} nil . @var{item-property-list})}
2269
2270For example:
2271
2272@example
2273(menu-item "--" nil :visible (boundp 'foo))
2274@end example
2275
2265 Some systems and display toolkits don't really handle all of these 2276 Some systems and display toolkits don't really handle all of these
2266separator types. If you use a type that isn't supported, the menu 2277separator types. If you use a type that isn't supported, the menu
2267displays a similar kind of separator that is supported. 2278displays a similar kind of separator that is supported.
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 562cc76c3f0..dd3b2e3038f 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -101,6 +101,11 @@ one, with no arguments.
101The hook variable's value can also be a single function---either a 101The hook variable's value can also be a single function---either a
102lambda expression or a symbol with a function definition---which 102lambda expression or a symbol with a function definition---which
103@code{run-hooks} calls. But this usage is obsolete. 103@code{run-hooks} calls. But this usage is obsolete.
104
105If the hook variable is buffer-local, the buffer-local variable will
106be used instead of the global variable. However, if the buffer-local
107variable contains the element @code{t}, the global hook variable will
108be run as well.
104@end defun 109@end defun
105 110
106@defun run-hook-with-args hook &rest args 111@defun run-hook-with-args hook &rest args
@@ -169,11 +174,11 @@ function goes at the end of the hook list and will be executed last.
169value is a single function; it sets or changes the value to a list of 174value is a single function; it sets or changes the value to a list of
170functions. 175functions.
171 176
172If @var{local} is non-@code{nil}, that says to add @var{function} to 177If @var{local} is non-@code{nil}, that says to add @var{function} to the
173the buffer-local hook list instead of to the global hook list. If 178buffer-local hook list instead of to the global hook list. This makes
174needed, this makes the hook buffer-local and adds @code{t} to the 179the hook buffer-local and adds @code{t} to the buffer-local value. The
175buffer-local value. The latter acts as a flag to run the hook 180latter acts as a flag to run the hook functions in the default value as
176functions in the default value as well as in the local value. 181well as in the local value.
177@end defun 182@end defun
178 183
179@defun remove-hook hook function &optional local 184@defun remove-hook hook function &optional local
@@ -1866,6 +1871,15 @@ default value also displays the recursive editing level, information
1866on the process status, and whether narrowing is in effect. 1871on the process status, and whether narrowing is in effect.
1867@end defopt 1872@end defopt
1868 1873
1874@defopt mode-line-remote
1875This variable is used to show whether @code{default-directory} for the
1876current buffer is remote.
1877@end defopt
1878
1879@defopt mode-line-client
1880This variable is used to identify @code{emacsclient} frames.
1881@end defopt
1882
1869 The following three variables are used in @code{mode-line-modes}: 1883 The following three variables are used in @code{mode-line-modes}:
1870 1884
1871@defvar mode-name 1885@defvar mode-name
diff --git a/doc/lispref/objects.texi b/doc/lispref/objects.texi
index 27d9ba10aef..6d63bb7b750 100644
--- a/doc/lispref/objects.texi
+++ b/doc/lispref/objects.texi
@@ -392,7 +392,7 @@ value is more important than the @acronym{ASCII} representation.
392and the hexadecimal character code. You can use any number of hex 392and the hexadecimal character code. You can use any number of hex
393digits, so you can represent any character code in this way. 393digits, so you can represent any character code in this way.
394Thus, @samp{?\x41} for the character @kbd{A}, @samp{?\x1} for the 394Thus, @samp{?\x41} for the character @kbd{A}, @samp{?\x1} for the
395character @kbd{C-a}, and @code{?\x8e0} for the Latin-1 character 395character @kbd{C-a}, and @code{?\xe0} for the Latin-1 character
396@iftex 396@iftex
397@samp{@`a}. 397@samp{@`a}.
398@end iftex 398@end iftex
@@ -1037,7 +1037,7 @@ digits as necessary. (Multibyte non-@acronym{ASCII} character codes are all
1037greater than 256.) Any character which is not a valid hex digit 1037greater than 256.) Any character which is not a valid hex digit
1038terminates this construct. If the next character in the string could be 1038terminates this construct. If the next character in the string could be
1039interpreted as a hex digit, write @w{@samp{\ }} (backslash and space) to 1039interpreted as a hex digit, write @w{@samp{\ }} (backslash and space) to
1040terminate the hex escape---for example, @w{@samp{\x8e0\ }} represents 1040terminate the hex escape---for example, @w{@samp{\xe0\ }} represents
1041one character, @samp{a} with grave accent. @w{@samp{\ }} in a string 1041one character, @samp{a} with grave accent. @w{@samp{\ }} in a string
1042constant is just like backslash-newline; it does not contribute any 1042constant is just like backslash-newline; it does not contribute any
1043character to the string, but it does terminate the preceding hex escape. 1043character to the string, but it does terminate the preceding hex escape.
diff --git a/doc/lispref/searching.texi b/doc/lispref/searching.texi
index 27b089f75b6..6272301dbb4 100644
--- a/doc/lispref/searching.texi
+++ b/doc/lispref/searching.texi
@@ -1207,6 +1207,12 @@ search you wish to refer back to and the use of the match data. If you
1207can't avoid another intervening search, you must save and restore the 1207can't avoid another intervening search, you must save and restore the
1208match data around it, to prevent it from being overwritten. 1208match data around it, to prevent it from being overwritten.
1209 1209
1210 Notice that all functions are allowed to overwrite the match data
1211unless they're explicitly documented not to do so. A consequence is
1212that functions that are run implictly in the background
1213(@pxref{Timers}, and @ref{Idle Timers}) should likely save and restore
1214the match data explicitly.
1215
1210@menu 1216@menu
1211* Replacing Match:: Replacing a substring that was matched. 1217* Replacing Match:: Replacing a substring that was matched.
1212* Simple Match Data:: Accessing single items of match data, 1218* Simple Match Data:: Accessing single items of match data,
diff --git a/doc/lispref/streams.texi b/doc/lispref/streams.texi
index 9802c7485dd..4d3a66d8852 100644
--- a/doc/lispref/streams.texi
+++ b/doc/lispref/streams.texi
@@ -684,6 +684,12 @@ For example, if the current buffer name is @samp{foo},
684returns @code{"The buffer is foo"}. 684returns @code{"The buffer is foo"}.
685@end defmac 685@end defmac
686 686
687@defun pp object &optional stream
688This function outputs @var{object} to @var{stream}, just like
689@code{prin1}, but does it in a more ``pretty'' way. That is, it'll
690indent and fill the object to make it more readable for humans.
691@end defun
692
687@node Output Variables 693@node Output Variables
688@section Variables Affecting Output 694@section Variables Affecting Output
689@cindex output-controlling variables 695@cindex output-controlling variables
diff --git a/doc/lispref/strings.texi b/doc/lispref/strings.texi
index 05ac40e90c1..2b8911277cd 100644
--- a/doc/lispref/strings.texi
+++ b/doc/lispref/strings.texi
@@ -856,14 +856,16 @@ with @samp{0x} or @samp{0X}. For @samp{%e}, @samp{%f}, and @samp{%g},
856the @samp{#} flag means include a decimal point even if the precision 856the @samp{#} flag means include a decimal point even if the precision
857is zero. 857is zero.
858 858
859 The flag @samp{0} ensures that the padding consists of @samp{0}
860characters instead of spaces. This flag is ignored for non-numerical
861specification characters like @samp{%s}, @samp{%S} and @samp{%c}.
862These specification characters accept the @samp{0} flag, but still pad
863with @emph{spaces}.
864
859 The flag @samp{-} causes the padding inserted by the width 865 The flag @samp{-} causes the padding inserted by the width
860specifier, if any, to be inserted on the right rather than the left. 866specifier, if any, to be inserted on the right rather than the left.
861The flag @samp{0} ensures that the padding consists of @samp{0} 867If both @samp{-} and @samp{0} are present, the @samp{0} flag is
862characters instead of spaces, inserted on the left. These flags are 868ignored.
863ignored for specification characters for which they do not make sense:
864@samp{%s}, @samp{%S} and @samp{%c} accept the @samp{0} flag, but still
865pad with @emph{spaces} on the left. If both @samp{-} and @samp{0} are
866present and valid, @samp{-} takes precedence.
867 869
868@example 870@example
869@group 871@group
diff --git a/doc/lispref/syntax.texi b/doc/lispref/syntax.texi
index 6582a8dfb0c..31ee7eb4e7d 100644
--- a/doc/lispref/syntax.texi
+++ b/doc/lispref/syntax.texi
@@ -108,7 +108,7 @@ Then come the characters for any desired flags. If no matching
108character or flags are needed, one character is sufficient. 108character or flags are needed, one character is sufficient.
109 109
110 For example, the syntax descriptor for the character @samp{*} in C 110 For example, the syntax descriptor for the character @samp{*} in C
111mode is @samp{@w{. 23}} (i.e., punctuation, matching character slot 111mode is @code{". 23"} (i.e., punctuation, matching character slot
112unused, second character of a comment-starter, first character of a 112unused, second character of a comment-starter, first character of a
113comment-ender), and the entry for @samp{/} is @samp{@w{. 14}} (i.e., 113comment-ender), and the entry for @samp{/} is @samp{@w{. 14}} (i.e.,
114punctuation, matching character slot unused, first character of a 114punctuation, matching character slot unused, first character of a
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index 7d2c3831a5a..b91afb044f0 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -364,14 +364,13 @@ after point. Some insertion functions leave point before the inserted
364text, while other functions leave it after. We call the former 364text, while other functions leave it after. We call the former
365insertion @dfn{after point} and the latter insertion @dfn{before point}. 365insertion @dfn{after point} and the latter insertion @dfn{before point}.
366 366
367 Insertion relocates markers that point at positions after the 367 Insertion moves markers located at positions after the insertion
368insertion point, so that they stay with the surrounding text 368point, so that they stay with the surrounding text (@pxref{Markers}).
369(@pxref{Markers}). When a marker points at the place of insertion, 369When a marker points at the place of insertion, insertion may or may
370insertion may or may not relocate the marker, depending on the marker's 370not relocate the marker, depending on the marker's insertion type
371insertion type (@pxref{Marker Insertion Types}). Certain special 371(@pxref{Marker Insertion Types}). Certain special functions such as
372functions such as @code{insert-before-markers} relocate all such markers 372@code{insert-before-markers} relocate all such markers to point after
373to point after the inserted text, regardless of the markers' insertion 373the inserted text, regardless of the markers' insertion type.
374type.
375 374
376 Insertion functions signal an error if the current buffer is 375 Insertion functions signal an error if the current buffer is
377read-only or if they insert within read-only text. 376read-only or if they insert within read-only text.
@@ -2978,8 +2977,7 @@ character.
2978You can use the property @code{face} to control the font and color of 2977You can use the property @code{face} to control the font and color of
2979text. @xref{Faces}, for more information. 2978text. @xref{Faces}, for more information.
2980 2979
2981In the simplest case, the value is a face name. It can also be a list; 2980@code{face} can be the following:
2982then each element can be any of these possibilities;
2983 2981
2984@itemize @bullet 2982@itemize @bullet
2985@item 2983@item
@@ -2994,8 +2992,8 @@ time you want to specify a particular attribute for certain text.
2994@xref{Face Attributes}. 2992@xref{Face Attributes}.
2995@end itemize 2993@end itemize
2996 2994
2997It works to use the latter two forms directly as the value 2995@code{face} can also be a list, where each element uses one of the
2998of the @code{face} property. 2996forms listed above.
2999 2997
3000Font Lock mode (@pxref{Font Lock Mode}) works in most buffers by 2998Font Lock mode (@pxref{Font Lock Mode}) works in most buffers by
3001dynamically updating the @code{face} property of characters based on 2999dynamically updating the @code{face} property of characters based on
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 08712466b5c..3da09369882 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -39,7 +39,6 @@ representing the variable.
39* Buffer-Local Variables:: Variable values in effect only in one buffer. 39* Buffer-Local Variables:: Variable values in effect only in one buffer.
40* File Local Variables:: Handling local variable lists in files. 40* File Local Variables:: Handling local variable lists in files.
41* Directory Local Variables:: Local variables common to all files in a directory. 41* Directory Local Variables:: Local variables common to all files in a directory.
42* Frame-Local Variables:: Frame-local bindings for variables.
43* Variable Aliases:: Variables that are aliases for other variables. 42* Variable Aliases:: Variables that are aliases for other variables.
44* Variables with Restricted Values:: Non-constant variables whose value can 43* Variables with Restricted Values:: Non-constant variables whose value can
45 @emph{not} be an arbitrary Lisp object. 44 @emph{not} be an arbitrary Lisp object.
@@ -99,7 +98,7 @@ x
99 98
100@node Constant Variables 99@node Constant Variables
101@section Variables that Never Change 100@section Variables that Never Change
102@kindex setting-constant 101@cindex @code{setting-constant} error
103@cindex keyword symbol 102@cindex keyword symbol
104@cindex variable with constant value 103@cindex variable with constant value
105@cindex constant variables 104@cindex constant variables
@@ -288,7 +287,7 @@ has room to execute.
288 287
289@node Void Variables 288@node Void Variables
290@section When a Variable is ``Void'' 289@section When a Variable is ``Void''
291@kindex void-variable 290@cindex @code{void-variable} error
292@cindex void variable 291@cindex void variable
293 292
294 If you have never given a symbol any value as a global variable, we 293 If you have never given a symbol any value as a global variable, we
@@ -583,7 +582,8 @@ and is a string, and its first character is @samp{*}, then the variable
583is a user option. Aliases of user options are also user options. 582is a user option. Aliases of user options are also user options.
584@end defun 583@end defun
585 584
586@kindex variable-interactive 585@cindex @code{variable-interactive} property
586@findex set-variable
587 If a user option variable has a @code{variable-interactive} property, 587 If a user option variable has a @code{variable-interactive} property,
588the @code{set-variable} command uses that value to control reading the 588the @code{set-variable} command uses that value to control reading the
589new value for the variable. The property's value is used as if it were 589new value for the variable. The property's value is used as if it were
@@ -1186,8 +1186,7 @@ additional, unusual kinds of variable binding, such as
1186@dfn{buffer-local} bindings, which apply only in one buffer. Having 1186@dfn{buffer-local} bindings, which apply only in one buffer. Having
1187different values for a variable in different buffers is an important 1187different values for a variable in different buffers is an important
1188customization method. (Variables can also have bindings that are 1188customization method. (Variables can also have bindings that are
1189local to each terminal, or to each frame. @xref{Multiple Terminals}, 1189local to each terminal. @xref{Multiple Terminals}.)
1190and @xref{Frame-Local Variables}.)
1191 1190
1192@menu 1191@menu
1193* Intro to Buffer-Local:: Introduction and concepts. 1192* Intro to Buffer-Local:: Introduction and concepts.
@@ -1286,9 +1285,8 @@ buffer-local binding of buffer @samp{b}.
1286values when you visit the file. @xref{File Variables,,, emacs, The 1285values when you visit the file. @xref{File Variables,,, emacs, The
1287GNU Emacs Manual}. 1286GNU Emacs Manual}.
1288 1287
1289 A buffer-local variable cannot be made frame-local 1288 A buffer-local variable cannot be made terminal-local
1290(@pxref{Frame-Local Variables}) or terminal-local (@pxref{Multiple 1289(@pxref{Multiple Terminals}).
1291Terminals}).
1292 1290
1293@node Creating Buffer-Local 1291@node Creating Buffer-Local
1294@subsection Creating and Deleting Buffer-Local Bindings 1292@subsection Creating and Deleting Buffer-Local Bindings
@@ -1339,9 +1337,9 @@ is not current either on entry to or exit from the @code{let}. This is
1339because @code{let} does not distinguish between different kinds of 1337because @code{let} does not distinguish between different kinds of
1340bindings; it knows only which variable the binding was made for. 1338bindings; it knows only which variable the binding was made for.
1341 1339
1342If the variable is terminal-local (@pxref{Multiple Terminals}), or 1340If the variable is terminal-local (@pxref{Multiple Terminals}), this
1343frame-local (@pxref{Frame-Local Variables}), this function signals an 1341function signals an error. Such variables cannot have buffer-local
1344error. Such variables cannot have buffer-local bindings as well. 1342bindings as well.
1345 1343
1346@strong{Warning:} do not use @code{make-local-variable} for a hook 1344@strong{Warning:} do not use @code{make-local-variable} for a hook
1347variable. The hook variables are automatically made buffer-local as 1345variable. The hook variables are automatically made buffer-local as
@@ -1879,36 +1877,6 @@ modification times of the associated directory local variables file
1879updates this list. 1877updates this list.
1880@end defvar 1878@end defvar
1881 1879
1882@node Frame-Local Variables
1883@section Frame-Local Values for Variables
1884@cindex frame-local variables
1885
1886 In addition to buffer-local variable bindings (@pxref{Buffer-Local
1887Variables}), Emacs supports @dfn{frame-local} bindings. A frame-local
1888binding for a variable is in effect in a frame for which it was
1889defined.
1890
1891 In practice, frame-local variables have not proven very useful.
1892Ordinary frame parameters are generally used instead (@pxref{Frame
1893Parameters}). The function @code{make-variable-frame-local}, which
1894was used to define frame-local variables, has been deprecated since
1895Emacs 22.2. However, you can still define a frame-specific binding
1896for a variable @var{var} in frame @var{frame}, by setting the
1897@var{var} frame parameter for that frame:
1898
1899@lisp
1900 (modify-frame-parameters @var{frame} '((@var{var} . @var{value})))
1901@end lisp
1902
1903@noindent
1904This causes the variable @var{var} to be bound to the specified
1905@var{value} in the named @var{frame}. To check the frame-specific
1906values of such variables, use @code{frame-parameter}. @xref{Parameter
1907Access}.
1908
1909 Note that you cannot have a frame-local binding for a variable that
1910has a buffer-local binding.
1911
1912@node Variable Aliases 1880@node Variable Aliases
1913@section Variable Aliases 1881@section Variable Aliases
1914@cindex variable aliases 1882@cindex variable aliases
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index afcd3d6cbd6..3b7718814b5 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -211,7 +211,7 @@ Appendices
211 --- The Detailed Node Listing --- 211 --- The Detailed Node Listing ---
212 --------------------------------- 212 ---------------------------------
213 213
214Here are other nodes that are inferiors of those already listed, 214Here are other nodes that are subnodes of those already listed,
215mentioned here so you can get to them in one step: 215mentioned here so you can get to them in one step:
216 216
217Introduction 217Introduction
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 65ffbc23860..22a51d3235c 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -210,7 +210,7 @@ Appendices
210 --- The Detailed Node Listing --- 210 --- The Detailed Node Listing ---
211 --------------------------------- 211 ---------------------------------
212 212
213Here are other nodes that are inferiors of those already listed, 213Here are other nodes that are subnodes of those already listed,
214mentioned here so you can get to them in one step: 214mentioned here so you can get to them in one step:
215 215
216Introduction 216Introduction
diff --git a/doc/man/ChangeLog b/doc/man/ChangeLog
index 88f70e410c8..0735e0593f9 100644
--- a/doc/man/ChangeLog
+++ b/doc/man/ChangeLog
@@ -1,3 +1,7 @@
12011-07-12 Chong Yidong <cyd@stupidchicken.com>
2
3 * emacsclient.1: Document exit status.
4
12011-06-25 Andreas Rottmann <a.rottmann@gmx.at> 52011-06-25 Andreas Rottmann <a.rottmann@gmx.at>
2 6
3 * emacsclient.1: Mention --frame-parameters. 7 * emacsclient.1: Mention --frame-parameters.
diff --git a/doc/man/emacsclient.1 b/doc/man/emacsclient.1
index 4843053666a..4020b6c0b6a 100644
--- a/doc/man/emacsclient.1
+++ b/doc/man/emacsclient.1
@@ -87,6 +87,9 @@ print version information and exit
87.TP 87.TP
88.B \-H, \-\-help 88.B \-H, \-\-help
89print this usage information message and exit 89print this usage information message and exit
90.SH "EXIT STATUS"
91Normally, the exit status is 0. If emacsclient shuts down due to
92Emacs signaling an error, the exit status is 1.
90.SH "SEE ALSO" 93.SH "SEE ALSO"
91The program is documented fully in 94The program is documented fully in
92.IR "Using Emacs as a Server" 95.IR "Using Emacs as a Server"
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index 2e0e28e9827..38cbaafa45d 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,59 @@
12011-07-14 Lars Magne Ingebrigtsen <larsi@gnus.org>
2
3 * widget.texi (Setting Up the Buffer): Remove mention of the
4 global keymap parent, which doesn't seem to be accurate
5 (bug#7045).
6
72010-07-10 Kevin Ryde <user42@zip.com.au>
8
9 * cl.texi (For Clauses): Add destructuring example processing an
10 alist (bug#6596).
11
122011-07-12 Lars Magne Ingebrigtsen <larsi@gnus.org>
13
14 * org.texi (Special agenda views): Fix double quoting (bug#3509).
15
162011-07-07 Lars Magne Ingebrigtsen <larsi@gnus.org>
17
18 * ediff.texi (Major Entry Points): Remove mention of `require',
19 since that's not pertinent in the installed Emacs (bug#9016).
20
212011-07-05 Lars Magne Ingebrigtsen <larsi@gnus.org>
22
23 * gnus.texi (Expiring Mail): Document gnus-auto-expirable-marks.
24 (Filtering New Groups): Clarify how simple the "options -n" format is.
25 (Agent Expiry): Remove mention of `gnus-request-expire-articles', which
26 is internal.
27
282011-07-04 Michael Albinus <michael.albinus@gmx.de>
29
30 * tramp.texi (Cleanup remote connections): Add
31 `tramp-cleanup-this-connection'.
32
332011-07-03 Lars Magne Ingebrigtsen <larsi@gnus.org>
34
35 * gnus.texi (Subscription Methods): Link to "Group Levels" to explain
36 zombies.
37 (Checking New Groups): Ditto (bug#8974).
38 (Checking New Groups): Moved the reference to the right place.
39
402011-07-03 Dave Abrahams <dave@boostpro.com> (tiny change)
41
42 * gnus.texi (Startup Files): Clarify that we're talking about numbered
43 backups, and not actual vc (bug#8975).
44
452011-07-03 Kevin Ryde <user42@zip.com.au>
46
47 * cl.texi (For Clauses): @items for hash-values and key-bindings
48 to make them more visible when skimming. Add examples of `using'
49 clause to them, examples being clearer than a description in
50 words (bug#6599).
51
522011-07-01 Alan Mackenzie <acm@muc.de>
53
54 * cc-mode.texi (Guessing the Style): New page.
55 (Styles): Add a short introduction to above.
56
12011-06-28 Deniz Dogan <deniz@dogan.se> 572011-06-28 Deniz Dogan <deniz@dogan.se>
2 58
3 * rcirc.texi (Configuration): Bug-fix: 59 * rcirc.texi (Configuration): Bug-fix:
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index 9ae9abd5e1a..a9339162666 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -287,10 +287,11 @@ Configuration Basics
287 287
288Styles 288Styles
289 289
290* Built-in Styles:: 290* Built-in Styles::
291* Choosing a Style:: 291* Choosing a Style::
292* Adding Styles:: 292* Adding Styles::
293* File Styles:: 293* Guessing the Style::
294* File Styles::
294 295
295Customizing Auto-newlines 296Customizing Auto-newlines
296 297
@@ -2511,14 +2512,18 @@ groupings of customizations called @dfn{styles}, associate a single name
2511for any particular style, and pretty easily start editing new or 2512for any particular style, and pretty easily start editing new or
2512existing code using these styles. 2513existing code using these styles.
2513 2514
2515As an alternative to writing a style definition yourself, you can have
2516@ccmode{} @dfn{guess} (at least part of) your style by looking at an
2517already formatted piece of your code, @ref{Guessing the Style}.
2518
2514@menu 2519@menu
2515* Built-in Styles:: 2520* Built-in Styles::
2516* Choosing a Style:: 2521* Choosing a Style::
2517* Adding Styles:: 2522* Adding Styles::
2518* File Styles:: 2523* Guessing the Style::
2524* File Styles::
2519@end menu 2525@end menu
2520 2526
2521
2522@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2527@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2523@node Built-in Styles, Choosing a Style, Styles, Styles 2528@node Built-in Styles, Choosing a Style, Styles, Styles
2524@comment node-name, next, previous, up 2529@comment node-name, next, previous, up
@@ -2653,9 +2658,8 @@ This variable always contains the buffer's current style name, as a
2653string. 2658string.
2654@end defvar 2659@end defvar
2655 2660
2656
2657@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2661@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2658@node Adding Styles, File Styles, Choosing a Style, Styles 2662@node Adding Styles, Guessing the Style, Choosing a Style, Styles
2659@comment node-name, next, previous, up 2663@comment node-name, next, previous, up
2660@subsection Adding and Amending Styles 2664@subsection Adding and Amending Styles
2661@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2665@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
@@ -2742,9 +2746,131 @@ This is the variable that holds the definitions for the styles. It
2742should not be changed directly; use @code{c-add-style} instead. 2746should not be changed directly; use @code{c-add-style} instead.
2743@end defvar 2747@end defvar
2744 2748
2749@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2750@node Guessing the Style, File Styles, Adding Styles, Styles
2751@comment node-name, next, previous, up
2752@subsection Guessing the Style
2753@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2754
2755Instead of specifying a style, you can get @ccmode{} to @dfn{guess}
2756your style by examining an already formatted code buffer. @ccmode{}
2757then determines the ''most frequent'' offset (@pxref{c-offsets-alist})
2758for each of the syntactic symbols (@pxref{Indentation Engine Basics})
2759encountered in the buffer, and the ''most frequent'' value of
2760c-basic-offset (@pxref{Customizing Indentation}), then merges the
2761current style with these ''guesses'' to form a new style. This
2762combined style is known as the @dfn{guessed style}.
2763
2764To do this, call @code{c-guess} (or one of the other 5 guessing
2765commands) on your sample buffer. The analysis of your code may take
2766some time.
2767
2768You can then set the guessed style in any @ccmode{} buffer with
2769@code{c-guess-install}. You can display the style with
2770@code{c-guess-view}, and preserve it by copying it into your
2771@file{.emacs} for future use, preferably after editing it.
2772
2773@table @asis
2774@item @kbd{M-x c-guess-no-install}
2775@itemx @kbd{M-x c-guess-buffer-no-install}
2776@itemx @kbd{M-x c-guess-region-no-install}
2777@findex c-guess-no-install
2778@findex c-guess-buffer-no-install
2779@findex c-guess-region-no-install
2780@findex guess-no-install (c-)
2781@findex guess-buffer-no-install (c-)
2782@findex guess-region-no-install (c-)
2783These commands analyze a part of the current buffer and guess the
2784style from it.
2785
2786The part of the buffer examined is either the region
2787(@code{c-guess-region-no-install}), the entire buffer
2788(@code{c-guess-buffer-no-install}), or the first
2789@code{c-guess-region-max} bytes (@code{c-guess-no-install}).
2790
2791Each of these commands can be given an optional prefix argument. This
2792instructs @ccmode{} to combine the new guesses with the current
2793guesses before forming the guessed style.
2794@end table
2795
2796@table @asis
2797@item @kbd{M-x c-guess}
2798@itemx @kbd{M-x c-guess-buffer}
2799@itemx @kbd{M-x c-guess-region}
2800@findex c-guess
2801@findex c-guess-buffer
2802@findex c-guess-region
2803@findex guess (c-)
2804@findex guess-buffer (c-)
2805@findex guess-region (c-)
2806These commands analyze a part of the current buffer, guess the style
2807from it, then install the guessed style on the buffer. The guessed
2808style is given a name based on the buffer's absolute file name, and
2809you can then set this style on any @ccmode{} buffer with @kbd{C-c .}.
2810
2811The part of the buffer examined is either the region
2812(@code{c-guess-region}), the entire buffer (@code{c-guess-buffer}), or
2813the first @code{c-guess-region-max} bytes (@code{c-guess}).
2814
2815Each of these commands can be given an optional prefix argument. This
2816instructs @ccmode{} to combine the new guesses with the current
2817guesses before forming the guessed style.
2818@end table
2819
2820@defopt c-guess-region-max
2821@vindex guess-region-max (c-)
2822This variable, default 50000, is the size in bytes of the buffer
2823portion examined by c-guess and c-guess-no-install. If set to
2824@code{nil}, the entire buffer is examined.
2825@end defopt
2826
2827@defopt c-guess-offset-threshold
2828@vindex guess-offset-threshold (c-)
2829This variable, default 10, is the maximum offset, either outwards or
2830inwards, which will be taken into account by the analysis process.
2831Any offset bigger than this will be ignored. For no limit, set this
2832variable to a large number.
2833@end defopt
2834
2835@table @asis
2836@item @kbd{M-x c-guess-install}
2837@findex c-guess-install
2838@findex guess-install (c-)
2839
2840Set the current buffer's style to the guessed style. This prompts you
2841to enter an optional new style name to give to the guessed style. By
2842default, this name is based on the buffer's absolute file name. You
2843can then use this style like any other.
2844
2845@item @kbd{M-x c-guess-view}
2846@findex c-guess-view
2847@findex guess-view (c-)
2848Display the most recently guessed style in a temporary buffer. This
2849display is in the form of a @code{c-add-style} form (@pxref{Adding
2850Styles}) which can be easily copied to your @file{.emacs}. You will
2851probably want to edit it first.
2852
2853The display of the guessed style contains these elements:
2854
2855@table @asis
2856@item Placeholder Name
2857You should replace this with a style name of your own.
2858@item Parent Style
2859The style current when the guessing began, from which the guessed
2860style inherits (@pxref{Config Basics}) the settings which weren't
2861guessed.
2862@item Guessed Offsets
2863These are the core result of the guessing process. Each of them is
2864marked by a comment.
2865@item Inherited Offsets
2866These are syntactic offsets which have been taken over from the parent
2867style. To avoid possible future conflicts, you should remove either
2868these offsets or the parent style name.
2869@end table
2870@end table
2745 2871
2746@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 2872@comment !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
2747@node File Styles, , Adding Styles, Styles 2873@node File Styles, , Guessing the Style, Styles
2748@comment node-name, next, previous, up 2874@comment node-name, next, previous, up
2749@subsection File Styles 2875@subsection File Styles
2750@cindex styles, file local 2876@cindex styles, file local
diff --git a/doc/misc/cl.texi b/doc/misc/cl.texi
index afe7c94f447..3f3d616e343 100644
--- a/doc/misc/cl.texi
+++ b/doc/misc/cl.texi
@@ -2449,22 +2449,33 @@ one of these types of clauses with other clauses like @code{for ... to}
2449or @code{while}. 2449or @code{while}.
2450 2450
2451@item for @var{var} being the hash-keys of @var{hash-table} 2451@item for @var{var} being the hash-keys of @var{hash-table}
2452This clause iterates over the entries in @var{hash-table}. For each 2452@itemx for @var{var} being the hash-values of @var{hash-table}
2453hash table entry, @var{var} is bound to the entry's key. If you write 2453This clause iterates over the entries in @var{hash-table} with
2454@samp{the hash-values} instead, @var{var} is bound to the values 2454@var{var} bound to each key, or value. A @samp{using} clause can bind
2455of the entries. The clause may be followed by the additional 2455a second variable to the opposite part.
2456term @samp{using (hash-values @var{var2})} (where @code{hash-values} 2456
2457is the opposite word of the word following @code{the}) to cause 2457@example
2458@var{var} and @var{var2} to be bound to the two parts of each 2458(loop for k being the hash-keys of h
2459hash table entry. 2459 using (hash-values v)
2460 do
2461 (message "key %S -> value %S" k v))
2462@end example
2460 2463
2461@item for @var{var} being the key-codes of @var{keymap} 2464@item for @var{var} being the key-codes of @var{keymap}
2465@itemx for @var{var} being the key-bindings of @var{keymap}
2462This clause iterates over the entries in @var{keymap}. 2466This clause iterates over the entries in @var{keymap}.
2463The iteration does not enter nested keymaps but does enter inherited 2467The iteration does not enter nested keymaps but does enter inherited
2464(parent) keymaps. 2468(parent) keymaps.
2465You can use @samp{the key-bindings} to access the commands bound to 2469A @code{using} clause can access both the codes and the bindings
2466the keys rather than the key codes, and you can add a @code{using} 2470together.
2467clause to access both the codes and the bindings together. 2471
2472@example
2473(loop for c being the key-codes of (current-local-map)
2474 using (key-bindings b)
2475 do
2476 (message "key %S -> binding %S" c b))
2477@end example
2478
2468 2479
2469@item for @var{var} being the key-seqs of @var{keymap} 2480@item for @var{var} being the key-seqs of @var{keymap}
2470This clause iterates over all key sequences defined by @var{keymap} 2481This clause iterates over all key sequences defined by @var{keymap}
@@ -2575,7 +2586,14 @@ the trailing values are ignored, and if there are more variables
2575than values the trailing variables get the value @code{nil}. 2586than values the trailing variables get the value @code{nil}.
2576If @code{nil} is used as a variable name, the corresponding 2587If @code{nil} is used as a variable name, the corresponding
2577values are ignored. Destructuring may be nested, and dotted 2588values are ignored. Destructuring may be nested, and dotted
2578lists of variables like @code{(x . y)} are allowed. 2589lists of variables like @code{(x . y)} are allowed, so for example
2590to process an alist
2591
2592@example
2593(loop for (key . value) in '((a . 1) (b . 2))
2594 collect value)
2595 @result{} (1 2)
2596@end example
2579 2597
2580@node Iteration Clauses, Accumulation Clauses, For Clauses, Loop Facility 2598@node Iteration Clauses, Accumulation Clauses, For Clauses, Loop Facility
2581@subsection Iteration Clauses 2599@subsection Iteration Clauses
diff --git a/doc/misc/ediff.texi b/doc/misc/ediff.texi
index 3ba0796e636..20c2ed90873 100644
--- a/doc/misc/ediff.texi
+++ b/doc/misc/ediff.texi
@@ -334,18 +334,6 @@ Brings up Ediff session registry. This feature enables you to quickly find
334and restart active Ediff sessions. 334and restart active Ediff sessions.
335@end table 335@end table
336 336
337@noindent
338If you want Ediff to be loaded from the very beginning of your Emacs
339session, you should put this line in your @file{~/.emacs} file:
340
341@example
342(require 'ediff)
343@end example
344
345@noindent
346Otherwise, Ediff will be loaded automatically when you use one of the
347above functions, either directly or through the menus.
348
349When the above functions are invoked, the user is prompted for all the 337When the above functions are invoked, the user is prompted for all the
350necessary information---typically the files or buffers to compare, merge, or 338necessary information---typically the files or buffers to compare, merge, or
351patch. Ediff tries to be smart about these prompts. For instance, in 339patch. Ediff tries to be smart about these prompts. For instance, in
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index f98d4df2bde..439ff7fbc55 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -1167,16 +1167,17 @@ when you do the @kbd{g} command (@pxref{Scanning New Messages}).
1167@node Checking New Groups 1167@node Checking New Groups
1168@subsection Checking New Groups 1168@subsection Checking New Groups
1169 1169
1170Gnus normally determines whether a group is new or not by comparing the 1170Gnus normally determines whether a group is new or not by comparing
1171list of groups from the active file(s) with the lists of subscribed and 1171the list of groups from the active file(s) with the lists of
1172dead groups. This isn't a particularly fast method. If 1172subscribed and dead groups. This isn't a particularly fast method.
1173@code{gnus-check-new-newsgroups} is @code{ask-server}, Gnus will ask the 1173If @code{gnus-check-new-newsgroups} is @code{ask-server}, Gnus will
1174server for new groups since the last time. This is both faster and 1174ask the server for new groups since the last time. This is both
1175cheaper. This also means that you can get rid of the list of killed 1175faster and cheaper. This also means that you can get rid of the list
1176groups altogether, so you may set @code{gnus-save-killed-list} to 1176of killed groups (@pxref{Group Levels}) altogether, so you may set
1177@code{nil}, which will save time both at startup, at exit, and all over. 1177@code{gnus-save-killed-list} to @code{nil}, which will save time both
1178Saves disk space, too. Why isn't this the default, then? 1178at startup, at exit, and all over. Saves disk space, too. Why isn't
1179Unfortunately, not all servers support this command. 1179this the default, then? Unfortunately, not all servers support this
1180command.
1180 1181
1181I bet I know what you're thinking now: How do I find out whether my 1182I bet I know what you're thinking now: How do I find out whether my
1182server supports @code{ask-server}? No? Good, because I don't have a 1183server supports @code{ask-server}? No? Good, because I don't have a
@@ -1214,9 +1215,10 @@ Some handy pre-fab functions are:
1214 1215
1215@item gnus-subscribe-zombies 1216@item gnus-subscribe-zombies
1216@vindex gnus-subscribe-zombies 1217@vindex gnus-subscribe-zombies
1217Make all new groups zombies. This is the default. You can browse the 1218Make all new groups zombies (@pxref{Group Levels}). This is the
1218zombies later (with @kbd{A z}) and either kill them all off properly 1219default. You can browse the zombies later (with @kbd{A z}) and either
1219(with @kbd{S z}), or subscribe to them (with @kbd{u}). 1220kill them all off properly (with @kbd{S z}), or subscribe to them
1221(with @kbd{u}).
1220 1222
1221@item gnus-subscribe-randomly 1223@item gnus-subscribe-randomly
1222@vindex gnus-subscribe-randomly 1224@vindex gnus-subscribe-randomly
@@ -1300,6 +1302,10 @@ subscribing these groups.
1300@code{gnus-subscribe-options-newsgroup-method} is used instead. This 1302@code{gnus-subscribe-options-newsgroup-method} is used instead. This
1301variable defaults to @code{gnus-subscribe-alphabetically}. 1303variable defaults to @code{gnus-subscribe-alphabetically}.
1302 1304
1305The ``options -n'' format is very simplistic. The syntax above is all
1306that is supports -- you can force-subscribe hierarchies, or you can
1307deny hierarchies, and that's it.
1308
1303@vindex gnus-options-not-subscribe 1309@vindex gnus-options-not-subscribe
1304@vindex gnus-options-subscribe 1310@vindex gnus-options-subscribe
1305If you don't want to mess with your @file{.newsrc} file, you can just 1311If you don't want to mess with your @file{.newsrc} file, you can just
@@ -1430,7 +1436,7 @@ several servers where not all servers support @code{ask-server}.
1430The @code{gnus-startup-file} variable says where the startup files are. 1436The @code{gnus-startup-file} variable says where the startup files are.
1431The default value is @file{~/.newsrc}, with the Gnus (El Dingo) startup 1437The default value is @file{~/.newsrc}, with the Gnus (El Dingo) startup
1432file being whatever that one is, with a @samp{.eld} appended. 1438file being whatever that one is, with a @samp{.eld} appended.
1433If you want version control for this file, set 1439If you want to keep multiple numbered backups of this file, set
1434@code{gnus-backup-startup-file}. It respects the same values as the 1440@code{gnus-backup-startup-file}. It respects the same values as the
1435@code{version-control} variable. 1441@code{version-control} variable.
1436 1442
@@ -2360,6 +2366,7 @@ empty subscribed groups and unsubscribed groups, too. Type @kbd{l} to
2360go back to showing nonempty subscribed groups again. Thus, unsubscribed 2366go back to showing nonempty subscribed groups again. Thus, unsubscribed
2361groups are hidden, in a way. 2367groups are hidden, in a way.
2362 2368
2369@cindex zombie groups
2363Zombie and killed groups are similar to unsubscribed groups in that they 2370Zombie and killed groups are similar to unsubscribed groups in that they
2364are hidden by default. But they are different from subscribed and 2371are hidden by default. But they are different from subscribed and
2365unsubscribed groups in that Gnus doesn't ask the news server for 2372unsubscribed groups in that Gnus doesn't ask the news server for
@@ -15645,14 +15652,16 @@ will remain on your system until hell freezes over. This bears
15645repeating one more time, with some spurious capitalizations: IF you do 15652repeating one more time, with some spurious capitalizations: IF you do
15646NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES. 15653NOT mark articles as EXPIRABLE, Gnus will NEVER delete those ARTICLES.
15647 15654
15655@vindex gnus-auto-expirable-marks
15648You do not have to mark articles as expirable by hand. Gnus provides 15656You do not have to mark articles as expirable by hand. Gnus provides
15649two features, called ``auto-expire'' and ``total-expire'', that can help you 15657two features, called ``auto-expire'' and ``total-expire'', that can help you
15650with this. In a nutshell, ``auto-expire'' means that Gnus hits @kbd{E} 15658with this. In a nutshell, ``auto-expire'' means that Gnus hits @kbd{E}
15651for you when you select an article. And ``total-expire'' means that Gnus 15659for you when you select an article. And ``total-expire'' means that Gnus
15652considers all articles as expirable that are read. So, in addition to 15660considers all articles as expirable that are read. So, in addition to
15653the articles marked @samp{E}, also the articles marked @samp{r}, 15661the articles marked @samp{E}, also the articles marked @samp{r},
15654@samp{R}, @samp{O}, @samp{K}, @samp{Y} and so on are considered 15662@samp{R}, @samp{O}, @samp{K}, @samp{Y} (and so on) are considered
15655expirable. 15663expirable. @code{gnus-auto-expirable-marks} has the full list of
15664these marks.
15656 15665
15657When should either auto-expire or total-expire be used? Most people 15666When should either auto-expire or total-expire be used? Most people
15658who are subscribed to mailing lists split each list into its own group 15667who are subscribed to mailing lists split each list into its own group
@@ -19001,9 +19010,8 @@ that you're running out of space. Neither are particularly fast or
19001efficient, and it's not a particularly good idea to interrupt them (with 19010efficient, and it's not a particularly good idea to interrupt them (with
19002@kbd{C-g} or anything else) once you've started one of them. 19011@kbd{C-g} or anything else) once you've started one of them.
19003 19012
19004Note that other functions, e.g. @code{gnus-request-expire-articles}, 19013Note that other functions might run @code{gnus-agent-expire} for you
19005might run @code{gnus-agent-expire} for you to keep the agent 19014to keep the agent synchronized with the group.
19006synchronized with the group.
19007 19015
19008The agent parameter @code{agent-enable-expiration} may be used to 19016The agent parameter @code{agent-enable-expiration} may be used to
19009prevent expiration in selected groups. 19017prevent expiration in selected groups.
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index a0ec20c4034..8e01a10bde3 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -13981,25 +13981,25 @@ particular, you may use the functions @code{org-agenda-skip-entry-if}
13981and @code{org-agenda-skip-subtree-if} in this form, for example: 13981and @code{org-agenda-skip-subtree-if} in this form, for example:
13982 13982
13983@table @code 13983@table @code
13984@item '(org-agenda-skip-entry-if 'scheduled) 13984@item (org-agenda-skip-entry-if 'scheduled)
13985Skip current entry if it has been scheduled. 13985Skip current entry if it has been scheduled.
13986@item '(org-agenda-skip-entry-if 'notscheduled) 13986@item (org-agenda-skip-entry-if 'notscheduled)
13987Skip current entry if it has not been scheduled. 13987Skip current entry if it has not been scheduled.
13988@item '(org-agenda-skip-entry-if 'deadline) 13988@item (org-agenda-skip-entry-if 'deadline)
13989Skip current entry if it has a deadline. 13989Skip current entry if it has a deadline.
13990@item '(org-agenda-skip-entry-if 'scheduled 'deadline) 13990@item (org-agenda-skip-entry-if 'scheduled 'deadline)
13991Skip current entry if it has a deadline, or if it is scheduled. 13991Skip current entry if it has a deadline, or if it is scheduled.
13992@item '(org-agenda-skip-entry-if 'todo '("TODO" "WAITING")) 13992@item (org-agenda-skip-entry-if 'todo '("TODO" "WAITING"))
13993Skip current entry if the TODO keyword is TODO or WAITING. 13993Skip current entry if the TODO keyword is TODO or WAITING.
13994@item '(org-agenda-skip-entry-if 'todo 'done) 13994@item (org-agenda-skip-entry-if 'todo 'done)
13995Skip current entry if the TODO keyword marks a DONE state. 13995Skip current entry if the TODO keyword marks a DONE state.
13996@item '(org-agenda-skip-entry-if 'timestamp) 13996@item (org-agenda-skip-entry-if 'timestamp)
13997Skip current entry if it has any timestamp, may also be deadline or scheduled. 13997Skip current entry if it has any timestamp, may also be deadline or scheduled.
13998@item '(org-agenda-skip-entry 'regexp "regular expression") 13998@item (org-agenda-skip-entry 'regexp "regular expression")
13999Skip current entry if the regular expression matches in the entry. 13999Skip current entry if the regular expression matches in the entry.
14000@item '(org-agenda-skip-entry 'notregexp "regular expression") 14000@item (org-agenda-skip-entry 'notregexp "regular expression")
14001Skip current entry unless the regular expression matches. 14001Skip current entry unless the regular expression matches.
14002@item '(org-agenda-skip-subtree-if 'regexp "regular expression") 14002@item (org-agenda-skip-subtree-if 'regexp "regular expression")
14003Same as above, but check and skip the entire subtree. 14003Same as above, but check and skip the entire subtree.
14004@end table 14004@end table
14005 14005
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index 50f1e90618f..a4e06ab22f1 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -2680,6 +2680,12 @@ handling}), file cache, connection cache (@pxref{Connection caching}),
2680connection buffers. 2680connection buffers.
2681@end deffn 2681@end deffn
2682 2682
2683@deffn Command tramp-cleanup-this-connection
2684This command flushes all objects of the current buffer's remote
2685connection. The same objects are removed as in
2686@code{tramp-cleanup-connection}.
2687@end deffn
2688
2683@deffn Command tramp-cleanup-all-connections 2689@deffn Command tramp-cleanup-all-connections
2684This command flushes objects for all active remote connections. The 2690This command flushes objects for all active remote connections. The
2685same objects are removed as in @code{tramp-cleanup-connection}. 2691same objects are removed as in @code{tramp-cleanup-connection}.
diff --git a/doc/misc/widget.texi b/doc/misc/widget.texi
index c4f5317e5a7..a778f491e76 100644
--- a/doc/misc/widget.texi
+++ b/doc/misc/widget.texi
@@ -450,7 +450,6 @@ There is a standard widget keymap which you might find useful.
450@findex widget-button-press 450@findex widget-button-press
451@findex widget-button-click 451@findex widget-button-click
452@defvr Const widget-keymap 452@defvr Const widget-keymap
453A keymap with the global keymap as its parent.@*
454@key{TAB} and @kbd{C-@key{TAB}} are bound to @code{widget-forward} and 453@key{TAB} and @kbd{C-@key{TAB}} are bound to @code{widget-forward} and
455@code{widget-backward}, respectively. @key{RET} and @kbd{Mouse-2} 454@code{widget-backward}, respectively. @key{RET} and @kbd{Mouse-2}
456are bound to @code{widget-button-press} and 455are bound to @code{widget-button-press} and