annotate doc/emacs/maintaining.texi @ 100257:a6a34eba22f9

(Old Revisions): Improve previous change.
author Glenn Morris <rgm@gnu.org>
date Sat, 06 Dec 2008 03:30:36 +0000
parents ff0dc1bbf0c1
children cb5d2387102c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1 @c This is part of the Emacs manual.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2 @c Copyright (C) 1985, 1986, 1987, 1993, 1994, 1995, 1997, 1999, 2000,
100257
a6a34eba22f9 (Old Revisions): Improve previous change.
Glenn Morris <rgm@gnu.org>
parents: 100188
diff changeset
3 @c 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
a6a34eba22f9 (Old Revisions): Improve previous change.
Glenn Morris <rgm@gnu.org>
parents: 100188
diff changeset
4 @c Free Software Foundation, Inc.
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
5 @c See file emacs.texi for copying conditions.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
6 @node Maintaining, Abbrevs, Building, Top
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
7 @chapter Maintaining Large Programs
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
8
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
9 This chapter describes Emacs features for maintaining large
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
10 programs.
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
11
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
12 @menu
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
13 * Version Control:: Using version control systems.
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
14 * Change Log:: Maintaining a change history for your program.
94293
ca9efc5939fc Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 91507
diff changeset
15 * Tags:: Go directly to any function in your program in one
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
16 command. Tags remembers which file it is in.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
17 @ifnottex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
18 * Emerge:: A convenient way of merging two versions of a program.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
19 @end ifnottex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
20 @end menu
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
21
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
22 @node Version Control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
23 @section Version Control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
24 @cindex version control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
25
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
26 A @dfn{version control system} is a package that can record multiple
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
27 versions of a source file, storing information such as the creation
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
28 time of each version, who created it, and a description of what was
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
29 changed in that version.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
30
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
31 The Emacs version control interface is called VC. Its commands work
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
32 with several different version control systems; currently, it supports
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
33 GNU Arch, Bazaar, CVS, Git, Mercurial, Monotone, RCS, SCCS/CSSC, and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
34 Subversion. Of these, the GNU project distributes CVS, GNU Arch, RCS,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
35 and Bazaar.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
36
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
37 VC is enabled automatically whenever you visit a file that is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
38 governed by a version control system. To disable VC entirely, set the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
39 customizable variable @code{vc-handled-backends} to @code{nil}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
40 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
41 (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
42 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
43 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
44 (@pxref{Customizing VC}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
45 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
46
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
47 @menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
48 * Introduction to VC:: How version control works in general.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
49 * VC Mode Line:: How the mode line shows version control status.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
50 * Basic VC Editing:: How to edit a file under version control.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
51 * Old Revisions:: Examining and comparing old versions.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
52 * Secondary VC Commands:: The commands used a little less frequently.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
53 * VC Directory Mode:: Listing files managed by version control.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
54 * Branches:: Multiple lines of development.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
55 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
56 * Remote Repositories:: Efficient access to remote CVS servers.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
57 * Revision Tags:: Symbolic names for revisions
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
58 * Miscellaneous VC:: Various other commands and features of VC.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
59 * Customizing VC:: Variables that change VC's behavior.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
60 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
61 @end menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
62
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
63 @node Introduction to VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
64 @subsection Introduction to Version Control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
65
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
66 VC allows you to use a version control system from within Emacs,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
67 integrating the version control operations smoothly with editing.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
68 Though VC cannot completely bridge the gaps between version control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
69 systems with widely differing capabilities, it does provide a uniform
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
70 interface to many version control operations. Regardless of which
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
71 version control system is in use, you will be able to do basic
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
72 operations in much the same way.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
73
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
74 This section provides a general overview of version control, and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
75 describes the version control systems that VC supports. You can skip
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
76 this section if you are already familiar with the version control system
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
77 you want to use.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
78
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
79 @menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
80 * Why Version Control?:: Understanding the problems it addresses
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
81 * Version Control Systems:: Supported version control back-end systems.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
82 * VCS Concepts:: Words and concepts related to version control.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
83 * Types of Log File:: The VCS log in contrast to the ChangeLog.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
84 @end menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
85
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
86 @node Why Version Control?
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
87 @subsubsection Understanding the problems it addresses
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
88
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
89 Version control systems provide you with three important
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
90 capabilities:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
91
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
92 @itemize @bullet
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
93 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
94 @dfn{Reversibility}: the ability to back up to a previous state if you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
95 discover that some modification you did was a mistake or a bad idea.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
96
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
97 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
98 @dfn{Concurrency}: the ability to have many people modifying the same
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
99 collection of files knowing that conflicting modifications can be
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
100 detected and resolved.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
101
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
102 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
103 @dfn{History}: the ability to attach historical data to your data,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
104 such as explanatory comments about the intention behind each change to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
105 it. Even for a programmer working solo, change histories are an
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
106 important aid to memory; for a multi-person project, they are a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
107 vitally important form of communication among developers.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
108 @end itemize
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
109
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
110 @node Version Control Systems
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
111 @subsubsection Supported Version Control Systems
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
112
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
113 @cindex back end (version control)
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
114 VC currently works with many different version control systems or
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
115 @dfn{back ends}:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
116
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
117 @itemize @bullet
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
118
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
119 @cindex SCCS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
120 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
121 SCCS was the first version control system ever built, and was long ago
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
122 superseded by more advanced ones. VC compensates for certain features
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
123 missing in SCCS (e.g., tag names for releases) by implementing them
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
124 itself. Other VC features, such as multiple branches, are simply
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
125 unavailable. Since SCCS is non-free, we recommend avoiding it.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
126
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
127 @cindex CSSC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
128 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
129 CSSC is a free replacement for SCCS. You should use CSSC only if, for
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
130 some reason, you cannot use a more recent and better-designed version
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
131 control system.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
132
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
133 @cindex RCS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
134 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
135 RCS is the free version control system around which VC was initially
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
136 built. Almost everything you can do with RCS can be done through VC.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
137 However, you cannot use RCS over the network, and it only works at the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
138 level of individual files rather than projects.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
139
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
140 @cindex CVS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
141 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
142 CVS is the free version control system that was, until recently (circa
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
143 2008), used by the majority of free software projects. Nowadays, it
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
144 is slowly being superseded by newer systems. CVS allows concurrent
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
145 multi-user development either locally or over the network. It lacks
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
146 support for atomic commits or file moving/renaming. VC supports all
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
147 basic editing operations under CVS. For some less common tasks, you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
148 still need to call CVS from the command line. Note also that before
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
149 using CVS you must set up a repository, which is a subject too complex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
150 to treat here.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
151
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
152 @cindex SVN
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
153 @cindex Subversion
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
154 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
155 Subversion (SVN) is a free version control system designed to be
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
156 similar to CVS but without its problems. It supports atomic commits
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
157 of filesets, and versioning of directories, symbolic links, meta-data,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
158 renames, copies, and deletes.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
159
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
160 @cindex GNU Arch
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
161 @cindex Arch
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
162 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
163 GNU Arch is a version control system designed for distributed work.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
164 It differs in many ways from older systems like CVS and RCS. It
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
165 provides different methods for interoperating between users, support
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
166 for offline operations, and good branching and merging features. It
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
167 also supports atomic commits of filesets and file moving/renaming. VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
168 does not support all operations provided by GNU Arch, so you must
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
169 sometimes invoke it from the command line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
170
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
171 @cindex git
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
172 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
173 Git is a distributed version control system invented by Linus Torvalds to support
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
174 development of Linux (his kernel). It supports atomic commits of filesets and
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
175 file moving/renaming. One significant feature of git is that it
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
176 largely abolishes the notion of a single centralized repository;
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
177 instead, each working copy of a git project is its own repository and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
178 coordination is done through repository-sync operations. VC supports
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
179 most git operations, with the exception of news merges and repository
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
180 syncing; these must be done from the command line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
181
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
182 @cindex hg
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
183 @cindex Mercurial
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
184 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
185 Mercurial (hg) is a distributed version control system broadly
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
186 resembling GNU Arch and git, with atomic fileset commits and file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
187 moving/renaming. Like git, it is fully decentralized. VC supports
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
188 most Mercurial commands, with the exception of repository sync
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
189 operations; this needs to be done from the command line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
190
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
191 @cindex bzr
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
192 @cindex Bazaar
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
193 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
194 Bazaar (bzr) is a distributed version control system that supports both
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
195 repository-based and distributed versioning, with atomic fileset
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
196 commits and file moving/renaming. VC supports most basic editing
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
197 operations under Bazaar.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
198 @end itemize
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
199
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
200 Previous versions of VC supported a version control system known as
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
201 Meta-CVS. This support has been dropped because of limited interest
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
202 from users and developers.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
203
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
204 @node VCS Concepts
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
205 @subsubsection Concepts of Version Control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
206
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
207 @cindex repository
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
208 @cindex registered file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
209 When a file is under version control, we say that it is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
210 @dfn{registered} in the version control system. The system has a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
211 @dfn{repository} which stores both the file's present state and its
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
212 change history---enough to reconstruct the current version or any
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
213 earlier version. The repository also contains other information, such
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
214 as @dfn{log entries} that describe the changes made to each file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
215
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
216 @cindex work file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
217 @cindex checking out files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
218 A file @dfn{checked out} of a repository is called the @dfn{work
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
219 file}. You edit the work file and make changes in it, as you would
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
220 with an ordinary file. After you are done with a set of changes, you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
221 @dfn{check in} or @dfn{commit} the file; this records the changes in
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
222 the repository, along with a log entry for those changes.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
223
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
224 @cindex revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
225 @cindex revision ID
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
226 A copy of a file stored in a repository is called a @dfn{revision}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
227 The history of a file is a sequence of revisions. Each revisions is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
228 named by a @dfn{revision ID}. The format of the revision ID depends
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
229 on the version control system; in the simplest case, it is just an
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
230 integer.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
231
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
232 To go beyond these basic concepts, you will need to understand three
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
233 aspects in which version control systems differ.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
234 They can be locking-based or merging-based; they can be file-based or
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
235 changeset-based; and they can be centralized or decentralized. VC
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
236 handles all these modes of operation, but it cannot hide the differences.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
237
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
238 @cindex locking versus merging
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
239 A version control system typically has some mechanism to coordinate
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
240 between users who want to change the same file. There are two ways to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
241 do this: merging and locking.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
242
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
243 In a version control system that uses merging, each user may check
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
244 out and modify a work file at any time. The system lets you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
245 @dfn{merge} your work file, which may contain changes that have not
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
246 been checked in, with the latest changes that others have checked into
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
247 the repository.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
248
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
249 Older version control systems use a @dfn{locking} scheme instead.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
250 Here, work files are normally read-only. To edit a file, you ask the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
251 version control system to make it writable for you by @dfn{locking}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
252 it; only one user can lock a given file at any given time. This
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
253 procedure is analogous to, but different from, the locking that Emacs
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
254 uses to detect simultaneous editing of ordinary files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
255 (@pxref{Interlocking}). When you check in your changes, that unlocks
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
256 the file, and the work file becomes read-only again. Other users may
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
257 then lock the file to make their own changes.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
258
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
259 Both locking and merging systems can have problems when multiple
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
260 users try to modify the same file at the same time. Locking systems
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
261 have @dfn{lock conflicts}; a user may try to check a file out and be
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
262 unable to because it is locked. In merging systems, @dfn{merge
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
263 conflicts} happen when you check in a change to a file that conflicts
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
264 with a change checked in by someone else after your checkout. Both
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
265 kinds of conflict have to be resolved by human judgment and
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
266 communication. Experience has shown that merging is superior to
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
267 locking, both in convenience to developers and in minimizing the
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
268 number and severity of conflicts that actually occur.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
269
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
270 SCCS always uses locking. RCS is lock-based by default but can be
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
271 told to operate in a merging style. CVS and Subversion are
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
272 merge-based by default but can be told to operate in a locking mode.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
273 Distributed version control systems, such as GNU Arch, git, and
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
274 Mercurial, are exclusively merging-based.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
275
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
276 VC mode supports both locking and merging version control. The
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
277 terms ``checkin'' and ``checkout'' come from locking-based version
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
278 control systems; newer version control systems have slightly different
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
279 operations usually called ``commit'' and ``update'', but VC hides the
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
280 differences between them as much as possible.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
281
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
282 @cindex files versus changesets.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
283 On SCCS, RCS, CVS, and other early version control systems, version
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
284 control operations are @dfn{file-based}: each file has its own comment
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
285 and revision history separate from that of all other files in the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
286 system. Later systems, beginning with Subversion, are
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
287 @dfn{changeset-based}: a checkin may include changes to several files,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
288 and the entire set of changes is treated as a unit by the system. Any
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
289 comment associated with the change does not belong to a single file,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
290 but to the changeset itself.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
292 Changeset-based version control is more flexible and powerful than
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
293 file-based version control; usually, when a change to multiple files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
294 has to be reversed, it's good to be able to easily identify and remove
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
295 all of it.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
296
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
297 @cindex centralized vs. decentralized version control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
298 Early version control systems were designed around a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
299 @dfn{centralized} model in which each project has only one repository
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
300 used by all developers. SCCS, RCS, CVS, and Subversion share this
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
301 kind of model. One of its drawbacks is that the repository is a choke
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
302 point for reliability and efficiency.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
303
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
304 GNU Arch pioneered the concept of @dfn{decentralized} version
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
305 control, later implemented in git, Mercurial, and Bazaar. A project
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
306 may have several different repositories, and these systems support a
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
307 sort of super-merge between repositories that tries to reconcile their
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
308 change histories. At the limit, each developer has his/her own
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
309 repository, and repository merges replace checkin/commit operations.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
310
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
311 VC's job is to help you manage the traffic between your personal
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
312 workfiles and a repository. Whether that repository is a single
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
313 master or one of a network of peer repositories is not something VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
314 has to care about. Thus, the difference between a centralized and a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
315 decentralized version control system is invisible to VC mode.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
316
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
317 @node Types of Log File
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
318 @subsubsection Types of Log File
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
319 @cindex types of log file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
320 @cindex log File, types of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
321 @cindex version control log
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
322
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
323 Projects that use a version control system can have two types of log
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
324 for changes. One is the log maintained by the version control system:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
325 each time you check in a change, you fill out a @dfn{log entry} for
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
326 the change (@pxref{Log Buffer}). This is called the @dfn{version
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
327 control log}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
328
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
329 The other kind of log is the file @file{ChangeLog} (@pxref{Change
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
330 Log}). It provides a chronological record of all changes to a large
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
331 portion of a program---typically one directory and its subdirectories.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
332 A small program would use one @file{ChangeLog} file; a large program
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
333 may have a @file{ChangeLog} file in each major directory.
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
334 @xref{Change Log}. Programmers have used change logs since long
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
335 before version control systems.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
336
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
337 Changeset-based version systems typically maintain a changeset-based
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
338 modification log for the entire system, which makes change log files
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
339 somewhat redundant. One advantage that they retain is that it is
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
340 sometimes useful to be able to view the transaction history of a
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
341 single directory separately from those of other directories.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
342
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
343 A project maintained with version control can use just the version
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
344 control log, or it can use both kinds of logs. It can handle some
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
345 files one way and some files the other way. Each project has its
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
346 policy, which you should follow.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
347
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
348 When the policy is to use both, you typically want to write an entry
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
349 for each change just once, then put it into both logs. You can write
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
350 the entry in @file{ChangeLog}, then copy it to the log buffer with
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
351 @kbd{C-c C-a} when checking in the change (@pxref{Log Buffer}). Or
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
352 you can write the entry in the log buffer while checking in the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
353 change, and later use the @kbd{C-x v a} command to copy it to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
354 @file{ChangeLog}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
355 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
356 (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
357 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
358 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
359 (@pxref{Change Logs and VC}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
360 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
361
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
362 @node VC Mode Line
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
363 @subsection Version Control and the Mode Line
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
364
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
365 When you visit a file that is under version control, Emacs indicates
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
366 this on the mode line. For example, @samp{RCS-1.3} says that RCS is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
367 used for that file, and the current version is 1.3.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
368
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
369 The character between the back-end name and the revision ID
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
370 indicates the version control status of the file. @samp{-} means that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
371 the work file is not locked (if locking is in use), or not modified (if
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
372 locking is not in use). @samp{:} indicates that the file is locked, or
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
373 that it is modified. If the file is locked by some other user (for
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
374 instance, @samp{jim}), that is displayed as @samp{RCS:jim:1.3}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
375
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
376 On a graphical display, you can move the mouse over this mode line
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
377 indicator to pop up a ``tool-tip'', which displays a more verbose
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
378 description of the version control status. Pressing @kbd{Mouse-1}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
379 over the indicator pops up a menu of VC commands. This menu is
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
380 identical to the @samp{Tools / Version Control} menu item.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
381
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
382 @vindex auto-revert-check-vc-info
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
383 When Auto Revert mode (@pxref{Reverting}) reverts a buffer that is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
384 under version control, it updates the version control information in
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
385 the mode line. However, Auto Revert mode may not properly update this
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
386 information if the version control status changes without changes to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
387 the work file, from outside the current Emacs session. If you set
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
388 @code{auto-revert-check-vc-info} to @code{t}, Auto Revert mode updates
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
389 the version control status information every
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
390 @code{auto-revert-interval} seconds, even if the work file itself is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
391 unchanged. The resulting CPU usage depends on the version control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
392 system, but is usually not excessive.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
393
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
394 @node Basic VC Editing
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
395 @subsection Basic Editing under Version Control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
396
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
397 @cindex filesets, VC
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
398 Most VC commands operate on @dfn{VC filesets}. A VC fileset is a
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
399 collection of one or more files that a VC operation acts on. When you
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
400 type VC commands in a buffer visiting a version-controlled file, the
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
401 VC fileset is simply that one file. When you type them in a VC
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
402 Directory buffer, and some files in it are marked, the VC fileset
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
403 consists of the marked files (@pxref{VC Directory Mode}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
404
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
405 The principal VC command is an all-purpose command, @kbd{C-x v v}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
406 (@code{vc-next-action}), that performs either locking, merging or a
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
407 check-in (depending on the situation) on the current VC fileset. You
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
408 can use @kbd{C-x v v} in a file-visiting buffer or in a VC Directory
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
409 buffer.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
410
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
411 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
412 @itemx C-x v v
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
413 Perform the appropriate next version control operation on the VC fileset.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
414 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
415
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
416 @findex vc-next-action
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
417 @kindex C-x v v
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
418 The precise action of @kbd{C-x v v} depends on the state of the VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
419 fileset, and whether the version control system uses locking or
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
420 merging. This is described in detail in the subsequent sections.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
421
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
422 VC filesets are the way that VC mode bridges the gap between
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
423 file-based and changeset-based version control systems. They are,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
424 essentially, a way to pass multiple file arguments as a group to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
425 version control commands. For example, on Subversion, a checkin with
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
426 a multi-file VC fileset becomes a joint commit, as though you had
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
427 typed @command{svn commit} with those file arguments at the shell
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
428 command line. All files in a VC fileset must be under the same
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
429 version control system; if they are not, Emacs signals an error when
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
430 you attempt to execute a command on the fileset.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
431
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
432 Support for VC filesets and changeset-based version control systems
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
433 is the main improvement to VC in Emacs 23. When you mark multi-file
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
434 VC in a VC Directory buffer, VC operations treat them as a VC fileset,
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
435 and operate on them all at once if the version control system is
99307
0be526fded6c Minor fix.
Chong Yidong <cyd@stupidchicken.com>
parents: 99299
diff changeset
436 changeset-based. @xref{VC Directory Mode}.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
437
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
438 VC filesets are distinct from the ``named filesets'' used for
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
439 viewing and visiting files in functional groups (@pxref{Filesets}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
440 Unlike named filesets, VC filesets are not named and don't persist
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
441 across sessions.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
442
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
443 @menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
444 * VC With A Merging VCS:: Without locking: default mode for CVS.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
445 * VC With A Locking VCS:: RCS in its default mode, SCCS, and optionally CVS.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
446 * Advanced C-x v v:: Advanced features available with a prefix argument.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
447 * Log Buffer:: Features available in log entry buffers.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
448 @end menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
449
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
450 @node VC With A Merging VCS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
451 @subsubsection Basic Version Control with Merging
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
452
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
453 When your version control system is merging-based (the default for
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
454 CVS and all newer version control systems), work files are always
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
455 writable; you need not do anything special to begin editing a file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
456 The status indicator on the mode line is @samp{-} if the file is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
457 unmodified; it flips to @samp{:} as soon as you save any changes
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
458 (@pxref{VC Mode Line}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
459
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
460 Here is what @kbd{C-x v v} does when using a merging-based system:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
461
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
462 @itemize @bullet
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
463 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
464 If the work file is the same as in the repository, it does nothing.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
465
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
466 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
467 If you have not changed the work file, but some other user has checked
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
468 in changes to the repository, @kbd{C-x v v} merges those changes into
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
469 the work file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
470
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
471 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
472 If you have made modifications to the work file, @kbd{C-x v v}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
473 attempts to check in your changes. To do this, Emacs first reads the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
474 log entry for the new revision (@pxref{Log Buffer}). If some other
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
475 user has checked in changes to the repository since you last checked
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
476 it out, the checkin fails. In that case, type @kbd{C-x v v} again to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
477 merge those changes into your own work file; this puts the work file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
478 into a ``conflicted'' state. Type @kbd{C-x v v} to clear the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
479 ``conflicted'' state; VC then regards the file as up-to-date and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
480 modified, and you can try to check it in again.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
481
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
482 To pick up any recent changes from the repository @emph{without}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
483 trying to commit your own changes, type @kbd{C-x v m @key{RET}}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
484 @xref{Merging}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
485 @end itemize
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
486
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
487 These rules also apply when you use RCS in its ``non-locking'' mode,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
488 except that changes will not be automatically merged from the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
489 repository. Nothing informs you if another user has checked in
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
490 changes in the same file since you began editing it; when you check in
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
491 your revision, his changes are removed (however, they remain in the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
492 repository and are thus not irrevocably lost). Therefore, you must
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
493 verify that the current revision is unchanged before checking in your
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
494 changes. In addition, locking is possible with RCS even in this mode:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
495 @kbd{C-x v v} with an unmodified file locks the file, just as it does
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
496 with RCS in its normal locking mode (@pxref{VC With A Locking VCS}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
497
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
498 @node VC With A Locking VCS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
499 @subsubsection Basic Version Control with Locking
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
500
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
501 Under a locking-based version control system (such as SCCS, and RCS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
502 in its default mode), @kbd{C-x v v} does the following:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
503
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
504 @itemize @bullet
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
505 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
506 If the file is not locked, @kbd{C-x v v} locks it, and makes it
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
507 writable so that you can change it.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
508
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
509 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
510 If the file is locked by you, and contains changes, @kbd{C-x v v}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
511 checks in the changes. In order to do this, it first reads the log
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
512 entry for the new revision. @xref{Log Buffer}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
513
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
514 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
515 If the file is locked by you, but you have not changed it since you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
516 locked it, @kbd{C-x v v} releases the lock and makes the file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
517 read-only again.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
518
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
519 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
520 If the file is locked by some other user, @kbd{C-x v v} asks you whether
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
521 you want to ``steal the lock'' from that user. If you say yes, the file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
522 becomes locked by you, but a message is sent to the person who had
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
523 formerly locked the file, to inform him of what has happened.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
524 @end itemize
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
525
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
526 These rules also apply when you use CVS in locking mode, except
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
527 that there is no such thing as stealing a lock.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
528
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
529 @node Advanced C-x v v
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
530 @subsubsection Advanced Control in @kbd{C-x v v}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
531
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
532 @cindex revision ID to check in/out
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
533 When you give a prefix argument to @code{vc-next-action} (@kbd{C-u
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
534 C-x v v}), it still performs the next logical version control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
535 operation, but accepts additional arguments to specify precisely how
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
536 to do the operation.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
537
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
538 @itemize @bullet
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
539 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
540 If the file is modified (or locked), you can specify the revision ID
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
541 to use for the new version that you check in. This is one way
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
542 to create a new branch (@pxref{Branches}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
543
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
544 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
545 If the file is not modified (and unlocked), you can specify the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
546 revision to select; this lets you start working from an older
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
547 revision, or on another branch. If you do not enter any revision,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
548 that takes you to the highest (``head'') revision on the current
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
549 branch; therefore @kbd{C-u C-x v v @key{RET}} is a convenient way to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
550 get the latest version of a file from the repository.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
551
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
552 @item
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
553 @cindex specific version control system
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
554 Instead of the revision ID, you can also specify the name of a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
555 version control system. This is useful when one file is being managed
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
556 with two version control systems at the same time
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
557 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
558 (@pxref{Local Version Control,,,emacs-xtra, Specialized Emacs
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
559 Features}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
560 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
561 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
562 (@pxref{Local Version Control}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
563 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
564
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
565 @end itemize
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
566
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
567 @node Log Buffer
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
568 @subsubsection Features of the Log Entry Buffer
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
569
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
570 When you check in changes, Emacs pops up a buffer called
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
571 @samp{*VC-Log*} for you to enter a log entry.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
572
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
573 After you have finished editing the log message, type @kbd{C-c C-c}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
574 to exit the buffer and commit the change.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
575
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
576 @findex log-edit-show-files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
577 @findex log-edit-show-diff
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
578 In the @samp{*VC-Log*} buffer, typing @kbd{C-c C-f}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
579 (@code{log-edit-show-files}) displays a list of files in the VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
580 fileset you are committing. If you called @kbd{C-x v v} directly from
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
581 a work file, the VC fileset consists of that single file, so this
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
582 command is not very useful. If you called @kbd{C-x v v} from a VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
583 directory buffer, the VC fileset may consist of multiple files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
584 (@pxref{VC Directory Mode}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
585
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
586 @findex log-edit-insert-changelog
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
587 Type @kbd{C-c C-d} (@code{log-edit-show-diff}) to show a ``diff'' of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
588 the changes you have made (i.e., the differences between the work file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
589 and the repository revision from which you started editing the file).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
590 The diff is displayed in a special buffer in another window.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
591 @xref{Comparing Files}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
592
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
593 If you have written an entry in the @file{ChangeLog} (@pxref{Change
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
594 Log}), type @kbd{C-c C-a} (@code{log-edit-insert-changelog}) to pull
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
595 it into the @samp{*VC-Log*} buffer. If the topmost item in the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
596 @file{ChangeLog} was made under your user name on the current date,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
597 this command searches that item for entries that match the file(s) to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
598 be committed; if found, these entries are inserted.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
599 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
600 @xref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features},
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
601 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
602 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
603 @xref{Change Logs and VC},
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
604 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
605 for the opposite way of working---generating ChangeLog entries from
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
606 the revision control log.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
607
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
608 To abort a check-in, just @strong{don't} type @kbd{C-c C-c} in that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
609 buffer. You can switch buffers and do other editing. As long as you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
610 don't try to check in another file, the entry you were editing remains
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
611 in the @samp{*VC-Log*} buffer, and you can go back to that buffer at
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
612 any time to complete the check-in.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
613
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
614 If you change several source files for the same reason, it is often
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
615 convenient to specify the same log entry for many of the files. (This
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
616 is the normal way to do things on a changeset-oriented system, where
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
617 comments are attached to changesets rather than the history of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
618 individual files.) The most convenient way to do this is to mark all
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
619 the files in VC Directory Mode and check in from there; the log buffer
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
620 will carry the fileset information with it and do a group commit when
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
621 you type @kbd{C-c C-c}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
622
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
623 You can also browse the history of previous log entries to duplicate
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
624 a checkin comment. This can be useful when you want several files to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
625 have checkin comments that vary only slightly from each other. The
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
626 commands @kbd{M-n}, @kbd{M-p}, @kbd{M-s} and @kbd{M-r} for doing this
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
627 work just like the minibuffer history commands (except that these
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
628 versions are used outside the minibuffer).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
629
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
630 @vindex vc-log-mode-hook
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
631 Each time you check in a change, the log entry buffer is put into VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
632 Log Edit mode, which involves running two hooks: @code{text-mode-hook}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
633 and @code{vc-log-mode-hook}. @xref{Hooks}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
634
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
635 @node Old Revisions
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
636 @subsection Examining And Comparing Old Revisions
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
637
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
638 One of the convenient features of version control is the ability
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
639 to examine any revision of a file, or compare two revisions.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
640
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
641 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
642 @item C-x v ~ @var{revision} @key{RET}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
643 Examine revision @var{revision} of the visited file, in a buffer of its
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
644 own.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
645
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
646 @item C-x v =
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
647 Compare the buffer contents associated with the current
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
648 fileset with the working revision(s) from which you started editing.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
649
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
650 @item C-u C-x v = @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
651 Compare the specified two repository revisions of the current fileset.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
652
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
653 @item C-x v g
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
654 Display an annotated version of the file: for each line, show the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
655 latest revision in which it was modified.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
656 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
657
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
658 @findex vc-revision-other-window
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
659 @kindex C-x v ~
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
660 To examine an old revision, visit the work file and type @kbd{C-x v
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
661 ~ @var{revision} @key{RET}} (@code{vc-revision-other-window}). Here,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
662 @var{revision} is either the desired revision ID (@pxref{VCS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
663 Concepts}), or the name of a tag or branch
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
664 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
665 (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
666 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
667 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
668 (@pxref{Tags}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
669 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
670 This command puts the text of the old revision in a file named
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
671 @file{@var{filename}.~@var{revision}~}, and visits it in its own
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
672 buffer in a separate window.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
673
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
674 @findex vc-diff
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
675 @kindex C-x v =
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
676 @kbd{C-x v =} (@code{vc-diff}) compares the current buffer contents
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
677 of each file in the current VC fileset (saving them if necessary) with
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
678 the repository revision from which you started editing. Note that the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
679 latter may or may not be the latest revision of the file(s). The diff
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
680 is displayed in a special buffer in another window. @xref{Comparing
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
681 Files}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
682
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
683 @findex vc-diff
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
684 @kindex C-u C-x v =
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
685 To compare two arbitrary revisions of the current VC fileset, call
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
686 @code{vc-diff} with a prefix argument: @kbd{C-u C-x v =}. This
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
687 prompts for two revision IDs, using the minibuffer, and displays the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
688 diff in a special buffer in another window. Instead of providing a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
689 revision ID, you can give an empty input, which specifies the current
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
690 contents of the work file; or a tag or branch name
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
691 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
692 (@pxref{Tags,,,emacs-xtra, Specialized Emacs Features}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
693 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
694 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
695 (@pxref{Tags}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
696 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
697 If your version control system is file-based (e.g. CVS) rather than
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
698 changeset-based (Subversion, GNU Arch, git, Mercurial), supplying a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
699 revision ID for a multi-file fileset (as opposed to a symbolic tag
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
700 name) is unlikely to return diffs that are connected in any meaningful
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
701 way.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
702
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
703 If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
704 is neither visiting a version-controlled file nor a VC directory
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
705 buffer, these commands generate a diff of all registered files in the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
706 current directory and its subdirectories.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
707
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
708 @vindex vc-diff-switches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
709 @vindex vc-rcs-diff-switches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
710 @kbd{C-x v =} works by running a variant of the @code{diff} utility
100188
ff0dc1bbf0c1 (Old Revisions): Fix diff-switches description.
Glenn Morris <rgm@gnu.org>
parents: 99307
diff changeset
711 designed to work with the version control system in use. The options
ff0dc1bbf0c1 (Old Revisions): Fix diff-switches description.
Glenn Morris <rgm@gnu.org>
parents: 99307
diff changeset
712 to pass to the @code{diff} command are taken from the first non-@code{nil}
ff0dc1bbf0c1 (Old Revisions): Fix diff-switches description.
Glenn Morris <rgm@gnu.org>
parents: 99307
diff changeset
713 value of @code{vc-@var{backend}-diff-switches}, @code{vc-diff-switches},
ff0dc1bbf0c1 (Old Revisions): Fix diff-switches description.
Glenn Morris <rgm@gnu.org>
parents: 99307
diff changeset
714 and @code{diff-switches} (@pxref{Comparing Files}), in that order.
ff0dc1bbf0c1 (Old Revisions): Fix diff-switches description.
Glenn Morris <rgm@gnu.org>
parents: 99307
diff changeset
715 Since @code{nil} means to check the next variable in the sequence,
ff0dc1bbf0c1 (Old Revisions): Fix diff-switches description.
Glenn Morris <rgm@gnu.org>
parents: 99307
diff changeset
716 either of the first two may use the value @code{t} to mean no switches at all.
100257
a6a34eba22f9 (Old Revisions): Improve previous change.
Glenn Morris <rgm@gnu.org>
parents: 100188
diff changeset
717 Most of the @samp{vc@dots{}diff-switches} variables default to
a6a34eba22f9 (Old Revisions): Improve previous change.
Glenn Morris <rgm@gnu.org>
parents: 100188
diff changeset
718 @code{nil}, but some default to @code{t}. These are for those version
a6a34eba22f9 (Old Revisions): Improve previous change.
Glenn Morris <rgm@gnu.org>
parents: 100188
diff changeset
719 control systems (e.g. SVN) whose @code{diff} implementations do not
a6a34eba22f9 (Old Revisions): Improve previous change.
Glenn Morris <rgm@gnu.org>
parents: 100188
diff changeset
720 accept common options (e.g. @samp{-c}) likely to be in
a6a34eba22f9 (Old Revisions): Improve previous change.
Glenn Morris <rgm@gnu.org>
parents: 100188
diff changeset
721 @code{diff-switches}.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
722
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
723 The buffer produced by @kbd{C-x v =} supports the commands of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
724 Compilation mode (@pxref{Compilation Mode}), such as @kbd{C-x `} and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
725 @kbd{C-c C-c}, in both the ``old'' and ``new'' text, and they always
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
726 find the corresponding locations in the current work file. (Older
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
727 revisions are not, in general, present as files on your disk.)
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
728
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
729 @findex vc-annotate
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
730 @kindex C-x v g
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
731 For some back ends, you can display the file @dfn{annotated} with
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
732 per-line revision information, by typing @kbd{C-x v g}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
733 (@code{vc-annotate}). This creates a new buffer (the ``annotate
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
734 buffer'') displaying the file's text, with each part colored to show
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
735 how old it is. Text colored red is new, blue means old, and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
736 intermediate colors indicate intermediate ages. By default, the color
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
737 is scaled over the full range of ages, such that the oldest changes
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
738 are blue, and the newest changes are red.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
739
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
740 When you give a prefix argument to this command, Emacs reads two
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
741 arguments using the minibuffer: the ID of which revision to display and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
742 annotate (instead of the current file contents), and the time span in
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
743 days the color range should cover.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
744
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
745 From the annotate buffer, these and other color scaling options are
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
746 available from the @samp{VC-Annotate} menu. In this buffer, you can
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
747 also use the following keys to browse the annotations of past revisions,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
748 view diffs, or view log entries:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
749
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
750 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
751 @item p
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
752 Annotate the previous revision, that is to say, the revision before
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
753 the one currently annotated. A numeric prefix argument is a repeat
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
754 count, so @kbd{C-u 10 p} would take you back 10 revisions.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
755
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
756 @item n
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
757 Annotate the next revision---the one after the revision currently
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
758 annotated. A numeric prefix argument is a repeat count.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
759
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
760 @item j
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
761 Annotate the revision indicated by the current line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
762
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
763 @item a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
764 Annotate the revision before the one indicated by the current line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
765 This is useful to see the state the file was in before the change on
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
766 the current line was made.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
767
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
768 @item f
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
769 Show in a buffer the file revision indicated by the current line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
770
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
771 @item d
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
772 Display the diff between the current line's revision and the previous
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
773 revision. This is useful to see what the current line's revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
774 actually changed in the file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
775
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
776 @item D
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
777 Display the diff between the current line's revision and the previous
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
778 revision for all files in the changeset (for VC systems that support
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
779 changesets). This is useful to see what the current line's revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
780 actually changed in the tree.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
781
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
782 @item l
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
783 Show the log of the current line's revision. This is useful to see
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
784 the author's description of the changes in the revision on the current
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
785 line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
786
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
787 @item w
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
788 Annotate the working revision--the one you are editing. If you used
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
789 @kbd{p} and @kbd{n} to browse to other revisions, use this key to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
790 return to your working revision.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
791
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
792 @item v
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
793 Toggle the annotation visibility. This is useful for looking just at
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
794 the file contents without distraction from the annotations.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
795 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
796
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
797 @node Secondary VC Commands
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
798 @subsection The Secondary Commands of VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
799
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
800 This section explains the secondary commands of VC.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
801
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
802 @menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
803 * Registering:: Putting a file under version control.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
804 * VC Status:: Viewing the VC status of files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
805 * VC Undo:: Canceling changes before or after check-in.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
806 @end menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
807
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
808 @node Registering
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
809 @subsubsection Registering a File for Version Control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
810
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
811 @kindex C-x v i
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
812 @findex vc-register
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
813 You can put any file under version control by simply visiting it, and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
814 then typing @w{@kbd{C-x v i}} (@code{vc-register}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
815
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
816 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
817 @item C-x v i
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
818 Register the visited file for version control.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
819 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
820
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
821 To register the file, Emacs must choose which version control system
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
822 to use for it. If the file's directory already contains files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
823 registered in a version control system, Emacs uses that system. If
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
824 there is more than one system in use for a directory, Emacs uses the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
825 one that appears first in @code{vc-handled-backends}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
826 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
827 (@pxref{Customizing VC,,,emacs-xtra, Specialized Emacs Features}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
828 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
829 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
830 (@pxref{Customizing VC}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
831 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
832 On the other hand, if there are no files already registered, Emacs uses
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
833 the first system from @code{vc-handled-backends} that could register
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
834 the file (for example, you cannot register a file under CVS if its
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
835 directory is not already part of a CVS tree); with the default value
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
836 of @code{vc-handled-backends}, this means that Emacs uses RCS in this
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
837 situation.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
838
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
839 If locking is in use, @kbd{C-x v i} leaves the file unlocked and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
840 read-only. Type @kbd{C-x v v} if you wish to start editing it. After
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
841 registering a file with CVS, you must subsequently commit the initial
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
842 revision by typing @kbd{C-x v v}. Until you do that, the revision ID
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
843 appears as @samp{@@@@} in the mode line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
844
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
845 @vindex vc-default-init-revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
846 @cindex initial revision ID to register
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
847 The default initial revision ID for a newly registered file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
848 varies by what VCS you are using; normally it will be 1.1 on VCSes
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
849 that use dot-pair revision IDs and 1 on VCSes that use monotonic IDs.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
850 You can specify a different default by setting the variable
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
851 @code{vc-default-init-revision}, or you can give @kbd{C-x v i} a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
852 numeric argument; then it reads the initial revision ID for this
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
853 particular file using the minibuffer.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
854
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
855 @vindex vc-initial-comment
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
856 If @code{vc-initial-comment} is non-@code{nil}, @kbd{C-x v i} reads an
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
857 initial comment to describe the purpose of this source file. Reading
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
858 the initial comment works like reading a log entry (@pxref{Log Buffer}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
859
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
860 @node VC Status
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
861 @subsubsection VC Status Commands
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
862
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
863 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
864 @item C-x v l
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
865 Display revision control state and change history.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
866 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
867
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
868 @kindex C-x v l
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
869 @findex vc-print-log
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
870 To view the detailed revision control status and history of a file,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
871 type @kbd{C-x v l} (@code{vc-print-log}). This pops up a special
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
872 buffer named @samp{*vc-change-log*}, in a new window, that displays
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
873 the history of changes to the current file, including the text of the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
874 log entries. The point is centered at the revision of the file that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
875 is currently being visited.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
876
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
877 In the @samp{*vc-change-log*} buffer, you can use the following keys
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
878 to move between the logs of revisions and of files, to view past
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
879 revisions, to modify change comments, to view annotations and to view
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
880 diffs:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
881
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
882 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
883 @item p
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
884 Move to the previous revision-item in the buffer. (Revision entries in the log
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
885 buffer are usually in reverse-chronological order, so the previous
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
886 revision-item usually corresponds to a newer revision.) A numeric
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
887 prefix argument is a repeat count.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
888
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
889 @item n
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
890 Move to the next revision-item (which most often corresponds to the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
891 previous revision of the file). A numeric prefix argument is a repeat
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
892 count.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
893
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
894 @item P
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
895 Move to the log of the previous file, when the logs of multiple files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
896 are in the log buffer (@pxref{VC Directory Mode}). Otherwise, just
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
897 move to the beginning of the log. A numeric prefix argument is a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
898 repeat count, so @kbd{C-u 10 P} would move backward 10 files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
899
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
900 @item N
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
901 Move to the log of the next file, when the logs of multiple files are
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
902 in the log buffer (@pxref{VC Directory Mode}). It also takes a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
903 numeric prefix argument as a repeat count.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
904
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
905 @item a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
906 Annotate the revision indicated by the current line.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
907
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
908 @item e
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
909 Modify the change comment displayed at point. Note that not all VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
910 systems support modifying change comments.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
911
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
912 @item f
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
913 Visit the revision indicated at the current line, like typing @kbd{C-x
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
914 v ~} and specifying this revision's ID (@pxref{Old Revisions}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
915
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
916 @item d
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
917 Display the diff (@pxref{Comparing Files}) between the revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
918 indicated at the current line and the next earlier revision. This is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
919 useful to see what actually changed in the file when the revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
920 indicated on the current line was committed.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
921
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
922 @item D
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
923 Display the changeset diff (@pxref{Comparing Files}) between the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
924 revision indicated at the current line and the next earlier revision.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
925 This is useful to see all the changes to all files that the revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
926 indicated on the current line did when it was committed.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
927 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
928
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
929 @node VC Undo
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
930 @subsubsection Undoing Version Control Actions
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
931
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
932 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
933 @item C-x v u
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
934 Revert the buffer and the file to the working revision from which you started
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
935 editing the file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
936
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
937 @item C-x v c
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
938 Remove the last-entered change from the master for the visited file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
939 This undoes your last check-in.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
940 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
941
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
942 @kindex C-x v u
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
943 @findex vc-revert-buffer
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
944 If you want to discard your current set of changes and revert to the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
945 working revision from which you started editing the file, use @kbd{C-x
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
946 v u} (@code{vc-revert-buffer}). If the version control system is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
947 locking-based, this leaves the file unlocked, and you must lock it
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
948 again before making new changes. @kbd{C-x v u} requires confirmation,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
949 unless it sees that you haven't made any changes with respect to the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
950 master copy of the working revision.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
951
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
952 @kbd{C-x v u} is also the command to unlock a file if you lock it and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
953 then decide not to change it.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
954
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
955 @kindex C-x v c
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
956 @findex vc-rollback
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
957 To cancel a change that you already checked in, use @kbd{C-x v c}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
958 (@code{vc-rollback}). This command discards all record of the most
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
959 recent checked-in revision, but only if your work file corresponds to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
960 that revision---you cannot use @kbd{C-x v c} to cancel a revision that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
961 is not the latest on its branch. Note that many version control
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
962 systems do not support rollback at all; this command is something of a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
963 historical relic.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
964
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
965 @node VC Directory Mode
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
966 @subsection VC Directory Mode
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
967
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
968 @kindex C-x v d
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
969 @findex vc-dir
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
970 When you are working on a large program, it is often useful to find
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
971 out which files have changed within an entire directory tree, or to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
972 view the status of all files under version control at once, and to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
973 perform version control operations on collections of files. You can
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
974 use the command @kbd{C-x v d} (@code{vc-dir}) to make a directory
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
975 listing that includes only files relevant for version control. This
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
976 creates a @dfn{VC Directory buffer} and displays it in a separate
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
977 window.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
978
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
979 @cindex PCL-CVS
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
980 @pindex cvs
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
981 @cindex CVS directory mode
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
982 The VC Directory buffer works with all the version control systems
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
983 that VC supports. For CVS, Emacs also offers a more powerful facility
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
984 called PCL-CVS. @xref{Top, , About PCL-CVS, pcl-cvs, PCL-CVS --- The
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
985 Emacs Front-End to CVS}.
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
986
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
987 @menu
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
988 * Buffer: VC Directory Buffer. What the buffer looks like and means.
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
989 * Commands: VC Directory Commands. Commands to use in a VC directory buffer.
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
990 @end menu
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
991
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
992 @node VC Directory Buffer
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
993 @subsubsection The VC Directory Buffer
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
994
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
995 The VC Directory buffer contains a list of version-controlled files
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
996 in the current directory and its subdirectories. Files which are
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
997 up-to-date (have no local differences from the repository copy) are
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
998 usually hidden; if all files in a subdirectory are up-to-date, the
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
999 subdirectory is hidden as well. There is an exception to this rule:
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1000 if VC mode detects that a file has changed to an up-to-date state
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1001 since you last looked at it, that file and its state are shown.
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1002
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1003 If a directory uses more that one version control system, you can
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1004 select which system to use for the @code{vc-dir} command by invoking
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1005 @code{vc-dir} with a prefix argument: @kbd{C-u C-x v d}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1006
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1007 The line for an individual file shows the version control state of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1008 the file. Under RCS and SCCS, the name of the user locking the file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1009 is shown; under CVS, an abbreviated version of the @samp{cvs status}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1010 output is used. Here is an example using CVS:
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1011
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1012 @smallexample
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1013 @group
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1014 ./
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1015 modified file1.c
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1016 needs-update file2.c
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1017 needs-merge file3.c
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1018 @end group
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1019 @end smallexample
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1020
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1021 @noindent
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1022 In this example, @samp{file1.c} is modified with respect to the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1023 repository, and @samp{file2.c} is not. @samp{file3.c} is modified,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1024 but other changes have also been checked in to the repository---you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1025 need to merge them with the work file before you can check it in.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1026
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1027 @vindex vc-stay-local
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1028 @vindex vc-cvs-stay-local
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1029 In the above, if the repository were on a remote machine, VC only
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1030 contacts it when the variable @code{vc-stay-local} (or
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1031 @code{vc-cvs-stay-local}) is @code{nil} (@pxref{CVS Options}). This is
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1032 because access to the repository may be slow, or you may be working
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1033 offline and not have access to the repository at all. As a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1034 consequence, VC would not be able to tell you that @samp{file3.c} is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1035 in the ``merge'' state; you would learn that only when you try to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1036 check-in your modified copy of the file, or use a command such as
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1037 @kbd{C-x v m}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1038
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1039 In practice, this is not a problem because CVS handles this case
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1040 consistently whenever it arises. In VC, you'll simply get prompted to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1041 merge the remote changes into your work file first. The benefits of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1042 less network communication usually outweigh the disadvantage of not
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1043 seeing remote changes immediately.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1044
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1045 @vindex vc-directory-exclusion-list
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1046 When a VC directory displays subdirectories it omits some that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1047 should never contain any files under version control. By default,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1048 this includes Version Control subdirectories such as @samp{RCS} and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1049 @samp{CVS}; you can customize this by setting the variable
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1050 @code{vc-directory-exclusion-list}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1051
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1052 @node VC Directory Commands
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1053 @subsubsection VC Directory Commands
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1054
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1055 VC Directory mode has a full set of navigation and marking commands
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1056 for picking out filesets. Some of these are also available in a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1057 context menu invoked by the @kbd{mouse-2} button.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1058
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1059 Up- and down-arrow keys move in the buffer; @kbd{n} and @kbd{p} also
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1060 move vertically as in other list-browsing modes. @key{SPC} and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1061 @key{TAB} behave like down-arrow, and @key{BackTab} behaves like
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1062 up-arrow.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1063
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1064 Both @kbd{C-m} and @kbd{f} visit the file on the current
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1065 line. @kbd{o} visits that file in another window. @kbd{q} dismisses
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1066 the directory buffer.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1067
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1068 @kbd{x} toggles hiding of up-to-date files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1069
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1070 @kbd{m} marks the file or directory on the current line. If the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1071 region is active, @kbd{m} marks all the files in the region. There
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1072 are some restrictions when marking: a file cannot be marked if any of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1073 its parent directories are marked, and a directory cannot be marked if
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1074 any files in it or in its child directories are marked.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1075
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1076 @kbd{M} marks all the files with the same VC state as the current
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1077 file if the cursor is on a file. If the cursor is on a directory, it
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1078 marks all child files. With a prefix argument: marks all files and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1079 directories.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1080
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1081 @kbd{u} unmarks the file or directory on the current line. If the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1082 region is active, it unmarks all the files in the region.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1083
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1084 @kbd{U} marks all the files with the same VC state as the current file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1085 if the cursor is on a file. If the cursor is on a directory, it
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1086 unmarks all child files. With a prefix argument: unmarks all marked
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1087 files and directories.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1088
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1089 It is possible to do search, search and replace, incremental search,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1090 and incremental regexp search on multiple files. These commands will
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1091 work on all the marked files or the current file if nothing is marked.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1092 If a directory is marked, the files in that directory shown in the VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1093 directory buffer will be used.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1094
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1095 @kbd{S} searches the marked files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1096
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1097 @kbd{Q} does a query replace on the marked files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1098
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1099 @kbd{M-s a C-s} does an incremental search on the marked files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1100
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1101 @kbd{M-s a C-M-s} does an incremental search on the marked files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1102
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1103 Commands are also accessible from the VC-dir menu. Note that some VC
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1104 backends use the VC-dir menu to make available extra backend specific
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1105 commands.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1106
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1107 Normal VC commands with the @kbd{C-x v} prefix work in VC directory
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1108 buffers. Some single-key shortcuts are available as well; @kbd{=},
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1109 @kbd{+}, @kbd{l}, @kbd{i}, and @kbd{v} behave as through prefixed with
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1110 @kbd{C-x v}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1111
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1112 The command @kbd{C-x v v} (@code{vc-next-action}) operates on all the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1113 marked files, so that you can check in several files at once.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1114 If the underlying VC supports atomic commits of multiple-file
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1115 changesets, @kbd{C-x v v} with a selected set of modified but not
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1116 committed files will commit all of them at once as a single changeset.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1117
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1118 When @kbd{C-x v v} (@code{vc-next-action}) operates on multiple
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1119 files, all of those files must be either in the same state or in
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1120 compatible states (added, modified and removed states are considered
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1121 compatible). Otherwise it signals an error. This differs from the
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1122 behavior of older versions of VC, which did not have fileset
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1123 operations and simply did @code{vc-next-action} on each file
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1124 individually.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1125
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1126 If any files are in a state that calls for commit, @kbd{C-x v v} reads a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1127 single log entry and uses it for the changeset as a whole. If the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1128 underling VCS is file- rather than changeset-oriented, the log entry
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1129 will be replicated into the history of each file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1130
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1131 @node Branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1132 @subsection Multiple Branches of a File
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1133 @cindex branch (version control)
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1134 @cindex trunk (version control)
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1135
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1136 One use of version control is to maintain multiple ``current''
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1137 revisions of a file. For example, you might have different revisions of a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1138 program in which you are gradually adding various unfinished new
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1139 features. Each such independent line of development is called a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1140 @dfn{branch}. VC allows you to create branches, switch between
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1141 different branches, and merge changes from one branch to another.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1142 Please note, however, that branches are not supported for SCCS.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1143
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1144 A file's main line of development is usually called the @dfn{trunk}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1145 You can create multiple branches from the trunk. How the difference
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1146 between trunk and branch is made visible is dependent on whether the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1147 VCS uses dot-pair or monotonic version IDs.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1148
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1149 In VCSes with dot-pair revision IDs, the revisions on the trunk are
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1150 normally IDed 1.1, 1.2, 1.3, etc. At any such revision, you can
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1151 start an independent branch. A branch starting at revision 1.2 would
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1152 have revision ID 1.2.1.1, and consecutive revisions on this branch
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1153 would have IDs 1.2.1.2, 1.2.1.3, 1.2.1.4, and so on. If there is
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1154 a second branch also starting at revision 1.2, it would consist of
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1155 revisions 1.2.2.1, 1.2.2.2, 1.2.2.3, etc.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1156
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1157 In VCSes with monotonic revision IDs, trunk revisions are IDed as
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1158 1, 2, 3, etc. A branch from (say) revision 2 might start with 2.1 and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1159 continue through 2.2, 2.3, etc. But naming conventions for branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1160 and subbranches vary widely on these systems, and some (like
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1161 Mercurial) never depart from the monotonic integer sequence at all.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1162 Consult the documentation of the VCS you are using.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1163
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1164 @cindex head revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1165 If you omit the final component of a dot-pair revision ID, that is called a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1166 @dfn{branch ID}. It refers to the highest existing revision on that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1167 branch---the @dfn{head revision} of that branch. The branches in the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1168 dot-pair example above have branch IDs 1.2.1 and 1.2.2.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1169
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1170 @menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1171 * Switching Branches:: How to get to another existing branch.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1172 * Creating Branches:: How to start a new branch.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1173 * Merging:: Transferring changes between branches.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1174 * Multi-User Branching:: Multiple users working at multiple branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1175 in parallel.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1176 @end menu
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1177
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1178 @node Switching Branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1179 @subsubsection Switching between Branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1180
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1181 To switch between branches, type @kbd{C-u C-x v v} and specify the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1182 revision ID you want to select. On a locking-based system, this
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1183 version is then visited @emph{unlocked} (write-protected), so you can
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1184 examine it before locking it. Switching branches in this way is allowed
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1185 only when the file is not locked.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1186
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1187 On a VCS with dot-pair IDs, you can omit the minor part, thus giving
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1188 only the branch ID; this takes you to the head version on the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1189 chosen branch. If you only type @key{RET}, Emacs goes to the highest
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1190 version on the trunk.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1191
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1192 After you have switched to any branch (including the main branch), you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1193 stay on it for subsequent VC commands, until you explicitly select some
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1194 other branch.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1195
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1196 @node Creating Branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1197 @subsubsection Creating New Branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1198
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1199 To create a new branch from a head revision (one that is the latest in
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1200 the branch that contains it), first select that revision if necessary,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1201 lock it with @kbd{C-x v v}, and make whatever changes you want. Then,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1202 when you check in the changes, use @kbd{C-u C-x v v}. This lets you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1203 specify the revision ID for the new revision. You should specify a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1204 suitable branch ID for a branch starting at the current revision.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1205 For example, if the current revision is 2.5, the branch ID should be
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1206 2.5.1, 2.5.2, and so on, depending on the number of existing branches at
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1207 that point.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1208
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1209 To create a new branch at an older revision (one that is no longer the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1210 head of a branch), first select that revision (@pxref{Switching
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1211 Branches}). Your procedure will then differ depending on whether you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1212 are using a locking or merging-based VCS.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1213
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1214 On a locking VCS, you will need to lock the old revision branch with
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1215 @kbd{C-x v v}. You'll be asked to confirm, when you lock the old
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1216 revision, that you really mean to create a new branch---if you say no,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1217 you'll be offered a chance to lock the latest revision instead. On
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1218 a merging-based VCS you will skip this step.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1219
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1220 Then make your changes and type @kbd{C-x v v} again to check in a new
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1221 revision. This automatically creates a new branch starting from the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1222 selected revision. You need not specially request a new branch, because
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1223 that's the only way to add a new revision at a point that is not the head
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1224 of a branch.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1225
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1226 After the branch is created, you ``stay'' on it. That means that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1227 subsequent check-ins create new revisions on that branch. To leave the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1228 branch, you must explicitly select a different revision with @kbd{C-u C-x
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1229 v v}. To transfer changes from one branch to another, use the merge
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1230 command, described in the next section.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1231
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1232 @node Merging
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1233 @subsubsection Merging Branches
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1234
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1235 @cindex merging changes
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1236 When you have finished the changes on a certain branch, you will
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1237 often want to incorporate them into the file's main line of development
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1238 (the trunk). This is not a trivial operation, because development might
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1239 also have proceeded on the trunk, so that you must @dfn{merge} the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1240 changes into a file that has already been changed otherwise. VC allows
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1241 you to do this (and other things) with the @code{vc-merge} command.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1242
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1243 @table @kbd
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1244 @item C-x v m (vc-merge)
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1245 Merge changes into the work file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1246 @end table
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1247
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1248 @kindex C-x v m
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1249 @findex vc-merge
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1250 @kbd{C-x v m} (@code{vc-merge}) takes a set of changes and merges it
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1251 into the current version of the work file. It firsts asks you in the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1252 minibuffer where the changes should come from. If you just type
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1253 @key{RET}, Emacs merges any changes that were made on the same branch
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1254 since you checked the file out (we call this @dfn{merging the news}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1255 This is the common way to pick up recent changes from the repository,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1256 regardless of whether you have already changed the file yourself.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1257
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1258 You can also enter a branch ID or a pair of revision IDs in
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1259 the minibuffer. Then @kbd{C-x v m} finds the changes from that
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1260 branch, or the differences between the two revisions you specified, and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1261 merges them into the current revision of the current file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1262
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1263 As an example, suppose that you have finished a certain feature on
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1264 branch 1.3.1. In the meantime, development on the trunk has proceeded
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1265 to revision 1.5. To merge the changes from the branch to the trunk,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1266 first go to the head revision of the trunk, by typing @kbd{C-u C-x v v
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1267 @key{RET}}. Revision 1.5 is now current. If locking is used for the file,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1268 type @kbd{C-x v v} to lock revision 1.5 so that you can change it. Next,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1269 type @kbd{C-x v m 1.3.1 @key{RET}}. This takes the entire set of changes on
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1270 branch 1.3.1 (relative to revision 1.3, where the branch started, up to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1271 the last revision on the branch) and merges it into the current revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1272 of the work file. You can now check in the changed file, thus creating
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1273 revision 1.6 containing the changes from the branch.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1274
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1275 It is possible to do further editing after merging the branch, before
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1276 the next check-in. But it is usually wiser to check in the merged
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1277 revision, then lock it and make the further changes. This will keep
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1278 a better record of the history of changes.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1279
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1280 @cindex conflicts
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1281 @cindex resolving conflicts
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1282 When you merge changes into a file that has itself been modified, the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1283 changes might overlap. We call this situation a @dfn{conflict}, and
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1284 reconciling the conflicting changes is called @dfn{resolving a
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1285 conflict}.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1286
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1287 Whenever conflicts occur during merging, VC detects them, tells you
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1288 about them in the echo area, and asks whether you want help in merging.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1289 If you say yes, it starts an Ediff session (@pxref{Top,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1290 Ediff, Ediff, ediff, The Ediff Manual}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1292 If you say no, the conflicting changes are both inserted into the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1293 file, surrounded by @dfn{conflict markers}. The example below shows how
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1294 a conflict region looks; the file is called @samp{name} and the current
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1295 master file revision with user B's changes in it is 1.11.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1296
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1297 @c @w here is so CVS won't think this is a conflict.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1298 @smallexample
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1299 @group
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1300 @w{<}<<<<<< name
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1301 @var{User A's version}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1302 =======
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1303 @var{User B's version}
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1304 @w{>}>>>>>> 1.11
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1305 @end group
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1306 @end smallexample
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1307
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1308 @cindex vc-resolve-conflicts
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1309 Then you can resolve the conflicts by editing the file manually. Or
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1310 you can type @code{M-x vc-resolve-conflicts} after visiting the file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1311 This starts an Ediff session, as described above. Don't forget to
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1312 check in the merged version afterwards.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1313
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1314 @node Multi-User Branching
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1315 @subsubsection Multi-User Branching
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1316
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1317 It is often useful for multiple developers to work simultaneously on
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1318 different branches of a file. CVS and later systems allow this by
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1319 default; for RCS, it is possible if you create multiple source
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1320 directories. Each source directory should have a link named
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1321 @file{RCS} which points to a common directory of RCS master files.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1322 Then each source directory can have its own choice of selected
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1323 revisions, but all share the same common RCS records.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1324
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1325 This technique works reliably and automatically, provided that the
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1326 source files contain RCS version headers
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1327 @iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1328 (@pxref{Version Headers,,,emacs-xtra, Specialized Emacs Features}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1329 @end iftex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1330 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1331 (@pxref{Version Headers}).
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1332 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1333 The headers enable Emacs to be sure, at all times, which revision
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1334 ID is present in the work file.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1335
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1336 If the files do not have version headers, you must instead tell Emacs
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1337 explicitly in each session which branch you are working on. To do this,
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1338 first find the file, then type @kbd{C-u C-x v v} and specify the correct
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1339 branch ID. This ensures that Emacs knows which branch it is using
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1340 during this particular editing session.
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1341
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1342 @ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1343 @include vc1-xtra.texi
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1344 @end ifnottex
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1345
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1346 @node Change Log
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1347 @section Change Logs
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1348
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1349 @cindex change log
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1350 A change log file contains a chronological record of when and why you
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1351 have changed a program, consisting of a sequence of entries describing
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1352 individual changes. Normally it is kept in a file called
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1353 @file{ChangeLog} in the same directory as the file you are editing, or
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1354 one of its parent directories. A single @file{ChangeLog} file can
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1355 record changes for all the files in its directory and all its
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1356 subdirectories.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1357
99299
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1358 @menu
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1359 * Change Log Commands:: Commands for editing change log files.
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1360 * Format of ChangeLog:: What the change log file looks like.
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1361 @end menu
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1362
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1363 @node Change Log Commands
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1364 @subsection Change Log Commands
8460775a4023 (Types of Log File): Change logs are older than version control.
Richard M. Stallman <rms@gnu.org>
parents: 99291
diff changeset
1365
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1366 @kindex C-x 4 a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1367 @findex add-change-log-entry-other-window
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1368 The Emacs command @kbd{C-x 4 a} adds a new entry to the change log
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1369 file for the file you are editing
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1370 (@code{add-change-log-entry-other-window}). If that file is actually
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1371 a backup file, it makes an entry appropriate for the file's
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1372 parent---that is useful for making log entries for functions that
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1373 have been deleted in the current version.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1374
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1375 @kbd{C-x 4 a} visits the change log file and creates a new entry
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1376 unless the most recent entry is for today's date and your name. It
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1377 also creates a new item for the current file. For many languages, it
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1378 can even guess the name of the function or other object that was
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1379 changed.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1380
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1381 @vindex add-log-keep-changes-together
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1382 When the variable @code{add-log-keep-changes-together} is
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1383 non-@code{nil}, @kbd{C-x 4 a} adds to any existing item for the file
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1384 rather than starting a new item.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1385
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1386 @vindex add-log-always-start-new-record
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1387 If @code{add-log-always-start-new-record} is non-@code{nil},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1388 @kbd{C-x 4 a} always makes a new entry, even if the last entry
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1389 was made by you and on the same date.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1390
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1391 @vindex change-log-version-info-enabled
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1392 @vindex change-log-version-number-regexp-list
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1393 @cindex file version in change log entries
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1394 If the value of the variable @code{change-log-version-info-enabled}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1395 is non-@code{nil}, @kbd{C-x 4 a} adds the file's version number to the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1396 change log entry. It finds the version number by searching the first
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1397 ten percent of the file, using regular expressions from the variable
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1398 @code{change-log-version-number-regexp-list}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1399
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1400 @cindex Change Log mode
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1401 @findex change-log-mode
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1402 The change log file is visited in Change Log mode. In this major
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1403 mode, each bunch of grouped items counts as one paragraph, and each
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1404 entry is considered a page. This facilitates editing the entries.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1405 @kbd{C-j} and auto-fill indent each new line like the previous line;
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1406 this is convenient for entering the contents of an entry.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1407
97440
4844a1945892 (Change Log): Mention next-error is available.
Teodor Zlatanov <tzz@lifelogs.com>
parents: 94293
diff changeset
1408 You can use the @code{next-error} command (by default bound to
4844a1945892 (Change Log): Mention next-error is available.
Teodor Zlatanov <tzz@lifelogs.com>
parents: 94293
diff changeset
1409 @kbd{C-x `}) to move between entries in the Change Log, when Change
4844a1945892 (Change Log): Mention next-error is available.
Teodor Zlatanov <tzz@lifelogs.com>
parents: 94293
diff changeset
1410 Log mode is on. You will jump to the actual site in the file that was
4844a1945892 (Change Log): Mention next-error is available.
Teodor Zlatanov <tzz@lifelogs.com>
parents: 94293
diff changeset
1411 changed, not just to the next Change Log entry. You can also use
4844a1945892 (Change Log): Mention next-error is available.
Teodor Zlatanov <tzz@lifelogs.com>
parents: 94293
diff changeset
1412 @code{previous-error} to move back in the same list.
4844a1945892 (Change Log): Mention next-error is available.
Teodor Zlatanov <tzz@lifelogs.com>
parents: 94293
diff changeset
1413
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1414 @findex change-log-merge
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1415 You can use the command @kbd{M-x change-log-merge} to merge other
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1416 log files into a buffer in Change Log Mode, preserving the date
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1417 ordering of entries.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1418
99281
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1419 Version control systems are another way to keep track of changes in
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1420 your program and keep a change log. In the VC log buffer, typing
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1421 @kbd{C-c C-a} (@code{log-edit-insert-changelog}) inserts the relevant
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1422 Change Log entry, if one exists (@pxref{Log Buffer}). You can also
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1423 insert a VC log entry into a Change Log buffer by typing @kbd{C-x v a}
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1424 (@code{vc-update-change-log}) in the Change Log buffer
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1425 @iftex
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1426 (@pxref{Change Logs and VC,,,emacs-xtra, Specialized Emacs Features}).
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1427 @end iftex
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1428 @ifnottex
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1429 (@pxref{Change Logs and VC}).
7b138a462a57 (Change Log): Document log-edit-insert-changelog and
Chong Yidong <cyd@stupidchicken.com>
parents: 97440
diff changeset
1430 @end ifnottex
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1431
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1432 @node Format of ChangeLog
99291
a3986c03d1ed (Change Log): Document log-edit-insert-changelog and vc-update-change-log.
Chong Yidong <cyd@stupidchicken.com>
parents: 99281
diff changeset
1433 @subsection Format of ChangeLog
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1434
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1435 A change log entry starts with a header line that contains the current
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1436 date, your name, and your email address (taken from the variable
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1437 @code{add-log-mailing-address}). Aside from these header lines, every
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1438 line in the change log starts with a space or a tab. The bulk of the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1439 entry consists of @dfn{items}, each of which starts with a line starting
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1440 with whitespace and a star. Here are two entries, both dated in May
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1441 1993, with two items and one item respectively.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1442
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1443 @iftex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1444 @medbreak
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1445 @end iftex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1446 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1447 1993-05-25 Richard Stallman <rms@@gnu.org>
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1448
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1449 * man.el: Rename symbols `man-*' to `Man-*'.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1450 (manual-entry): Make prompt string clearer.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1451
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1452 * simple.el (blink-matching-paren-distance):
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1453 Change default to 12,000.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1454
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1455 1993-05-24 Richard Stallman <rms@@gnu.org>
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1456
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1457 * vc.el (minor-mode-map-alist): Don't use it if it's void.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1458 (vc-cancel-version): Doc fix.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1459 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1460
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1461 One entry can describe several changes; each change should have its
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1462 own item, or its own line in an item. Normally there should be a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1463 blank line between items. When items are related (parts of the same
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1464 change, in different places), group them by leaving no blank line
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1465 between them.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1466
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1467 You should put a copyright notice and permission notice at the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1468 end of the change log file. Here is an example:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1469
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1470 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1471 Copyright 1997, 1998 Free Software Foundation, Inc.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1472 Copying and distribution of this file, with or without modification, are
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1473 permitted provided the copyright notice and this notice are preserved.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1474 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1475
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1476 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1477 Of course, you should substitute the proper years and copyright holder.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1478
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1479 @node Tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1480 @section Tags Tables
91507
5f89bbfccdc3 Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 88056
diff changeset
1481 @cindex tags and tag tables
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1482
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1483 A @dfn{tags table} is a description of how a multi-file program is
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1484 broken up into files. It lists the names of the component files and the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1485 names and positions of the functions (or other named subunits) in each
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1486 file. Grouping the related files makes it possible to search or replace
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1487 through all the files with one command. Recording the function names
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1488 and positions makes possible the @kbd{M-.} command which finds the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1489 definition of a function by looking up which of the files it is in.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1490
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1491 Tags tables are stored in files called @dfn{tags table files}. The
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1492 conventional name for a tags table file is @file{TAGS}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1493
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1494 Each entry in the tags table records the name of one tag, the name of the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1495 file that the tag is defined in (implicitly), and the position in that
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1496 file of the tag's definition. When a file parsed by @code{etags} is
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1497 generated from a different source file, like a C file generated from a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1498 Cweb source file, the tags of the parsed file reference the source
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1499 file.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1500
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1501 Just what names from the described files are recorded in the tags table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1502 depends on the programming language of the described file. They
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1503 normally include all file names, functions and subroutines, and may
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1504 also include global variables, data types, and anything else
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1505 convenient. Each name recorded is called a @dfn{tag}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1506
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1507 @cindex C++ class browser, tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1508 @cindex tags, C++
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1509 @cindex class browser, C++
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1510 @cindex Ebrowse
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1511 See also the Ebrowse facility, which is tailored for C++.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1512 @xref{Top,, Ebrowse, ebrowse, Ebrowse User's Manual}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1513
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1514 @menu
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1515 * Tag Syntax:: Tag syntax for various types of code and text files.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1516 * Create Tags Table:: Creating a tags table with @code{etags}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1517 * Etags Regexps:: Create arbitrary tags using regular expressions.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1518 * Select Tags Table:: How to visit a tags table.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1519 * Find Tag:: Commands to find the definition of a specific tag.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1520 * Tags Search:: Using a tags table for searching and replacing.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1521 * List Tags:: Listing and finding tags defined in a file.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1522 @end menu
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1523
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1524 @node Tag Syntax
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1525 @subsection Source File Tag Syntax
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1526
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1527 Here is how tag syntax is defined for the most popular languages:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1528
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1529 @itemize @bullet
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1530 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1531 In C code, any C function or typedef is a tag, and so are definitions of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1532 @code{struct}, @code{union} and @code{enum}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1533 @code{#define} macro definitions, @code{#undef} and @code{enum}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1534 constants are also
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1535 tags, unless you specify @samp{--no-defines} when making the tags table.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1536 Similarly, global variables are tags, unless you specify
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1537 @samp{--no-globals}, and so are struct members, unless you specify
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1538 @samp{--no-members}. Use of @samp{--no-globals}, @samp{--no-defines}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1539 and @samp{--no-members} can make the tags table file much smaller.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1540
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1541 You can tag function declarations and external variables in addition
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1542 to function definitions by giving the @samp{--declarations} option to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1543 @code{etags}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1544
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1545 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1546 In C++ code, in addition to all the tag constructs of C code, member
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1547 functions are also recognized; member variables are also recognized,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1548 unless you use the @samp{--no-members} option. Tags for variables and
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1549 functions in classes are named @samp{@var{class}::@var{variable}} and
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1550 @samp{@var{class}::@var{function}}. @code{operator} definitions have
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1551 tag names like @samp{operator+}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1552
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1553 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1554 In Java code, tags include all the constructs recognized in C++, plus
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1555 the @code{interface}, @code{extends} and @code{implements} constructs.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1556 Tags for variables and functions in classes are named
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1557 @samp{@var{class}.@var{variable}} and @samp{@var{class}.@var{function}}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1558
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1559 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1560 In La@TeX{} text, the argument of any of the commands @code{\chapter},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1561 @code{\section}, @code{\subsection}, @code{\subsubsection},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1562 @code{\eqno}, @code{\label}, @code{\ref}, @code{\cite},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1563 @code{\bibitem}, @code{\part}, @code{\appendix}, @code{\entry},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1564 @code{\index}, @code{\def}, @code{\newcommand}, @code{\renewcommand},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1565 @code{\newenvironment} or @code{\renewenvironment} is a tag.@refill
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1566
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1567 Other commands can make tags as well, if you specify them in the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1568 environment variable @env{TEXTAGS} before invoking @code{etags}. The
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1569 value of this environment variable should be a colon-separated list of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1570 command names. For example,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1571
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1572 @example
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1573 TEXTAGS="mycommand:myothercommand"
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1574 export TEXTAGS
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1575 @end example
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1576
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1577 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1578 specifies (using Bourne shell syntax) that the commands
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1579 @samp{\mycommand} and @samp{\myothercommand} also define tags.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1580
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1581 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1582 In Lisp code, any function defined with @code{defun}, any variable
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1583 defined with @code{defvar} or @code{defconst}, and in general the first
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1584 argument of any expression that starts with @samp{(def} in column zero is
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1585 a tag.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1586
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1587 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1588 In Scheme code, tags include anything defined with @code{def} or with a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1589 construct whose name starts with @samp{def}. They also include variables
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1590 set with @code{set!} at top level in the file.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1591 @end itemize
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1592
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1593 Several other languages are also supported:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1594
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1595 @itemize @bullet
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1596
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1597 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1598 In Ada code, functions, procedures, packages, tasks and types are
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1599 tags. Use the @samp{--packages-only} option to create tags for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1600 packages only.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1601
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1602 In Ada, the same name can be used for different kinds of entity
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1603 (e.g.@:, for a procedure and for a function). Also, for things like
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1604 packages, procedures and functions, there is the spec (i.e.@: the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1605 interface) and the body (i.e.@: the implementation). To make it
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1606 easier to pick the definition you want, Ada tag name have suffixes
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1607 indicating the type of entity:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1608
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1609 @table @samp
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1610 @item /b
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1611 package body.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1612 @item /f
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1613 function.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1614 @item /k
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1615 task.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1616 @item /p
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1617 procedure.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1618 @item /s
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1619 package spec.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1620 @item /t
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1621 type.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1622 @end table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1623
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1624 Thus, @kbd{M-x find-tag @key{RET} bidule/b @key{RET}} will go
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1625 directly to the body of the package @code{bidule}, while @kbd{M-x
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1626 find-tag @key{RET} bidule @key{RET}} will just search for any tag
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1627 @code{bidule}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1628
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1629 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1630 In assembler code, labels appearing at the beginning of a line,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1631 followed by a colon, are tags.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1632
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1633 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1634 In Bison or Yacc input files, each rule defines as a tag the nonterminal
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1635 it constructs. The portions of the file that contain C code are parsed
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1636 as C code.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1637
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1638 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1639 In Cobol code, tags are paragraph names; that is, any word starting in
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1640 column 8 and followed by a period.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1641
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1642 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1643 In Erlang code, the tags are the functions, records and macros defined
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1644 in the file.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1645
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1646 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1647 In Fortran code, functions, subroutines and block data are tags.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1648
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1649 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1650 In HTML input files, the tags are the @code{title} and the @code{h1},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1651 @code{h2}, @code{h3} headers. Also, tags are @code{name=} in anchors
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1652 and all occurrences of @code{id=}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1653
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1654 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1655 In Lua input files, all functions are tags.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1656
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1657 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1658 In makefiles, targets are tags; additionally, variables are tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1659 unless you specify @samp{--no-globals}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1660
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1661 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1662 In Objective C code, tags include Objective C definitions for classes,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1663 class categories, methods and protocols. Tags for variables and
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1664 functions in classes are named @samp{@var{class}::@var{variable}} and
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1665 @samp{@var{class}::@var{function}}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1666
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1667 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1668 In Pascal code, the tags are the functions and procedures defined in
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1669 the file.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1670
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1671 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1672 In Perl code, the tags are the packages, subroutines and variables
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1673 defined by the @code{package}, @code{sub}, @code{my} and @code{local}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1674 keywords. Use @samp{--globals} if you want to tag global variables.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1675 Tags for subroutines are named @samp{@var{package}::@var{sub}}. The
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1676 name for subroutines defined in the default package is
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1677 @samp{main::@var{sub}}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1678
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1679 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1680 In PHP code, tags are functions, classes and defines. Vars are tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1681 too, unless you use the @samp{--no-members} option.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1682
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1683 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1684 In PostScript code, the tags are the functions.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1685
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1686 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1687 In Prolog code, tags are predicates and rules at the beginning of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1688 line.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1689
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1690 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1691 In Python code, @code{def} or @code{class} at the beginning of a line
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1692 generate a tag.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1693 @end itemize
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1694
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1695 You can also generate tags based on regexp matching (@pxref{Etags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1696 Regexps}) to handle other formats and languages.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1697
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1698 @node Create Tags Table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1699 @subsection Creating Tags Tables
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1700 @cindex @code{etags} program
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1701
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1702 The @code{etags} program is used to create a tags table file. It knows
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1703 the syntax of several languages, as described in
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1704 @iftex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1705 the previous section.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1706 @end iftex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1707 @ifnottex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1708 @ref{Tag Syntax}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1709 @end ifnottex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1710 Here is how to run @code{etags}:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1711
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1712 @example
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1713 etags @var{inputfiles}@dots{}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1714 @end example
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1715
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1716 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1717 The @code{etags} program reads the specified files, and writes a tags
86091
f4b63f572df1 Note that you can use "-" with --output=file in Etags.
Francesco Potortì <pot@gnu.org>
parents: 84252
diff changeset
1718 table named @file{TAGS} in the current working directory. You can
f4b63f572df1 Note that you can use "-" with --output=file in Etags.
Francesco Potortì <pot@gnu.org>
parents: 84252
diff changeset
1719 optionally specify a different file name for the tags table by using the
f4b63f572df1 Note that you can use "-" with --output=file in Etags.
Francesco Potortì <pot@gnu.org>
parents: 84252
diff changeset
1720 @samp{--output=@var{file}} option; specifying @file{-} as a file name
f4b63f572df1 Note that you can use "-" with --output=file in Etags.
Francesco Potortì <pot@gnu.org>
parents: 84252
diff changeset
1721 prints the tags table to standard output.
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1722
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1723 If the specified files don't exist, @code{etags} looks for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1724 compressed versions of them and uncompresses them to read them. Under
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1725 MS-DOS, @code{etags} also looks for file names like @file{mycode.cgz}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1726 if it is given @samp{mycode.c} on the command line and @file{mycode.c}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1727 does not exist.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1728
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1729 @code{etags} recognizes the language used in an input file based on
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1730 its file name and contents. You can specify the language with the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1731 @samp{--language=@var{name}} option, described below.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1732
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1733 If the tags table data become outdated due to changes in the files
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1734 described in the table, the way to update the tags table is the same
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1735 way it was made in the first place. If the tags table fails to record
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1736 a tag, or records it for the wrong file, then Emacs cannot possibly
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1737 find its definition until you update the tags table. However, if the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1738 position recorded in the tags table becomes a little bit wrong (due to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1739 other editing), the worst consequence is a slight delay in finding the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1740 tag. Even if the stored position is very far wrong, Emacs will still
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1741 find the tag, after searching most of the file for it. That delay is
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1742 hardly noticeable with today's computers.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1743
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1744 Thus, there is no need to update the tags table after each edit.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1745 You should update a tags table when you define new tags that you want
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1746 to have listed, or when you move tag definitions from one file to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1747 another, or when changes become substantial.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1748
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1749 One tags table can virtually include another. Specify the included
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1750 tags file name with the @samp{--include=@var{file}} option when
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1751 creating the file that is to include it. The latter file then acts as
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1752 if it covered all the source files specified in the included file, as
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1753 well as the files it directly contains.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1754
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1755 If you specify the source files with relative file names when you run
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1756 @code{etags}, the tags file will contain file names relative to the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1757 directory where the tags file was initially written. This way, you can
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1758 move an entire directory tree containing both the tags file and the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1759 source files, and the tags file will still refer correctly to the source
86091
f4b63f572df1 Note that you can use "-" with --output=file in Etags.
Francesco Potortì <pot@gnu.org>
parents: 84252
diff changeset
1760 files. If the tags file is @file{-} or is in the @file{/dev} directory,
f4b63f572df1 Note that you can use "-" with --output=file in Etags.
Francesco Potortì <pot@gnu.org>
parents: 84252
diff changeset
1761 however, the file names are
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1762 made relative to the current working directory. This is useful, for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1763 example, when writing the tags to @file{/dev/stdout}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1764
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1765 When using a relative file name, it should not be a symbolic link
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1766 pointing to a tags file in a different directory, because this would
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1767 generally render the file names invalid.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1768
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1769 If you specify absolute file names as arguments to @code{etags}, then
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1770 the tags file will contain absolute file names. This way, the tags file
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1771 will still refer to the same files even if you move it, as long as the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1772 source files remain in the same place. Absolute file names start with
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1773 @samp{/}, or with @samp{@var{device}:/} on MS-DOS and MS-Windows.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1774
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1775 When you want to make a tags table from a great number of files, you
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1776 may have problems listing them on the command line, because some systems
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1777 have a limit on its length. The simplest way to circumvent this limit
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1778 is to tell @code{etags} to read the file names from its standard input,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1779 by typing a dash in place of the file names, like this:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1780
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1781 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1782 find . -name "*.[chCH]" -print | etags -
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1783 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1784
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1785 Use the option @samp{--language=@var{name}} to specify the language
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1786 explicitly. You can intermix these options with file names; each one
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1787 applies to the file names that follow it. Specify
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1788 @samp{--language=auto} to tell @code{etags} to resume guessing the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1789 language from the file names and file contents. Specify
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1790 @samp{--language=none} to turn off language-specific processing
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1791 entirely; then @code{etags} recognizes tags by regexp matching alone
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1792 (@pxref{Etags Regexps}).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1793
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1794 The option @samp{--parse-stdin=@var{file}} is mostly useful when
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1795 calling @code{etags} from programs. It can be used (only once) in
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1796 place of a file name on the command line. @code{Etags} will read from
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1797 standard input and mark the produced tags as belonging to the file
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1798 @var{file}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1799
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1800 @samp{etags --help} outputs the list of the languages @code{etags}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1801 knows, and the file name rules for guessing the language. It also prints
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1802 a list of all the available @code{etags} options, together with a short
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1803 explanation. If followed by one or more @samp{--language=@var{lang}}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1804 options, it outputs detailed information about how tags are generated for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1805 @var{lang}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1806
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1807 @node Etags Regexps
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1808 @subsection Etags Regexps
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1809
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1810 The @samp{--regex} option provides a general way of recognizing tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1811 based on regexp matching. You can freely intermix this option with
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1812 file names, and each one applies to the source files that follow it.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1813 If you specify multiple @samp{--regex} options, all of them are used
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1814 in parallel. The syntax is:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1815
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1816 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1817 --regex=[@var{@{language@}}]/@var{tagregexp}/[@var{nameregexp}/]@var{modifiers}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1818 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1819
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1820 The essential part of the option value is @var{tagregexp}, the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1821 regexp for matching tags. It is always used anchored, that is, it
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1822 only matches at the beginning of a line. If you want to allow
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1823 indented tags, use a regexp that matches initial whitespace; start it
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1824 with @samp{[ \t]*}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1825
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1826 In these regular expressions, @samp{\} quotes the next character, and
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1827 all the GCC character escape sequences are supported (@samp{\a} for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1828 bell, @samp{\b} for back space, @samp{\d} for delete, @samp{\e} for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1829 escape, @samp{\f} for formfeed, @samp{\n} for newline, @samp{\r} for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1830 carriage return, @samp{\t} for tab, and @samp{\v} for vertical tab).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1831
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1832 Ideally, @var{tagregexp} should not match more characters than are
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1833 needed to recognize what you want to tag. If the syntax requires you
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1834 to write @var{tagregexp} so it matches more characters beyond the tag
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1835 itself, you should add a @var{nameregexp}, to pick out just the tag.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1836 This will enable Emacs to find tags more accurately and to do
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1837 completion on tag names more reliably. You can find some examples
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1838 below.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1839
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1840 The @var{modifiers} are a sequence of zero or more characters that
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1841 modify the way @code{etags} does the matching. A regexp with no
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1842 modifiers is applied sequentially to each line of the input file, in a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1843 case-sensitive way. The modifiers and their meanings are:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1844
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1845 @table @samp
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1846 @item i
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1847 Ignore case when matching this regexp.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1848 @item m
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1849 Match this regular expression against the whole file, so that
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1850 multi-line matches are possible.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1851 @item s
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1852 Match this regular expression against the whole file, and allow
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1853 @samp{.} in @var{tagregexp} to match newlines.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1854 @end table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1855
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1856 The @samp{-R} option cancels all the regexps defined by preceding
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1857 @samp{--regex} options. It too applies to the file names following
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1858 it. Here's an example:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1859
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1860 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1861 etags --regex=/@var{reg1}/i voo.doo --regex=/@var{reg2}/m \
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1862 bar.ber -R --lang=lisp los.er
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1863 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1864
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1865 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1866 Here @code{etags} chooses the parsing language for @file{voo.doo} and
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1867 @file{bar.ber} according to their contents. @code{etags} also uses
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1868 @var{reg1} to recognize additional tags in @file{voo.doo}, and both
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1869 @var{reg1} and @var{reg2} to recognize additional tags in
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1870 @file{bar.ber}. @var{reg1} is checked against each line of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1871 @file{voo.doo} and @file{bar.ber}, in a case-insensitive way, while
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1872 @var{reg2} is checked against the whole @file{bar.ber} file,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1873 permitting multi-line matches, in a case-sensitive way. @code{etags}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1874 uses only the Lisp tags rules, with no user-specified regexp matching,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1875 to recognize tags in @file{los.er}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1876
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1877 You can restrict a @samp{--regex} option to match only files of a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1878 given language by using the optional prefix @var{@{language@}}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1879 (@samp{etags --help} prints the list of languages recognized by
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1880 @code{etags}.) This is particularly useful when storing many
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1881 predefined regular expressions for @code{etags} in a file. The
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1882 following example tags the @code{DEFVAR} macros in the Emacs source
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1883 files, for the C language only:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1884
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1885 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1886 --regex='@{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/'
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1887 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1888
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1889 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1890 When you have complex regular expressions, you can store the list of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1891 them in a file. The following option syntax instructs @code{etags} to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1892 read two files of regular expressions. The regular expressions
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1893 contained in the second file are matched without regard to case.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1894
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1895 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1896 --regex=@@@var{case-sensitive-file} --ignore-case-regex=@@@var{ignore-case-file}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1897 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1898
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1899 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1900 A regex file for @code{etags} contains one regular expression per
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1901 line. Empty lines, and lines beginning with space or tab are ignored.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1902 When the first character in a line is @samp{@@}, @code{etags} assumes
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1903 that the rest of the line is the name of another file of regular
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1904 expressions; thus, one such file can include another file. All the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1905 other lines are taken to be regular expressions. If the first
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1906 non-whitespace text on the line is @samp{--}, that line is a comment.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1907
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1908 For example, we can create a file called @samp{emacs.tags} with the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1909 following contents:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1910
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1911 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1912 -- This is for GNU Emacs C source files
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1913 @{c@}/[ \t]*DEFVAR_[A-Z_ \t(]+"\([^"]+\)"/\1/
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1914 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1915
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1916 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1917 and then use it like this:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1918
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1919 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1920 etags --regex=@@emacs.tags *.[ch] */*.[ch]
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1921 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1922
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1923 Here are some more examples. The regexps are quoted to protect them
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1924 from shell interpretation.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1925
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1926 @itemize @bullet
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1927
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1928 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1929 Tag Octave files:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1930
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1931 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1932 etags --language=none \
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1933 --regex='/[ \t]*function.*=[ \t]*\([^ \t]*\)[ \t]*(/\1/' \
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1934 --regex='/###key \(.*\)/\1/' \
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1935 --regex='/[ \t]*global[ \t].*/' \
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1936 *.m
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1937 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1938
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1939 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1940 Note that tags are not generated for scripts, so that you have to add
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1941 a line by yourself of the form @samp{###key @var{scriptname}} if you
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1942 want to jump to it.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1943
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1944 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1945 Tag Tcl files:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1946
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1947 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1948 etags --language=none --regex='/proc[ \t]+\([^ \t]+\)/\1/' *.tcl
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1949 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1950
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1951 @item
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1952 Tag VHDL files:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1953
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1954 @smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1955 etags --language=none \
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1956 --regex='/[ \t]*\(ARCHITECTURE\|CONFIGURATION\) +[^ ]* +OF/' \
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1957 --regex='/[ \t]*\(ATTRIBUTE\|ENTITY\|FUNCTION\|PACKAGE\
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1958 \( BODY\)?\|PROCEDURE\|PROCESS\|TYPE\)[ \t]+\([^ \t(]+\)/\3/'
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1959 @end smallexample
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1960 @end itemize
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1961
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1962 @node Select Tags Table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1963 @subsection Selecting a Tags Table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1964
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1965 @vindex tags-file-name
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1966 @findex visit-tags-table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1967 Emacs has at any time one @dfn{selected} tags table, and all the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1968 commands for working with tags tables use the selected one. To select
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1969 a tags table, type @kbd{M-x visit-tags-table}, which reads the tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1970 table file name as an argument, with @file{TAGS} in the default
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1971 directory as the default.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1972
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1973 Emacs does not actually read in the tags table contents until you
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1974 try to use them; all @code{visit-tags-table} does is store the file
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1975 name in the variable @code{tags-file-name}, and setting the variable
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1976 yourself is just as good. The variable's initial value is @code{nil};
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1977 that value tells all the commands for working with tags tables that
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1978 they must ask for a tags table file name to use.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1979
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1980 Using @code{visit-tags-table} when a tags table is already loaded
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1981 gives you a choice: you can add the new tags table to the current list
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1982 of tags tables, or start a new list. The tags commands use all the tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1983 tables in the current list. If you start a new list, the new tags table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1984 is used @emph{instead} of others. If you add the new table to the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1985 current list, it is used @emph{as well as} the others.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1986
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1987 @vindex tags-table-list
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1988 You can specify a precise list of tags tables by setting the variable
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1989 @code{tags-table-list} to a list of strings, like this:
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1990
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1991 @c keep this on two lines for formatting in smallbook
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1992 @example
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1993 @group
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1994 (setq tags-table-list
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1995 '("~/emacs" "/usr/local/lib/emacs/src"))
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1996 @end group
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1997 @end example
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1998
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
1999 @noindent
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2000 This tells the tags commands to look at the @file{TAGS} files in your
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2001 @file{~/emacs} directory and in the @file{/usr/local/lib/emacs/src}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2002 directory. The order depends on which file you are in and which tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2003 table mentions that file, as explained above.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2004
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2005 Do not set both @code{tags-file-name} and @code{tags-table-list}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2006
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2007 @node Find Tag
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2008 @subsection Finding a Tag
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2009
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2010 The most important thing that a tags table enables you to do is to find
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2011 the definition of a specific tag.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2012
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2013 @table @kbd
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2014 @item M-.@: @var{tag} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2015 Find first definition of @var{tag} (@code{find-tag}).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2016 @item C-u M-.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2017 Find next alternate definition of last tag specified.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2018 @item C-u - M-.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2019 Go back to previous tag found.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2020 @item C-M-. @var{pattern} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2021 Find a tag whose name matches @var{pattern} (@code{find-tag-regexp}).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2022 @item C-u C-M-.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2023 Find the next tag whose name matches the last pattern used.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2024 @item C-x 4 .@: @var{tag} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2025 Find first definition of @var{tag}, but display it in another window
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2026 (@code{find-tag-other-window}).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2027 @item C-x 5 .@: @var{tag} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2028 Find first definition of @var{tag}, and create a new frame to select the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2029 buffer (@code{find-tag-other-frame}).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2030 @item M-*
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2031 Pop back to where you previously invoked @kbd{M-.} and friends.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2032 @end table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2033
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2034 @kindex M-.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2035 @findex find-tag
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2036 @kbd{M-.}@: (@code{find-tag}) is the command to find the definition of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2037 a specified tag. It searches through the tags table for that tag, as a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2038 string, and then uses the tags table info to determine the file that the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2039 definition is in and the approximate character position in the file of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2040 the definition. Then @code{find-tag} visits that file, moves point to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2041 the approximate character position, and searches ever-increasing
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2042 distances away to find the tag definition.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2043
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2044 If an empty argument is given (just type @key{RET}), the balanced
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2045 expression in the buffer before or around point is used as the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2046 @var{tag} argument. @xref{Expressions}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2047
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2048 You don't need to give @kbd{M-.} the full name of the tag; a part
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2049 will do. This is because @kbd{M-.} finds tags in the table which
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2050 contain @var{tag} as a substring. However, it prefers an exact match
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2051 to a substring match. To find other tags that match the same
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2052 substring, give @code{find-tag} a numeric argument, as in @kbd{C-u
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2053 M-.}; this does not read a tag name, but continues searching the tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2054 table's text for another tag containing the same substring last used.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2055 If you have a real @key{META} key, @kbd{M-0 M-.}@: is an easier
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2056 alternative to @kbd{C-u M-.}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2057
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2058 @kindex C-x 4 .
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2059 @findex find-tag-other-window
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2060 @kindex C-x 5 .
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2061 @findex find-tag-other-frame
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2062 Like most commands that can switch buffers, @code{find-tag} has a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2063 variant that displays the new buffer in another window, and one that
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2064 makes a new frame for it. The former is @w{@kbd{C-x 4 .}}, which invokes
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2065 the command @code{find-tag-other-window}. The latter is @w{@kbd{C-x 5 .}},
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2066 which invokes @code{find-tag-other-frame}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2067
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2068 To move back to places you've found tags recently, use @kbd{C-u -
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2069 M-.}; more generally, @kbd{M-.} with a negative numeric argument. This
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2070 command can take you to another buffer. @w{@kbd{C-x 4 .}} with a negative
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2071 argument finds the previous tag location in another window.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2072
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2073 @kindex M-*
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2074 @findex pop-tag-mark
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2075 @vindex find-tag-marker-ring-length
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2076 As well as going back to places you've found tags recently, you can go
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2077 back to places @emph{from where} you found them. Use @kbd{M-*}, which
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2078 invokes the command @code{pop-tag-mark}, for this. Typically you would
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2079 find and study the definition of something with @kbd{M-.} and then
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2080 return to where you were with @kbd{M-*}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2081
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2082 Both @kbd{C-u - M-.} and @kbd{M-*} allow you to retrace your steps to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2083 a depth determined by the variable @code{find-tag-marker-ring-length}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2084
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2085 @findex find-tag-regexp
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2086 @kindex C-M-.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2087 The command @kbd{C-M-.} (@code{find-tag-regexp}) visits the tags that
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2088 match a specified regular expression. It is just like @kbd{M-.} except
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2089 that it does regexp matching instead of substring matching.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2090
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2091 @node Tags Search
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2092 @subsection Searching and Replacing with Tags Tables
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2093 @cindex search and replace in multiple files
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2094 @cindex multiple-file search and replace
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2095
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2096 The commands in this section visit and search all the files listed
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2097 in the selected tags table, one by one. For these commands, the tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2098 table serves only to specify a sequence of files to search. These
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2099 commands scan the list of tags tables starting with the first tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2100 table (if any) that describes the current file, proceed from there to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2101 the end of the list, and then scan from the beginning of the list
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2102 until they have covered all the tables in the list.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2103
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2104 @table @kbd
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2105 @item M-x tags-search @key{RET} @var{regexp} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2106 Search for @var{regexp} through the files in the selected tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2107 table.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2108 @item M-x tags-query-replace @key{RET} @var{regexp} @key{RET} @var{replacement} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2109 Perform a @code{query-replace-regexp} on each file in the selected tags table.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2110 @item M-,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2111 Restart one of the commands above, from the current location of point
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2112 (@code{tags-loop-continue}).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2113 @end table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2114
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2115 @findex tags-search
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2116 @kbd{M-x tags-search} reads a regexp using the minibuffer, then
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2117 searches for matches in all the files in the selected tags table, one
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2118 file at a time. It displays the name of the file being searched so you
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2119 can follow its progress. As soon as it finds an occurrence,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2120 @code{tags-search} returns.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2121
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2122 @kindex M-,
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2123 @findex tags-loop-continue
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2124 Having found one match, you probably want to find all the rest. To find
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2125 one more match, type @kbd{M-,} (@code{tags-loop-continue}) to resume the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2126 @code{tags-search}. This searches the rest of the current buffer, followed
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2127 by the remaining files of the tags table.@refill
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2128
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2129 @findex tags-query-replace
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2130 @kbd{M-x tags-query-replace} performs a single
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2131 @code{query-replace-regexp} through all the files in the tags table. It
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2132 reads a regexp to search for and a string to replace with, just like
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2133 ordinary @kbd{M-x query-replace-regexp}. It searches much like @kbd{M-x
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2134 tags-search}, but repeatedly, processing matches according to your
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2135 input. @xref{Replace}, for more information on query replace.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2136
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2137 @vindex tags-case-fold-search
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2138 @cindex case-sensitivity and tags search
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2139 You can control the case-sensitivity of tags search commands by
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2140 customizing the value of the variable @code{tags-case-fold-search}. The
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2141 default is to use the same setting as the value of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2142 @code{case-fold-search} (@pxref{Search Case}).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2143
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2144 It is possible to get through all the files in the tags table with a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2145 single invocation of @kbd{M-x tags-query-replace}. But often it is
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2146 useful to exit temporarily, which you can do with any input event that
88056
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87903
diff changeset
2147 has no special query replace meaning. You can resume the query
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87903
diff changeset
2148 replace subsequently by typing @kbd{M-,}; this command resumes the
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87903
diff changeset
2149 last tags search or replace command that you did. For instance, to
7dc2524306eb Merge from emacs--rel--22
Miles Bader <miles@gnu.org>
parents: 87903
diff changeset
2150 skip the rest of the current file, you can type @kbd{M-> M-,}.
84252
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2151
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2152 The commands in this section carry out much broader searches than the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2153 @code{find-tag} family. The @code{find-tag} commands search only for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2154 definitions of tags that match your substring or regexp. The commands
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2155 @code{tags-search} and @code{tags-query-replace} find every occurrence
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2156 of the regexp, as ordinary search commands and replace commands do in
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2157 the current buffer.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2158
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2159 These commands create buffers only temporarily for the files that they
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2160 have to search (those which are not already visited in Emacs buffers).
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2161 Buffers in which no match is found are quickly killed; the others
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2162 continue to exist.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2163
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2164 It may have struck you that @code{tags-search} is a lot like
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2165 @code{grep}. You can also run @code{grep} itself as an inferior of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2166 Emacs and have Emacs show you the matching lines one by one.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2167 @xref{Grep Searching}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2168
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2169 @node List Tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2170 @subsection Tags Table Inquiries
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2171
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2172 @table @kbd
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2173 @item M-x list-tags @key{RET} @var{file} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2174 Display a list of the tags defined in the program file @var{file}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2175 @item M-x tags-apropos @key{RET} @var{regexp} @key{RET}
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2176 Display a list of all tags matching @var{regexp}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2177 @end table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2178
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2179 @findex list-tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2180 @kbd{M-x list-tags} reads the name of one of the files described by
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2181 the selected tags table, and displays a list of all the tags defined in
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2182 that file. The ``file name'' argument is really just a string to
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2183 compare against the file names recorded in the tags table; it is read as
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2184 a string rather than as a file name. Therefore, completion and
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2185 defaulting are not available, and you must enter the file name the same
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2186 way it appears in the tags table. Do not include a directory as part of
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2187 the file name unless the file name recorded in the tags table includes a
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2188 directory.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2189
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2190 @findex tags-apropos
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2191 @vindex tags-apropos-verbose
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2192 @kbd{M-x tags-apropos} is like @code{apropos} for tags
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2193 (@pxref{Apropos}). It finds all the tags in the selected tags table
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2194 whose entries match @var{regexp}, and displays them. If the variable
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2195 @code{tags-apropos-verbose} is non-@code{nil}, it displays the names
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2196 of the tags files together with the tag names.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2197
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2198 @vindex tags-tag-face
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2199 @vindex tags-apropos-additional-actions
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2200 You can customize the appearance of the output by setting the
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2201 variable @code{tags-tag-face} to a face. You can display additional
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2202 output with @kbd{M-x tags-apropos} by customizing the variable
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2203 @code{tags-apropos-additional-actions}---see its documentation for
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2204 details.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2205
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2206 You can also use the collection of tag names to complete a symbol
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2207 name in the buffer. @xref{Symbol Completion}.
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2208
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2209 @ifnottex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2210 @include emerge-xtra.texi
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2211 @end ifnottex
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2212
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2213 @ignore
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2214 arch-tag: b9d83dfb-82ea-4ff6-bab5-05a3617091fb
fe346181c6f6 Move here from ../../man
Glenn Morris <rgm@gnu.org>
parents:
diff changeset
2215 @end ignore