aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorJoakim Verona2011-12-28 11:34:15 +0100
committerJoakim Verona2011-12-28 11:34:15 +0100
commit2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f (patch)
tree034e65ef002631d0aba8fc1a41e9984fc557e630 /doc
parentbb29f044aa967831cd664c54eba0de0c701436ce (diff)
parentd23ab8e8726ecb7e3554644857b4a58e5f7408f1 (diff)
downloademacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.tar.gz
emacs-2f74c36bf173b5ad01f99e0d1b31b9b8fa5c8f2f.zip
upstream
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog231
-rw-r--r--doc/emacs/abbrevs.texi82
-rw-r--r--doc/emacs/ack.texi4
-rw-r--r--doc/emacs/building.texi1534
-rw-r--r--doc/emacs/cal-xtra.texi4
-rw-r--r--doc/emacs/dired-xtra.texi26
-rw-r--r--doc/emacs/dired.texi148
-rw-r--r--doc/emacs/emacs.texi42
-rw-r--r--doc/emacs/files.texi13
-rw-r--r--doc/emacs/frames.texi2
-rw-r--r--doc/emacs/maintaining.texi1829
-rw-r--r--doc/emacs/msdog.texi19
-rw-r--r--doc/emacs/programs.texi1032
-rw-r--r--doc/emacs/rmail.texi27
-rw-r--r--doc/emacs/text.texi735
-rw-r--r--doc/emacs/vc1-xtra.texi811
-rw-r--r--doc/lispref/ChangeLog30
-rw-r--r--doc/lispref/commands.texi7
-rw-r--r--doc/lispref/elisp.texi4
-rw-r--r--doc/lispref/files.texi11
-rw-r--r--doc/lispref/internals.texi4
-rw-r--r--doc/lispref/modes.texi2
-rw-r--r--doc/lispref/nonascii.texi2
-rw-r--r--doc/lispref/spellfile1
-rw-r--r--doc/lispref/text.texi6
-rw-r--r--doc/lispref/variables.texi4
-rw-r--r--doc/lispref/vol1.texi6
-rw-r--r--doc/lispref/vol2.texi4
-rw-r--r--doc/lispref/windows.texi34
-rw-r--r--doc/misc/ChangeLog15
-rw-r--r--doc/misc/auth.texi2
-rw-r--r--doc/misc/calc.texi30
-rw-r--r--doc/misc/cc-mode.texi6
-rw-r--r--doc/misc/dbus.texi4
-rw-r--r--doc/misc/ebrowse.texi2
-rw-r--r--doc/misc/ede.texi8
-rw-r--r--doc/misc/emacs-mime.texi2
-rw-r--r--doc/misc/eshell.texi2
-rw-r--r--doc/misc/gnus-faq.texi18
-rw-r--r--doc/misc/gnus.texi16
-rw-r--r--doc/misc/idlwave.texi6
-rw-r--r--doc/misc/message.texi2
-rw-r--r--doc/misc/org.texi8
-rw-r--r--doc/misc/rcirc.texi10
-rw-r--r--doc/misc/semantic.texi2
-rw-r--r--doc/misc/tramp.texi6
46 files changed, 3316 insertions, 3477 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index d16443ccf31..7857295de92 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,232 @@
12011-12-26 Chong Yidong <cyd@gnu.org>
2
3 * dired.texi (Dired Enter, Misc Dired Features): Document
4 dired-use-ls-dired changes. Mention quit-window.
5 (Dired Navigation): Add index entries.
6 (Dired Visiting): Fix View Mode xref.
7 (Marks vs Flags): Prefer C-/ binding for undo.
8 (Subdirectories in Dired): Add xrefs.
9 (Misc Dired Features): Document some Emacs 24 changes. Add index
10 entries.
11
12 * abbrevs.texi (Abbrev Concepts): No need to mention abbrev-mode
13 variable, since it is explained in Minor Modes node.
14 (Defining Abbrevs): Copyedits.
15 (Expanding Abbrevs): State default of abbrev-all-caps. Prefer the
16 C-/ binding for undo.
17 (Dabbrev Customization): Add xrefs for case-fold-search and
18 case-replace.
19
20 * dired-xtra.texi (Subdir Switches): Add xref.
21
22 * maintaining.texi (VC Directory Commands): Mention quit-window.
23
242011-12-25 Chong Yidong <cyd@gnu.org>
25
26 * maintaining.texi (Tags): Mention Semantic.
27 (Create Tags Table, Etags Regexps): Copyedits.
28 (Find Tag): Mention minibuffer completion.
29 (List Tags): Mention completion-at-point. Completion is actually
30 available in M-x list-tags.
31
32 * vc1-xtra.texi (VC Delete/Rename): Rename from Renaming and VC.
33 Document vc-delete-file.
34
35 * files.texi (Misc File Ops): Mention vc-delete-file.
36
37 * programs.texi (Symbol Completion): Mention completion-at-point
38 explicitly.
39
402011-12-22 Chong Yidong <cyd@gnu.org>
41
42 * maintaining.texi (Change Log Commands): Don't specially mention
43 vc-update-change-log which is CVS-only.
44
45 * vc1-xtra.texi (Version Headers): Note that these are for
46 Subversion, CVS, etc. only.
47 (General VC Options): De-document vc-keep-workfiles. Fix
48 RCS-isms.
49
502011-12-22 Eli Zaretskii <eliz@gnu.org>
51
52 * building.texi (Debugger Operation): Fix a typo: "@end iftext"
53 should be @end iftex".
54
552011-12-21 Chong Yidong <cyd@gnu.org>
56
57 * maintaining.texi (Advanced C-x v v): Use fileset terminology.
58 (VC With A Merging VCS, VC Change Log): Add xref to VC Pull node.
59 (VC Pull): Mention vc-log-incoming.
60 (Log Buffer): Add CVS/RCS only disclaimer.
61
62 * vc1-xtra.texi (Remote Repositories): Update introduction.
63 (Local Version Control): Node deleted (obsolete with DVCSes).
64 (Remote Repositories, Version Backups): Node deleted. Move
65 documentation of vc-cvs-stay-local to CVS Options.
66 (CVS Options): Reduce verbosity of description of obscure CVS
67 locking feature.
68 (Making Revision Tags, Revision Tag Caveats): Merge into Revision
69 Tags node.
70 (Revision Tags): Move under Miscellaneous VC subsection.
71 (Change Logs and VC): Note that this is wrong for DVCSs.
72 De-document log entry manipulating features.
73 (Renaming and VC): Describe how it works on modern VCSes.
74
75 * files.texi (Misc File Ops): Mention vc-rename-file.
76
77 * programs.texi (Custom C Indent): Add index entries.
78
792011-12-20 Alan Mackenzie <acm@muc.de>
80
81 * programs.texi (Motion in C): Update the description of C-M-a and
82 C-M-e, they now DTRT in enclosing scopes.
83 (Custom C Indent): Add @dfn{guessing} of the indentation style.
84
852011-12-20 Chong Yidong <cyd@gnu.org>
86
87 * maintaining.texi (VCS Concepts): Add "working tree" terminology.
88 (Old Revisions): Use it.
89 (VCS Repositories): Add "distributed" terminology.
90 (Log Buffer): Remove duplicate description
91 about changesets. Fix "current VC fileset" ambiguity.
92 (Multi-User Branching): Node deleted.
93 (Branches, Switching Branches): Discuss decentralized version
94 control systems.
95 (VC Pull): New node.
96 (Merging): Document merging on decentralized systems.
97 (Creating Branches): Note that this is specific to CVS and related
98 systems.
99
1002011-12-19 Chong Yidong <cyd@gnu.org>
101
102 * maintaining.texi (VCS Merging, VCS Changesets): Index entries.
103 (VC Mode Line): Add index entry for "version control status".
104 (VC Undo): Use vc-revert instead of its vc-revert-buffer alias.
105 Document vc-revert-show-diff. De-document vc-rollback.
106 (VC Directory Mode): Rewrite introduction. Move prefix arg
107 documentation here from VC Directory Buffer node.
108 (VC Directory Buffer): Use a decentralized VCS example.
109 (VC Directory Commands): Use a table. Remove material duplicated
110 in previous nodes on multi-file VC filsets.
111
1122011-12-17 Chong Yidong <cyd@gnu.org>
113
114 * maintaining.texi (VCS Concepts): Make "revision" terminology
115 less CVS-specific.
116 (VC With A Merging VCS, VC With A Locking VCS): Add xref to
117 Registering node.
118 (Secondary VC Commands): Deleted. Promote subnodes.
119 (Log Buffer): Add command name for C-c C-c. Fix the name of the
120 log buffer. Add index entries.
121 (VCS Changesets, Types of Log File, VC With A Merging VCS): Use
122 "commit" terminology.
123 (Old Revisions): Move it to just before VC Change Log. "Tag" here
124 doesn't refer to tags tables. Note other possible forms of the
125 revision ID. C-x v = does not save.
126 (Registering): Note similarity to C-x v v action. Fix description
127 of how backends are chosen. De-document vc-default-init-revision.
128 (VC Change Log): Document C-x v l in VC-Dir buffer. Document RET
129 in root log buffers.
130
1312011-12-16 Chong Yidong <cyd@gnu.org>
132
133 * maintaining.texi (Version Control Systems): Drop Meta-CVS.
134 (Basic VC Editing): Remove redundant descriptions.
135 (VC With A Merging VCS): Make description more general instead of
136 CVS-specific.
137 (VC With A Locking VCS): Use VC fileset terminology.
138
1392011-12-12 Chong Yidong <cyd@gnu.org>
140
141 * building.texi (Executing Lisp): Fix xref for C-M-x.
142 (Lisp Libraries): Add xref to node explaining `load' in Lisp
143 manual. Note that load-path is not customizable.
144 (Lisp Eval): Note that listed commands are available globally.
145 Explain the meaning of "defun" in the C-M-x context.
146 (Lisp Interaction): Copyedits.
147 (External Lisp): Fix name of inferior Lisp buffer. Mention
148 Scheme.
149 (Compilation): Define "inferior process".
150
1512011-12-10 Eli Zaretskii <eliz@gnu.org>
152
153 * msdog.texi (Windows Fonts): Document how to force GDI font
154 backend on MS-Windows.
155
1562011-12-10 Chong Yidong <cyd@gnu.org>
157
158 * building.texi (Compilation): Say what the -k flag to make does.
159 Move subprocess discussion to Compilation Shell.
160 (Compilation Mode): Add xref for grep, occur, and mouse
161 references. Define "locus".
162 (Grep Searching): Use @command.
163 (Debuggers, Commands of GUD, GDB Graphical Interface): Clarify
164 intro.
165 (Starting GUD): Clarify how arguments are specified.
166 (Debugger Operation): Index entry for "GUD interaction buffer",
167 and move basic description here from Commands of GUD node.
168 (GDB User Interface Layout): Copyedits.
169 (Source Buffers): Remove gdb-find-source-frame, which is not in
170 gdb-mi.el.
171 (Other GDB Buffers): Remove gdb-use-separate-io-buffer and
172 toggle-gdb-all-registers, which are not in gdb-mi.el. Don't
173 re-document GUD interaction buffers.
174
175 * programs.texi (Symbol Completion): M-TAB can now use Semantic.
176 (Semantic): Add cindex entries for Semantic.
177
1782011-12-06 Chong Yidong <cyd@gnu.org>
179
180 * programs.texi (Man Page): Clarify how to use Man-switches.
181 Don't bother documenting Man-fontify-manpage-flag.
182 (Lisp Doc): Add xref to Name Help node.
183 (Hideshow): Add cindex. Mention role of ellipses, and default
184 value of hs-isearch-open. Don't bother documenting
185 hs-special-modes-alist.
186 (Symbol Completion): Add kindex for C-M-i. Don't recommend
187 changing the window manager binding of M-TAB.
188
1892011-12-05 Chong Yidong <cyd@gnu.org>
190
191 * programs.texi (Comment Commands): Fix description of for M-; on
192 blank lines. Move documentation of comment-region here.
193 (Multi-Line Comments): Clarify the role of comment-multi-line.
194 Refer to Comment Commands for comment-region doc.
195 (Options for Comments): Refer to Multi-Line Comments for
196 comment-multi-line doc, instead of duplicating it. Fix default
197 values of comment-padding and comment-start-skip.
198
1992011-12-04 Chong Yidong <cyd@gnu.org>
200
201 * programs.texi (Program Modes): Mention modes that are not
202 included with Emacs. Fix references to other manuals for tex.
203 Add index entry for backward-delete-char-untabify. Mention
204 prog-mode-hook.
205 (Which Function): Use "global minor mode" terminology.
206 (Basic Indent, Multi-line Indent): Refer to previous descriptions
207 in Indentation chapter to avoid duplication.
208 (Expressions): Copyedit.
209 (Matching): Document Electric Pair mode.
210
211 * ack.texi (Acknowledgments):
212 * rmail.texi (Movemail, Other Mailbox Formats):
213 * frames.texi (Frames): Don't capitalize "Unix".
214
2152011-12-04 Chong Yidong <cyd@gnu.org>
216
217 * text.texi (Nroff Mode): Mention what nroff is.
218 (Text Based Tables, Table Recognition): Don't say "Table mode"
219 since it's not a major or minor mode.
220 (Text Based Tables): Reduce the size of the example.
221 (Table Definition): Clarify definitions.
222 (Table Creation): Add key table.
223 (Cell Commands): Use kbd for commands.
224 (Table Rows and Columns): Combine nodes Row Commands and Column
225 Commands.
226 (Fixed Width Mode): Node deleted; contents moved to parent.
227 (Table Conversion): Shorten example.
228 (Measuring Tables): Merge into Table Misc.
229
12011-12-03 Chong Yidong <cyd@gnu.org> 2302011-12-03 Chong Yidong <cyd@gnu.org>
2 231
3 * text.texi (TeX Mode): Mention AUCTeX package. 232 * text.texi (TeX Mode): Mention AUCTeX package.
@@ -1597,7 +1826,7 @@
15972009-08-31 Nick Roberts <nickrob@snap.net.nz> 18262009-08-31 Nick Roberts <nickrob@snap.net.nz>
1598 1827
1599 * building.texi (Threads Buffer, Multithreaded Debugging): 1828 * building.texi (Threads Buffer, Multithreaded Debugging):
1600 Re-organise these two sections. 1829 Reorganize these two sections.
1601 1830
16022009-08-29 Eli Zaretskii <eliz@gnu.org> 18312009-08-29 Eli Zaretskii <eliz@gnu.org>
1603 1832
diff --git a/doc/emacs/abbrevs.texi b/doc/emacs/abbrevs.texi
index 2eafadf4841..5868010806c 100644
--- a/doc/emacs/abbrevs.texi
+++ b/doc/emacs/abbrevs.texi
@@ -45,17 +45,14 @@ expanding to @samp{find outer otter}, then you can insert @samp{find
45outer otter.} into the buffer by typing @kbd{f o o .}. 45outer otter.} into the buffer by typing @kbd{f o o .}.
46 46
47@findex abbrev-mode 47@findex abbrev-mode
48@vindex abbrev-mode
49@cindex Abbrev mode 48@cindex Abbrev mode
50@cindex mode, Abbrev 49@cindex mode, Abbrev
51 Abbrevs expand only when Abbrev mode (a minor mode) is enabled. 50 Abbrevs expand only when Abbrev mode, a buffer-local minor mode, is
52Disabling Abbrev mode does not cause abbrev definitions to be forgotten, 51enabled. Disabling Abbrev mode does not cause abbrev definitions to
53but they do not expand until Abbrev mode is enabled again. The command 52be forgotten, but they do not expand until Abbrev mode is enabled
54@kbd{M-x abbrev-mode} toggles Abbrev mode; with a numeric argument, it 53again. The command @kbd{M-x abbrev-mode} toggles Abbrev mode; with a
55turns Abbrev mode on if the argument is positive, off otherwise. 54numeric argument, it turns Abbrev mode on if the argument is positive,
56@xref{Minor Modes}. @code{abbrev-mode} is also a variable; Abbrev mode is 55off otherwise. @xref{Minor Modes}.
57on when the variable is non-@code{nil}. The variable @code{abbrev-mode}
58automatically becomes local to the current buffer when it is set.
59 56
60 Abbrevs can have @dfn{mode-specific} definitions, active only in one major 57 Abbrevs can have @dfn{mode-specific} definitions, active only in one major
61mode. Abbrevs can also have @dfn{global} definitions that are active in 58mode. Abbrevs can also have @dfn{global} definitions that are active in
@@ -108,22 +105,18 @@ region as the expansion of the abbrev being defined.
108@kindex C-x a l 105@kindex C-x a l
109@findex add-mode-abbrev 106@findex add-mode-abbrev
110 The command @kbd{C-x a l} (@code{add-mode-abbrev}) is similar, but 107 The command @kbd{C-x a l} (@code{add-mode-abbrev}) is similar, but
111defines a mode-specific abbrev. Mode-specific abbrevs are active only in a 108defines a mode-specific abbrev for the current major mode. The
112particular major mode. @kbd{C-x a l} defines an abbrev for the major mode 109arguments work the same as for @kbd{C-x a g}.
113in effect at the time @kbd{C-x a l} is typed. The arguments work the same
114as for @kbd{C-x a g}.
115 110
116@kindex C-x a i g 111@kindex C-x a i g
117@findex inverse-add-global-abbrev 112@findex inverse-add-global-abbrev
118@kindex C-x a i l 113@kindex C-x a i l
119@findex inverse-add-mode-abbrev 114@findex inverse-add-mode-abbrev
120 If the abbrev text itself is already in the buffer, you can use the 115 @kbd{C-x a i g} (@code{inverse-add-global-abbrev}) and @kbd{C-x a i
121commands @kbd{C-x a i g} (@code{inverse-add-global-abbrev}) and 116l} (@code{inverse-add-mode-abbrev}) perform the opposite task: if the
122@kbd{C-x a i l} (@code{inverse-add-mode-abbrev}) to define it as an 117abbrev text is already in the buffer, you use these commands to define
123abbrev by specify the expansion in the minibuffer. These commands are 118an abbrev by specifying the expansion in the minibuffer. These
124called ``inverse'' because they invert the meaning of the two text 119commands will expand the abbrev text used for the definition.
125strings they use (one from the buffer and one read with the
126minibuffer).
127 120
128@findex define-mode-abbrev 121@findex define-mode-abbrev
129@findex define-global-abbrev 122@findex define-global-abbrev
@@ -132,8 +125,8 @@ expansion in the buffer using the command @code{define-global-abbrev}.
132It reads two arguments---the abbrev, and its expansion. The command 125It reads two arguments---the abbrev, and its expansion. The command
133@code{define-mode-abbrev} does likewise for a mode-specific abbrev. 126@code{define-mode-abbrev} does likewise for a mode-specific abbrev.
134 127
135 To change the definition of an abbrev, just define a new definition. 128 To change the definition of an abbrev, just make a new definition.
136When the abbrev has a prior definition, the abbrev definition commands 129When an abbrev has a prior definition, the abbrev definition commands
137ask for confirmation before replacing it. 130ask for confirmation before replacing it.
138 131
139@findex kill-all-abbrevs 132@findex kill-all-abbrevs
@@ -155,11 +148,11 @@ The most common way to use an abbrev is to insert it and then insert a
155punctuation or whitespace character to expand it. 148punctuation or whitespace character to expand it.
156 149
157@vindex abbrev-all-caps 150@vindex abbrev-all-caps
158 Abbrev expansion preserves case; thus, @samp{foo} expands into @samp{find 151 Abbrev expansion preserves case: @samp{foo} expands to @samp{find
159outer otter}; @samp{Foo} into @samp{Find outer otter}, and @samp{FOO} into 152outer otter}, and @samp{Foo} to @samp{Find outer otter}. @samp{FOO}
160@samp{FIND OUTER OTTER} or @samp{Find Outer Otter} according to the 153expands to @samp{Find Outer Otter} by default, but if you change the
161variable @code{abbrev-all-caps} (setting it non-@code{nil} specifies 154variable @code{abbrev-all-caps} to a non-@code{nil} value, it expands
162@samp{FIND OUTER OTTER}). 155to @samp{FIND OUTER OTTER}.
163 156
164 These commands are used to control abbrev expansion: 157 These commands are used to control abbrev expansion:
165 158
@@ -196,14 +189,14 @@ punctuation with @kbd{C-q}. Thus, @kbd{foo C-q ,} leaves @samp{foo,} in
196the buffer, not expanding it. 189the buffer, not expanding it.
197 190
198@findex unexpand-abbrev 191@findex unexpand-abbrev
199 If you expand an abbrev by mistake, you can undo the expansion and 192 If you expand an abbrev by mistake, you can undo the expansion by
200bring back the abbrev itself by typing @kbd{C-_} to undo (@pxref{Undo}). 193typing @kbd{C-/} (@code{undo}). @xref{Undo}. This undoes the
201This also undoes the insertion of the non-word character that expanded 194insertion of the abbrev expansion and brings back the abbrev text. If
202the abbrev. If the result you want is the terminating non-word 195the result you want is the terminating non-word character plus the
203character plus the unexpanded abbrev, you must reinsert the terminating 196unexpanded abbrev, you must reinsert the terminating character,
204character, quoting it with @kbd{C-q}. You can also use the command 197quoting it with @kbd{C-q}. You can also use the command @kbd{M-x
205@kbd{M-x unexpand-abbrev} to cancel the last expansion without 198unexpand-abbrev} to cancel the last expansion without deleting the
206deleting the terminating character. 199terminating character.
207 200
208@findex expand-region-abbrevs 201@findex expand-region-abbrevs
209 @kbd{M-x expand-region-abbrevs} searches through the region for defined 202 @kbd{M-x expand-region-abbrevs} searches through the region for defined
@@ -409,12 +402,11 @@ you are expanding.
409 402
410@vindex dabbrev-case-fold-search 403@vindex dabbrev-case-fold-search
411 This feature is controlled by the variable 404 This feature is controlled by the variable
412@code{dabbrev-case-fold-search}. If it is @code{t}, case is ignored in 405@code{dabbrev-case-fold-search}. If it is @code{t}, case is ignored
413this search; if it is @code{nil}, the word and the expansion must match 406in this search; if it is @code{nil}, the word and the expansion must
414in case. If the value of @code{dabbrev-case-fold-search} is 407match in case. If the value is @code{case-fold-search} (the default),
415@code{case-fold-search}, which is true by default, then the variable 408then the variable @code{case-fold-search} controls whether to ignore
416@code{case-fold-search} controls whether to ignore case while searching 409case while searching for expansions (@pxref{Search Case}).
417for expansions.
418 410
419@vindex dabbrev-case-replace 411@vindex dabbrev-case-replace
420 Normally, dynamic abbrev expansion preserves the case pattern 412 Normally, dynamic abbrev expansion preserves the case pattern
@@ -425,10 +417,10 @@ expansion to that case pattern.
425 The variable @code{dabbrev-case-replace} controls whether to 417 The variable @code{dabbrev-case-replace} controls whether to
426preserve the case pattern of the dynamic abbrev. If it is @code{t}, 418preserve the case pattern of the dynamic abbrev. If it is @code{t},
427the dynamic abbrev's case pattern is preserved in most cases; if it is 419the dynamic abbrev's case pattern is preserved in most cases; if it is
428@code{nil}, the expansion is always copied verbatim. If the value of 420@code{nil}, the expansion is always copied verbatim. If the value is
429@code{dabbrev-case-replace} is @code{case-replace}, which is true by 421@code{case-replace} (the default), then the variable
430default, then the variable @code{case-replace} controls whether to 422@code{case-replace} controls whether to copy the expansion verbatim
431copy the expansion verbatim. 423(@pxref{Replacement and Case}).
432 424
433 However, if the expansion contains a complex mixed case pattern, and 425 However, if the expansion contains a complex mixed case pattern, and
434the dynamic abbrev matches this pattern as far as it goes, then the 426the dynamic abbrev matches this pattern as far as it goes, then the
diff --git a/doc/emacs/ack.texi b/doc/emacs/ack.texi
index d7022ba739b..ae6338ce5a6 100644
--- a/doc/emacs/ack.texi
+++ b/doc/emacs/ack.texi
@@ -1272,8 +1272,8 @@ Colin Walters wrote Ibuffer, an enhanced buffer menu.
1272Barry Warsaw wrote @file{assoc.el}, a set of utility functions for 1272Barry Warsaw wrote @file{assoc.el}, a set of utility functions for
1273working with association lists; @file{cc-mode.el}, a mode for editing 1273working with association lists; @file{cc-mode.el}, a mode for editing
1274C, C@t{++}, and Java code, based on earlier work by Dave Detlefs, 1274C, C@t{++}, and Java code, based on earlier work by Dave Detlefs,
1275Stewart Clamen, and Richard Stallman; @file{elp.el}, a profiler 1275Stewart Clamen, and Richard Stallman; @file{elp.el}, a profiler for
1276for Emacs Lisp programs; @file{man.el}, a mode for reading UNIX manual 1276Emacs Lisp programs; @file{man.el}, a mode for reading Unix manual
1277pages; @file{regi.el}, providing an AWK-like functionality for use in 1277pages; @file{regi.el}, providing an AWK-like functionality for use in
1278lisp programs; @file{reporter.el}, providing customizable bug 1278lisp programs; @file{reporter.el}, providing customizable bug
1279reporting for lisp packages; and @file{supercite.el}, a minor mode for 1279reporting for lisp packages; and @file{supercite.el}, a minor mode for
diff --git a/doc/emacs/building.texi b/doc/emacs/building.texi
index 9c5b2e7dcd7..963bd510f67 100644
--- a/doc/emacs/building.texi
+++ b/doc/emacs/building.texi
@@ -8,9 +8,9 @@
8@cindex program building 8@cindex program building
9@cindex running Lisp functions 9@cindex running Lisp functions
10 10
11 The previous chapter discusses the Emacs commands that are useful for 11 The previous chapter discusses the Emacs commands that are useful
12making changes in programs. This chapter deals with commands that assist 12for making changes in programs. This chapter deals with commands that
13in the larger process of compiling and testing programs. 13assist in the process of compiling and testing programs.
14 14
15@menu 15@menu
16* Compilation:: Compiling programs in languages other 16* Compilation:: Compiling programs in languages other
@@ -24,7 +24,7 @@ in the larger process of compiling and testing programs.
24* Executing Lisp:: Various modes for editing Lisp programs, 24* Executing Lisp:: Various modes for editing Lisp programs,
25 with different facilities for running 25 with different facilities for running
26 the Lisp programs. 26 the Lisp programs.
27* Libraries: Lisp Libraries. Creating Lisp programs to run in Emacs. 27* Libraries: Lisp Libraries. How Lisp programs are loaded into Emacs.
28* Eval: Lisp Eval. Executing a single Lisp expression in Emacs. 28* Eval: Lisp Eval. Executing a single Lisp expression in Emacs.
29* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer. 29* Interaction: Lisp Interaction. Executing Lisp in an Emacs buffer.
30* External Lisp:: Communicating through Emacs with a separate Lisp. 30* External Lisp:: Communicating through Emacs with a separate Lisp.
@@ -37,10 +37,9 @@ in the larger process of compiling and testing programs.
37@cindex compilation errors 37@cindex compilation errors
38@cindex error log 38@cindex error log
39 39
40 Emacs can run compilers for noninteractive languages such as C and 40 Emacs can run compilers for languages such as C and Fortran, feeding
41Fortran as inferior processes, feeding the error log into an Emacs buffer. 41the compilation log into an Emacs buffer. It can also parse the error
42It can also parse the error messages and show you the source lines where 42messages and show you where the errors occurred.
43compilation errors occurred.
44 43
45@table @kbd 44@table @kbd
46@item M-x compile 45@item M-x compile
@@ -54,65 +53,60 @@ Kill the running compilation subprocess.
54@end table 53@end table
55 54
56@findex compile 55@findex compile
57 To run @code{make} or another compilation command, do @kbd{M-x 56 To run @code{make} or another compilation command, type @kbd{M-x
58compile}. This command reads a shell command line using the minibuffer, 57compile}. This reads a shell command line using the minibuffer, and
59and then executes the command in an inferior shell, putting output in 58then executes the command by running a shell as a subprocess (or
60the buffer named @samp{*compilation*}. The current buffer's default 59@dfn{inferior process}) of Emacs. The output is inserted in a buffer
61directory is used as the working directory for the execution of the 60named @samp{*compilation*}. The current buffer's default directory is
62command; normally, therefore, the compilation happens in this 61used as the working directory for the execution of the command;
63directory. 62normally, therefore, compilation takes place in this directory.
64 63
65@vindex compile-command 64@vindex compile-command
66 The default for the compilation command is normally @samp{make -k}, 65 The default compilation command is @samp{make -k}, which is usually
67which is correct most of the time for nontrivial programs. 66correct for programs compiled using the @command{make} utility (the
68@xref{Top,, Make, make, GNU Make Manual}. If you have done @kbd{M-x 67@samp{-k} flag tells @command{make} to continue compiling as much as
69compile} before, the default each time is the command you used the 68possible after an error). @xref{Top,, Make, make, GNU Make Manual}.
70previous time. @code{compile} stores this command in the variable 69If you have done @kbd{M-x compile} before, the command that you
71@code{compile-command}, so setting that variable specifies the default 70specified is automatically stored in the variable
72for the next use of @kbd{M-x compile}. If a file specifies a file 71@code{compile-command}; this is used as the default the next time you
73local value for @code{compile-command}, that provides the default when 72type @kbd{M-x compile}. A file can also specify a file-local value
74you type @kbd{M-x compile} in that file's buffer. @xref{File 73for @code{compile-command} (@pxref{File Variables}).
75Variables}. 74
76 75 Starting a compilation displays the @samp{*compilation*} buffer in
77 Starting a compilation displays the buffer @samp{*compilation*} in 76another window but does not select it. While the compilation is
78another window but does not select it. The buffer's mode line tells 77running, the word @samp{run} is shown in the major mode indicator for
79you whether compilation is finished, with the word @samp{run}, 78the @samp{*compilation*} buffer, and the word @samp{Compiling} appears
80@samp{signal} or @samp{exit} inside the parentheses. You do not have 79in all mode lines. You do not have to keep the @samp{*compilation*}
81to keep this buffer visible; compilation continues in any case. While 80buffer visible while compilation is running; it continues in any case.
82a compilation is going on, the string @samp{Compiling} appears in the 81When the compilation ends, for whatever reason, the mode line of the
83mode lines of all windows. When this string disappears, the 82@samp{*compilation*} buffer changes to say @samp{exit} (followed by
84compilation is finished. 83the exit code: @samp{[0]} for a normal exit), or @samp{signal} (if a
85 84signal terminated the process).
86 If you want to watch the compilation transcript as it appears, switch 85
87to the @samp{*compilation*} buffer and move point to the end of the 86 If you want to watch the compilation transcript as it appears,
88buffer. When point is at the end, new compilation output is inserted 87switch to the @samp{*compilation*} buffer and move point to the end of
89above point, which remains at the end. If point is not at the end of 88the buffer. When point is at the end, new compilation output is
90the buffer, it remains fixed while more compilation output is added at 89inserted above point, which remains at the end. Otherwise, point
91the end of the buffer. 90remains fixed while compilation output is added at the end of the
91buffer.
92 92
93@cindex compilation buffer, keeping point at end 93@cindex compilation buffer, keeping point at end
94@vindex compilation-scroll-output 94@vindex compilation-scroll-output
95 If you change the variable @code{compilation-scroll-output} to a 95 If you change the variable @code{compilation-scroll-output} to a
96non-@code{nil} value, the compilation buffer will scroll automatically 96non-@code{nil} value, the @samp{*compilation*} buffer scrolls
97to follow the output as it comes in. If the value is 97automatically to follow the output. If the value is
98@code{first-error}, the scrolling stops at the first error that 98@code{first-error}, scrolling stops when the first error appears,
99appears, leaving point at that error. For any other non-@code{nil} 99leaving point at that error. For any other non-@code{nil} value,
100value, the buffer continues scrolling until there is no more output. 100scrolling continues until there is no more output.
101 101
102@findex recompile 102@findex recompile
103 To rerun the last compilation with the same command, type @kbd{M-x 103 To rerun the last compilation with the same command, type @kbd{M-x
104recompile}. This automatically reuses the compilation command from 104recompile}. This reuses the compilation command from the last
105the last invocation of @kbd{M-x compile}. It also reuses the 105invocation of @kbd{M-x compile}. It also reuses the
106@samp{*compilation*} buffer and starts the compilation in its default 106@samp{*compilation*} buffer and starts the compilation in its default
107directory, which is the directory in which the previous compilation 107directory, which is the directory in which the previous compilation
108was started. 108was started.
109 109
110 When the compiler process terminates, for whatever reason, the mode
111line of the @samp{*compilation*} buffer changes to say @samp{exit}
112(followed by the exit code, @samp{[0]} for a normal exit), or
113@samp{signal} (if a signal terminated the process), instead of
114@samp{run}.
115
116@findex kill-compilation 110@findex kill-compilation
117 Starting a new compilation also kills any compilation already 111 Starting a new compilation also kills any compilation already
118running in @samp{*compilation*}, as the buffer can only handle one 112running in @samp{*compilation*}, as the buffer can only handle one
@@ -126,27 +120,6 @@ the @samp{*compilation*} buffer (perhaps using @code{rename-uniquely};
126@pxref{Misc Buffer}), then switch buffers and start the other 120@pxref{Misc Buffer}), then switch buffers and start the other
127compilation. This will create a new @samp{*compilation*} buffer. 121compilation. This will create a new @samp{*compilation*} buffer.
128 122
129 Emacs does not expect a compiler process to launch asynchronous
130subprocesses; if it does, and they keep running after the main
131compiler process has terminated, Emacs may kill them or their output
132may not arrive in Emacs. To avoid this problem, make the main process
133wait for its subprocesses to finish. In a shell script, you can do this
134using @samp{$!} and @samp{wait}, like this:
135
136@example
137(sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess}
138echo first message
139wait $pid # @r{Wait for subprocess}
140@end example
141
142 If the background process does not output to the compilation buffer,
143so you only need to prevent it from being killed when the main
144compilation process terminates, this is sufficient:
145
146@example
147nohup @var{command}; sleep 1
148@end example
149
150@vindex compilation-environment 123@vindex compilation-environment
151 You can control the environment passed to the compilation command 124 You can control the environment passed to the compilation command
152with the variable @code{compilation-environment}. Its value is a list 125with the variable @code{compilation-environment}. Its value is a list
@@ -159,153 +132,154 @@ variable settings override the usual ones.
159 132
160@cindex Compilation mode 133@cindex Compilation mode
161@cindex mode, Compilation 134@cindex mode, Compilation
162 The @samp{*compilation*} buffer uses a special major mode, 135@cindex locus
163Compilation mode, whose main feature is to provide a convenient way to 136 The @samp{*compilation*} buffer uses a major mode called Compilation
164visit the source line corresponding to an error message. These 137mode. Compilation mode turns each error message in the buffer into a
165commands are also available in other special buffers that list 138hyperlink; you can move point to it and type @key{RET}, or click on it
166locations in files, including those made by @kbd{M-x grep} and 139with the mouse (@pxref{Mouse References}), to visit the @dfn{locus} of
167@kbd{M-x occur}. 140the error message in a separate window. The locus is the specific
141position in a file where that error occurred.
142
143@findex compile-goto-error
144@vindex compilation-auto-jump-to-first-error
145 If you change the variable
146@code{compilation-auto-jump-to-first-error} to a non-@code{nil} value,
147Emacs automatically visits the locus of the first error message that
148appears in the @samp{*compilation*} buffer.
149
150 Compilation mode provides the following additional commands. These
151commands can also be used in @samp{*grep*} buffers, where the
152hyperlinks are search matches rather than error messages (@pxref{Grep
153Searching}).
168 154
169@table @kbd 155@table @kbd
170@item M-g M-n 156@item M-g M-n
171@itemx M-g n 157@itemx M-g n
172@itemx C-x ` 158@itemx C-x `
173Visit the locus of the next error message or match. 159Visit the locus of the next error message or match (@code{next-error}).
174@item M-g M-p 160@item M-g M-p
175@itemx M-g p 161@itemx M-g p
176Visit the locus of the previous error message or match. 162Visit the locus of the previous error message or match
177@item @key{RET} 163(@code{previous-error}).
178Visit the locus of the error message that point is on.
179This command is used in the compilation buffer.
180@item Mouse-2
181Visit the locus of the error message that you click on.
182@item M-n 164@item M-n
183Find and highlight the locus of the next error message, without 165Move point to the next error message or match, without visiting its
184selecting the source buffer. 166locus (@code{compilation-next-error}).
185@item M-p 167@item M-p
186Find and highlight the locus of the previous error message, without 168Move point to the previous error message or match, without visiting
187selecting the source buffer. 169its locus (@code{compilation-previous-error}).
188@item M-@} 170@item M-@}
189Move point to the next error for a different file than the current 171Move point to the next error message or match occurring in a different
190one. 172file (@code{compilation-next-file}).
191@item M-@{ 173@item M-@{
192Move point to the previous error for a different file than the current 174Move point to the previous error message or match occurring in a
193one. 175different file (@code{compilation-previous-file}).
194@item C-c C-f 176@item C-c C-f
195Toggle Next Error Follow minor mode, which makes cursor motion in the 177Toggle Next Error Follow minor mode, which makes cursor motion in the
196compilation buffer produce automatic source display. 178compilation buffer produce automatic source display.
197@end table 179@end table
198 180
199@findex compile-goto-error
200@vindex compilation-auto-jump-to-first-error
201 You can visit the source for any particular error message by moving
202point in the @samp{*compilation*} buffer to that error message and
203typing @key{RET} (@code{compile-goto-error}). Alternatively, you can
204click @kbd{Mouse-2} on the error message; you need not switch to the
205@samp{*compilation*} buffer first. If you set the variable
206@code{compilation-auto-jump-to-first-error} to a non-@code{nil} value,
207Emacs automatically jumps to the first error, if any, as soon as it
208appears in the @samp{*compilation*} buffer.
209
210@kindex M-g M-n 181@kindex M-g M-n
211@kindex M-g n 182@kindex M-g n
212@kindex C-x ` 183@kindex C-x `
213@findex next-error 184@findex next-error
214@vindex next-error-highlight 185@vindex next-error-highlight
215 To parse the compiler error messages sequentially, type @kbd{C-x `} 186 To visit errors sequentially, type @w{@kbd{C-x `}}
216(@code{next-error}). The character following the @kbd{C-x} is the 187(@code{next-error}), or equivalently @kbd{M-g M-n} or @kbd{M-g n}.
217backquote or ``grave accent,'' not the single-quote. This command is 188This command can be invoked from any buffer, not just a Compilation
218available in all buffers, not just in @samp{*compilation*}; it 189mode buffer. The first time you invoke it after a compilation, it
219displays the next error message at the top of one window and source 190visits the locus of the first error message. Each subsequent
220location of the error in another window. It also temporarily 191@w{@kbd{C-x `}} visits the next error, in a similar fashion. If you
221highlights the relevant source line, for a period controlled by the 192visit a specific error with @key{RET} or a mouse click in the
222variable @code{next-error-highlight}. 193@samp{*compilation*} buffer, subsequent @w{@kbd{C-x `}} commands
223 194advance from there. When @w{@kbd{C-x `}} finds no more error messages
224 The first time @w{@kbd{C-x `}} is used after the start of a compilation, 195to visit, it signals an error. @w{@kbd{C-u C-x `}} starts again from
225it moves to the first error's location. Subsequent uses of @kbd{C-x 196the beginning of the compilation buffer, and visits the first locus.
226`} advance down to subsequent errors. If you visit a specific error 197
227message with @key{RET} or @kbd{Mouse-2}, subsequent @w{@kbd{C-x `}} 198 @kbd{M-g M-p} or @kbd{M-g p} (@code{previous-error}) iterates
228commands advance from there. When @w{@kbd{C-x `}} gets to the end of the 199through errors in the opposite direction.
229buffer and finds no more error messages to visit, it fails and signals 200
230an Emacs error. @w{@kbd{C-u C-x `}} starts scanning from the beginning of 201 The @code{next-error} and @code{previous-error} commands don't just
231the compilation buffer, and goes to the first error's location. 202act on the errors or matches listed in @samp{*compilation*} and
203@samp{*grep*} buffers; they also know how to iterate through error or
204match lists produced by other commands, such as @kbd{M-x occur}
205(@pxref{Other Repeating Search}). If you are already in a buffer
206containing error messages or matches, those are the ones that are
207iterated through; otherwise, Emacs looks for a buffer containing error
208messages or matches amongst the windows of the selected frame, then
209for one that @code{next-error} or @code{previous-error} previously
210iterated through, and finally amongst all other buffers. If the
211buffer chosen for iterating through is not currently displayed in a
212window, it will be displayed.
232 213
233@vindex compilation-skip-threshold 214@vindex compilation-skip-threshold
234 By default, @w{@kbd{C-x `}} skips less important messages. The variable 215 By default, the @code{next-error} and @code{previous-error} commands
235@code{compilation-skip-threshold} controls this. If its value is 2, 216skip less important messages. The variable
236@w{@kbd{C-x `}} skips anything less than error, 1 skips anything less 217@code{compilation-skip-threshold} controls this. The default value,
237than warning, and 0 doesn't skip any messages. The default is 1. 2181, means to skip anything less important than a warning. A value of 2
238 219means to skip anything less important than an error, while 0 means not
239 When the window has a left fringe, an arrow in the fringe points to 220to skip any messages.
240the current message in the compilation buffer. The variable 221
241@code{compilation-context-lines} controls the number of lines of 222 When Emacs visits the locus of an error message, it momentarily
242leading context to display before the current message. Going to an 223highlights the relevant source line. The duration of this highlight
243error message location scrolls the @samp{*compilation*} buffer to put 224is determined by the variable @code{next-error-highlight}.
244the message that far down from the top. The value @code{nil} is 225
245special: if there's a left fringe, the window doesn't scroll at all 226@vindex compilation-context-lines
246if the message is already visible. If there is no left fringe, 227 If the @samp{*compilation*} buffer is shown in a window with a left
247@code{nil} means display the message at the top of the window. 228fringe (@pxref{Fringes}), the locus-visiting commands put an arrow in
248 229the fringe, pointing to the current error message. If the window has
249 If you're not in the compilation buffer when you run 230no left fringe, such as on a text-only terminal, these commands scroll
250@code{next-error}, Emacs will look for a buffer that contains error 231the window so that the current message is at the top of the window.
251messages. First, it looks for one displayed in the selected frame, 232If you change the variable @code{compilation-context-lines} to an
252then for one that previously had @code{next-error} called on it, and 233integer value @var{n}, these commands scroll the window so that the
253then at the current buffer. Finally, Emacs looks at all the remaining 234current error message is @var{n} lines from the top, whether or not
254buffers. @code{next-error} signals an error if it can't find any such 235there is a fringe; the default value, @code{nil}, gives the behavior
255buffer. 236described above.
256 237
257@vindex compilation-error-regexp-alist 238@vindex compilation-error-regexp-alist
258@vindex grep-regexp-alist 239@vindex grep-regexp-alist
259 To parse messages from the compiler, Compilation mode uses the 240 To parse messages from the compiler, Compilation mode uses the
260variable @code{compilation-error-regexp-alist} which lists various 241variable @code{compilation-error-regexp-alist} which lists various
261formats of error messages and tells Emacs how to extract the source file 242error message formats and tells Emacs how to extract the locus from
262and the line number from the text of a message. If your compiler isn't 243each. A similar variable, @code{grep-regexp-alist}, tells Emacs how
263supported, you can tailor Compilation mode to it by adding elements to 244to parse output from a @code{grep} command (@pxref{Grep Searching}).
264that list. A similar variable @code{grep-regexp-alist} tells Emacs how
265to parse output of a @code{grep} command.
266 245
267@findex compilation-next-error 246@findex compilation-next-error
268@findex compilation-previous-error 247@findex compilation-previous-error
269@findex compilation-next-file 248@findex compilation-next-file
270@findex compilation-previous-file 249@findex compilation-previous-file
271 Compilation mode also redefines the keys @key{SPC} and @key{DEL} to 250 Compilation mode also defines the keys @key{SPC} and @key{DEL} to
272scroll by screenfuls, and @kbd{M-n} (@code{compilation-next-error}) 251scroll by screenfuls; @kbd{M-n} (@code{compilation-next-error}) and
273and @kbd{M-p} (@code{compilation-previous-error}) to move to the next 252@kbd{M-p} (@code{compilation-previous-error}) to move to the next or
274or previous error message. You can also use @kbd{M-@{} 253previous error message; and @kbd{M-@{} (@code{compilation-next-file})
275(@code{compilation-next-file} and @kbd{M-@}} 254and @kbd{M-@}} (@code{compilation-previous-file}) to move to the next
276(@code{compilation-previous-file}) to move up or down to an error 255or previous error message for a different source file.
277message for a different source file.
278 256
279@cindex Next Error Follow mode 257@cindex Next Error Follow mode
280@findex next-error-follow-minor-mode 258@findex next-error-follow-minor-mode
281 You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In 259 You can type @kbd{C-c C-f} to toggle Next Error Follow mode. In
282this minor mode, ordinary cursor motion in the compilation buffer 260this minor mode, ordinary cursor motion in the compilation buffer
283automatically updates the source buffer. For instance, moving the 261automatically updates the source buffer, i.e.@: moving the cursor over
284cursor to the next error message causes the location of that error to 262an error message causes the locus of that error to be displayed.
285be displayed immediately.
286 263
287 The features of Compilation mode are also available in a minor mode 264 The features of Compilation mode are also available in a minor mode
288called Compilation Minor mode. This lets you parse error messages in 265called Compilation Minor mode. This lets you parse error messages in
289any buffer, not just a normal compilation output buffer. Type @kbd{M-x 266any buffer, not just a normal compilation output buffer. Type
290compilation-minor-mode} to enable the minor mode. This defines the keys 267@kbd{M-x compilation-minor-mode} to enable the minor mode. For
291@key{RET} and @kbd{Mouse-2}, as in the Compilation major mode. 268instance, in an Rlogin buffer (@pxref{Remote Host}), Compilation minor
292 269mode automatically accesses remote source files by FTP (@pxref{File
293 Compilation minor mode works in any buffer, as long as the contents 270Names}).
294are in a format that it understands. In an Rlogin buffer (@pxref{Remote
295Host}), Compilation minor mode automatically accesses remote source
296files by FTP (@pxref{File Names}).
297 271
298@node Compilation Shell 272@node Compilation Shell
299@section Subshells for Compilation 273@section Subshells for Compilation
300 274
301 Emacs uses a shell to run the compilation command, but specifies the 275 The @kbd{M-x compile} command uses a shell to run the compilation
302option for a noninteractive shell. This means, in particular, that 276command, but specifies the option for a noninteractive shell. This
303the shell should start with no prompt. If you find your usual shell 277means, in particular, that the shell should start with no prompt. If
304prompt making an unsightly appearance in the @samp{*compilation*} 278you find your usual shell prompt making an unsightly appearance in the
305buffer, it means you have made a mistake in your shell's init file by 279@samp{*compilation*} buffer, it means you have made a mistake in your
306setting the prompt unconditionally. (This init file's name may be 280shell's init file by setting the prompt unconditionally. (This init
307@file{.bashrc}, @file{.profile}, @file{.cshrc}, @file{.shrc}, or 281file may be named @file{.bashrc}, @file{.profile}, @file{.cshrc},
308various other things, depending on the shell you use.) The shell init 282@file{.shrc}, etc., depending on what shell you use.) The shell init
309file should set the prompt only if there already is a prompt. Here's 283file should set the prompt only if there already is a prompt. Here's
310how to do it in bash: 284how to do it in bash:
311 285
@@ -322,67 +296,80 @@ And here's how to do it in csh:
322if ($?prompt) set prompt = @dots{} 296if ($?prompt) set prompt = @dots{}
323@end example 297@end example
324 298
325 There may well be other things that your shell's init file 299 Emacs does not expect a compiler process to launch asynchronous
326ought to do only for an interactive shell. You can use the same 300subprocesses; if it does, and they keep running after the main
327method to conditionalize them. 301compiler process has terminated, Emacs may kill them or their output
302may not arrive in Emacs. To avoid this problem, make the main
303compilation process wait for its subprocesses to finish. In a shell
304script, you can do this using @samp{$!} and @samp{wait}, like this:
305
306@example
307(sleep 10; echo 2nd)& pid=$! # @r{Record pid of subprocess}
308echo first message
309wait $pid # @r{Wait for subprocess}
310@end example
311
312@noindent
313If the background process does not output to the compilation buffer,
314so you only need to prevent it from being killed when the main
315compilation process terminates, this is sufficient:
316
317@example
318nohup @var{command}; sleep 1
319@end example
328 320
329 The MS-DOS ``operating system'' does not support asynchronous
330subprocesses; to work around this lack, @kbd{M-x compile} runs the
331compilation command synchronously on MS-DOS. As a consequence, you must
332wait until the command finishes before you can do anything else in
333Emacs.
334@iftex
335@inforef{MS-DOS,,emacs-xtra}.
336@end iftex
337@ifnottex 321@ifnottex
338@xref{MS-DOS}. 322 On the MS-DOS ``operating system'', asynchronous subprocesses are
323not supported, so @kbd{M-x compile} runs the compilation command
324synchronously (i.e.@: you must wait until the command finishes before
325you can do anything else in Emacs). @xref{MS-DOS}.
339@end ifnottex 326@end ifnottex
340 327
341@node Grep Searching 328@node Grep Searching
342@section Searching with Grep under Emacs 329@section Searching with Grep under Emacs
343 330
344 Just as you can run a compiler from Emacs and then visit the lines 331 Just as you can run a compiler from Emacs and then visit the lines
345with compilation errors, you can also run @code{grep} and then visit 332with compilation errors, you can also run @command{grep} and then
346the lines on which matches were found. This works by treating the 333visit the lines on which matches were found. This works by treating
347matches reported by @code{grep} as if they were ``errors.'' The 334the matches reported by @command{grep} as if they were ``errors.''
348buffer of matches uses Grep mode, which is a variant of Compilation 335The output buffer uses Grep mode, which is a variant of Compilation
349mode (@pxref{Compilation Mode}). 336mode (@pxref{Compilation Mode}).
350 337
351@table @kbd 338@table @kbd
352@item M-x grep 339@item M-x grep
353@itemx M-x lgrep 340@itemx M-x lgrep
354Run @code{grep} asynchronously under Emacs, with matching lines 341Run @command{grep} asynchronously under Emacs, listing matching lines in
355listed in the buffer named @samp{*grep*}. 342the buffer named @samp{*grep*}.
356@item M-x grep-find 343@item M-x grep-find
357@itemx M-x find-grep 344@itemx M-x find-grep
358@itemx M-x rgrep 345@itemx M-x rgrep
359Run @code{grep} via @code{find}, and collect output in the buffer 346Run @command{grep} via @code{find}, and collect output in the
360named @samp{*grep*}. 347@samp{*grep*} buffer.
361@item M-x zrgrep 348@item M-x zrgrep
362Run @code{zgrep} and collect output in the buffer named @samp{*grep*}. 349Run @code{zgrep} and collect output in the @samp{*grep*} buffer.
363@item M-x kill-grep 350@item M-x kill-grep
364Kill the running @code{grep} subprocess. 351Kill the running @command{grep} subprocess.
365@end table 352@end table
366 353
367@findex grep 354@findex grep
368 To run @code{grep}, type @kbd{M-x grep}, then enter a command line 355 To run @command{grep}, type @kbd{M-x grep}, then enter a command line
369that specifies how to run @code{grep}. Use the same arguments you 356that specifies how to run @command{grep}. Use the same arguments you
370would give @code{grep} when running it normally: a @code{grep}-style 357would give @command{grep} when running it normally: a @command{grep}-style
371regexp (usually in single-quotes to quote the shell's special 358regexp (usually in single-quotes to quote the shell's special
372characters) followed by file names, which may use wildcards. If you 359characters) followed by file names, which may use wildcards. If you
373specify a prefix argument for @kbd{M-x grep}, it finds the tag 360specify a prefix argument for @kbd{M-x grep}, it finds the tag
374(@pxref{Tags}) in the buffer around point, and puts that into the 361(@pxref{Tags}) in the buffer around point, and puts that into the
375default @code{grep} command. 362default @command{grep} command.
376 363
377 Your command need not simply run @code{grep}; you can use any shell 364 Your command need not simply run @command{grep}; you can use any shell
378command that produces output in the same format. For instance, you 365command that produces output in the same format. For instance, you
379can chain @code{grep} commands, like this: 366can chain @command{grep} commands, like this:
380 367
381@example 368@example
382grep -nH -e foo *.el | grep bar | grep toto 369grep -nH -e foo *.el | grep bar | grep toto
383@end example 370@end example
384 371
385 The output from @code{grep} goes in the @samp{*grep*} buffer. You 372 The output from @command{grep} goes in the @samp{*grep*} buffer. You
386can find the corresponding lines in the original files using @w{@kbd{C-x 373can find the corresponding lines in the original files using @w{@kbd{C-x
387`}}, @key{RET}, and so forth, just like compilation errors. 374`}}, @key{RET}, and so forth, just like compilation errors.
388 375
@@ -397,30 +384,31 @@ match will be highlighted, instead of the entire source line.
397 The command @kbd{M-x grep-find} (also available as @kbd{M-x 384 The command @kbd{M-x grep-find} (also available as @kbd{M-x
398find-grep}) is similar to @kbd{M-x grep}, but it supplies a different 385find-grep}) is similar to @kbd{M-x grep}, but it supplies a different
399initial default for the command---one that runs both @code{find} and 386initial default for the command---one that runs both @code{find} and
400@code{grep}, so as to search every file in a directory tree. See also 387@command{grep}, so as to search every file in a directory tree. See also
401the @code{find-grep-dired} command, in @ref{Dired and Find}. 388the @code{find-grep-dired} command, in @ref{Dired and Find}.
402 389
403@findex lgrep 390@findex lgrep
404@findex rgrep 391@findex rgrep
405@findex zrgrep 392@findex zrgrep
406 The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep} 393 The commands @kbd{M-x lgrep} (local grep) and @kbd{M-x rgrep}
407(recursive grep) are more user-friendly versions of @code{grep} and 394(recursive grep) are more user-friendly versions of @command{grep} and
408@code{grep-find}, which prompt separately for the regular expression 395@code{grep-find}, which prompt separately for the regular expression
409to match, the files to search, and the base directory for the search. 396to match, the files to search, and the base directory for the search.
410Case sensitivity of the search is controlled by the current value of 397Case sensitivity of the search is controlled by the current value of
411@code{case-fold-search}. The command @kbd{M-x zrgrep} is similar to 398@code{case-fold-search}. The command @kbd{M-x zrgrep} is similar to
412@code{rgrep}, but it calls @code{zgrep} instead of @code{grep} to 399@kbd{M-x rgrep}, but it calls @command{zgrep} instead of
413search the contents of gzipped files. 400@command{grep} to search the contents of gzipped files.
414 401
415 These commands build the shell commands based on the variables 402 These commands build the shell commands based on the variables
416@code{grep-template} (for @code{lgrep}) and @code{grep-find-template} 403@code{grep-template} (for @code{lgrep}) and @code{grep-find-template}
417(for @code{rgrep}). The files to search can use aliases defined in 404(for @code{rgrep}). The files to search can use aliases defined in
418the variable @code{grep-files-aliases}. 405the variable @code{grep-files-aliases}.
419 406
420 Subdirectories listed in the variable 407@vindex grep-find-ignored-directories
421@code{grep-find-ignored-directories} such as those typically used by 408 Directories listed in the variable
422various version control systems, like CVS and arch, are automatically 409@code{grep-find-ignored-directories} are automatically skipped by
423skipped by @code{rgrep}. 410@kbd{M-x rgrep}. The default value includes the data directories used
411by various version control systems.
424 412
425@node Flymake 413@node Flymake
426@section Finding Syntax Errors On The Fly 414@section Finding Syntax Errors On The Fly
@@ -444,8 +432,13 @@ flymake-goto-next-error} and @kbd{M-x flymake-goto-prev-error}. To
444display any error messages associated with the current line, use 432display any error messages associated with the current line, use
445@kbd{M-x flymake-display-err-menu-for-current-line}. 433@kbd{M-x flymake-display-err-menu-for-current-line}.
446 434
447 For more details about using Flymake, see @ref{Top, Flymake, 435 For more details about using Flymake,
448Flymake, flymake, The Flymake Manual}. 436@ifnottex
437see @ref{Top, Flymake, Flymake, flymake, The Flymake Manual}.
438@end ifnottex
439@iftex
440see the Flymake Info manual, which is distributed with Emacs.
441@end iftex
449 442
450@node Debuggers 443@node Debuggers
451@section Running Debuggers Under Emacs 444@section Running Debuggers Under Emacs
@@ -459,16 +452,18 @@ Flymake, flymake, The Flymake Manual}.
459@cindex JDB 452@cindex JDB
460@cindex PDB 453@cindex PDB
461 454
462@c Do you believe in GUD?
463The GUD (Grand Unified Debugger) library provides an Emacs interface 455The GUD (Grand Unified Debugger) library provides an Emacs interface
464to a wide variety of symbolic debuggers. Unlike the GDB graphical 456to a wide variety of symbolic debuggers. It can run the GNU Debugger
465interface, which only runs GDB (@pxref{GDB Graphical Interface}), GUD 457(GDB), as well as DBX, SDB, XDB, Perl's debugging mode, the Python
466can also run DBX, SDB, XDB, Perl's debugging mode, the Python debugger 458debugger PDB, and the Java Debugger JDB.
467PDB, or the Java Debugger JDB.
468 459
469 In addition, Emacs contains a built-in system for debugging Emacs 460 Emacs provides a special interface to GDB, which uses extra Emacs
470Lisp programs. @xref{Debugging,, The Lisp Debugger, elisp, the Emacs 461windows to display the state of the debugged program. @xref{GDB
471Lisp Reference Manual}, for information on the Emacs Lisp debugger. 462Graphical Interface}.
463
464 Emacs also has a built-in debugger for Emacs Lisp programs.
465@xref{Debugging,, The Lisp Debugger, elisp, the Emacs Lisp Reference
466Manual}.
472 467
473@menu 468@menu
474* Starting GUD:: How to start a debugger subprocess. 469* Starting GUD:: How to start a debugger subprocess.
@@ -483,146 +478,136 @@ Lisp Reference Manual}, for information on the Emacs Lisp debugger.
483@node Starting GUD 478@node Starting GUD
484@subsection Starting GUD 479@subsection Starting GUD
485 480
486 There are several commands for starting a debugger under GUD, each 481 There are several commands for starting a debugger subprocess, each
487corresponding to a particular debugger program. 482corresponding to a particular debugger program.
488 483
489@table @kbd 484@table @kbd
490@item M-x gdb @key{RET} @var{file} @key{RET} 485@item M-x gdb
491@findex gdb 486@findex gdb
492Run GDB as a subprocess of Emacs. This uses an IDE-like graphical 487Run GDB as a subprocess, and interact with it via an IDE-like Emacs
493interface; see @ref{GDB Graphical Interface}. Only GDB works with the 488interface. @xref{GDB Graphical Interface}, for more information about
494graphical interface. 489this command.
495 490
496@item M-x gud-gdb @key{RET} @var{file} @key{RET} 491@item M-x gud-gdb
497@findex gud-gdb 492@findex gud-gdb
498Run GDB as a subprocess of Emacs. This command creates a buffer for 493Run GDB, using a GUD interaction buffer for input and output to the
499input and output to GDB, and switches to it. If a GDB buffer already 494GDB subprocess (@pxref{Debugger Operation}). If such a buffer already
500exists, it just switches to that buffer. 495exists, switch to it; otherwise, create the buffer and switch to it.
501
502@item M-x dbx @key{RET} @var{file} @key{RET}
503@findex dbx
504Run DBX as a subprocess of Emacs. Since Emacs does not implement a
505graphical interface for DBX, communication with DBX works by typing
506commands in the GUD interaction buffer. The same is true for all
507the other supported debuggers.
508 496
509@item M-x xdb @key{RET} @var{file} @key{RET} 497The other commands in this list do the same, for other debugger
510@findex xdb 498programs.
511@vindex gud-xdb-directories
512Run XDB as a subprocess of Emacs. Use the variable
513@code{gud-xdb-directories} to specify directories to search for source
514files.
515
516@item M-x sdb @key{RET} @var{file} @key{RET}
517@findex sdb
518Run SDB as a subprocess of Emacs.
519 499
520Some versions of SDB do not mention source file names in their 500@item M-x perldb
521messages. When you use them, you need to have a valid tags table
522(@pxref{Tags}) in order for GUD to find functions in the source code.
523If you have not visited a tags table or the tags table doesn't list
524one of the functions, you get a message saying @samp{The sdb support
525requires a valid tags table to work}. If this happens, generate a
526valid tags table in the working directory and try again.
527
528@item M-x perldb @key{RET} @var{file} @key{RET}
529@findex perldb 501@findex perldb
530Run the Perl interpreter in debug mode to debug @var{file}, a Perl program. 502Run the Perl interpreter in debug mode.
531 503
532@item M-x jdb @key{RET} @var{file} @key{RET} 504@item M-x jdb
533@findex jdb 505@findex jdb
534Run the Java debugger to debug @var{file}. 506Run the Java debugger.
535 507
536@item M-x pdb @key{RET} @var{file} @key{RET} 508@item M-x pdb
537@findex pdb 509@findex pdb
538Run the Python debugger to debug @var{file}. 510Run the Python debugger.
511
512@item M-x dbx
513@findex dbx
514Run the DBX debugger.
515
516@item M-x xdb
517@findex xdb
518@vindex gud-xdb-directories
519Run the XDB debugger.
520
521@item M-x sdb
522@findex sdb
523Run the SDB debugger.
539@end table 524@end table
540 525
541 Each of these commands takes one argument: a command line to invoke 526 Each of these commands reads a command line to invoke the debugger,
542the debugger. In the simplest case, specify just the name of the 527using the minibuffer. The minibuffer's initial contents contain the
543executable file you want to debug. You may also use options that the 528standard executable name and options for the debugger, and sometimes
544debugger supports. However, shell wildcards and variables are not 529also a guess for the name of the executable file you want to debug.
545allowed. GUD assumes that the first argument not starting with a 530Shell wildcards and variables are not allowed in this command line.
546@samp{-} is the executable file name. 531Emacs assumes that the first command argument which does not start
532with a @samp{-} is the executable file name.
547 533
548@cindex remote host, debugging on 534@cindex remote host, debugging on
549Tramp provides a facility to debug programs on remote hosts 535 Tramp provides a facility for remote debugging, whereby both the
550(@pxref{Running a debugger on a remote host, Running a debugger on a 536debugger and the program being debugged are on the same remote host.
551remote host,, tramp, The Tramp Manual}), whereby both the debugger and 537@xref{Running a debugger on a remote host,,, tramp, The Tramp Manual},
552the program being debugged are on the same remote host. This should 538for details. This is separate from GDB's remote debugging feature,
553not be confused with debugging programs remotely, where the program 539where the program and the debugger run on different machines
554and the debugger run on different machines, as can be done using the 540(@pxref{Remote Debugging,, Debugging Remote Programs, gdb, The GNU
555GDB remote debugging feature, for example (@pxref{Remote Debugging,, 541debugger}).
556Debugging Remote Programs, gdb, The GNU debugger}).
557 542
558@node Debugger Operation 543@node Debugger Operation
559@subsection Debugger Operation 544@subsection Debugger Operation
545@cindex GUD interaction buffer
546
547 The @dfn{GUD interaction buffer} is an Emacs buffer which is used to
548send text commands to a debugger subprocess, and record its output.
549This is the basic interface for interacting with a debugger, used by
550@kbd{M-x gud-gdb} and other commands listed in
551@iftex
552the preceding section.
553@end iftex
554@ifnottex
555@ref{Starting GUD}.
556@end ifnottex
557The @kbd{M-x gdb} command extends this interface with additional
558specialized buffers for controlling breakpoints, stack frames, and
559other aspects of the debugger state (@pxref{GDB Graphical Interface}).
560 560
561@cindex fringes, and current execution line in GUD 561 The GUD interaction buffer uses a variant of Shell mode, so the
562 Generally when you run a debugger with GUD, the debugger uses an Emacs 562Emacs commands defined by Shell mode are available (@pxref{Shell
563buffer for its ordinary input and output. This is called the GUD 563Mode}). Completion is available for most debugger commands
564buffer. Input and output from the program you are debugging also use 564(@pxref{Completion}), and you can use the usual Shell mode history
565this buffer. We call this @dfn{text command mode}. The GDB Graphical 565commands to repeat them.
566Interface can use further buffers (@pxref{GDB Graphical Interface}). 566@iftex
567 567See the next section
568 The debugger displays the source files of the program by visiting 568@end iftex
569them in Emacs buffers. An arrow in the left fringe indicates the 569@ifnottex
570current execution line.@footnote{On a text-only terminal, the arrow 570@xref{Commands of GUD},
571appears as @samp{=>} and overlays the first two text columns.} Moving 571@end ifnottex
572point in this buffer does not move the arrow. The arrow is not part 572for special commands that can be used in the GUD interaction buffer.
573of the file's text; it appears only on the screen. 573
574 574 As you debug a program, Emacs displays the relevant source files by
575 You can start editing these source files at any time in the buffers 575visiting them in Emacs buffers, with an arrow in the left fringe
576that display them. If you do modify a source file, keep in mind that 576indicating the current execution line. (On a text-only terminal, the
577inserting or deleting lines will throw off the arrow's positioning; 577arrow appears as @samp{=>}, overlaid on the first two text columns.)
578GUD has no way of figuring out which line corresponded before your 578Moving point in such a buffer does not move the arrow. You are free
579changes to the line number in a debugger message. Also, you'll 579to edit these source files, but note that inserting or deleting lines
580typically have to recompile and restart the program for your changes 580will throw off the arrow's positioning, as Emacs has no way to figure
581to be reflected in the debugger's tables. 581out which edited source line corresponds to the line reported by the
582 582debugger subprocess. To update this information, you typically have
583@cindex tooltips with GUD 583to recompile and restart the program.
584@vindex tooltip-gud-modes 584
585@vindex gud-tooltip-mode 585@cindex GUD Tooltip mode
586@cindex mode, GUD Tooltip
587@findex gud-tooltip-mode
586@vindex gud-tooltip-echo-area 588@vindex gud-tooltip-echo-area
587 The Tooltip facility (@pxref{Tooltips}) provides support for GUD@. 589 GUD Tooltip mode is a global minor mode that adds tooltip support to
588You activate this feature by turning on the minor mode 590GUD. To toggle this mode, type @kbd{M-x gud-tooltip-mode}. It is
589@code{gud-tooltip-mode}. Then you can display a variable's value in a 591disabled by default. If enabled, you can move the mouse cursor over a
590tooltip simply by pointing at it with the mouse. This operates in the 592variable to show its value in a tooltip (@pxref{Tooltips}); this takes
591GUD buffer and in source buffers with major modes in the list 593effect in the GUD interaction buffer, and in all source buffers with
592@code{gud-tooltip-modes}. If the variable @code{gud-tooltip-echo-area} 594major modes listed in the variable @code{gud-tooltip-modes}. If the
593is non-@code{nil} then the variable's value is displayed in the echo 595variable @code{gud-tooltip-echo-area} is non-@code{nil}, values are
594area. When debugging a C program using the GDB Graphical Interface, you 596shown in the echo area instead of a tooltip.
595can also display macro definitions associated with an identifier when 597
596the program is not executing. 598 When using GUD Tooltip mode with @kbd{M-x gud-gdb}, you should note
597 599that displaying an expression's value in GDB can sometimes expand a
598 GUD tooltips are disabled when you use GDB in text command mode 600macro, potentially causing side effects in the debugged program. If
599(@pxref{GDB Graphical Interface}), because displaying an expression's 601you use the @kbd{M-x gdb} interface, this problem does not occur, as
600value in GDB can sometimes expand a macro and result in a side effect 602there is special code to avoid side-effects; furthermore, you can
601that interferes with the program's operation. The GDB graphical 603display macro definitions associated with an identifier when the
602interface supports GUD tooltips and assures they will not cause side 604program is not executing.
603effects.
604 605
605@node Commands of GUD 606@node Commands of GUD
606@subsection Commands of GUD 607@subsection Commands of GUD
607 608
608 The GUD interaction buffer uses a variant of Shell mode, so the 609 GUD provides commands for setting and clearing breakpoints,
609Emacs commands of Shell mode are available (@pxref{Shell Mode}). All 610selecting stack frames, and stepping through the program.
610the usual commands for your debugger are available, and you can use
611the Shell mode history commands to repeat them. If you wish, you can
612control your debugger process entirely through this buffer.
613
614 GUD mode also provides commands for setting and clearing
615breakpoints, for selecting stack frames, and for stepping through the
616program. These commands are available both in the GUD buffer and
617globally, but with different key bindings. It also has its own tool
618bar from which you can invoke the more common commands by clicking on
619the appropriate icon. This is particularly useful for repetitive
620commands like @code{gud-next} and @code{gud-step}, and allows you to
621keep the GUD buffer hidden.
622
623 The breakpoint commands are normally used in source file buffers,
624because that is the easiest way to specify where to set or clear the
625breakpoint. Here's the global command to set a breakpoint:
626 611
627@table @kbd 612@table @kbd
628@item C-x @key{SPC} 613@item C-x @key{SPC}
@@ -630,35 +615,42 @@ breakpoint. Here's the global command to set a breakpoint:
630Set a breakpoint on the source line that point is on. 615Set a breakpoint on the source line that point is on.
631@end table 616@end table
632 617
618 @kbd{C-x @key{SPC}} (@code{gud-break}), when called in a source
619buffer, sets a debugger breakpoint on the current source line. This
620command is available only after starting GUD. If you call it in a
621buffer that is not associated with any debugger subprocess, it signals
622a error.
623
633@kindex C-x C-a @r{(GUD)} 624@kindex C-x C-a @r{(GUD)}
634 Here are the other special commands provided by GUD@. The keys 625 The following commands are available both in the GUD interaction
626buffer and globally, but with different key bindings. The keys
635starting with @kbd{C-c} are available only in the GUD interaction 627starting with @kbd{C-c} are available only in the GUD interaction
636buffer. The key bindings that start with @kbd{C-x C-a} are available 628buffer, while those starting with @kbd{C-x C-a} are available
637in the GUD interaction buffer and also in source files. Some of these 629globally. Some of these commands are also available via the tool bar;
638commands are not available to all the supported debuggers. 630some are not supported by certain debuggers.
639 631
640@table @kbd 632@table @kbd
641@item C-c C-l 633@item C-c C-l
642@kindex C-c C-l @r{(GUD)} 634@kindex C-c C-l @r{(GUD)}
643@itemx C-x C-a C-l 635@itemx C-x C-a C-l
644@findex gud-refresh 636@findex gud-refresh
645Display in another window the last line referred to in the GUD 637Display, in another window, the last source line referred to in the
646buffer (that is, the line indicated in the last location message). 638GUD interaction buffer (@code{gud-refresh}).
647This runs the command @code{gud-refresh}.
648 639
649@item C-c C-s 640@item C-c C-s
650@kindex C-c C-s @r{(GUD)} 641@kindex C-c C-s @r{(GUD)}
651@itemx C-x C-a C-s 642@itemx C-x C-a C-s
652@findex gud-step 643@findex gud-step
653Execute a single line of code (@code{gud-step}). If the line contains 644Execute the next single line of code (@code{gud-step}). If the line
654a function call, execution stops after entering the called function. 645contains a function call, execution stops after entering the called
646function.
655 647
656@item C-c C-n 648@item C-c C-n
657@kindex C-c C-n @r{(GUD)} 649@kindex C-c C-n @r{(GUD)}
658@itemx C-x C-a C-n 650@itemx C-x C-a C-n
659@findex gud-next 651@findex gud-next
660Execute a single line of code, stepping across entire function calls 652Execute the next single line of code, stepping across function calls
661at full speed (@code{gud-next}). 653without stopping inside the functions (@code{gud-next}).
662 654
663@item C-c C-i 655@item C-c C-i
664@kindex C-c C-i @r{(GUD)} 656@kindex C-c C-i @r{(GUD)}
@@ -769,17 +761,17 @@ Instead, type @kbd{C-q @key{TAB}} to enter a tab.
769@vindex perldb-mode-hook 761@vindex perldb-mode-hook
770@vindex pdb-mode-hook 762@vindex pdb-mode-hook
771@vindex jdb-mode-hook 763@vindex jdb-mode-hook
772 On startup, GUD runs one of the following hooks: @code{gdb-mode-hook}, 764 On startup, GUD runs one of the following hooks:
773if you are using GDB; @code{dbx-mode-hook}, if you are using DBX; 765@code{gdb-mode-hook}, if you are using GDB; @code{dbx-mode-hook}, if
774@code{sdb-mode-hook}, if you are using SDB; @code{xdb-mode-hook}, if you 766you are using DBX; @code{sdb-mode-hook}, if you are using SDB;
775are using XDB; @code{perldb-mode-hook}, for Perl debugging mode; 767@code{xdb-mode-hook}, if you are using XDB; @code{perldb-mode-hook},
776@code{pdb-mode-hook}, for PDB; @code{jdb-mode-hook}, for JDB. You can 768for Perl debugging mode; @code{pdb-mode-hook}, for PDB;
777use these hooks to define custom key bindings for the debugger 769@code{jdb-mode-hook}, for JDB. @xref{Hooks}.
778interaction buffer. @xref{Hooks}. 770
779 771 The @code{gud-def} Lisp macro (@pxref{Defining Macros,,, elisp, the
780 Here is a convenient way to define a command that sends a particular 772Emacs Lisp Reference Manual}) provides a convenient way to define an
781command string to the debugger, and set up a key binding for it in the 773Emacs command that sends a particular command string to the debugger,
782debugger interaction buffer: 774and set up a key binding for in the GUD interaction buffer:
783 775
784@findex gud-def 776@findex gud-def
785@example 777@example
@@ -835,21 +827,22 @@ Fully qualified class name derived from the expression surrounding point
835@node GDB Graphical Interface 827@node GDB Graphical Interface
836@subsection GDB Graphical Interface 828@subsection GDB Graphical Interface
837 829
838 The command @code{gdb} starts GDB in a graphical interface, using 830 The command @kbd{M-x gdb} starts GDB in an IDE-like interface, with
839Emacs windows for display program state information. With it, you do 831specialized buffers for controlling breakpoints, stack frames, and
840not need to use textual GDB commands; you can control the debugging 832other aspects of the debugger state. It also provides additional ways
841session with the mouse. For example, you can click in the fringe of a 833to control the debugging session with the mouse, such as clicking in
842source buffer to set a breakpoint there, or on a stack frame in the 834the fringe of a source buffer to set a breakpoint there.
843stack buffer to select that frame.
844
845 This mode requires telling GDB that its ``screen size'' is
846unlimited, so it sets the height and width accordingly. For correct
847operation you must not change these values during the GDB session.
848 835
849@vindex gud-gdb-command-name 836@vindex gud-gdb-command-name
850 To run GDB in text command mode, like the other debuggers in Emacs, 837 To run GDB using just the GUD interaction buffer interface, without
851use @kbd{M-x gud-gdb}. You need to use text command mode to debug 838these additional features, use @kbd{M-x gud-gdb} (@pxref{Starting
852multiple programs within one Emacs session. 839GUD}). You must use this if you want to debug multiple programs
840within one Emacs session, as that is currently unsupported by @kbd{M-x
841gdb}.
842
843 Internally, @kbd{M-x gdb} informs GDB that its ``screen size'' is
844unlimited; for correct operation, you must not change GDB's screen
845height and width values during the debugging session.
853 846
854@menu 847@menu
855* GDB User Interface Layout:: Control the number of displayed buffers. 848* GDB User Interface Layout:: Control the number of displayed buffers.
@@ -858,8 +851,7 @@ multiple programs within one Emacs session.
858* Breakpoints Buffer:: A breakpoint control panel. 851* Breakpoints Buffer:: A breakpoint control panel.
859* Threads Buffer:: Displays your threads. 852* Threads Buffer:: Displays your threads.
860* Stack Buffer:: Select a frame from the call stack. 853* Stack Buffer:: Select a frame from the call stack.
861* Other GDB Buffers:: Input/output, locals, registers, 854* Other GDB Buffers:: Other buffers for controlling the GDB state.
862 assembler, threads and memory buffers.
863* Watch Expressions:: Monitor variable values in the speedbar. 855* Watch Expressions:: Monitor variable values in the speedbar.
864* Multithreaded Debugging:: Debugging programs with several threads. 856* Multithreaded Debugging:: Debugging programs with several threads.
865@end menu 857@end menu
@@ -869,12 +861,12 @@ multiple programs within one Emacs session.
869@cindex GDB User Interface layout 861@cindex GDB User Interface layout
870 862
871@vindex gdb-many-windows 863@vindex gdb-many-windows
872 If the variable @code{gdb-many-windows} is @code{nil} (the default 864 If the variable @code{gdb-many-windows} is @code{nil} (the default),
873value) then @kbd{M-x gdb} normally displays only the GUD buffer. 865@kbd{M-x gdb} normally displays only the GUD interaction buffer.
874However, if the variable @code{gdb-show-main} is also non-@code{nil}, 866However, if the variable @code{gdb-show-main} is also non-@code{nil},
875it starts with two windows: one displaying the GUD buffer, and the 867it starts with two windows: one displaying the GUD interaction buffer,
876other showing the source for the @code{main} function of the program 868and the other showing the source for the @code{main} function of the
877you are debugging. 869program you are debugging.
878 870
879 If @code{gdb-many-windows} is non-@code{nil}, then @kbd{M-x gdb} 871 If @code{gdb-many-windows} is non-@code{nil}, then @kbd{M-x gdb}
880displays the following frame layout: 872displays the following frame layout:
@@ -882,7 +874,7 @@ displays the following frame layout:
882@smallexample 874@smallexample
883@group 875@group
884+--------------------------------+--------------------------------+ 876+--------------------------------+--------------------------------+
885| GUD buffer (I/O of GDB) | Locals/Registers buffer | 877| GUD interaction buffer | Locals/Registers buffer |
886|--------------------------------+--------------------------------+ 878|--------------------------------+--------------------------------+
887| Primary Source buffer | I/O buffer for debugged pgm | 879| Primary Source buffer | I/O buffer for debugged pgm |
888|--------------------------------+--------------------------------+ 880|--------------------------------+--------------------------------+
@@ -896,264 +888,233 @@ buffer does not appear and the primary source buffer occupies the full
896width of the frame. 888width of the frame.
897 889
898@findex gdb-restore-windows 890@findex gdb-restore-windows
899 If you change the window layout, for example, while editing and
900re-compiling your program, then you can restore this standard window
901layout with the command @code{gdb-restore-windows}.
902
903@findex gdb-many-windows 891@findex gdb-many-windows
904 To switch between this standard layout and a simple layout 892 If you ever change the window layout, you can restore the ``many
905containing just the GUD buffer and a source file, type @kbd{M-x 893windows'' layout by typing @kbd{M-x gdb-restore-windows}. To toggle
906gdb-many-windows}. 894between the many windows layout and a simple layout with just the GUD
895interaction buffer and a source file, type @kbd{M-x gdb-many-windows}.
907 896
908 You may also specify additional GDB-related buffers to display, 897 You may also specify additional GDB-related buffers to display,
909either in the same frame or a different one. Select the buffers you 898either in the same frame or a different one. Select the buffers you
910want with the @samp{GUD->GDB-Windows} and @samp{GUD->GDB-Frames} 899want by typing @code{M-x gdb-display-@var{buffertype}-buffer} or
911sub-menus. If the menu-bar is unavailable, type @code{M-x 900@code{M-x gdb-frame-@var{buffertype}-buffer}, where @var{buffertype}
912gdb-display-@var{buffertype}-buffer} or @code{M-x 901is the relevant buffer type, such as @samp{breakpoints}. You can do
913gdb-frame-@var{buffertype}-buffer} respectively, where 902the same with the menu bar, with the @samp{GDB-Windows} and
914@var{buffertype} is the relevant buffer type, such as 903@samp{GDB-Frames} sub-menus of the @samp{GUD} menu.
915@samp{breakpoints}. Most of these buffers are read-only, and typing 904
916@kbd{q} in them kills them. 905 When you finish debugging, kill the GUD interaction buffer with
917 906@kbd{C-x k}, which will also kill all the buffers associated with the
918 When you finish debugging, kill the GUD buffer with @kbd{C-x k}, 907session. However you need not do this if, after editing and
919which will also kill all the buffers associated with the session. 908re-compiling your source code within Emacs, you wish to continue
920However you need not do this if, after editing and re-compiling your 909debugging. When you restart execution, GDB automatically finds the
921source code within Emacs, you wish continue debugging. When you 910new executable. Keeping the GUD interaction buffer has the advantage
922restart execution, GDB will automatically find your new executable. 911of keeping the shell history as well as GDB's breakpoints. You do
923Keeping the GUD buffer has the advantage of keeping the shell history 912need to check that the breakpoints in recently edited source files are
924as well as GDB's breakpoints. You do need to check that the 913still in the right places.
925breakpoints in recently edited source files are still in the right
926places.
927 914
928@node Source Buffers 915@node Source Buffers
929@subsubsection Source Buffers 916@subsubsection Source Buffers
930@cindex GDB commands in Fringe 917@cindex fringes, for debugging
931
932@c @findex gdb-mouse-set-clear-breakpoint
933@c @findex gdb-mouse-toggle-breakpoint
934Many GDB commands can be entered using key bindings or the tool bar but
935sometimes it is quicker to use the fringe. These commands either
936manipulate breakpoints or control program execution. When there is no
937fringe, you can use the margin but this is only present when the
938source file already has a breakpoint.
939
940You can click @kbd{Mouse-1} in the fringe or display margin of a
941source buffer to set a breakpoint there and, on a graphical display, a
942red bullet will appear on that line. If a breakpoint already exists
943on that line, the same click will remove it. You can also enable or
944disable a breakpoint by clicking @kbd{C-Mouse-1} on the bullet.
945
946A solid arrow in the left fringe of a source buffer indicates the line
947of the innermost frame where the debugged program has stopped. A
948hollow arrow indicates the current execution line of higher level
949frames.
950
951If you drag the arrow in the fringe with @kbd{Mouse-1}
952(@code{gdb-mouse-until}), execution will continue to the line where
953you release the button, provided it is still in the same frame.
954Alternatively, you can click @kbd{Mouse-3} at some point in the fringe
955of this buffer and execution will advance to there. A similar command
956(@code{gdb-mouse-jump}) allows you to jump to a source line without
957executing the intermediate lines by clicking @kbd{C-Mouse-3}. This
958command allows you to go backwards which can be useful for running
959through code that has already executed, in order to examine its
960execution in more detail.
961 918
962@table @kbd 919@table @asis
963@item Mouse-1 920@item @kbd{Mouse-1} (in fringe)
964Set or clear a breakpoint. 921Set or clear a breakpoint on that line.
965 922
966@item C-Mouse-1 923@item @kbd{C-Mouse-1} (in fringe)
967Enable or disable a breakpoint. 924Enable or disable a breakpoint on that line.
968 925
969@item Mouse-3 926@item @kbd{Mouse-3} (in fringe)
970Continue execution to here. 927Continue execution to that line.
971 928
972@item C-Mouse-3 929@item @kbd{C-Mouse-3} (in fringe)
973Jump to here. 930Jump to that line.
974@end table 931@end table
975 932
976If the variable @code{gdb-find-source-frame} is non-@code{nil} and 933 On a graphical display, you can click @kbd{Mouse-1} in the fringe of
977execution stops in a frame for which there is no source code e.g after 934a source buffer, to set a breakpoint on that line (@pxref{Fringes}).
978an interrupt, then Emacs finds and displays the first frame further up 935A red dot appears in the fringe, where you clicked. If a breakpoint
979stack for which there is source. If it is @code{nil} then the source 936already exists there, the click removes it. A @kbd{C-Mouse-1} click
980buffer continues to display the last frame which maybe more useful, 937enables or disables an existing breakpoint; a breakpoint that is
981for example, when re-setting a breakpoint. 938disabled, but not unset, is indicated by a gray dot.
939
940 On a text-only terminal, or when fringes are disabled, enabled
941breakpoints are indicated with a @samp{B} character in the left margin
942of the window. Disabled breakpoints are indicated with @samp{b}.
943(The margin is only displayed if a breakpoint is present.)
944
945 A solid arrow in the left fringe of a source buffer indicates the
946line of the innermost frame where the debugged program has stopped. A
947hollow arrow indicates the current execution line of a higher-level
948frame. If you drag the arrow in the fringe with @kbd{Mouse-1}, that
949causes execution to advance to the line where you release the button.
950Alternatively, you can click @kbd{Mouse-3} in the fringe to advance to
951that line. You can click @kbd{C-Mouse-3} in the fringe to jump to
952that line without executing the intermediate lines. This command
953allows you to go backwards, which can be useful for running through
954code that has already executed, in order to examine its execution in
955more detail.
982 956
983@node Breakpoints Buffer 957@node Breakpoints Buffer
984@subsubsection Breakpoints Buffer 958@subsubsection Breakpoints Buffer
985 959
986 The breakpoints buffer shows the existing breakpoints, watchpoints and 960 The GDB Breakpoints buffer shows the breakpoints, watchpoints and
987catchpoints (@pxref{Breakpoints,,, gdb, The GNU debugger}). It has 961catchpoints in the debugger session. @xref{Breakpoints,,, gdb, The
988these special commands, which mostly apply to the @dfn{current 962GNU debugger}. It provides the following commands, which mostly apply
989breakpoint}, the breakpoint which point is on. 963to the @dfn{current breakpoint} (the breakpoint which point is on):
990 964
991@table @kbd 965@table @kbd
992@item @key{SPC} 966@item @key{SPC}
993@kindex SPC @r{(GDB breakpoints buffer)} 967@kindex SPC @r{(GDB Breakpoints buffer)}
994@findex gdb-toggle-breakpoint 968@findex gdb-toggle-breakpoint
995Enable/disable current breakpoint (@code{gdb-toggle-breakpoint}). 969Enable/disable current breakpoint (@code{gdb-toggle-breakpoint}). On
996On a graphical display, this changes the color of a bullet in the 970a graphical display, this changes the color of the dot in the fringe
997margin of a source buffer at the relevant line. This is red when 971of the source buffer at that line. The dot is red when the breakpoint
998the breakpoint is enabled and gray when it is disabled. Text-only 972is enabled, and gray when it is disabled.
999terminals correspondingly display a @samp{B} or @samp{b}.
1000 973
1001@item D 974@item D
1002@kindex D @r{(GDB breakpoints buffer)} 975@kindex D @r{(GDB Breakpoints buffer)}
1003@findex gdb-delete-breakpoint 976@findex gdb-delete-breakpoint
1004Delete the current breakpoint (@code{gdb-delete-breakpoint}). 977Delete the current breakpoint (@code{gdb-delete-breakpoint}).
1005 978
1006@item @key{RET} 979@item @key{RET}
1007@kindex RET @r{(GDB breakpoints buffer)} 980@kindex RET @r{(GDB Breakpoints buffer)}
1008@findex gdb-goto-breakpoint 981@findex gdb-goto-breakpoint
1009Visit the source line for the current breakpoint 982Visit the source line for the current breakpoint
1010(@code{gdb-goto-breakpoint}). 983(@code{gdb-goto-breakpoint}).
1011 984
1012@item Mouse-2 985@item Mouse-2
1013@kindex Mouse-2 @r{(GDB breakpoints buffer)} 986@kindex Mouse-2 @r{(GDB Breakpoints buffer)}
1014Visit the source line for the breakpoint you click on. 987Visit the source line for the breakpoint you click on.
1015@end table 988@end table
1016 989
1017@vindex gdb-show-threads-by-default 990@vindex gdb-show-threads-by-default
1018When @code{gdb-many-windows} is non-@code{nil}, the breakpoints buffer 991 When @code{gdb-many-windows} is non-@code{nil}, the GDB Breakpoints
1019shares its window with the threads buffer. To switch from one to the 992buffer shares its window with the GDB Threads buffer. To switch from
1020other click with @kbd{Mouse-1} on the relevant button in the header 993one to the other click with @kbd{Mouse-1} on the relevant button in
1021line. If @code{gdb-show-threads-by-default} is non-@code{nil}, the 994the header line. If @code{gdb-show-threads-by-default} is
1022threads buffer, rather than the breakpoints buffer, is shown at start 995non-@code{nil}, the GDB Threads buffer is the one shown by default.
1023up.
1024 996
1025@node Threads Buffer 997@node Threads Buffer
1026@subsubsection Threads Buffer 998@subsubsection Threads Buffer
1027 999
1028@findex gdb-select-thread 1000@findex gdb-select-thread
1029The threads buffer displays a summary of all threads currently in your 1001 The GDB Threads buffer displays a summary of the threads in the
1030program (@pxref{Threads, Threads, Debugging programs with multiple 1002debugged program. @xref{Threads, Threads, Debugging programs with
1031threads, gdb, The GNU debugger}). Move point to any thread in the list 1003multiple threads, gdb, The GNU debugger}. To select a thread, move
1032and press @key{RET} to select it (@code{gdb-select-thread}) and 1004point there and type @key{RET} (@code{gdb-select-thread}), or click on
1033display the associated source in the primary source buffer. 1005it with @kbd{Mouse-2}. This also displays the associated source
1034Alternatively, click @kbd{Mouse-2} on a thread to select it. Contents 1006buffer, and updates the contents of the other GDB buffers.
1035of all GDB buffers are updated whenever you select a thread.
1036 1007
1037 You can customize variables under @code{gdb-buffers} group to select 1008 You can customize variables under @code{gdb-buffers} group to select
1038fields included in threads buffer. 1009fields included in GDB Threads buffer.
1039 1010
1040@table @code 1011@table @code
1041@item gdb-thread-buffer-verbose-names 1012@item gdb-thread-buffer-verbose-names
1042@vindex gdb-thread-buffer-verbose-names 1013@vindex gdb-thread-buffer-verbose-names
1043Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)} in 1014Show long thread names like @samp{Thread 0x4e2ab70 (LWP 1983)}.
1044threads buffer.
1045 1015
1046@item gdb-thread-buffer-arguments 1016@item gdb-thread-buffer-arguments
1047@vindex gdb-thread-buffer-arguments 1017@vindex gdb-thread-buffer-arguments
1048Show arguments of thread top frames in threads buffer. 1018Show arguments of thread top frames.
1049 1019
1050@item gdb-thread-buffer-locations 1020@item gdb-thread-buffer-locations
1051@vindex gdb-thread-buffer-locations 1021@vindex gdb-thread-buffer-locations
1052Show file information or library names in threads buffer. 1022Show file information or library names.
1053 1023
1054@item gdb-thread-buffer-addresses 1024@item gdb-thread-buffer-addresses
1055@vindex gdb-thread-buffer-addresses 1025@vindex gdb-thread-buffer-addresses
1056Show addresses for thread frames in threads buffer. 1026Show addresses for thread frames in threads buffer.
1057@end table 1027@end table
1058 1028
1059 It's possible to observe information for several threads 1029 To view information for several threads simultaneously, use the
1060simultaneously (in addition to buffers which show information for 1030following commands from the GDB Threads buffer.
1061currently selected thread) using the following keys from the threads
1062buffer.
1063 1031
1064@table @kbd 1032@table @kbd
1065@item d 1033@item d
1066@kindex d @r{(GDB threads buffer)} 1034@kindex d @r{(GDB threads buffer)}
1067@findex gdb-display-disassembly-for-thread 1035@findex gdb-display-disassembly-for-thread
1068Display disassembly buffer for the thread at current line. 1036Display disassembly buffer for the thread at current line
1069(@code{gdb-display-disassembly-for-thread}) 1037(@code{gdb-display-disassembly-for-thread}).
1070 1038
1071@item f 1039@item f
1072@kindex f @r{(GDB threads buffer)} 1040@kindex f @r{(GDB threads buffer)}
1073@findex gdb-display-stack-for-thread 1041@findex gdb-display-stack-for-thread
1074Display stack buffer for the thread at current line. 1042Display the GDB Stack buffer for the thread at current line
1075(@code{gdb-display-stack-for-thread}). 1043(@code{gdb-display-stack-for-thread}).
1076 1044
1077@item l 1045@item l
1078@kindex l @r{(GDB threads buffer)} 1046@kindex l @r{(GDB threads buffer)}
1079@findex gdb-display-locals-for-thread 1047@findex gdb-display-locals-for-thread
1080Display locals buffer for the thread at current line. 1048Display the GDB Locals buffer for the thread at current line
1081(@code{gdb-display-locals-for-thread}). 1049(@code{gdb-display-locals-for-thread}).
1082 1050
1083@item r 1051@item r
1084@kindex r @r{(GDB threads buffer)} 1052@kindex r @r{(GDB threads buffer)}
1085@findex gdb-display-registers-for-thread 1053@findex gdb-display-registers-for-thread
1086Display registers buffer for the thread at current line. 1054Display the GDB Registers buffer for the thread at current line
1087(@code{gdb-display-registers-for-thread}). 1055(@code{gdb-display-registers-for-thread}).
1088@end table 1056@end table
1089 1057
1090Pressing their upper-case counterparts, @kbd{D}, @kbd{F} ,@kbd{L} and 1058@noindent
1091@kbd{R} displays the corresponding buffer in a new frame. 1059Their upper-case counterparts, @kbd{D}, @kbd{F} ,@kbd{L} and @kbd{R},
1060display the corresponding buffer in a new frame.
1092 1061
1093 When you create a buffer showing information about some specific 1062 When you create a buffer showing information about some specific
1094thread, it becomes bound to that thread and keeps showing actual 1063thread, it becomes bound to that thread and keeps showing actual
1095information while you debug your program. Every GDB buffer contains a 1064information while you debug your program. The mode indicator for each
1096number of thread it shows information for in its mode name. Thread 1065GDB buffer shows the number of thread it is showing information about.
1097number is also included in the buffer name of bound buffers to prevent 1066The thread number is also included in the buffer name of bound
1098buffer names clashing. 1067buffers.
1099 1068
1100Further commands are available in the threads buffer which depend on the 1069 Further commands are available in the GDB Threads buffer which
1101mode of GDB that is used for controlling execution of your program. 1070depend on the mode of GDB that is used for controlling execution of
1102(@pxref{Multithreaded Debugging, Stopping and Starting Multi-threaded Programs}). 1071your program. @xref{Multithreaded Debugging}.
1103 1072
1104@node Stack Buffer 1073@node Stack Buffer
1105@subsubsection Stack Buffer 1074@subsubsection Stack Buffer
1106 1075
1107 The stack buffer displays a @dfn{call stack}, with one line for each 1076 The GDB Stack buffer displays a @dfn{call stack}, with one line for
1108of the nested subroutine calls (@dfn{stack frames}) now active in the 1077each of the nested subroutine calls (@dfn{stack frames}) in the
1109program. @xref{Backtrace,, Backtraces, gdb, The GNU debugger}. 1078debugger session. @xref{Backtrace,, Backtraces, gdb, The GNU
1079debugger}.
1110 1080
1111@findex gdb-frames-select 1081@findex gdb-frames-select
1112An arrow in the fringe points to the selected frame or, if the fringe is 1082 On graphical displays, the selected stack frame is indicated by an
1113not present, the number of the selected frame is displayed in reverse 1083arrow in the fringe. On text-only terminals, or when fringes are
1114contrast. To select a frame in GDB, move point in the stack buffer to 1084disabled, the selected stack frame is displayed in reverse contrast.
1115that stack frame and type @key{RET} (@code{gdb-frames-select}), or click 1085To select a stack frame, move point in its line and type @key{RET}
1116@kbd{Mouse-2} on a stack frame. If the locals buffer is visible, 1086(@code{gdb-frames-select}), or click @kbd{Mouse-2} on it. Doing so
1117selecting a stack frame updates it to display the local variables of the 1087also updates the Locals buffer
1118new frame. 1088@ifnottex
1089(@pxref{Other GDB Buffers}).
1090@end ifnottex
1091@iftex
1092(described in the next section).
1093@end iftex
1119 1094
1120@node Other GDB Buffers 1095@node Other GDB Buffers
1121@subsubsection Other Buffers 1096@subsubsection Other GDB Buffers
1122 1097
1123@table @asis 1098@table @asis
1124@item Input/Output Buffer
1125@vindex gdb-use-separate-io-buffer
1126If the variable @code{gdb-use-separate-io-buffer} is non-@code{nil},
1127the program being debugged takes its input and displays its output
1128here. Otherwise it uses the GUD buffer for that. To toggle whether
1129GUD mode uses this buffer, do @kbd{M-x gdb-use-separate-io-buffer}.
1130This takes effect when you next restart the program you are debugging.
1131
1132The history and replay commands from Shell mode are available here,
1133as are the commands to send signals to the debugged program.
1134@xref{Shell Mode}.
1135
1136@item Locals Buffer 1099@item Locals Buffer
1137The locals buffer displays the values of local variables of the 1100This buffer displays the values of local variables of the current
1138current frame for simple data types (@pxref{Frame Info, Frame Info, 1101frame for simple data types (@pxref{Frame Info, Frame Info,
1139Information on a frame, gdb, The GNU debugger}). Press @key{RET} or 1102Information on a frame, gdb, The GNU debugger}). Press @key{RET} or
1140click @kbd{Mouse-2} on the value if you want to edit it. 1103click @kbd{Mouse-2} on the value if you want to edit it.
1141 1104
1142Arrays and structures display their type only. With GDB 6.4 or later, 1105Arrays and structures display their type only. With GDB 6.4 or later,
1143move point to their name and press @key{RET}, or alternatively click 1106you can examine the value of the local variable at point by typing
1144@kbd{Mouse-2} there, to examine their values. With earlier versions 1107@key{RET}, or with a @kbd{Mouse-2} click. With earlier versions of
1145of GDB, use @kbd{Mouse-2} or @key{RET} on the type description 1108GDB, use @key{RET} or @kbd{Mouse-2} on the type description
1146(@samp{[struct/union]} or @samp{[array]}). @xref{Watch Expressions}. 1109(@samp{[struct/union]} or @samp{[array]}). @xref{Watch Expressions}.
1147 1110
1148@item Registers Buffer 1111@item Registers Buffer
1149@findex toggle-gdb-all-registers 1112@findex toggle-gdb-all-registers
1150The registers buffer displays the values held by the registers 1113This buffer displays the values held by the registers
1151(@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or 1114(@pxref{Registers,,, gdb, The GNU debugger}). Press @key{RET} or
1152click @kbd{Mouse-2} on a register if you want to edit its value. 1115click @kbd{Mouse-2} on a register if you want to edit its value. With
1153With GDB 6.4 or later, recently changed register values display with 1116GDB 6.4 or later, recently changed register values display with
1154@code{font-lock-warning-face}. With earlier versions of GDB, you can 1117@code{font-lock-warning-face}.
1155press @key{SPC} to toggle the display of floating point registers
1156(@code{toggle-gdb-all-registers}).
1157 1118
1158@item Assembler Buffer 1119@item Assembler Buffer
1159The assembler buffer displays the current frame as machine code. An 1120The assembler buffer displays the current frame as machine code. An
@@ -1172,8 +1133,8 @@ size for these data items.
1172@end table 1133@end table
1173 1134
1174When @code{gdb-many-windows} is non-@code{nil}, the locals buffer 1135When @code{gdb-many-windows} is non-@code{nil}, the locals buffer
1175shares its window with the registers buffer, just like breakpoints 1136shares its window with the registers buffer, just like breakpoints and
1176and threads buffers. To switch from one to the other click with 1137threads buffers. To switch from one to the other, click with
1177@kbd{Mouse-1} on the relevant button in the header line. 1138@kbd{Mouse-1} on the relevant button in the header line.
1178 1139
1179@node Watch Expressions 1140@node Watch Expressions
@@ -1188,14 +1149,15 @@ in the tool bar (@code{gud-watch}) or type @kbd{C-x C-a C-w}. If you
1188specify a prefix argument, you can enter the variable name in the 1149specify a prefix argument, you can enter the variable name in the
1189minibuffer. 1150minibuffer.
1190 1151
1191 Each watch expression is displayed in the speedbar. Complex data 1152 Each watch expression is displayed in the speedbar
1192types, such as arrays, structures and unions are represented in a tree 1153(@pxref{Speedbar}). Complex data types, such as arrays, structures
1193format. Leaves and simple data types show the name of the expression 1154and unions are represented in a tree format. Leaves and simple data
1194and its value and, when the speedbar frame is selected, display the 1155types show the name of the expression and its value and, when the
1195type as a tooltip. Higher levels show the name, type and address 1156speedbar frame is selected, display the type as a tooltip. Higher
1196value for pointers and just the name and type otherwise. Root expressions 1157levels show the name, type and address value for pointers and just the
1197also display the frame address as a tooltip to help identify the frame 1158name and type otherwise. Root expressions also display the frame
1198in which they were defined. 1159address as a tooltip to help identify the frame in which they were
1160defined.
1199 1161
1200 To expand or contract a complex data type, click @kbd{Mouse-2} or 1162 To expand or contract a complex data type, click @kbd{Mouse-2} or
1201press @key{SPC} on the tag to the left of the expression. Emacs asks 1163press @key{SPC} on the tag to the left of the expression. Emacs asks
@@ -1243,51 +1205,43 @@ non-@code{nil}. This can be useful if you are debugging with a full
1243screen Emacs frame. 1205screen Emacs frame.
1244 1206
1245@node Multithreaded Debugging 1207@node Multithreaded Debugging
1246@subsubsection Stopping and Starting Multi-threaded Programs 1208@subsubsection Multithreaded Debugging
1247@cindex Multithreaded debugging in GDB 1209@cindex Multithreaded debugging in GDB
1248
1249@subsubheading All-stop Debugging
1250
1251In all-stop mode, whenever your program stops, @emph{all} threads of
1252execution stop. Likewise, whenever you restart the program, all
1253threads start executing. @xref{All-Stop Mode, , All-Stop Mode, gdb,
1254The GNU debugger}. You can enable this behavior in Emacs by setting
1255@code{gdb-non-stop-setting} to @code{nil} before starting a debugging
1256session.
1257
1258@subsubheading Non-stop Debugging
1259@cindex Non-stop debugging in GDB 1210@cindex Non-stop debugging in GDB
1260 1211
1261For some multi-threaded targets, GDB supports a further mode of 1212 In GDB's @dfn{all-stop mode}, whenever your program stops, all
1262operation in which you can examine stopped program threads in the 1213execution threads stop. Likewise, whenever you restart the program,
1263debugger while other threads continue to execute freely. 1214all threads start executing. @xref{All-Stop Mode, , All-Stop Mode,
1264@xref{Non-Stop Mode, , Non-Stop Mode, gdb, The GNU debugger}. 1215gdb, The GNU debugger}. For some multi-threaded targets, GDB supports
1265This is referred to as @dfn{non-stop} mode. 1216a further mode of operation, called @dfn{non-stop mode}, in which you
1266 1217can examine stopped program threads in the debugger while other
1267Versions of GDB prior to 7.0 do not support non-stop mode and it does 1218threads continue to execute freely. @xref{Non-Stop Mode, , Non-Stop
1268not work on all targets. In such cases, Emacs uses all-stop mode 1219Mode, gdb, The GNU debugger}. Versions of GDB prior to 7.0 do not
1269regardless of the value of @code{gdb-non-stop-setting}. 1220support non-stop mode, and it does not work on all targets.
1270 1221
1271@vindex gdb-non-stop-setting 1222@vindex gdb-non-stop-setting
1272If the variable @code{gdb-non-stop-setting} is non-@code{nil} (the 1223 The variable @code{gdb-non-stop-setting} determines whether Emacs
1273default value), Emacs tries to start GDB in non-stop mode. Note that 1224runs GDB in all-stop mode or non-stop mode. The default is @code{t},
1274GDB debugging session needs to be restarted for change of this setting 1225which means it tries to use non-stop mode if that is available. If
1275to take effect. 1226you change the value to @code{nil}, or if non-stop mode is
1227unavailable, Emacs runs GDB in all-stop mode. The variable takes
1228effect when Emacs begins a debugging session; if you change its value,
1229you should restart any active debugging session.
1276 1230
1277@vindex gdb-switch-when-another-stopped 1231@vindex gdb-switch-when-another-stopped
1278When a thread stops in non-stop mode, Emacs automatically switches to 1232 When a thread stops in non-stop mode, Emacs usually switches to that
1279that thread. It may be undesirable to allow switching of current 1233thread. If you don't want Emacs to do this switch if another stopped
1280thread when some other stopped thread is already selected. Set 1234thread is already selected, change the variable
1281@code{gdb-switch-when-another-stopped} to @code{nil} to prevent this. 1235@code{gdb-switch-when-another-stopped} to @code{nil}.
1282 1236
1283@vindex gdb-switch-reasons 1237@vindex gdb-switch-reasons
1284Emacs can decide whether or not to switch to the stopped thread 1238 Emacs can decide whether or not to switch to the stopped thread
1285depending on the reason which caused the stop. Customize 1239depending on the reason which caused the stop. Customize the variable
1286@code{gdb-switch-reasons} to select stop reasons which make Emacs 1240@code{gdb-switch-reasons} to select the stop reasons which will cause
1287switch thread. 1241a thread switch.
1288 1242
1289@vindex gdb-stopped-hooks 1243@vindex gdb-stopped-hooks
1290The variable @code{gdb-stopped-hooks} allows you to execute your 1244 The variable @code{gdb-stopped-hooks} allows you to execute your
1291functions whenever some thread stops. 1245functions whenever some thread stops.
1292 1246
1293 In non-stop mode, you can switch between different modes for GUD 1247 In non-stop mode, you can switch between different modes for GUD
@@ -1297,7 +1251,7 @@ execution control commands.
1297@table @dfn 1251@table @dfn
1298@item Non-stop/A 1252@item Non-stop/A
1299 1253
1300When @code{gdb-gud-control-all-threads} is @code{t} (the default 1254 When @code{gdb-gud-control-all-threads} is @code{t} (the default
1301value), interruption and continuation commands apply to all threads, 1255value), interruption and continuation commands apply to all threads,
1302so you can halt or continue all your threads with one command using 1256so you can halt or continue all your threads with one command using
1303@code{gud-stop-subjob} and @code{gud-cont}, respectively. The 1257@code{gud-stop-subjob} and @code{gud-cont}, respectively. The
@@ -1318,127 +1272,132 @@ from the tool bar or from @samp{GUD->GDB-MI} menu.
1318 1272
1319 Stepping commands always apply to the current thread. 1273 Stepping commands always apply to the current thread.
1320 1274
1321@subsubheading Fine Thread Control
1322
1323 In non-stop mode, you can interrupt/continue your threads without 1275 In non-stop mode, you can interrupt/continue your threads without
1324selecting them. Hitting @kbd{i} in threads buffer interrupts thread 1276selecting them. Hitting @kbd{i} in threads buffer interrupts thread
1325under point, @kbd{c} continues it, @kbd{s} steps through. More such 1277under point, @kbd{c} continues it, @kbd{s} steps through. More such
1326commands may be added in the future. 1278commands may be added in the future.
1327 1279
1328Combined with creating bound buffers for any thread, this allows you 1280 Note that when you interrupt a thread, it stops with the
1329to change and track state of many threads in the same time. 1281@samp{signal received} reason. If that reason is included in your
1330
1331 Note that when you interrupt a thread, it stops with @samp{signal
1332received} reason. If that reason is included in your
1333@code{gdb-switch-reasons} (it is by default), Emacs will switch to 1282@code{gdb-switch-reasons} (it is by default), Emacs will switch to
1334that thread. 1283that thread.
1335 1284
1336@node Executing Lisp 1285@node Executing Lisp
1337@section Executing Lisp Expressions 1286@section Executing Lisp Expressions
1338 1287
1339 Emacs has several different major modes for Lisp and Scheme. They are 1288 Emacs has major modes for several variants of Lisp. They use the
1340the same in terms of editing commands, but differ in the commands for 1289same editing commands as other programming language modes
1341executing Lisp expressions. Each mode has its own purpose. 1290(@pxref{Programs}). In addition, they provide special commands for
1291executing Lisp expressions.
1342 1292
1343@table @asis 1293@table @asis
1344@item Emacs-Lisp mode 1294@item Emacs Lisp mode
1345The mode for editing source files of programs to run in Emacs Lisp. 1295The mode for editing Emacs Lisp source files. It defines @kbd{C-M-x}
1346This mode defines @kbd{C-M-x} to evaluate the current defun. 1296to evaluate the current top-level Lisp expression. @xref{Lisp Eval}.
1347@xref{Lisp Libraries}. 1297
1348@item Lisp Interaction mode 1298@item Lisp Interaction mode
1349The mode for an interactive session with Emacs Lisp. It defines 1299The mode for an interactive Emacs Lisp session. It defines @kbd{C-j}
1350@kbd{C-j} to evaluate the sexp before point and insert its value in the 1300to evaluate the expression before point and insert its value in the
1351buffer. @xref{Lisp Interaction}. 1301buffer. @xref{Lisp Interaction}.
1302
1352@item Lisp mode 1303@item Lisp mode
1353The mode for editing source files of programs that run in Lisps other 1304The mode for editing source files of programs that run in Lisps other
1354than Emacs Lisp. This mode defines @kbd{C-M-x} to send the current defun 1305than Emacs Lisp. It defines @kbd{C-M-x} to evaluate the current
1355to an inferior Lisp process. @xref{External Lisp}. 1306top-level expression in an external Lisp. @xref{External Lisp}.
1307
1356@item Inferior Lisp mode 1308@item Inferior Lisp mode
1357The mode for an interactive session with an inferior Lisp process. 1309The mode for an interactive session with an external Lisp which is
1358This mode combines the special features of Lisp mode and Shell mode 1310being run as a subprocess (or @dfn{inferior process}) of Emacs.
1359(@pxref{Shell Mode}). 1311@ifnottex
1312@xref{External Lisp}.
1313@end ifnottex
1314
1360@item Scheme mode 1315@item Scheme mode
1361Like Lisp mode but for Scheme programs. 1316Like Lisp mode, but for Scheme programs.
1317
1362@item Inferior Scheme mode 1318@item Inferior Scheme mode
1363The mode for an interactive session with an inferior Scheme process. 1319Like Inferior Lisp mode, but for Scheme.
1364@end table 1320@end table
1365 1321
1366 Most editing commands for working with Lisp programs are in fact
1367available globally. @xref{Programs}.
1368
1369@node Lisp Libraries 1322@node Lisp Libraries
1370@section Libraries of Lisp Code for Emacs 1323@section Libraries of Lisp Code for Emacs
1371@cindex libraries 1324@cindex libraries
1372@cindex loading Lisp code 1325@cindex loading Lisp code
1373 1326
1374 Lisp code for Emacs editing commands is stored in files whose names 1327 Emacs Lisp code is stored in files whose names conventionally end in
1375conventionally end in @file{.el}. This ending tells Emacs to edit them in 1328@file{.el}. Such files are automatically visited in Emacs Lisp mode.
1376Emacs-Lisp mode (@pxref{Executing Lisp}).
1377 1329
1378@cindex byte code 1330@cindex byte code
1379 Emacs Lisp code can be compiled into byte-code, which loads faster, 1331 Emacs Lisp code can be compiled into byte-code, which loads faster,
1380takes up less space, and executes faster. @xref{Byte Compilation,, 1332takes up less space, and executes faster. By convention, compiled
1381Byte Compilation, elisp, the Emacs Lisp Reference Manual}. By 1333Emacs Lisp code goes in a separate file whose name ends in
1382convention, the compiled code for a library goes in a separate file 1334@samp{.elc}. For example, the compiled code for @file{foo.el} goes in
1383whose name ends in @samp{.elc}. Thus, the compiled code for 1335@file{foo.elc}. @xref{Byte Compilation,, Byte Compilation, elisp, the
1384@file{foo.el} goes in @file{foo.elc}. 1336Emacs Lisp Reference Manual}.
1385 1337
1386@findex load-file 1338@findex load-file
1387 To execute a file of Emacs Lisp code, use @kbd{M-x load-file}. This 1339 To @dfn{load} an Emacs Lisp file, type @kbd{M-x load-file}. This
1388command reads a file name using the minibuffer and then executes the 1340command reads a file name using the minibuffer, and executes the
1389contents of that file as Lisp code. It is not necessary to visit the 1341contents of that file as Emacs Lisp code. It is not necessary to
1390file first; in any case, this command reads the file as found on disk, 1342visit the file first; this command reads the file directly from disk,
1391not text in an Emacs buffer. 1343not from an existing Emacs buffer.
1392 1344
1393@findex load 1345@findex load
1394@findex load-library 1346@findex load-library
1395 Once a file of Lisp code is installed in the Emacs Lisp library 1347@cindex load path for Emacs Lisp
1396directories, users can load it using @kbd{M-x load-library}. Programs 1348 If an Emacs Lisp file is installed in the Emacs Lisp @dfn{load path}
1397can load it by calling @code{load}, a more primitive function that is 1349(defined below), you can load it by typing @kbd{M-x load-library},
1398similar but accepts some additional arguments. 1350instead of using @kbd{M-x load-file}. The @kbd{M-x load-library}
1399 1351command prompts for a @dfn{library name} rather than a file name; it
1400 @kbd{M-x load-library} differs from @kbd{M-x load-file} in that it 1352searches through each directory in the Emacs Lisp load path, trying to
1401searches a sequence of directories and tries three file names in each 1353find a file matching that library name. If the library name is
1402directory. Suppose your argument is @var{lib}; the three names are 1354@samp{@var{foo}}, it tries looking for files named
1403@file{@var{lib}.elc}, @file{@var{lib}.el}, and lastly just 1355@file{@var{foo}.elc}, @file{@var{foo}.el}, and lastly just
1404@file{@var{lib}}. If @file{@var{lib}.elc} exists, it is by convention 1356@file{@var{foo}}; the first one found is loaded. This command prefers
1405the result of compiling @file{@var{lib}.el}; it is better to load the 1357@file{.elc} files over @file{.el} files because compiled files load
1406compiled file, since it will load and run faster. 1358and run faster. If it finds that @file{@var{lib}.el} is newer than
1407 1359@file{@var{lib}.elc}, it issues a warning, in case someone made
1408 If @code{load-library} finds that @file{@var{lib}.el} is newer than 1360changes to the @file{.el} file and forgot to recompile it, but loads
1409@file{@var{lib}.elc} file, it issues a warning, because it's likely 1361the @file{.elc} file anyway. (Due to this behavior, you can save
1410that somebody made changes to the @file{.el} file and forgot to 1362unfinished edits to Emacs Lisp source files, and not recompile until
1411recompile it. Nonetheless, it loads @file{@var{lib}.elc}. This is 1363your changes are ready for use.)
1412because people often leave unfinished edits the source file, and don't 1364
1413recompile it until they think it is ready to use. 1365 Emacs Lisp programs usually load Emacs Lisp files using the
1366@code{load} function. This is similar to @code{load-library}, but is
1367lower-level and accepts additional arguments. @xref{How Programs Do
1368Loading,,, elisp, the Emacs Lisp Reference Manual}.
1414 1369
1415@vindex load-path 1370@vindex load-path
1416 The variable @code{load-path} specifies the sequence of directories 1371 The Emacs Lisp load path is specified by the variable
1417searched by @kbd{M-x load-library}. Its value should be a list of 1372@code{load-path}. Its value should be a list of directory names
1418strings that are directory names; in addition, @code{nil} in this list 1373(strings). These directories are searched, in the specified order, by
1419stands for the current default directory. (Generally, it is not a 1374the @kbd{M-x load-library} command, the lower-level @code{load}
1420good idea to put @code{nil} in the list; if you find yourself wishing 1375function, and other Emacs functions that find Emacs Lisp libraries. A
1376list entry in @code{load-path} can also have the special value
1377@code{nil}, which stands for the current default directory, but it is
1378almost always a bad idea to use this. (If you find yourself wishing
1421that @code{nil} were in the list, most likely what you really want is 1379that @code{nil} were in the list, most likely what you really want is
1422to do @kbd{M-x load-file} this once.) 1380to use @kbd{M-x load-file}.)
1423 1381
1424 The default value of @code{load-path} is a list of directories where 1382 The default value of @code{load-path} is a list of directories where
1425the Lisp code for Emacs itself is stored. If you have libraries of 1383the Lisp code for Emacs itself is stored. If you have libraries of
1426your own, put them in a single directory and add that directory to 1384your own in another directory, you can add that directory to the load
1427@code{load-path}, by adding a line like this to your init file 1385path. Unlike most other variables described in this manual,
1428(@pxref{Init File}): 1386@code{load-path} cannot be changed via the Customize interface
1387(@pxref{Easy Customization}), but you can add a directory to it by
1388putting a line like this in your init file (@pxref{Init File}):
1429 1389
1430@example 1390@example
1431(add-to-list 'load-path "/path/to/lisp/libraries") 1391(add-to-list 'load-path "/path/to/my/lisp/library")
1432@end example 1392@end example
1433 1393
1434@cindex autoload 1394@cindex autoload
1435 Some commands are @dfn{autoloaded}: when you run them, Emacs will 1395 Some commands are @dfn{autoloaded}: when you run them, Emacs
1436automatically load the associated library first. For instance, the 1396automatically loads the associated library first. For instance, the
1437@code{compile} and @code{compilation-mode} commands 1397@kbd{M-x compile} command (@pxref{Compilation}) is autoloaded; if you
1438(@pxref{Compilation}) are autoloaded; if you call either command, 1398call it, Emacs automatically loads the @code{compile} library first.
1439Emacs automatically loads the @code{compile} library. In contrast, 1399In contrast, the command @kbd{M-x recompile} is not autoloaded, so it
1440the command @code{recompile} is not autoloaded, so it is unavailable 1400is unavailable until you load the @code{compile} library.
1441until you load the @code{compile} library.
1442 1401
1443@vindex load-dangerous-libraries 1402@vindex load-dangerous-libraries
1444@cindex Lisp files byte-compiled by XEmacs 1403@cindex Lisp files byte-compiled by XEmacs
@@ -1449,38 +1408,35 @@ Emacs to crash. Set the variable @code{load-dangerous-libraries} to
1449 1408
1450@node Lisp Eval 1409@node Lisp Eval
1451@section Evaluating Emacs Lisp Expressions 1410@section Evaluating Emacs Lisp Expressions
1452@cindex Emacs-Lisp mode 1411@cindex Emacs Lisp mode
1453@cindex mode, Emacs-Lisp 1412@cindex mode, Emacs Lisp
1454 1413
1455@findex emacs-lisp-mode 1414@findex emacs-lisp-mode
1456 Lisp programs intended to be run in Emacs should be edited in 1415 Emacs Lisp mode is the major mode for editing Emacs Lisp. Its mode
1457Emacs-Lisp mode; this happens automatically for file names ending in 1416command is @kbd{M-x emacs-lisp-mode}.
1458@file{.el}. By contrast, Lisp mode itself is used for editing Lisp
1459programs intended for other Lisp systems. To switch to Emacs-Lisp mode
1460explicitly, use the command @kbd{M-x emacs-lisp-mode}.
1461
1462 For testing of Lisp programs to run in Emacs, it is often useful to
1463evaluate part of the program as it is found in the Emacs buffer. For
1464example, after changing the text of a Lisp function definition,
1465evaluating the definition installs the change for future calls to the
1466function. Evaluation of Lisp expressions is also useful in any kind of
1467editing, for invoking noninteractive functions (functions that are
1468not commands).
1469 1417
1470@table @kbd 1418 Emacs provides several commands for evaluating Emacs Lisp
1471@item M-: 1419expressions. You can use these commands in Emacs Lisp mode, to test
1472Read a single Lisp expression in the minibuffer, evaluate it, and print 1420your Emacs Lisp code as it is being written. For example, after
1473the value in the echo area (@code{eval-expression}). 1421re-writing a function, you can evaluate the function definition to
1474@item C-x C-e 1422make it take effect for subsequent function calls. These commands are
1475Evaluate the Lisp expression before point, and print the value in the 1423also available globally, and can be used outside Emacs Lisp mode.
1476echo area (@code{eval-last-sexp}). 1424
1477@item C-M-x 1425@table @asis
1426@item @kbd{M-:}
1427Read a single Emacs Lisp expression in the minibuffer, evaluate it,
1428and print the value in the echo area (@code{eval-expression}).
1429@item @kbd{C-x C-e}
1430Evaluate the Emacs Lisp expression before point, and print the value
1431in the echo area (@code{eval-last-sexp}).
1432@item @kbd{C-M-x} @r{(in Emacs Lisp mode)}
1433@itemx @kbd{M-x eval-defun}
1478Evaluate the defun containing or after point, and print the value in 1434Evaluate the defun containing or after point, and print the value in
1479the echo area (@code{eval-defun}). 1435the echo area (@code{eval-defun}).
1480@item M-x eval-region 1436@item @kbd{M-x eval-region}
1481Evaluate all the Lisp expressions in the region. 1437Evaluate all the Emacs Lisp expressions in the region.
1482@item M-x eval-buffer 1438@item @kbd{M-x eval-buffer}
1483Evaluate all the Lisp expressions in the buffer. 1439Evaluate all the Emacs Lisp expressions in the buffer.
1484@end table 1440@end table
1485 1441
1486@ifinfo 1442@ifinfo
@@ -1492,150 +1448,144 @@ Evaluate all the Lisp expressions in the buffer.
1492@kindex M-: 1448@kindex M-:
1493@end ifnotinfo 1449@end ifnotinfo
1494@findex eval-expression 1450@findex eval-expression
1495 @kbd{M-:} (@code{eval-expression}) is the most basic command for evaluating 1451 @kbd{M-:} (@code{eval-expression}) reads an expression using the
1496a Lisp expression interactively. It reads the expression using the 1452minibuffer, and evaluates it. (Before evaluating the expression, the
1497minibuffer, so you can execute any expression on a buffer regardless of 1453current buffer switches back to the buffer that was current when you
1498what the buffer contains. When the expression is evaluated, the current 1454typed @kbd{M-:}, not the minibuffer into which you typed the
1499buffer is once again the buffer that was current when @kbd{M-:} was 1455expression.)
1500typed.
1501
1502@kindex C-M-x @r{(Emacs-Lisp mode)}
1503@findex eval-defun
1504 In Emacs-Lisp mode, the key @kbd{C-M-x} is bound to the command
1505@code{eval-defun}, which parses the defun containing or following point
1506as a Lisp expression and evaluates it. The value is printed in the echo
1507area. This command is convenient for installing in the Lisp environment
1508changes that you have just made in the text of a function definition.
1509
1510 @kbd{C-M-x} treats @code{defvar} expressions specially. Normally,
1511evaluating a @code{defvar} expression does nothing if the variable it
1512defines already has a value. But @kbd{C-M-x} unconditionally resets the
1513variable to the initial value specified in the @code{defvar} expression.
1514@code{defcustom} expressions are treated similarly.
1515This special feature is convenient for debugging Lisp programs.
1516Typing @kbd{C-M-x} on a @code{defface} expression reinitializes
1517the face according to the @code{defface} specification.
1518 1456
1519@kindex C-x C-e 1457@kindex C-x C-e
1520@findex eval-last-sexp 1458@findex eval-last-sexp
1521 The command @kbd{C-x C-e} (@code{eval-last-sexp}) evaluates the Lisp 1459 The command @kbd{C-x C-e} (@code{eval-last-sexp}) evaluates the
1522expression preceding point in the buffer, and displays the value in the 1460Emacs Lisp expression preceding point in the buffer, and displays the
1523echo area. It is available in all major modes, not just Emacs-Lisp 1461value in the echo area. When the result of an evaluation is an
1524mode. It does not treat @code{defvar} specially. 1462integer, you can type @kbd{C-x C-e} a second time to display the value
1525 1463of the integer result in additional formats (octal, hexadecimal, and
1526 When the result of an evaluation is an integer, you can type 1464character).
1527@kbd{C-x C-e} a second time to display the value of the integer result 1465
1528in additional formats (octal, hexadecimal, and character). 1466 If @kbd{M-:} or @kbd{C-x C-e} is given a prefix argument, it inserts
1529 1467the value into the current buffer at point, rather than displaying it
1530 If @kbd{C-x C-e}, or @kbd{M-:} is given a numeric argument, it 1468in the echo area. The argument's value does not matter.
1531inserts the value into the current buffer at point, rather than 1469
1532displaying it in the echo area. The argument's value does not matter. 1470@kindex C-M-x @r{(Emacs Lisp mode)}
1533@kbd{C-M-x} with a numeric argument instruments the function 1471@findex eval-defun
1534definition for Edebug (@pxref{Instrumenting, Instrumenting for Edebug,, elisp, the Emacs Lisp Reference Manual}). 1472 The @code{eval-defun} command is bound to @kbd{C-M-x} in Emacs Lisp
1473mode. It evaluates the top-level Lisp expression containing or
1474following point, and prints the value in the echo area. In this
1475context, a top-level expression is referred to as a ``defun'', but it
1476need not be an actual @code{defun} (function definition). In
1477particular, this command treats @code{defvar} expressions specially.
1478Normally, evaluating a @code{defvar} expression does nothing if the
1479variable it defines already has a value. But this command
1480unconditionally resets the variable to the initial value specified by
1481the @code{defvar}; this is convenient for debugging Emacs Lisp
1482programs. @code{defcustom} and @code{defface} expressions are treated
1483similarly. Note that the other commands documented in this section do
1484not have this special feature.
1485
1486 With a prefix argument, @kbd{C-M-x} instruments the function
1487definition for Edebug, the Emacs Lisp Debugger. @xref{Instrumenting,
1488Instrumenting for Edebug,, elisp, the Emacs Lisp Reference Manual}.
1535 1489
1536@findex eval-region 1490@findex eval-region
1537@findex eval-buffer 1491@findex eval-buffer
1538 The most general command for evaluating Lisp expressions from a buffer 1492 The command @kbd{M-x eval-region} parses the text of the region as
1539is @code{eval-region}. @kbd{M-x eval-region} parses the text of the 1493one or more Lisp expressions, evaluating them one by one. @kbd{M-x
1540region as one or more Lisp expressions, evaluating them one by one. 1494eval-buffer} is similar but evaluates the entire buffer.
1541@kbd{M-x eval-buffer} is similar but evaluates the entire
1542buffer. This is a reasonable way to install the contents of a file of
1543Lisp code that you are ready to test. Later, as you find bugs and
1544change individual functions, use @kbd{C-M-x} on each function that you
1545change. This keeps the Lisp world in step with the source file.
1546 1495
1547@vindex eval-expression-print-level 1496@vindex eval-expression-print-level
1548@vindex eval-expression-print-length 1497@vindex eval-expression-print-length
1549@vindex eval-expression-debug-on-error 1498@vindex eval-expression-debug-on-error
1550 The two customizable variables @code{eval-expression-print-level} and 1499 The customizable variables @code{eval-expression-print-level} and
1551@code{eval-expression-print-length} control the maximum depth and length 1500@code{eval-expression-print-length} control the maximum depth and
1552of lists to print in the result of the evaluation commands before 1501length of lists to print in the result of the evaluation commands
1553abbreviating them. @code{eval-expression-debug-on-error} controls 1502before abbreviating them. @code{eval-expression-debug-on-error}
1554whether evaluation errors invoke the debugger when these commands are 1503controls whether evaluation errors invoke the debugger when these
1555used; its default is @code{t}. 1504commands are used; its default is @code{t}.
1556 1505
1557@node Lisp Interaction 1506@node Lisp Interaction
1558@section Lisp Interaction Buffers 1507@section Lisp Interaction Buffers
1559 1508
1509@findex lisp-interaction-mode
1560 When Emacs starts up, it contains a buffer named @samp{*scratch*}, 1510 When Emacs starts up, it contains a buffer named @samp{*scratch*},
1561which is provided for evaluating Lisp expressions interactively inside 1511which is provided for evaluating Emacs Lisp expressions interactively.
1562Emacs. Its major mode is Lisp Interaction mode. 1512Its major mode is Lisp Interaction mode. You can also enable Lisp
1513Interaction mode by typing @kbd{M-x lisp-interaction-mode}.
1563 1514
1564@findex eval-print-last-sexp 1515@findex eval-print-last-sexp
1565@kindex C-j @r{(Lisp Interaction mode)} 1516@kindex C-j @r{(Lisp Interaction mode)}
1566 The simplest way to use the @samp{*scratch*} buffer is to insert 1517 In the @samp{*scratch*} buffer, and other Lisp Interaction mode
1567Lisp expressions and type @kbd{C-j} (@code{eval-print-last-sexp}) 1518buffers, @kbd{C-j} (@code{eval-print-last-sexp}) evaluates the Lisp
1568after each expression. This command reads the Lisp expression before 1519expression before point, and inserts the value at point. Thus, as you
1569point, evaluates it, and inserts the value in printed representation 1520type expressions into the buffer followed by @kbd{C-j} after each
1570before point. The result is a complete typescript of the expressions 1521expression, the buffer records a transcript of the evaluated
1571you have evaluated and their values. 1522expressions and their values. All other commands in Lisp Interaction
1523mode are the same as in Emacs Lisp mode.
1572 1524
1573@vindex initial-scratch-message 1525@vindex initial-scratch-message
1574 At startup, the @samp{*scratch*} buffer contains a short message, in 1526 At startup, the @samp{*scratch*} buffer contains a short message, in
1575the form of a Lisp comment, that explains what it is for. This 1527the form of a Lisp comment, that explains what it is for. This
1576message is controlled by the variable @code{initial-scratch-message}, 1528message is controlled by the variable @code{initial-scratch-message},
1577which should be either a string or @code{nil}. If you set it to the 1529which should be either a string, or @code{nil} (which means to
1578empty string, or @code{nil}, the initial message is suppressed. 1530suppress the message).
1579
1580@findex lisp-interaction-mode
1581 All other commands in Lisp Interaction mode are the same as in Emacs
1582Lisp mode. You can enable Lisp Interaction mode by typing @kbd{M-x
1583lisp-interaction-mode}.
1584 1531
1585@findex ielm 1532@findex ielm
1586 An alternative way of evaluating Emacs Lisp expressions interactively 1533 An alternative way of evaluating Emacs Lisp expressions
1587is to use Inferior Emacs-Lisp mode, which provides an interface rather 1534interactively is to use Inferior Emacs Lisp mode, which provides an
1588like Shell mode (@pxref{Shell Mode}) for evaluating Emacs Lisp 1535interface rather like Shell mode (@pxref{Shell Mode}) for evaluating
1589expressions. Type @kbd{M-x ielm} to create an @samp{*ielm*} buffer 1536Emacs Lisp expressions. Type @kbd{M-x ielm} to create an
1590which uses this mode. For more information see that command's 1537@samp{*ielm*} buffer which uses this mode. For more information, see
1591documentation. 1538that command's documentation.
1592 1539
1593@node External Lisp 1540@node External Lisp
1594@section Running an External Lisp 1541@section Running an External Lisp
1542@cindex Lisp mode
1543@cindex mode, Lisp
1544@cindex Common Lisp
1595 1545
1596 Emacs has facilities for running programs in other Lisp systems. You can 1546 Lisp mode is the major mode for editing programs written in
1597run a Lisp process as an inferior of Emacs, and pass expressions to it to 1547general-purpose Lisp dialects, such as Common Lisp. Its mode command
1598be evaluated. You can also pass changed function definitions directly from 1548is @kbd{M-x lisp-mode}. Emacs uses Lisp mode automatically for files
1599the Emacs buffers in which you edit the Lisp programs to the inferior Lisp 1549whose names end in @file{.l}, @file{.lsp}, or @file{.lisp}.
1600process.
1601 1550
1602@findex run-lisp 1551@findex run-lisp
1603@vindex inferior-lisp-program 1552@vindex inferior-lisp-program
1604@kindex C-x C-z 1553@kindex C-x C-z
1605 To run an inferior Lisp process, type @kbd{M-x run-lisp}. This runs 1554 You can run an external Lisp session as a subprocess or
1606the program named @code{lisp}, the same program you would run by typing 1555@dfn{inferior process} of Emacs, and pass expressions to it to be
1607@code{lisp} as a shell command, with both input and output going through 1556evaluated. To begin an external Lisp session, type @kbd{M-x
1608an Emacs buffer named @samp{*lisp*}. That is to say, any ``terminal 1557run-lisp}. This runs the program named @command{lisp}, and sets it up
1609output'' from Lisp will go into the buffer, advancing point, and any 1558so that both input and output go through an Emacs buffer named
1610``terminal input'' for Lisp comes from text in the buffer. (You can 1559@samp{*inferior-lisp*}. To change the name of the Lisp program run by
1611change the name of the Lisp executable file by setting the variable 1560@kbd{M-x run-lisp}, change the variable @code{inferior-lisp-program}.
1612@code{inferior-lisp-program}.) 1561
1613 1562 The major mode for the @samp{*lisp*} buffer is Inferior Lisp mode,
1614 To give input to Lisp, go to the end of the buffer and type the input, 1563which combines the characteristics of Lisp mode and Shell mode
1615terminated by @key{RET}. The @samp{*lisp*} buffer is in Inferior Lisp 1564(@pxref{Shell Mode}). To send input to the Lisp session, go to the
1616mode, which combines the special characteristics of Lisp mode with most 1565end of the @samp{*lisp*} buffer and type the input, followed by
1617of the features of Shell mode (@pxref{Shell Mode}). The definition of 1566@key{RET}. Terminal output from the Lisp session is automatically
1618@key{RET} to send a line to a subprocess is one of the features of Shell 1567inserted in the buffer.
1619mode.
1620
1621@findex lisp-mode
1622 For the source files of programs to run in external Lisps, use Lisp
1623mode. You can switch to this mode with @kbd{M-x lisp-mode}, and it is
1624used automatically for files whose names end in @file{.l},
1625@file{.lsp}, or @file{.lisp}.
1626 1568
1627@kindex C-M-x @r{(Lisp mode)} 1569@kindex C-M-x @r{(Lisp mode)}
1628@findex lisp-eval-defun 1570@findex lisp-eval-defun
1629 When you edit a function in a Lisp program you are running, the easiest 1571 When you edit a Lisp program in Lisp mode, you can type @kbd{C-M-x}
1630way to send the changed definition to the inferior Lisp process is the key 1572(@code{lisp-eval-defun}) to send an expression from the Lisp mode
1631@kbd{C-M-x}. In Lisp mode, this runs the function @code{lisp-eval-defun}, 1573buffer to a Lisp session that you had started with @kbd{M-x run-lisp}.
1632which finds the defun around or following point and sends it as input to 1574The expression sent is the top-level Lisp expression at or following
1633the Lisp process. (Emacs can send input to any inferior process regardless 1575point. The resulting value goes as usual into the
1634of what buffer is current.) 1576@samp{*inferior-lisp*} buffer. Note that the effect of @kbd{C-M-x} in
1635 1577Lisp mode is thus very similar to its effect in Emacs Lisp mode
1636 Contrast the meanings of @kbd{C-M-x} in Lisp mode (for editing 1578(@pxref{Lisp Eval}), except that the expression is sent to a different
1637programs to be run in another Lisp system) and Emacs-Lisp mode (for 1579Lisp environment instead of being evaluated in Emacs.
1638editing Lisp programs to be run in Emacs; see @pxref{Lisp Eval}): in 1580
1639both modes it has the effect of installing the function definition 1581@findex scheme-mode
1640that point is in, but the way of doing so is different according to 1582@findex run-scheme
1641where the relevant Lisp environment is found. 1583@cindex Scheme mode
1584@cindex mode, Scheme
1585@kindex C-M-x @r{(Scheme mode)}
1586 The facilities for editing Scheme code, and for sending expressions
1587to a Scheme subprocess, are very similar. Scheme source files are
1588edited in Scheme mode, which can be explicitly enabled with @kbd{M-x
1589scheme-mode}. You can initiate a Scheme session by typing @kbd{M-x
1590run-scheme} (the buffer for interacting with Scheme is named
1591@samp{*scheme*}), and send expressions to it by typing @kbd{C-M-x}.
diff --git a/doc/emacs/cal-xtra.texi b/doc/emacs/cal-xtra.texi
index 6d20c92a6d9..2d2b32943f5 100644
--- a/doc/emacs/cal-xtra.texi
+++ b/doc/emacs/cal-xtra.texi
@@ -41,12 +41,12 @@ customize the variables @code{calendar-intermonth-header} and
41 41
42@vindex calendar-holiday-marker 42@vindex calendar-holiday-marker
43@vindex diary-entry-marker 43@vindex diary-entry-marker
44@vindex calenday-today-marker 44@vindex calendar-today-marker
45 The variable @code{calendar-holiday-marker} specifies how to mark a 45 The variable @code{calendar-holiday-marker} specifies how to mark a
46date as being a holiday. Its value may be a single-character string to 46date as being a holiday. Its value may be a single-character string to
47insert next to the date, or a face name to use for displaying the date. 47insert next to the date, or a face name to use for displaying the date.
48Likewise, the variable @code{diary-entry-marker} specifies how to mark a 48Likewise, the variable @code{diary-entry-marker} specifies how to mark a
49date that has diary entries, and @code{calenday-today-marker} is used by 49date that has diary entries, and @code{calendar-today-marker} is used by
50the function @code{calendar-mark-today} to mark today's date. By 50the function @code{calendar-mark-today} to mark today's date. By
51default, the calendar uses faces named @code{holiday}, @code{diary}, and 51default, the calendar uses faces named @code{holiday}, @code{diary}, and
52@code{calendar-today} for these purposes. 52@code{calendar-today} for these purposes.
diff --git a/doc/emacs/dired-xtra.texi b/doc/emacs/dired-xtra.texi
index efb05226ba8..52ccccce58c 100644
--- a/doc/emacs/dired-xtra.texi
+++ b/doc/emacs/dired-xtra.texi
@@ -7,24 +7,24 @@
7@node Subdir Switches 7@node Subdir Switches
8@section Subdirectory Switches in Dired 8@section Subdirectory Switches in Dired
9 9
10You can insert subdirectories with specified @code{ls} switches in 10You can insert subdirectories with specified @command{ls} switches in
11Dired buffers using @kbd{C-u i}. You can change the @code{ls} 11Dired buffers using @kbd{C-u i}. You can change the @command{ls}
12switches of an already inserted subdirectory using @kbd{C-u l}. 12switches of an already inserted subdirectory using @kbd{C-u l}.
13 13
14Dired preserves the switches if you revert the buffer. Deleting a 14Dired preserves the switches if you revert the buffer. Deleting a
15subdirectory forgets about its switches. 15subdirectory forgets about its switches.
16 16
17Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u}) 17Using @code{dired-undo} (@pxref{Marks vs Flags}) to reinsert or delete
18to reinsert or delete subdirectories that were inserted with explicit 18subdirectories that were inserted with explicit switches can bypass
19switches can bypass Dired's machinery for remembering (or forgetting) 19Dired's machinery for remembering (or forgetting) switches. Deleting
20switches. Deleting a subdirectory using @code{dired-undo} does not 20a subdirectory using @code{dired-undo} does not forget its switches.
21forget its switches. When later reinserted using @kbd{i}, it will be 21When later reinserted using @kbd{i}, it will be reinserted using its
22reinserted using its old switches. Using @code{dired-undo} to 22old switches. Using @code{dired-undo} to reinsert a subdirectory that
23reinsert a subdirectory that was deleted using the regular 23was deleted using the regular Dired commands (not @code{dired-undo})
24Dired commands (not @code{dired-undo}) will originally insert it with 24will originally insert it with its old switches. Reverting the
25its old switches. Reverting the buffer, however, will relist it using 25buffer, however, will relist it using the buffer's default switches.
26the buffer's default switches. If any of this yields problems, you 26If any of this yields problems, you can easily correct the situation
27can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}. 27using @kbd{C-u i} or @kbd{C-u l}.
28 28
29Dired does not remember the @code{R} switch. Inserting a subdirectory 29Dired does not remember the @code{R} switch. Inserting a subdirectory
30with switches that include the @code{R} switch is equivalent to 30with switches that include the @code{R} switch is equivalent to
diff --git a/doc/emacs/dired.texi b/doc/emacs/dired.texi
index b6ed47fdb3f..5097565830e 100644
--- a/doc/emacs/dired.texi
+++ b/doc/emacs/dired.texi
@@ -73,32 +73,45 @@ completion commands can be used in the minibuffer; in particular,
73a directory name. 73a directory name.
74 74
75 The variable @code{dired-listing-switches} specifies the options to 75 The variable @code{dired-listing-switches} specifies the options to
76give to @code{ls} for listing the directory; this string @emph{must} 76give to @command{ls} for listing the directory; this string
77contain @samp{-l}. If you use a prefix argument with the @code{dired} 77@emph{must} contain @samp{-l}. If you use a prefix argument with the
78command, you can specify the @code{ls} switches with the minibuffer 78@code{dired} command, you can specify the @command{ls} switches with the
79before you enter the directory specification. No matter how they are 79minibuffer before you enter the directory specification. No matter
80specified, the @code{ls} switches can include short options (that is, 80how they are specified, the @command{ls} switches can include short
81single characters) requiring no arguments, and long options (starting 81options (that is, single characters) requiring no arguments, and long
82with @samp{--}) whose arguments are specified with @samp{=}. 82options (starting with @samp{--}) whose arguments are specified with
83@samp{=}.
83 84
84@vindex dired-use-ls-dired 85@vindex dired-use-ls-dired
85 Note that Dired automatically adds the option @samp{--dired}, if 86 If your @command{ls} program supports the @samp{--dired} option,
86your @code{ls} program supports it, unless you explicitly set 87Dired automatically passes it that option; this causes @command{ls} to
87the variable @code{dired-use-ls-dired} to @code{nil}. Without this 88emit special escape sequences for certain unusual file names, without
88option, Dired will have trouble parsing some @samp{unusual} file-names. 89which Dired will not be able to parse those names. The first time you
89See the documentation of @code{dired-use-ls-dired} for more details. 90run Dired in an Emacs session, it checks whether @command{ls} supports
90 91the @samp{--dired} option by calling it once with that option. If the
91 On MS-Windows and MS-DOS systems, Emacs @emph{emulates} @code{ls}; 92exit code is 0, Dired will subsequently use the @samp{--dired} option;
92see @ref{ls in Lisp}, for options and peculiarities of that emulation. 93otherwise it will not. You can inhibit this check by customizing the
94variable @code{dired-use-ls-dired}. The value @code{unspecified} (the
95default) means to perform the check; any other non-@code{nil} value
96means to use the @samp{--dired} option; and @code{nil} means not to
97use the @samp{--dired} option.
98
99 On MS-Windows and MS-DOS systems, Emacs emulates @command{ls}.
100@xref{ls in Lisp}, for options and peculiarities of this emulation.
93 101
94@findex dired-other-window 102@findex dired-other-window
95@kindex C-x 4 d 103@kindex C-x 4 d
96@findex dired-other-frame 104@findex dired-other-frame
97@kindex C-x 5 d 105@kindex C-x 5 d
98 To display the Dired buffer in another window rather than in the 106 To display the Dired buffer in another window, use @kbd{C-x 4 d}
99selected window, use @kbd{C-x 4 d} (@code{dired-other-window}) instead 107(@code{dired-other-window}) instead of @kbd{C-x d}. @kbd{C-x 5 d}
100of @kbd{C-x d}. @kbd{C-x 5 d} (@code{dired-other-frame}) uses a 108(@code{dired-other-frame}) displays the Dired buffer in a separate
101separate frame to display the Dired buffer. 109frame.
110
111@kindex q @r{(Dired)}
112@findex quit-window
113 Typing @kbd{q} (@code{quit-window}) buries the Dired buffer, and
114deletes its window if the window was created just for that buffer.
102 115
103@node Dired Navigation 116@node Dired Navigation
104@section Navigation in the Dired Buffer 117@section Navigation in the Dired Buffer
@@ -124,7 +137,11 @@ minibuffer, and moves point to the line in the Dired buffer describing
124that file. 137that file.
125 138
126@cindex searching Dired buffers 139@cindex searching Dired buffers
140@findex dired-isearch-filenames
127@vindex dired-isearch-filenames 141@vindex dired-isearch-filenames
142@findex dired-isearch-filenames-regexp
143@kindex M-s f C-s @r{(Dired)}
144@kindex M-s f M-C-s @r{(Dired)}
128 @kbd{M-s f C-s} (@code{dired-isearch-filenames}) performs a forward 145 @kbd{M-s f C-s} (@code{dired-isearch-filenames}) performs a forward
129incremental search in the Dired buffer, looking for matches only 146incremental search in the Dired buffer, looking for matches only
130amongst the file names and ignoring the rest of the text in the 147amongst the file names and ignoring the rest of the text in the
@@ -331,18 +348,16 @@ another window, but do not select that window (@code{dired-display-file}).
331@item Mouse-1 348@item Mouse-1
332@itemx Mouse-2 349@itemx Mouse-2
333@findex dired-mouse-find-file-other-window 350@findex dired-mouse-find-file-other-window
334Visit the file named by the line you click on 351Visit the file whose name you clicked on
335(@code{dired-mouse-find-file-other-window}). This uses another window 352(@code{dired-mouse-find-file-other-window}). This uses another window
336to display the file, like the @kbd{o} command. 353to display the file, like the @kbd{o} command.
337 354
338@item v 355@item v
339@kindex v @r{(Dired)} 356@kindex v @r{(Dired)}
340@findex dired-view-file 357@findex dired-view-file
341View the file described on the current line, using @kbd{M-x view-file} 358View the file described on the current line, with View mode
342(@code{dired-view-file}). Viewing a file with @code{view-file} is 359(@code{dired-view-file}). View mode provides convenient commands to
343like visiting it, but is slanted toward moving around in the file 360navigate the buffer but forbids changing it; @xref{View Mode}.
344conveniently and does not allow changing the file. @xref{Misc File
345Ops, View File, Miscellaneous File Operations}.
346 361
347@item ^ 362@item ^
348@kindex ^ @r{(Dired)} 363@kindex ^ @r{(Dired)}
@@ -520,9 +535,9 @@ the regular expression @var{regexp}
520@kbd{% m}, except that it searches the file contents instead of the file 535@kbd{% m}, except that it searches the file contents instead of the file
521name. 536name.
522 537
523@item C-x u 538@item C-/
539@itemx C-x u
524@itemx C-_ 540@itemx C-_
525@itemx C-/
526@kindex C-_ @r{(Dired)} 541@kindex C-_ @r{(Dired)}
527@findex dired-undo 542@findex dired-undo
528Undo changes in the Dired buffer, such as adding or removing 543Undo changes in the Dired buffer, such as adding or removing
@@ -615,7 +630,7 @@ Like the other commands in this section, this command operates on the
615Rename the specified files (@code{dired-do-rename}). If you rename a 630Rename the specified files (@code{dired-do-rename}). If you rename a
616single file, the argument @var{new} is the new name of the file. If 631single file, the argument @var{new} is the new name of the file. If
617you rename several files, the argument @var{new} is the directory into 632you rename several files, the argument @var{new} is the directory into
618which to move the files (this is like the shell command @code{mv}). 633which to move the files (this is like the shell command @command{mv}).
619 634
620Dired automatically changes the visited file name of buffers associated 635Dired automatically changes the visited file name of buffers associated
621with renamed files so that they refer to the new names. 636with renamed files so that they refer to the new names.
@@ -625,7 +640,7 @@ with renamed files so that they refer to the new names.
625@cindex hard links (in Dired) 640@cindex hard links (in Dired)
626@item H @var{new} @key{RET} 641@item H @var{new} @key{RET}
627Make hard links to the specified files (@code{dired-do-hardlink}). 642Make hard links to the specified files (@code{dired-do-hardlink}).
628This is like the shell command @code{ln}. The argument @var{new} is 643This is like the shell command @command{ln}. The argument @var{new} is
629the directory to make the links in, or (if making just one link) the 644the directory to make the links in, or (if making just one link) the
630name to give the link. 645name to give the link.
631 646
@@ -642,9 +657,10 @@ link.
642@kindex M @r{(Dired)} 657@kindex M @r{(Dired)}
643@cindex changing file permissions (in Dired) 658@cindex changing file permissions (in Dired)
644@item M @var{modespec} @key{RET} 659@item M @var{modespec} @key{RET}
645Change the mode (also called ``permission bits'') of the specified files 660Change the mode (also called @dfn{permission bits}) of the specified
646(@code{dired-do-chmod}). @var{modespec} can be in octal or symbolic 661files (@code{dired-do-chmod}). @var{modespec} can be in octal or
647notation like arguments handled by the @code{chmod} program. 662symbolic notation, like arguments handled by the @command{chmod}
663program.
648 664
649@findex dired-do-chgrp 665@findex dired-do-chgrp
650@kindex G @r{(Dired)} 666@kindex G @r{(Dired)}
@@ -663,8 +679,8 @@ this.)
663 679
664@vindex dired-chown-program 680@vindex dired-chown-program
665The variable @code{dired-chown-program} specifies the name of the 681The variable @code{dired-chown-program} specifies the name of the
666program to use to do the work (different systems put @code{chown} in 682program to use to do the work (different systems put @command{chown}
667different places). 683in different places).
668 684
669@findex dired-do-touch 685@findex dired-do-touch
670@kindex T @r{(Dired)} 686@kindex T @r{(Dired)}
@@ -952,17 +968,17 @@ The backup file is the first file given to @code{diff}.
952@cindex subdirectories in Dired 968@cindex subdirectories in Dired
953@cindex expanding subdirectories in Dired 969@cindex expanding subdirectories in Dired
954 970
955 A Dired buffer displays just one directory in the normal case; 971 A Dired buffer usually displays just one directory, but you can
956but you can optionally include its subdirectories as well. 972optionally include its subdirectories as well.
957 973
958 The simplest way to include multiple directories in one Dired buffer is 974 The simplest way to include multiple directories in one Dired buffer is
959to specify the options @samp{-lR} for running @code{ls}. (If you give a 975to specify the options @samp{-lR} for running @command{ls}. (If you give a
960numeric argument when you run Dired, then you can specify these options 976numeric argument when you run Dired, then you can specify these options
961in the minibuffer.) That produces a recursive directory listing showing 977in the minibuffer.) That produces a recursive directory listing showing
962all subdirectories at all levels. 978all subdirectories at all levels.
963 979
964 More often, you will want to show only specific subdirectories. You 980 More often, you will want to show only specific subdirectories. You
965can do this with the @kbd{i} command: 981can do this with @kbd{i} (@code{dired-maybe-insert-subdir}):
966 982
967@table @kbd 983@table @kbd
968@findex dired-maybe-insert-subdir 984@findex dired-maybe-insert-subdir
@@ -973,25 +989,27 @@ can do this with the @kbd{i} command:
973Insert the contents of a subdirectory later in the buffer. 989Insert the contents of a subdirectory later in the buffer.
974@end table 990@end table
975 991
976Use the @kbd{i} (@code{dired-maybe-insert-subdir}) command on a line 992@noindent
977that describes a file which is a directory. It inserts the contents of 993If you use this command on a line that describes a file which is a
978that directory into the same Dired buffer, and moves there. Inserted 994directory, it inserts the contents of that directory into the same
979subdirectory contents follow the top-level directory of the Dired 995Dired buffer, and moves there. Inserted subdirectory contents follow
980buffer, just as they do in @samp{ls -lR} output. 996the top-level directory of the Dired buffer, just as they do in
981 997@samp{ls -lR} output.
982If the subdirectory's contents are already present in the buffer, the 998
983@kbd{i} command just moves to it. 999 If the subdirectory's contents are already present in the buffer,
984 1000the @kbd{i} command just moves to it.
985In either case, @kbd{i} sets the Emacs mark before moving, so @kbd{C-u 1001
986C-@key{SPC}} takes you back to the old position in the buffer (the line 1002 In either case, @kbd{i} sets the Emacs mark before moving, so
987describing that subdirectory). You can also use @samp{^} to return 1003@kbd{C-u C-@key{SPC}} returns to your previous position in the Dired
988to the parent directory in the same Dired buffer. 1004buffer (@pxref{Setting Mark}). You can also use @samp{^} to return to
989 1005the parent directory in the same Dired buffer (@pxref{Dired
990Use the @kbd{l} command (@code{dired-do-redisplay}) to update the 1006Visiting}).
991subdirectory's contents. Use @kbd{C-u k} on the subdirectory header 1007
992line to remove the subdirectory listing (@pxref{Dired Updating}). You 1008 Use the @kbd{l} command (@code{dired-do-redisplay}) to update the
993can also hide and show inserted subdirectories (@pxref{Hiding 1009subdirectory's contents, and use @kbd{C-u k} on the subdirectory
994Subdirectories}). 1010header line to remove the subdirectory listing (@pxref{Dired
1011Updating}). You can also hide and show inserted subdirectories
1012(@pxref{Hiding Subdirectories}).
995 1013
996@ifnottex 1014@ifnottex
997@include dired-xtra.texi 1015@include dired-xtra.texi
@@ -1209,10 +1227,10 @@ tell @command{find} what condition to test. To use this command, you
1209need to know how to use @command{find}. 1227need to know how to use @command{find}.
1210 1228
1211@vindex find-ls-option 1229@vindex find-ls-option
1212 The format of listing produced by these commands is controlled by the 1230 The format of listing produced by these commands is controlled by
1213variable @code{find-ls-option}, whose default value specifies using 1231the variable @code{find-ls-option}, whose default value specifies
1214options @samp{-ld} for @code{ls}. If your listings are corrupted, you 1232using options @samp{-ld} for @command{ls}. If your listings are
1215may need to change the value of this variable. 1233corrupted, you may need to change the value of this variable.
1216 1234
1217@findex locate 1235@findex locate
1218@findex locate-with-filter 1236@findex locate-with-filter
@@ -1338,10 +1356,14 @@ rotation is lossless, and uses an external utility called JpegTRAN.
1338@kindex + @r{(Dired)} 1356@kindex + @r{(Dired)}
1339@findex dired-create-directory 1357@findex dired-create-directory
1340 The command @kbd{+} (@code{dired-create-directory}) reads a 1358 The command @kbd{+} (@code{dired-create-directory}) reads a
1341directory name, and creates the directory if it does not already 1359directory name, and creates that directory. It signals an error if
1342exist. 1360the directory already exists.
1343 1361
1344@cindex searching multiple files via Dired 1362@cindex searching multiple files via Dired
1363@kindex M-s a C-s @r{(Dired)}
1364@kindex M-s a M-C-s @r{(Dired)}
1365@findex dired-do-isearch
1366@findex dired-do-isearch-regexp
1345 The command @kbd{M-s a C-s} (@code{dired-do-isearch}) begins a 1367 The command @kbd{M-s a C-s} (@code{dired-do-isearch}) begins a
1346``multi-file'' incremental search on the marked files. If a search 1368``multi-file'' incremental search on the marked files. If a search
1347fails at the end of a file, typing @kbd{C-s} advances to the next 1369fails at the end of a file, typing @kbd{C-s} advances to the next
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index aca3735ff03..7f703fbaad0 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -602,11 +602,8 @@ Editing Text-based Tables
602* Table Recognition:: How to activate and deactivate tables. 602* Table Recognition:: How to activate and deactivate tables.
603* Cell Commands:: Cell-oriented commands in a table. 603* Cell Commands:: Cell-oriented commands in a table.
604* Cell Justification:: Justifying cell contents. 604* Cell Justification:: Justifying cell contents.
605* Row Commands:: Manipulating rows of table cell. 605* Table Rows and Columns:: Inserting and deleting rows and columns.
606* Column Commands:: Manipulating columns of table cell.
607* Fixed Width Mode:: Fixing cell width.
608* Table Conversion:: Converting between plain text and tables. 606* Table Conversion:: Converting between plain text and tables.
609* Measuring Tables:: Analyzing table dimension.
610* Table Misc:: Table miscellany. 607* Table Misc:: Table miscellany.
611 608
612Editing Programs 609Editing Programs
@@ -702,7 +699,7 @@ Compiling and Testing Programs
702* Executing Lisp:: Various modes for editing Lisp programs, 699* Executing Lisp:: Various modes for editing Lisp programs,
703 with different facilities for running 700 with different facilities for running
704 the Lisp programs. 701 the Lisp programs.
705* Lisp Libraries:: Creating Lisp programs to run in Emacs. 702* Lisp Libraries:: How Lisp programs are loaded into Emacs.
706* Lisp Eval:: Executing a single Lisp expression in Emacs. 703* Lisp Eval:: Executing a single Lisp expression in Emacs.
707* Lisp Interaction:: Executing Lisp in an Emacs buffer. 704* Lisp Interaction:: Executing Lisp in an Emacs buffer.
708* External Lisp:: Communicating through Emacs with a separate Lisp. 705* External Lisp:: Communicating through Emacs with a separate Lisp.
@@ -725,8 +722,7 @@ GDB Graphical Interface
725* Breakpoints Buffer:: A breakpoint control panel. 722* Breakpoints Buffer:: A breakpoint control panel.
726* Threads Buffer:: Displays your threads. 723* Threads Buffer:: Displays your threads.
727* Stack Buffer:: Select a frame from the call stack. 724* Stack Buffer:: Select a frame from the call stack.
728* Other GDB Buffers:: Input/output, locals, registers, 725* Other GDB Buffers:: Other buffers for controlling the GDB state.
729 assembler, threads and memory buffers.
730* Watch Expressions:: Monitor variable values in the speedbar. 726* Watch Expressions:: Monitor variable values in the speedbar.
731* Multithreaded Debugging:: Debugging programs with several threads. 727* Multithreaded Debugging:: Debugging programs with several threads.
732 728
@@ -745,15 +741,16 @@ Version Control
745* VC Mode Line:: How the mode line shows version control status. 741* VC Mode Line:: How the mode line shows version control status.
746* Basic VC Editing:: How to edit a file under version control. 742* Basic VC Editing:: How to edit a file under version control.
747* Log Buffer:: Features available in log entry buffers. 743* Log Buffer:: Features available in log entry buffers.
744* Registering:: Putting a file under version control.
748* Old Revisions:: Examining and comparing old versions. 745* Old Revisions:: Examining and comparing old versions.
749* Secondary VC Commands:: The commands used a little less frequently. 746* VC Change Log:: Viewing the VC Change Log.
747* VC Undo:: Canceling changes before or after committing.
750* VC Directory Mode:: Listing files managed by version control. 748* VC Directory Mode:: Listing files managed by version control.
751* Branches:: Multiple lines of development. 749* Branches:: Multiple lines of development.
752* Remote Repositories:: Efficient access to remote CVS servers.
753* Revision Tags:: Symbolic names for revisions. 750* Revision Tags:: Symbolic names for revisions.
754* Miscellaneous VC:: Various other commands and features of VC. 751* Miscellaneous VC:: Various other commands and features of VC.
755* Customizing VC:: Variables that change VC's behavior. 752* Customizing VC:: Variables that change VC's behavior.
756 753
757Introduction to Version Control 754Introduction to Version Control
758 755
759* Why Version Control?:: Understanding the problems it addresses. 756* Why Version Control?:: Understanding the problems it addresses.
@@ -770,12 +767,6 @@ Basic Editing under Version Control
770* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS. 767* VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS.
771* Advanced C-x v v:: Advanced features available with a prefix argument. 768* Advanced C-x v v:: Advanced features available with a prefix argument.
772 769
773The Secondary Commands of VC
774
775* Registering:: Putting a file under version control.
776* VC Change Log:: Viewing the VC Change Log.
777* VC Undo:: Canceling changes before or after check-in.
778
779VC Directory Mode 770VC Directory Mode
780 771
781* VC Directory Buffer:: What the buffer looks like and means. 772* VC Directory Buffer:: What the buffer looks like and means.
@@ -784,26 +775,15 @@ VC Directory Mode
784Multiple Branches of a File 775Multiple Branches of a File
785 776
786* Switching Branches:: How to get to another existing branch. 777* Switching Branches:: How to get to another existing branch.
787* Creating Branches:: How to start a new branch. 778* VC Pull:: Updating a branch from another branch.
788* Merging:: Transferring changes between branches. 779* Merging:: Transferring changes between branches.
789* Multi-User Branching:: Multiple users working at multiple branches 780* Creating Branches:: How to start a new branch.
790 in parallel.
791
792Remote Repositories
793
794* Version Backups:: Keeping local copies of repository versions.
795* Local Version Control:: Using another version system for local editing.
796
797Revision Tags
798
799* Making Revision Tags:: The tag facilities.
800* Revision Tag Caveats:: Things to be careful of when using tags.
801 781
802Miscellaneous Commands and Features of VC 782Miscellaneous Commands and Features of VC
803 783
804* Change Logs and VC:: Generating a change log file from log entries. 784* Change Logs and VC:: Generating a change log file from log entries.
805* Renaming and VC:: A command to rename both the source and master 785* VC Delete/Rename:: Deleting and renaming version-controlled files.
806 file correctly. 786* Revision Tags:: Symbolic names for revisions.
807* Version Headers:: Inserting version control headers into working files. 787* Version Headers:: Inserting version control headers into working files.
808 788
809Customizing VC 789Customizing VC
diff --git a/doc/emacs/files.texi b/doc/emacs/files.texi
index e3da0ca44e6..9b2322e1850 100644
--- a/doc/emacs/files.texi
+++ b/doc/emacs/files.texi
@@ -1485,6 +1485,12 @@ argument to @kbd{M-x delete-file} or @kbd{M-x delete-directory} makes
1485them delete outright, instead of using the Trash, regardless of 1485them delete outright, instead of using the Trash, regardless of
1486@code{delete-by-moving-to-trash}. 1486@code{delete-by-moving-to-trash}.
1487 1487
1488@ifnottex
1489 If a file is under version control (@pxref{Version Control}), you
1490should delete it using @kbd{M-x vc-delete-file} instead of @kbd{M-x
1491delete-file}. @xref{VC Delete/Rename}.
1492@end ifnottex
1493
1488@findex copy-file 1494@findex copy-file
1489@cindex copying files 1495@cindex copying files
1490 @kbd{M-x copy-file} reads the file @var{old} and writes a new file 1496 @kbd{M-x copy-file} reads the file @var{old} and writes a new file
@@ -1498,6 +1504,7 @@ it creates a copy of the @var{old} directory and puts it in @var{new}.
1498If @var{new} is not an existing directory, it copies all the contents 1504If @var{new} is not an existing directory, it copies all the contents
1499of @var{old} into a new directory named @var{new}. 1505of @var{old} into a new directory named @var{new}.
1500 1506
1507@cindex renaming files
1501@findex rename-file 1508@findex rename-file
1502 @kbd{M-x rename-file} reads two file names @var{old} and @var{new} 1509 @kbd{M-x rename-file} reads two file names @var{old} and @var{new}
1503using the minibuffer, then renames file @var{old} as @var{new}. If 1510using the minibuffer, then renames file @var{old} as @var{new}. If
@@ -1512,6 +1519,12 @@ RET /tmp RET} renames @file{~/foo} to @file{/tmp/foo}. The same rule
1512applies to all the remaining commands in this section. All of them 1519applies to all the remaining commands in this section. All of them
1513ask for confirmation when the new file name already exists, too. 1520ask for confirmation when the new file name already exists, too.
1514 1521
1522@ifnottex
1523 If a file is under version control (@pxref{Version Control}), you
1524should rename it using @kbd{M-x vc-rename-file} instead of @kbd{M-x
1525rename-file}. @xref{VC Delete/Rename}.
1526@end ifnottex
1527
1515@findex add-name-to-file 1528@findex add-name-to-file
1516@cindex hard links (creation) 1529@cindex hard links (creation)
1517 @kbd{M-x add-name-to-file} adds an additional name to an existing 1530 @kbd{M-x add-name-to-file} adds an additional name to an existing
diff --git a/doc/emacs/frames.texi b/doc/emacs/frames.texi
index 1445d25be15..dec5aa771ea 100644
--- a/doc/emacs/frames.texi
+++ b/doc/emacs/frames.texi
@@ -32,7 +32,7 @@ unavailable. However, it is still possible to create multiple
32``frames'' on text-only terminals; such frames are displayed one at a 32``frames'' on text-only terminals; such frames are displayed one at a
33time, filling the entire terminal screen (@pxref{Non-Window 33time, filling the entire terminal screen (@pxref{Non-Window
34Terminals}). It is also possible to use the mouse on some text-only 34Terminals}). It is also possible to use the mouse on some text-only
35terminals (@pxref{Text-Only Mouse}, for doing so on GNU and UNIX 35terminals (@pxref{Text-Only Mouse}, for doing so on GNU and Unix
36systems; and 36systems; and
37@iftex 37@iftex
38@pxref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features}, 38@pxref{MS-DOS Mouse,,,emacs-xtra,Specialized Emacs Features},
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 354812edc1f..6ce298c1795 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -49,13 +49,13 @@ variable @code{vc-handled-backends} to @code{nil}
49* VC Mode Line:: How the mode line shows version control status. 49* VC Mode Line:: How the mode line shows version control status.
50* Basic VC Editing:: How to edit a file under version control. 50* Basic VC Editing:: How to edit a file under version control.
51* Log Buffer:: Features available in log entry buffers. 51* Log Buffer:: Features available in log entry buffers.
52* Registering:: Putting a file under version control.
52* Old Revisions:: Examining and comparing old versions. 53* Old Revisions:: Examining and comparing old versions.
53* Secondary VC Commands:: The commands used a little less frequently. 54* VC Change Log:: Viewing the VC Change Log.
55* VC Undo:: Canceling changes before or after committing.
54* VC Directory Mode:: Listing files managed by version control. 56* VC Directory Mode:: Listing files managed by version control.
55* Branches:: Multiple lines of development. 57* Branches:: Multiple lines of development.
56@ifnottex 58@ifnottex
57* Remote Repositories:: Efficient access to remote CVS servers.
58* Revision Tags:: Symbolic names for revisions.
59* Miscellaneous VC:: Various other commands and features of VC. 59* Miscellaneous VC:: Various other commands and features of VC.
60* Customizing VC:: Variables that change VC's behavior. 60* Customizing VC:: Variables that change VC's behavior.
61@end ifnottex 61@end ifnottex
@@ -71,7 +71,7 @@ control operations.
71 71
72 Some uncommon or intricate version control operations, such as 72 Some uncommon or intricate version control operations, such as
73altering repository settings, are not supported in VC. You should 73altering repository settings, are not supported in VC. You should
74perform such tasks outside Emacs, e.g. via the command line. 74perform such tasks outside Emacs, e.g.@: via the command line.
75 75
76 This section provides a general overview of version control, and 76 This section provides a general overview of version control, and
77describes the version control systems that VC supports. You can skip 77describes the version control systems that VC supports. You can skip
@@ -125,7 +125,7 @@ which it refers to as @dfn{back ends}:
125@item 125@item
126SCCS was the first version control system ever built, and was long ago 126SCCS was the first version control system ever built, and was long ago
127superseded by more advanced ones. VC compensates for certain features 127superseded by more advanced ones. VC compensates for certain features
128missing in SCCS (e.g., tag names for releases) by implementing them 128missing in SCCS (e.g.@: tag names for releases) by implementing them
129itself. Other VC features, such as multiple branches, are simply 129itself. Other VC features, such as multiple branches, are simply
130unavailable. Since SCCS is non-free, we recommend avoiding it. 130unavailable. Since SCCS is non-free, we recommend avoiding it.
131 131
@@ -154,7 +154,7 @@ moving/renaming. VC supports all basic editing operations under CVS.
154@cindex SVN 154@cindex SVN
155@cindex Subversion 155@cindex Subversion
156@item 156@item
157Subversion (SVN) is a free version control system designed to be 157Subversion (svn) is a free version control system designed to be
158similar to CVS but without its problems (e.g., it supports atomic 158similar to CVS but without its problems (e.g., it supports atomic
159commits of filesets, and versioning of directories, symbolic links, 159commits of filesets, and versioning of directories, symbolic links,
160meta-data, renames, copies, and deletes). 160meta-data, renames, copies, and deletes).
@@ -162,37 +162,33 @@ meta-data, renames, copies, and deletes).
162@cindex GNU Arch 162@cindex GNU Arch
163@cindex Arch 163@cindex Arch
164@item 164@item
165GNU Arch is one of the earliest @dfn{distributed} version control 165GNU Arch is one of the earliest @dfn{decentralized} version control
166systems (the other being Monotone). @xref{VCS Concepts}, for a 166systems (the other being Monotone). @xref{VCS Concepts}, for a
167description of distributed version control systems. It is no longer 167description of decentralized version control systems. It is no longer
168under active development, and has been deprecated in favor of Bazaar. 168under active development, and has been deprecated in favor of Bazaar.
169 169
170@cindex git 170@cindex git
171@item 171@item
172Git is a distributed version control system originally invented by 172Git is a decentralized version control system originally invented by
173Linus Torvalds to support development of Linux (his kernel). VC 173Linus Torvalds to support development of Linux (his kernel). VC
174supports many common git operations, but others, such as repository 174supports many common Git operations, but others, such as repository
175syncing, must be done from the command line. 175syncing, must be done from the command line.
176 176
177@cindex hg 177@cindex hg
178@cindex Mercurial 178@cindex Mercurial
179@item 179@item
180Mercurial (hg) is a distributed version control system broadly 180Mercurial (hg) is a decentralized version control system broadly
181resembling git. VC supports most Mercurial commands, with the 181resembling Git. VC supports most Mercurial commands, with the
182exception of repository sync operations. 182exception of repository sync operations.
183 183
184@cindex bzr 184@cindex bzr
185@cindex Bazaar 185@cindex Bazaar
186@item 186@item
187Bazaar (bzr) is a distributed version control system that supports 187Bazaar (bzr) is a decentralized version control system that supports
188both repository-based and distributed versioning. VC supports most 188both repository-based and decentralized versioning. VC supports most
189basic editing operations under Bazaar. 189basic editing operations under Bazaar.
190@end itemize 190@end itemize
191 191
192 Previous versions of VC supported a version control system known as
193Meta-CVS. This support was dropped due to limited interest from users
194and developers.
195
196@node VCS Concepts 192@node VCS Concepts
197@subsubsection Concepts of Version Control 193@subsubsection Concepts of Version Control
198 194
@@ -210,16 +206,19 @@ as @dfn{log entries} that describe the changes made to each file.
210 The copy of a version-controlled file that you actually edit is 206 The copy of a version-controlled file that you actually edit is
211called the @dfn{work file}. You can change each work file as you 207called the @dfn{work file}. You can change each work file as you
212would an ordinary file. After you are done with a set of changes, you 208would an ordinary file. After you are done with a set of changes, you
213@dfn{commit} (or @dfn{check in}) the changes; this records the changes 209may @dfn{commit} (or @dfn{check in}) the changes; this records the
214in the repository, along with a descriptive log entry. 210changes in the repository, along with a descriptive log entry.
211
212@cindex working tree
213 A directory tree of work files is called a @dfn{working tree}.
215 214
216@cindex revision 215@cindex revision
217@cindex revision ID 216@cindex revision ID
218 A copy of a file stored in a repository is called a @dfn{revision}. 217 Each commit creates a new @dfn{revision} in the repository. The
219The history of a file is a sequence of revisions. Each revision is 218version control system keeps track of all past revisions and the
220named by a @dfn{revision ID}. The format of the revision ID depends 219changes that were made in each revision. Each revision is named by a
221on the version control system; in the simplest case, it is just an 220@dfn{revision ID}, whose format depends on the version control system;
222integer. 221in the simplest case, it is just an integer.
223 222
224 To go beyond these basic concepts, you will need to understand three 223 To go beyond these basic concepts, you will need to understand three
225aspects in which version control systems differ. As explained in the 224aspects in which version control systems differ. As explained in the
@@ -229,17 +228,18 @@ these modes of operation, but it cannot hide the differences.
229 228
230@node VCS Merging 229@node VCS Merging
231@subsubsection Merge-based vs lock-based Version Control 230@subsubsection Merge-based vs lock-based Version Control
232@cindex locking versus merging
233 231
234 A version control system typically has some mechanism to coordinate 232 A version control system typically has some mechanism to coordinate
235between users who want to change the same file. There are two ways to 233between users who want to change the same file. There are two ways to
236do this: merging and locking. 234do this: merging and locking.
237 235
238 In a version control system that uses merging, each user may check 236@cindex merging-based version
239out and modify a work file at any time. The system lets you 237 In a version control system that uses merging, each user may modify
240@dfn{merge} your work file, which may contain changes that have not 238a work file at any time. The system lets you @dfn{merge} your work
241been committed, with the latest changes that others have committed. 239file, which may contain changes that have not been committed, with the
240latest changes that others have committed.
242 241
242@cindex locking-based version
243 Older version control systems use a @dfn{locking} scheme instead. 243 Older version control systems use a @dfn{locking} scheme instead.
244Here, work files are normally read-only. To edit a file, you ask the 244Here, work files are normally read-only. To edit a file, you ask the
245version control system to make it writable for you by @dfn{locking} 245version control system to make it writable for you by @dfn{locking}
@@ -264,7 +264,7 @@ number and severity of conflicts that actually occur.
264 SCCS always uses locking. RCS is lock-based by default but can be 264 SCCS always uses locking. RCS is lock-based by default but can be
265told to operate in a merging style. CVS and Subversion are 265told to operate in a merging style. CVS and Subversion are
266merge-based by default but can be told to operate in a locking mode. 266merge-based by default but can be told to operate in a locking mode.
267Distributed version control systems, such as GNU Arch, git, and 267Decentralized version control systems, such as GNU Arch, Git, and
268Mercurial, are exclusively merging-based. 268Mercurial, are exclusively merging-based.
269 269
270 VC mode supports both locking and merging version control. The 270 VC mode supports both locking and merging version control. The
@@ -276,15 +276,16 @@ possible.
276@node VCS Changesets 276@node VCS Changesets
277@subsubsection Changeset-based vs File-based Version Control 277@subsubsection Changeset-based vs File-based Version Control
278 278
279@cindex changesets 279@cindex file-based version control
280 On SCCS, RCS, CVS, and other early version control systems, version 280 On SCCS, RCS, CVS, and other early version control systems, version
281control operations are @dfn{file-based}: each file has its own comment 281control operations are @dfn{file-based}: each file has its own comment
282and revision history separate from that of all other files. Newer 282and revision history separate from that of all other files. Newer
283systems, beginning with Subversion, are @dfn{changeset-based}: a 283systems, beginning with Subversion, are @dfn{changeset-based}: a
284checkin may include changes to several files, and the entire set of 284commit may include changes to several files, and the entire set of
285changes is handled as a unit. Any comment associated with the change 285changes is handled as a unit. Any comment associated with the change
286does not belong to a single file, but to the changeset itself. 286does not belong to a single file, but to the changeset itself.
287 287
288@cindex changeset-based version control
288 Changeset-based version control is more flexible and powerful than 289 Changeset-based version control is more flexible and powerful than
289file-based version control; usually, when a change to multiple files 290file-based version control; usually, when a change to multiple files
290has to be reversed, it's good to be able to easily identify and remove 291has to be reversed, it's good to be able to easily identify and remove
@@ -295,18 +296,20 @@ all of it.
295 296
296@cindex centralized version control 297@cindex centralized version control
297@cindex decentralized version control 298@cindex decentralized version control
299@cindex distributed version control
298 Early version control systems were designed around a 300 Early version control systems were designed around a
299@dfn{centralized} model in which each project has only one repository 301@dfn{centralized} model in which each project has only one repository
300used by all developers. SCCS, RCS, CVS, and Subversion share this 302used by all developers. SCCS, RCS, CVS, and Subversion share this
301kind of model. One of its drawbacks is that the repository is a choke 303kind of model. One of its drawbacks is that the repository is a choke
302point for reliability and efficiency. 304point for reliability and efficiency.
303 305
304 GNU Arch pioneered the concept of @dfn{decentralized} version 306 GNU Arch pioneered the concept of @dfn{distributed} or
305control, later implemented in git, Mercurial, and Bazaar. A project 307@dfn{decentralized} version control, later implemented in Git,
306may have several different repositories, and these systems support a 308Mercurial, and Bazaar. A project may have several different
307sort of super-merge between repositories that tries to reconcile their 309repositories, and these systems support a sort of super-merge between
308change histories. In effect, there is one repository for each 310repositories that tries to reconcile their change histories. In
309developer, and repository merges take the place of commit operations. 311effect, there is one repository for each developer, and repository
312merges take the place of commit operations.
310 313
311 VC helps you manage the traffic between your personal workfiles and 314 VC helps you manage the traffic between your personal workfiles and
312a repository. Whether the repository is a single master, or one of a 315a repository. Whether the repository is a single master, or one of a
@@ -346,10 +349,9 @@ policy, which you should follow.
346 When the policy is to use both, you typically want to write an entry 349 When the policy is to use both, you typically want to write an entry
347for each change just once, then put it into both logs. You can write 350for each change just once, then put it into both logs. You can write
348the entry in @file{ChangeLog}, then copy it to the log buffer with 351the entry in @file{ChangeLog}, then copy it to the log buffer with
349@kbd{C-c C-a} when checking in the change (@pxref{Log Buffer}). Or 352@kbd{C-c C-a} when committing the change (@pxref{Log Buffer}). Or you
350you can write the entry in the log buffer while checking in the 353can write the entry in the log buffer while committing the change, and
351change, and later use the @kbd{C-x v a} command to copy it to 354later use the @kbd{C-x v a} command to copy it to @file{ChangeLog}
352@file{ChangeLog}
353@iftex 355@iftex
354(@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}). 356(@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}).
355@end iftex 357@end iftex
@@ -359,20 +361,22 @@ change, and later use the @kbd{C-x v a} command to copy it to
359 361
360@node VC Mode Line 362@node VC Mode Line
361@subsection Version Control and the Mode Line 363@subsection Version Control and the Mode Line
362@cindex VC, mode line indicator 364@cindex VC mode line indicator
363 365
364 When you visit a file that is under version control, Emacs indicates 366 When you visit a file that is under version control, Emacs indicates
365this on the mode line. For example, @samp{Bzr-1223} says that Bazaar 367this on the mode line. For example, @samp{Bzr-1223} says that Bazaar
366is used for that file, and the current revision ID is 1223. 368is used for that file, and the current revision ID is 1223.
367 369
370@cindex version control status
368 The character between the back-end name and the revision ID 371 The character between the back-end name and the revision ID
369indicates the status of the work file. In a merge-based version 372indicates the @dfn{version control status} of the work file. In a
370control system, a @samp{-} character indicates that the work file is 373merge-based version control system, a @samp{-} character indicates
371unmodified, and @samp{:} indicates that it has been modified. 374that the work file is unmodified, and @samp{:} indicates that it has
372@samp{!} indicates that the file contains conflicts as result of a 375been modified. @samp{!} indicates that the file contains conflicts as
373recent merge operation (@pxref{Merging}), or that the file was removed 376result of a recent merge operation (@pxref{Merging}), or that the file
374from the version control. Finally, @samp{?} means that the file is 377was removed from the version control. Finally, @samp{?} means that
375under version control, but is missing from the working tree. 378the file is under version control, but is missing from the working
379tree.
376 380
377 In a lock-based system, @samp{-} indicates an unlocked file, and 381 In a lock-based system, @samp{-} indicates an unlocked file, and
378@samp{:} a locked file; if the file is locked by another user (for 382@samp{:} a locked file; if the file is locked by another user (for
@@ -402,6 +406,7 @@ system, but is usually not excessive.
402@subsection Basic Editing under Version Control 406@subsection Basic Editing under Version Control
403 407
404@cindex filesets, VC 408@cindex filesets, VC
409@cindex VC filesets
405 Most VC commands operate on @dfn{VC filesets}. A VC fileset is a 410 Most VC commands operate on @dfn{VC filesets}. A VC fileset is a
406collection of one or more files that a VC operation acts on. When you 411collection of one or more files that a VC operation acts on. When you
407type VC commands in a buffer visiting a version-controlled file, the 412type VC commands in a buffer visiting a version-controlled file, the
@@ -409,37 +414,34 @@ VC fileset is simply that one file. When you type them in a VC
409Directory buffer, and some files in it are marked, the VC fileset 414Directory buffer, and some files in it are marked, the VC fileset
410consists of the marked files (@pxref{VC Directory Mode}). 415consists of the marked files (@pxref{VC Directory Mode}).
411 416
412 The principal VC command is an all-purpose command, @kbd{C-x v v} 417 On modern changeset-based version control systems (@pxref{VCS
413(@code{vc-next-action}), that performs either registration, locking, 418Changesets}), VC commands handle multi-file VC filesets as a group.
414merging or a check-in (depending on the situation) on the current VC 419For example, committing a multi-file VC fileset generates a single
415fileset. You can use @kbd{C-x v v} in a file-visiting buffer or in a 420revision, containing the changes to all those files. On older
416VC Directory buffer. 421file-based version control systems like CVS, each file in a multi-file
422VC fileset is handled individually; for example, a commit generates
423one revision for each changed file.
417 424
418@table @kbd 425@table @kbd
419@itemx C-x v v 426@itemx C-x v v
420Perform the appropriate next version control operation on the VC fileset. 427Perform the next appropriate version control operation on the current
428VC fileset.
421@end table 429@end table
422 430
423@findex vc-next-action 431@findex vc-next-action
424@kindex C-x v v 432@kindex C-x v v
425 The precise action of @kbd{C-x v v} depends on the state of the VC 433 The principal VC command is a multi-purpose command, @kbd{C-x v v}
426fileset, and whether the version control system uses locking or 434(@code{vc-next-action}), which performs the ``most appropriate''
427merging. This is described in detail in the subsequent sections. 435action on the current VC fileset: either registering it with a version
428 436control system, or committing it, or unlocking it, or merging changes
429 VC filesets are the way that VC mode bridges the gap between 437into it. The precise actions are described in detail in the following
430file-based and changeset-based version control systems. They are, 438subsections. You can use @kbd{C-x v v} either in a file-visiting
431essentially, a way to pass multiple file arguments as a group to 439buffer or in a VC Directory buffer.
432version control commands. For example, on Subversion, a checkin with 440
433a multi-file VC fileset becomes a joint commit, as though you had 441 Note that VC filesets are distinct from the ``named filesets'' used
434typed @command{svn commit} with those file arguments at the shell 442for viewing and visiting files in functional groups
435command line. All files in a VC fileset must be under the same 443(@pxref{Filesets}). Unlike named filesets, VC filesets are not named
436version control system; if they are not, Emacs signals an error when 444and don't persist across sessions.
437you attempt to execute a command on the fileset.
438
439 VC filesets are distinct from the ``named filesets'' used for
440viewing and visiting files in functional groups (@pxref{Filesets}).
441Unlike named filesets, VC filesets are not named and don't persist
442across sessions.
443 445
444@menu 446@menu
445* VC With A Merging VCS:: Without locking: default mode for CVS. 447* VC With A Merging VCS:: Without locking: default mode for CVS.
@@ -450,46 +452,44 @@ across sessions.
450@node VC With A Merging VCS 452@node VC With A Merging VCS
451@subsubsection Basic Version Control with Merging 453@subsubsection Basic Version Control with Merging
452 454
453 When your version control system is merging-based (the default for 455 On a merging-based version control system (i.e.@: most modern ones;
454CVS and all newer version control systems), work files are always 456@pxref{VCS Merging}), @kbd{C-x v v} does the following:
455writable; you need not do anything special to begin editing a file.
456The status indicator on the mode line is @samp{-} if the file is
457unmodified; it flips to @samp{:} as soon as you save any changes
458(@pxref{VC Mode Line}).
459
460 Here is what @kbd{C-x v v} does when using a merging-based system:
461 457
462@itemize @bullet 458@itemize @bullet
463@item 459@item
464If the work file is in a directory that is not controlled by any 460If there is more than one file in the VC fileset and the files have
465version control system, prompt for a repository type. Then, create a 461inconsistent version control statuses, signal an error. (Note,
466version control repository of that type and register the file with it. 462however, that a fileset is allowed to include both ``newly-added''
463files and ``modified'' files; @pxref{Registering}.)
467 464
468@item 465@item
469If the work file is in a directory that is controlled by a version 466If none of the files in the VC fileset are registered with a version
470control system but not registered with it, register the file. 467control system, register the VC fileset, i.e.@: place it under version
468control. @xref{Registering}. If Emacs cannot find a system to
469register under, it prompts for a repository type, creates a new
470repository, and registers the VC fileset with it.
471 471
472@item 472@item
473If the work file is the same as in the repository, do nothing. 473If every work file in the VC fileset is unchanged, do nothing.
474 474
475@item 475@item
476If you have not changed the work file, but some other user has checked 476If every work file in the VC fileset has been modified, commit the
477in changes to the repository, merge those changes into the work file. 477changes. To do this, Emacs pops up a @samp{*vc-log*} buffer; type the
478desired log entry for the new revision, followed by @kbd{C-c C-c} to
479commit. @xref{Log Buffer}.
480
481If committing to a shared repository, the commit may fail if the
482repository that has been changed since your last update. In that
483case, you must perform an update before trying again. On a
484decentralized version control system, use @kbd{C-x v +} (@pxref{VC
485Pull}) or @kbd{C-x v m} (@pxref{Merging}). On a centralized version
486control system, type @kbd{C-x v v} again to merge in the repository
487changes.
478 488
479@item 489@item
480If you have made modifications to the work file, attempt to commit 490Finally, if you are using a centralized version control system, check
481the changes. To do this, Emacs first reads the log entry for the new 491if each work file in the VC fileset is up-to-date. If any file has
482revision (@pxref{Log Buffer}). If some other user has committed 492been changed in the repository, offer to update it.
483changes to the repository since you last checked it out, the checkin
484fails. In that case, type @kbd{C-x v v} again to merge those changes
485into your own work file; this puts the work file into a ``conflicted''
486state. Type @kbd{C-x v v} to clear the ``conflicted'' state; VC then
487regards the file as up-to-date and modified, and you can try to check
488it in again.
489
490To pick up any recent changes from the repository @emph{without}
491trying to commit your own changes, type @kbd{C-x v m @key{RET}}.
492@xref{Merging}.
493@end itemize 493@end itemize
494 494
495 These rules also apply when you use RCS in its ``non-locking'' mode, 495 These rules also apply when you use RCS in its ``non-locking'' mode,
@@ -498,7 +498,7 @@ Nothing informs you if another user has committed changes in the same
498file since you began editing it; when you commit your revision, his 498file since you began editing it; when you commit your revision, his
499changes are removed (however, they remain in the repository and are 499changes are removed (however, they remain in the repository and are
500thus not irrevocably lost). Therefore, you must verify that the 500thus not irrevocably lost). Therefore, you must verify that the
501current revision is unchanged before checking in your changes. In 501current revision is unchanged before committing your changes. In
502addition, locking is possible with RCS even in this mode: @kbd{C-x v 502addition, locking is possible with RCS even in this mode: @kbd{C-x v
503v} with an unmodified file locks the file, just as it does with RCS in 503v} with an unmodified file locks the file, just as it does with RCS in
504its normal locking mode (@pxref{VC With A Locking VCS}). 504its normal locking mode (@pxref{VC With A Locking VCS}).
@@ -506,32 +506,44 @@ its normal locking mode (@pxref{VC With A Locking VCS}).
506@node VC With A Locking VCS 506@node VC With A Locking VCS
507@subsubsection Basic Version Control with Locking 507@subsubsection Basic Version Control with Locking
508 508
509 Under a locking-based version control system (such as SCCS, and RCS 509 On a locking-based version control system (such as SCCS, and RCS in
510in its default mode), @kbd{C-x v v} does the following: 510its default mode), @kbd{C-x v v} does the following:
511 511
512@itemize @bullet 512@itemize @bullet
513@item 513@item
514If the file is not locked, lock it and make it writable, so that you 514If there is more than one file in the VC fileset and the files have
515can change it. 515inconsistent version control statuses, signal an error.
516
517@item
518If each file in the VC fileset is not registered with a version
519control system, register the VC fileset. @xref{Registering}. If
520Emacs cannot find a system to register under, it prompts for a
521repository type, creates a new repository, and registers the VC
522fileset with it.
523
524@item
525If each file is registered and unlocked, lock it and make it writable,
526so that you can begin to edit it.
516 527
517@item 528@item
518If the file is locked by you, and contains changes, commit the 529If each file is locked by you and contains changes, commit the
519changes. In order to do this, Emacs first reads the log entry for the 530changes. To do this, Emacs pops up a @samp{*vc-log*} buffer; type the
520new revision. @xref{Log Buffer}. 531desired log entry for the new revision, followed by @kbd{C-c C-c} to
532commit (@pxref{Log Buffer}).
521 533
522@item 534@item
523If the file is locked by you, but you have not changed it since you 535If each file is locked by you, but you have not changed it, release
524locked it, release the lock and makes the file read-only again. 536the lock and make the file read-only again.
525 537
526@item 538@item
527If the file is locked by some other user, ask whether you want to 539If each file is locked by another user, ask whether you want to
528``steal the lock'' from that user. If you say yes, the file becomes 540``steal the lock''. If you say yes, the file becomes locked by you,
529locked by you, but a message is sent to the person who had formerly 541and a warning message is sent to the user who had formerly locked the
530locked the file, to inform him of what has happened. 542file.
531@end itemize 543@end itemize
532 544
533 These rules also apply when you use CVS in locking mode, except 545 These rules also apply when you use CVS in locking mode, except
534that CVS does not support stealing a lock. 546that CVS does not support stealing locks.
535 547
536@node Advanced C-x v v 548@node Advanced C-x v v
537@subsubsection Advanced Control in @kbd{C-x v v} 549@subsubsection Advanced Control in @kbd{C-x v v}
@@ -544,49 +556,55 @@ to do the operation.
544 556
545@itemize @bullet 557@itemize @bullet
546@item 558@item
547If the file is modified (or locked), you can specify the revision ID 559@cindex specific version control system
548to use for the new version that you commit. This is one way to create 560You can specify the name of a version control system. This is useful
549a new branch (@pxref{Branches}). 561if the fileset can be managed by more than one version control system,
562and Emacs fails to detect the correct one.
550 563
551@item 564@item
552If the file is not modified (and unlocked), you can specify the 565Otherwise, if using CVS or RCS, you can specify a revision ID.
553revision to select; this lets you start working from an older
554revision, or on another branch. If you do not enter any revision,
555that takes you to the highest (``head'') revision on the current
556branch; therefore @kbd{C-u C-x v v @key{RET}} is a convenient way to
557get the latest version of a file from the repository.
558 566
559@item 567If the fileset is modified (or locked), this makes Emacs commit with
560@cindex specific version control system 568that revision ID. You can create a new branch by supplying an
561Instead of the revision ID, you can also specify the name of a 569appropriate revision ID (@pxref{Branches}).
562version control system. This is useful when one file is being managed 570
563with two version control systems at the same time 571If the fileset is unmodified (and unlocked), this checks the specified
564@iftex 572revision into the working tree. You can also specify a revision on
565(@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs 573another branch by giving its revision or branch ID (@pxref{Switching
566Features}). 574Branches}). An empty argument (i.e.@: @kbd{C-u C-x v v @key{RET}})
567@end iftex 575checks out the latest (``head'') revision on the current branch.
568@ifnottex
569(@pxref{Local Version Control}).
570@end ifnottex
571 576
577This signals an error on a decentralized version control system.
578Those systems do not let you specify your own revision IDs, nor do
579they use the concept of ``checking out'' individual files.
572@end itemize 580@end itemize
573 581
574@node Log Buffer 582@node Log Buffer
575@subsection Features of the Log Entry Buffer 583@subsection Features of the Log Entry Buffer
576 584
577 When you tell VC to commit a change, it pops up a buffer called 585@cindex C-c C-c @r{(Log Edit mode)}
578@samp{*VC-Log*}. In this buffer, you should write a @dfn{log entry} 586@findex log-edit-done
587 When you tell VC to commit a change, it pops up a buffer named
588@samp{*vc-log*}. In this buffer, you should write a @dfn{log entry}
579describing the changes you have made (@pxref{Why Version Control?}). 589describing the changes you have made (@pxref{Why Version Control?}).
580After you are done, type @kbd{C-c C-c}; this exits the buffer and 590After you are done, type @kbd{C-c C-c} (@code{log-edit-done}) to exit
581commits the change, together with your log entry. 591the buffer and commit the change, together with your log entry.
582 592
583 While in the @samp{*VC-Log*} buffer, you can write one or more 593@cindex Log Edit mode
584@dfn{header lines}, specifying additional information to be supplied 594@cindex mode, Log Edit
585to the version control system. Each header line must occupy a single 595@vindex vc-log-mode-hook
586line at the top of the buffer; the first line that is not a header 596 The major mode for the @samp{*vc-log*} buffer is Log Edit mode, a
587line is treated as the start of the log entry. For example, the 597variant of Text mode (@pxref{Text Mode}). On entering Log Edit mode,
588following header line states that the present change was not written 598Emacs runs the hooks @code{text-mode-hook} and @code{vc-log-mode-hook}
589by you, but by another developer: 599(@pxref{Hooks}).
600
601 In the @samp{*vc-log*} buffer, you can write one or more @dfn{header
602lines}, specifying additional information to be supplied to the
603version control system. Each header line must occupy a single line at
604the top of the buffer; the first line that is not a header line is
605treated as the start of the log entry. For example, the following
606header line states that the present change was not written by you, but
607by another developer:
590 608
591@smallexample 609@smallexample
592Author: J. R. Hacker <jrh@@example.com> 610Author: J. R. Hacker <jrh@@example.com>
@@ -597,196 +615,215 @@ Apart from the @samp{Author} header, Emacs recognizes the headers
597@samp{Date} (a manually-specified commit time) and @samp{Fixes} (a 615@samp{Date} (a manually-specified commit time) and @samp{Fixes} (a
598reference to a bug fixed by the change). Not all version control 616reference to a bug fixed by the change). Not all version control
599systems recognize all headers: Bazaar recognizes all three headers, 617systems recognize all headers: Bazaar recognizes all three headers,
600while git, Mercurial, and Monotone recognizes only @samp{Author} and 618while Git, Mercurial, and Monotone recognize only @samp{Author} and
601@samp{Summary}. If you specify a header for a version control that 619@samp{Date}. If you specify a header for a system that does not
602does not support it, the header is treated as part of the log entry. 620support it, the header is treated as part of the log entry.
603 621
622@kindex C-c C-f @r{(Log Edit mode)}
604@findex log-edit-show-files 623@findex log-edit-show-files
624@kindex C-c C-d @r{(Log Edit mode)}
605@findex log-edit-show-diff 625@findex log-edit-show-diff
606 Type @kbd{C-c C-f} (@code{log-edit-show-files}) to display a list of 626 While in the @samp{*vc-log*} buffer, the ``current VC fileset'' is
607files in the current VC fileset. If you called @kbd{C-x v v} directly 627considered to be the fileset that will be committed if you type
608from a work file, the fileset consists of that single file; if you 628@w{@kbd{C-c C-c}}. To view a list of the files in the VC fileset,
609called @kbd{C-x v v} from a VC directory buffer (@pxref{VC Directory 629type @w{@kbd{C-c C-f}} (@code{log-edit-show-files}). To view a diff
610Mode}), the fileset may consist of multiple files. 630of changes between the VC fileset and the version from which you
611 631started editing (@pxref{Old Revisions}), type @kbd{C-c C-d}
632(@code{log-edit-show-diff}).
633
634@kindex C-c C-a @r{(Log Edit mode)}
612@findex log-edit-insert-changelog 635@findex log-edit-insert-changelog
613 Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a @dfn{diff} 636 If the VC fileset includes one or more @file{ChangeLog} files
614of the changes you have made (i.e., the differences between the work 637(@pxref{Change Log}), type @kbd{C-c C-a}
615file and the repository revision from which you started editing).
616@xref{Old Revisions}.
617
618 If the current VC fileset includes one or more @file{ChangeLog}
619files (@pxref{Change Log}), type @kbd{C-c C-a}
620(@code{log-edit-insert-changelog}) to pull the relevant entries into 638(@code{log-edit-insert-changelog}) to pull the relevant entries into
621the @samp{*VC-Log*} buffer. If the topmost item in each 639the @samp{*vc-log*} buffer. If the topmost item in each
622@file{ChangeLog} was made under your user name on the current date, 640@file{ChangeLog} was made under your user name on the current date,
623this command searches that item for entries that match the file(s) to 641this command searches that item for entries matching the file(s) to be
624be committed; if found, these entries are inserted. 642committed, and inserts them.
625@iftex
626@xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features},
627@end iftex
628@ifnottex 643@ifnottex
629@xref{Change Logs and VC}, 644If you are using CVS or RCS, see @ref{Change Logs and VC}, for the
645opposite way of working---generating ChangeLog entries from the Log
646Edit buffer.
630@end ifnottex 647@end ifnottex
631for the opposite way of working---generating ChangeLog entries from
632the revision control log.
633 648
634 To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that 649 To abort a commit, just @strong{don't} type @kbd{C-c C-c} in that
635buffer. You can switch buffers and do other editing. As long as you 650buffer. You can switch buffers and do other editing. As long as you
636don't try to commit another file, the entry you were editing remains 651don't try to make another commit, the entry you were editing remains
637in the @samp{*VC-Log*} buffer, and you can go back to that buffer at 652in the @samp{*vc-log*} buffer, and you can go back to that buffer at
638any time to complete the check-in. 653any time to complete the commit.
639 654
640 If you change several source files for the same reason, it is often 655@kindex M-n @r{(Log Edit mode)}
641convenient to specify the same log entry for many of the files. (This 656@kindex M-p @r{(Log Edit mode)}
642is the normal way to do things on a changeset-oriented system, where 657@kindex M-s @r{(Log Edit mode)}
643comments are attached to changesets rather than the history of 658@kindex M-r @r{(Log Edit mode)}
644individual files.) The most convenient way to do this is to mark all
645the files in VC Directory Mode and commit from there; the log buffer
646will carry the fileset information with it and do a group commit when
647you type @kbd{C-c C-c}.
648
649 You can also browse the history of previous log entries to duplicate 659 You can also browse the history of previous log entries to duplicate
650a checkin comment. This can be useful when you want several files to 660a commit comment. This can be useful when you want to make several
651have checkin comments that vary only slightly from each other. The 661commits with similar comments. The commands @kbd{M-n}, @kbd{M-p},
652commands @kbd{M-n}, @kbd{M-p}, @kbd{M-s} and @kbd{M-r} for doing this 662@kbd{M-s} and @kbd{M-r} for doing this work just like the minibuffer
653work just like the minibuffer history commands (except that these 663history commands (@pxref{Minibuffer History}), except that they are
654versions are used outside the minibuffer). 664used outside the minibuffer.
655 665
656@vindex vc-log-mode-hook 666@node Registering
657 Each time you commit a change, the log entry buffer is put into VC 667@subsection Registering a File for Version Control
658Log Edit mode, which involves running two hooks: @code{text-mode-hook} 668
659and @code{vc-log-mode-hook}. @xref{Hooks}. 669@table @kbd
670@item C-x v i
671Register the visited file for version control.
672@end table
673
674@kindex C-x v i
675@findex vc-register
676 The command @kbd{C-x v i} (@code{vc-register}) @dfn{registers} each
677file in the current VC fileset, placing it under version control.
678This is essentially equivalent to the action of @kbd{C-x v v} on an
679unregistered VC fileset (@pxref{Basic VC Editing}), except that if the
680VC fileset is already registered, @kbd{C-x v i} signals an error
681whereas @kbd{C-x v v} performs some other action.
682
683 To register a file, Emacs must choose a version control system. For
684a multi-file VC fileset, the VC Directory buffer specifies the system
685to use (@pxref{VC Directory Mode}). For a single-file VC fileset, if
686the file's directory already contains files registered in a version
687control system, or if the directory is part of a directory tree
688controlled by a version control system, Emacs chooses that system. In
689the event that more than one version control system is applicable,
690Emacs uses the one that appears first in the variable
691@iftex
692@code{vc-handled-backends}.
693@end iftex
694@ifnottex
695@code{vc-handled-backends} (@pxref{Customizing VC}).
696@end ifnottex
697If Emacs cannot find a version control system to register the file
698under, it prompts for a repository type, creates a new repository, and
699registers the file into that repository.
700
701 On most version control systems, registering a file with @kbd{C-x v
702i} or @kbd{C-x v v} adds it to the ``working tree'' but not to the
703repository. Such files are labeled as @samp{added} in the VC
704Directory buffer, and show a revision ID of @samp{@@@@} in the mode
705line. To make the registration take effect in the repository, you
706must perform a commit (@pxref{Basic VC Editing}). Note that a single
707commit can include both file additions and edits to existing files.
708
709 On a locking-based version control system (@pxref{VCS Merging}),
710registering a file leaves it unlocked and read-only. Type @kbd{C-x v
711v} if you wish to start editing it.
660 712
661@node Old Revisions 713@node Old Revisions
662@subsection Examining And Comparing Old Revisions 714@subsection Examining And Comparing Old Revisions
663 715
664 One of the convenient features of version control is the ability
665to examine any revision of a file, or compare two revisions.
666
667@table @kbd 716@table @kbd
668@item C-x v ~
669Prompt for a revision of the current file, and visit it in a buffer of
670its own (@code{vc-revision-other-window}).
671
672@item C-x v = 717@item C-x v =
673Compare the files in the current fileset with the working revision(s) 718Compare the work files in the current VC fileset with the versions you
674you started from (@code{vc-diff}). With a prefix argument, prompt for 719started from (@code{vc-diff}). With a prefix argument, prompt for two
675two revisions of the current fileset and compare them. You can call 720revisions of the current VC fileset and compare them. You can also
676this command from a Dired buffer (@pxref{Dired}). 721call this command from a Dired buffer (@pxref{Dired}).
722
723@ifnottex
724@item M-x vc-ediff
725Like @kbd{C-x v =}, but using Ediff. @xref{Top, Ediff, ediff, The
726Ediff Manual}.
727@end ifnottex
677 728
678@item C-x v D 729@item C-x v D
679Compare the entire tree corresponding to the current fileset with the 730Compare the entire working tree to the revision you started from
680tree you started from (@code{vc-root-diff}). With a prefix argument, 731(@code{vc-root-diff}). With a prefix argument, prompt for two
681prompt for two revisions and compare their trees. 732revisions and compare their trees.
733
734@item C-x v ~
735Prompt for a revision of the current file, and visit it in a separate
736buffer (@code{vc-revision-other-window}).
682 737
683@item C-x v g 738@item C-x v g
684Display an annotated version of the file: for each line, show the 739Display an annotated version of the current file: for each line, show
685latest revision in which it was modified (@code{vc-annotate}). 740the latest revision in which it was modified (@code{vc-annotate}).
686@end table 741@end table
687 742
688@findex vc-revision-other-window
689@kindex C-x v ~
690 To examine an old revision, visit the work file and type @kbd{C-x v
691~ @var{revision} @key{RET}} (@code{vc-revision-other-window}). Here,
692@var{revision} is either the desired revision ID (@pxref{VCS
693Concepts}), or the name of a tag or branch
694@iftex
695(@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}).
696@end iftex
697@ifnottex
698(@pxref{Tags}).
699@end ifnottex
700This command puts the text of the old revision in a file named
701@file{@var{filename}.~@var{revision}~}, and visits it in its own
702buffer in a separate window.
703
704@findex vc-diff 743@findex vc-diff
705@kindex C-x v = 744@kindex C-x v =
706 @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC 745 @kbd{C-x v =} (@code{vc-diff}) displays a @dfn{diff} which compares
707fileset (saving them if necessary) with the repository revision(s) 746each work file in the current VC fileset to the version(s) from which
708from which you started editing. Note that the latter may or may not 747you started editing. The diff is displayed in another window, in a
709be the latest revision of the file(s). 748Diff mode buffer (@pxref{Diff Mode}) named @file{*vc-diff*}. The
710 749usual Diff mode commands are available in this buffer. In particular,
711 The diff is displayed in another window, in a Diff mode buffer 750the @kbd{g} (@code{revert-buffer}) command performs the file
712(@pxref{Diff Mode}) named @file{*vc-diff*}. In this buffer, the 751comparison again, generating a new diff.
713@kbd{g} (@code{revert-buffer}) command performs the file comparison
714again, generating a new diff.
715 752
716@findex vc-diff
717@kindex C-u C-x v = 753@kindex C-u C-x v =
718 To compare two arbitrary revisions of the current VC fileset, call 754 To compare two arbitrary revisions of the current VC fileset, call
719@code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This 755@code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This
720prompts for two revision IDs, using the minibuffer, and displays the 756prompts for two revision IDs (@pxref{VCS Concepts}), and displays a
721diff in a special buffer in another window. Instead of providing a 757diff between those versions of the fileset. This will not work
722revision ID, you can give an empty input, which specifies the current 758reliably for multi-file VC filesets, if the version control system is
723contents of the work file; or a tag or branch name 759file-based rather than changeset-based (e.g.@: CVS), since then
724@iftex 760revision IDs for different files would not be related in any
725(@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}). 761meaningful way.
726@end iftex 762
763 Instead of the revision ID, some version control systems let you
764specify revisions in other formats. For instance, under Bazaar you
765can enter @samp{date:yesterday} for the argument to @kbd{C-u C-x v =}
766(and related commands) to specify the first revision committed after
767yesterday. See the documentation of the version control system for
768details.
769
770 If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a Dired buffer
771(@pxref{Dired}), the file listed on the current line is treated as the
772current VC fileset.
773
727@ifnottex 774@ifnottex
728(@pxref{Tags}). 775@findex vc-ediff
776 @kbd{M-x vc-ediff} works like @kbd{C-x v =}, except that it uses an
777Ediff session. @xref{Top, Ediff, ediff, The Ediff Manual}.
729@end ifnottex 778@end ifnottex
730If your version control system is file-based (e.g. CVS) rather than
731changeset-based (Subversion, GNU Arch, git, Mercurial), supplying a
732revision ID for a multi-file fileset (as opposed to a symbolic tag
733name) is unlikely to return diffs that are connected in any meaningful
734way.
735
736 The command @kbd{C-x v D} (@code{vc-root-diff}) is similar to
737@kbd{C-x v =}, but it compares the entire tree associated with the
738current VC fileset with the tree you started with. This means all the
739files controlled by the current version control repository, even those
740that are not part of the current VC fileset.
741
742 If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that
743is neither visiting a version-controlled file nor a VC directory
744buffer, these commands generate a diff of all registered files in the
745current directory and its subdirectories.
746 779
747@findex vc-ediff 780@findex vc-root-diff
748The function @code{vc-ediff} works like @code{vc-diff} and provides a way to 781@kindex C-x v D
749visually compare two revisions of a file in an Ediff session, @pxref{Top, 782 @kbd{C-x v D} (@code{vc-root-diff}) is similar to @kbd{C-x v =}, but
750Ediff, ediff, The Ediff Manual}. It compares the file associated with the 783it displays the changes in the entire current working tree (i.e.@: the
751current buffer with the last repository revision. To compare two arbitrary 784working tree containing the current VC fileset). If you invoke this
752revisions of the current file, call @code{vc-ediff} with a prefix argument. 785command from a Dired buffer, it applies to the working tree containing
786the directory.
753 787
754@vindex vc-diff-switches 788@vindex vc-diff-switches
755@vindex vc-rcs-diff-switches 789 You can customize the @command{diff} options that @kbd{C-x v =} and
756 @kbd{C-x v =} works by running a variant of the @code{diff} utility 790@kbd{C-x v D} use for generating diffs. The options used are taken
757designed to work with the version control system in use. The options 791from the first non-@code{nil} value amongst the variables
758to pass to the @code{diff} command are taken from the first non-@code{nil} 792@code{vc-@var{backend}-diff-switches}, @code{vc-diff-switches}, and
759value of @code{vc-@var{backend}-diff-switches}, @code{vc-diff-switches}, 793@code{diff-switches} (@pxref{Comparing Files}), in that order. Here,
760and @code{diff-switches} (@pxref{Comparing Files}), in that order. 794@var{backend} stands for the relevant version control system,
761Since @code{nil} means to check the next variable in the sequence, 795e.g.@: @code{bzr} for Bazaar. Since @code{nil} means to check the
762either of the first two may use the value @code{t} to mean no switches at all. 796next variable in the sequence, either of the first two may use the
763Most of the @samp{vc@dots{}diff-switches} variables default to 797value @code{t} to mean no switches at all. Most of the
764@code{nil}, but some default to @code{t}. These are for those version 798@code{vc-@var{backend}-diff-switches} variables default to @code{nil},
765control systems (e.g. SVN) whose @code{diff} implementations do not 799but some default to @code{t}; these are for version control systems
766accept common options (e.g. @samp{-c}) likely to be in 800whose @code{diff} implementations do not accept common diff options,
767@code{diff-switches}. 801such as Subversion.
768 802
769 The buffer produced by @kbd{C-x v =} supports the commands of 803@findex vc-revision-other-window
770Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and 804@kindex C-x v ~
771@kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always 805 To directly examine an older version of a file, visit the work file
772find the corresponding locations in the current work file. (Older 806and type @kbd{C-x v ~ @var{revision} @key{RET}}
773revisions are not, in general, present as files on your disk.) 807(@code{vc-revision-other-window}). This retrieves the file version
808corresponding to @var{revision}, saves it to
809@file{@var{filename}.~@var{revision}~}, and visits it in a separate
810window.
774 811
775@findex vc-annotate 812@findex vc-annotate
776@kindex C-x v g 813@kindex C-x v g
777 For some back ends, you can display the file @dfn{annotated} with 814 Many version control systems allow you to view files @dfn{annotated}
778per-line revision information, by typing @kbd{C-x v g} 815with per-line revision information, by typing @kbd{C-x v g}
779(@code{vc-annotate}). This creates a new buffer (the ``annotate 816(@code{vc-annotate}). This creates a new buffer (the ``annotate
780buffer'') displaying the file's text, with each part colored to show 817buffer'') displaying the file's text, with each line colored to show
781how old it is. Text colored red is new, blue means old, and 818how old it is. Red text is new, blue is old, and intermediate colors
782intermediate colors indicate intermediate ages. By default, the color 819indicate intermediate ages. By default, the color is scaled over the
783is scaled over the full range of ages, such that the oldest changes 820full range of ages, such that the oldest changes are blue, and the
784are blue, and the newest changes are red. 821newest changes are red.
785 822
786 When you give a prefix argument to this command, Emacs reads two 823 When you give a prefix argument to this command, Emacs reads two
787arguments using the minibuffer: the ID of which revision to display and 824arguments using the minibuffer: the revision to display and annotate
788annotate (instead of the current file contents), and the time span in 825(instead of the current file contents), and the time span in days the
789days the color range should cover. 826color range should cover.
790 827
791 From the annotate buffer, these and other color scaling options are 828 From the annotate buffer, these and other color scaling options are
792available from the @samp{VC-Annotate} menu. In this buffer, you can 829available from the @samp{VC-Annotate} menu. In this buffer, you can
@@ -795,13 +832,13 @@ view diffs, or view log entries:
795 832
796@table @kbd 833@table @kbd
797@item p 834@item p
798Annotate the previous revision, that is to say, the revision before 835Annotate the previous revision, i.e.@: the revision before the one
799the one currently annotated. A numeric prefix argument is a repeat 836currently annotated. A numeric prefix argument is a repeat count, so
800count, so @kbd{C-u 10 p} would take you back 10 revisions. 837@kbd{C-u 10 p} would take you back 10 revisions.
801 838
802@item n 839@item n
803Annotate the next revision---the one after the revision currently 840Annotate the next revision, i.e.@: the revision after the one
804annotated. A numeric prefix argument is a repeat count. 841currently annotated. A numeric prefix argument is a repeat count.
805 842
806@item j 843@item j
807Annotate the revision indicated by the current line. 844Annotate the revision indicated by the current line.
@@ -840,76 +877,12 @@ Toggle the annotation visibility. This is useful for looking just at
840the file contents without distraction from the annotations. 877the file contents without distraction from the annotations.
841@end table 878@end table
842 879
843@node Secondary VC Commands
844@subsection The Secondary Commands of VC
845
846 This section explains the secondary commands of VC.
847
848@menu
849* Registering:: Putting a file under version control.
850* VC Change Log:: Viewing the VC Change Log.
851* VC Undo:: Canceling changes before or after check-in.
852@end menu
853
854@node Registering
855@subsubsection Registering a File for Version Control
856
857@kindex C-x v i
858@findex vc-register
859 You can put any file under version control by simply visiting it, and
860then typing @w{@kbd{C-x v i}} (@code{vc-register}).
861
862@table @kbd
863@item C-x v i
864Register the visited file for version control.
865@end table
866
867 To register the file, Emacs must choose which version control system
868to use for it. If the file's directory already contains files
869registered in a version control system, Emacs uses that system. If
870there is more than one system in use for a directory, Emacs uses the
871one that appears first in @code{vc-handled-backends}
872@iftex
873(@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
874@end iftex
875@ifnottex
876(@pxref{Customizing VC}).
877@end ifnottex
878On the other hand, if there are no files already registered, Emacs uses
879the first system from @code{vc-handled-backends} that could register
880the file (for example, you cannot register a file under CVS if its
881directory is not already part of a CVS tree); with the default value
882of @code{vc-handled-backends}, this means that Emacs uses RCS in this
883situation.
884
885 If locking is in use, @kbd{C-x v i} leaves the file unlocked and
886read-only. Type @kbd{C-x v v} if you wish to start editing it. After
887registering a file with CVS, you must subsequently commit the initial
888revision by typing @kbd{C-x v v}. Until you do that, the revision ID
889appears as @samp{@@@@} in the mode line.
890
891@vindex vc-default-init-revision
892@cindex initial revision ID to register
893 The default initial revision ID for a newly registered file
894varies by what VCS you are using; normally it will be 1.1 on VCSes
895that use dot-pair revision IDs and 1 on VCSes that use monotonic IDs.
896You can specify a different default by setting the variable
897@code{vc-default-init-revision}, or you can give @kbd{C-x v i} a
898numeric argument; then it reads the initial revision ID for this
899particular file using the minibuffer.
900
901@c See http://debbugs.gnu.org/9745
902@c @vindex vc-initial-comment
903@c If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an
904@c initial comment to describe the purpose of this source file. Reading
905@c the initial comment works like reading a log entry (@pxref{Log Buffer}).
906
907@node VC Change Log 880@node VC Change Log
908@subsubsection VC Change Log 881@subsection VC Change Log
909 882
910@table @kbd 883@table @kbd
911@item C-x v l 884@item C-x v l
912Display revision control state and change history 885Display the change history for the current fileset
913(@code{vc-print-log}). 886(@code{vc-print-log}).
914 887
915@item C-x v L 888@item C-x v L
@@ -928,85 +901,91 @@ Display the changes that will be sent by the next push operation
928@kindex C-x v l 901@kindex C-x v l
929@findex vc-print-log 902@findex vc-print-log
930 The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer 903 The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer
931named @samp{*vc-change-log*} in a new window. This buffer lists the 904named @samp{*vc-change-log*}, showing the history of changes made to
932changes to the current file, including the associated log entries. 905the current file, including who made the changes, the dates, and the
933(These are the log entries associated with the version control system, 906log entry for each change (these are the same log entries you would
934i.e. the ones you enter via the @samp{*VC-Log*} buffer. @xref{Log 907enter via the @samp{*vc-log*} buffer; @pxref{Log Buffer}). Point is
935Buffer}.) Point is centered at the revision of the file currently 908centered at the revision of the file currently being visited. With a
936being visited. With a prefix argument, the command prompts for the 909prefix argument, the command prompts for the revision to center on,
937revision to center on, and the maximum number of revisions to display. 910and the maximum number of revisions to display.
938You can call this command from a Dired buffer (@pxref{Dired}). 911
912 If you call @kbd{C-x v l} from a VC Directory buffer (@pxref{VC
913Directory Mode}) or a Dired buffer (@pxref{Dired}), it applies to the
914file listed on the current line.
939 915
940@findex vc-print-root-log 916@findex vc-print-root-log
941 Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a 917@findex log-view-toggle-entry-display
942@samp{*vc-change-log*} buffer showing the history of the 918 @kbd{C-x v L} (@code{vc-print-root-log}) displays a
943version-controlled directory tree as a whole. With a prefix argument, 919@samp{*vc-change-log*} buffer showing the history of the entire
944the command prompts for the maximum number of revisions to display. 920version-controlled directory tree (RCS, SCCS, and CVS do not support
945RCS, SCCS, and CVS do not support this feature. 921this feature). With a prefix argument, the command prompts for the
946 922maximum number of revisions to display.
947 On a distributed version control system, the @kbd{C-x v I} 923
924 The @kbd{C-x v L} history is shown in a compact form, usually
925showing only the first line of each log entry. However, you can type
926@key{RET} (@code{log-view-toggle-entry-display}) in the
927@samp{*vc-change-log*} buffer to reveal the entire log entry for the
928revision at point. A second @key{RET} hides it again.
929
930 On a decentralized version control system, the @kbd{C-x v I}
948(@code{vc-log-incoming}) command displays a log buffer showing the 931(@code{vc-log-incoming}) command displays a log buffer showing the
949changes that will be applied, the next time you run the version 932changes that will be applied, the next time you run the version
950control system's ``pull'' command to get new revisions from another 933control system's ``pull'' command to get new revisions from another
951repository. This other repository is the default one from which 934repository (@pxref{VC Pull}). This other repository is the default
952changes are pulled, as defined by the version control system; with a 935one from which changes are pulled, as defined by the version control
953prefix argument, @code{vc-log-incoming} prompts for a specific 936system; with a prefix argument, @code{vc-log-incoming} prompts for a
954repository from which changes would be pulled, and lists the changes 937specific repository. Similarly, @kbd{C-x v O}
955accordingly. Similarly, @kbd{C-x v O} (@code{vc-log-outgoing}) shows 938(@code{vc-log-outgoing}) shows the changes that will be sent to
956the changes that will be sent to another repository, the next time you 939another repository, the next time you run the ``push'' command; with a
957run the ``push'' command; with a prefix argument, it prompts for a 940prefix argument, it prompts for a specific destination repository.
958specific repository to which changes would be pushed.
959 941
960 In the @samp{*vc-change-log*} buffer, you can use the following keys 942 In the @samp{*vc-change-log*} buffer, you can use the following keys
961to move between the logs of revisions and of files, to view past 943to move between the logs of revisions and of files, and to examine and
962revisions, to modify change comments, to view annotations and to view 944compare past revisions (@pxref{Old Revisions}):
963diffs:
964 945
965@table @kbd 946@table @kbd
966@item p 947@item p
967Move to the previous revision-item in the buffer. (Revision entries in the log 948Move to the previous revision entry. (Revision entries in the log
968buffer are usually in reverse-chronological order, so the previous 949buffer are usually in reverse-chronological order, so the previous
969revision-item usually corresponds to a newer revision.) A numeric 950revision-item usually corresponds to a newer revision.) A numeric
970prefix argument is a repeat count. 951prefix argument is a repeat count.
971 952
972@item n 953@item n
973Move to the next revision-item (which most often corresponds to the 954Move to the next revision entry. A numeric prefix argument is a
974previous revision of the file). A numeric prefix argument is a repeat 955repeat count.
975count.
976 956
977@item P 957@item P
978Move to the log of the previous file, when the logs of multiple files 958Move to the log of the previous file, if showing logs for a multi-file
979are in the log buffer (@pxref{VC Directory Mode}). Otherwise, just 959VC fileset. Otherwise, just move to the beginning of the log. A
980move to the beginning of the log. A numeric prefix argument is a 960numeric prefix argument is a repeat count.
981repeat count, so @kbd{C-u 10 P} would move backward 10 files.
982 961
983@item N 962@item N
984Move to the log of the next file, when the logs of multiple files are 963Move to the log of the next file, if showing logs for a multi-file VC
985in the log buffer (@pxref{VC Directory Mode}). It also takes a 964fileset. A numeric prefix argument is a repeat count.
986numeric prefix argument as a repeat count.
987 965
988@item a 966@item a
989Annotate the revision indicated by the current line. 967Annotate the revision on the current line (@pxref{Old Revisions}).
990 968
991@item e 969@item e
992Modify the change comment displayed at point. Note that not all VC 970Modify the change comment displayed at point. Note that not all VC
993systems support modifying change comments. 971systems support modifying change comments.
994 972
995@item f 973@item f
996Visit the revision indicated at the current line, like typing @kbd{C-x 974Visit the revision indicated at the current line.
997v ~} and specifying this revision's ID (@pxref{Old Revisions}).
998 975
999@item d 976@item d
1000Display the diff (@pxref{Comparing Files}) between the revision 977Display a diff between the revision at point and the next earlier
1001indicated at the current line and the next earlier revision. This is 978revision, for the specific file.
1002useful to see what actually changed in the file when the revision
1003indicated on the current line was committed.
1004 979
1005@item D 980@item D
1006Display the changeset diff (@pxref{Comparing Files}) between the 981Display the changeset diff between the revision at point and the next
1007revision indicated at the current line and the next earlier revision. 982earlier revision. This shows the changes to all files made in that
1008This is useful to see all the changes to all files that the revision 983revision.
1009indicated on the current line did when it was committed. 984
985@item @key{RET}
986In a compact-style log buffer (e.g.@: the one created by @kbd{C-x v
987L}), toggle between showing and hiding the full log entry for the
988revision at point.
1010@end table 989@end table
1011 990
1012@vindex vc-log-show-limit 991@vindex vc-log-show-limit
@@ -1020,62 +999,71 @@ entries} or @samp{Show unlimited entries} buttons at the end of the
1020buffer. However, RCS, SCCS, and CVS do not support this feature. 999buffer. However, RCS, SCCS, and CVS do not support this feature.
1021 1000
1022@node VC Undo 1001@node VC Undo
1023@subsubsection Undoing Version Control Actions 1002@subsection Undoing Version Control Actions
1024 1003
1025@table @kbd 1004@table @kbd
1026@item C-x v u 1005@item C-x v u
1027Revert the buffer and the file to the working revision from which you started 1006Revert the work file(s) in the current VC fileset to the last revision
1028editing the file. 1007(@code{vc-revert}).
1029
1030@item C-x v c
1031Remove the last-entered change from the master for the visited file.
1032This undoes your last check-in.
1033@end table 1008@end table
1034 1009
1010@c `C-x v c' (vc-rollback) was removed, since it's RCS/SCCS specific.
1011
1035@kindex C-x v u 1012@kindex C-x v u
1036@findex vc-revert-buffer 1013@findex vc-revert
1037 If you want to discard your current set of changes and revert to the 1014@vindex vc-revert-show-diff
1038working revision from which you started editing the file, use @kbd{C-x 1015 If you want to discard all the changes you have made to the current
1039v u} (@code{vc-revert-buffer}). If the version control system is 1016VC fileset, type @kbd{C-x v u} (@code{vc-revert-buffer}). This shows
1040locking-based, this leaves the file unlocked, and you must lock it 1017you a diff between the work file(s) and the revision from which you
1041again before making new changes. @kbd{C-x v u} requires confirmation, 1018started editing, and asks for confirmation for discarding the changes.
1042unless it sees that you haven't made any changes with respect to the 1019If you agree, the fileset is reverted. If you don't want @kbd{C-x v
1043master copy of the working revision. 1020u} to show a diff, set the variable @code{vc-revert-show-diff} to
1044 1021@code{nil} (you can still view the diff directly with @kbd{C-x v =};
1045 @kbd{C-x v u} is also the command to unlock a file if you lock it and 1022@pxref{Old Revisions}). Note that @kbd{C-x v u} cannot be reversed
1046then decide not to change it. 1023with the usual undo commands (@pxref{Undo}), so use it with care.
1047 1024
1048@kindex C-x v c 1025 On locking-based version control systems, @kbd{C-x v u} leaves files
1049@findex vc-rollback 1026unlocked; you must lock again to resume editing. You can also use
1050 To cancel a change that you already committed, use @kbd{C-x v c} 1027@kbd{C-x v u} to unlock a file if you lock it and then decide not to
1051(@code{vc-rollback}). This command discards all record of the most 1028change it.
1052recent checked-in revision, but only if your work file corresponds to
1053that revision---you cannot use @kbd{C-x v c} to cancel a revision that
1054is not the latest on its branch. Note that many version control
1055systems do not support rollback at all; this command is something of a
1056historical relic.
1057 1029
1058@node VC Directory Mode 1030@node VC Directory Mode
1059@subsection VC Directory Mode 1031@subsection VC Directory Mode
1060 1032
1033@cindex VC Directory buffer
1034 The @dfn{VC Directory buffer} is a specialized buffer for viewing
1035the version control statuses of the files in a directory tree, and
1036performing version control operations on those files. In particular,
1037it is used to specify multi-file VC filesets for commands like
1038@w{@kbd{C-x v v}} to act on (@pxref{VC Directory Commands}).
1039
1061@kindex C-x v d 1040@kindex C-x v d
1062@findex vc-dir 1041@findex vc-dir
1063 When you are working on a large program, it is often useful to find 1042 To use the VC Directory buffer, type @kbd{C-x v d} (@code{vc-dir}).
1064out which files have changed within an entire directory tree, or to 1043This reads a directory name using the minibuffer, and switches to a VC
1065view the status of all files under version control at once, and to 1044Directory buffer for that directory. By default, the buffer is named
1066perform version control operations on collections of files. You can 1045@samp{*vc-dir*}. Its contents are described
1067use the command @kbd{C-x v d} (@code{vc-dir}) to make a directory 1046@iftex
1068listing that includes only files relevant for version control. This 1047below.
1069creates a @dfn{VC Directory buffer} and displays it in a separate 1048@end iftex
1070window. 1049@ifnottex
1050in @ref{VC Directory Buffer}.
1051@end ifnottex
1052
1053 The @code{vc-dir} command automatically detects the version control
1054system to be used in the specified directory. In the event that more
1055than one system is being used in the directory, you should invoke the
1056command with a prefix argument, @kbd{C-u C-x v d}; this prompts for
1057the version control system which the VC Directory buffer should use.
1071 1058
1059@ifnottex
1072@cindex PCL-CVS 1060@cindex PCL-CVS
1073@pindex cvs 1061@pindex cvs
1074@cindex CVS directory mode 1062@cindex CVS directory mode
1075 The VC Directory buffer works with all the version control systems 1063 In addition to the VC Directory buffer, Emacs has a similar facility
1076that VC supports. For CVS, Emacs also offers a more powerful facility 1064called PCL-CVS which is specialized for CVS. @xref{Top, , About
1077called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The 1065PCL-CVS, pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
1078Emacs Front-End to CVS}. 1066@end ifnottex
1079 1067
1080@menu 1068@menu
1081* Buffer: VC Directory Buffer. What the buffer looks like and means. 1069* Buffer: VC Directory Buffer. What the buffer looks like and means.
@@ -1086,369 +1074,367 @@ Emacs Front-End to CVS}.
1086@subsubsection The VC Directory Buffer 1074@subsubsection The VC Directory Buffer
1087 1075
1088 The VC Directory buffer contains a list of version-controlled files 1076 The VC Directory buffer contains a list of version-controlled files
1089in the current directory and its subdirectories. Files which are 1077and their version control statuses. It lists files in the current
1090up-to-date (have no local differences from the repository copy) are 1078directory (the one specified when you called @kbd{C-x v d}) and its
1091usually hidden; if all files in a subdirectory are up-to-date, the 1079subdirectories, but only those with a ``noteworthy'' status. Files
1092subdirectory is hidden as well. There is an exception to this rule: 1080that are up-to-date (i.e.@: the same as in the repository) are
1093if VC mode detects that a file has changed to an up-to-date state 1081omitted. If all the files in a subdirectory are up-to-date, the
1094since you last looked at it, that file and its state are shown. 1082subdirectory is not listed either. As an exception, if a file has
1095 1083become up-to-date as a direct result of a VC command, it is listed.
1096 If a directory uses more that one version control system, you can 1084
1097select which system to use for the @code{vc-dir} command by invoking 1085 Here is an example of a VC Directory buffer listing:
1098@code{vc-dir} with a prefix argument: @kbd{C-u C-x v d}.
1099
1100 The line for an individual file shows the version control state of
1101the file. Under RCS and SCCS, the name of the user locking the file
1102is shown; under CVS, an abbreviated version of the @samp{cvs status}
1103output is used. Here is an example using CVS:
1104 1086
1105@smallexample 1087@smallexample
1106@group 1088@group
1107 ./ 1089 ./
1108 modified file1.c 1090 edited configure.ac
1109 needs-update file2.c 1091* added README
1110 needs-merge file3.c 1092 unregistered temp.txt
1093 src/
1094* edited src/main.c
1111@end group 1095@end group
1112@end smallexample 1096@end smallexample
1113 1097
1114@noindent 1098@noindent
1115In this example, @samp{file1.c} is modified with respect to the 1099Two work files have been modified but not committed:
1116repository, and @samp{file2.c} is not. @samp{file3.c} is modified, 1100@file{configure.ac} in the current directory, and @file{foo.c} in the
1117but other changes have also been committed---you need to merge them 1101@file{src/} subdirectory. The file named @file{README} has been added
1118with the work file before you can check it in. 1102but is not yet committed, while @file{temp.txt} is not under version
1119 1103control (@pxref{Registering}).
1120@vindex vc-stay-local 1104
1121@vindex vc-cvs-stay-local 1105The @samp{*} characters next to the entries for @file{README} and
1122 In the above, if the repository were on a remote machine, VC only 1106@file{src/main.c} indicate that the user has marked out these files as
1123contacts it when the variable @code{vc-stay-local} (or 1107the current VC fileset
1124@code{vc-cvs-stay-local}) is @code{nil}
1125@iftex 1108@iftex
1126(@pxref{CVS Options,,,emacs-xtra, Specialized Emacs Features}). 1109(see below).
1127@end iftex 1110@end iftex
1128@ifnottex 1111@ifnottex
1129(@pxref{CVS Options}). 1112(@pxref{VC Directory Commands}).
1113@end ifnottex
1114
1115 The above example is typical for a decentralized version control
1116system like Bazaar, Git, or Mercurial. Other systems can show other
1117statuses. For instance, CVS shows the @samp{needs-update} status if
1118the repository has changes that have not been applied to the work
1119file. RCS and SCCS show the name of the user locking a file as its
1120status.
1121
1122@ifnottex
1123@vindex vc-stay-local
1124@vindex vc-cvs-stay-local
1125 On CVS and Subversion, the @code{vc-dir} command normally contacts
1126the repository, which may be on a remote machine, to check for
1127updates. If you change the variable @code{vc-stay-local} or
1128@code{vc-cvs-stay-local} (for CVS) to @code{nil} (@pxref{CVS
1129Options}), then Emacs avoids contacting a remote repository when
1130generating the VC Directory buffer (it will still contact it when
1131necessary, e.g.@: when doing a commit). This may be desirable if you
1132are working offline or the network is slow.
1130@end ifnottex 1133@end ifnottex
1131This is because access to the repository may be slow, or you may be
1132working offline and not have access to the repository at all. As a
1133consequence, VC would not be able to tell you that @samp{file3.c} is
1134in the ``merge'' state; you would learn that only when you try to
1135check-in your modified copy of the file, or use a command such as
1136@kbd{C-x v m}.
1137
1138 In practice, this is not a problem because CVS handles this case
1139consistently whenever it arises. In VC, you'll simply get prompted to
1140merge the remote changes into your work file first. The benefits of
1141less network communication usually outweigh the disadvantage of not
1142seeing remote changes immediately.
1143 1134
1144@vindex vc-directory-exclusion-list 1135@vindex vc-directory-exclusion-list
1145 When a VC directory displays subdirectories it omits some that 1136 The VC Directory buffer omits subdirectories listed in the variable
1146should never contain any files under version control. By default, 1137@code{vc-directory-exclusion-list}. Its default value contains
1147this includes Version Control subdirectories such as @samp{RCS} and 1138directories that are used internally by version control systems.
1148@samp{CVS}; you can customize this by setting the variable
1149@code{vc-directory-exclusion-list}.
1150 1139
1151@node VC Directory Commands 1140@node VC Directory Commands
1152@subsubsection VC Directory Commands 1141@subsubsection VC Directory Commands
1153 1142
1154 VC Directory mode has a full set of navigation and marking commands 1143 Emacs provides several commands for navigating the VC Directory
1155for picking out filesets. Some of these are also available in a 1144buffer, and for ``marking'' files as belonging to the current VC
1156context menu invoked by @kbd{mouse-2}. 1145fileset.
1157 1146
1158 Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also 1147@table @kbd
1159move vertically as in other list-browsing modes. @key{SPC} and 1148@item n
1160@key{TAB} behave like down-arrow, and @key{BackTab} behaves like 1149@itemx @key{SPC}
1161up-arrow. 1150Move point to the next entry (@code{vc-dir-next-line}).
1162 1151
1163 Both @kbd{C-m} and @kbd{f} visit the file on the current 1152@item p
1164line. @kbd{o} visits that file in another window. @kbd{q} dismisses 1153Move point to the previous entry (@code{vc-dir-previous-line}).
1165the directory buffer.
1166 1154
1167 @kbd{x} hides up-to-date files. 1155@item @key{TAB}
1156Move to the next directory entry (@code{vc-dir-next-directory}).
1168 1157
1169 @kbd{m} marks the file or directory on the current line. If the 1158@item S-@key{TAB}
1170region is active, @kbd{m} marks all the files in the region. There 1159Move to the previous directory entry
1171are some restrictions when marking: a file cannot be marked if any of 1160(@code{vc-dir-previous-directory}).
1172its parent directories are marked, and a directory cannot be marked if
1173any files in it or in its child directories are marked.
1174 1161
1175 @kbd{M} marks all the files with the same VC state as the current 1162@item @key{RET}
1176file if the cursor is on a file. If the cursor is on a directory, it 1163@itemx f
1177marks all child files. With a prefix argument: marks all files and 1164Visit the file or directory listed on the current line
1178directories. 1165(@code{vc-dir-find-file}).
1179 1166
1180 @kbd{u} unmarks the file or directory on the current line. If the 1167@item o
1181region is active, it unmarks all the files in the region. 1168Visit the file or directory on the current line, in a separate window
1169(@code{vc-dir-find-file-other-window}).
1182 1170
1183 @kbd{U} marks all the files with the same VC state as the current file 1171@item m
1184if the cursor is on a file. If the cursor is on a directory, it 1172Mark the file or directory on the current line (@code{vc-dir-mark}),
1185unmarks all child files. With a prefix argument: unmarks all marked 1173putting it in the current VC fileset. If the region is active, mark
1174all files in the region.
1175
1176A file cannot be marked with this command if it is already in a marked
1177directory, or one of its subdirectories. Similarly, a directory
1178cannot be marked with this command if any file in its tree is marked.
1179
1180@item M
1181If point is on a file entry, mark all files with the same status; if
1182point is on a directory entry, mark all files in that directory tree
1183(@code{vc-dir-mark-all-files}). With a prefix argument, mark all
1184listed files and directories.
1185
1186@kindex q @r{(VC Directory)}
1187@findex quit-window
1188@item q
1189Bury the VC Directory buffer, and delete its window if the window was
1190created just for that buffer.
1191
1192@item u
1193Unmark the file or directory on the current line. If the region is
1194active, unmark all the files in the region (@code{vc-dir-unmark}).
1195
1196@item U
1197If point is on a file entry, unmark all files with the same status; if
1198point is on a directory entry, unmark all files in that directory tree
1199(@code{vc-dir-unmark-all-files}). With a prefix argument, unmark all
1186files and directories. 1200files and directories.
1187 1201
1188 It is possible to do search, search and replace, incremental search, 1202@item x
1189and incremental regexp search on multiple files. These commands will 1203Hide files with @samp{up-to-date} status
1190work on all the marked files or the current file if nothing is marked. 1204(@code{vc-dir-hide-up-to-date}).
1191If a directory is marked, the files in that directory shown in the VC
1192directory buffer will be used.
1193 1205
1194 @kbd{S} searches the marked files. 1206@item q
1207Quit the VC Directory buffer, and bury it (@code{quit-window}).
1208@end table
1195 1209
1196 @kbd{Q} does a query replace on the marked files. 1210@findex vc-dir-mark
1211@findex vc-dir-mark-all-files
1212 While in the VC Directory buffer, all the files that you mark with
1213@kbd{m} (@code{vc-dir-mark}) or @kbd{M} (@code{vc-dir-mark}) are in
1214the current VC fileset. If you mark a directory entry with @kbd{m},
1215all the listed files in that directory tree are in the current VC
1216fileset. The files and directories that belong to the current VC
1217fileset are indicated with a @samp{*} character in the VC Directory
1218buffer, next to their VC status. In this way, you can set up a
1219multi-file VC fileset to be acted on by VC commands like @w{@kbd{C-x v
1220v}} (@pxref{Basic VC Editing}), @w{@kbd{C-x v =}} (@pxref{Old
1221Revisions}), and @w{@kbd{C-x v u}} (@pxref{VC Undo}).
1222
1223 The VC Directory buffer also defines some single-key shortcuts for
1224VC commands with the @kbd{C-x v} prefix: @kbd{=}, @kbd{+}, @kbd{l},
1225@kbd{i}, and @kbd{v}.
1226
1227 For example, you can commit a set of edited files by opening a VC
1228Directory buffer, where the files are listed with the @samp{edited}
1229status; marking the files; and typing @kbd{v} or @kbd{C-x v v}
1230(@code{vc-next-action}). If the version control system is
1231changeset-based, Emacs will commit the files in a single revision.
1232
1233 While in the VC Directory buffer, you can also perform search and
1234replace on the current VC fileset, with the following commands:
1197 1235
1198 @kbd{M-s a C-s} does an incremental search on the marked files. 1236@table @kbd
1237@item S
1238Search the fileset (@code{vc-dir-search}).
1199 1239
1200 @kbd{M-s a C-M-s} does an incremental regular expression search 1240@item Q
1201on the marked files. 1241Do a regular expression query replace on the fileset
1242(@code{vc-dir-query-replace-regexp}).
1243
1244@item M-s a C-s
1245Do an incremental search on the fileset (@code{vc-dir-isearch}).
1246
1247@item M-s a C-M-s
1248Do an incremental regular expression search on the fileset
1249(@code{vc-dir-isearch-regexp}).
1250@end table
1251
1252@noindent
1253Apart from acting on multiple files, these commands behave much like
1254their single-buffer counterparts (@pxref{Search}).
1202 1255
1203@cindex stashes in version control 1256@cindex stashes in version control
1204@cindex shelves in version control 1257@cindex shelves in version control
1205 Commands are also accessible from the VC-dir menu. Note that some 1258 The above commands are also available via the menu bar, and via a
1206VC backends use the VC-dir menu to make available extra, 1259context menu invoked by @kbd{Mouse-2}. Furthermore, some VC backends
1207backend-specific, commands. For example, Git and Bazaar allow you to 1260use the menu to provide extra backend-specific commands. For example,
1208manipulate @dfn{stashes} and @dfn{shelves}. (These provide a 1261Git and Bazaar allow you to manipulate @dfn{stashes} and @dfn{shelves}
1209mechanism to temporarily store uncommitted changes somewhere out of 1262(where are a way to temporarily put aside uncommitted changes, and
1210the way, and bring them back at a later time.) 1263bring them back at a later time).
1211
1212 Normal VC commands with the @kbd{C-x v} prefix work in VC directory
1213buffers. Some single-key shortcuts are available as well; @kbd{=},
1214@kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with
1215@kbd{C-x v}.
1216
1217 The command @kbd{C-x v v} (@code{vc-next-action}) operates on all
1218the marked files, so that you can commit several files at once. If
1219the underlying VC supports atomic commits of multiple-file changesets,
1220@kbd{C-x v v} with a selected set of modified but not committed files
1221will commit all of them at once as a single changeset.
1222
1223 When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple
1224files, all of those files must be either in the same state or in
1225compatible states (added, modified and removed states are considered
1226compatible). Otherwise it signals an error. This differs from the
1227behavior of older versions of VC, which did not have fileset
1228operations and simply did @code{vc-next-action} on each file
1229individually.
1230
1231 If any files are in a state that calls for commit, @kbd{C-x v v} reads a
1232single log entry and uses it for the changeset as a whole. If the
1233underling VCS is file- rather than changeset-oriented, the log entry
1234will be replicated into the history of each file.
1235 1264
1236@node Branches 1265@node Branches
1237@subsection Multiple Branches of a File 1266@subsection Version Control Branches
1238@cindex branch (version control) 1267@cindex branch (version control)
1239@cindex trunk (version control) 1268
1240 1269 One use of version control is to support multiple independent lines
1241 One use of version control is to maintain multiple ``current'' 1270of development, which are called @dfn{branches}. Branches are used
1242revisions of a file. For example, you might have different revisions of a 1271for maintaining separate ``stable'' and ``development'' versions of a
1243program in which you are gradually adding various unfinished new 1272program, and for developing unrelated features in isolation from one
1244features. Each such independent line of development is called a 1273another.
1245@dfn{branch}. VC allows you to create branches, switch between 1274
1246different branches, and merge changes from one branch to another. 1275 VC's support for branch operations is currently fairly limited. For
1247Please note, however, that branches are not supported for SCCS. 1276decentralized version control systems, it provides commands for
1248 1277@dfn{updating} one branch with the contents of another, and for
1249 A file's main line of development is usually called the @dfn{trunk}. 1278@dfn{merging} the changes made to two different branches
1250You can create multiple branches from the trunk. How the difference 1279(@pxref{Merging}). For centralized version control systems, it
1251between trunk and branch is made visible is dependent on whether the 1280supports checking out different branches and committing into new or
1252VCS uses dot-pair or monotonic version IDs. 1281different branches.
1253
1254 In VCSes with dot-pair revision IDs, the revisions on the trunk are
1255normally IDed 1.1, 1.2, 1.3, etc. At any such revision, you can
1256start an independent branch. A branch starting at revision 1.2 would
1257have revision ID 1.2.1.1, and consecutive revisions on this branch
1258would have IDs 1.2.1.2, 1.2.1.3, 1.2.1.4, and so on. If there is
1259a second branch also starting at revision 1.2, it would consist of
1260revisions 1.2.2.1, 1.2.2.2, 1.2.2.3, etc.
1261
1262 In VCSes with monotonic revision IDs, trunk revisions are IDed as
12631, 2, 3, etc. A branch from (say) revision 2 might start with 2.1 and
1264continue through 2.2, 2.3, etc. But naming conventions for branches
1265and subbranches vary widely on these systems, and some (like
1266Mercurial) never depart from the monotonic integer sequence at all.
1267Consult the documentation of the VCS you are using.
1268
1269@cindex head revision
1270 If you omit the final component of a dot-pair revision ID, that is called a
1271@dfn{branch ID}. It refers to the highest existing revision on that
1272branch---the @dfn{head revision} of that branch. The branches in the
1273dot-pair example above have branch IDs 1.2.1 and 1.2.2.
1274 1282
1275@menu 1283@menu
1276* Switching Branches:: How to get to another existing branch. 1284* Switching Branches:: How to get to another existing branch.
1277* Creating Branches:: How to start a new branch. 1285* VC Pull:: Updating the contents of a branch.
1278* Merging:: Transferring changes between branches. 1286* Merging:: Transferring changes between branches.
1279* Multi-User Branching:: Multiple users working at multiple branches 1287* Creating Branches:: How to start a new branch.
1280 in parallel.
1281@end menu 1288@end menu
1282 1289
1283@node Switching Branches 1290@node Switching Branches
1284@subsubsection Switching between Branches 1291@subsubsection Switching between Branches
1285 1292
1286 To switch between branches, type @kbd{C-u C-x v v} and specify the 1293 The various version control systems differ in how branches are
1287revision ID you want to select. On a locking-based system, this 1294implemented, and these differences cannot be entirely concealed by VC.
1288version is then visited @emph{unlocked} (write-protected), so you can 1295
1289examine it before locking it. Switching branches in this way is allowed 1296 On some decentralized version control systems, including Bazaar and
1290only when the file is not locked. 1297Mercurial in its normal mode of operation, each branch has its own
1291 1298working directory tree, so switching between branches just involves
1292 On a VCS with dot-pair IDs, you can omit the minor part, thus giving 1299switching directories. On Git, switching between branches is done
1293only the branch ID; this takes you to the head version on the 1300using the @command{git branch} command, which changes the contents of
1294chosen branch. If you only type @key{RET}, Emacs goes to the highest 1301the working tree itself.
1295version on the trunk. 1302
1303 On centralized version control systems, you can switch between
1304branches by typing @kbd{C-u C-x v v} in an up-to-date work file
1305(@pxref{Advanced C-x v v}), and entering the revision ID for a
1306revision on another branch. On CVS, for instance, revisions on the
1307@dfn{trunk} (the main line of development) normally have IDs of the
1308form 1.1, 1.2, 1.3, @dots{}, while the first branch created from (say)
1309revision 1.2 has revision IDs 1.2.1.1, 1.2.1.2, @dots{}, the second
1310branch created from revision 1.2 has revision IDs 1.2.2.1, 1.2.2.2,
1311@dots{}, and so forth. You can also specify the @dfn{branch ID},
1312which is a branch revision ID omitting its final component
1313(e.g.@: 1.2.1), to switch to the latest revision on that branch.
1314
1315 On a locking-based system, switching to a different branch also
1316unlocks (write-protects) the working tree.
1317
1318 Once you have switched to a branch, VC commands will apply to that
1319branch until you switch away; for instance, any VC filesets that you
1320commit will be committed to that specific branch.
1321
1322@node VC Pull
1323@subsubsection Pulling Changes into a Branch
1296 1324
1297 After you have switched to any branch (including the main branch), you 1325@table @kbd
1298stay on it for subsequent VC commands, until you explicitly select some 1326@itemx C-x v +
1299other branch. 1327On a decentralized version control system, update the current branch
1328by ``pulling in'' changes from another location.
1300 1329
1301@node Creating Branches 1330On a centralized version control system, update the current VC
1302@subsubsection Creating New Branches 1331fileset.
1332@end table
1303 1333
1304 To create a new branch from a head revision (one that is the latest 1334@kindex C-x v +
1305in the branch that contains it), first select that revision if 1335@findex vc-pull
1306necessary, lock it with @kbd{C-x v v}, and make whatever changes you 1336 On a decentralized version control system, the command @kbd{C-x v +}
1307want. Then, when you commit the changes, use @kbd{C-u C-x v v}. This 1337(@code{vc-pull}) updates the current branch and working tree. It is
1308lets you specify the revision ID for the new revision. You should 1338typically used to update a copy of a remote branch. If you supply a
1309specify a suitable branch ID for a branch starting at the current 1339prefix argument, the command prompts for the exact version control
1310revision. For example, if the current revision is 2.5, the branch ID 1340command to use, which lets you specify where to pull changes from.
1311should be 2.5.1, 2.5.2, and so on, depending on the number of existing 1341Otherwise, it pulls from a default location determined by the version
1312branches at that point. 1342control system.
1313
1314 To create a new branch at an older revision (one that is no longer the
1315head of a branch), first select that revision (@pxref{Switching
1316Branches}). Your procedure will then differ depending on whether you
1317are using a locking or merging-based VCS.
1318 1343
1319 On a locking VCS, you will need to lock the old revision branch with 1344 Amongst decentralized version control systems, @kbd{C-x v +} is
1320@kbd{C-x v v}. You'll be asked to confirm, when you lock the old 1345currently supported only by Bazaar, Git, and Mercurial. On Bazaar, it
1321revision, that you really mean to create a new branch---if you say no, 1346calls @command{bzr pull} for ordinary branches (to pull from a master
1322you'll be offered a chance to lock the latest revision instead. On 1347branch into a mirroring branch), and @command{bzr update} for a bound
1323a merging-based VCS you will skip this step. 1348branch (to pull from a central repository). On Git, it calls
1349@command{git pull} to fetch changes from a remote repository and merge
1350it into the current branch. On Mercurial, it calls @command{hg pull
1351-u} to fetch changesets from the default remote repository and update
1352the working directory.
1324 1353
1325 Then make your changes and type @kbd{C-x v v} again to commit a new 1354 Prior to pulling, you can use @kbd{C-x v I} (@code{vc-log-incoming})
1326revision. This automatically creates a new branch starting from the 1355to view a log buffer of the changes to be applied. @xref{VC Change
1327selected revision. You need not specially request a new branch, 1356Log}.
1328because that's the only way to add a new revision at a point that is
1329not the head of a branch.
1330 1357
1331 After the branch is created, you ``stay'' on it. That means that 1358 On a centralized version control system like CVS, @kbd{C-x v +}
1332subsequent check-ins create new revisions on that branch. To leave the 1359updates the current VC fileset from the repository.
1333branch, you must explicitly select a different revision with @kbd{C-u C-x
1334v v}. To transfer changes from one branch to another, use the merge
1335command, described in the next section.
1336 1360
1337@node Merging 1361@node Merging
1338@subsubsection Merging Branches 1362@subsubsection Merging Branches
1339
1340@cindex merging changes 1363@cindex merging changes
1341 When you have finished the changes on a certain branch, you will
1342often want to incorporate them into the file's main line of development
1343(the trunk). This is not a trivial operation, because development might
1344also have proceeded on the trunk, so that you must @dfn{merge} the
1345changes into a file that has already been changed otherwise. VC allows
1346you to do this (and other things) with the @code{vc-merge} command.
1347 1364
1348@table @kbd 1365@table @kbd
1349@item C-x v m (vc-merge) 1366@itemx C-x v m
1350Merge changes into the work file. 1367On a decentralized version control system, merge changes from another
1368branch into the current one.
1369
1370On a centralized version control system, merge changes from another
1371branch into the current VC fileset.
1351@end table 1372@end table
1352 1373
1353@kindex C-x v m 1374 While developing a branch, you may sometimes need to @dfn{merge} in
1354@findex vc-merge 1375changes that have already been made in another branch. This is not a
1355 @kbd{C-x v m} (@code{vc-merge}) takes a set of changes and merges it 1376trivial operation, as overlapping changes may have been made to the
1356into the current version of the work file. It firsts asks you in the 1377two branches.
1357minibuffer where the changes should come from. If you just type 1378
1358@key{RET}, Emacs merges any changes that were made on the same branch 1379 On a decentralized version control system, merging is done with the
1359since you checked the file out (we call this @dfn{merging the news}). 1380command @kbd{C-x v m} (@code{vc-merge}). On Bazaar, this prompts for
1360This is the common way to pick up recent changes from the repository, 1381the exact arguments to pass to @command{bzr merge}, offering a
1361regardless of whether you have already changed the file yourself. 1382sensible default if possible. On Git, this prompts for the name of a
1362 1383branch to merge from, with completion (based on the branch names known
1363 You can also enter a branch ID or a pair of revision IDs in 1384to the current repository). The output from running the merge command
1364the minibuffer. Then @kbd{C-x v m} finds the changes from that 1385is shown in a separate buffer.
1365branch, or the differences between the two revisions you specified, and 1386
1366merges them into the current revision of the current file. 1387 On a centralized version control system like CVS, @kbd{C-x v m}
1367 1388prompts for a branch ID, or a pair of revision IDs (@pxref{Switching
1368 As an example, suppose that you have finished a certain feature on 1389Branches}); then it finds the changes from that branch, or the changes
1369branch 1.3.1. In the meantime, development on the trunk has proceeded 1390between the two revisions you specified, and merges those changes into
1370to revision 1.5. To merge the changes from the branch to the trunk, 1391the current VC fileset. If you just type @key{RET}, Emacs simply
1371first go to the head revision of the trunk, by typing @kbd{C-u C-x v v 1392merges any changes that were made on the same branch since you checked
1372@key{RET}}. Revision 1.5 is now current. If locking is used for the file, 1393the file out.
1373type @kbd{C-x v v} to lock revision 1.5 so that you can change it. Next,
1374type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on
1375branch 1.3.1 (relative to revision 1.3, where the branch started, up to
1376the last revision on the branch) and merges it into the current revision
1377of the work file. You can now commit the changed file, thus creating
1378revision 1.6 containing the changes from the branch.
1379
1380 It is possible to do further editing after merging the branch, before
1381the next check-in. But it is usually wiser to commit the merged
1382revision, then lock it and make the further changes. This will keep
1383a better record of the history of changes.
1384 1394
1385@cindex conflicts 1395@cindex conflicts
1386@cindex resolving conflicts 1396@cindex resolving conflicts
1387 When you merge changes into a file that has itself been modified, the 1397 Immediately after performing a merge, only the working tree is
1388changes might overlap. We call this situation a @dfn{conflict}, and 1398modified, and you can review the changes produced by the merge with
1389reconciling the conflicting changes is called @dfn{resolving a 1399@kbd{C-x v D} and related commands (@pxref{Old Revisions}). If the
1390conflict}. 1400two branches contained overlapping changes, merging produces a
1391 1401@dfn{conflict}; a warning appears in the output of the merge command,
1392 Whenever conflicts occur during merging, VC detects them, tells you 1402and @dfn{conflict markers} are inserted into each affected work file,
1393about them in the echo area, and asks whether you want help in merging. 1403surrounding the two sets of conflicting changes. You must then
1394If you say yes, it starts an Ediff session (@pxref{Top, 1404resolve the conflict by editing the conflicted files. Once you are
1395Ediff, Ediff, ediff, The Ediff Manual}). 1405done, the modified files must be committed in the usual way for the
1396 1406merge to take effect (@pxref{Basic VC Editing}).
1397 If you say no, the conflicting changes are both inserted into the
1398file, surrounded by @dfn{conflict markers}. The example below shows how
1399a conflict region looks; the file is called @samp{name} and the current
1400master file revision with user B's changes in it is 1.11.
1401
1402@c @w here is so CVS won't think this is a conflict.
1403@smallexample
1404@group
1405@w{<}<<<<<< name
1406 @var{User A's version}
1407=======
1408 @var{User B's version}
1409@w{>}>>>>>> 1.11
1410@end group
1411@end smallexample
1412 1407
1413@findex vc-resolve-conflicts 1408@node Creating Branches
1414 Then you can resolve the conflicts by editing the file manually. Or 1409@subsubsection Creating New Branches
1415you can type @code{M-x vc-resolve-conflicts} after visiting the file. 1410
1416This starts an Ediff session, as described above. Don't forget to 1411 On centralized version control systems like CVS, Emacs supports
1417commit the merged version afterwards. 1412creating new branches as part of a commit operation. When committing
1418 1413a modified VC fileset, type @kbd{C-u C-x v v} (@code{vc-next-action}
1419@findex vc-find-conflicted-file 1414with a prefix argument; @pxref{Advanced C-x v v}). Then Emacs prompts
1420 If there is more than one conflicted file in a merge, type @kbd{M-x 1415for a revision ID for the new revision. You should specify a suitable
1421vc-find-conflicted-file} after resolving the conflicts in each file. 1416branch ID for a branch starting at the current revision. For example,
1422This command visits the next conflicted file, and moves point to the 1417if the current revision is 2.5, the branch ID should be 2.5.1, 2.5.2,
1423first conflict marker in that file. 1418and so on, depending on the number of existing branches at that point.
1424 1419
1425@node Multi-User Branching 1420 To create a new branch at an older revision (one that is no longer
1426@subsubsection Multi-User Branching 1421the head of a branch), first select that revision (@pxref{Switching
1427 1422Branches}). Your procedure will then differ depending on whether you
1428 It is often useful for multiple developers to work simultaneously on 1423are using a locking or merging-based VCS.
1429different branches of a file. CVS and later systems allow this by 1424
1430default; for RCS, it is possible if you create multiple source 1425 On a locking VCS, you will need to lock the old revision branch with
1431directories. Each source directory should have a link named 1426@kbd{C-x v v}. You'll be asked to confirm, when you lock the old
1432@file{RCS} which points to a common directory of RCS master files. 1427revision, that you really mean to create a new branch---if you say no,
1433Then each source directory can have its own choice of selected 1428you'll be offered a chance to lock the latest revision instead. On a
1434revisions, but all share the same common RCS records. 1429merging-based VCS you will skip this step.
1435 1430
1436 This technique works reliably and automatically, provided that the 1431 Then make your changes and type @kbd{C-x v v} again to commit a new
1437source files contain RCS version headers 1432revision. This creates a new branch starting from the selected
1438@iftex 1433revision.
1439(@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
1440@end iftex
1441@ifnottex
1442(@pxref{Version Headers}).
1443@end ifnottex
1444The headers enable Emacs to be sure, at all times, which revision
1445ID is present in the work file.
1446 1434
1447 If the files do not have version headers, you must instead tell Emacs 1435 After the branch is created, subsequent commits create new revisions
1448explicitly in each session which branch you are working on. To do this, 1436on that branch. To leave the branch, you must explicitly select a
1449first find the file, then type @kbd{C-u C-x v v} and specify the correct 1437different revision with @kbd{C-u C-x v v}.
1450branch ID. This ensures that Emacs knows which branch it is using
1451during this particular editing session.
1452 1438
1453@ifnottex 1439@ifnottex
1454@include vc1-xtra.texi 1440@include vc1-xtra.texi
@@ -1458,13 +1444,11 @@ during this particular editing session.
1458@section Change Logs 1444@section Change Logs
1459 1445
1460@cindex change log 1446@cindex change log
1461 A change log file contains a chronological record of when and why you 1447 Many software projects keep a @dfn{change log}. This is a file,
1462have changed a program, consisting of a sequence of entries describing 1448normally named @file{ChangeLog}, containing a chronological record of
1463individual changes. Normally it is kept in a file called 1449when and how the program was changed. Sometimes, there are several
1464@file{ChangeLog} in the same directory as the file you are editing, or 1450change log files, each recording the changes in one directory or
1465one of its parent directories. A single @file{ChangeLog} file can 1451directory tree.
1466record changes for all the files in its directory and all its
1467subdirectories.
1468 1452
1469@menu 1453@menu
1470* Change Log Commands:: Commands for editing change log files. 1454* Change Log Commands:: Commands for editing change log files.
@@ -1496,7 +1480,7 @@ rather than starting a new item.
1496 1480
1497You can combine multiple changes of the same nature. If you don't 1481You can combine multiple changes of the same nature. If you don't
1498enter any text after the initial @kbd{C-x 4 a}, any subsequent 1482enter any text after the initial @kbd{C-x 4 a}, any subsequent
1499@kbd{C-x 4 a} adds another symbol to the change. 1483@kbd{C-x 4 a} adds another symbol to the change log entry.
1500 1484
1501@vindex add-log-always-start-new-record 1485@vindex add-log-always-start-new-record
1502 If @code{add-log-always-start-new-record} is non-@code{nil}, 1486 If @code{add-log-always-start-new-record} is non-@code{nil},
@@ -1534,15 +1518,7 @@ ordering of entries.
1534 Version control systems are another way to keep track of changes in 1518 Version control systems are another way to keep track of changes in
1535your program and keep a change log. In the VC log buffer, typing 1519your program and keep a change log. In the VC log buffer, typing
1536@kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant 1520@kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant
1537Change Log entry, if one exists (@pxref{Log Buffer}). You can also 1521Change Log entry, if one exists. @xref{Log Buffer}.
1538insert a VC log entry into a Change Log buffer by typing @kbd{C-x v a}
1539(@code{vc-update-change-log}) in the Change Log buffer
1540@iftex
1541(@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}).
1542@end iftex
1543@ifnottex
1544(@pxref{Change Logs and VC}).
1545@end ifnottex
1546 1522
1547@node Format of ChangeLog 1523@node Format of ChangeLog
1548@subsection Format of ChangeLog 1524@subsection Format of ChangeLog
@@ -1597,8 +1573,8 @@ Of course, you should substitute the proper years and copyright holder.
1597@cindex tags and tag tables 1573@cindex tags and tag tables
1598 1574
1599 A @dfn{tag} is a reference to a subunit in a program or in a 1575 A @dfn{tag} is a reference to a subunit in a program or in a
1600document. In program source code, tags reference syntactic elements 1576document. In source code, tags reference syntactic elements of the
1601of the program: functions, subroutines, data types, macros, etc. In a 1577program: functions, subroutines, data types, macros, etc. In a
1602document, tags reference chapters, sections, appendices, etc. Each 1578document, tags reference chapters, sections, appendices, etc. Each
1603tag specifies the name of the file where the corresponding subunit is 1579tag specifies the name of the file where the corresponding subunit is
1604defined, and the position of the subunit's definition in that file. 1580defined, and the position of the subunit's definition in that file.
@@ -1612,34 +1588,36 @@ a Yacc parser, or from Lex scanner definitions; @file{.i} preprocessed
1612C files; and Fortran files produced by preprocessing @file{.fpp} 1588C files; and Fortran files produced by preprocessing @file{.fpp}
1613source files. 1589source files.
1614 1590
1615 To produce a tags table, you use the @samp{etags} command, 1591@cindex etags
1616submitting it a document or the source code of a program. 1592 To produce a tags table, you run the @command{etags} shell command
1617@samp{etags} writes the tags to a @dfn{tags table file}, or @dfn{tags 1593on a document or the source code file. The @samp{etags} program
1618file} in short. The conventional name for a tags file is @file{TAGS}. 1594writes the tags to a @dfn{tags table file}, or @dfn{tags file} in
1595short. The conventional name for a tags file is @file{TAGS}.
1596@xref{Create Tags Table}.
1619 1597
1620 Emacs uses the information recorded in tags tables in commands that 1598 Emacs provides many commands for searching and replacing using the
1621search or replace through multiple source files: these commands use 1599information recorded in tags tables. For instance, the @kbd{M-.}
1622the names of the source files recorded in the tags table to know which 1600(@code{find-tag}) jumps to the location of a specified function
1623files to search. Other commands, such as @kbd{M-.}, which finds the 1601definition in its source file. @xref{Find Tag}.
1624definition of a function, use the recorded information about the
1625function names and positions to find the source file and the position
1626within that file where the function is defined.
1627 1602
1628@cindex C++ class browser, tags 1603@cindex C++ class browser, tags
1629@cindex tags, C++ 1604@cindex tags, C++
1630@cindex class browser, C++ 1605@cindex class browser, C++
1631@cindex Ebrowse 1606@cindex Ebrowse
1632 See also the Ebrowse facility, which is tailored for C++. 1607 The Ebrowse facility is similar to @command{etags} but specifically
1633@xref{Top,, Ebrowse, ebrowse, Ebrowse User's Manual}. 1608tailored for C++. @xref{Top,, Ebrowse, ebrowse, Ebrowse User's
1609Manual}. The Semantic package provides another way to generate and
1610use tags, separate from the @command{etags} facility.
1611@xref{Semantic}.
1634 1612
1635@menu 1613@menu
1636* Tag Syntax:: Tag syntax for various types of code and text files. 1614* Tag Syntax:: Tag syntax for various types of code and text files.
1637* Create Tags Table:: Creating a tags table with @code{etags}. 1615* Create Tags Table:: Creating a tags table with @command{etags}.
1638* Etags Regexps:: Create arbitrary tags using regular expressions. 1616* Etags Regexps:: Create arbitrary tags using regular expressions.
1639* Select Tags Table:: How to visit a tags table. 1617* Select Tags Table:: How to visit a tags table.
1640* Find Tag:: Commands to find the definition of a specific tag. 1618* Find Tag:: Commands to find the definition of a specific tag.
1641* Tags Search:: Using a tags table for searching and replacing. 1619* Tags Search:: Using a tags table for searching and replacing.
1642* List Tags:: Listing and finding tags defined in a file. 1620* List Tags:: Using tags for completion, and listing them.
1643@end menu 1621@end menu
1644 1622
1645@node Tag Syntax 1623@node Tag Syntax
@@ -1661,7 +1639,7 @@ and @samp{--no-members} can make the tags table file much smaller.
1661 1639
1662You can tag function declarations and external variables in addition 1640You can tag function declarations and external variables in addition
1663to function definitions by giving the @samp{--declarations} option to 1641to function definitions by giving the @samp{--declarations} option to
1664@code{etags}. 1642@command{etags}.
1665 1643
1666@item 1644@item
1667In C++ code, in addition to all the tag constructs of C code, member 1645In C++ code, in addition to all the tag constructs of C code, member
@@ -1678,15 +1656,15 @@ Tags for variables and functions in classes are named
1678@samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}. 1656@samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}.
1679 1657
1680@item 1658@item
1681In La@TeX{} text, the argument of any of the commands @code{\chapter}, 1659In La@TeX{} documents, the arguments for @code{\chapter},
1682@code{\section}, @code{\subsection}, @code{\subsubsection}, 1660@code{\section}, @code{\subsection}, @code{\subsubsection},
1683@code{\eqno}, @code{\label}, @code{\ref}, @code{\cite}, 1661@code{\eqno}, @code{\label}, @code{\ref}, @code{\cite},
1684@code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry}, 1662@code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry},
1685@code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand}, 1663@code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand},
1686@code{\newenvironment} or @code{\renewenvironment} is a tag.@refill 1664@code{\newenvironment} and @code{\renewenvironment} are tags.
1687 1665
1688Other commands can make tags as well, if you specify them in the 1666Other commands can make tags as well, if you specify them in the
1689environment variable @env{TEXTAGS} before invoking @code{etags}. The 1667environment variable @env{TEXTAGS} before invoking @command{etags}. The
1690value of this environment variable should be a colon-separated list of 1668value of this environment variable should be a colon-separated list of
1691command names. For example, 1669command names. For example,
1692 1670
@@ -1818,9 +1796,9 @@ Regexps}) to handle other formats and languages.
1818 1796
1819@node Create Tags Table 1797@node Create Tags Table
1820@subsection Creating Tags Tables 1798@subsection Creating Tags Tables
1821@cindex @code{etags} program 1799@cindex @command{etags} program
1822 1800
1823 The @code{etags} program is used to create a tags table file. It knows 1801 The @command{etags} program is used to create a tags table file. It knows
1824the syntax of several languages, as described in 1802the syntax of several languages, as described in
1825@iftex 1803@iftex
1826the previous section. 1804the previous section.
@@ -1828,58 +1806,51 @@ the previous section.
1828@ifnottex 1806@ifnottex
1829@ref{Tag Syntax}. 1807@ref{Tag Syntax}.
1830@end ifnottex 1808@end ifnottex
1831Here is how to run @code{etags}: 1809Here is how to run @command{etags}:
1832 1810
1833@example 1811@example
1834etags @var{inputfiles}@dots{} 1812etags @var{inputfiles}@dots{}
1835@end example 1813@end example
1836 1814
1837@noindent 1815@noindent
1838The @code{etags} program reads the specified files, and writes a tags 1816The @command{etags} program reads the specified files, and writes a tags
1839table named @file{TAGS} in the current working directory. You can 1817table named @file{TAGS} in the current working directory. You can
1840optionally specify a different file name for the tags table by using the 1818optionally specify a different file name for the tags table by using the
1841@samp{--output=@var{file}} option; specifying @file{-} as a file name 1819@samp{--output=@var{file}} option; specifying @file{-} as a file name
1842prints the tags table to standard output. 1820prints the tags table to standard output.
1843 1821
1844 If the specified files don't exist, @code{etags} looks for 1822 If the specified files don't exist, @command{etags} looks for
1845compressed versions of them and uncompresses them to read them. Under 1823compressed versions of them and uncompresses them to read them. Under
1846MS-DOS, @code{etags} also looks for file names like @file{mycode.cgz} 1824MS-DOS, @command{etags} also looks for file names like @file{mycode.cgz}
1847if it is given @samp{mycode.c} on the command line and @file{mycode.c} 1825if it is given @samp{mycode.c} on the command line and @file{mycode.c}
1848does not exist. 1826does not exist.
1849 1827
1850 @code{etags} recognizes the language used in an input file based on 1828 If the tags table becomes outdated due to changes in the files
1851its file name and contents. You can specify the language with the 1829described in it, you can update it by running the @command{etags}
1852@samp{--language=@var{name}} option, described below. 1830program again. If the tags table does not record a tag, or records it
1853 1831for the wrong file, then Emacs will not be able to find that
1854 If the tags table data become outdated due to changes in the files 1832definition until you update the tags table. But if the position
1855described in the table, the way to update the tags table is the same 1833recorded in the tags table becomes a little bit wrong (due to other
1856way it was made in the first place. If the tags table fails to record 1834editing), Emacs will still be able to find the right position, with a
1857a tag, or records it for the wrong file, then Emacs cannot possibly 1835slight delay.
1858find its definition until you update the tags table. However, if the
1859position recorded in the tags table becomes a little bit wrong (due to
1860other editing), the worst consequence is a slight delay in finding the
1861tag. Even if the stored position is very far wrong, Emacs will still
1862find the tag, after searching most of the file for it. That delay is
1863hardly noticeable with today's computers.
1864 1836
1865 Thus, there is no need to update the tags table after each edit. 1837 Thus, there is no need to update the tags table after each edit.
1866You should update a tags table when you define new tags that you want 1838You should update a tags table when you define new tags that you want
1867to have listed, or when you move tag definitions from one file to 1839to have listed, or when you move tag definitions from one file to
1868another, or when changes become substantial. 1840another, or when changes become substantial.
1869 1841
1870 One tags table can virtually include another. Specify the included 1842 You can make a tags table @dfn{include} another tags table, by
1871tags file name with the @samp{--include=@var{file}} option when 1843passing the @samp{--include=@var{file}} option to @command{etags}. It
1872creating the file that is to include it. The latter file then acts as 1844then covers all the files covered by the included tags file, as well
1873if it covered all the source files specified in the included file, as 1845as its own.
1874well as the files it directly contains.
1875 1846
1876 If you specify the source files with relative file names when you run 1847 If you specify the source files with relative file names when you run
1877@code{etags}, the tags file will contain file names relative to the 1848@command{etags}, the tags file will contain file names relative to the
1878directory where the tags file was initially written. This way, you can 1849directory where the tags file was initially written. This way, you can
1879move an entire directory tree containing both the tags file and the 1850move an entire directory tree containing both the tags file and the
1880source files, and the tags file will still refer correctly to the source 1851source files, and the tags file will still refer correctly to the source
1881files. If the tags file is @file{-} or is in the @file{/dev} directory, 1852files. If the tags file is @file{-} or is in the @file{/dev} directory,
1882however, the file names are 1853however, the file names are
1883made relative to the current working directory. This is useful, for 1854made relative to the current working directory. This is useful, for
1884example, when writing the tags to @file{/dev/stdout}. 1855example, when writing the tags to @file{/dev/stdout}.
1885 1856
@@ -1887,40 +1858,41 @@ example, when writing the tags to @file{/dev/stdout}.
1887pointing to a tags file in a different directory, because this would 1858pointing to a tags file in a different directory, because this would
1888generally render the file names invalid. 1859generally render the file names invalid.
1889 1860
1890 If you specify absolute file names as arguments to @code{etags}, then 1861 If you specify absolute file names as arguments to @command{etags}, then
1891the tags file will contain absolute file names. This way, the tags file 1862the tags file will contain absolute file names. This way, the tags file
1892will still refer to the same files even if you move it, as long as the 1863will still refer to the same files even if you move it, as long as the
1893source files remain in the same place. Absolute file names start with 1864source files remain in the same place. Absolute file names start with
1894@samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows. 1865@samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows.
1895 1866
1896 When you want to make a tags table from a great number of files, you 1867 When you want to make a tags table from a great number of files,
1897may have problems listing them on the command line, because some systems 1868you may have problems listing them on the command line, because some
1898have a limit on its length. The simplest way to circumvent this limit 1869systems have a limit on its length. You can circumvent this limit by
1899is to tell @code{etags} to read the file names from its standard input, 1870telling @command{etags} to read the file names from its standard
1900by typing a dash in place of the file names, like this: 1871input, by typing a dash in place of the file names, like this:
1901 1872
1902@smallexample 1873@smallexample
1903find . -name "*.[chCH]" -print | etags - 1874find . -name "*.[chCH]" -print | etags -
1904@end smallexample 1875@end smallexample
1905 1876
1906 Use the option @samp{--language=@var{name}} to specify the language 1877 @command{etags} recognizes the language used in an input file based
1907explicitly. You can intermix these options with file names; each one 1878on its file name and contents. You can specify the language
1908applies to the file names that follow it. Specify 1879explicitly with the @samp{--language=@var{name}} option. You can
1909@samp{--language=auto} to tell @code{etags} to resume guessing the 1880intermix these options with file names; each one applies to the file
1910language from the file names and file contents. Specify 1881names that follow it. Specify @samp{--language=auto} to tell
1911@samp{--language=none} to turn off language-specific processing 1882@command{etags} to resume guessing the language from the file names
1912entirely; then @code{etags} recognizes tags by regexp matching alone 1883and file contents. Specify @samp{--language=none} to turn off
1913(@pxref{Etags Regexps}). 1884language-specific processing entirely; then @command{etags} recognizes
1885tags by regexp matching alone (@pxref{Etags Regexps}).
1914 1886
1915 The option @samp{--parse-stdin=@var{file}} is mostly useful when 1887 The option @samp{--parse-stdin=@var{file}} is mostly useful when
1916calling @code{etags} from programs. It can be used (only once) in 1888calling @command{etags} from programs. It can be used (only once) in
1917place of a file name on the command line. @code{Etags} will read from 1889place of a file name on the command line. @command{etags} will read from
1918standard input and mark the produced tags as belonging to the file 1890standard input and mark the produced tags as belonging to the file
1919@var{file}. 1891@var{file}.
1920 1892
1921 @samp{etags --help} outputs the list of the languages @code{etags} 1893 @samp{etags --help} outputs the list of the languages @command{etags}
1922knows, and the file name rules for guessing the language. It also prints 1894knows, and the file name rules for guessing the language. It also prints
1923a list of all the available @code{etags} options, together with a short 1895a list of all the available @command{etags} options, together with a short
1924explanation. If followed by one or more @samp{--language=@var{lang}} 1896explanation. If followed by one or more @samp{--language=@var{lang}}
1925options, it outputs detailed information about how tags are generated for 1897options, it outputs detailed information about how tags are generated for
1926@var{lang}. 1898@var{lang}.
@@ -1928,21 +1900,22 @@ options, it outputs detailed information about how tags are generated for
1928@node Etags Regexps 1900@node Etags Regexps
1929@subsection Etags Regexps 1901@subsection Etags Regexps
1930 1902
1931 The @samp{--regex} option provides a general way of recognizing tags 1903 The @samp{--regex} option to @command{etags} allows tags to be
1932based on regexp matching. You can freely intermix this option with 1904recognized by regular expression matching. You can intermix this
1933file names, and each one applies to the source files that follow it. 1905option with file names; each one applies to the source files that
1934If you specify multiple @samp{--regex} options, all of them are used 1906follow it. If you specify multiple @samp{--regex} options, all of
1935in parallel. The syntax is: 1907them are used in parallel. The syntax is:
1936 1908
1937@smallexample 1909@smallexample
1938--regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers} 1910--regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers}
1939@end smallexample 1911@end smallexample
1940 1912
1941 The essential part of the option value is @var{tagregexp}, the 1913@noindent
1942regexp for matching tags. It is always used anchored, that is, it 1914The essential part of the option value is @var{tagregexp}, the regexp
1943only matches at the beginning of a line. If you want to allow 1915for matching tags. It is always used anchored, that is, it only
1944indented tags, use a regexp that matches initial whitespace; start it 1916matches at the beginning of a line. If you want to allow indented
1945with @samp{[ \t]*}. 1917tags, use a regexp that matches initial whitespace; start it with
1918@samp{[ \t]*}.
1946 1919
1947 In these regular expressions, @samp{\} quotes the next character, and 1920 In these regular expressions, @samp{\} quotes the next character, and
1948all the GCC character escape sequences are supported (@samp{\a} for 1921all the GCC character escape sequences are supported (@samp{\a} for
@@ -1959,7 +1932,7 @@ completion on tag names more reliably. You can find some examples
1959below. 1932below.
1960 1933
1961 The @var{modifiers} are a sequence of zero or more characters that 1934 The @var{modifiers} are a sequence of zero or more characters that
1962modify the way @code{etags} does the matching. A regexp with no 1935modify the way @command{etags} does the matching. A regexp with no
1963modifiers is applied sequentially to each line of the input file, in a 1936modifiers is applied sequentially to each line of the input file, in a
1964case-sensitive way. The modifiers and their meanings are: 1937case-sensitive way. The modifiers and their meanings are:
1965 1938
@@ -1984,22 +1957,22 @@ etags --regex=/@var{reg1}/i voo.doo --regex=/@var{reg2}/m \
1984@end smallexample 1957@end smallexample
1985 1958
1986@noindent 1959@noindent
1987Here @code{etags} chooses the parsing language for @file{voo.doo} and 1960Here @command{etags} chooses the parsing language for @file{voo.doo} and
1988@file{bar.ber} according to their contents. @code{etags} also uses 1961@file{bar.ber} according to their contents. @command{etags} also uses
1989@var{reg1} to recognize additional tags in @file{voo.doo}, and both 1962@var{reg1} to recognize additional tags in @file{voo.doo}, and both
1990@var{reg1} and @var{reg2} to recognize additional tags in 1963@var{reg1} and @var{reg2} to recognize additional tags in
1991@file{bar.ber}. @var{reg1} is checked against each line of 1964@file{bar.ber}. @var{reg1} is checked against each line of
1992@file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while 1965@file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while
1993@var{reg2} is checked against the whole @file{bar.ber} file, 1966@var{reg2} is checked against the whole @file{bar.ber} file,
1994permitting multi-line matches, in a case-sensitive way. @code{etags} 1967permitting multi-line matches, in a case-sensitive way. @command{etags}
1995uses only the Lisp tags rules, with no user-specified regexp matching, 1968uses only the Lisp tags rules, with no user-specified regexp matching,
1996to recognize tags in @file{los.er}. 1969to recognize tags in @file{los.er}.
1997 1970
1998 You can restrict a @samp{--regex} option to match only files of a 1971 You can restrict a @samp{--regex} option to match only files of a
1999given language by using the optional prefix @var{@{language@}}. 1972given language by using the optional prefix @var{@{language@}}.
2000(@samp{etags --help} prints the list of languages recognized by 1973(@samp{etags --help} prints the list of languages recognized by
2001@code{etags}.) This is particularly useful when storing many 1974@command{etags}.) This is particularly useful when storing many
2002predefined regular expressions for @code{etags} in a file. The 1975predefined regular expressions for @command{etags} in a file. The
2003following example tags the @code{DEFVAR} macros in the Emacs source 1976following example tags the @code{DEFVAR} macros in the Emacs source
2004files, for the C language only: 1977files, for the C language only:
2005 1978
@@ -2009,7 +1982,7 @@ files, for the C language only:
2009 1982
2010@noindent 1983@noindent
2011When you have complex regular expressions, you can store the list of 1984When you have complex regular expressions, you can store the list of
2012them in a file. The following option syntax instructs @code{etags} to 1985them in a file. The following option syntax instructs @command{etags} to
2013read two files of regular expressions. The regular expressions 1986read two files of regular expressions. The regular expressions
2014contained in the second file are matched without regard to case. 1987contained in the second file are matched without regard to case.
2015 1988
@@ -2018,9 +1991,9 @@ contained in the second file are matched without regard to case.
2018@end smallexample 1991@end smallexample
2019 1992
2020@noindent 1993@noindent
2021A regex file for @code{etags} contains one regular expression per 1994A regex file for @command{etags} contains one regular expression per
2022line. Empty lines, and lines beginning with space or tab are ignored. 1995line. Empty lines, and lines beginning with space or tab are ignored.
2023When the first character in a line is @samp{@@}, @code{etags} assumes 1996When the first character in a line is @samp{@@}, @command{etags} assumes
2024that the rest of the line is the name of another file of regular 1997that the rest of the line is the name of another file of regular
2025expressions; thus, one such file can include another file. All the 1998expressions; thus, one such file can include another file. All the
2026other lines are taken to be regular expressions. If the first 1999other lines are taken to be regular expressions. If the first
@@ -2083,14 +2056,14 @@ etags --language=none \
2083@node Select Tags Table 2056@node Select Tags Table
2084@subsection Selecting a Tags Table 2057@subsection Selecting a Tags Table
2085 2058
2086@vindex tags-file-name
2087@findex visit-tags-table 2059@findex visit-tags-table
2088 Emacs has at any time one @dfn{selected} tags table, and all the 2060 Emacs has at any time one @dfn{selected} tags table. All the
2089commands for working with tags tables use the selected one. To select 2061commands for working with tags tables use the selected one. To select
2090a tags table, type @kbd{M-x visit-tags-table}, which reads the tags 2062a tags table, type @kbd{M-x visit-tags-table}, which reads the tags
2091table file name as an argument, with @file{TAGS} in the default 2063table file name as an argument, with @file{TAGS} in the default
2092directory as the default. 2064directory as the default.
2093 2065
2066@vindex tags-file-name
2094 Emacs does not actually read in the tags table contents until you 2067 Emacs does not actually read in the tags table contents until you
2095try to use them; all @code{visit-tags-table} does is store the file 2068try to use them; all @code{visit-tags-table} does is store the file
2096name in the variable @code{tags-file-name}, and setting the variable 2069name in the variable @code{tags-file-name}, and setting the variable
@@ -2154,27 +2127,25 @@ Pop back to where you previously invoked @kbd{M-.} and friends.
2154 2127
2155@kindex M-. 2128@kindex M-.
2156@findex find-tag 2129@findex find-tag
2157 @kbd{M-.}@: (@code{find-tag}) is the command to find the definition of 2130 @kbd{M-.}@: (@code{find-tag}) prompts for a tag name and jumps to
2158a specified tag. It searches through the tags table for that tag, as a 2131its source definition. It works by searching through the tags table
2159string, and then uses the tags table info to determine the file that the 2132for that tag's file and approximate character position, visiting that
2160definition is in and the approximate character position in the file of 2133file, and searching for the tag definition at ever-increasing
2161the definition. Then @code{find-tag} visits that file, moves point to 2134distances away from the recorded approximate position.
2162the approximate character position, and searches ever-increasing 2135
2163distances away to find the tag definition. 2136 When entering the tag argument to @kbd{M-.}, the usual minibuffer
2164 2137completion commands can be used (@pxref{Completion}), with the tag
2165 If an empty argument is given (just type @key{RET}), the balanced 2138names in the selected tags table as completion candidates. If you
2166expression in the buffer before or around point is used as the 2139specify an empty argument, the balanced expression in the buffer
2167@var{tag} argument. @xref{Expressions}. 2140before or around point is the default argument. @xref{Expressions}.
2168 2141
2169 You don't need to give @kbd{M-.} the full name of the tag; a part 2142 You don't need to give @kbd{M-.} the full name of the tag; a part
2170will do. This is because @kbd{M-.} finds tags in the table which 2143will do. @kbd{M-.} finds tags which contain that argument as a
2171contain @var{tag} as a substring. However, it prefers an exact match 2144substring. However, it prefers an exact match to a substring match.
2172to a substring match. To find other tags that match the same 2145To find other tags that match the same substring, give @code{find-tag}
2173substring, give @code{find-tag} a numeric argument, as in @kbd{C-u 2146a numeric argument, as in @kbd{C-u M-.} or @kbd{M-0 M-.}; this does
2174M-.}; this does not read a tag name, but continues searching the tags 2147not read a tag name, but continues searching the tags table's text for
2175table's text for another tag containing the same substring last used. 2148another tag containing the same substring last used.
2176If you have a real @key{META} key, @kbd{M-0 M-.}@: is an easier
2177alternative to @kbd{C-u M-.}.
2178 2149
2179@kindex C-x 4 . 2150@kindex C-x 4 .
2180@findex find-tag-other-window 2151@findex find-tag-other-window
@@ -2182,23 +2153,23 @@ alternative to @kbd{C-u M-.}.
2182@findex find-tag-other-frame 2153@findex find-tag-other-frame
2183 Like most commands that can switch buffers, @code{find-tag} has a 2154 Like most commands that can switch buffers, @code{find-tag} has a
2184variant that displays the new buffer in another window, and one that 2155variant that displays the new buffer in another window, and one that
2185makes a new frame for it. The former is @w{@kbd{C-x 4 .}}, which invokes 2156makes a new frame for it. The former is @w{@kbd{C-x 4 .}}
2186the command @code{find-tag-other-window}. The latter is @w{@kbd{C-x 5 .}}, 2157(@code{find-tag-other-window}), and the latter is @w{@kbd{C-x 5 .}}
2187which invokes @code{find-tag-other-frame}. 2158(@code{find-tag-other-frame}).
2188 2159
2189 To move back to places you've found tags recently, use @kbd{C-u - 2160 To move back to previous tag definitions, use @kbd{C-u - M-.}; more
2190M-.}; more generally, @kbd{M-.} with a negative numeric argument. This 2161generally, @kbd{M-.} with a negative numeric argument. Similarly,
2191command can take you to another buffer. @w{@kbd{C-x 4 .}} with a negative 2162@w{@kbd{C-x 4 .}} with a negative argument finds the previous tag
2192argument finds the previous tag location in another window. 2163location in another window.
2193 2164
2194@kindex M-* 2165@kindex M-*
2195@findex pop-tag-mark 2166@findex pop-tag-mark
2196@vindex find-tag-marker-ring-length 2167@vindex find-tag-marker-ring-length
2197 As well as going back to places you've found tags recently, you can go 2168 As well as going back to places you've found tags recently, you can
2198back to places @emph{from where} you found them. Use @kbd{M-*}, which 2169go back to places @emph{from where} you found them, using @kbd{M-*}
2199invokes the command @code{pop-tag-mark}, for this. Typically you would 2170(@code{pop-tag-mark}). Thus you can find and examine the definition
2200find and study the definition of something with @kbd{M-.} and then 2171of something with @kbd{M-.} and then return to where you were with
2201return to where you were with @kbd{M-*}. 2172@kbd{M-*}.
2202 2173
2203 Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to 2174 Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to
2204a depth determined by the variable @code{find-tag-marker-ring-length}. 2175a depth determined by the variable @code{find-tag-marker-ring-length}.
@@ -2242,10 +2213,10 @@ can follow its progress. As soon as it finds an occurrence,
2242 2213
2243@kindex M-, 2214@kindex M-,
2244@findex tags-loop-continue 2215@findex tags-loop-continue
2245 Having found one match, you probably want to find all the rest. To find 2216 Having found one match, you probably want to find all the rest.
2246one more match, type @kbd{M-,} (@code{tags-loop-continue}) to resume the 2217Type @kbd{M-,} (@code{tags-loop-continue}) to resume the
2247@code{tags-search}. This searches the rest of the current buffer, followed 2218@code{tags-search}, finding one more match. This searches the rest of
2248by the remaining files of the tags table.@refill 2219the current buffer, followed by the remaining files of the tags table.
2249 2220
2250@findex tags-query-replace 2221@findex tags-query-replace
2251 @kbd{M-x tags-query-replace} performs a single 2222 @kbd{M-x tags-query-replace} performs a single
@@ -2282,56 +2253,56 @@ have to search (those which are not already visited in Emacs buffers).
2282Buffers in which no match is found are quickly killed; the others 2253Buffers in which no match is found are quickly killed; the others
2283continue to exist. 2254continue to exist.
2284 2255
2285 It may have struck you that @code{tags-search} is a lot like 2256 As an alternative to @code{tags-search}, you can run @command{grep}
2286@code{grep}. You can also run @code{grep} itself as an inferior of 2257as a subprocess and have Emacs show you the matching lines one by one.
2287Emacs and have Emacs show you the matching lines one by one.
2288@xref{Grep Searching}. 2258@xref{Grep Searching}.
2289 2259
2290@node List Tags 2260@node List Tags
2291@subsection Tags Table Inquiries 2261@subsection Tags Table Inquiries
2292 2262
2293@table @kbd 2263@table @kbd
2264@item C-M-i
2265@itemx M-@key{TAB}
2266Perform completion on the text around point, using the selected tags
2267table if one is loaded (@code{completion-at-point}).
2294@item M-x list-tags @key{RET} @var{file} @key{RET} 2268@item M-x list-tags @key{RET} @var{file} @key{RET}
2295Display a list of the tags defined in the program file @var{file}. 2269Display a list of the tags defined in the program file @var{file}.
2296@item M-x tags-apropos @key{RET} @var{regexp} @key{RET} 2270@item M-x tags-apropos @key{RET} @var{regexp} @key{RET}
2297Display a list of all tags matching @var{regexp}. 2271Display a list of all tags matching @var{regexp}.
2298@end table 2272@end table
2299 2273
2274@cindex completion (symbol names)
2275 In most programming language modes, you can type @kbd{C-M-i} or
2276@kbd{M-@key{TAB}} (@code{completion-at-point}) to complete the symbol
2277at point. If there is a selected tags table, this command can use it
2278to generate completion candidates. @xref{Symbol Completion}.
2279
2300@findex list-tags 2280@findex list-tags
2301 @kbd{M-x list-tags} reads the name of one of the files described by 2281 @kbd{M-x list-tags} reads the name of one of the files covered by
2302the selected tags table, and displays a list of all the tags defined in 2282the selected tags table, and displays a list of tags defined in that
2303that file. The ``file name'' argument is really just a string to 2283file. Do not include a directory as part of the file name unless the
2304compare against the file names recorded in the tags table; it is read as 2284file name recorded in the tags table includes a directory.
2305a string rather than as a file name. Therefore, completion and
2306defaulting are not available, and you must enter the file name the same
2307way it appears in the tags table. Do not include a directory as part of
2308the file name unless the file name recorded in the tags table includes a
2309directory.
2310 2285
2311@findex tags-apropos 2286@findex tags-apropos
2312@vindex tags-apropos-verbose 2287@vindex tags-apropos-verbose
2313 @kbd{M-x tags-apropos} is like @code{apropos} for tags
2314(@pxref{Apropos}). It finds all the tags in the selected tags table
2315whose entries match @var{regexp}, and displays them. If the variable
2316@code{tags-apropos-verbose} is non-@code{nil}, it displays the names
2317of the tags files together with the tag names.
2318
2319@vindex tags-tag-face 2288@vindex tags-tag-face
2320@vindex tags-apropos-additional-actions 2289@vindex tags-apropos-additional-actions
2321 You can customize the appearance of the output by setting the 2290 @kbd{M-x tags-apropos} is like @code{apropos} for tags
2322variable @code{tags-tag-face} to a face. You can display additional 2291(@pxref{Apropos}). It displays a list of tags in the selected tags
2323output with @kbd{M-x tags-apropos} by customizing the variable 2292table whose entries match @var{regexp}. If the variable
2324@code{tags-apropos-additional-actions}---see its documentation for 2293@code{tags-apropos-verbose} is non-@code{nil}, it displays the names
2325details. 2294of the tags files together with the tag names. You can customize the
2326 2295appearance of the output by setting the variable @code{tags-tag-face}
2327 You can also use the collection of tag names to complete a symbol 2296to a face. You can display additional output by customizing the
2328name in the buffer. @xref{Symbol Completion}. 2297variable @code{tags-apropos-additional-actions}; see its documentation
2329 2298for details.
2330 You can use @kbd{M-x next-file} to visit the files in the selected 2299
2331tags table. The first time this command is called, it visits the 2300@findex next-file
2332first file in the tags table. Each subsequent call visits the next 2301 @kbd{M-x next-file} visits files covered by the selected tags table.
2333file in the table, unless a prefix argument is supplied, in which case 2302The first time it is called, it visits the first file covered by the
2334it returns to the first file. 2303table. Each subsequent call visits the next covered file, unless a
2304prefix argument is supplied, in which case it returns to the first
2305file.
2335 2306
2336@node EDE 2307@node EDE
2337@section Emacs Development Environment 2308@section Emacs Development Environment
diff --git a/doc/emacs/msdog.texi b/doc/emacs/msdog.texi
index e3c9b8d4fc2..547d8cbadd9 100644
--- a/doc/emacs/msdog.texi
+++ b/doc/emacs/msdog.texi
@@ -863,15 +863,22 @@ fontconfig library used in modern Free desktops:
863 863
864 The old XLFD based format is also supported for backwards compatibility. 864 The old XLFD based format is also supported for backwards compatibility.
865 865
866 Emacs 23 supports a number of backends. Currently, the @code{gdi} 866@cindex font backend selection (MS-Windows)
867and @code{uniscribe} font backends are supported on Windows. The 867 Emacs 23 and later supports a number of font backends. Currently,
868@code{gdi} font backend is available on all versions of Windows, and 868the @code{gdi} and @code{uniscribe} backends are supported on Windows.
869supports all fonts that are natively supported by Windows. The 869The @code{gdi} font backend is available on all versions of Windows,
870and supports all fonts that are natively supported by Windows. The
870@code{uniscribe} font backend is available on Windows 2000 and later, 871@code{uniscribe} font backend is available on Windows 2000 and later,
871and supports TrueType and OpenType fonts. Some languages requiring 872and supports TrueType and OpenType fonts. Some languages requiring
872complex layout can only be properly supported by the uniscribe 873complex layout can only be properly supported by the Uniscribe
873backend. By default, both backends are enabled if supported, with 874backend. By default, both backends are enabled if supported, with
874@code{uniscribe} taking priority over @code{gdi}. 875@code{uniscribe} taking priority over @code{gdi}. To override that
876and use the GDI backend even if Uniscribe is available, invoke Emacs
877with the @kbd{-xrm Emacs.fontBackend:gdi} command-line argument, or
878add a @code{Emacs.fontBackend} resource with the value @code{gdi} in
879the Registry under either the
880@samp{HKEY_CURRENT_USER\SOFTWARE\GNU\Emacs} or the
881@samp{HKEY_LOCAL_MACHINE\SOFTWARE\GNU\Emacs} key (@pxref{Resources}).
875 882
876@cindex font properties (MS Windows) 883@cindex font properties (MS Windows)
877@noindent 884@noindent
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 675977c2c35..7301ecfea8a 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -8,8 +8,8 @@
8@cindex C editing 8@cindex C editing
9@cindex program editing 9@cindex program editing
10 10
11 Emacs provides many features to facilitate editing programs. Some 11 This chapter describes Emacs features for facilitating editing
12of these features can 12programs. Some of these features can:
13 13
14@itemize @bullet 14@itemize @bullet
15@item 15@item
@@ -25,8 +25,6 @@ Insert, kill or align comments (@pxref{Comments}).
25Highlight program syntax (@pxref{Font Lock}). 25Highlight program syntax (@pxref{Font Lock}).
26@end itemize 26@end itemize
27 27
28 This chapter describes these features and many more.
29
30@menu 28@menu
31* Program Modes:: Major modes for editing programs. 29* Program Modes:: Major modes for editing programs.
32* Defuns:: Commands to operate on major top-level parts 30* Defuns:: Commands to operate on major top-level parts
@@ -40,8 +38,8 @@ Highlight program syntax (@pxref{Font Lock}).
40* Glasses:: Making identifiersLikeThis more readable. 38* Glasses:: Making identifiersLikeThis more readable.
41* Semantic:: Suite of editing tools based on source code parsing. 39* Semantic:: Suite of editing tools based on source code parsing.
42* Misc for Programs:: Other Emacs features useful for editing programs. 40* Misc for Programs:: Other Emacs features useful for editing programs.
43* C Modes:: Special commands of C, C++, Objective-C, 41* C Modes:: Special commands of C, C++, Objective-C, Java,
44 Java, and Pike modes. 42 IDL, Pike and AWK modes.
45* Asm Mode:: Asm mode and its special features. 43* Asm Mode:: Asm mode and its special features.
46@ifnottex 44@ifnottex
47* Fortran:: Fortran mode and its special features. 45* Fortran:: Fortran mode and its special features.
@@ -52,21 +50,14 @@ Highlight program syntax (@pxref{Font Lock}).
52@section Major Modes for Programming Languages 50@section Major Modes for Programming Languages
53@cindex modes for programming languages 51@cindex modes for programming languages
54 52
55 Emacs has specialized major modes for various programming languages. 53 Emacs has specialized major modes (@pxref{Major Modes}) for many
56@xref{Major Modes}. A programming language major mode typically 54programming languages. A programming language mode typically
57specifies the syntax of expressions, the customary rules for 55specifies the syntax of expressions, the customary rules for
58indentation, how to do syntax highlighting for the language, and how 56indentation, how to do syntax highlighting for the language, and how
59to find the beginning or end of a function definition. It often 57to find the beginning or end of a function definition. It often has
60customizes or provides facilities for compiling and debugging programs 58features for compiling and debugging programs as well. The major mode
61as well. 59for each language is named after the language; for instance, the major
62 60mode for the C programming language is @code{c-mode}.
63 Ideally, Emacs should provide a major mode for each programming
64language that you might want to edit; if it doesn't have a mode for
65your favorite language, you can contribute one. But often the mode
66for one language can serve for other syntactically similar languages.
67The major mode for language @var{l} is called @code{@var{l}-mode},
68and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
69@xref{Choosing Modes}.
70 61
71@cindex Perl mode 62@cindex Perl mode
72@cindex Icon mode 63@cindex Icon mode
@@ -89,40 +80,32 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
89@cindex Conf mode 80@cindex Conf mode
90@cindex DNS mode 81@cindex DNS mode
91@cindex Javascript mode 82@cindex Javascript mode
92 The existing programming language major modes include Lisp, Scheme 83 Emacs has programming language modes for Lisp, Scheme, the
93(a variant of Lisp) and the Scheme-based DSSSL expression language, 84Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++, Delphi,
94Ada, ASM, AWK, C, C++, Delphi (Object Pascal), Fortran, Icon, IDL 85Fortran, Icon, IDL (CORBA), IDLWAVE, Java, Javascript, Metafont
95(CORBA), IDLWAVE, Java, Javascript, Metafont (@TeX{}'s companion for 86(@TeX{}'s companion for font creation), Modula2, Objective-C, Octave,
96font creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike, 87Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, Tcl, and
97PostScript, Prolog, Python, Ruby, Simula, Tcl, and VHDL. An 88VHDL. An alternative mode for Perl is called CPerl mode. Modes are
98alternative mode for Perl is called CPerl mode. Modes are available 89also available for the scripting languages of the common GNU and Unix
99for the scripting languages of the common GNU and Unix shells, VMS 90shells, VMS DCL, and MS-DOS/MS-Windows @samp{BAT} files, and for
100DCL, and MS-DOS/MS-Windows @samp{BAT} files. There are also major 91makefiles, DNS master files, and various sorts of configuration files.
101modes for editing makefiles, DNS master files, and various sorts of 92
102configuration files. 93 Ideally, Emacs should have a major mode for each programming
94language that you might want to edit. If it doesn't have a mode for
95your favorite language, the mode might be implemented in a package not
96distributed with Emacs (@pxref{Packages}); or you can contribute one.
103 97
104@kindex DEL @r{(programming modes)} 98@kindex DEL @r{(programming modes)}
105@findex c-electric-backspace 99@findex c-electric-backspace
100@findex backward-delete-char-untabify
106 In most programming languages, indentation should vary from line to 101 In most programming languages, indentation should vary from line to
107line to illustrate the structure of the program. So the major modes 102line to illustrate the structure of the program. Therefore, in most
108for programming languages arrange for @key{TAB} to update the 103programming language modes, typing @key{TAB} updates the indentation
109indentation of the current line (@pxref{Program Indent}). They also 104of the current line (@pxref{Program Indent}). Furthermore, @key{DEL}
110rebind @key{DEL} to treat a tab as if it were the equivalent number of 105is usually bound to @code{backward-delete-char-untabify}, which
111spaces; this lets you delete one column of indentation without 106deletes backward treating each tab as if it were the equivalent number
112worrying whether the whitespace consists of spaces or tabs. Use 107of spaces, so that you can delete one column of indentation without
113@kbd{C-b C-d} to delete a tab character before point, in these modes. 108worrying whether the whitespace consists of spaces or tabs.
114
115 Separate manuals are available for the modes for Ada (@pxref{Top, , Ada
116Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba IDL/Pike/AWK
117(@pxref{Top, , CC Mode, ccmode, CC Mode}) and the IDLWAVE modes
118(@pxref{Top, , IDLWAVE, idlwave, IDLWAVE User Manual}). For Fortran
119mode, see
120@iftex
121@ref{Fortran,,, emacs-xtra, Specialized Emacs Features}.
122@end iftex
123@ifnottex
124@ref{Fortran}.
125@end ifnottex
126 109
127@cindex mode hook 110@cindex mode hook
128@vindex c-mode-hook 111@vindex c-mode-hook
@@ -130,13 +113,24 @@ mode, see
130@vindex emacs-lisp-mode-hook 113@vindex emacs-lisp-mode-hook
131@vindex lisp-interaction-mode-hook 114@vindex lisp-interaction-mode-hook
132@vindex scheme-mode-hook 115@vindex scheme-mode-hook
133 Turning on a major mode runs a normal hook called the @dfn{mode 116 Entering a programming language mode runs the custom Lisp functions
134hook}, which is the value of a Lisp variable. Each major mode has a 117specified in the hook variable @code{prog-mode-hook}, followed by
135mode hook, and the hook's name is always made from the mode command's 118those specified in the mode's own mode hook (@pxref{Major Modes}).
136name by adding @samp{-hook}. For example, turning on C mode runs the 119For instance, entering C mode runs the hooks @code{prog-mode-hook} and
137hook @code{c-mode-hook}, while turning on Lisp mode runs the hook 120@code{c-mode-hook}. @xref{Hooks}, for information about hooks.
138@code{lisp-mode-hook}. The purpose of the mode hook is to give you a 121
139place to set up customizations for that major mode. @xref{Hooks}. 122@ifinfo
123 Separate manuals are available for the modes for Ada (@pxref{Top,,
124Ada Mode, ada-mode, Ada Mode}), C/C++/Objective C/Java/Corba
125IDL/Pike/AWK (@pxref{Top, , CC Mode, ccmode, CC Mode}), and IDLWAVE
126(@pxref{Top,, IDLWAVE, idlwave, IDLWAVE User Manual}).
127@end ifinfo
128@ifnotinfo
129 The Emacs distribution contains Info manuals for the major modes for
130Ada, C/C++/Objective C/Java/Corba IDL/Pike/AWK, and IDLWAVE. For
131Fortran mode, see the ``Fortran'' section in the Info version of the
132Emacs manual, which is not included in this printed version.
133@end ifnotinfo
140 134
141@node Defuns 135@node Defuns
142@section Top-Level Definitions, or Defuns 136@section Top-Level Definitions, or Defuns
@@ -328,20 +322,19 @@ The Speedbar can also use it (@pxref{Speedbar}).
328@subsection Which Function Mode 322@subsection Which Function Mode
329@cindex current function name in mode line 323@cindex current function name in mode line
330 324
331 Which Function mode is a minor mode that displays the current 325 Which Function mode is a global minor mode (@pxref{Minor Modes})
332function name in the mode line, updating it as you move around in a 326which displays the current function name in the mode line, updating it
333buffer. 327as you move around in a buffer.
334 328
335@findex which-function-mode 329@findex which-function-mode
336@vindex which-func-modes 330@vindex which-func-modes
337 To either enable or disable Which Function mode, use the command 331 To either enable or disable Which Function mode, use the command
338@kbd{M-x which-function-mode}. This command applies to all buffers, 332@kbd{M-x which-function-mode}. Although Which Function mode is a
339both existing ones and those yet to be created. However, it takes 333global minor mode, it takes effect only in certain major modes: those
340effect only in certain major modes, those listed in the value of 334listed in the variable @code{which-func-modes}. If the value of
341@code{which-func-modes}. If the value of @code{which-func-modes} is 335@code{which-func-modes} is @code{t} rather than a list of modes, then
342@code{t} rather than a list of modes, then Which Function mode applies 336Which Function mode applies to all major modes that know how to
343to all major modes that know how to support it---in other words, all 337support it---in other words, all the major modes that support Imenu.
344the major modes that support Imenu.
345 338
346@node Program Indent 339@node Program Indent
347@section Indentation for Programs 340@section Indentation for Programs
@@ -352,6 +345,10 @@ reindent it as you change it. Emacs has commands to indent either a
352single line, a specified number of lines, or all of the lines inside a 345single line, a specified number of lines, or all of the lines inside a
353single parenthetical grouping. 346single parenthetical grouping.
354 347
348 @xref{Indentation}, for general information about indentation. This
349section describes indentation features specific to programming
350language modes.
351
355@menu 352@menu
356* Basic Indent:: Indenting a single line. 353* Basic Indent:: Indenting a single line.
357* Multi-line Indent:: Commands to reindent many lines at once. 354* Multi-line Indent:: Commands to reindent many lines at once.
@@ -361,18 +358,15 @@ single parenthetical grouping.
361@end menu 358@end menu
362 359
363@cindex pretty-printer 360@cindex pretty-printer
364 Emacs also provides a Lisp pretty-printer in the library @code{pp}. 361 Emacs also provides a Lisp pretty-printer in the @code{pp} package,
365This program reformats a Lisp object with indentation chosen to look nice. 362which reformats Lisp objects with nice-looking indentation.
366 363
367@node Basic Indent 364@node Basic Indent
368@subsection Basic Program Indentation Commands 365@subsection Basic Program Indentation Commands
369 366
370 The basic indentation commands indent a single line according to the
371usual conventions of the language you are editing.
372
373@table @kbd 367@table @kbd
374@item @key{TAB} 368@item @key{TAB}
375Adjust indentation of current line. 369Adjust indentation of current line (@code{indent-for-tab-command}).
376@item C-j 370@item C-j
377Insert a newline, then adjust indentation of following line 371Insert a newline, then adjust indentation of following line
378(@code{newline-and-indent}). 372(@code{newline-and-indent}).
@@ -382,65 +376,50 @@ Insert a newline, then adjust indentation of following line
382@findex c-indent-command 376@findex c-indent-command
383@findex indent-line-function 377@findex indent-line-function
384@findex indent-for-tab-command 378@findex indent-for-tab-command
385 The basic indentation command is @key{TAB}. In any 379 The basic indentation command is @key{TAB}
386programming-language major mode, @key{TAB} gives the current line the 380(@code{indent-for-tab-command}), which was documented in
387correct indentation as determined from the previous lines. It does 381@ref{Indentation}. In programming language modes, @key{TAB} indents
388this by inserting or deleting whitespace at the beginning of the 382the current line, based on the indentation and syntactic content of
389current line. If point was inside the whitespace at the beginning of 383the preceding lines; if the region is active, @key{TAB} indents each
390the line, @key{TAB} puts it at the end of that whitespace; otherwise, 384line within the region, not just the current line.
391@key{TAB} keeps point fixed with respect to the characters around it.
392If the region is active (@pxref{Mark}), @key{TAB} indents every line
393within the region instead of just the current line. The function that
394@key{TAB} runs depends on the major mode; for instance, it is
395@code{c-indent-line-or-region} in C mode. Each function is aware of
396the syntax and conventions for its particular language.
397
398 Use @kbd{C-q @key{TAB}} to insert a tab character at point.
399 385
400@kindex C-j @r{(indenting source code)} 386@kindex C-j @r{(indenting source code)}
401@findex newline-and-indent 387@findex newline-and-indent
402 When entering lines of new code, use @kbd{C-j} 388 The command @kbd{C-j} (@code{newline-and-indent}), which was
403(@code{newline-and-indent}), which inserts a newline and then adjusts 389documented in @ref{Indentation Commands}, does the same as @key{RET}
404indentation after it. (It also deletes any trailing whitespace which 390followed by @key{TAB}: it inserts a new line, then adjusts the line's
405remains before the new newline.) For instance, @kbd{C-j} at the end 391indentation.
406of a line creates a blank line with appropriate indentation. In 392
407programming language modes, it is equivalent to @key{RET} @key{TAB}. 393 When indenting a line that starts within a parenthetical grouping,
408 394Emacs usually places the start of the line under the preceding line
409 When Emacs indents a line that starts within a parenthetical 395within the group, or under the text after the parenthesis. If you
410grouping, it usually places the start of the line under the preceding 396manually give one of these lines a nonstandard indentation (e.g.@: for
411line within the group, or under the text after the parenthesis. If 397aesthetic purposes), the lines below will follow it.
412you manually give one of these lines a nonstandard indentation, the 398
413lines below will tend to follow it. This behavior is convenient in 399 The indentation commands for most programming language modes assume
414cases where you have overridden the standard result of @key{TAB} 400that a open-parenthesis, open-brace or other opening delimiter at the
415indentation (e.g., for aesthetic purposes). 401left margin is the start of a function. If the code you are editing
416 402violates this assumption---even if the delimiters occur in strings or
417 Many programming-language modes assume that an open-parenthesis, 403comments---you must set @code{open-paren-in-column-0-is-defun-start}
418open-brace or other opening delimiter at the left margin is the start 404to @code{nil} for indentation to work properly. @xref{Left Margin
419of a function. This assumption speeds up indentation commands. If
420the text you are editing contains opening delimiters in column zero
421that aren't the beginning of a functions---even if these delimiters
422occur inside strings or comments---then you must set
423@code{open-paren-in-column-0-is-defun-start}. @xref{Left Margin
424Paren}. 405Paren}.
425 406
426 Normally, Emacs indents lines using an ``optimal'' mix of tab and
427space characters. If you want Emacs to use spaces only, set
428@code{indent-tabs-mode} (@pxref{Just Spaces}).
429
430@node Multi-line Indent 407@node Multi-line Indent
431@subsection Indenting Several Lines 408@subsection Indenting Several Lines
432 409
433 Sometimes, you may want to reindent several lines of code at a time. 410 Sometimes, you may want to reindent several lines of code at a time.
434One way to do this is to use the mark; when the mark is active and the 411One way to do this is to use the mark; when the mark is active and the
435region is non-empty, @key{TAB} indents every line within the region. 412region is non-empty, @key{TAB} indents every line in the region.
436In addition, Emacs provides several other commands for indenting large 413Alternatively, the command @kbd{C-M-\} (@code{indent-region}) indents
437chunks of code: 414every line in the region, whether or not the mark is active
415(@pxref{Indentation Commands}).
416
417 In addition, Emacs provides the following commands for indenting
418large chunks of code:
438 419
439@table @kbd 420@table @kbd
440@item C-M-q 421@item C-M-q
441Reindent all the lines within one parenthetical grouping. 422Reindent all the lines within one parenthetical grouping.
442@item C-M-\
443Reindent all lines in the region (@code{indent-region}).
444@item C-u @key{TAB} 423@item C-u @key{TAB}
445Shift an entire parenthetical grouping rigidly sideways so that its 424Shift an entire parenthetical grouping rigidly sideways so that its
446first line is properly indented. 425first line is properly indented.
@@ -454,18 +433,13 @@ lines that start inside comments and strings.
454 To reindent the contents of a single parenthetical grouping, 433 To reindent the contents of a single parenthetical grouping,
455position point before the beginning of the grouping and type 434position point before the beginning of the grouping and type
456@kbd{C-M-q}. This changes the relative indentation within the 435@kbd{C-M-q}. This changes the relative indentation within the
457grouping, without affecting its overall indentation (i.e., the 436grouping, without affecting its overall indentation (i.e.@: the
458indentation of the line where the grouping starts). The function that 437indentation of the line where the grouping starts). The function that
459@kbd{C-M-q} runs depends on the major mode; it is 438@kbd{C-M-q} runs depends on the major mode; it is
460@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode, 439@code{indent-pp-sexp} in Lisp mode, @code{c-indent-exp} in C mode,
461etc. To correct the overall indentation as well, type @key{TAB} 440etc. To correct the overall indentation as well, type @key{TAB}
462first. 441first.
463 442
464 @kbd{C-M-\} (@code{indent-region}) applies @key{TAB} to the region.
465This is useful when Transient Mark mode is disabled (@pxref{Disabled
466Transient Mark}), because in that case @key{TAB} does not act on the
467region.
468
469@kindex C-u TAB 443@kindex C-u TAB
470 If you like the relative indentation within a grouping but not the 444 If you like the relative indentation within a grouping but not the
471indentation of its first line, move point to that first line and type 445indentation of its first line, move point to that first line and type
@@ -516,9 +490,9 @@ expression.
516@cindex @code{lisp-indent-function} property 490@cindex @code{lisp-indent-function} property
517 You can override the standard pattern in various ways for individual 491 You can override the standard pattern in various ways for individual
518functions, according to the @code{lisp-indent-function} property of 492functions, according to the @code{lisp-indent-function} property of
519the function name. Normally you would use this for macro definitions 493the function name. This is normally done for macro definitions, using
520and specify it using the @code{declare} construct (@pxref{Defining 494the @code{declare} construct. @xref{Defining Macros,,, elisp, the
521Macros,,, elisp, the Emacs Lisp Reference Manual}). 495Emacs Lisp Reference Manual}.
522 496
523@node C Indent 497@node C Indent
524@subsection Commands for C Indentation 498@subsection Commands for C Indentation
@@ -632,6 +606,14 @@ information on customizing indentation for C and related modes,
632including how to override parts of an existing style and how to define 606including how to override parts of an existing style and how to define
633your own styles. 607your own styles.
634 608
609@findex c-guess
610@findex c-guess-install
611 As an alternative to specifying a style, you can tell Emacs to guess
612a style by typing @kbd{M-x c-guess} in a sample code buffer. You can
613then apply the guessed style to other buffers with @kbd{M-x
614c-guess-install}. @xref{Guessing the Style,,, ccmode, the CC Mode
615Manual}, for details.
616
635@node Parentheses 617@node Parentheses
636@section Commands for Editing with Parentheses 618@section Commands for Editing with Parentheses
637 619
@@ -664,9 +646,13 @@ parentheses and unbalanced string quotes in the buffer.
664@cindex sexp 646@cindex sexp
665@cindex expression 647@cindex expression
666@cindex balanced expression 648@cindex balanced expression
667 These commands deal with balanced expressions, also called 649 Each programming language mode has its own definition of a
668@dfn{sexps}@footnote{The word ``sexp'' is used to refer to an 650@dfn{balanced expression}. Balanced expressions typically include
669expression in Lisp.}. 651individual symbols, numbers, and string constants, as well as pieces
652of code enclosed in a matching pair of delimiters. The following
653commands deal with balanced expressions (in Emacs, such expressions
654are referred to internally as @dfn{sexps}@footnote{The word ``sexp''
655is used to refer to an expression in Lisp.}).
670 656
671@table @kbd 657@table @kbd
672@item C-M-f 658@item C-M-f
@@ -682,90 +668,71 @@ Transpose expressions (@code{transpose-sexps}).
682Put mark after following expression (@code{mark-sexp}). 668Put mark after following expression (@code{mark-sexp}).
683@end table 669@end table
684 670
685 Each programming language major mode customizes the definition of
686balanced expressions to suit that language. Balanced expressions
687typically include symbols, numbers, and string constants, as well as
688any pair of matching delimiters and their contents. Some languages
689have obscure forms of expression syntax that nobody has bothered to
690implement in Emacs.
691
692@cindex Control-Meta
693 By convention, the keys for these commands are all Control-Meta
694characters. They usually act on expressions just as the corresponding
695Meta characters act on words. For instance, the command @kbd{C-M-b}
696moves backward over a balanced expression, just as @kbd{M-b} moves
697back over a word.
698
699@kindex C-M-f 671@kindex C-M-f
700@kindex C-M-b 672@kindex C-M-b
701@findex forward-sexp 673@findex forward-sexp
702@findex backward-sexp 674@findex backward-sexp
703 To move forward over a balanced expression, use @kbd{C-M-f} 675 To move forward over a balanced expression, use @kbd{C-M-f}
704(@code{forward-sexp}). If the first significant character after point 676(@code{forward-sexp}). If the first significant character after point
705is an opening delimiter (@samp{(} in Lisp; @samp{(}, @samp{[} or 677is an opening delimiter (e.g.@: @samp{(}, @samp{[} or @samp{@{} in C),
706@samp{@{} in C), @kbd{C-M-f} moves past the matching closing 678this command moves past the matching closing delimiter. If the
707delimiter. If the character begins a symbol, string, or number, 679character begins a symbol, string, or number, the command moves over
708@kbd{C-M-f} moves over that. 680that.
709 681
710 The command @kbd{C-M-b} (@code{backward-sexp}) moves backward over a 682 The command @kbd{C-M-b} (@code{backward-sexp}) moves backward over a
711balanced expression. The detailed rules are like those above for 683balanced expression---like @kbd{C-M-f}, but in the reverse direction.
712@kbd{C-M-f}, but with directions reversed. If there are prefix 684If the expression is preceded by any prefix characters (single-quote,
713characters (single-quote, backquote and comma, in Lisp) preceding the 685backquote and comma, in Lisp), the command moves back over them as
714expression, @kbd{C-M-b} moves back over them as well. The balanced 686well.
715expression commands move across comments as if they were whitespace, 687
716in most modes. 688 @kbd{C-M-f} or @kbd{C-M-b} with an argument repeats that operation
717 689the specified number of times; with a negative argument means to move
718 @kbd{C-M-f} or @kbd{C-M-b} with an argument repeats that operation the 690in the opposite direction. In most modes, these two commands move
719specified number of times; with a negative argument, it moves in the 691across comments as if they were whitespace. Note that their keys,
720opposite direction. 692@kbd{C-M-f} and @kbd{C-M-b}, are analogous to @kbd{C-f} and @kbd{C-b},
693which move by characters (@pxref{Moving Point}), and @kbd{M-f} and
694@kbd{M-b}, which move by words (@pxref{Words}).
721 695
722@cindex killing expressions 696@cindex killing expressions
723@kindex C-M-k 697@kindex C-M-k
724@findex kill-sexp 698@findex kill-sexp
725 Killing a whole balanced expression can be done with @kbd{C-M-k} 699 To kill a whole balanced expression, type @kbd{C-M-k}
726(@code{kill-sexp}). @kbd{C-M-k} kills the characters that @kbd{C-M-f} 700(@code{kill-sexp}). This kills the text that @kbd{C-M-f} would move
727would move over. 701over.
728 702
729@cindex transposition of expressions 703@cindex transposition of expressions
730@kindex C-M-t 704@kindex C-M-t
731@findex transpose-sexps 705@findex transpose-sexps
732 A somewhat random-sounding command which is nevertheless handy is 706 @kbd{C-M-t} (@code{transpose-sexps}) switches the positions of the
733@kbd{C-M-t} (@code{transpose-sexps}), which drags the previous 707previous balanced expression and the next one. It is analogous to the
734balanced expression across the next one. An argument serves as a 708@kbd{C-t} command, which transposes characters (@pxref{Transpose}).
735repeat count, moving the previous expression over that many following 709An argument to @kbd{C-M-t} serves as a repeat count, moving the
736ones. A negative argument drags the previous balanced expression 710previous expression over that many following ones. A negative
737backwards across those before it (thus canceling out the effect of 711argument moves the previous balanced expression backwards across those
738@kbd{C-M-t} with a positive argument). An argument of zero, rather 712before it. An argument of zero, rather than doing nothing, transposes
739than doing nothing, transposes the balanced expressions ending at or 713the balanced expressions ending at or after point and the mark.
740after point and the mark.
741 714
742@kindex C-M-@@ 715@kindex C-M-@@
743@kindex C-M-@key{SPC} 716@kindex C-M-@key{SPC}
744@findex mark-sexp 717@findex mark-sexp
745 To operate on balanced expressions with an operation which acts on 718 To operate on balanced expressions with a command which acts on the
746the region, use the command @kbd{C-M-@key{SPC}} (@code{mark-sexp}). 719region, type @kbd{C-M-@key{SPC}} (@code{mark-sexp}). This sets the
747This sets the mark at the same place that @kbd{C-M-f} would move to. 720mark where @kbd{C-M-f} would move to. While the mark is active, each
748@xref{Marking Objects}, for more information about this command. 721successive call to this command extends the region by shifting the
749 722mark by one expression. Positive or negative numeric arguments move
750@kbd{C-M-@key{SPC}} treats 723the mark forward or backward by the specified number of expressions.
751numeric arguments in the same way as @kbd{C-M-f}; in particular, a 724The alias @kbd{C-M-@@} is equivalent to @kbd{C-M-@key{SPC}}.
752negative argument puts the mark at the beginning of the previous 725@xref{Marking Objects}, for more information about this and related
753balanced expression. The alias @kbd{C-M-@@} is equivalent to 726commands.
754@kbd{C-M-@key{SPC}}. While the mark is active, each successive use of
755@kbd{C-M-@key{SPC}} extends the region by shifting the mark by one
756sexp.
757 727
758 In languages that use infix operators, such as C, it is not possible 728 In languages that use infix operators, such as C, it is not possible
759to recognize all balanced expressions as such because there can be 729to recognize all balanced expressions because there can be multiple
760multiple possibilities at a given position. For example, C mode does 730possibilities at a given position. For example, C mode does not treat
761not treat @samp{foo + bar} as a single expression, even though it 731@samp{foo + bar} as a single expression, even though it @emph{is} one
762@emph{is} one C expression; instead, it recognizes @samp{foo} as one 732C expression; instead, it recognizes @samp{foo} as one expression and
763expression and @samp{bar} as another, with the @samp{+} as punctuation 733@samp{bar} as another, with the @samp{+} as punctuation between them.
764between them. Both @samp{foo + bar} and @samp{foo} are legitimate 734However, C mode recognizes @samp{(foo + bar)} as a single expression,
765choices for ``the expression following point'' when point is at the 735because of the parentheses.
766@samp{f}, so the expression commands must perforce choose one or the
767other to operate on. Note that @samp{(foo + bar)} is recognized as a
768single expression in C mode, because of the parentheses.
769 736
770@node Moving by Parens 737@node Moving by Parens
771@subsection Moving in the Parenthesis Structure 738@subsection Moving in the Parenthesis Structure
@@ -776,19 +743,18 @@ single expression in C mode, because of the parentheses.
776@cindex braces, moving across 743@cindex braces, moving across
777@cindex list commands 744@cindex list commands
778 745
779 The Emacs commands for handling parenthetical groupings see nothing 746 The following commands move over groupings delimited by parentheses
780except parentheses (or whatever characters must balance in the 747(or whatever else serves as delimiters in the language you are working
781language you are working with). They ignore strings and comments 748with). They ignore strings and comments, including any parentheses
782(including any parentheses within them) and ignore parentheses quoted 749within them, and also ignore parentheses that are ``quoted'' with an
783by an escape character. They are mainly intended for editing 750escape character. These commands are mainly intended for editing
784programs, but can be useful for editing any text that has parentheses. 751programs, but can be useful for editing any text containing
785They are sometimes called ``list'' commands because in Lisp these 752parentheses. They are referred to internally as ``list'' commands
786groupings are lists. 753because in Lisp these groupings are lists.
787 754
788These commands assume that the starting point is not inside a string 755 These commands assume that the starting point is not inside a string
789or a comment. Sometimes you can invoke them usefully from one of 756or a comment. If you invoke them from inside a string or comment, the
790these places (for example, when you have a parenthesised clause in a 757results are unreliable.
791comment) but this is unreliable.
792 758
793@table @kbd 759@table @kbd
794@item C-M-n 760@item C-M-n
@@ -826,52 +792,62 @@ delimiter, this is nearly the same as searching for a @samp{(}. An
826argument specifies the number of levels to go down. 792argument specifies the number of levels to go down.
827 793
828@node Matching 794@node Matching
829@subsection Automatic Display Of Matching Parentheses 795@subsection Matching Parentheses
830@cindex matching parentheses 796@cindex matching parentheses
831@cindex parentheses, displaying matches 797@cindex parentheses, displaying matches
832 798
833 The Emacs parenthesis-matching feature is designed to show 799 Emacs has a number of @dfn{parenthesis matching} features, which
834automatically how parentheses (and other matching delimiters) match in 800make it easy to see how and whether parentheses (or other delimiters)
835the text. Whenever you type a self-inserting character that is a 801match up.
836closing delimiter, the cursor moves momentarily to the location of the 802
803 Whenever you type a self-inserting character that is a closing
804delimiter, the cursor moves momentarily to the location of the
837matching opening delimiter, provided that is on the screen. If it is 805matching opening delimiter, provided that is on the screen. If it is
838not on the screen, Emacs displays some of the text near it in the echo 806not on the screen, Emacs displays some of the text near it in the echo
839area. Either way, you can tell which grouping you are closing off. 807area. Either way, you can tell which grouping you are closing off.
840 808If the opening delimiter and closing delimiter are mismatched---such
841 If the opening delimiter and closing delimiter are mismatched---such
842as in @samp{[x)}---a warning message is displayed in the echo area. 809as in @samp{[x)}---a warning message is displayed in the echo area.
843 810
844@vindex blink-matching-paren 811@vindex blink-matching-paren
845@vindex blink-matching-paren-distance 812@vindex blink-matching-paren-distance
846@vindex blink-matching-delay 813@vindex blink-matching-delay
847 Three variables control parenthesis match display: 814 Three variables control the display of matching parentheses:
848 815
849 @code{blink-matching-paren} turns the feature on or off: @code{nil} 816@itemize @bullet
850disables it, but the default is @code{t} to enable match display. 817@item
818@code{blink-matching-paren} turns the feature on or off: @code{nil}
819disables it, but the default is @code{t} to enable it.
851 820
852 @code{blink-matching-delay} says how many seconds to leave the 821@item
853cursor on the matching opening delimiter, before bringing it back to 822@code{blink-matching-delay} says how many seconds to leave the cursor
854the real location of point; the default is 1, but on some systems it 823on the matching opening delimiter, before bringing it back to the real
855is useful to specify a fraction of a second. 824location of point. This may be an integer or floating-point number;
825the default is 1.
856 826
857 @code{blink-matching-paren-distance} specifies how many characters 827@item
828@code{blink-matching-paren-distance} specifies how many characters
858back to search to find the matching opening delimiter. If the match 829back to search to find the matching opening delimiter. If the match
859is not found in that distance, scanning stops, and nothing is displayed. 830is not found in that distance, Emacs stops scanning and nothing is
860This is to prevent the scan for the matching delimiter from wasting 831displayed. The default is 102400.
861lots of time when there is no match. The default is 102400. 832@end itemize
862 833
863@cindex Show Paren mode 834@cindex Show Paren mode
864@cindex highlighting matching parentheses 835@cindex highlighting matching parentheses
865@findex show-paren-mode 836@findex show-paren-mode
866 Show Paren mode provides a more powerful kind of automatic matching. 837 Show Paren mode, a global minor mode, provides a more powerful kind
867Whenever point is before an opening delimiter or after a closing 838of automatic matching. Whenever point is before an opening delimiter
868delimiter, both that delimiter and its opposite delimiter are 839or after a closing delimiter, both that delimiter and its opposite
869highlighted. Use the command @kbd{M-x show-paren-mode} to enable or 840delimiter are highlighted. To toggle Show Paren mode, type @kbd{M-x
870disable this mode. 841show-paren-mode}.
871 842
872 Show Paren mode uses the faces @code{show-paren-match} and 843@cindex Electric Pair mode
873@code{show-paren-mismatch} to highlight parentheses; you can customize 844@cindex inserting matching parentheses
874them to control how highlighting looks. @xref{Face Customization}. 845@findex electric-pair-mode
846 Electric Pair mode, a global minor mode, provides a way to easily
847insert matching delimiters. Whenever you insert an opening delimiter,
848the matching closing delimiter is automatically inserted as well,
849leaving point between the two. To toggle Electric Pair mode, type
850@kbd{M-x electric-pair-mode}.
875 851
876@node Comments 852@node Comments
877@section Manipulating Comments 853@section Manipulating Comments
@@ -882,6 +858,23 @@ provides special commands for editing and inserting comments. It can
882also do spell checking on comments with Flyspell Prog mode 858also do spell checking on comments with Flyspell Prog mode
883(@pxref{Spelling}). 859(@pxref{Spelling}).
884 860
861 Some major modes have special rules for indenting different kinds of
862comments. For example, in Lisp code, comments starting with two
863semicolons are indented as if they were lines of code, while those
864starting with three semicolons are supposed to be aligned to the left
865margin and are often used for sectioning purposes. Emacs understand
866these conventions; for instance, typing @key{TAB} on a comment line
867will indent the comment to the appropriate position.
868
869@example
870;; This function is just an example.
871;;; Here either two or three semicolons are appropriate.
872(defun foo (x)
873;;; And now, the first part of the function:
874 ;; The following line adds one.
875 (1+ x)) ; This line adds one.
876@end example
877
885@menu 878@menu
886* Comment Commands:: Inserting, killing, and aligning comments. 879* Comment Commands:: Inserting, killing, and aligning comments.
887* Multi-Line Comments:: Commands for adding and editing multi-line comments. 880* Multi-Line Comments:: Commands for adding and editing multi-line comments.
@@ -893,12 +886,12 @@ also do spell checking on comments with Flyspell Prog mode
893@cindex indentation for comments 886@cindex indentation for comments
894@cindex alignment for comments 887@cindex alignment for comments
895 888
896 The commands in this table insert, kill and align comments: 889 The following commands operate on comments:
897 890
898@table @asis 891@table @asis
899@item @kbd{M-;} 892@item @kbd{M-;}
900Insert or realign comment on current line; alternatively, comment or 893Insert or realign comment on current line; if the region is active,
901uncomment the region (@code{comment-dwim}). 894comment or uncomment the region instead (@code{comment-dwim}).
902@item @kbd{C-u M-;} 895@item @kbd{C-u M-;}
903Kill comment on current line (@code{comment-kill}). 896Kill comment on current line (@code{comment-kill}).
904@item @kbd{C-x ;} 897@item @kbd{C-x ;}
@@ -909,7 +902,7 @@ Like @key{RET} followed by inserting and aligning a comment
909(@code{comment-indent-new-line}). @xref{Multi-Line Comments}. 902(@code{comment-indent-new-line}). @xref{Multi-Line Comments}.
910@item @kbd{M-x comment-region} 903@item @kbd{M-x comment-region}
911@itemx @kbd{C-c C-c} (in C-like modes) 904@itemx @kbd{C-c C-c} (in C-like modes)
912Add or remove comment delimiters on all the lines in the region. 905Add comment delimiters to all the lines in the region.
913@end table 906@end table
914 907
915@kindex M-; 908@kindex M-;
@@ -920,65 +913,61 @@ I Mean''; it indicates that this command can be used for many
920different jobs relating to comments, depending on the situation where 913different jobs relating to comments, depending on the situation where
921you use it. 914you use it.
922 915
923 When a region is active, @kbd{M-;} either adds or removes comment 916 When a region is active (@pxref{Mark}), @kbd{M-;} either adds
924delimiters on each line of the region. @xref{Mark}. If every line in 917comment delimiters to the region, or removes them. If every line in
925the region is a comment, it removes comment delimiters from each; 918the region is already a comment, it ``uncomments'' each of those lines
926otherwise, it adds comment delimiters to each. You can also use the 919by removing their comment delimiters. Otherwise, it adds comment
927commands @code{comment-region} and @code{uncomment-region} to 920delimiters to enclose the text in the region.
928explicitly comment or uncomment the text in the region 921
929(@pxref{Multi-Line Comments}). If you supply a prefix argument to 922 If you supply a prefix argument to @kbd{M-;} when a region is
930@kbd{M-;} when a region is active, that specifies how many comment 923active, that specifies the number of comment delimiters to add or
931delimiters to add or how many to delete. 924delete. A positive argument @var{n} adds @var{n} delimiters, while a
932 925negative argument @var{-n} removes @var{n} delimiters.
933 If the region is not active, @kbd{M-;} inserts a new comment if 926
934there is no comment already on the line. The new comment is normally 927 If the region is not active, and there is no existing comment on the
935aligned at a specific column called the @dfn{comment column}; if the 928current line, @kbd{M-;} adds a new comment to the current line. If
936text of the line extends past the comment column, @kbd{M-;} aligns the 929the line is blank (i.e.@: empty or containing only whitespace
937comment start string to a suitable boundary (usually, at least one 930characters), the comment is indented to the same position where
938space is inserted). The comment begins with the string Emacs thinks 931@key{TAB} would indent to (@pxref{Basic Indent}). If the line is
939comments should start with (the value of @code{comment-start}; see 932non-blank, the comment is placed after the last non-whitespace
940below). Emacs places point after that string, so you can insert the 933character on the line; normally, Emacs tries putting it at the column
941text of the comment right away. If the major mode has specified a 934specified by the variable @code{comment-column} (@pxref{Options for
942string to terminate comments, @kbd{M-;} inserts that string after 935Comments}), but if the line already extends past that column, it puts
943point, to keep the syntax valid. 936the comment at some suitable position, usually separated from the
937non-comment text by at least one space. In each case, Emacs places
938point after the comment's starting delimiter, so that you can start
939typing the comment text right away.
944 940
945 You can also use @kbd{M-;} to align an existing comment. If a line 941 You can also use @kbd{M-;} to align an existing comment. If a line
946already contains the comment-start string, @kbd{M-;} realigns it to 942already contains the comment-start string, @kbd{M-;} realigns it to
947the conventional alignment and moves point after it. (Exception: 943the conventional alignment and moves point after the comment's
948comments starting in column 0 are not moved.) Even when an existing 944starting delimiter. As an exception, comments starting in column 0
949comment is properly aligned, @kbd{M-;} is still useful for moving 945are not moved. Even when an existing comment is properly aligned,
950directly to the start of the text inside the comment. 946@kbd{M-;} is still useful for moving directly to the start of the
947comment text.
951 948
952@findex comment-kill 949@findex comment-kill
953@kindex C-u M-; 950@kindex C-u M-;
954 @kbd{C-u M-;} kills any comment on the current line, along with the 951 @kbd{C-u M-;} (@code{comment-dwim} with a prefix argument) kills any
955whitespace before it. To reinsert the comment on another line, move 952comment on the current line, along with the whitespace before it.
956to the end of that line, do @kbd{C-y}, and then do @kbd{M-;} to 953Since the comment is saved to the kill ring, you can reinsert it on
957realign it. 954another line by moving to the end of that line, doing @kbd{C-y}, and
958 955then @kbd{M-;} to realign the command. You can achieve the same
959 Note that @kbd{C-u M-;} is not a distinct key; it is @kbd{M-;} 956effect as @kbd{C-u M-;} by typing @kbd{M-x comment-kill}
960(@code{comment-dwim}) with a prefix argument. That command is 957(@code{comment-dwim} actually calls @code{comment-kill} as a
961programmed so that when it receives a prefix argument it calls 958subroutine when it is given a prefix argument).
962@code{comment-kill}. However, @code{comment-kill} is a valid command
963in its own right, and you can bind it directly to a key if you wish.
964
965 Some major modes have special rules for aligning certain kinds of
966comments in certain contexts. For example, in Lisp code, comments which
967start with two semicolons are indented as if they were lines of code,
968instead of at the comment column. Comments which start with three
969semicolons are supposed to start at the left margin and are often used
970for sectioning purposes. Emacs understands
971these conventions by indenting a double-semicolon comment using @key{TAB},
972and by not changing the indentation of a triple-semicolon comment at all.
973 959
974@example 960@kindex C-c C-c (C mode)
975;; This function is just an example. 961@findex comment-region
976;;; Here either two or three semicolons are appropriate. 962@findex uncomment-region
977(defun foo (x) 963 The command @kbd{M-x comment-region} is equivalent to calling
978;;; And now, the first part of the function: 964@kbd{M-;} on an active region, except that it always acts on the
979 ;; The following line adds one. 965region, even if the mark is inactive. In C mode and related modes,
980 (1+ x)) ; This line adds one. 966this command is bound to @kbd{C-c C-c}. The command @kbd{M-x
981@end example 967uncomment-region} uncomments each line in the region; a numeric prefix
968argument specifies the number of comment delimiters to remove
969(negative arguments specify the number of comment to delimiters to
970add).
982 971
983 For C-like modes, you can configure the exact effect of @kbd{M-;} by 972 For C-like modes, you can configure the exact effect of @kbd{M-;} by
984setting the variables @code{c-indent-comment-alist} and 973setting the variables @code{c-indent-comment-alist} and
@@ -994,32 +983,31 @@ the brace rather than at @code{comment-column}. For full details see
994@kindex M-j 983@kindex M-j
995@cindex blank lines in programs 984@cindex blank lines in programs
996@findex comment-indent-new-line 985@findex comment-indent-new-line
997 986@vindex comment-multi-line
998 If you are typing a comment and wish to continue it on another line, 987 If you are typing a comment and wish to continue it to another line,
999you can use the command @kbd{C-M-j} or @kbd{M-j} 988type @kbd{M-j} or @kbd{C-M-j} (@code{comment-indent-new-line}). This
1000(@code{comment-indent-new-line}). If @code{comment-multi-line} 989breaks the current line, and inserts the necessary comment delimiters
1001(@pxref{Options for Comments}) is non-@code{nil}, it moves to a new 990and indentation to continue the comment.
1002line within the comment. Otherwise it closes the comment and starts a 991
1003new comment on a new line. When Auto Fill mode is on, going past the 992 For languages with closing comment delimiters (e.g.@: @samp{*/} in
1004fill column while typing a comment causes the comment to be continued 993C), the exact behavior of @kbd{M-j} depends on the value of the
1005in just this fashion. 994variable @code{comment-multi-line}. If the value is @code{nil}, the
1006 995command closes the comment on the old line and starts a new comment on
1007@kindex C-c C-c (C mode) 996the new line. Otherwise, it opens a new line within the current
1008@findex comment-region 997comment delimiters.
1009 To turn existing lines into comment lines, use the @kbd{M-x 998
1010comment-region} command (or type @kbd{C-c C-c} in C-like modes). It 999 When Auto Fill mode is on, going past the fill column while typing a
1011adds comment delimiters to the lines that start in the region, thus 1000comment also continues the comment, in the same way as an explicit
1012commenting them out. With a negative argument, it does the 1001invocation of @kbd{M-j}.
1013opposite---it deletes comment delimiters from the lines in the region. 1002
1014 1003 To turn existing lines into comment lines, use @kbd{M-;} with the
1015 With a positive argument, @code{comment-region} duplicates the last 1004region active, or use @kbd{M-x comment-region}
1016character of the comment start sequence it adds; the argument 1005@ifinfo
1017specifies how many copies of the character to insert. Thus, in Lisp 1006(@pxref{Comment Commands}).
1018mode, @kbd{C-u 2 M-x comment-region} adds @samp{;;} to each line. 1007@end ifinfo
1019Duplicating the comment delimiter is a way of calling attention to the 1008@ifnotinfo
1020comment. It can also affect how the comment is aligned or indented. 1009as described in the preceding section.
1021In Lisp, for proper indentation, you should use an argument of two or 1010@end ifnotinfo
1022three, if between defuns; if within a defun, it must be three.
1023 1011
1024 You can configure C Mode such that when you type a @samp{/} at the 1012 You can configure C Mode such that when you type a @samp{/} at the
1025start of a line in a multi-line block comment, this closes the 1013start of a line in a multi-line block comment, this closes the
@@ -1032,19 +1020,16 @@ comment. Enable the @code{comment-close-slash} clean-up for this.
1032@vindex comment-column 1020@vindex comment-column
1033@kindex C-x ; 1021@kindex C-x ;
1034@findex comment-set-column 1022@findex comment-set-column
1035 The @dfn{comment column}, the column at which Emacs tries to place 1023 As mentioned in @ref{Comment Commands}, when the @kbd{M-j} command
1036comments, is stored in the variable @code{comment-column}. You can 1024adds a comment to a line, it tries to place the comment at the column
1037set it to a number explicitly. Alternatively, the command @kbd{C-x ;} 1025specified by the buffer-local variable @code{comment-column}. You can
1038(@code{comment-set-column}) sets the comment column to the column 1026set either the local value or the default value of this buffer-local
1039point is at. @kbd{C-u C-x ;} sets the comment column to match the 1027variable in the usual way (@pxref{Locals}). Alternatively, you can
1040last comment before point in the buffer, and then does a @kbd{M-;} to 1028type @kbd{C-x ;} (@code{comment-set-column}) to set the value of
1041align the current line's comment under the previous one. 1029@code{comment-column} in the current buffer to the column where point
1042 1030is currently located. @kbd{C-u C-x ;} sets the comment column to
1043 The variable @code{comment-column} is per-buffer: setting the variable 1031match the last comment before point in the buffer, and then does a
1044in the normal fashion affects only the current buffer, but there is a 1032@kbd{M-;} to align the current line's comment under the previous one.
1045default value which you can change with @code{setq-default}.
1046@xref{Locals}. Many major modes initialize this variable for the
1047current buffer.
1048 1033
1049@vindex comment-start-skip 1034@vindex comment-start-skip
1050 The comment commands recognize comments based on the regular 1035 The comment commands recognize comments based on the regular
@@ -1053,39 +1038,32 @@ Make sure this regexp does not match the null string. It may match more
1053than the comment starting delimiter in the strictest sense of the word; 1038than the comment starting delimiter in the strictest sense of the word;
1054for example, in C mode the value of the variable is 1039for example, in C mode the value of the variable is
1055@c This stops M-q from breaking the line inside that @code. 1040@c This stops M-q from breaking the line inside that @code.
1056@code{@w{"/\\*+ *\\|//+ *"}}, which matches extra stars and spaces 1041@code{@w{"\\(//+\\|/\\*+\\)\\s *"}}, which matches extra stars and
1057after the @samp{/*} itself, and accepts C++ style comments also. 1042spaces after the @samp{/*} itself, and accepts C++ style comments
1058(Note that @samp{\\} is needed in Lisp syntax to include a @samp{\} in 1043also. (Note that @samp{\\} is needed in Lisp syntax to include a
1059the string, which is needed to deny the first star its special meaning 1044@samp{\} in the string, which is needed to deny the first star its
1060in regexp syntax. @xref{Regexp Backslash}.) 1045special meaning in regexp syntax. @xref{Regexp Backslash}.)
1061 1046
1062@vindex comment-start 1047@vindex comment-start
1063@vindex comment-end 1048@vindex comment-end
1064 When a comment command makes a new comment, it inserts the value of 1049 When a comment command makes a new comment, it inserts the value of
1065@code{comment-start} to begin it. The value of @code{comment-end} is 1050@code{comment-start} as an opening comment delimiter. It also inserts
1066inserted after point, so that it will follow the text that you will 1051the value of @code{comment-end} after point, as a closing comment
1067insert into the comment. When @code{comment-end} is non-empty, it 1052delimiter. For example, in Lisp mode, @code{comment-start} is
1068should start with a space. For example, in C mode, 1053@samp{";"} and @code{comment-end} is @code{""} (the empty string). In
1069@code{comment-start} has the value @w{@code{"/* "}} and 1054C mode, @code{comment-start} is @code{"/* "} and @code{comment-end} is
1070@code{comment-end} has the value @w{@code{" */"}}. 1055@code{" */"}.
1071 1056
1072@vindex comment-padding 1057@vindex comment-padding
1073 The variable @code{comment-padding} specifies how many spaces 1058 The variable @code{comment-padding} specifies a string that the
1074@code{comment-region} should insert on each line between the comment 1059commenting commands should insert between the comment delimiter(s) and
1075delimiter and the line's original text. The default is 1, to insert 1060the comment text. The default, @samp{" "}, specifies a single space.
1076one space. @code{nil} means 0. Alternatively, @code{comment-padding} 1061Alternatively, the value can be a number, which specifies that number
1077can hold the actual string to insert. 1062of spaces, or @code{nil}, which means no spaces at all.
1078 1063
1079@vindex comment-multi-line 1064 The variable @code{comment-multi-line} controls how @kbd{M-j} and
1080 The variable @code{comment-multi-line} controls how @kbd{C-M-j} 1065Auto Fill mode continue comments over multiple lines.
1081(@code{indent-new-comment-line}) behaves when used inside a comment. 1066@xref{Multi-Line Comments}.
1082Specifically, when @code{comment-multi-line} is @code{nil}, the
1083command inserts a comment terminator, begins a new line, and finally
1084inserts a comment starter. Otherwise it does not insert the
1085terminator and starter, so it effectively continues the current
1086comment across multiple lines. In languages that allow multi-line
1087comments, the choice of value for this variable is a matter of taste.
1088The default for this variable depends on the major mode.
1089 1067
1090@vindex comment-indent-function 1068@vindex comment-indent-function
1091 The variable @code{comment-indent-function} should contain a function 1069 The variable @code{comment-indent-function} should contain a function
@@ -1139,7 +1117,7 @@ mode which @kbd{C-h S} does support.
1139@node Man Page 1117@node Man Page
1140@subsection Man Page Lookup 1118@subsection Man Page Lookup
1141 1119
1142@cindex manual page 1120@cindex man page
1143 On Unix, the main form of on-line documentation was the @dfn{manual 1121 On Unix, the main form of on-line documentation was the @dfn{manual
1144page} or @dfn{man page}. In the GNU operating system, we aim to 1122page} or @dfn{man page}. In the GNU operating system, we aim to
1145replace man pages with better-organized manuals that you can browse 1123replace man pages with better-organized manuals that you can browse
@@ -1148,71 +1126,51 @@ still useful to read manual pages.
1148 1126
1149@findex manual-entry 1127@findex manual-entry
1150 You can read the man page for an operating system command, library 1128 You can read the man page for an operating system command, library
1151function, or system call, with the @kbd{M-x man} command. It 1129function, or system call, with the @kbd{M-x man} command. This
1152runs the @code{man} program to format the man page; if the system 1130prompts for a topic, with completion (@pxref{Completion}), and runs
1153permits, it runs @code{man} asynchronously, so that you can keep on 1131the @command{man} program to format the corresponding man page. If
1154editing while the page is being formatted. (On MS-DOS and MS-Windows 1132the system permits, it runs @command{man} asynchronously, so that you
11553, you cannot edit while Emacs waits for @code{man} to finish.) The 1133can keep on editing while the page is being formatted. The result
1156result goes in a buffer named @samp{*Man @var{topic}*}. These buffers 1134goes in a buffer named @samp{*Man @var{topic}*}. These buffers use a
1157use a special major mode, Man mode, that facilitates scrolling and 1135special major mode, Man mode, that facilitates scrolling and jumping
1158jumping to other manual pages. For details, type @kbd{C-h m} while in 1136to other manual pages. For details, type @kbd{C-h m} while in a Man
1159a man page buffer. 1137mode buffer.
1160 1138
1161@cindex sections of manual pages 1139@cindex sections of manual pages
1162 Each man page belongs to one of ten or more @dfn{sections}, each 1140 Each man page belongs to one of ten or more @dfn{sections}, each
1163named by a digit or by a digit and a letter. Sometimes there are 1141named by a digit or by a digit and a letter. Sometimes there are man
1164multiple man pages with the same name in different sections. To read 1142pages with the same name in different sections. To read a man page
1165a man page from a specific section, type 1143from a specific section, type @samp{@var{topic}(@var{section})} or
1166@samp{@var{topic}(@var{section})} or @samp{@var{section} @var{topic}} 1144@samp{@var{section} @var{topic}} when @kbd{M-x manual-entry} prompts
1167when @kbd{M-x manual-entry} prompts for the topic. For example, to 1145for the topic. For example, the man page for the C library function
1168read the man page for the C library function @code{chmod} (as opposed 1146@code{chmod} is in section 2, but there is a shell command of the same
1169to a command of the same name), type @kbd{M-x manual-entry @key{RET} 1147name, whose man page is in section 1; to view the former, type
1170chmod(2) @key{RET}}. (@code{chmod} is a system call, so it is in 1148@kbd{M-x manual-entry @key{RET} chmod(2) @key{RET}}.
1171section @samp{2}.)
1172 1149
1173@vindex Man-switches 1150@vindex Man-switches
1174 If you do not specify a section, the results depend on how the 1151@kindex M-n @r{(Man mode)}
1175@code{man} program works on your system. Some of them display only 1152@kindex M-p @r{(Man mode)}
1176the first man page they find. Others display all man pages that have 1153 If you do not specify a section, @kbd{M-x man} normally displays
1177the specified name, so you can move between them with the @kbd{M-n} 1154only the first man page found. On some systems, the @code{man}
1178and @kbd{M-p} keys@footnote{On some systems, the @code{man} program 1155program accepts a @samp{-a} command-line option, which tells it to
1179accepts a @samp{-a} command-line option which tells it to display all 1156display all the man pages for the specified topic. To make use of
1180the man pages for the specified topic. If you want this behavior, you 1157this, change the value of the variable @code{Man-switches} to
1181can add this option to the value of the variable @code{Man-switches}.}. 1158@samp{"-a"}. Then, in the Man mode buffer, you can type @kbd{M-n} and
1182The mode line shows how many manual pages are present in the Man buffer. 1159@kbd{M-p} to switch between man pages in different sections. The mode
1183 1160line shows how many manual pages are available.
1184@vindex Man-fontify-manpage-flag
1185 By default, Emacs highlights the text in man pages. For a long man
1186page, highlighting can take substantial time. You can turn off
1187highlighting of man pages by setting the variable
1188@code{Man-fontify-manpage-flag} to @code{nil}.
1189
1190@findex Man-fontify-manpage
1191 If you insert the text of a man page into an Emacs buffer in some
1192other fashion, you can use the command @kbd{M-x Man-fontify-manpage} to
1193perform the same conversions that @kbd{M-x manual-entry} does.
1194 1161
1195@findex woman 1162@findex woman
1196@cindex manual pages, on MS-DOS/MS-Windows 1163@cindex manual pages, on MS-DOS/MS-Windows
1197 An alternative way of reading manual pages is the @kbd{M-x woman} 1164 An alternative way of reading manual pages is the @kbd{M-x woman}
1198command@footnote{The name of the command, @code{woman}, is an acronym 1165command. Unlike @kbd{M-x man}, it does not run any external programs
1199for ``w/o (without) man,'' since it doesn't use the @code{man} 1166to format and display the man pages; the formatting is done by Emacs,
1200program.}. Unlike @kbd{M-x man}, it does not run any external 1167so it works on systems such as MS-Windows where the @command{man}
1201programs to format and display the man pages; instead it does the job 1168program may be unavailable. It prompts for a man page, and displays
1202in Emacs Lisp, so it works on systems such as MS-Windows, where the 1169it in a buffer named @samp{*WoMan @var{section} @var{topic}}.
1203@code{man} program (and other programs it uses) are not generally 1170
1204available. 1171 @kbd{M-x woman} computes the completion list for manpages the first
1205 1172time you invoke the command. With a numeric argument, it recomputes
1206 @kbd{M-x woman} prompts for a name of a manual page, and provides 1173this list; this is useful if you add or delete manual pages.
1207completion based on the list of manual pages that are installed on
1208your machine; the list of available manual pages is computed
1209automatically the first time you invoke @code{woman}. The word at
1210point in the current buffer is used to suggest the default for the
1211name of the manual page.
1212
1213 With a numeric argument, @kbd{M-x woman} recomputes the list of the
1214manual pages used for completion. This is useful if you add or delete
1215manual pages.
1216 1174
1217 If you type a name of a manual page and @kbd{M-x woman} finds that 1175 If you type a name of a manual page and @kbd{M-x woman} finds that
1218several manual pages by the same name exist in different sections, it 1176several manual pages by the same name exist in different sections, it
@@ -1220,48 +1178,51 @@ pops up a window with possible candidates asking you to choose one of
1220them. 1178them.
1221 1179
1222 For more information about setting up and using @kbd{M-x woman}, see 1180 For more information about setting up and using @kbd{M-x woman}, see
1223@ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The WoMan 1181@ifinfo
1224Manual}. 1182@ref{Top, WoMan, Browse UN*X Manual Pages WithOut Man, woman, The
1183WoMan Manual}.
1184@end ifinfo
1185@ifnotinfo
1186the WoMan Info manual, which is distributed with Emacs.
1187@end ifnotinfo
1225 1188
1226@node Lisp Doc 1189@node Lisp Doc
1227@subsection Emacs Lisp Documentation Lookup 1190@subsection Emacs Lisp Documentation Lookup
1228 1191
1229 As you edit Lisp code to be run in Emacs, you can use the commands 1192 When editing Emacs Lisp code, you can use the commands @kbd{C-h f}
1230@kbd{C-h f} (@code{describe-function}) and @kbd{C-h v} 1193(@code{describe-function}) and @kbd{C-h v} (@code{describe-variable})
1231(@code{describe-variable}) to view documentation of functions and 1194to view the built-in documentation for the Lisp functions and
1232variables that you want to use. These commands use the minibuffer to 1195variables that you want to use. @xref{Name Help}.
1233read the name of a function or variable to document, and display the
1234documentation in a window. Their default arguments are based on the
1235code in the neighborhood of point. For @kbd{C-h f}, the default is
1236the function called in the innermost list containing point. @kbd{C-h
1237v} uses the symbol name around or adjacent to point as its default.
1238 1196
1239@cindex Eldoc mode 1197@cindex Eldoc mode
1240@findex eldoc-mode 1198@findex eldoc-mode
1241 A more automatic but less powerful method is Eldoc mode. This minor 1199 Eldoc is a buffer-local minor mode that helps with looking up Lisp
1242mode constantly displays in the echo area the argument list for the 1200documention. When it is enabled, the echo area displays some useful
1243function being called at point. (In other words, it finds the 1201information whenever there is a Lisp function or variable at point;
1244function call that point is contained in, and displays the argument 1202for a function, it shows the argument list, and for a variable it
1245list of that function.) If point is over a documented variable, it 1203shows the first line of the variable's documentation string. To
1246shows the first line of the variable's docstring. Eldoc mode applies 1204toggle Eldoc mode, type @kbd{M-x eldoc-mode}. Eldoc mode can be used
1247in Emacs Lisp and Lisp Interaction modes, and perhaps a few others 1205with the Emacs Lisp and Lisp Interaction major modes.
1248that provide special support for looking up doc strings. Use the
1249command @kbd{M-x eldoc-mode} to enable or disable this feature.
1250 1206
1251@node Hideshow 1207@node Hideshow
1252@section Hideshow minor mode 1208@section Hideshow minor mode
1209@cindex Hideshow mode
1210@cindex mode, Hideshow
1253 1211
1254@findex hs-minor-mode 1212@findex hs-minor-mode
1255 Hideshow minor mode provides selective display of portions of a 1213 Hideshow mode is a buffer-local minor mode that allows you to
1256program, known as @dfn{blocks}. You can use @kbd{M-x hs-minor-mode} 1214selectively display portions of a program, which are referred to as
1257to enable or disable this mode, or add @code{hs-minor-mode} to the 1215@dfn{blocks}. Type @kbd{M-x hs-minor-mode} to toggle this minor mode
1258mode hook for certain major modes in order to enable it automatically 1216(@pxref{Minor Modes}).
1259for those modes. 1217
1218 When you use Hideshow mode to hide a block, the block disappears
1219from the screen, to be replaced by an ellipsis (three periods in a
1220row). Just what constitutes a block depends on the major mode. In C
1221mode and related modes, blocks are delimited by braces, while in Lisp
1222mode they are delimited by parentheses. Multi-line comments also
1223count as blocks.
1260 1224
1261 Just what constitutes a block depends on the major mode. In C mode 1225 Hideshow mode provides the following commands:
1262or C++ mode, they are delimited by braces, while in Lisp mode and
1263similar modes they are delimited by parentheses. Multi-line comments
1264also count as blocks.
1265 1226
1266@findex hs-hide-all 1227@findex hs-hide-all
1267@findex hs-hide-block 1228@findex hs-hide-block
@@ -1285,11 +1246,11 @@ Show the current block (@code{hs-show-block}).
1285@item C-c @@ C-c 1246@item C-c @@ C-c
1286Either hide or show the current block (@code{hs-toggle-hiding}). 1247Either hide or show the current block (@code{hs-toggle-hiding}).
1287@item S-Mouse-2 1248@item S-Mouse-2
1288Either hide or show the block you click on (@code{hs-mouse-toggle-hiding}). 1249Toggle hiding for the block you click on (@code{hs-mouse-toggle-hiding}).
1289@item C-c @@ C-M-h 1250@item C-c @@ C-M-h
1290Hide all top-level blocks (@code{hs-hide-all}). 1251Hide all top-level blocks (@code{hs-hide-all}).
1291@item C-c @@ C-M-s 1252@item C-c @@ C-M-s
1292Show everything in the buffer (@code{hs-show-all}). 1253Show all blocks in the buffer (@code{hs-show-all}).
1293@item C-c @@ C-l 1254@item C-c @@ C-l
1294Hide all blocks @var{n} levels below this block 1255Hide all blocks @var{n} levels below this block
1295(@code{hs-hide-level}). 1256(@code{hs-hide-level}).
@@ -1298,80 +1259,55 @@ Hide all blocks @var{n} levels below this block
1298@vindex hs-hide-comments-when-hiding-all 1259@vindex hs-hide-comments-when-hiding-all
1299@vindex hs-isearch-open 1260@vindex hs-isearch-open
1300@vindex hs-special-modes-alist 1261@vindex hs-special-modes-alist
1301 These variables exist for customizing Hideshow mode. 1262 These variables can be used to customize Hideshow mode:
1302 1263
1303@table @code 1264@table @code
1304@item hs-hide-comments-when-hiding-all 1265@item hs-hide-comments-when-hiding-all
1305Non-@code{nil} says that @kbd{hs-hide-all} should hide comments too. 1266If non-@code{nil}, @kbd{C-c @@ C-M-h} (@code{hs-hide-all}) hides
1267comments too.
1306 1268
1307@item hs-isearch-open 1269@item hs-isearch-open
1308Specifies what kind of hidden blocks incremental search should make 1270This variable specifies the conditions under which incremental search
1309visible. The value should be one of these four symbols: 1271should unhide a hidden block when matching text occurs within the
1310 1272block. Its value should be either @code{code} (unhide only code
1311@table @code 1273blocks), @code{comment} (unhide only comments), @code{t} (unhide both
1312@item code 1274code blocks and comments), or @code{nil} (unhide neither code blocks
1313Open only code blocks. 1275nor comments). The default value is @code{code}.
1314@item comment
1315Open only comments.
1316@item t
1317Open both code blocks and comments.
1318@item nil
1319Open neither code blocks nor comments.
1320@end table
1321
1322@item hs-special-modes-alist
1323A list of elements, each specifying how to initialize Hideshow
1324variables for one major mode. See the variable's documentation string
1325for more information.
1326@end table 1276@end table
1327 1277
1328@node Symbol Completion 1278@node Symbol Completion
1329@section Completion for Symbol Names 1279@section Completion for Symbol Names
1330@cindex completion (symbol names) 1280@cindex completion (symbol names)
1331 1281
1332 In Emacs, completion is something you normally do in the minibuffer 1282 Completion is normally done in the minibuffer (@pxref{Completion}),
1333(@pxref{Completion}). But one kind of completion is available in all 1283but you can also complete symbol names in ordinary Emacs buffers.
1334buffers: completion for symbol names.
1335 1284
1336@kindex M-TAB 1285@kindex M-TAB
1337 The character @kbd{M-@key{TAB}} runs a command to complete the 1286@kindex C-M-i
1338partial symbol before point against the set of meaningful symbol 1287 In programming language modes, type @kbd{C-M-i} or @kbd{M-@key{TAB}}
1339names. This command inserts at point any additional characters that 1288to complete the partial symbol before point. On graphical displays,
1340it can determine from the partial name. 1289the @kbd{M-@key{TAB}} key is usually reserved by the window manager
1341 1290for switching graphical windows, so you should type @kbd{C-M-i} or
1342 If your window manager defines @kbd{M-@key{TAB}} to switch windows, 1291@kbd{@key{ESC} @key{TAB}} instead.
1343you can type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i} instead.
1344However, most window managers let you customize these shortcuts, so
1345you can change any that interfere with the way you use Emacs.
1346
1347 If the partial name in the buffer has multiple possible completions
1348that differ in the very next character, so that it is impossible to
1349complete even one more character, @kbd{M-@key{TAB}} displays a list of
1350all possible completions in another window.
1351 1292
1352@cindex tags-based completion 1293@cindex tags-based completion
1353@cindex Info index completion 1294@findex completion-at-point
1354@findex complete-symbol
1355 In most programming language major modes, @kbd{M-@key{TAB}} runs the
1356command @code{complete-symbol}, which provides two kinds of completion.
1357Normally it does completion based on a tags table (@pxref{Tags}); with a
1358numeric argument (regardless of the value), it does completion based on
1359the names listed in the Info file indexes for your language. Thus, to
1360complete the name of a symbol defined in your own program, use
1361@kbd{M-@key{TAB}} with no argument; to complete the name of a standard
1362library function, use @kbd{C-u M-@key{TAB}}. Of course, Info-based
1363completion works only if there is an Info file for the standard library
1364functions of your language, and only if it is installed at your site.
1365
1366@cindex Lisp symbol completion 1295@cindex Lisp symbol completion
1367@cindex completion (Lisp symbols) 1296@cindex completion (Lisp symbols)
1368@findex lisp-complete-symbol 1297 In most programming language modes, @kbd{C-M-i} (or
1369 In Emacs-Lisp mode, the name space for completion normally consists of 1298@kbd{M-@key{TAB}}) invokes the command @code{completion-at-point},
1370nontrivial symbols present in Emacs---those that have function 1299which generates its completion list in a flexible way. If Semantic
1371definitions, values or properties. However, if there is an 1300mode is enabled, it tries to use the Semantic parser data for
1372open-parenthesis immediately before the beginning of the partial symbol, 1301completion (@pxref{Semantic}). If Semantic mode is not enabled or
1373only symbols with function definitions are considered as completions. 1302fails at performing completion, it tries to complete using the
1374The command which implements this is @code{lisp-complete-symbol}. 1303selected tags table (@pxref{Tags}). If in Emacs Lisp mode, it
1304performs completion using the function, variable, or property names
1305defined in the current Emacs session.
1306
1307 In all other respects, in-buffer symbol completion behaves like
1308minibuffer completion. For instance, if Emacs cannot complete to a
1309unique symbol, it displays a list of completion alternatives in
1310another window. @xref{Completion}.
1375 1311
1376 In Text mode and related modes, @kbd{M-@key{TAB}} completes words 1312 In Text mode and related modes, @kbd{M-@key{TAB}} completes words
1377based on the spell-checker's dictionary. @xref{Spelling}. 1313based on the spell-checker's dictionary. @xref{Spelling}.
@@ -1379,20 +1315,20 @@ based on the spell-checker's dictionary. @xref{Spelling}.
1379@node Glasses 1315@node Glasses
1380@section Glasses minor mode 1316@section Glasses minor mode
1381@cindex Glasses mode 1317@cindex Glasses mode
1382@cindex identifiers, making long ones readable 1318@cindex camel case
1383@cindex StudlyCaps, making them readable 1319@findex mode, Glasses
1384@findex glasses-mode 1320
1385 1321 Glasses mode is a buffer-local minor mode that makes it easier to
1386 Glasses minor mode makes @samp{unreadableIdentifiersLikeThis} 1322read mixed-case (or ``CamelCase'') symbols like
1387readable by altering the way they display. It knows two different 1323@samp{unReadableSymbol}, by altering how they are displayed. By
1388ways to do this: by displaying underscores between a lower-case letter 1324default, it displays extra underscores between each lower-case letter
1389and the following capital letter, and by emboldening the capital 1325and the following capital letter. This does not alter the buffer
1390letters. It does not alter the buffer text, only the way they 1326text, only how it is displayed.
1391display, so you can use it even on read-only buffers. You can use the 1327
1392command @kbd{M-x glasses-mode} to enable or disable the mode in the 1328 To toggle Glasses mode, type @kbd{M-x glasses-mode} (@pxref{Minor
1393current buffer; you can also add @code{glasses-mode} to the mode hook 1329Modes}). When Glasses mode is enabled, the minor mode indicator
1394of the programming language major modes in which you normally want 1330@samp{o^o} appears in the mode line. For more information about
1395to use Glasses mode. 1331Glasses mode, type @kbd{C-h P glasses @key{RET}}.
1396 1332
1397@node Semantic 1333@node Semantic
1398@section Semantic 1334@section Semantic
@@ -1400,23 +1336,24 @@ to use Glasses mode.
1400 1336
1401Semantic is a package that provides language-aware editing commands 1337Semantic is a package that provides language-aware editing commands
1402based on @code{source code parsers}. This section provides a brief 1338based on @code{source code parsers}. This section provides a brief
1403description of Semantic; 1339description of Semantic; for full details,
1404@ifnottex 1340@ifnottex
1405for full details, see @ref{Top, Semantic,, semantic, Semantic}. 1341see @ref{Top, Semantic,, semantic, Semantic}.
1406@end ifnottex 1342@end ifnottex
1407@iftex 1343@iftex
1408for full details, type @kbd{C-h i} (@code{info}) and then select the 1344see the Semantic Info manual, which is distributed with Emacs.
1409Semantic manual.
1410@end iftex 1345@end iftex
1411 1346
1412 Most of the ``language aware'' features in Emacs, such as font lock 1347 Most of the ``language aware'' features in Emacs, such as Font Lock
1413(@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular 1348mode (@pxref{Font Lock}), rely on ``rules of thumb''@footnote{Regular
1414expressions and syntax tables.} that usually give good results but are 1349expressions and syntax tables.} that usually give good results but are
1415never completely exact. In contrast, the parsers used by Semantic 1350never completely exact. In contrast, the parsers used by Semantic
1416have an exact understanding of programming language syntax. This 1351have an exact understanding of programming language syntax. This
1417allows Semantic to provide search, navigation, and completion commands 1352allows Semantic to provide search, navigation, and completion commands
1418that are powerful and precise. 1353that are powerful and precise.
1419 1354
1355@cindex Semantic mode
1356@cindex mode, Semantic
1420 To begin using Semantic, type @kbd{M-x semantic-mode} or click on 1357 To begin using Semantic, type @kbd{M-x semantic-mode} or click on
1421the menu item named @samp{Source Code Parsers (Semantic)} in the 1358the menu item named @samp{Source Code Parsers (Semantic)} in the
1422@samp{Tools} menu. This enables Semantic mode, a global minor mode. 1359@samp{Tools} menu. This enables Semantic mode, a global minor mode.
@@ -1464,30 +1401,30 @@ is idle.
1464@node Misc for Programs 1401@node Misc for Programs
1465@section Other Features Useful for Editing Programs 1402@section Other Features Useful for Editing Programs
1466 1403
1467 A number of Emacs commands that aren't designed specifically for 1404 Some Emacs commands that aren't designed specifically for editing
1468editing programs are useful for that nonetheless. 1405programs are useful for that nonetheless.
1469 1406
1470 The Emacs commands that operate on words, sentences and paragraphs 1407 The Emacs commands that operate on words, sentences and paragraphs
1471are useful for editing code. Most symbols names contain words 1408are useful for editing code. Most symbols names contain words
1472(@pxref{Words}); sentences can be found in strings and comments 1409(@pxref{Words}), while sentences can be found in strings and comments
1473(@pxref{Sentences}). Paragraphs in the strict sense can be found in 1410(@pxref{Sentences}). As for paragraphs, they are defined in most
1474program code (in long comments), but the paragraph commands are useful 1411programming language modes to begin and end at blank lines
1475in other places too, because programming language major modes define 1412(@pxref{Paragraphs}). Therefore, judicious use of blank lines to make
1476paragraphs to begin and end at blank lines (@pxref{Paragraphs}). 1413the program clearer will also provide useful chunks of text for the
1477Judicious use of blank lines to make the program clearer will also 1414paragraph commands to work on. Auto Fill mode, if enabled in a
1478provide useful chunks of text for the paragraph commands to work on. 1415programming language major mode, indents the new lines which it
1479Auto Fill mode, if enabled in a programming language major mode, 1416creates.
1480indents the new lines which it creates. 1417
1481 1418 Apart from Hideshow mode (@pxref{Hideshow}), another way to
1482 The selective display feature is useful for looking at the overall 1419selectively display parts of a program is to use the selective display
1483structure of a function (@pxref{Selective Display}). This feature 1420feature (@pxref{Selective Display}). Programming modes often also
1484hides the lines that are indented more than a specified amount. 1421support Outline minor mode (@pxref{Outline Mode}), which can be used
1485Programming modes often support Outline minor mode (@pxref{Outline 1422with the Foldout package (@pxref{Foldout}).
1486Mode}). The Foldout package provides folding-editor features 1423
1487(@pxref{Foldout}). 1424@ifinfo
1488
1489 The ``automatic typing'' features may be useful for writing programs. 1425 The ``automatic typing'' features may be useful for writing programs.
1490@xref{Top,,Autotyping, autotype, Autotyping}. 1426@xref{Top,,Autotyping, autotype, Autotyping}.
1427@end ifinfo
1491 1428
1492@node C Modes 1429@node C Modes
1493@section C and Related Modes 1430@section C and Related Modes
@@ -1509,9 +1446,14 @@ Mode}). The Foldout package provides folding-editor features
1509 1446
1510 This section gives a brief description of the special features 1447 This section gives a brief description of the special features
1511available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes. 1448available in C, C++, Objective-C, Java, CORBA IDL, Pike and AWK modes.
1512(These are called ``C mode and related modes.'') @xref{Top, , CC Mode, 1449(These are called ``C mode and related modes.'')
1513ccmode, CC Mode}, for a more extensive description of these modes 1450@ifinfo
1514and their special features. 1451@xref{Top,, CC Mode, ccmode, CC Mode}, for more details.
1452@end ifinfo
1453@ifnotinfo
1454For more details, see the CC mode Info manual, which is distributed
1455with Emacs.
1456@end ifnotinfo
1515 1457
1516@menu 1458@menu
1517* Motion in C:: Commands to move by C statements, etc. 1459* Motion in C:: Commands to move by C statements, etc.
@@ -1528,17 +1470,17 @@ and their special features.
1528related modes. 1470related modes.
1529 1471
1530@table @code 1472@table @code
1531@item M-x c-beginning-of-defun 1473@item C-M-a
1532@itemx M-x c-end-of-defun 1474@itemx C-M-e
1533@findex c-beginning-of-defun 1475@findex c-beginning-of-defun
1534@findex c-end-of-defun 1476@findex c-end-of-defun
1535Move point to the beginning or end of the current function or 1477Move point to the beginning or end of the current function or
1536top-level definition. These are found by searching for the least 1478top-level definition. In languages with enclosing scopes (such as
1479C++'s classes) the @dfn{current function} is the immediate one,
1480possibly inside a scope. Otherwise it is the one defined by the least
1537enclosing braces. (By contrast, @code{beginning-of-defun} and 1481enclosing braces. (By contrast, @code{beginning-of-defun} and
1538@code{end-of-defun} search for braces in column zero.) If you are 1482@code{end-of-defun} search for braces in column zero.) @xref{Moving
1539editing code where the opening brace of a function isn't placed in 1483by Defuns}.
1540column zero, you may wish to bind @code{C-M-a} and @code{C-M-e} to
1541these commands. @xref{Moving by Defuns}.
1542 1484
1543@item C-c C-u 1485@item C-c C-u
1544@kindex C-c C-u @r{(C mode)} 1486@kindex C-c C-u @r{(C mode)}
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index 0df4a3a7bb5..d05af468fa1 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -1340,17 +1340,18 @@ included in GNU mailutils (the ``mailutils version,''
1340command line syntax and the same basic subset of options. However, the 1340command line syntax and the same basic subset of options. However, the
1341Mailutils version offers additional features. 1341Mailutils version offers additional features.
1342 1342
1343 The Emacs version of @code{movemail} is able to retrieve mail from the 1343 The Emacs version of @code{movemail} is able to retrieve mail from
1344usual UNIX mailbox formats and from remote mailboxes using the POP3 1344the usual Unix mailbox formats and from remote mailboxes using the
1345protocol. 1345POP3 protocol.
1346 1346
1347 The Mailutils version is able to handle a wide set of mailbox 1347 The Mailutils version is able to handle a wide set of mailbox
1348formats, such as plain UNIX mailboxes, @code{maildir} and @code{MH} 1348formats, such as plain Unix mailboxes, @code{maildir} and @code{MH}
1349mailboxes, etc. It is able to access remote mailboxes using the POP3 or 1349mailboxes, etc. It is able to access remote mailboxes using the POP3
1350IMAP4 protocol, and can retrieve mail from them using a TLS encrypted 1350or IMAP4 protocol, and can retrieve mail from them using a TLS
1351channel. It also accepts mailbox arguments in @acronym{URL} form. 1351encrypted channel. It also accepts mailbox arguments in @acronym{URL}
1352The detailed description of mailbox @acronym{URL}s can be found in 1352form. The detailed description of mailbox @acronym{URL}s can be found
1353@ref{URL,,,mailutils,Mailbox URL Formats}. In short, a @acronym{URL} is: 1353in @ref{URL,,,mailutils,Mailbox URL Formats}. In short, a
1354@acronym{URL} is:
1354 1355
1355@smallexample 1356@smallexample
1356@var{proto}://[@var{user}[:@var{password}]@@]@var{host-or-file-name} 1357@var{proto}://[@var{user}[:@var{password}]@@]@var{host-or-file-name}
@@ -1381,9 +1382,9 @@ local mailbox.
1381 1382
1382@table @code 1383@table @code
1383@item mbox 1384@item mbox
1384Usual UNIX mailbox format. In this case, neither @var{user} nor 1385Usual Unix mailbox format. In this case, neither @var{user} nor
1385@var{pass} are used, and @var{host-or-file-name} denotes the file name of 1386@var{pass} are used, and @var{host-or-file-name} denotes the file name
1386the mailbox file, e.g., @code{mbox://var/spool/mail/smith}. 1387of the mailbox file, e.g., @code{mbox://var/spool/mail/smith}.
1387 1388
1388@item mh 1389@item mh
1389A local mailbox in the @acronym{MH} format. @var{User} and 1390A local mailbox in the @acronym{MH} format. @var{User} and
@@ -1524,7 +1525,7 @@ use it, add the @samp{--tls} flag to @code{rmail-movemail-flags}.
1524@section Retrieving Mail from Local Mailboxes in Various Formats 1525@section Retrieving Mail from Local Mailboxes in Various Formats
1525 1526
1526 If your incoming mail is stored on a local machine in a format other 1527 If your incoming mail is stored on a local machine in a format other
1527than UNIX mailbox, you will need the Mailutils @code{movemail} to 1528than Unix mailbox, you will need the Mailutils @code{movemail} to
1528retrieve it. @xref{Movemail}, for the detailed description of 1529retrieve it. @xref{Movemail}, for the detailed description of
1529@code{movemail} versions. For example, to access mail from a inbox in 1530@code{movemail} versions. For example, to access mail from a inbox in
1530@code{maildir} format located in @file{/var/spool/mail/in}, you would 1531@code{maildir} format located in @file{/var/spool/mail/in}, you would
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index 8f353961afb..37a85a89ea2 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -21,7 +21,10 @@ are also often useful for editing programs.
21the file contains ordinary text, use Text mode, which customizes Emacs 21the file contains ordinary text, use Text mode, which customizes Emacs
22in small ways for the syntactic conventions of text. Outline mode 22in small ways for the syntactic conventions of text. Outline mode
23provides special commands for operating on text with an outline 23provides special commands for operating on text with an outline
24structure. 24structure. Org mode extends Outline mode and turn Emacs into a
25full-fledged organizer: you can manage TODO lists, store notes and
26publish them in many formats.
27
25@iftex 28@iftex
26@xref{Outline Mode}. 29@xref{Outline Mode}.
27@end iftex 30@end iftex
@@ -32,9 +35,14 @@ structure.
32@findex nxml-mode 35@findex nxml-mode
33 Emacs has other major modes for text which contains ``embedded'' 36 Emacs has other major modes for text which contains ``embedded''
34commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and 37commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and
35SGML (@pxref{HTML Mode}); XML (@pxref{Top,The nXML Mode 38SGML (@pxref{HTML Mode}); XML
36Manual,,nxml-mode, nXML Mode}); and Groff and Nroff (@pxref{Nroff 39@ifinfo
37Mode}). 40(@pxref{Top,The nXML Mode Manual,,nxml-mode, nXML Mode});
41@end ifinfo
42@ifnotinfo
43(see the nXML mode Info manual, which is distributed with Emacs);
44@end ifnotinfo
45and Groff and Nroff (@pxref{Nroff Mode}).
38 46
39@cindex ASCII art 47@cindex ASCII art
40 If you need to edit pictures made out of text characters (commonly 48 If you need to edit pictures made out of text characters (commonly
@@ -65,6 +73,7 @@ for editing such pictures.
65* Case:: Changing the case of text. 73* Case:: Changing the case of text.
66* Text Mode:: The major modes for editing text files. 74* Text Mode:: The major modes for editing text files.
67* Outline Mode:: Editing outlines. 75* Outline Mode:: Editing outlines.
76* Org Mode:: The Emacs organizer.
68* TeX Mode:: Editing input to the formatter TeX. 77* TeX Mode:: Editing input to the formatter TeX.
69* HTML Mode:: Editing HTML and SGML files. 78* HTML Mode:: Editing HTML and SGML files.
70* Nroff Mode:: Editing input to the formatter nroff. 79* Nroff Mode:: Editing input to the formatter nroff.
@@ -1245,6 +1254,143 @@ automatically by putting this in your init file (@pxref{Init File}):
1245(eval-after-load "outline" '(require 'foldout)) 1254(eval-after-load "outline" '(require 'foldout))
1246@end example 1255@end example
1247 1256
1257@node Org Mode
1258@section Org Mode
1259@kindex TAB @r{(Org Mode)}
1260@kindex S-TAB @r{(Org Mode)}
1261@cindex organizer
1262@cindex planner
1263@findex org-mode
1264@cindex fold
1265@cindex headline
1266@kindex M-<up> @r{(Org Mode)}
1267@kindex M-<down> @r{(Org Mode)}
1268@kindex M-<left> @r{(Org Mode)}
1269@kindex M-<right> @r{(Org Mode)}
1270@kindex S-M-<up> @r{(Org Mode)}
1271@kindex S-M-<down> @r{(Org Mode)}
1272@kindex S-M-<left> @r{(Org Mode)}
1273@kindex S-M-<right> @r{(Org Mode)}
1274
1275Org mode extends Outline mode to turn Emacs into an organizer and an
1276authoring system.
1277
1278When editing a file ending with the @file{.org} extension, Emacs
1279automatically uses @code{org-mode} as the major mode. In this mode,
1280headlines start with one (or more) leading star(s) and comments start
1281with the @code{#} character at the beginning of a line.
1282
1283@example
1284* This is the first headline
1285** This is a first sub-headline
1286* This is the second headline
1287
1288Some content here.
1289
1290# Some comment here.
1291@end example
1292
1293From here, you can use Org mode as a simple outliner: @key{TAB} on a
1294headline will cycle through the various folding states of a subtree,
1295and @key{S-TAB} anywhere in the buffer will (un)fold the whole
1296structure.
1297
1298You can also manipulate the structure of your document by moving a
1299headline up and down with @key{M-<up>} and @key{M-<down>}, or by
1300promoting and demoting a headline with @key{M-<left>} and
1301@key{M-<left>}. If you want to act on the whole subtree (i.e. the
1302headline and its content, including other headlines), simply add the
1303@kbd{Shift} key and use @key{S-M-<up>}, @key{S-M-<down>},
1304@key{S-M-<left>} and @key{S-M-<right>}.
1305
1306For further details, see @ref{Document Structure,,,org, The Org Manual}.
1307
1308@menu
1309* Org as an organizer:: Manage TODO lists and agendas
1310* Org as an authoring system:: Export to various formats
1311@end menu
1312
1313@node Org as an organizer
1314@subsection Org as an organizer
1315
1316@cindex TODO keywords
1317@kindex C-c C-t @r{(Org Mode)}
1318@kindex C-c C-s @r{(Org Mode)}
1319@kindex C-c C-d @r{(Org Mode)}
1320@vindex org-todo-keywords
1321@findex org-todo
1322@findex org-agenda
1323@cindex scheduled
1324@cindex deadline
1325@cindex agenda
1326
1327Each headline can be turned into a TODO item calling @code{org-todo}
1328with @key{C-c C-t} anywhere on it. This will add the TODO keyword
1329@code{TODO}. Hit @key{C-c C-t} to cycle through the list of available
1330TODO keywords: you can configure the variable @code{org-todo-keywords}
1331to use your own list of keywords.
1332
1333Now that you have something to do, let's add a date to it: pressing
1334@key{C-c C-s} on a headline will add @code{SCHEDULED} below it, and
1335you will be prompted for a date through the calendar. @key{C-c C-d}
1336has the same effect, except that the item will have a @code{DEADLINE}
1337instead.
1338
1339Now that some TODO items are planned in the current file, add it to
1340the list of agenda files with @key{C-c [}. Calling the interactive
1341command @code{org-agenda} will prompt you for what you want to see: a
1342list of things to do this week, a list of TODO items with specific
1343keywords, etc.
1344
1345For further details, see @ref{TODO items,,,org, The Org Manual} and
1346@ref{Dates and times,,,org, The Org Manual}.
1347
1348@node Org as an authoring system
1349@subsection Org as an authoring system
1350@cindex export
1351@findex org-export
1352@cindex publish
1353@cindex code block
1354@cindex quote
1355
1356You may want to format your Org notes nicely and to prepare them for
1357export and publication. Org supports simple text formatting:
1358
1359@example
1360- This text is /emphasized/
1361- This item uses *a bold font*
1362- This text is _underlined_
1363- This text uses =a teletype font=
1364@end example
1365
1366If a paragraph is a quote or an example, you can use specific
1367environments:
1368
1369@example
1370#+begin_quote
1371``This is a quote.''
1372#+end_quote
1373
1374#+begin_example
1375This is an example.
1376#+end_example
1377@end example
1378
1379These environments will be displayed in a specific way with respect
1380to the selected export/publish backend.
1381
1382To export the current buffer, press the @key{C-c C-e} key anywhere in
1383an Org buffer. Supported export formats include @code{HTML}, La@TeX{}
1384and @file{.odt} (OpenDocument format.) Depending on your system
1385installation, you can also directly export to @code{pdf}.
1386
1387To export several files at once to a specific directory either locally
1388or on the Internet, you will need to define a list of projects through
1389the variable @code{org-publish-project-alist}.
1390
1391For further details, see @ref{Exporting,,,org, The Org Manual} and
1392@ref{Publishing,,,org, The Org Manual}.
1393
1248@node TeX Mode 1394@node TeX Mode
1249@section @TeX{} Mode 1395@section @TeX{} Mode
1250@cindex @TeX{} mode 1396@cindex @TeX{} mode
@@ -1298,8 +1444,8 @@ more information, see the documentation string for the command
1298@code{bibtex-mode}. 1444@code{bibtex-mode}.
1299 1445
1300@item 1446@item
1301The Ref@TeX{} package provides a minor mode which can be used in 1447The Ref@TeX{} package provides a minor mode which can be used with
1302conjunction with La@TeX{} mode to manage bibliographic references. 1448La@TeX{} mode to manage bibliographic references.
1303@ifinfo 1449@ifinfo
1304@xref{Top,The Ref@TeX{} Manual,,reftex}. 1450@xref{Top,The Ref@TeX{} Manual,,reftex}.
1305@end ifinfo 1451@end ifinfo
@@ -1764,8 +1910,15 @@ xml-mode}. Emacs uses nXML mode for files which have the extension
1764@file{.xml}. For XHTML files, which have the extension @file{.xhtml}, 1910@file{.xml}. For XHTML files, which have the extension @file{.xhtml},
1765Emacs uses HTML mode by default; you can make it use nXML mode by 1911Emacs uses HTML mode by default; you can make it use nXML mode by
1766customizing the variable @code{auto-mode-alist} (@pxref{Choosing 1912customizing the variable @code{auto-mode-alist} (@pxref{Choosing
1767Modes}). nXML mode is described in its own manual: @xref{Top, nXML 1913Modes}).
1914@ifinfo
1915nXML mode is described in its own manual: @xref{Top, nXML
1768Mode,,nxml-mode, nXML Mode}. 1916Mode,,nxml-mode, nXML Mode}.
1917@end ifinfo
1918@ifnotinfo
1919nXML mode is described in an Info manual, which is distributed with
1920Emacs.
1921@end ifnotinfo
1769 1922
1770@vindex sgml-xml-mode 1923@vindex sgml-xml-mode
1771 You may choose to use the less powerful SGML mode for editing XML, 1924 You may choose to use the less powerful SGML mode for editing XML,
@@ -1781,13 +1934,16 @@ always insert explicit closing tags as well.
1781 1934
1782@cindex nroff 1935@cindex nroff
1783@findex nroff-mode 1936@findex nroff-mode
1784 Nroff mode is a mode like Text mode but modified to handle nroff commands 1937@vindex nroff-mode-hook
1785present in the text. Invoke @kbd{M-x nroff-mode} to enter this mode. It 1938 Nroff mode is a major mode derived from Text mode, which is
1786differs from Text mode in only a few ways. All nroff command lines are 1939specialized for editing nroff files (e.g.@: Unix man pages). Type
1787considered paragraph separators, so that filling will never garble the 1940@kbd{M-x nroff-mode} to enter this mode. Entering Nroff mode runs the
1788nroff commands. Pages are separated by @samp{.bp} commands. Comments 1941hook @code{text-mode-hook}, followed by @code{nroff-mode-hook}
1789start with backslash-doublequote. Also, three special commands are 1942(@pxref{Hooks}).
1790provided that are not in Text mode: 1943
1944 In Nroff mode, nroff command lines are treated as paragraph
1945separators, pages are separated by @samp{.bp} commands, and comments
1946start with backslash-doublequote. It also defines these commands:
1791 1947
1792@findex forward-text-line 1948@findex forward-text-line
1793@findex backward-text-line 1949@findex backward-text-line
@@ -1807,23 +1963,16 @@ nroff commands) in the region (@code{count-text-lines}).
1807@end table 1963@end table
1808 1964
1809@findex electric-nroff-mode 1965@findex electric-nroff-mode
1810 The other feature of Nroff mode is that you can turn on Electric Nroff 1966 Electric Nroff mode is a buffer-local minor mode that can be used
1811mode. This is a minor mode that you can turn on or off with @kbd{M-x 1967with Nroff mode. To toggle this minor mode, type @kbd{M-x
1812electric-nroff-mode} (@pxref{Minor Modes}). When the mode is on, each 1968electric-nroff-mode} (@pxref{Minor Modes}). When the mode is on, each
1813time you use @key{RET} to end a line that contains an nroff command that 1969time you type @key{RET} to end a line containing an nroff command that
1814opens a kind of grouping, the matching nroff command to close that 1970opens a kind of grouping, the nroff command to close that grouping is
1815grouping is automatically inserted on the following line. For example, 1971automatically inserted on the following line.
1816if you are at the beginning of a line and type @kbd{.@: ( b @key{RET}},
1817this inserts the matching command @samp{.)b} on a new line following
1818point.
1819 1972
1820 If you use Outline minor mode with Nroff mode (@pxref{Outline Mode}), 1973 If you use Outline minor mode with Nroff mode (@pxref{Outline
1821heading lines are lines of the form @samp{.H} followed by a number (the 1974Mode}), heading lines are lines of the form @samp{.H} followed by a
1822header level). 1975number (the header level).
1823
1824@vindex nroff-mode-hook
1825 Entering Nroff mode runs the hook @code{text-mode-hook}, followed by
1826the hook @code{nroff-mode-hook} (@pxref{Hooks}).
1827 1976
1828@node Enriched Text 1977@node Enriched Text
1829@section Enriched Text 1978@section Enriched Text
@@ -2149,18 +2298,16 @@ hides text), and @code{intangible} (which disallows moving point
2149within the text). The @samp{Remove Special} menu item removes all of 2298within the text). The @samp{Remove Special} menu item removes all of
2150these special properties from the text in the region. 2299these special properties from the text in the region.
2151 2300
2152 The @code{invisible} and @code{intangible} properties are @emph{not} 2301 The @code{invisible} and @code{intangible} properties are not saved
2153saved in the text/enriched format. The @code{read-only} property is 2302in the @samp{text/enriched} format.
2154saved, but it is not a standard part of the text/enriched format, so
2155other editors may not respect it.
2156 2303
2157@node Text Based Tables 2304@node Text Based Tables
2158@section Editing Text-based Tables 2305@section Editing Text-based Tables
2159@cindex table mode 2306@cindex table mode
2160@cindex text-based tables 2307@cindex text-based tables
2161 2308
2162 Table mode provides an easy and intuitive way to create and edit 2309 The @code{table} package provides commands to easily edit text-based
2163text-based tables. Here is an example of such a table: 2310tables. Here is an example of what such a table looks like:
2164 2311
2165@smallexample 2312@smallexample
2166@group 2313@group
@@ -2170,27 +2317,23 @@ text-based tables. Here is an example of such a table:
2170| forward-char |Move point right N characters | C-f | 2317| forward-char |Move point right N characters | C-f |
2171| |(left if N is negative). | | 2318| |(left if N is negative). | |
2172| | | | 2319| | | |
2173| |On reaching end of buffer, stop | |
2174| |and signal error. | |
2175+-----------------+--------------------------------+-----------------+ 2320+-----------------+--------------------------------+-----------------+
2176| backward-char |Move point left N characters | C-b | 2321| backward-char |Move point left N characters | C-b |
2177| |(right if N is negative). | | 2322| |(right if N is negative). | |
2178| | | | 2323| | | |
2179| |On attempt to pass beginning or | |
2180| |end of buffer, stop and signal | |
2181| |error. | |
2182+-----------------+--------------------------------+-----------------+ 2324+-----------------+--------------------------------+-----------------+
2183@end group 2325@end group
2184@end smallexample 2326@end smallexample
2185 2327
2186 Table mode allows the contents of the table such as this one to be 2328 When Emacs recognizes such a stretch of text as a table
2187easily manipulated by inserting or deleting characters inside a cell. 2329(@pxref{Table Recognition}), editing the contents of each table cell
2188A cell is effectively a localized rectangular edit region and edits to 2330will automatically resize the table, whenever the contents become too
2189a cell do not affect the contents of the surrounding cells. If the 2331large to fit in the cell. You can use the commands defined in the
2190contents do not fit into a cell, then the cell is automatically 2332following sections for navigating and editing the table layout.
2191expanded in the vertical and/or horizontal directions and the rest of 2333
2192the table is restructured and reformatted in accordance with the 2334@findex table-fixed-width-mode
2193growth of the cell. 2335 To toggle the automatic table resizing feature, type @kbd{M-x
2336table-fixed-width-mode}.
2194 2337
2195@menu 2338@menu
2196* Table Definition:: What is a text based table. 2339* Table Definition:: What is a text based table.
@@ -2198,102 +2341,87 @@ growth of the cell.
2198* Table Recognition:: How to activate and deactivate tables. 2341* Table Recognition:: How to activate and deactivate tables.
2199* Cell Commands:: Cell-oriented commands in a table. 2342* Cell Commands:: Cell-oriented commands in a table.
2200* Cell Justification:: Justifying cell contents. 2343* Cell Justification:: Justifying cell contents.
2201* Row Commands:: Manipulating rows of table cell. 2344* Table Rows and Columns:: Inserting and deleting rows and columns.
2202* Column Commands:: Manipulating columns of table cell.
2203* Fixed Width Mode:: Fixing cell width.
2204* Table Conversion:: Converting between plain text and tables. 2345* Table Conversion:: Converting between plain text and tables.
2205* Measuring Tables:: Analyzing table dimension.
2206* Table Misc:: Table miscellany. 2346* Table Misc:: Table miscellany.
2207@end menu 2347@end menu
2208 2348
2209@node Table Definition 2349@node Table Definition
2210@subsection What is a Text-based Table? 2350@subsection What is a Text-based Table?
2351@cindex cells, for text-based tables
2211 2352
2212 Keep the following examples of valid tables in mind as a reference 2353 A @dfn{table} consists of a rectangular text area which is divided
2213while you read this section: 2354into @dfn{cells}. Each cell must be at least one character wide and
2214 2355one character high, not counting its border lines. A cell can be
2215@example 2356subdivided into more cells, but they cannot overlap.
2216 +--+----+---+ +-+ +--+-----+
2217 | | | | | | | | |
2218 +--+----+---+ +-+ | +--+--+
2219 | | | | | | | |
2220 +--+----+---+ +--+--+ |
2221 | | |
2222 +-----+--+
2223@end example
2224
2225 A table consists of a rectangular frame whose inside is divided into
2226cells. Each cell must be at least one character wide and one
2227character high, not counting its border lines. A cell can be
2228subdivided into multiple rectangular cells, but cells cannot overlap.
2229 2357
2230 The table frame and cell border lines are made of three special 2358 Cell border lines are drawn with three special characters, specified
2231characters. These variables specify those characters: 2359by the following variables:
2232 2360
2233@table @code 2361@table @code
2234@vindex table-cell-vertical-char 2362@vindex table-cell-vertical-char
2235@item table-cell-vertical-char 2363@item table-cell-vertical-char
2236Holds the character used for vertical lines. The default value is 2364The character used for vertical lines. The default is @samp{|}.
2237@samp{|}.
2238 2365
2239@vindex table-cell-horizontal-chars 2366@vindex table-cell-horizontal-chars
2240@item table-cell-horizontal-chars 2367@item table-cell-horizontal-chars
2241Holds the characters used for horizontal lines. The default value is 2368The characters used for horizontal lines. The default is @samp{"-="}.
2242@samp{"-="}.
2243 2369
2244@vindex table-cell-intersection-char 2370@vindex table-cell-intersection-char
2245@item table-cell-intersection-char 2371@item table-cell-intersection-char
2246Holds the character used at where horizontal line and vertical line 2372The character used for the intersection of horizontal and vertical
2247meet. The default value is @samp{+}. 2373lines. The default is @samp{+}.
2248@end table 2374@end table
2249 2375
2250@noindent 2376@noindent
2251Based on this definition, the following five tables are examples of invalid 2377The following are examples of @emph{invalid} tables:
2252tables:
2253 2378
2254@example 2379@example
2255 +-----+ +-----+ +--+ +-++--+ ++ 2380 +-----+ +--+ +-++--+
2256 | | | | | | | || | ++ 2381 | | | | | || |
2257 | +-+ | | | | | | || | 2382 | | | | | || |
2258 | | | | +--+ | +--+--+ +-++--+ 2383 +--+ | +--+--+ +-++--+
2259 | +-+ | | | | | | | +-++--+ 2384 | | | | | | +-++--+
2260 | | | | | | | | | || | 2385 | | | | | | | || |
2261 +-----+ +--+--+ +--+--+ +-++--+ 2386 +--+--+ +--+--+ +-++--+
2262 a b c d e 2387 a b c
2263@end example 2388@end example
2264 2389
2390@noindent
2265From left to right: 2391From left to right:
2266 2392
2267@enumerate a 2393@enumerate a
2268@item 2394@item
2269Overlapped cells or non-rectangular cells are not allowed. 2395Overlapped cells or non-rectangular cells are not allowed.
2270@item 2396@item
2271Same as a.
2272@item
2273The border must be rectangular. 2397The border must be rectangular.
2274@item 2398@item
2275Cells must have a minimum width/height of one character. 2399Cells must have a minimum width/height of one character.
2276@item
2277Same as d.
2278@end enumerate 2400@end enumerate
2279 2401
2280@node Table Creation 2402@node Table Creation
2281@subsection How to Create a Table? 2403@subsection Creating a Table
2282@cindex create a text-based table 2404@cindex create a text-based table
2283@cindex table creation 2405@cindex table creation
2284 2406
2285@findex table-insert 2407@findex table-insert
2286 The command to create a table is @code{table-insert}. When called 2408 To create a text-based table from scratch, type @kbd{M-x
2287interactively, it asks for the number of columns, number of rows, cell 2409table-insert}. This command prompts for the number of table columns,
2288width and cell height. The number of columns is the number of cells 2410the number of table rows, cell width and cell height. The cell width
2289horizontally side by side. The number of rows is the number of cells 2411and cell height do not include the cell borders; each can be specified
2290vertically within the table's height. The cell width is a number of 2412as a single integer (which means each cell is given the same
2291characters that each cell holds, left to right. The cell height is a 2413width/height), or as a sequence of integers separated by spaces or
2292number of lines each cell holds. The cell width and the cell height 2414commas (which specify the width/height of the individual table
2293can be either an integer (when the value is constant across the table) 2415columns/rows, counting from left to right for table columns and from
2294or a series of integer, separated by spaces or commas, where each 2416top to bottom for table rows). The specified table is then inserted
2295number corresponds to the next cell within a row from left to right, 2417at point.
2296or the next cell within a column from top to bottom. 2418
2419 The table inserted by @kbd{M-x table-insert} contains special text
2420properties, which tell Emacs to treat it specially as a text-based
2421table. If you save the buffer to a file and visit it again later,
2422those properties are lost, and the table appears to Emacs as an
2423ordinary piece of text. See the next section, for how to convert it
2424back into a table.
2297 2425
2298@node Table Recognition 2426@node Table Recognition
2299@subsection Table Recognition 2427@subsection Table Recognition
@@ -2301,103 +2429,97 @@ or the next cell within a column from top to bottom.
2301 2429
2302@findex table-recognize 2430@findex table-recognize
2303@findex table-unrecognize 2431@findex table-unrecognize
2304 Table mode maintains special text properties in the buffer to allow 2432 Existing text-based tables in a buffer, which lack the special text
2305editing in a convenient fashion. When a buffer with tables is saved 2433properties applied by @kbd{M-x table-insert}, are not treated
2306to its file, these text properties are lost, so when you visit this 2434specially as tables. To apply those text properties, type @kbd{M-x
2307file again later, Emacs does not see a table, but just formatted text. 2435table-recognize}. This command scans the current buffer,
2308To resurrect the table text properties, issue the @kbd{M-x 2436@dfn{recognizes} valid table cells, and applies the relevant text
2309table-recognize} command. It scans the current buffer, recognizes 2437properties. Conversely, type @kbd{M-x table-unrecognize} to
2310valid table cells, and attaches appropriate text properties to allow 2438@dfn{unrecognize} all tables in the current buffer, removing the
2311for table editing. The converse command, @code{table-unrecognize}, is 2439special text properties and converting tables back to plain text.
2312used to remove the special text properties and convert the buffer back 2440
2313to plain text. 2441 You can also use the following commands to selectively recognize or
2314 2442unrecognize tables:
2315 Special commands exist to enable or disable tables within a region,
2316enable or disable individual tables, and enable/disable individual
2317cells. These commands are:
2318 2443
2319@table @kbd 2444@table @kbd
2320@findex table-recognize-region 2445@findex table-recognize-region
2321@item M-x table-recognize-region 2446@item M-x table-recognize-region
2322Recognize tables within the current region and activate them. 2447Recognize tables within the current region.
2448
2323@findex table-unrecognize-region 2449@findex table-unrecognize-region
2324@item M-x table-unrecognize-region 2450@item M-x table-unrecognize-region
2325Deactivate tables within the current region. 2451Unrecognize tables within the current region.
2452
2326@findex table-recognize-table 2453@findex table-recognize-table
2327@item M-x table-recognize-table 2454@item M-x table-recognize-table
2328Recognize the table at point and activate it. 2455Recognize the table at point and activate it.
2456
2329@findex table-unrecognize-table 2457@findex table-unrecognize-table
2330@item M-x table-unrecognize-table 2458@item M-x table-unrecognize-table
2331Deactivate the table at point. 2459Deactivate the table at point.
2460
2332@findex table-recognize-cell 2461@findex table-recognize-cell
2333@item M-x table-recognize-cell 2462@item M-x table-recognize-cell
2334Recognize the cell at point and activate it. 2463Recognize the cell at point and activate it.
2464
2335@findex table-unrecognize-cell 2465@findex table-unrecognize-cell
2336@item M-x table-unrecognize-cell 2466@item M-x table-unrecognize-cell
2337Deactivate the cell at point. 2467Deactivate the cell at point.
2338@end table 2468@end table
2339 2469
2340 For another way of converting text into tables, see @ref{Table 2470 @xref{Table Conversion}, for another way to recognize a table.
2341Conversion}.
2342 2471
2343@node Cell Commands 2472@node Cell Commands
2344@subsection Commands for Table Cells 2473@subsection Commands for Table Cells
2345 2474
2346@findex table-forward-cell 2475@findex table-forward-cell
2347@findex table-backward-cell 2476@findex table-backward-cell
2348 The commands @code{table-forward-cell} and 2477 The commands @kbd{M-x table-forward-cell} and @kbd{M-x
2349@code{table-backward-cell} move point from the current cell to an 2478table-backward-cell} move point from the current cell to an adjacent
2350adjacent cell forward and backward respectively. The order of the 2479cell. The order is cyclic: when point is in the last cell of a table,
2351cells is cyclic: when point is in the last cell of a table, typing 2480@kbd{M-x table-forward-cell} moves to the first cell. Likewise, when
2352@kbd{M-x table-forward-cell} moves to the first cell in the table. 2481point is on the first cell, @kbd{M-x table-backward-cell} moves to the
2353Likewise @kbd{M-x table-backward-cell} from the first cell in a table 2482last cell.
2354moves to the last cell.
2355 2483
2356@findex table-span-cell 2484@findex table-span-cell
2357 The command @code{table-span-cell} merges the current cell with the 2485 @kbd{M-x table-span-cell} prompts for a direction---right, left,
2358adjacent cell in a specified direction---right, left, above or below. 2486above, or below---and merges the current cell with the adjacent cell
2359You specify the direction with the minibuffer. It does not allow 2487in that direction. This command signals an error if the merge would
2360merges which don't result in a legitimate cell layout. 2488result in an illegitimate cell layout.
2361 2489
2362@findex table-split-cell 2490@findex table-split-cell
2363@cindex text-based tables, split a cell
2364@cindex split table cell
2365 The command @code{table-split-cell} splits the current cell
2366vertically or horizontally. This command is a wrapper to the
2367direction specific commands @code{table-split-cell-vertically} and
2368@code{table-split-cell-horizontally}. You specify the direction with
2369a minibuffer argument.
2370
2371@findex table-split-cell-vertically 2491@findex table-split-cell-vertically
2372 The command @code{table-split-cell-vertically} splits the current
2373cell vertically and creates a pair of cells above and below where
2374point is located. The content in the original cell is split as well.
2375
2376@findex table-split-cell-horizontally 2492@findex table-split-cell-horizontally
2377 The command @code{table-split-cell-horizontally} splits the current 2493@cindex text-based tables, splitting cells
2378cell horizontally and creates a pair of cells right and left of where 2494@cindex splitting table cells
2379point is located. If the cell being split is not empty, this asks you 2495 @kbd{M-x table-split-cell} splits the current cell vertically or
2380how to handle the cell contents. The three options are: @code{split}, 2496horizontally, prompting for the direction with the minibuffer. The
2381@code{left}, or @code{right}. @code{split} splits the contents at 2497commands @kbd{M-x table-split-cell-vertically} and @kbd{M-x
2382point literally, while the @code{left} and @code{right} options move 2498table-split-cell-horizontally} split in a specific direction. When
2383the entire contents into the left or right cell respectively. 2499splitting vertically, the old cell contents are automatically split
2384 2500between the two new cells. When splitting horizontally, you are
2385@cindex enlarge a table cell 2501prompted for how to divide the cell contents, if the cell is
2386@cindex shrink a table cell 2502non-empty; the options are @samp{split} (divide the contents at
2387 The next four commands enlarge or shrink a cell. They use numeric 2503point), @samp{left} (put all the contents in the left cell), and
2388arguments (@pxref{Arguments}) to specify how many columns or rows to 2504@samp{right} (put all the contents in the right cell).
2389enlarge or shrink a particular table. 2505
2506 The following commands enlarge or shrink a cell. By default, they
2507resize by one row or column; if a numeric argument is supplied, that
2508specifies the number of rows or columns to resize by.
2390 2509
2391@table @kbd 2510@table @kbd
2392@findex table-heighten-cell 2511@findex table-heighten-cell
2393@item M-x table-heighten-cell 2512@item M-x table-heighten-cell
2394Enlarge the current cell vertically. 2513Enlarge the current cell vertically.
2514
2395@findex table-shorten-cell 2515@findex table-shorten-cell
2396@item M-x table-shorten-cell 2516@item M-x table-shorten-cell
2397Shrink the current cell vertically. 2517Shrink the current cell vertically.
2518
2398@findex table-widen-cell 2519@findex table-widen-cell
2399@item M-x table-widen-cell 2520@item M-x table-widen-cell
2400Enlarge the current cell horizontally. 2521Enlarge the current cell horizontally.
2522
2401@findex table-narrow-cell 2523@findex table-narrow-cell
2402@item M-x table-narrow-cell 2524@item M-x table-narrow-cell
2403Shrink the current cell horizontally. 2525Shrink the current cell horizontally.
@@ -2405,107 +2527,76 @@ Shrink the current cell horizontally.
2405 2527
2406@node Cell Justification 2528@node Cell Justification
2407@subsection Cell Justification 2529@subsection Cell Justification
2408@cindex cell text justification 2530@cindex justification in text-based tables
2409 2531
2410 You can specify text justification for each cell. The justification 2532 The command @kbd{M-x table-justify} imposes @dfn{justification} on
2411is remembered independently for each cell and the subsequent editing 2533one or more cells in a text-based table. Justification determines how
2412of cell contents is subject to the specified justification. 2534the text in the cell is aligned, relative to the edges of the cell.
2535Each cell in a table can be separately justified.
2413 2536
2414@findex table-justify 2537@findex table-justify
2415 The command @code{table-justify} ask you to specify what to justify: 2538 @kbd{M-x table-justify} first prompts for what to justify; the
2416a cell, a column, or a row. If you select cell justification, this 2539options are @samp{cell} (just the current cell), @samp{column} (all
2417command sets the justification only for the current cell. Selecting 2540cells in the current table column) and @samp{row} (all cells in the
2418column or row justification sets the justification for all the cells 2541current table row). The command then prompts for the justification
2419within a column or row respectively. The command then ask you which 2542style; the options are @code{left}, @code{center}, @code{right},
2420kind of justification to apply: @code{left}, @code{center}, 2543@code{top}, @code{middle}, @code{bottom}, or @code{none} (meaning no
2421@code{right}, @code{top}, @code{middle}, @code{bottom}, or 2544vertical justification).
2422@code{none}. Horizontal justification and vertical justification are 2545
2423specified independently. The options @code{left}, @code{center}, and 2546 Horizontal and vertical justification styles are specified
2424@code{right} specify horizontal justification while the options 2547independently, and both types can be in effect simultaneously; for
2425@code{top}, @code{middle}, @code{bottom}, and @code{none} specify 2548instance, you can call @kbd{M-x table-justify} twice, once to specify
2426vertical justification. The vertical justification @code{none} 2549@code{right} justification and once to specify @code{bottom}
2427effectively removes vertical justification. Horizontal justification 2550justification, to align the contents of a cell to the bottom right.
2428must be one of @code{left}, @code{center}, or @code{right}.
2429 2551
2430@vindex table-detect-cell-alignment 2552@vindex table-detect-cell-alignment
2431 Justification information is stored in the buffer as a part of text 2553 The justification style is stored in the buffer as a text property,
2432property. Therefore, this information is ephemeral and does not 2554and is lost when you kill the buffer or exit Emacs. However, the
2433survive through the loss of the buffer (closing the buffer and 2555table recognition commands, such as @kbd{M-x table-recognize}
2434revisiting the buffer erase any previous text properties). To 2556(@pxref{Table Recognition}), attempt to determine and re-apply each
2435countermand for this, the command @code{table-recognize} and other 2557cell's justification style, by examining its contents. To disable
2436recognition commands (@pxref{Table Recognition}) are equipped with a 2558this feature, change the variable @code{table-detect-cell-alignment}
2437convenience feature (turned on by default). During table recognition, 2559to @code{nil}.
2438the contents of a cell are examined to determine which justification 2560
2439was originally applied to the cell and then applies this justification 2561@node Table Rows and Columns
2440to the cell. This is a speculative algorithm and is therefore not 2562@subsection Table Rows and Columns
2441perfect, however, the justification is deduced correctly most of the 2563@cindex inserting rows and columns in text-based tables
2442time. To disable this feature, customize the variable 2564
2443@code{table-detect-cell-alignment} and set it to @code{nil}.
2444
2445@node Row Commands
2446@subsection Commands for Table Rows
2447@cindex table row commands
2448
2449@cindex insert row in table
2450@findex table-insert-row 2565@findex table-insert-row
2451 The command @code{table-insert-row} inserts a row of cells before 2566 @kbd{M-x table-insert-row} inserts a row of cells before the current
2452the current row in a table. The current row where point is located is 2567table row. The current row, together with point, is pushed down past
2453pushed down after the newly inserted row. A numeric prefix argument 2568the new row. To insert rows after the last row at the bottom of a
2454specifies the number of rows to insert. Note that in order to insert 2569table, invoke this command with point below the table, just below the
2455rows @emph{after} the last row at the bottom of a table, you must 2570bottom edge. A numeric prefix argument specifies the number of rows
2456place point below the table---that is, outside the table---prior to 2571to insert.
2457invoking this command.
2458
2459@cindex delete row in table
2460@findex table-delete-row
2461 The command @code{table-delete-row} deletes a row of cells at point.
2462A numeric prefix argument specifies the number of rows to delete.
2463
2464@node Column Commands
2465@subsection Commands for Table Columns
2466@cindex table column commands
2467
2468@cindex insert column in table
2469@findex table-insert-column
2470 The command @code{table-insert-column} inserts a column of cells to
2471the left of the current row in a table. This pushes the current
2472column to the right. To insert a column to the right side of the
2473rightmost column, place point to the right of the rightmost column,
2474which is outside of the table, prior to invoking this command. A
2475numeric prefix argument specifies the number of columns to insert.
2476
2477@cindex delete column in table
2478 A command @code{table-delete-column} deletes a column of cells at
2479point. A numeric prefix argument specifies the number of columns to
2480delete.
2481
2482@node Fixed Width Mode
2483@subsection Fix Width of Cells
2484@cindex fix width of table cells
2485 2572
2486@findex table-fixed-width-mode 2573@findex table-insert-column
2487 The command @code{table-fixed-width-mode} toggles fixed width mode 2574 Similarly, @kbd{M-x table-insert-column} inserts a column of cells
2488on and off. When fixed width mode is turned on, editing inside a 2575to the left of the current table column. To insert a column to the
2489cell never changes the cell width; when it is off, the cell width 2576right side of the rightmost column, invoke this command with point to
2490expands automatically in order to prevent a word from being folded 2577the right of the rightmost column, outside the table. A numeric
2491into multiple lines. By default, fixed width mode is disabled. 2578prefix argument specifies the number of columns to insert.
2579
2580@cindex deleting rows and column in text-based tables
2581 @kbd{M-x table-delete-column} deletes the column of cells at point.
2582Similarly, @kbd{M-x table-delete-row} deletes the row of cells at
2583point. A numeric prefix argument to either command specifies the
2584number of columns or rows to delete.
2492 2585
2493@node Table Conversion 2586@node Table Conversion
2494@subsection Conversion Between Plain Text and Tables 2587@subsection Converting Between Plain Text and Tables
2495@cindex text to table 2588@cindex text to table
2496@cindex table to text 2589@cindex table to text
2497 2590
2498@findex table-capture 2591@findex table-capture
2499 The command @code{table-capture} captures plain text in a region and 2592 The command @kbd{M-x table-capture} captures plain text in a region
2500turns it into a table. Unlike @code{table-recognize} (@pxref{Table 2593and turns it into a table. Unlike @kbd{M-x table-recognize}
2501Recognition}), the original text does not have a table appearance but 2594(@pxref{Table Recognition}), the original text does not need to have a
2502may hold a logical table structure. For example, some elements 2595table appearance; it only needs to have a logical table-like
2503separated by known patterns form a two dimensional structure which can 2596structure.
2504be turned into a table.
2505 2597
2506 Here's an example of data that @code{table-capture} can operate on. 2598 For example, suppose we have the following numbers, which are
2507The numbers are horizontally separated by a comma and vertically 2599divided into three lines and separated horizontally by commas:
2508separated by a newline character.
2509 2600
2510@example 2601@example
25111, 2, 3, 4 26021, 2, 3, 4
@@ -2526,136 +2617,92 @@ Invoking @kbd{M-x table-capture} on that text produces this table:
2526+-----+-----+-----+-----+ 2617+-----+-----+-----+-----+
2527@end example 2618@end example
2528 2619
2529@noindent
2530The conversion uses @samp{,} for the column delimiter and newline for
2531a row delimiter, cells are left justified, and minimum cell width is
25325.
2533
2534@findex table-release 2620@findex table-release
2535 The command @code{table-release} does the opposite of 2621 @kbd{M-x table-release} does the opposite: it converts a table back
2536@code{table-capture}. It releases a table by removing the table frame 2622to plain text, removing its cell borders.
2537and cell borders. This leaves the table contents as plain text. One 2623
2538of the useful applications of @code{table-capture} and 2624 One application of this pair of commands is to edit a text in
2539@code{table-release} is to edit a text in layout. Look at the 2625layout. Look at the following three paragraphs (the latter two are
2540following three paragraphs (the latter two are indented with header 2626indented with header lines):
2541lines):
2542 2627
2543@example 2628@example
2544table-capture is a powerful command. 2629table-capture is a powerful command.
2545Here are some things it can do: 2630Here are some things it can do:
2546 2631
2547Parse Cell Items By using column delimiter regular 2632Parse Cell Items Using row and column delimiter regexps,
2548 expression and raw delimiter regular 2633 it parses the specified text area and
2549 expression, it parses the specified text 2634 extracts cell items into a table.
2550 area and extracts cell items from
2551 non-table text and then forms a table out
2552 of them.
2553
2554Capture Text Area When no delimiters are specified it
2555 creates a single cell table. The text in
2556 the specified region is placed in that
2557 cell.
2558@end example 2635@end example
2559 2636
2560@noindent 2637@noindent
2561Applying @code{table-capture} to a region containing the above three 2638Applying @code{table-capture} to a region containing the above text,
2562paragraphs, with empty strings for column delimiter regexp and row 2639with empty strings for the column and row delimiter regexps, creates a
2563delimiter regexp, creates a table with a single cell like the 2640table with a single cell like the following one.
2564following one. 2641
2565
2566@c The first line's right-hand frame in the following two examples
2567@c sticks out to accommodate for the removal of @samp in the
2568@c produced output!!
2569@smallexample 2642@smallexample
2570@group 2643@group
2571+-------------------------------------------------------------+ 2644+----------------------------------------------------------+
2572|table-capture is a powerful command. | 2645|table-capture is a powerful command. |
2573|Here are some things it can do: | 2646|Here are some things it can do: |
2574| | 2647| |
2575|Parse Cell Items By using column delimiter regular | 2648|Parse Cell Items Using row and column delimiter regexps,|
2576| expression and raw delimiter regular | 2649| it parses the specified text area and |
2577| expression, it parses the specified text | 2650| extracts cell items into a table. |
2578| area and extracts cell items from | 2651+----------------------------------------------------------+
2579| non-table text and then forms a table out |
2580| of them. |
2581| |
2582|Capture Text Area When no delimiters are specified it |
2583| creates a single cell table. The text in |
2584| the specified region is placed in that |
2585| cell. |
2586+-------------------------------------------------------------+
2587@end group 2652@end group
2588@end smallexample 2653@end smallexample
2589 2654
2590@noindent 2655@noindent
2591By splitting the cell appropriately we now have a table consisting of 2656We can then use the cell splitting commands (@pxref{Cell Commands}) to
2592paragraphs occupying its own cell. Each cell can now be edited 2657subdivide the table so that each paragraph occupies a cell:
2593independently without affecting the layout of other cells.
2594 2658
2595@smallexample 2659@smallexample
2596+--------------------------------------------------------------+ 2660+----------------------------------------------------------+
2597|table-capture is a powerful command. | 2661|table-capture is a powerful command. |
2598|Here are some things it can do: | 2662|Here are some things it can do: |
2599+------------------+-------------------------------------------+ 2663+-----------------+----------------------------------------+
2600|Parse Cell Items |By using column delimiter regular | 2664|Parse Cell Items | Using row and column delimiter regexps,|
2601| |expression and raw delimiter regular | 2665| | it parses the specified text area and |
2602| |expression, it parses the specified text | 2666| | extracts cell items into a table. |
2603| |area and extracts cell items from | 2667+-----------------+----------------------------------------+
2604| |non-table text and then forms a table out |
2605| |of them. |
2606+------------------+-------------------------------------------+
2607|Capture Text Area |When no delimiters are specified it |
2608| |creates a single cell table. The text in |
2609| |the specified region is placed in that |
2610| |cell. |
2611+------------------+-------------------------------------------+
2612@end smallexample 2668@end smallexample
2613 2669
2614@noindent 2670@noindent
2615By applying @code{table-release}, which does the opposite process, the 2671Each cell can now be edited independently without affecting the layout
2616contents become once again plain text. @code{table-release} works as 2672of other cells. When finished, we can invoke @kbd{M-x table-release}
2617a companion command to @code{table-capture}. 2673to convert the table back to plain text.
2618 2674
2619@node Measuring Tables 2675@node Table Misc
2620@subsection Analyzing Table Dimensions 2676@subsection Table Miscellany
2621@cindex table dimensions
2622 2677
2678@cindex table dimensions
2623@findex table-query-dimension 2679@findex table-query-dimension
2624 The command @code{table-query-dimension} analyzes a table structure 2680 The command @code{table-query-dimension} reports the layout of the
2625and reports information regarding its dimensions. In case of the 2681table and table cell at point. Here is an example of its output:
2626above example table, the @code{table-query-dimension} command displays
2627in echo area:
2628 2682
2629@smallexample 2683@smallexample
2630Cell: (21w, 6h), Table: (67w, 16h), Dim: (2c, 3r), Total Cells: 5 2684Cell: (21w, 6h), Table: (67w, 16h), Dim: (2c, 3r), Total Cells: 5
2631@end smallexample 2685@end smallexample
2632 2686
2633@noindent 2687@noindent
2634This indicates that the current cell is 21 character wide and 6 lines 2688This indicates that the current cell is 21 characters wide and 6 lines
2635high, the entire table is 67 characters wide and 16 lines high. The 2689high, the table is 67 characters wide and 16 lines high with 2 columns
2636table has 2 columns and 3 rows. It has a total of 5 cells, since the 2690and 3 rows, and a total of 5 cells.
2637first row has a spanned cell.
2638 2691
2639@node Table Misc
2640@subsection Table Miscellany
2641
2642@cindex insert string into table cells
2643@findex table-insert-sequence 2692@findex table-insert-sequence
2644 The command @code{table-insert-sequence} inserts a string into each 2693 @kbd{M-x table-insert-sequence} inserts a string into each cell.
2645cell. Each string is a part of a sequence i.e.@: a series of 2694Each string is a part of a sequence i.e.@: a series of increasing
2646increasing integer numbers. 2695integer numbers.
2647 2696
2648@cindex table in language format
2649@cindex table for HTML and LaTeX 2697@cindex table for HTML and LaTeX
2650@findex table-generate-source 2698@findex table-generate-source
2651 The command @code{table-generate-source} generates a table formatted 2699 @kbd{M-x table-generate-source} generates a table formatted for a
2652for a specific markup language. It asks for a language (which must be 2700specific markup language. It asks for a language (which must be one
2653one of @code{html}, @code{latex}, or @code{cals}), a destination 2701of @code{html}, @code{latex}, or @code{cals}), a destination buffer in
2654buffer where to put the result, and the table caption (a string), and 2702which to put the result, and a table caption, and then inserts the
2655then inserts the generated table in the proper syntax into the 2703generated table into the specified buffer. The default destination
2656destination buffer. The default destination buffer is 2704buffer is @code{table.@var{lang}}, where @var{lang} is the language
2657@code{table.@var{lang}}, where @var{lang} is the language you 2705you specified.
2658specified.
2659 2706
2660@node Two-Column 2707@node Two-Column
2661@section Two-Column Editing 2708@section Two-Column Editing
@@ -2663,11 +2710,9 @@ specified.
2663@cindex splitting columns 2710@cindex splitting columns
2664@cindex columns, splitting 2711@cindex columns, splitting
2665 2712
2666 Two-column mode lets you conveniently edit two side-by-side columns of 2713 Two-column mode lets you conveniently edit two side-by-side columns
2667text. It uses two side-by-side windows, each showing its own 2714of text. It uses two side-by-side windows, each showing its own
2668buffer. 2715buffer. There are three ways to enter two-column mode:
2669
2670 There are three ways to enter two-column mode:
2671 2716
2672@table @asis 2717@table @asis
2673@item @kbd{@key{F2} 2} or @kbd{C-x 6 2} 2718@item @kbd{@key{F2} 2} or @kbd{C-x 6 2}
diff --git a/doc/emacs/vc1-xtra.texi b/doc/emacs/vc1-xtra.texi
index 05e89e69f0e..b65e6f96a6e 100644
--- a/doc/emacs/vc1-xtra.texi
+++ b/doc/emacs/vc1-xtra.texi
@@ -5,301 +5,6 @@
5@c This file is included either in vc-xtra.texi (when producing the 5@c This file is included either in vc-xtra.texi (when producing the
6@c printed version) or in the main Emacs manual (for the on-line version). 6@c printed version) or in the main Emacs manual (for the on-line version).
7 7
8@node Remote Repositories
9@subsection Remote Repositories
10@cindex remote repositories
11
12 A common way of using CVS and other more advanced VCSes is to set up
13a central repository on some Internet host, then have each
14developer check out a personal working copy of the files on his local
15machine. Committing changes to the repository, and picking up changes
16from other users into one's own working area, then works by direct
17interactions with the repository server.
18
19 One difficulty is that access to a repository server is often slow,
20and that developers might need to work off-line as well. While only
21third-generation decentralized VCses such as GNU Arch or Mercurial
22really solve this problem, VC is designed to reduce the amount of
23network interaction necessary.
24
25 If you are using a truly decentralized VCS you can skip the rest of
26this section. It describes backup and local-repository techniques
27that are only useful for Subversion and earlier VCSes.
28
29@menu
30* Version Backups:: Keeping local copies of repository versions.
31* Local Version Control:: Using another version system for local editing.
32@end menu
33
34@node Version Backups
35@subsubsection Version Backups
36@cindex version backups
37
38@cindex automatic version backups
39 When VC sees that the repository for a file is on a remote
40machine, it automatically makes local backups of unmodified versions
41of the file---@dfn{automatic version backups}. This means that you
42can compare the file to the repository version (@kbd{C-x v =}), or
43revert to that version (@kbd{C-x v u}), without any network
44interactions.
45
46 The local copy of the unmodified file is called a @dfn{version
47backup} to indicate that it corresponds exactly to a version that is
48stored in the repository. Note that version backups are not the same
49as ordinary Emacs backup files
50@iftex
51(@pxref{Backup,,,emacs, the Emacs Manual}).
52@end iftex
53@ifnottex
54(@pxref{Backup}).
55@end ifnottex
56But they follow a similar naming convention.
57
58 For a file that comes from a remote repository, VC makes a
59version backup whenever you save the first changes to the file, and
60removes it after you have committed your modified version to the
61repository. You can disable the making of automatic version backups by
62setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
63
64@cindex manual version backups
65 The name of the automatic version backup for version @var{version}
66of file @var{file} is @code{@var{file}.~@var{version}.~}. This is
67almost the same as the name used by @kbd{C-x v ~}
68@iftex
69(@pxref{Old Revisions,,,emacs, the Emacs Manual}),
70@end iftex
71@ifnottex
72(@pxref{Old Revisions}),
73@end ifnottex
74the only difference being the additional dot (@samp{.}) after the
75version number. This similarity is intentional, because both kinds of
76files store the same kind of information. The file made by @kbd{C-x v
77~} acts as a @dfn{manual version backup}.
78
79 All the VC commands that operate on old versions of a file can use
80both kinds of version backups. For instance, @kbd{C-x v ~} uses
81either an automatic or a manual version backup, if possible, to get
82the contents of the version you request. Likewise, @kbd{C-x v =} and
83@kbd{C-x v u} use either an automatic or a manual version backup, if
84one of them exists, to get the contents of a version to compare or
85revert to. If you changed a file outside of Emacs, so that no
86automatic version backup was created for the previous text, you can
87create a manual backup of that version using @kbd{C-x v ~}, and thus
88obtain the benefit of the local copy for Emacs commands.
89
90 The only difference in Emacs's handling of manual and automatic
91version backups, once they exist, is that Emacs deletes automatic
92version backups when you commit to the repository. By contrast,
93manual version backups remain until you delete them.
94
95@node Local Version Control
96@subsubsection Local Version Control
97@cindex local version control
98@cindex local back end (version control)
99
100When you make many changes to a file that comes from a remote
101repository, it can be convenient to have version control on your local
102machine as well. You can then record intermediate versions, revert to
103a previous state, etc., before you actually commit your changes to the
104remote server.
105
106VC lets you do this by putting a file under a second, local version
107control system, so that the file is effectively registered in two
108systems at the same time. For the description here, we will assume
109that the remote system is CVS, and you use RCS locally, although the
110mechanism works with any combination of version control systems
111(@dfn{back ends}).
112
113To make it work with other back ends, you must make sure that the
114``more local'' back end comes before the ``more remote'' back end in
115the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By
116default, this variable is set up so that you can use remote CVS and
117local RCS as described here.
118
119To start using local RCS for a file that comes from a remote CVS
120server, you must @emph{register the file in RCS}, by typing @kbd{C-u
121C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a
122prefix argument, and specify RCS as the back end.)
123
124You can do this at any time; it does not matter whether you have
125already modified the file with respect to the version in the CVS
126repository. If possible, VC tries to make the RCS master start with
127the unmodified repository version, then checks in any local changes
128as a new version. This works if you have not made any changes yet, or
129if the unmodified repository version exists locally as a version
130backup (@pxref{Version Backups}). If the unmodified version is not
131available locally, the RCS master starts with the modified version;
132the only drawback to this is that you cannot compare your changes
133locally to what is stored in the repository.
134
135The version number of the RCS master is derived from the current CVS
136version, starting a branch from it. For example, if the current CVS
137version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in
138the RCS master will be identical to version 1.23 under CVS; your first
139changes are checked in as 1.23.1.1. (If the unmodified file is not
140available locally, VC will check in the modified file twice, both as
1411.23 and 1.23.1.1, to make the revision numbers consistent.)
142
143If you do not use locking under CVS (the default), locking is also
144disabled for RCS, so that editing under RCS works exactly as under
145CVS.
146
147When you are done with local editing, you can commit the final version
148back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
149This initializes the log entry buffer
150@iftex
151(@pxref{Log Buffer,,,emacs, the Emacs Manual})
152@end iftex
153@ifnottex
154(@pxref{Log Buffer})
155@end ifnottex
156to contain all the log entries you have recorded in the RCS master;
157you can edit them as you wish, and then commit in CVS by typing
158@kbd{C-c C-c}. If the commit is successful, VC removes the RCS
159master, so that the file is once again registered under CVS only.
160(The RCS master is not actually deleted, just renamed by appending
161@samp{~} to the name, so that you can refer to it later if you wish.)
162
163While using local RCS, you can pick up recent changes from the CVS
164repository into your local file, or commit some of your changes back
165to CVS, without terminating local RCS version control. To do this,
166switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
167
168@table @kbd
169@item C-x v b
170Switch to another back end that the current file is registered
171under (@code{vc-switch-backend}).
172
173@item C-u C-x v b @var{backend} @key{RET}
174Switch to @var{backend} for the current file.
175@end table
176
177@kindex C-x v b
178@findex vc-switch-backend
179@kbd{C-x v b} does not change the buffer contents, or any files; it
180only changes VC's perspective on how to handle the file. Any
181subsequent VC commands for that file will operate on the back end that
182is currently selected.
183
184If the current file is registered in more than one back end, typing
185@kbd{C-x v b} ``cycles'' through all of these back ends. With a
186prefix argument, it asks for the back end to use in the minibuffer.
187
188Thus, if you are using local RCS, and you want to pick up some recent
189changes in the file from remote CVS, first visit the file, then type
190@kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
191@key{RET}} to merge the news
192@iftex
193(@pxref{Merging,,,emacs, the Emacs Manual}).
194@end iftex
195@ifnottex
196(@pxref{Merging}).
197@end ifnottex
198You can then switch back to RCS by typing @kbd{C-x v b} again, and
199continue to edit locally.
200
201But if you do this, the revision numbers in the RCS master no longer
202correspond to those of CVS. Technically, this is not a problem, but
203it can become difficult to keep track of what is in the CVS repository
204and what is not. So we suggest that you return from time to time to
205CVS-only operation, by committing your local changes back to the
206repository using @kbd{C-u C-x v v cvs @key{RET}}.
207
208@node Revision Tags
209@subsection Revision Tags
210@cindex tags and version control
211
212 In a VCS with per-file revision numbers (such as SCCS, RCS, or CVS)
213@dfn{tag} is a named set of file versions (one for each registered
214file) that you can treat as a unit. In a VCS with per-repository
215version numbers (Subversion and most later ones) a tag is simply
216a symbolic name for a revision.
217
218 One important kind of tag is a @dfn{release}, a (theoretically)
219stable version of the system that is ready for distribution to users.
220
221@menu
222* Making Revision Tags:: The tag facilities.
223* Revision Tag Caveats:: Things to be careful of when using tags.
224@end menu
225
226@node Making Revision Tags
227@subsubsection Making and Using Revision Tags
228
229 There are two basic commands for tags; one makes a
230tag with a given name, the other retrieves a named tag.
231
232@table @code
233@kindex C-x v s
234@findex vc-create-tag
235@item C-x v s @var{name} @key{RET}
236Define the working revision of every registered file in or under the
237current directory as a tag named @var{name}
238(@code{vc-create-tag}).
239
240@kindex C-x v r
241@findex vc-retrieve-tag
242@item C-x v r @var{name} @key{RET}
243For all registered files at or below the current directory level,
244retrieve the tagged revision @var{name}. This command will
245switch to a branch if @var{name} is a branch name and your VCS
246distinguishes branches from tags.
247(@code{vc-retrieve-tag}).
248
249This command reports an error if any files are locked at or below the
250current directory, without changing anything; this is to avoid
251overwriting work in progress.
252@end table
253
254Tags are inexpensive, so you need not hesitate to create them whenever
255they are useful. Branches vary in cost depending on your VCS; in
256older ones they may be expensive.
257
258 You can give a tag or branch name as an argument to @kbd{C-x v =} or
259@kbd{C-x v ~}
260@iftex
261(@pxref{Old Revisions,,,emacs, the Emacs Manual}).
262@end iftex
263@ifnottex
264(@pxref{Old Revisions}).
265@end ifnottex
266Thus, you can use it to compare a tagged version against the current files,
267or two tagged versions against each other.
268
269@node Revision Tag Caveats
270@subsubsection Revision Tag Caveats
271
272 For SCCS, VC implements tags itself; these tags are visible only
273through VC. Most later systems (including CVS, Subversion, bzr, git,
274and hg) have a native tag facility, and VC uses it where
275available; those tags will be visible even when you bypass VC.
276
277 There is no support for VC tags using GNU Arch yet.
278
279 Under older VCSes (SCCS, RCS, CVS, early versions of Subversion),
280renaming and deletion could create some difficulties with tags. This is
281not a VC-specific problem, but a general design issue in version
282control systems that was not solved effectively until the earliest
283third-generation systems.
284
285 In a file-oriented VCS, when you rename a registered file you need
286to rename its master along with it; the command @code{vc-rename-file}
287will do this automatically. If you are using SCCS, you must also
288update the records of the tag, to mention the file by its new name
289(@code{vc-rename-file} does this, too). An old tag that refers to a
290master file that no longer exists under the recorded name is invalid;
291VC can no longer retrieve it. It would be beyond the scope of this
292manual to explain enough about RCS and SCCS to explain how to update
293the tags by hand.
294
295 Using @code{vc-rename-file} makes the tag remain valid for
296retrieval, but it does not solve all problems. For example, some of the
297files in your program probably refer to others by name. At the very
298least, the makefile probably mentions the file that you renamed. If you
299retrieve an old tag, the renamed file is retrieved under its new
300name, which is not the name that the makefile expects. So the program
301won't really work as retrieved.
302
303@node Miscellaneous VC 8@node Miscellaneous VC
304@subsection Miscellaneous Commands and Features of VC 9@subsection Miscellaneous Commands and Features of VC
305 10
@@ -307,52 +12,55 @@ won't really work as retrieved.
307 12
308@menu 13@menu
309* Change Logs and VC:: Generating a change log file from log entries. 14* Change Logs and VC:: Generating a change log file from log entries.
310* Renaming and VC:: A command to rename both the source and master 15* VC Delete/Rename:: Deleting and renaming version-controlled files.
311 file correctly. 16* Revision Tags:: Symbolic names for revisions.
312* Version Headers:: Inserting version control headers into working files. 17* Version Headers:: Inserting version control headers into working files.
313@end menu 18@end menu
314 19
315@node Change Logs and VC 20@node Change Logs and VC
316@subsubsection Change Logs and VC 21@subsubsection Change Logs and VC
317 22
318 If you use RCS or CVS for a program and also maintain a change log 23 If you use RCS or CVS for a program with a @file{ChangeLog} file
319file for it
320@iftex 24@iftex
321(@pxref{Change Log,,,emacs, the Emacs Manual}), 25(@pxref{Change Log,,,emacs, the Emacs Manual}),
322@end iftex 26@end iftex
323@ifnottex 27@ifnottex
324(@pxref{Change Log}), 28(@pxref{Change Log}),
325@end ifnottex 29@end ifnottex
326you can generate change log entries automatically from the version 30you can generate change log entries from the version control log
327control log entries: 31entries of previous commits.
32
33 Note that this only works with RCS or CVS. This procedure would be
34particularly incorrect on a modern changeset-based version control
35system, where changes to the @file{ChangeLog} file would normally be
36committed as part of a changeset. In that case, you should write the
37change log entries first, then pull them into the @samp{*vc-log*}
38buffer when you commit
39@iftex
40(@pxref{Log Buffer,,,emacs, the Emacs Manual}).
41@end iftex
42@ifnottex
43(@pxref{Log Buffer}).
44@end ifnottex
328 45
329@table @kbd 46@table @kbd
330@item C-x v a 47@item C-x v a
331@kindex C-x v a 48@kindex C-x v a
332@findex vc-update-change-log 49@findex vc-update-change-log
333Visit the current directory's change log file and, for registered files 50Visit the current directory's @file{ChangeLog} file and, for
334in that directory, create new entries for versions checked in since the 51registered files in that directory, create new entries for versions
335most recent entry in the change log file. 52committed since the most recent change log entry
336(@code{vc-update-change-log}). 53(@code{vc-update-change-log}).
337 54
338This command works with RCS or CVS only, not with any of the other
339back ends.
340
341@item C-u C-x v a 55@item C-u C-x v a
342As above, but only find entries for the current buffer's file. 56As above, but only find entries for the current buffer's file.
343
344@item M-1 C-x v a
345As above, but find entries for all the currently visited files that are
346maintained with version control. This works only with RCS, and it puts
347all entries in the log for the default directory, which may not be
348appropriate.
349@end table 57@end table
350 58
351 For example, suppose the first line of @file{ChangeLog} is dated 59 For example, suppose the first line of @file{ChangeLog} is dated
3521999-04-10, and that the only check-in since then was by Nathaniel 601999-04-10, and that the only check-in since then was by Nathaniel
353Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log 61Bowditch to @file{rcs2log} on 1999-05-22 with log entry @samp{Ignore
354messages that start with `#'.}. Then @kbd{C-x v a} visits 62log messages that start with `#'.}. Then @kbd{C-x v a} inserts this
355@file{ChangeLog} and inserts text like this: 63@file{ChangeLog} entry:
356 64
357@iftex 65@iftex
358@medbreak 66@medbreak
@@ -369,17 +77,11 @@ messages that start with `#'.}. Then @kbd{C-x v a} visits
369@end iftex 77@end iftex
370 78
371@noindent 79@noindent
372You can then edit the new change log entry further as you wish. 80If the version control log entry specifies a function name (in
373 81parenthesis at the beginning of a line), that is reflected in the
374 Some of the new change log entries may duplicate what's already in 82@file{ChangeLog} entry. For example, if a log entry for @file{vc.el}
375ChangeLog. You will have to remove these duplicates by hand. 83is @samp{(vc-do-command): Check call-process status.}, the
376 84@file{ChangeLog} entry is:
377 Normally, the log entry for file @file{foo} is displayed as @samp{*
378foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
379if the text of the log entry starts with @w{@samp{(@var{functionname}):
380}}. For example, if the log entry for @file{vc.el} is
381@samp{(vc-do-command): Check call-process status.}, then the text in
382@file{ChangeLog} looks like this:
383 85
384@iftex 86@iftex
385@medbreak 87@medbreak
@@ -395,221 +97,184 @@ if the text of the log entry starts with @w{@samp{(@var{functionname}):
395@medbreak 97@medbreak
396@end iftex 98@end iftex
397 99
398 When @kbd{C-x v a} adds several change log entries at once, it groups 100 When @kbd{C-x v a} adds several change log entries at once, it
399related log entries together if they all are checked in by the same 101groups related log entries together if they all are checked in by the
400author at nearly the same time. If the log entries for several such 102same author at nearly the same time. If the log entries for several
401files all have the same text, it coalesces them into a single entry. 103such files all have the same text, it coalesces them into a single
402For example, suppose the most recent check-ins have the following log 104entry.
403entries:
404 105
405@flushleft 106@node VC Delete/Rename
406@bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.} 107@subsubsection Deleting and Renaming Version-Controlled Files
407@bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.} 108@cindex renaming version-controlled files
408@bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
409@end flushleft
410 109
411@noindent 110@table @kbd
412They appear like this in @file{ChangeLog}: 111@item M-x vc-delete-file
413 112Prompt for a file name, delete the file from the working tree, and
414@iftex 113schedule the deletion for committing.
415@medbreak
416@end iftex
417@smallexample
418@group
4191999-04-01 Nathaniel Bowditch <nat@@apn.org>
420 114
421 * vc.texinfo: Fix expansion typos. 115@item M-x vc-rename-file
116Prompt for two file names, @var{VAR} and @var{OLD}, rename them in the
117working tree, and schedule the renaming for committing.
118@end table
422 119
423 * vc.el, vc-hooks.el: Don't call expand-file-name. 120@findex vc-delete-file
424@end group 121 If you wish to delete a version-controlled file, use the command
425@end smallexample 122@kbd{M-x vc-delete-file}. This prompts for the file name, and deletes
123it via the version control system. The file is removed from the
124working tree, and in the VC Directory buffer
426@iftex 125@iftex
427@medbreak 126(@pxref{VC Directory Mode}),
428@end iftex 127@end iftex
128@ifnottex
129(@pxref{VC Directory Mode}),
130@end ifnottex
131it is displayed with the @samp{removed} status. When you commit it,
132the deletion takes effect in the repository.
429 133
430 Normally, @kbd{C-x v a} separates log entries by a blank line, but you 134@findex vc-rename-file
431can mark several related log entries to be clumped together (without an 135 To rename a version-controlled file, type @kbd{M-x vc-rename-file}.
432intervening blank line) by starting the text of each related log entry 136This prompts for two arguments: the name of the file you wish to
433with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label 137rename, and the new name; then it performs the renaming via the
434itself is not copied to @file{ChangeLog}. For example, suppose the log 138version control system. The renaming takes effect immediately in the
435entries are: 139working tree, and takes effect in the repository when you commit the
140renamed file.
141
142 On modern version control systems that have built-in support for
143renaming, the renamed file retains the full change history of the
144original file. On CVS and older version control systems, the
145@code{vc-rename-file} command actually works by creating a copy of the
146old file under the new name, registering it, and deleting the old
147file. In this case, the change history is not preserved.
436 148
437@flushleft 149@node Revision Tags
438@bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.} 150@subsubsection Revision Tags
439@bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.} 151@cindex revision tag
440@bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.} 152@cindex tags for version control
441@end flushleft
442 153
443@noindent 154 Most version control systems allow you to apply a @dfn{revision tag}
444Then the text in @file{ChangeLog} looks like this: 155to a specific version of a version-controlled tree. On modern
156changeset-based version control systems, a revision tag is simply a
157symbolic name for a particular revision. On older file-based systems
158like CVS, each tag is added to the entire set of version-controlled
159files, allowing them to be handled as a unit. Revision tags are
160commonly used to identify releases that are distributed to users.
445 161
446@iftex 162 There are two basic commands for tags; one makes a tag with a given
447@medbreak 163name, the other retrieves a named tag.
448@end iftex
449@smallexample
450@group
4511999-04-01 Nathaniel Bowditch <nat@@apn.org>
452 164
453 * vc.texinfo: Fix expansion typos. 165@table @code
454 * vc.el, vc-hooks.el: Don't call expand-file-name. 166@kindex C-x v s
455@end group 167@findex vc-create-tag
456@end smallexample 168@item C-x v s @var{name} @key{RET}
457@iftex 169Define the working revision of every registered file in or under the
458@medbreak 170current directory as a tag named @var{name}
459@end iftex 171(@code{vc-create-tag}).
460 172
461 A log entry whose text begins with @samp{#} is not copied to 173@kindex C-x v r
462@file{ChangeLog}. For example, if you merely fix some misspellings in 174@findex vc-retrieve-tag
463comments, you can log the change with an entry beginning with @samp{#} 175@item C-x v r @var{name} @key{RET}
464to avoid putting such trivia into @file{ChangeLog}. 176For all registered files at or below the current directory level,
177retrieve the tagged revision @var{name}. This command will switch to a
178branch if @var{name} is a branch name and your VCS distinguishes
179branches from tags. (@code{vc-retrieve-tag}).
465 180
466@node Renaming and VC 181This command reports an error if any files are locked at or below the
467@subsubsection Renaming VC Work Files and Master Files 182current directory, without changing anything; this is to avoid
183overwriting work in progress.
184@end table
468 185
469@findex vc-rename-file 186 You can give a tag or branch name as an argument to @kbd{C-x v =} or
470 When you rename a registered file, you must also rename its master 187@kbd{C-x v ~}
471file correspondingly to get proper results. Use @code{vc-rename-file} 188@iftex
472to rename the source file as you specify, and rename its master file 189(@pxref{Old Revisions,,,emacs, the Emacs Manual}).
473accordingly. It also updates any tags (@pxref{Revision Tags}) that 190@end iftex
474mention the file, so that they use the new name; despite this, the 191@ifnottex
475tag thus modified may not completely work (@pxref{Revision Tag Caveats}). 192(@pxref{Old Revisions}).
193@end ifnottex
194Thus, you can use it to compare a tagged version against the current files,
195or two tagged versions against each other.
476 196
477 Some back ends do not provide an explicit rename operation to their 197 On SCCS, VC implements tags itself; these tags are visible only
478repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v} 198through VC. Most later systems (including CVS, Subversion, bzr, git,
479on the original and renamed buffers and provide the necessary edit 199and hg) have a native tag facility, and VC uses it where available;
480log. 200those tags will be visible even when you bypass VC.
481 201
482 You cannot use @code{vc-rename-file} on a file that is locked by 202 In a file-oriented VCS, when you rename a registered file you need
483someone else. 203to rename its master along with it; the command @code{vc-rename-file}
204will do this automatically. If you are using SCCS, you must also
205update the records of the tag, to mention the file by its new name
206(@code{vc-rename-file} does this, too). An old tag that refers to a
207master file that no longer exists under the recorded name is invalid;
208VC can no longer retrieve it. It would be beyond the scope of this
209manual to explain enough about RCS and SCCS to explain how to update
210the tags by hand. Using @code{vc-rename-file} makes the tag remain
211valid for retrieval, but it does not solve all problems. For example,
212some of the files in your program probably refer to others by name.
213At the very least, the makefile probably mentions the file that you
214renamed. If you retrieve an old tag, the renamed file is retrieved
215under its new name, which is not the name that the makefile expects.
216So the program won't really work as retrieved.
484 217
485@node Version Headers 218@node Version Headers
486@subsubsection Inserting Version Control Headers 219@subsubsection Inserting Version Control Headers
487 220
488 Sometimes it is convenient to put version identification strings 221 On Subversion, CVS, RCS, and SCCS, you can put certain special
489directly into working files. Certain special strings called 222strings called @dfn{version headers} into a work file. When the file
490@dfn{version headers} are replaced in each successive version by the 223is committed, the version control system automatically puts the
491number of that version, the name of the user who created it, and other 224revision number, the name of the user who made the commit, and other
492relevant information. All of the back ends that VC supports have such 225relevant information into the version header.
493a mechanism, except GNU Arch.
494
495 VC does not normally use the information contained in these headers.
496The exception is RCS---with RCS, version headers are sometimes more
497reliable than the master file to determine which version of the file
498you are editing. Note that in a multi-branch environment, version
499headers are necessary to make VC behave correctly
500@iftex
501(@pxref{Multi-User Branching,,,emacs, the Emacs Manual}).
502@end iftex
503@ifnottex
504(@pxref{Multi-User Branching}).
505@end ifnottex
506
507 Searching for RCS version headers is controlled by the variable
508@code{vc-consult-headers}. If it is non-@code{nil} (the default),
509Emacs searches for headers to determine the version number you are
510editing. Setting it to @code{nil} disables this feature.
511 226
512 Note that although CVS uses the same kind of version headers as RCS 227@vindex vc-consult-headers
513does, VC never searches for these headers if you are using CVS, 228 VC does not normally use the information in the version headers. As
514regardless of the above setting. 229an exception, when using RCS, Emacs uses the version header, if there
230is one, to determine the file version, since it is often more reliable
231than the RCS master file. To inhibit using the version header this
232way, change the variable @code{vc-consult-headers} to @code{nil}.
515 233
516@kindex C-x v h 234@kindex C-x v h
517@findex vc-insert-headers 235@findex vc-insert-headers
518 You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
519insert a suitable header string.
520
521@table @kbd
522@item C-x v h
523Insert headers in a file for use with your version-control system.
524@end table
525
526@vindex vc-@var{backend}-header 236@vindex vc-@var{backend}-header
527 The default header string is @samp{@w{$}Id$} for RCS and 237 To insert a suitable header string into the current buffer, type
528@samp{@w{%}W%} for SCCS. You can specify other headers to insert by 238@kbd{C-x v h} (@code{vc-insert-headers}). This command works only on
529setting the variables @code{vc-@var{backend}-header} where 239Subversion, CVS, RCS, and SCCS. The variable
530@var{backend} is @code{rcs} or @code{sccs}. 240@code{vc-@var{backend}-header} contains the list of keywords to insert
531 241into the version header; for instance, CVS uses @code{vc-cvs-header},
532 Instead of a single string, you can specify a list of strings; then 242whose default value is @code{'("\$Id\$")}. (The extra backslashes
533each string in the list is inserted as a separate header on a line of 243prevent the string constant from being interpreted as a header, if the
534its own. 244Emacs Lisp file defining it is maintained with version control.) The
535 245@kbd{C-x v h} command inserts each keyword in the list on a new line
536 It may be necessary to use apparently-superfluous backslashes when 246at point, surrounded by tabs, and inside comment delimiters if
537writing the strings that you put in this variable. For instance, you 247necessary.
538might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
539backslash prevents the string constant from being interpreted as a
540header, if the Emacs Lisp file containing it is maintained with
541version control.
542
543@vindex vc-comment-alist
544 Each header is inserted surrounded by tabs, inside comment delimiters,
545on a new line at point. Normally the ordinary comment
546start and comment end strings of the current mode are used, but for
547certain modes, there are special comment delimiters for this purpose;
548the variable @code{vc-comment-alist} specifies them. Each element of
549this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
550 248
551@vindex vc-static-header-alist 249@vindex vc-static-header-alist
552 The variable @code{vc-static-header-alist} specifies further strings 250 The variable @code{vc-static-header-alist} specifies further strings
553to add based on the name of the buffer. Its value should be a list of 251to add based on the name of the buffer. Its value should be a list of
554elements of the form @code{(@var{regexp} . @var{format})}. Whenever 252elements of the form @code{(@var{regexp} . @var{format})}. Whenever
555@var{regexp} matches the buffer name, @var{format} is inserted as part 253@var{regexp} matches the buffer name, @var{format} is also inserted as
556of the header. A header line is inserted for each element that matches 254part of the version header. A @samp{%s} in @var{format} is replaced
557the buffer name, and for each string specified by 255with the file's version control type.
558@code{vc-@var{backend}-header}. The header line is made by processing the
559string from @code{vc-@var{backend}-header} with the format taken from the
560element. The default value for @code{vc-static-header-alist} is as follows:
561
562@example
563@group
564(("\\.c$" .
565 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
566#endif /* lint */\n"))
567@end group
568@end example
569
570@noindent
571It specifies insertion of text of this form:
572
573@example
574@group
575
576#ifndef lint
577static char vcid[] = "@var{string}";
578#endif /* lint */
579@end group
580@end example
581
582@noindent
583Note that the text above starts with a blank line.
584
585 If you use more than one version header in a file, put them close
586together in the file. The mechanism in @code{revert-buffer} that
587preserves markers may not handle markers positioned between two version
588headers.
589 256
590@node Customizing VC 257@node Customizing VC
591@subsection Customizing VC 258@subsection Customizing VC
592 259
593@vindex vc-handled-backends 260@vindex vc-handled-backends
594The variable @code{vc-handled-backends} determines which version 261 The variable @code{vc-handled-backends} determines which version
595control systems VC should handle. The default value is @code{(RCS CVS 262control systems VC should handle. The default value is @code{(RCS CVS
596SVN SCCS Bzr Git Hg Mtn Arch)}, so it contains all the version systems 263SVN SCCS Bzr Git Hg Mtn Arch)}, so it contains all the version systems
597that are currently supported. If you want VC to ignore one or more of 264that are currently supported. If you want VC to ignore one or more of
598these systems, exclude its name from the list. To disable VC entirely, 265these systems, exclude its name from the list. To disable VC
599set this variable to @code{nil}. 266entirely, set this variable to @code{nil}.
600 267
601The order of systems in the list is significant: when you visit a file 268 The order of systems in the list is significant: when you visit a
602registered in more than one system (@pxref{Local Version Control}), VC 269file registered in more than one system, VC uses the system that comes
603uses the system that comes first in @code{vc-handled-backends} by 270first in @code{vc-handled-backends} by default. The order is also
604default. The order is also significant when you register a file for 271significant when you register a file for the first time
605the first time, see
606@iftex 272@iftex
607@ref{Registering,,,emacs, the Emacs Manual}, 273(@pxref{Registering,,,emacs, the Emacs Manual}).
608@end iftex 274@end iftex
609@ifnottex 275@ifnottex
610@ref{Registering}, 276(@pxref{Registering}).
611@end ifnottex 277@end ifnottex
612for details.
613 278
614@menu 279@menu
615* General VC Options:: Options that apply to multiple back ends. 280* General VC Options:: Options that apply to multiple back ends.
@@ -626,40 +291,27 @@ maintained with version control. If you want to make backup files even
626for files that use version control, set the variable 291for files that use version control, set the variable
627@code{vc-make-backup-files} to a non-@code{nil} value. 292@code{vc-make-backup-files} to a non-@code{nil} value.
628 293
629@vindex vc-keep-workfiles
630 Normally the work file exists all the time, whether it is locked or
631not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
632in a new version with @kbd{C-x v v} deletes the work file; but any
633attempt to visit the file with Emacs creates it again. (With CVS, work
634files are always kept.)
635
636@vindex vc-follow-symlinks 294@vindex vc-follow-symlinks
637 Editing a version-controlled file through a symbolic link can be 295@cindex symbolic links (and version control)
638dangerous. It bypasses the version control system---you can edit the 296 Editing a version-controlled file through a symbolic link may cause
639file without locking it, and fail to check your changes in. Also, 297unexpected results, if you are unaware that the underlying file is
640your changes might overwrite those of another user. To protect against 298version-controlled. The variable @code{vc-follow-symlinks} controls
641this, VC checks each symbolic link that you visit, to see if it points 299what Emacs does if you try to visit a symbolic link pointing to a
642to a file under version control. 300version-controlled file. If the value is @code{ask} (the default),
643 301Emacs asks for confirmation. If it is @code{nil}, Emacs just displays
644 The variable @code{vc-follow-symlinks} controls what to do when a 302a warning message. If it is @code{t}, Emacs automatically follows the
645symbolic link points to a version-controlled file. If it is @code{nil}, 303link and visits the real file instead.
646VC only displays a warning message. If it is @code{t}, VC automatically
647follows the link, and visits the real file instead, telling you about
648this in the echo area. If the value is @code{ask} (the default), VC
649asks you each time whether to follow the link.
650 304
651@vindex vc-suppress-confirm 305@vindex vc-suppress-confirm
652 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v} 306 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
653and @kbd{C-x v i} can save the current buffer without asking, and 307and @kbd{C-x v i} can save the current buffer without asking, and
654@kbd{C-x v u} also operates without asking for confirmation. (This 308@kbd{C-x v u} also operates without asking for confirmation.
655variable does not affect @kbd{C-x v c}; that operation is so drastic
656that it should always ask for confirmation.)
657 309
658@vindex vc-command-messages 310@vindex vc-command-messages
659 VC mode does much of its work by running the shell commands for the 311 VC mode does much of its work by running the shell commands for the
660appropriate backend. If @code{vc-command-messages} is non-@code{nil}, VC 312appropriate version control system. If @code{vc-command-messages} is
661displays messages to indicate which shell commands it runs, and 313non-@code{nil}, VC displays messages to indicate which shell commands
662additional messages when the commands finish. 314it runs, and additional messages when the commands finish.
663 315
664@vindex vc-path 316@vindex vc-path
665 You can specify additional directories to search for version control 317 You can specify additional directories to search for version control
@@ -715,37 +367,16 @@ the variable @code{vc-mistrust-permissions} affects SCCS use, but
715@node CVS Options 367@node CVS Options
716@subsubsection Options specific for CVS 368@subsubsection Options specific for CVS
717 369
718@cindex locking (CVS) 370@vindex vc-cvs-global-switches
719 By default, CVS does not use locking to coordinate the activities of 371 You can specify additional command line options to pass to all CVS
720several users; anyone can change a work file at any time. However, 372operations in the variable @code{vc-cvs-global-switches}. These
721there are ways to restrict this, resulting in behavior that resembles 373switches are inserted immediately after the @code{cvs} command, before
722locking. 374the name of the operation to invoke.
723
724@cindex CVSREAD environment variable (CVS)
725 For one thing, you can set the @env{CVSREAD} environment variable
726(the value you use makes no difference). If this variable is defined,
727CVS makes your work files read-only by default. In Emacs, you must
728type @kbd{C-x v v} to make the file writable, so that editing works
729in fact similar as if locking was used. Note however, that no actual
730locking is performed, so several users can make their files writable
731at the same time. When setting @env{CVSREAD} for the first time, make
732sure to check out all your modules anew, so that the file protections
733are set correctly.
734
735@cindex cvs watch feature
736@cindex watching files (CVS)
737 Another way to achieve something similar to locking is to use the
738@dfn{watch} feature of CVS. If a file is being watched, CVS makes it
739read-only by default, and you must also use @kbd{C-x v v} in Emacs to
740make it writable. VC calls @code{cvs edit} to make the file writable,
741and CVS takes care to notify other developers of the fact that you
742intend to change the file. See the CVS documentation for details on
743using the watch feature.
744 375
745@vindex vc-stay-local 376@vindex vc-stay-local
746@vindex vc-cvs-stay-local 377@vindex vc-cvs-stay-local
747@cindex remote repositories (CVS) 378@cindex remote repositories (CVS)
748 When a file's repository is on a remote machine, VC tries to keep 379 When using a CVS repository on a remote machine, VC can try keeping
749network interactions to a minimum. This is controlled by the variable 380network interactions to a minimum. This is controlled by the variable
750@code{vc-cvs-stay-local}. There is another variable, 381@code{vc-cvs-stay-local}. There is another variable,
751@code{vc-stay-local}, which enables the feature also for other back 382@code{vc-stay-local}, which enables the feature also for other back
@@ -753,36 +384,58 @@ ends that support it, including CVS. In the following, we will talk
753only about @code{vc-cvs-stay-local}, but everything applies to 384only about @code{vc-cvs-stay-local}, but everything applies to
754@code{vc-stay-local} as well. 385@code{vc-stay-local} as well.
755 386
756If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses 387 If @code{vc-cvs-stay-local} is @code{t} (the default), VC determines
757only the entry in the local CVS subdirectory to determine the file's 388the version control status of each file using only the entry in the
758state (and possibly information returned by previous CVS commands). 389local CVS subdirectory and the information returned by previous CVS
759One consequence of this is that when you have modified a file, and 390commands. As a consequence, if you have modified a file and somebody
760somebody else has already checked in other changes to the file, you 391else has checked in other changes, you will not be notified of the
761are not notified of it until you actually try to commit. (But you can 392conflict until you try to commit.
762try to pick up any recent changes from the repository first, using 393
763@kbd{C-x v m @key{RET}}, 394 If you change @code{vc-cvs-stay-local} to @code{nil}, VC queries the
395remote repository @emph{before} it decides what to do in
396@code{vc-next-action} (@kbd{C-x v v}), just as it does for local
397repositories.
398
399 You can also set @code{vc-cvs-stay-local} to a regular expression
400that is matched against the repository host name; VC then stays local
401only for repositories from hosts that match the pattern.
402
403@cindex automatic version backups
404 When using a remote repository, Emacs normally makes @dfn{automatic
405version backups} of the original versions of each edited file. These
406local backups are made whenever you save the first changes to a file,
407and they are removed after you commit your changes to the repository.
408(Note that these are not the same as ordinary Emacs backup files;
764@iftex 409@iftex
765@pxref{Merging,,,emacs, the Emacs Manual}). 410@pxref{Backup,,,emacs, the Emacs Manual}.)
766@end iftex 411@end iftex
767@ifnottex 412@ifnottex
768@pxref{Merging}). 413@pxref{Backup}.)
769@end ifnottex 414@end ifnottex
415Commands like @kbd{C-x v =} and @kbd{C-x v u} make use of automatic
416version backups, if possible, to avoid having to access the network.
770 417
771 When @code{vc-cvs-stay-local} is @code{t}, VC also makes local 418 Setting @code{vc-cvs-stay-local} to @code{nil} disables the making
772version backups, so that simple diff and revert operations are 419of automatic version backups.
773completely local (@pxref{Version Backups}).
774
775 On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
776then VC queries the remote repository @emph{before} it decides what to
777do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
778repositories. It also does not make any version backups.
779 420
780 You can also set @code{vc-cvs-stay-local} to a regular expression 421@cindex manual version backups
781that is matched against the repository host name; VC then stays local 422 Automatic version backups have names of the form
782only for repositories from hosts that match the pattern. 423@w{@code{@var{file}.~@var{version}.~}}. This is similar to the name
424that @kbd{C-x v ~} saves old versions to
425@iftex
426(@pxref{Old Revisions,,,emacs, the Emacs Manual}),
427@end iftex
428@ifnottex
429(@pxref{Old Revisions}),
430@end ifnottex
431except for the additional dot (@samp{.}) after the version. The
432relevant VC commands can use both kinds of version backups. The main
433difference is that the ``manual'' version backups made by @kbd{C-x v
434~} are not deleted automatically when you commit.
783 435
784@vindex vc-cvs-global-switches 436@cindex locking (CVS)
785 You can specify additional command line options to pass to all CVS 437 CVS does not use locking by default, but there are ways to enable
786operations in the variable @code{vc-cvs-global-switches}. These 438locking-like behavior using its @env{CVSREAD} or @dfn{watch} feature;
787switches are inserted immediately after the @code{cvs} command, before 439see the CVS documentation for details. If that case, you can use
788the name of the operation to invoke. 440@kbd{C-x v v} in Emacs to toggle locking, as you would for a
441locking-based version control system (@pxref{VC With A Locking VCS}).
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 37de62be976..d4f9ab747ed 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,23 @@
12011-12-28 Paul Eggert <eggert@cs.ucla.edu>
2
3 * files.texi (File Attributes, Changing Files):
4 Use a more-natural notation for octal numbers.
5
62011-12-23 Juanma Barranquero <lekktu@gmail.com>
7
8 * variables.texi (Variables with Restricted Values):
9 Change reference to variable (bug#10354).
10
112011-12-13 Martin Rudalics <rudalics@gmx.at>
12
13 * windows.texi (Splitting Windows): Use t instead of non-nil
14 when describing window-combination-resize.
15
162011-12-05 Stefan Monnier <monnier@iro.umontreal.ca>
17
18 * text.texi (Special Properties): Warn against `intangible' properties
19 (bug#10222).
20
12011-11-26 Eli Zaretskii <eliz@gnu.org> 212011-11-26 Eli Zaretskii <eliz@gnu.org>
2 22
3 * display.texi (Truncation): 23 * display.texi (Truncation):
@@ -23,8 +43,8 @@
23 43
242011-11-21 Martin Rudalics <rudalics@gmx.at> 442011-11-21 Martin Rudalics <rudalics@gmx.at>
25 45
26 * windows.texi (Windows and Frames, Splitting Windows): Fix 46 * windows.texi (Windows and Frames, Splitting Windows):
27 typos. 47 Fix typos.
28 48
292011-11-21 Chong Yidong <cyd@gnu.org> 492011-11-21 Chong Yidong <cyd@gnu.org>
30 50
@@ -36,8 +56,8 @@
36 (Buffers and Windows): Copyedits. 56 (Buffers and Windows): Copyedits.
37 (Choosing Window): Document special handling of special-display-*. 57 (Choosing Window): Document special handling of special-display-*.
38 (Choosing Window Options): Fix display-buffer-reuse-frames doc. 58 (Choosing Window Options): Fix display-buffer-reuse-frames doc.
39 Don't document even-window-heights, which is going away. Clarify 59 Don't document even-window-heights, which is going away.
40 which options are obeyed by which action functions. 60 Clarify which options are obeyed by which action functions.
41 61
422011-11-20 Stefan Monnier <monnier@iro.umontreal.ca> 622011-11-20 Stefan Monnier <monnier@iro.umontreal.ca>
43 63
@@ -9749,7 +9769,7 @@
9749 directory have been changed to reflect this. 9769 directory have been changed to reflect this.
9750 9770
9751 * All instances of @indentedresultt{} have been changed to 9771 * All instances of @indentedresultt{} have been changed to
9752 ` @result{}', using 5 spaces at the begining of the line. 9772 ` @result{}', using 5 spaces at the beginning of the line.
9753 9773
97541989-04-24 Robert J. Chassell (bob@rice-chex.ai.mit.edu) 97741989-04-24 Robert J. Chassell (bob@rice-chex.ai.mit.edu)
9755 9775
diff --git a/doc/lispref/commands.texi b/doc/lispref/commands.texi
index e76b2bafd79..41392273fbd 100644
--- a/doc/lispref/commands.texi
+++ b/doc/lispref/commands.texi
@@ -946,10 +946,9 @@ If the last event came from a keyboard macro, the value is @code{macro}.
946 946
947 It is not easy to display a value of point in the middle of a 947 It is not easy to display a value of point in the middle of a
948sequence of text that has the @code{display}, @code{composition} or 948sequence of text that has the @code{display}, @code{composition} or
949@code{intangible} property, or is invisible. Therefore, after a 949is invisible. Therefore, after a command finishes and returns to the
950command finishes and returns to the command loop, if point is within 950command loop, if point is within such a sequence, the command loop
951such a sequence, the command loop normally moves point to the edge of 951normally moves point to the edge of the sequence.
952the sequence.
953 952
954 A command can inhibit this feature by setting the variable 953 A command can inhibit this feature by setting the variable
955@code{disable-point-adjustment}: 954@code{disable-point-adjustment}:
diff --git a/doc/lispref/elisp.texi b/doc/lispref/elisp.texi
index cefa917a4e1..98eaf1f8ade 100644
--- a/doc/lispref/elisp.texi
+++ b/doc/lispref/elisp.texi
@@ -1381,7 +1381,7 @@ Operating System Interface
1381* System Environment:: Distinguish the name and kind of system. 1381* System Environment:: Distinguish the name and kind of system.
1382* User Identification:: Finding the name and user id of the user. 1382* User Identification:: Finding the name and user id of the user.
1383* Time of Day:: Getting the current time. 1383* Time of Day:: Getting the current time.
1384* Time Conversion:: Converting a time from numeric form to 1384* Time Conversion:: Converting a time from numeric form to
1385 calendrical data and vice versa. 1385 calendrical data and vice versa.
1386* Time Parsing:: Converting a time from numeric form to text 1386* Time Parsing:: Converting a time from numeric form to text
1387 and vice versa. 1387 and vice versa.
@@ -1438,7 +1438,7 @@ Tips and Conventions
1438GNU Emacs Internals 1438GNU Emacs Internals
1439 1439
1440* Building Emacs:: How the dumped Emacs is made. 1440* Building Emacs:: How the dumped Emacs is made.
1441* Pure Storage:: A kludge to make preloaded Lisp functions sharable. 1441* Pure Storage:: Kludge to make preloaded Lisp functions shareable.
1442* Garbage Collection:: Reclaiming space for Lisp objects no longer used. 1442* Garbage Collection:: Reclaiming space for Lisp objects no longer used.
1443* Memory Usage:: Info about total size of Lisp objects made so far. 1443* Memory Usage:: Info about total size of Lisp objects made so far.
1444* Writing Emacs Primitives:: Writing C code for Emacs. 1444* Writing Emacs Primitives:: Writing C code for Emacs.
diff --git a/doc/lispref/files.texi b/doc/lispref/files.texi
index 86ecfd122ef..b6d0b5c7ed2 100644
--- a/doc/lispref/files.texi
+++ b/doc/lispref/files.texi
@@ -1115,16 +1115,11 @@ This function recursively follows symbolic links at all levels.
1115@end group 1115@end group
1116 1116
1117@group 1117@group
1118(set-file-modes "~/junk/diffs" 438) 1118(set-file-modes "~/junk/diffs" #o666)
1119 @result{} nil 1119 @result{} nil
1120@end group 1120@end group
1121 1121
1122@group 1122@group
1123(format "%o" 438)
1124 @result{} "666" ; @r{Convert to octal.}
1125@end group
1126
1127@group
1128% ls -l diffs 1123% ls -l diffs
1129 -rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs 1124 -rw-rw-rw- 1 lewis 0 3063 Oct 30 16:00 diffs
1130@end group 1125@end group
@@ -1570,10 +1565,10 @@ the bitwise complement of the ``umask'' value.
1570 1565
1571The argument @var{mode} must be an integer. On most systems, only the 1566The argument @var{mode} must be an integer. On most systems, only the
1572low 9 bits of @var{mode} are meaningful. You can use the Lisp construct 1567low 9 bits of @var{mode} are meaningful. You can use the Lisp construct
1573for octal character codes to enter @var{mode}; for example, 1568for octal numbers to enter @var{mode}; for example,
1574 1569
1575@example 1570@example
1576(set-default-file-modes ?\644) 1571(set-default-file-modes #o644)
1577@end example 1572@end example
1578 1573
1579Saving a modified version of an existing file does not count as creating 1574Saving a modified version of an existing file does not count as creating
diff --git a/doc/lispref/internals.texi b/doc/lispref/internals.texi
index 0168c564e34..9ef4646b50b 100644
--- a/doc/lispref/internals.texi
+++ b/doc/lispref/internals.texi
@@ -13,7 +13,7 @@ internal aspects of GNU Emacs that may be of interest to C programmers.
13 13
14@menu 14@menu
15* Building Emacs:: How the dumped Emacs is made. 15* Building Emacs:: How the dumped Emacs is made.
16* Pure Storage:: A kludge to make preloaded Lisp functions sharable. 16* Pure Storage:: Kludge to make preloaded Lisp functions shareable.
17* Garbage Collection:: Reclaiming space for Lisp objects no longer used. 17* Garbage Collection:: Reclaiming space for Lisp objects no longer used.
18* Memory Usage:: Info about total size of Lisp objects made so far. 18* Memory Usage:: Info about total size of Lisp objects made so far.
19* Writing Emacs Primitives:: Writing C code for Emacs. 19* Writing Emacs Primitives:: Writing C code for Emacs.
@@ -196,7 +196,7 @@ function definition in pure storage. If it is non-@code{nil}, then the
196function definition is copied into pure storage. 196function definition is copied into pure storage.
197 197
198This flag is @code{t} while loading all of the basic functions for 198This flag is @code{t} while loading all of the basic functions for
199building Emacs initially (allowing those functions to be sharable and 199building Emacs initially (allowing those functions to be shareable and
200non-collectible). Dumping Emacs as an executable always writes 200non-collectible). Dumping Emacs as an executable always writes
201@code{nil} in this variable, regardless of the value it actually has 201@code{nil} in this variable, regardless of the value it actually has
202before and after dumping. 202before and after dumping.
diff --git a/doc/lispref/modes.texi b/doc/lispref/modes.texi
index 9d652901e53..fcb7c772936 100644
--- a/doc/lispref/modes.texi
+++ b/doc/lispref/modes.texi
@@ -701,7 +701,7 @@ init file.)
701@cindex help for major mode 701@cindex help for major mode
702@cindex documentation for major mode 702@cindex documentation for major mode
703 703
704 The @code{describe-mode} function is provides information about major 704 The @code{describe-mode} function provides information about major
705modes. It is normally bound to @kbd{C-h m}. It uses the value of the 705modes. It is normally bound to @kbd{C-h m}. It uses the value of the
706variable @code{major-mode} (@pxref{Major Modes}), which is why every 706variable @code{major-mode} (@pxref{Major Modes}), which is why every
707major mode command needs to set that variable. 707major mode command needs to set that variable.
diff --git a/doc/lispref/nonascii.texi b/doc/lispref/nonascii.texi
index 298c7c3d1a8..46dbbb08e57 100644
--- a/doc/lispref/nonascii.texi
+++ b/doc/lispref/nonascii.texi
@@ -1580,7 +1580,7 @@ decoding functions (@pxref{Explicit Encoding}).
1580 Sometimes, you need to prefer several coding systems for some 1580 Sometimes, you need to prefer several coding systems for some
1581operation, rather than fix a single one. Emacs lets you specify a 1581operation, rather than fix a single one. Emacs lets you specify a
1582priority order for using coding systems. This ordering affects the 1582priority order for using coding systems. This ordering affects the
1583sorting of lists of coding sysems returned by functions such as 1583sorting of lists of coding systems returned by functions such as
1584@code{find-coding-systems-region} (@pxref{Lisp and Coding Systems}). 1584@code{find-coding-systems-region} (@pxref{Lisp and Coding Systems}).
1585 1585
1586@defun coding-system-priority-list &optional highestp 1586@defun coding-system-priority-list &optional highestp
diff --git a/doc/lispref/spellfile b/doc/lispref/spellfile
index e0d77ee0541..18fb633acfd 100644
--- a/doc/lispref/spellfile
+++ b/doc/lispref/spellfile
@@ -337,7 +337,6 @@ fset
337fstab 337fstab
338ftp 338ftp
339fu 339fu
340funtions
341garbles 340garbles
342gc 341gc
343gcpro 342gcpro
diff --git a/doc/lispref/text.texi b/doc/lispref/text.texi
index fc12939bec5..f7f9c716162 100644
--- a/doc/lispref/text.texi
+++ b/doc/lispref/text.texi
@@ -3145,6 +3145,12 @@ group is separately treated as described above.
3145When the variable @code{inhibit-point-motion-hooks} is non-@code{nil}, 3145When the variable @code{inhibit-point-motion-hooks} is non-@code{nil},
3146the @code{intangible} property is ignored. 3146the @code{intangible} property is ignored.
3147 3147
3148Beware: this property operates at a very low level, and affects a lot of code
3149in unexpected ways. So use it with extreme caution. A common misuse is to put
3150an intangible property on invisible text, which is actually unnecessary since
3151the command loop will move point outside of the invisible text at the end of
3152each command anyway. @xref{Adjusting Point}.
3153
3148@item field 3154@item field
3149@kindex field @r{(text property)} 3155@kindex field @r{(text property)}
3150Consecutive characters with the same @code{field} property constitute a 3156Consecutive characters with the same @code{field} property constitute a
diff --git a/doc/lispref/variables.texi b/doc/lispref/variables.texi
index 091765043e3..62f5092497a 100644
--- a/doc/lispref/variables.texi
+++ b/doc/lispref/variables.texi
@@ -1998,6 +1998,6 @@ This variable holds a list of all variables of type @code{DEFVAR_BOOL}.
1998Attempting to assign them any other value will result in an error: 1998Attempting to assign them any other value will result in an error:
1999 1999
2000@example 2000@example
2001(setq window-min-height 5.0) 2001(setq undo-limit 1000.0)
2002@error{} Wrong type argument: integerp, 5.0 2002@error{} Wrong type argument: integerp, 1000.0
2003@end example 2003@end example
diff --git a/doc/lispref/vol1.texi b/doc/lispref/vol1.texi
index 914ba5b1fd8..c89447fc139 100644
--- a/doc/lispref/vol1.texi
+++ b/doc/lispref/vol1.texi
@@ -44,7 +44,7 @@
44@end ifset 44@end ifset
45 45
46@c per rms and peterb, use 10pt fonts for the main text, mostly to 46@c per rms and peterb, use 10pt fonts for the main text, mostly to
47@c save on paper cost. 47@c save on paper cost.
48@c Do this inside @tex for now, so current makeinfo does not complain. 48@c Do this inside @tex for now, so current makeinfo does not complain.
49@tex 49@tex
50@ifset smallbook 50@ifset smallbook
@@ -1402,7 +1402,7 @@ Operating System Interface
1402* System Environment:: Distinguish the name and kind of system. 1402* System Environment:: Distinguish the name and kind of system.
1403* User Identification:: Finding the name and user id of the user. 1403* User Identification:: Finding the name and user id of the user.
1404* Time of Day:: Getting the current time. 1404* Time of Day:: Getting the current time.
1405* Time Conversion:: Converting a time from numeric form to 1405* Time Conversion:: Converting a time from numeric form to
1406 calendrical data and vice versa. 1406 calendrical data and vice versa.
1407* Time Parsing:: Converting a time from numeric form to text 1407* Time Parsing:: Converting a time from numeric form to text
1408 and vice versa. 1408 and vice versa.
@@ -1458,7 +1458,7 @@ Tips and Conventions
1458GNU Emacs Internals 1458GNU Emacs Internals
1459 1459
1460* Building Emacs:: How the dumped Emacs is made. 1460* Building Emacs:: How the dumped Emacs is made.
1461* Pure Storage:: A kludge to make preloaded Lisp functions sharable. 1461* Pure Storage:: Kludge to make preloaded Lisp functions shareable.
1462* Garbage Collection:: Reclaiming space for Lisp objects no longer used. 1462* Garbage Collection:: Reclaiming space for Lisp objects no longer used.
1463* Memory Usage:: Info about total size of Lisp objects made so far. 1463* Memory Usage:: Info about total size of Lisp objects made so far.
1464* Writing Emacs Primitives:: Writing C code for Emacs. 1464* Writing Emacs Primitives:: Writing C code for Emacs.
diff --git a/doc/lispref/vol2.texi b/doc/lispref/vol2.texi
index 1f84b267c9b..d45d23da365 100644
--- a/doc/lispref/vol2.texi
+++ b/doc/lispref/vol2.texi
@@ -1401,7 +1401,7 @@ Operating System Interface
1401* System Environment:: Distinguish the name and kind of system. 1401* System Environment:: Distinguish the name and kind of system.
1402* User Identification:: Finding the name and user id of the user. 1402* User Identification:: Finding the name and user id of the user.
1403* Time of Day:: Getting the current time. 1403* Time of Day:: Getting the current time.
1404* Time Conversion:: Converting a time from numeric form to 1404* Time Conversion:: Converting a time from numeric form to
1405 calendrical data and vice versa. 1405 calendrical data and vice versa.
1406* Time Parsing:: Converting a time from numeric form to text 1406* Time Parsing:: Converting a time from numeric form to text
1407 and vice versa. 1407 and vice versa.
@@ -1457,7 +1457,7 @@ Tips and Conventions
1457GNU Emacs Internals 1457GNU Emacs Internals
1458 1458
1459* Building Emacs:: How the dumped Emacs is made. 1459* Building Emacs:: How the dumped Emacs is made.
1460* Pure Storage:: A kludge to make preloaded Lisp functions sharable. 1460* Pure Storage:: Kludge to make preloaded Lisp functions shareable.
1461* Garbage Collection:: Reclaiming space for Lisp objects no longer used. 1461* Garbage Collection:: Reclaiming space for Lisp objects no longer used.
1462* Memory Usage:: Info about total size of Lisp objects made so far. 1462* Memory Usage:: Info about total size of Lisp objects made so far.
1463* Writing Emacs Primitives:: Writing C code for Emacs. 1463* Writing Emacs Primitives:: Writing C code for Emacs.
diff --git a/doc/lispref/windows.texi b/doc/lispref/windows.texi
index 437b6db8d58..df631158689 100644
--- a/doc/lispref/windows.texi
+++ b/doc/lispref/windows.texi
@@ -793,20 +793,20 @@ the new root window.
793 793
794@defopt window-combination-resize 794@defopt window-combination-resize
795If this variable is @code{nil}, @code{split-window} can only split a 795If this variable is @code{nil}, @code{split-window} can only split a
796window (denoted by @var{window}) if @var{window}'s screen area is 796window (denoted by @var{window}) if @var{window}'s screen area is large
797large enough to accommodate both itself and the new window. This is 797enough to accommodate both itself and the new window.
798the default. 798
799 799If this variable is @code{t}, @code{split-window} tries to resize all
800If this variable is non-@code{nil}, @code{split-window} tries to 800windows that are part of the same combination as @var{window}, in order
801resize all windows that are part of the same combination as 801to accommodate the new window. In particular, this may allow
802@var{window}, in order to accommodate the new window. In particular, 802@code{split-window} to succeed even if @var{window} is a fixed-size
803this may allow @code{split-window} to succeed even if @var{window} is 803window or too small to ordinarily split. Furthermore, subsequently
804a fixed-size window or too small to ordinarily split. Furthermore, 804resizing or deleting @var{window} may resize all other windows in its
805subsequently resizing or deleting @var{window} may resize all other 805combination.
806windows in its combination. 806
807 807The default is @code{nil}. Other values are reserved for future use.
808This variable has no effect if @code{window-combination-limit} is 808The value of this variable is ignored when
809non-@code{nil} (see below). 809@code{window-combination-limit} is non-@code{nil} (see below).
810@end defopt 810@end defopt
811 811
812 To illustrate the effect of @code{window-combination-resize}, 812 To illustrate the effect of @code{window-combination-resize},
@@ -857,9 +857,9 @@ If @code{window-combination-resize} is @code{nil}, splitting window
857@end smallexample 857@end smallexample
858 858
859@noindent 859@noindent
860If @code{window-combination-resize} is non-@code{nil}, splitting 860If @code{window-combination-resize} is @code{t}, splitting @code{W3}
861@code{W3} instead leaves all three live windows with approximately the 861instead leaves all three live windows with approximately the same
862same height: 862height:
863 863
864@smallexample 864@smallexample
865@group 865@group
diff --git a/doc/misc/ChangeLog b/doc/misc/ChangeLog
index f94153479a8..3b0e5251d5e 100644
--- a/doc/misc/ChangeLog
+++ b/doc/misc/ChangeLog
@@ -1,3 +1,18 @@
12011-12-28 Paul Eggert <eggert@cs.ucla.edu>
2
3 * gnus.texi (Mail Source Customization, Mail Back End Variables):
4 Use octal notation for file permissions, which are normally
5 thought of in octal.
6 (Mail Back End Variables): Use more-plausible modes in example.
7
82011-12-20 Alan Mackenzie <acm@muc.de>
9
10 * cc-mode.texi: Update version string 5.31 -> 5.32.
11
122011-12-06 Juanma Barranquero <lekktu@gmail.com>
13
14 * gnus-faq.texi (FAQ 2-1, FAQ 3-8, FAQ 4-14, FAQ 9-1): Fix typos.
15
12011-11-24 Glenn Morris <rgm@gnu.org> 162011-11-24 Glenn Morris <rgm@gnu.org>
2 17
3 * gnus.texi, smtpmail.texi: Fix case of "GnuTLS". 18 * gnus.texi, smtpmail.texi: Fix case of "GnuTLS".
diff --git a/doc/misc/auth.texi b/doc/misc/auth.texi
index b64562f6875..60bb6e7cdac 100644
--- a/doc/misc/auth.texi
+++ b/doc/misc/auth.texi
@@ -281,7 +281,7 @@ for any of the prompts.
281Note that the password needs to be evaluated if it's a function. It's 281Note that the password needs to be evaluated if it's a function. It's
282wrapped in a function to provide some security. 282wrapped in a function to provide some security.
283 283
284Later, after a successful login, @code{nnimal.el} calls the 284Later, after a successful login, @code{nnimap.el} calls the
285@code{:save-function} like so: 285@code{:save-function} like so:
286 286
287@example 287@example
diff --git a/doc/misc/calc.texi b/doc/misc/calc.texi
index 32311ff5c3e..d0c15c1940e 100644
--- a/doc/misc/calc.texi
+++ b/doc/misc/calc.texi
@@ -12878,7 +12878,7 @@ To declare specifically that @code{x} is real and non-zero,
12878use @samp{[[-inf .. 0), (0 .. inf]]}. (There is no way in the 12878use @samp{[[-inf .. 0), (0 .. inf]]}. (There is no way in the
12879current notation to say that @code{x} is nonzero but not necessarily 12879current notation to say that @code{x} is nonzero but not necessarily
12880real.) The @kbd{a e} command does ``unsafe'' simplifications, 12880real.) The @kbd{a e} command does ``unsafe'' simplifications,
12881including cancelling @samp{x} from the equation when @samp{x} is 12881including canceling @samp{x} from the equation when @samp{x} is
12882not known to be nonzero. 12882not known to be nonzero.
12883 12883
12884Another set of type symbols distinguish between scalars and vectors. 12884Another set of type symbols distinguish between scalars and vectors.
@@ -16873,7 +16873,7 @@ The @kbd{t U} (@code{calc-unix-time}) [@code{unixtime}] command
16873converts a date form into a Unix time value, which is the number of 16873converts a date form into a Unix time value, which is the number of
16874seconds since midnight on Jan 1, 1970, or vice-versa. The numeric result 16874seconds since midnight on Jan 1, 1970, or vice-versa. The numeric result
16875will be an integer if the current precision is 12 or less; for higher 16875will be an integer if the current precision is 12 or less; for higher
16876precisions, the result may be a float with (@var{precision}@minus{}12) 16876precision, the result may be a float with (@var{precision}@minus{}12)
16877digits after the decimal. Just as for @kbd{t J}, the numeric time 16877digits after the decimal. Just as for @kbd{t J}, the numeric time
16878is interpreted in the GMT time zone and the date form is interpreted 16878is interpreted in the GMT time zone and the date form is interpreted
16879in the current or specified zone. Some systems use Unix-like 16879in the current or specified zone. Some systems use Unix-like
@@ -16943,7 +16943,7 @@ from a date form as an integer in the range 0 to 59.
16943The @kbd{M-6 t P} [@code{second}] function extracts the second 16943The @kbd{M-6 t P} [@code{second}] function extracts the second
16944from a date form. If the current precision is 12 or less, 16944from a date form. If the current precision is 12 or less,
16945the result is an integer in the range 0 to 59. For higher 16945the result is an integer in the range 0 to 59. For higher
16946precisions, the result may instead be a floating-point number. 16946precision, the result may instead be a floating-point number.
16947 16947
16948@tindex weekday 16948@tindex weekday
16949The @kbd{M-7 t P} [@code{weekday}] function extracts the weekday 16949The @kbd{M-7 t P} [@code{weekday}] function extracts the weekday
@@ -18499,7 +18499,7 @@ counterparts, which are also available separately as @code{calc-sech}
18499Calc can compute a variety of less common functions that arise in 18499Calc can compute a variety of less common functions that arise in
18500various branches of mathematics. All of the functions described in 18500various branches of mathematics. All of the functions described in
18501this section allow arbitrary complex arguments and, except as noted, 18501this section allow arbitrary complex arguments and, except as noted,
18502will work to arbitrarily large precisions. They can not at present 18502will work to arbitrarily large precision. They can not at present
18503handle error forms or intervals as arguments. 18503handle error forms or intervals as arguments.
18504 18504
18505NOTE: These functions are still experimental. In particular, their 18505NOTE: These functions are still experimental. In particular, their
@@ -21903,7 +21903,7 @@ of our sample formula by selecting it and pressing @kbd{n}
21903@end smallexample 21903@end smallexample
21904 21904
21905Unselecting the sub-formula reveals that the minus sign, which would 21905Unselecting the sub-formula reveals that the minus sign, which would
21906normally have cancelled out with the subtraction automatically, has 21906normally have canceled out with the subtraction automatically, has
21907not been able to do so because the subtraction was not part of the 21907not been able to do so because the subtraction was not part of the
21908selected portion. Pressing @kbd{=} (@code{calc-evaluate}) or doing 21908selected portion. Pressing @kbd{=} (@code{calc-evaluate}) or doing
21909any other mathematical operation on the whole formula will cause it 21909any other mathematical operation on the whole formula will cause it
@@ -22590,7 +22590,7 @@ described for multiplication.
22590 22590
22591Quotients of products cancel only in the leading terms of the 22591Quotients of products cancel only in the leading terms of the
22592numerator and denominator. In other words, @expr{a x b / a y b} 22592numerator and denominator. In other words, @expr{a x b / a y b}
22593is cancelled to @expr{x b / y b} but not to @expr{x / y}. Once 22593is canceled to @expr{x b / y b} but not to @expr{x / y}. Once
22594again this is because full cancellation can be slow; use @kbd{a s} 22594again this is because full cancellation can be slow; use @kbd{a s}
22595to cancel all terms of the quotient. 22595to cancel all terms of the quotient.
22596 22596
@@ -22810,7 +22810,7 @@ the distributive law. For example, @expr{a x^2 b / c x^3 d} will
22810cancel @expr{x^2} from the top and bottom to get @expr{a b / c x d}. 22810cancel @expr{x^2} from the top and bottom to get @expr{a b / c x d}.
22811(The terms in the denominator will then be rearranged to @expr{c d x} 22811(The terms in the denominator will then be rearranged to @expr{c d x}
22812as described above.) If there is any common integer or fractional 22812as described above.) If there is any common integer or fractional
22813factor in the numerator and denominator, it is cancelled out; 22813factor in the numerator and denominator, it is canceled out;
22814for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}. 22814for example, @expr{(4 x + 6) / 8 x} simplifies to @expr{(2 x + 3) / 4 x}.
22815 22815
22816Non-constant common factors are not found even by @kbd{a s}. To 22816Non-constant common factors are not found even by @kbd{a s}. To
@@ -22858,7 +22858,7 @@ example, @samp{(x - 23) % 10} is simplified to @samp{(x + 7) % 10}.
22858 22858
22859If the argument is multiplied by a constant, and this constant 22859If the argument is multiplied by a constant, and this constant
22860has a common integer divisor with the modulus, then this factor is 22860has a common integer divisor with the modulus, then this factor is
22861cancelled out. For example, @samp{12 x % 15} is changed to 22861canceled out. For example, @samp{12 x % 15} is changed to
22862@samp{3 (4 x % 5)} by factoring out 3. Also, @samp{(12 x + 1) % 15} 22862@samp{3 (4 x % 5)} by factoring out 3. Also, @samp{(12 x + 1) % 15}
22863is changed to @samp{3 ((4 x + 1:3) % 5)}. While these forms may 22863is changed to @samp{3 ((4 x + 1:3) % 5)}. While these forms may
22864not seem ``simpler,'' they allow Calc to discover useful information 22864not seem ``simpler,'' they allow Calc to discover useful information
@@ -22938,13 +22938,13 @@ function.
22938\bigskip 22938\bigskip
22939@end tex 22939@end tex
22940 22940
22941Equations and inequalities are simplified by cancelling factors 22941Equations and inequalities are simplified by canceling factors
22942of products, quotients, or sums on both sides. Inequalities 22942of products, quotients, or sums on both sides. Inequalities
22943change sign if a negative multiplicative factor is cancelled. 22943change sign if a negative multiplicative factor is canceled.
22944Non-constant multiplicative factors as in @expr{a b = a c} are 22944Non-constant multiplicative factors as in @expr{a b = a c} are
22945cancelled from equations only if they are provably nonzero (generally 22945canceled from equations only if they are provably nonzero (generally
22946because they were declared so; @pxref{Declarations}). Factors 22946because they were declared so; @pxref{Declarations}). Factors
22947are cancelled from inequalities only if they are nonzero and their 22947are canceled from inequalities only if they are nonzero and their
22948sign is known. 22948sign is known.
22949 22949
22950Simplification also replaces an equation or inequality with 22950Simplification also replaces an equation or inequality with
@@ -23035,9 +23035,9 @@ The simplifications of @expr{@tfn{ln}(@tfn{exp}(x))},
23035unsafe because of problems with principal values (although these 23035unsafe because of problems with principal values (although these
23036simplifications are safe if @expr{x} is known to be real). 23036simplifications are safe if @expr{x} is known to be real).
23037 23037
23038Common factors are cancelled from products on both sides of an 23038Common factors are canceled from products on both sides of an
23039equation, even if those factors may be zero: @expr{a x / b x} 23039equation, even if those factors may be zero: @expr{a x / b x}
23040to @expr{a / b}. Such factors are never cancelled from 23040to @expr{a / b}. Such factors are never canceled from
23041inequalities: Even @kbd{a e} is not bold enough to reduce 23041inequalities: Even @kbd{a e} is not bold enough to reduce
23042@expr{a x < b x} to @expr{a < b} (or @expr{a > b}, depending 23042@expr{a x < b x} to @expr{a < b} (or @expr{a > b}, depending
23043on whether you believe @expr{x} is positive or negative). 23043on whether you believe @expr{x} is positive or negative).
@@ -23071,7 +23071,7 @@ If units auto-ranging mode is enabled, products or quotients in
23071which the first argument is a number which is out of range for the 23071which the first argument is a number which is out of range for the
23072leading unit are modified accordingly. 23072leading unit are modified accordingly.
23073 23073
23074When cancelling and combining units in products and quotients, 23074When canceling and combining units in products and quotients,
23075Calc accounts for unit names that differ only in the prefix letter. 23075Calc accounts for unit names that differ only in the prefix letter.
23076For example, @samp{2 km m} is simplified to @samp{2000 m^2}. 23076For example, @samp{2 km m} is simplified to @samp{2000 m^2}.
23077However, compatible but different units like @code{ft} and @code{in} 23077However, compatible but different units like @code{ft} and @code{in}
diff --git a/doc/misc/cc-mode.texi b/doc/misc/cc-mode.texi
index d5f403e5cdb..8b589259a48 100644
--- a/doc/misc/cc-mode.texi
+++ b/doc/misc/cc-mode.texi
@@ -190,7 +190,7 @@ developing GNU and promoting software freedom.''
190@titlepage 190@titlepage
191@sp 10 191@sp 10
192 192
193@center @titlefont{CC Mode 5.31} 193@center @titlefont{CC Mode 5.32}
194@sp 2 194@sp 2
195@center @subtitlefont{A GNU Emacs mode for editing C and C-like languages} 195@center @subtitlefont{A GNU Emacs mode for editing C and C-like languages}
196@sp 2 196@sp 2
@@ -378,7 +378,7 @@ was added in version 5.30.
378 378
379This manual describes @ccmode{} 379This manual describes @ccmode{}
380@comment The following line must appear on its own, so that the 380@comment The following line must appear on its own, so that the
381version 5.31. 381version 5.32.
382@comment Release.py script can update the version number automatically 382@comment Release.py script can update the version number automatically
383 383
384@ccmode{} supports the editing of K&R and ANSI C, C++, Objective-C, 384@ccmode{} supports the editing of K&R and ANSI C, C++, Objective-C,
@@ -2160,7 +2160,7 @@ A space between the function name and opening parenthesis when calling
2160a user function. The last character of the function name and the 2160a user function. The last character of the function name and the
2161opening parenthesis are highlighted. This font-locking rule will 2161opening parenthesis are highlighted. This font-locking rule will
2162spuriously highlight a valid concatenation expression where an 2162spuriously highlight a valid concatenation expression where an
2163identifier precedes a parenthesised expression. Unfortunately. 2163identifier precedes a parenthesized expression. Unfortunately.
2164 2164
2165@item 2165@item
2166Whitespace following the @samp{\} in what otherwise looks like an 2166Whitespace following the @samp{\} in what otherwise looks like an
diff --git a/doc/misc/dbus.texi b/doc/misc/dbus.texi
index 88b068ccd5b..f515109bf76 100644
--- a/doc/misc/dbus.texi
+++ b/doc/misc/dbus.texi
@@ -1677,7 +1677,7 @@ Establish the connection to D-Bus @var{bus}.
1677 1677
1678@var{bus} can be either the symbol @code{:system} or the symbol 1678@var{bus} can be either the symbol @code{:system} or the symbol
1679@code{:session}, or it can be a string denoting the address of the 1679@code{:session}, or it can be a string denoting the address of the
1680corresponding bus. For the system and session busses, this function 1680corresponding bus. For the system and session buses, this function
1681is called when loading @file{dbus.el}, there is no need to call it 1681is called when loading @file{dbus.el}, there is no need to call it
1682again. 1682again.
1683 1683
@@ -1816,7 +1816,7 @@ handled by a hook function.
1816@defvar dbus-event-error-hooks 1816@defvar dbus-event-error-hooks
1817This hook variable keeps a list of functions, which are called when a 1817This hook variable keeps a list of functions, which are called when a
1818D-Bus error happens in the event handler. Every function must accept 1818D-Bus error happens in the event handler. Every function must accept
1819two arguments, the event and the error variable catched in 1819two arguments, the event and the error variable caught in
1820@code{condition-case} by @code{dbus-error}. 1820@code{condition-case} by @code{dbus-error}.
1821 1821
1822Such functions can be used the adapt the error signal to be raised. 1822Such functions can be used the adapt the error signal to be raised.
diff --git a/doc/misc/ebrowse.texi b/doc/misc/ebrowse.texi
index 19ee9705484..a2a4017eb64 100644
--- a/doc/misc/ebrowse.texi
+++ b/doc/misc/ebrowse.texi
@@ -482,7 +482,7 @@ name.
482@table @kbd 482@table @kbd
483@item SPC 483@item SPC
484This command views the class declaration if the database 484This command views the class declaration if the database
485contains informations about it. If you don't parse the entire source 485contains information about it. If you don't parse the entire source
486you are working on, some classes will only be known to exist but the 486you are working on, some classes will only be known to exist but the
487location of their declarations and definitions will not be known.@refill 487location of their declarations and definitions will not be known.@refill
488 488
diff --git a/doc/misc/ede.texi b/doc/misc/ede.texi
index cc566086f44..2b2a6a21b7f 100644
--- a/doc/misc/ede.texi
+++ b/doc/misc/ede.texi
@@ -705,11 +705,11 @@ A brief description of the project or target. This is currently used
705by the @samp{ede-speedbar} interface. 705by the @samp{ede-speedbar} interface.
706@item ede-want-file-p 706@item ede-want-file-p
707Return non-nil if a target will accept a given file. 707Return non-nil if a target will accept a given file.
708It is generally unecessary to override this. See the section on source 708It is generally unnecessary to override this. See the section on source
709code. 709code.
710@item ede-buffer-mine 710@item ede-buffer-mine
711Return non-nil if a buffer belongs to this target. Used during 711Return non-nil if a buffer belongs to this target. Used during
712association when a file is loaded. It is generally unecessary to 712association when a file is loaded. It is generally unnecessary to
713override this unless you keep auxiliary files. 713override this unless you keep auxiliary files.
714@end table 714@end table
715 715
@@ -2483,7 +2483,7 @@ Create the make rule needed to create an archive for @var{THIS}.
2483 2483
2484@deffn Method ede-proj-makefile-insert-source-variables :PRIMARY this 2484@deffn Method ede-proj-makefile-insert-source-variables :PRIMARY this
2485Insert bin_PROGRAMS variables needed by target @var{THIS}. 2485Insert bin_PROGRAMS variables needed by target @var{THIS}.
2486We aren't acutally inserting SOURCE details, but this is used by the 2486We aren't actually inserting SOURCE details, but this is used by the
2487Makefile.am generator, so use it to add this important bin program. 2487Makefile.am generator, so use it to add this important bin program.
2488@end deffn 2488@end deffn
2489 2489
@@ -2624,7 +2624,7 @@ Return the name of the main target for @var{THIS} target.
2624 2624
2625@deffn Method ede-proj-makefile-insert-automake-pre-variables :AFTER this 2625@deffn Method ede-proj-makefile-insert-automake-pre-variables :AFTER this
2626Insert bin_PROGRAMS variables needed by target @var{THIS}. 2626Insert bin_PROGRAMS variables needed by target @var{THIS}.
2627We aren't acutally inserting SOURCE details, but this is used by the 2627We aren't actually inserting SOURCE details, but this is used by the
2628Makefile.am generator, so use it to add this important bin program. 2628Makefile.am generator, so use it to add this important bin program.
2629@end deffn 2629@end deffn
2630 2630
diff --git a/doc/misc/emacs-mime.texi b/doc/misc/emacs-mime.texi
index c44cc1c9b09..91440dcfe8f 100644
--- a/doc/misc/emacs-mime.texi
+++ b/doc/misc/emacs-mime.texi
@@ -417,7 +417,7 @@ called with a @acronym{MIME} handle as the argument.
417@vindex mm-inline-text-html-with-images 417@vindex mm-inline-text-html-with-images
418Some @acronym{HTML} mails might have the trick of spammers using 418Some @acronym{HTML} mails might have the trick of spammers using
419@samp{<img>} tags. It is likely to be intended to verify whether you 419@samp{<img>} tags. It is likely to be intended to verify whether you
420have read the mail. You can prevent your personal informations from 420have read the mail. You can prevent your personal information from
421leaking by setting this option to @code{nil} (which is the default). 421leaking by setting this option to @code{nil} (which is the default).
422It is currently ignored by Emacs/w3. For emacs-w3m, you may use the 422It is currently ignored by Emacs/w3. For emacs-w3m, you may use the
423command @kbd{t} on the image anchor to show an image even if it is 423command @kbd{t} on the image anchor to show an image even if it is
diff --git a/doc/misc/eshell.texi b/doc/misc/eshell.texi
index b0090f0fb84..7c178757927 100644
--- a/doc/misc/eshell.texi
+++ b/doc/misc/eshell.texi
@@ -608,7 +608,7 @@ scrolls back.
608 608
609@item Using C-p and C-n with rebind gets into a locked state 609@item Using C-p and C-n with rebind gets into a locked state
610 610
611This happened a few times in Emacs 21, but has been unreproducible 611This happened a few times in Emacs 21, but has been irreproducible
612since. 612since.
613 613
614@item If an interactive process is currently running, @kbd{M-!} doesn't work 614@item If an interactive process is currently running, @kbd{M-!} doesn't work
diff --git a/doc/misc/gnus-faq.texi b/doc/misc/gnus-faq.texi
index b5bb75f7284..7bd3e4ac7fa 100644
--- a/doc/misc/gnus-faq.texi
+++ b/doc/misc/gnus-faq.texi
@@ -266,9 +266,9 @@ and how to prevent it?
266@subsubheading Answer 266@subsubheading Answer
267 267
268This message means that the last time you used Gnus, it 268This message means that the last time you used Gnus, it
269wasn't properly exited and therefor couldn't write its 269wasn't properly exited and therefore couldn't write its
270informations to disk (e.g. which messages you read), you 270information to disk (e.g. which messages you read), you
271are now asked if you want to restore those informations 271are now asked if you want to restore that information
272from the auto-save file. 272from the auto-save file.
273 273
274To prevent this message make sure you exit Gnus 274To prevent this message make sure you exit Gnus
@@ -563,7 +563,7 @@ However, the first thing to do is to tell Gnus in which way
563it should store the mail, in Gnus terminology which back end 563it should store the mail, in Gnus terminology which back end
564to use. Gnus supports many different back ends, the most 564to use. Gnus supports many different back ends, the most
565commonly used one is nnml. It stores every mail in one file 565commonly used one is nnml. It stores every mail in one file
566and is therefor quite fast. However you might prefer a one 566and is therefore quite fast. However you might prefer a one
567file per group approach if your file system has problems with 567file per group approach if your file system has problems with
568many small files, the nnfolder back end is then probably the 568many small files, the nnfolder back end is then probably the
569choice for you. To use nnml add the following to ~/.gnus.el: 569choice for you. To use nnml add the following to ~/.gnus.el:
@@ -580,7 +580,7 @@ As you might have guessed, if you want nnfolder, it's
580@end example 580@end example
581@noindent 581@noindent
582 582
583Now we need to tell Gnus, where to get it's mail from. If 583Now we need to tell Gnus, where to get its mail from. If
584it's a POP3 server, then you need something like this: 584it's a POP3 server, then you need something like this:
585 585
586@example 586@example
@@ -1104,11 +1104,11 @@ I don't like the way the Summary buffer looks, how to tweak it?
1104@subsubheading Answer 1104@subsubheading Answer
1105 1105
1106You've got to play around with the variable 1106You've got to play around with the variable
1107gnus-summary-line-format. It's value is a string of 1107gnus-summary-line-format. Its value is a string of
1108symbols which stand for things like author, date, subject 1108symbols which stand for things like author, date, subject
1109etc. A list of the available specifiers can be found in the 1109etc. A list of the available specifiers can be found in the
1110manual node "Summary Buffer Lines" and the often forgotten 1110manual node "Summary Buffer Lines" and the often forgotten
1111node "Formatting Variables" and it's sub-nodes. There 1111node "Formatting Variables" and its sub-nodes. There
1112you'll find useful things like positioning the cursor and 1112you'll find useful things like positioning the cursor and
1113tabulators which allow you a summary in table form, but 1113tabulators which allow you a summary in table form, but
1114sadly hard tabulators are broken in 5.8.8. 1114sadly hard tabulators are broken in 5.8.8.
@@ -1838,7 +1838,7 @@ inconvenient since you are not displaying the found mail
1838in Gnus. Here comes nnir into action. Nnir is a front end 1838in Gnus. Here comes nnir into action. Nnir is a front end
1839to search engines like swish-e or swish++ and 1839to search engines like swish-e or swish++ and
1840others. You index your mail with one of those search 1840others. You index your mail with one of those search
1841engines and with the help of nnir you can search trough 1841engines and with the help of nnir you can search through
1842the indexed mail and generate a temporary group with all 1842the indexed mail and generate a temporary group with all
1843messages which met your search criteria. If this sound 1843messages which met your search criteria. If this sound
1844cool to you get nnir.el from 1844cool to you get nnir.el from
@@ -2190,7 +2190,7 @@ Starting Gnus is really slow, how to speed it up?
2190 2190
2191@subsubheading Answer 2191@subsubheading Answer
2192 2192
2193The reason for this could be the way Gnus reads it's 2193The reason for this could be the way Gnus reads its
2194active file, see the node "The Active File" in the Gnus 2194active file, see the node "The Active File" in the Gnus
2195manual for things you might try to speed the process up. 2195manual for things you might try to speed the process up.
2196An other idea would be to byte compile your ~/.gnus.el (say 2196An other idea would be to byte compile your ~/.gnus.el (say
diff --git a/doc/misc/gnus.texi b/doc/misc/gnus.texi
index 69b17a94d68..86aaadf8ae8 100644
--- a/doc/misc/gnus.texi
+++ b/doc/misc/gnus.texi
@@ -4622,7 +4622,7 @@ Sieve is a server-side mail filtering language. In Gnus you can use
4622the @code{sieve} group parameter (@pxref{Group Parameters}) to specify 4622the @code{sieve} group parameter (@pxref{Group Parameters}) to specify
4623sieve rules that should apply to each group. Gnus provides two 4623sieve rules that should apply to each group. Gnus provides two
4624commands to translate all these group parameters into a proper Sieve 4624commands to translate all these group parameters into a proper Sieve
4625script that can be transfered to the server somehow. 4625script that can be transferred to the server somehow.
4626 4626
4627@vindex gnus-sieve-file 4627@vindex gnus-sieve-file
4628@vindex gnus-sieve-region-start 4628@vindex gnus-sieve-region-start
@@ -8332,7 +8332,7 @@ Files with name matching this regular expression won't be viewed.
8332Files with a @acronym{MIME} type matching this variable won't be viewed. 8332Files with a @acronym{MIME} type matching this variable won't be viewed.
8333Note that Gnus tries to guess what type the file is based on the name. 8333Note that Gnus tries to guess what type the file is based on the name.
8334@code{gnus-uu} is not a @acronym{MIME} package (yet), so this is slightly 8334@code{gnus-uu} is not a @acronym{MIME} package (yet), so this is slightly
8335kludgey. 8335kludgy.
8336 8336
8337@item gnus-uu-tmp-dir 8337@item gnus-uu-tmp-dir
8338@vindex gnus-uu-tmp-dir 8338@vindex gnus-uu-tmp-dir
@@ -8976,7 +8976,7 @@ Translate many non-@acronym{ASCII} characters into their
8976@acronym{ASCII} equivalents (@code{gnus-article-treat-non-ascii}). 8976@acronym{ASCII} equivalents (@code{gnus-article-treat-non-ascii}).
8977This is mostly useful if you're on a terminal that has a limited font 8977This is mostly useful if you're on a terminal that has a limited font
8978and doesn't show accented characters, ``advanced'' punctuation, and the 8978and doesn't show accented characters, ``advanced'' punctuation, and the
8979like. For instance, @samp{»} is tranlated into @samp{>>}, and so on. 8979like. For instance, @samp{»} is translated into @samp{>>}, and so on.
8980 8980
8981@item W Y f 8981@item W Y f
8982@kindex W Y f (Summary) 8982@kindex W Y f (Summary)
@@ -11634,7 +11634,7 @@ message/external-body @acronym{MIME} type.
11634@item r (Article) 11634@item r (Article)
11635@kindex r (Article) 11635@kindex r (Article)
11636Prompt for a file name, replace the @acronym{MIME} object with an 11636Prompt for a file name, replace the @acronym{MIME} object with an
11637external body refering to the file via the message/external-body 11637external body referring to the file via the message/external-body
11638@acronym{MIME} type. (@code{gnus-mime-replace-part}). 11638@acronym{MIME} type. (@code{gnus-mime-replace-part}).
11639 11639
11640@findex gnus-mime-delete-part 11640@findex gnus-mime-delete-part
@@ -15033,7 +15033,7 @@ number.
15033 15033
15034@item mail-source-default-file-modes 15034@item mail-source-default-file-modes
15035@vindex mail-source-default-file-modes 15035@vindex mail-source-default-file-modes
15036All new mail files will get this file mode. The default is 384. 15036All new mail files will get this file mode. The default is @code{#o600}.
15037 15037
15038@item mail-source-movemail-program 15038@item mail-source-movemail-program
15039@vindex mail-source-movemail-program 15039@vindex mail-source-movemail-program
@@ -15123,10 +15123,10 @@ default file modes the new mail files get:
15123 15123
15124@lisp 15124@lisp
15125(add-hook 'nnmail-pre-get-new-mail-hook 15125(add-hook 'nnmail-pre-get-new-mail-hook
15126 (lambda () (set-default-file-modes 511))) 15126 (lambda () (set-default-file-modes #o700)))
15127 15127
15128(add-hook 'nnmail-post-get-new-mail-hook 15128(add-hook 'nnmail-post-get-new-mail-hook
15129 (lambda () (set-default-file-modes 551))) 15129 (lambda () (set-default-file-modes #o775)))
15130@end lisp 15130@end lisp
15131 15131
15132@item nnmail-use-long-file-names 15132@item nnmail-use-long-file-names
@@ -30012,7 +30012,7 @@ this:
30012@node Score File Syntax 30012@node Score File Syntax
30013@subsection Score File Syntax 30013@subsection Score File Syntax
30014 30014
30015Score files are meant to be easily parseable, but yet extremely 30015Score files are meant to be easily parsable, but yet extremely
30016malleable. It was decided that something that had the same read syntax 30016malleable. It was decided that something that had the same read syntax
30017as an Emacs Lisp list would fit that spec. 30017as an Emacs Lisp list would fit that spec.
30018 30018
diff --git a/doc/misc/idlwave.texi b/doc/misc/idlwave.texi
index 3e13dbb0f23..c7495d8cc93 100644
--- a/doc/misc/idlwave.texi
+++ b/doc/misc/idlwave.texi
@@ -669,7 +669,7 @@ We have already used the routine info display in the first part of this
669tutorial. This was the invoked using @kbd{C-c ?}, and displays 669tutorial. This was the invoked using @kbd{C-c ?}, and displays
670information about the IDL routine near the cursor position. Wouldn't it 670information about the IDL routine near the cursor position. Wouldn't it
671be nice to have the same kind of information available for your own 671be nice to have the same kind of information available for your own
672routines and for the huge amount of code in major libraries like JHUPL 672routines and for the huge amount of code in major libraries like JHUAPL
673or the IDL-Astro library? In many cases, you may already have this 673or the IDL-Astro library? In many cases, you may already have this
674information. Files named @file{.idlwave_catalog} in library directories 674information. Files named @file{.idlwave_catalog} in library directories
675contain scanned information on the routines in that directory; many 675contain scanned information on the routines in that directory; many
@@ -1580,8 +1580,8 @@ available will be emphasized (e.g. colored blue). For other items, the
1580corresponding source code or DocLib header will be used as the help 1580corresponding source code or DocLib header will be used as the help
1581text. 1581text.
1582 1582
1583@cindex Completion, cancelling 1583@cindex Completion, canceling
1584@cindex Cancelling completion 1584@cindex Canceling completion
1585Completion is not a blocking operation --- you are free to continue 1585Completion is not a blocking operation --- you are free to continue
1586editing, enter commands, or simply ignore the @file{*Completions*} 1586editing, enter commands, or simply ignore the @file{*Completions*}
1587buffer during a completion operation. If, however, the most recent 1587buffer during a completion operation. If, however, the most recent
diff --git a/doc/misc/message.texi b/doc/misc/message.texi
index d9062a32572..774bf180266 100644
--- a/doc/misc/message.texi
+++ b/doc/misc/message.texi
@@ -1974,7 +1974,7 @@ that look like:
1974Hallvard B Furuseth <h.b.furuseth@@usit.uio.no> writes: 1974Hallvard B Furuseth <h.b.furuseth@@usit.uio.no> writes:
1975@end example 1975@end example
1976 1976
1977@c FIXME: Add `message-insert-formated-citation-line' and 1977@c FIXME: Add `message-insert-formatted-citation-line' and
1978@c `message-citation-line-format' 1978@c `message-citation-line-format'
1979 1979
1980Point will be at the beginning of the body of the message when this 1980Point will be at the beginning of the body of the message when this
diff --git a/doc/misc/org.texi b/doc/misc/org.texi
index 181e00f8e02..adc9cf0b139 100644
--- a/doc/misc/org.texi
+++ b/doc/misc/org.texi
@@ -11399,16 +11399,16 @@ a file is retrieved with @code{org-publish-find-date}.
11399@tab Should sorting be case-sensitive? Default @code{nil}. 11399@tab Should sorting be case-sensitive? Default @code{nil}.
11400 11400
11401@item @code{:sitemap-file-entry-format} 11401@item @code{:sitemap-file-entry-format}
11402@tab With this option one can tell how a sitemap's entry is formated in the 11402@tab With this option one can tell how a sitemap's entry is formatted in the
11403sitemap. This is a format string with some escape sequences: @code{%t} stands 11403sitemap. This is a format string with some escape sequences: @code{%t} stands
11404for the title of the file, @code{%a} stands for the author of the file and 11404for the title of the file, @code{%a} stands for the author of the file and
11405@code{%d} stands for the date of the file. The date is retrieved with the 11405@code{%d} stands for the date of the file. The date is retrieved with the
11406@code{org-publish-find-date} function and formated with 11406@code{org-publish-find-date} function and formatted with
11407@code{org-publish-sitemap-date-format}. Default @code{%t}. 11407@code{org-publish-sitemap-date-format}. Default @code{%t}.
11408 11408
11409@item @code{:sitemap-date-format} 11409@item @code{:sitemap-date-format}
11410@tab Format string for the @code{format-time-string} function that tells how 11410@tab Format string for the @code{format-time-string} function that tells how
11411a sitemap entry's date is to be formated. This property bypasses 11411a sitemap entry's date is to be formatted. This property bypasses
11412@code{org-publish-sitemap-date-format} which defaults to @code{%Y-%m-%d}. 11412@code{org-publish-sitemap-date-format} which defaults to @code{%Y-%m-%d}.
11413 11413
11414@item @code{:sitemap-sans-extension} 11414@item @code{:sitemap-sans-extension}
@@ -12469,7 +12469,7 @@ block. E.g., @code{:results value html}.
12469Results assumed to be LaTeX and are enclosed in a @code{begin_latex} block. 12469Results assumed to be LaTeX and are enclosed in a @code{begin_latex} block.
12470E.g., @code{:results value latex}. 12470E.g., @code{:results value latex}.
12471@item @code{code} 12471@item @code{code}
12472Result are assumed to be parseable code and are enclosed in a code block. 12472Result are assumed to be parsable code and are enclosed in a code block.
12473E.g., @code{:results value code}. 12473E.g., @code{:results value code}.
12474@item @code{pp} 12474@item @code{pp}
12475The result is converted to pretty-printed code and is enclosed in a code 12475The result is converted to pretty-printed code and is enclosed in a code
diff --git a/doc/misc/rcirc.texi b/doc/misc/rcirc.texi
index 3e9ee928822..192afe33cb4 100644
--- a/doc/misc/rcirc.texi
+++ b/doc/misc/rcirc.texi
@@ -524,7 +524,7 @@ your full name, you might want to set it to some pseudonym.
524 524
525@item rcirc-authinfo 525@item rcirc-authinfo
526@vindex rcirc-authinfo 526@vindex rcirc-authinfo
527@cindex authentification 527@cindex authentication
528@cindex identification 528@cindex identification
529@cindex nickserv 529@cindex nickserv
530@cindex login 530@cindex login
@@ -547,7 +547,7 @@ And here are the valid method symbols and the arguments they require:
547 547
548@table @code 548@table @code
549@item nickserv 549@item nickserv
550@cindex nickserv authentification 550@cindex nickserv authentication
551Use this symbol if you need to identify yourself as follows when 551Use this symbol if you need to identify yourself as follows when
552connecting to a network: @code{/msg nickserv identify secret}. The 552connecting to a network: @code{/msg nickserv identify secret}. The
553necessary arguments are the nickname you want to use this for, and the 553necessary arguments are the nickname you want to use this for, and the
@@ -558,7 +558,7 @@ pick a password for it. Contact @code{nickserv} and check out the
558details. (Using @code{/msg nickserv help}, for example.) 558details. (Using @code{/msg nickserv help}, for example.)
559 559
560@item chanserv 560@item chanserv
561@cindex chanserv authentification 561@cindex chanserv authentication
562Use this symbol if you need to identify yourself as follows if you want 562Use this symbol if you need to identify yourself as follows if you want
563to join a particular channel: @code{/msg chanserv identify #underground 563to join a particular channel: @code{/msg chanserv identify #underground
564secret}. The necessary arguments are the nickname and channel you want 564secret}. The necessary arguments are the nickname and channel you want
@@ -569,7 +569,7 @@ the password to use. Contact @code{chanserv} and check out the details.
569(Using @code{/msg chanserv help}, for example.) 569(Using @code{/msg chanserv help}, for example.)
570 570
571@item bitlbee 571@item bitlbee
572@cindex bitlbee authentification 572@cindex bitlbee authentication
573Use this symbol if you need to identify yourself in the Bitlbee channel 573Use this symbol if you need to identify yourself in the Bitlbee channel
574as follows: @code{identify secret}. The necessary arguments are the 574as follows: @code{identify secret}. The necessary arguments are the
575nickname you want to use this for, and the password to use. 575nickname you want to use this for, and the password to use.
@@ -585,7 +585,7 @@ Bitlbee acts like an IRC server, but in fact it is a gateway to a lot of
585other instant messaging services. You can either install Bitlbee 585other instant messaging services. You can either install Bitlbee
586locally or use a public Bitlbee server. There, you need to create an 586locally or use a public Bitlbee server. There, you need to create an
587account with a password. This is the nick and password you need to 587account with a password. This is the nick and password you need to
588provide for the bitlbee authentification method. 588provide for the bitlbee authentication method.
589 589
590Later, you will tell Bitlbee about your accounts and passwords on all 590Later, you will tell Bitlbee about your accounts and passwords on all
591the other instant messaging services, and Bitlbee will log you in. All 591the other instant messaging services, and Bitlbee will log you in. All
diff --git a/doc/misc/semantic.texi b/doc/misc/semantic.texi
index dcfff1fcb96..8c56d2dc9f8 100644
--- a/doc/misc/semantic.texi
+++ b/doc/misc/semantic.texi
@@ -380,7 +380,7 @@ with the search results format.
380 380
381@item semanticdb-ref.el 381@item semanticdb-ref.el
382Tracks crossreferences. Cross references are needed when buffer is 382Tracks crossreferences. Cross references are needed when buffer is
383reparsed, and must alert other tables that any dependant caches may 383reparsed, and must alert other tables that any dependent caches may
384need to be flushed. References are in the form of include files. 384need to be flushed. References are in the form of include files.
385 385
386@end table 386@end table
diff --git a/doc/misc/tramp.texi b/doc/misc/tramp.texi
index f7f340074a2..1cea074fa2b 100644
--- a/doc/misc/tramp.texi
+++ b/doc/misc/tramp.texi
@@ -528,8 +528,8 @@ differ.
528@cindex methods, inline 528@cindex methods, inline
529@cindex methods, external 529@cindex methods, external
530Loading or saving a remote file requires that the content of the file 530Loading or saving a remote file requires that the content of the file
531be transfered between the two machines. The content of the file can 531be transferred between the two machines. The content of the file can
532be transfered using one of two methods: the @dfn{inline method} over 532be transferred using one of two methods: the @dfn{inline method} over
533the same connection used to log in to the remote machine, or the 533the same connection used to log in to the remote machine, or the
534@dfn{external method} through another connection using a remote copy 534@dfn{external method} through another connection using a remote copy
535program such as @command{rcp}, @command{scp} or @command{rsync}. 535program such as @command{rcp}, @command{scp} or @command{rsync}.
@@ -3704,4 +3704,4 @@ for @value{emacsothername}.
3704@c host and then send commands to it. 3704@c host and then send commands to it.
3705@c * Use `filename' resp. `file name' consistently. 3705@c * Use `filename' resp. `file name' consistently.
3706@c * Use `host' resp. `machine' consistently. 3706@c * Use `host' resp. `machine' consistently.
3707@c * Consistent small or capitalized words especially in menues. 3707@c * Consistent small or capitalized words especially in menus.