annotate man/emacs-xtra.texi @ 70308:7d6d4101f890

*** empty log message ***
author YAMAMOTO Mitsuharu <mituharu@math.s.chiba-u.ac.jp>
date Mon, 01 May 2006 01:14:30 +0000
parents ab05f8713897
children 67cae6fd5e56
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
1 \input texinfo @c -*-texinfo-*-
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
2 @comment %**start of header
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3 @setfilename ../info/emacs-xtra
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
4 @settitle Specialized Emacs Features
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
5 @syncodeindex fn cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
6 @syncodeindex vr cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
7 @syncodeindex ky cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
8 @comment %**end of header
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
9
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
10 @copying
56160
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
11 This manual describes specialized features of Emacs.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
12
69681
11b616eddda4 @copyright{}, no indentation in @copying{}
Karl Berry <karl@gnu.org>
parents: 69530
diff changeset
13 Copyright @copyright{} 2004, 2005, 2006 Free Software Foundation, Inc.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
14
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
15 @quotation
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
16 Permission is granted to copy, distribute and/or modify this document
65555
69b3598a61c5 Update all manuals to specify GFDL version 1.2.
Romain Francoise <romain@orebokech.com>
parents: 64890
diff changeset
17 under the terms of the GNU Free Documentation License, Version 1.2 or
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
18 any later version published by the Free Software Foundation; with no
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
19 Invariant Sections, with the Front-Cover texts being ``A GNU
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
20 Manual'', and with the Back-Cover Texts as in (a) below. A copy of the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
21 license is included in the section entitled ``GNU Free Documentation
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
22 License'' in the Emacs manual.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
23
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
24 (a) The FSF's Back-Cover Text is: ``You have freedom to copy and modify
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
25 this GNU Manual, like GNU software. Copies published by the Free
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
26 Software Foundation raise funds for GNU development.''
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
27
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
28 This document is part of a collection distributed under the GNU Free
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
29 Documentation License. If you want to distribute this document
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
30 separately from the collection, you can do so by adding a copy of the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
31 license to the document, as described in section 6 of the license.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
32 @end quotation
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
33 @end copying
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
34
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
35 @dircategory Emacs
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
36 @direntry
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
37 * Emacs-Xtra: (emacs-xtra). Specialized Emacs features.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
38 @end direntry
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
39
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
40 @titlepage
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
41 @title Specialized Emacs Features
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
42 @page
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
43 @vskip 0pt plus 1filll
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
44 @insertcopying
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
45 @end titlepage
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
46
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
47 @contents
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
48
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
49 @ifnottex
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
50 @node Top
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
51 @top Specialized Emacs Features
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
52
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
53 @insertcopying
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
54
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
55 @end ifnottex
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
56
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
57 @menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
58 * Introduction:: What documentation belongs here?
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
59 * Autorevert:: Auto Reverting non-file buffers.
69945
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
60 * Subdir Switches:: Subdirectory switches in Dired.
61000
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
61 * Advanced Calendar/Diary Usage:: Advanced Calendar/Diary customization.
69530
408a60784b2e (Top): Avoid ugly continuation line in menu in the standalone Info reader.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69506
diff changeset
62 * Emerge:: A convenient way of merging two versions
408a60784b2e (Top): Avoid ugly continuation line in menu in the standalone Info reader.
Luc Teirlinck <teirllm@auburn.edu>
parents: 69506
diff changeset
63 of a program.
69506
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
64 * Picture Mode:: Editing pictures made up of characters
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
65 using the quarter-plane screen model.
69945
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
66
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
67 * Advanced VC Usage:: Advanced VC (version control) features.
69506
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
68 * Fortran:: Fortran mode and its special features.
69898
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
69 * MS-DOG::
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
70 * Index::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
71 @end menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
72
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
73 @node Introduction
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
74 @unnumbered Introduction
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
75
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
76 This manual contains detailed information about various features that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
77 are too specialized to be included in the Emacs manual. It is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
78 intended to be readable by anyone having a basic knowledge of Emacs.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
79 However, certain sections may be intended for a more specialized
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
80 audience, such as Elisp authors. This should be clearly pointed out
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
81 at the beginning of these sections.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
82
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
83 This manual is intended as a complement, rather than an alternative,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
84 to other ways to gain a more detailed knowledge of Emacs than the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
85 Emacs manual can provide, such as browsing packages using @kbd{C-h p},
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
86 accessing mode documentation using @kbd{C-h m} and browsing user
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
87 options using Custom. Also, certain packages, or collections of
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
88 related features, have their own manuals. The present manual is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
89 mainly intended to be a collection of smaller specialized features,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
90 too small to get their own manual.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
91
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
92 Sections intended specifically for Elisp programmers can follow the
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
93 style of the Elisp manual. Other sections should follow the style of
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
94 the Emacs manual.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
95
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
96 @node Autorevert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
97 @chapter Auto Reverting non-file Buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
98
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
99 Normally Global Auto Revert Mode only reverts file buffers. There are
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
100 two ways to auto-revert certain non-file buffers: enabling Auto Revert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
101 Mode in those buffers (using @kbd{M-x auto-revert-mode}) and setting
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
102 @code{global-auto-revert-non-file-buffers} to @code{t}. The latter
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
103 enables Auto Reverting for all types of buffers for which it is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
104 implemented, that is, for the types of buffers listed in the menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
105 below.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
106
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
107 Like file buffers, non-file buffers should normally not revert while
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
108 you are working on them, or while they contain information that might
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
109 get lost after reverting. Therefore, they do not revert if they are
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
110 ``modified''. This can get tricky, because deciding when a non-file
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
111 buffer should be marked modified is usually more difficult than for
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
112 file buffers.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
113
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
114 Another tricky detail is that, for efficiency reasons, Auto Revert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
115 often does not try to detect all possible changes in the buffer, only
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
116 changes that are ``major'' or easy to detect. Hence, enabling
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
117 auto-reverting for a non-file buffer does not always guarantee that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
118 all information in the buffer is up to date and does not necessarily
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
119 make manual reverts useless.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
120
56128
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
121 At the other extreme, certain buffers automatically auto-revert every
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
122 @code{auto-revert-interval} seconds. (This currently only applies to
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
123 the Buffer Menu.) In this case, Auto Revert does not print any
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
124 messages while reverting, even when @code{auto-revert-verbose} is
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
125 non-@code{nil}.
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
126
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
127 The details depend on the particular types of buffers and are
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
128 explained in the corresponding sections.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
129
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
130 @menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
131 * Auto Reverting the Buffer Menu::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
132 * Auto Reverting Dired::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
133 * Supporting additional buffers::
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
134 @end menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
135
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
136 @node Auto Reverting the Buffer Menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
137 @section Auto Reverting the Buffer Menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
138
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
139 If auto-reverting of non-file buffers is enabled, the Buffer Menu
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
140 automatically reverts every @code{auto-revert-interval} seconds,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
141 whether there is a need for it or not. (It would probably take longer
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
142 to check whether there is a need than to actually revert.)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
143
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
144 If the Buffer Menu inappropriately gets marked modified, just revert
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
145 it manually using @kbd{g} and auto-reverting will resume. However, if
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
146 you marked certain buffers to get deleted or to be displayed, you have
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
147 to be careful, because reverting erases all marks. The fact that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
148 adding marks sets the buffer's modified flag prevents Auto Revert from
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
149 automatically erasing the marks.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
150
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
151 @node Auto Reverting Dired
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
152 @section Auto Reverting Dired buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
153
56149
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
154 Auto-reverting Dired buffers currently works on GNU or Unix style
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
155 operating systems. It may not work satisfactorily on some other
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
156 systems.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
157
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
158 Dired buffers only auto-revert when the file list of the buffer's main
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
159 directory changes. They do not auto-revert when information about a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
160 particular file changes or when inserted subdirectories change. To be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
161 sure that @emph{all} listed information is up to date, you have to
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
162 manually revert using @kbd{g}, @emph{even} if auto-reverting is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
163 enabled in the Dired buffer. Sometimes, you might get the impression
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
164 that modifying or saving files listed in the main directory actually
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
165 does cause auto-reverting. This is because making changes to a file,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
166 or saving it, very often causes changes in the directory itself, for
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
167 instance, through backup files or auto-save files. However, this is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
168 not guaranteed.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
169
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
170 If the Dired buffer is marked modified and there are no changes you
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
171 want to protect, then most of the time you can make auto-reverting
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
172 resume by manually reverting the buffer using @kbd{g}. There is one
56149
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
173 exception. If you flag or mark files, you can safely revert the
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
174 buffer. This will not erase the flags or marks (unless the marked
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
175 file has been deleted, of course). However, the buffer will stay
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
176 modified, even after reverting, and auto-reverting will not resume.
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
177 This is because, if you flag or mark files, you may be working on the
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
178 buffer and you might not want the buffer to change without warning.
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
179 If you want auto-reverting to resume in the presence of marks and
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
180 flags, mark the buffer non-modified using @kbd{M-~}. However, adding,
0e86f3e9a45d (Auto Reverting Dired): Minor changes.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56131
diff changeset
181 deleting or changing marks or flags will mark it modified again.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
182
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
183 Remote Dired buffers are not auto-reverted. Neither are Dired buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
184 for which you used shell wildcards or file arguments to list only some
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
185 of the files. @samp{*Find*} and @samp{*Locate*} buffers do not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
186 auto-revert either.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
187
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
188 @node Supporting additional buffers
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
189 @section Adding Support for Auto-Reverting additional Buffers.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
190
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
191 This section is intended for Elisp programmers who would like to add
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
192 support for auto-reverting new types of buffers.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
193
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
194 To support auto-reverting the buffer must first of all have a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
195 @code{revert-buffer-function}. @xref{Definition of
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
196 revert-buffer-function,, Reverting, elisp, the Emacs Lisp Reference Manual}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
197
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
198 In addition, it @emph{must} have a @code{buffer-stale-function}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
199
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
200 @defvar buffer-stale-function
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
201 The value of this variable is a function to check whether a non-file
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
202 buffer needs reverting. This should be a function with one optional
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
203 argument @var{noconfirm}. The function should return non-@code{nil}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
204 if the buffer should be reverted. The buffer is current when this
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
205 function is called.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
206
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
207 While this function is mainly intended for use in auto-reverting, it
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
208 could be used for other purposes as well. For instance, if
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
209 auto-reverting is not enabled, it could be used to warn the user that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
210 the buffer needs reverting. The idea behind the @var{noconfirm}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
211 argument is that it should be @code{t} if the buffer is going to be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
212 reverted without asking the user and @code{nil} if the function is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
213 just going to be used to warn the user that the buffer is out of date.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
214 In particular, for use in auto-reverting, @var{noconfirm} is @code{t}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
215 If the function is only going to be used for auto-reverting, you can
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
216 ignore the @var{noconfirm} argument.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
217
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
218 If you just want to automatically auto-revert every
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
219 @code{auto-revert-interval} seconds, use:
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
220
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
221 @example
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
222 (set (make-local-variable 'buffer-stale-function)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
223 #'(lambda (&optional noconfirm) 'fast))
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
224 @end example
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
225
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
226 @noindent
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
227 in the buffer's mode function.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
228
56128
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
229 The special return value @samp{fast} tells the caller that the need
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
230 for reverting was not checked, but that reverting the buffer is fast.
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
231 It also tells Auto Revert not to print any revert messages, even if
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
232 @code{auto-revert-verbose} is non-@code{nil}. This is important, as
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
233 getting revert messages every @code{auto-revert-interval} seconds can
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
234 be very annoying. The information provided by this return value could
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
235 also be useful if the function is consulted for purposes other than
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
236 auto-reverting.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
237 @end defvar
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
238
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
239 Once the buffer has a @code{revert-buffer-function} and a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
240 @code{buffer-stale-function}, several problems usually remain.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
241
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
242 The buffer will only auto-revert if it is marked unmodified. Hence,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
243 you will have to make sure that various functions mark the buffer
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
244 modified if and only if either the buffer contains information that
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
245 might be lost by reverting or there is reason to believe that the user
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
246 might be inconvenienced by auto-reverting, because he is actively
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
247 working on the buffer. The user can always override this by manually
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
248 adjusting the modified status of the buffer. To support this, calling
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
249 the @code{revert-buffer-function} on a buffer that is marked
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
250 unmodified should always keep the buffer marked unmodified.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
251
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
252 It is important to assure that point does not continuously jump around
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
253 as a consequence of auto-reverting. Of course, moving point might be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
254 inevitable if the buffer radically changes.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
255
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
256 You should make sure that the @code{revert-buffer-function} does not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
257 print messages that unnecessarily duplicate Auto Revert's own messages
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
258 if @code{auto-revert-verbose} is @code{t} and effectively override a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
259 @code{nil} value for @code{auto-revert-verbose}. Hence, adapting a
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
260 mode for auto-reverting often involves getting rid of such messages.
56128
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
261 This is especially important for buffers that automatically
cf2e292bf084 (Autorevert, Supporting additional buffers): Explain special treatment
Luc Teirlinck <teirllm@auburn.edu>
parents: 56119
diff changeset
262 auto-revert every @code{auto-revert-interval} seconds.
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
263
56160
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
264 Also, you may want to update the documentation string of
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
265 @code{global-auto-revert-non-file-buffers}.
6ad083598109 (Supporting additional buffers): Minor change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56149
diff changeset
266
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
267 @ifinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
268 Finally, you should add a node to this chapter's menu. This node
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
269 @end ifinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
270 @ifnotinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
271 Finally, you should add a section to this chapter. This section
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
272 @end ifnotinfo
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
273 should at the very least make clear whether enabling auto-reverting
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
274 for the buffer reliably assures that all information in the buffer is
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
275 completely up to date (or will be after @code{auto-revert-interval}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
276 seconds).
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
277
69945
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
278 @node Subdir Switches
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
279 @chapter Subdirectory Switches in Dired
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
280
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
281 You can insert subdirectories with specified @code{ls} switches in
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
282 Dired buffers, using @kbd{C-u i}. You can change the @code{ls}
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
283 switches of an already inserted subdirectory using @kbd{C-u l}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
284
59996
aac0a33f5772 Change release version from 21.4 to 22.1 throughout.
Kim F. Storm <storm@cua.dk>
parents: 56473
diff changeset
285 In Emacs versions 22.1 and later, Dired remembers the switches, so
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
286 that reverting the buffer will not change them back to the main
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
287 directory's switches. Deleting a subdirectory forgets about its
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
288 switches.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
289
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
290 Using @code{dired-undo} (usually bound to @kbd{C-_} and @kbd{C-x u})
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
291 to reinsert or delete subdirectories, that were inserted with explicit
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
292 switches, can bypass Dired's machinery for remembering (or forgetting)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
293 switches. Deleting a subdirectory using @code{dired-undo} does not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
294 forget its switches. When later reinserted using @kbd{i}, it will be
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
295 reinserted using its old switches. Using @code{dired-undo} to
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
296 reinsert a subdirectory that was deleted using the regular
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
297 Dired commands (not @code{dired-undo}) will originally insert it with
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
298 its old switches. However, reverting the buffer will relist it using
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
299 the buffer's default switches. If any of this yields problems, you
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
300 can easily correct the situation using @kbd{C-u i} or @kbd{C-u l}.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
301
56471
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
302 Dired does not remember the @code{R} switch. Inserting a subdirectory
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
303 with switches that include the @code{R} switch is equivalent with
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
304 inserting each of its subdirectories using all remaining switches.
56473
d9fdff5fee26 (Subdir switches): Minor fix to previous change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56471
diff changeset
305 For instance, updating or killing a subdirectory that was inserted
d9fdff5fee26 (Subdir switches): Minor fix to previous change.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56471
diff changeset
306 with the @code{R} switch will not update or kill its subdirectories.
56471
ca944d885fe6 (Subdir switches): Dired does not remember the `R' switch.
Luc Teirlinck <teirllm@auburn.edu>
parents: 56160
diff changeset
307
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
308 The buffer's default switches do not affect subdirectories that were
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
309 inserted using explicitly specified switches. In particular,
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
310 commands such as @kbd{s}, that change the buffer's switches do not
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
311 affect such subdirectories. (They do affect subdirectories without
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
312 explicitly assigned switches, however.)
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
313
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
314 You can make Dired forget about all subdirectory switches and relist
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
315 all subdirectories with the buffer's default switches using
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
316 @kbd{M-x dired-reset-subdir-switches}. This also reverts the Dired buffer.
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
317
61000
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
318
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
319 @c Moved here from the Emacs Lisp Reference Manual, 2005-03-26.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
320 @node Advanced Calendar/Diary Usage
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
321 @chapter Customizing the Calendar and Diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
322
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
323 There are many customizations that you can use to make the calendar and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
324 diary suit your personal tastes.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
325
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
326 @menu
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
327 * Calendar Customizing:: Defaults you can set.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
328 * Holiday Customizing:: Defining your own holidays.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
329 * Date Display Format:: Changing the format.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
330 * Time Display Format:: Changing the format.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
331 * Daylight Savings:: Changing the default.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
332 * Diary Customizing:: Defaults you can set.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
333 * Hebrew/Islamic Entries:: How to obtain them.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
334 * Fancy Diary Display:: Enhancing the diary display, sorting entries,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
335 using included diary files.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
336 * Sexp Diary Entries:: Fancy things you can do.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
337 @end menu
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
338
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
339 @node Calendar Customizing
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
340 @section Customizing the Calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
341 @vindex calendar-holiday-marker
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
342 @vindex diary-entry-marker
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
343 The variable @code{calendar-holiday-marker} specifies how to mark a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
344 date as being a holiday. Its value may be a single-character string
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
345 to insert next to the date, or a face name to use for displaying the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
346 date. Likewise, the variable @code{diary-entry-marker} specifies how
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
347 to mark a date that has diary entries. The calendar creates faces
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
348 named @code{holiday-face} and @code{diary-face} for these purposes;
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
349 those symbols are the default values of these variables.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
350
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
351 @vindex calendar-load-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
352 The variable @code{calendar-load-hook} is a normal hook run when the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
353 calendar package is first loaded (before actually starting to display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
354 the calendar).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
355
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
356 @vindex initial-calendar-window-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
357 Starting the calendar runs the normal hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
358 @code{initial-calendar-window-hook}. Recomputation of the calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
359 display does not run this hook. But if you leave the calendar with the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
360 @kbd{q} command and reenter it, the hook runs again.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
361
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
362 @vindex today-visible-calendar-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
363 The variable @code{today-visible-calendar-hook} is a normal hook run
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
364 after the calendar buffer has been prepared with the calendar when the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
365 current date is visible in the window. One use of this hook is to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
366 replace today's date with asterisks; to do that, use the hook function
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
367 @code{calendar-star-date}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
368
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
369 @findex calendar-star-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
370 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
371 (add-hook 'today-visible-calendar-hook 'calendar-star-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
372 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
373
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
374 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
375 Another standard hook function marks the current date, either by
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
376 changing its face or by adding an asterisk. Here's how to use it:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
377
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
378 @findex calendar-mark-today
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
379 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
380 (add-hook 'today-visible-calendar-hook 'calendar-mark-today)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
381 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
382
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
383 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
384 @vindex calendar-today-marker
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
385 The variable @code{calendar-today-marker} specifies how to mark
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
386 today's date. Its value should be a single-character string to insert
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
387 next to the date or a face name to use for displaying the date. A
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
388 face named @code{calendar-today-face} is provided for this purpose;
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
389 that symbol is the default for this variable.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
390
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
391 @vindex today-invisible-calendar-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
392 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
393 A similar normal hook, @code{today-invisible-calendar-hook} is run if
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
394 the current date is @emph{not} visible in the window.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
395
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
396 @vindex calendar-move-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
397 Each of the calendar cursor motion commands runs the hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
398 @code{calendar-move-hook} after it moves the cursor.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
399
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
400 @node Holiday Customizing
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
401 @section Customizing the Holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
402
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
403 @vindex calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
404 @vindex christian-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
405 @vindex hebrew-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
406 @vindex islamic-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
407 Emacs knows about holidays defined by entries on one of several lists.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
408 You can customize these lists of holidays to your own needs, adding or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
409 deleting holidays. The lists of holidays that Emacs uses are for
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
410 general holidays (@code{general-holidays}), local holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
411 (@code{local-holidays}), Christian holidays (@code{christian-holidays}),
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
412 Hebrew (Jewish) holidays (@code{hebrew-holidays}), Islamic (Muslim)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
413 holidays (@code{islamic-holidays}), and other holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
414 (@code{other-holidays}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
415
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
416 @vindex general-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
417 The general holidays are, by default, holidays common throughout the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
418 United States. To eliminate these holidays, set @code{general-holidays}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
419 to @code{nil}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
420
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
421 @vindex local-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
422 There are no default local holidays (but sites may supply some). You
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
423 can set the variable @code{local-holidays} to any list of holidays, as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
424 described below.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
425
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
426 @vindex all-christian-calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
427 @vindex all-hebrew-calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
428 @vindex all-islamic-calendar-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
429 By default, Emacs does not include all the holidays of the religions
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
430 that it knows, only those commonly found in secular calendars. For a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
431 more extensive collection of religious holidays, you can set any (or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
432 all) of the variables @code{all-christian-calendar-holidays},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
433 @code{all-hebrew-calendar-holidays}, or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
434 @code{all-islamic-calendar-holidays} to @code{t}. If you want to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
435 eliminate the religious holidays, set any or all of the corresponding
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
436 variables @code{christian-holidays}, @code{hebrew-holidays}, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
437 @code{islamic-holidays} to @code{nil}.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
438
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
439 @vindex other-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
440 You can set the variable @code{other-holidays} to any list of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
441 holidays. This list, normally empty, is intended for individual use.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
442
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
443 @cindex holiday forms
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
444 Each of the lists (@code{general-holidays}, @code{local-holidays},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
445 @code{christian-holidays}, @code{hebrew-holidays},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
446 @code{islamic-holidays}, and @code{other-holidays}) is a list of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
447 @dfn{holiday forms}, each holiday form describing a holiday (or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
448 sometimes a list of holidays).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
449
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
450 Here is a table of the possible kinds of holiday form. Day numbers
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
451 and month numbers count starting from 1, but ``dayname'' numbers
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
452 count Sunday as 0. The element @var{string} is always the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
453 name of the holiday, as a string.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
454
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
455 @table @code
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
456 @item (holiday-fixed @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
457 A fixed date on the Gregorian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
458
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
459 @item (holiday-float @var{month} @var{dayname} @var{k} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
460 The @var{k}th @var{dayname} in @var{month} on the Gregorian calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
461 (@var{dayname}=0 for Sunday, and so on); negative @var{k} means count back
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
462 from the end of the month.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
463
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
464 @item (holiday-hebrew @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
465 A fixed date on the Hebrew calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
466
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
467 @item (holiday-islamic @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
468 A fixed date on the Islamic calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
469
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
470 @item (holiday-julian @var{month} @var{day} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
471 A fixed date on the Julian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
472
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
473 @item (holiday-sexp @var{sexp} @var{string})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
474 A date calculated by the Lisp expression @var{sexp}. The expression
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
475 should use the variable @code{year} to compute and return the date of a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
476 holiday, or @code{nil} if the holiday doesn't happen this year. The
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
477 value of @var{sexp} must represent the date as a list of the form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
478 @code{(@var{month} @var{day} @var{year})}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
479
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
480 @item (if @var{condition} @var{holiday-form})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
481 A holiday that happens only if @var{condition} is true.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
482
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
483 @item (@var{function} @r{[}@var{args}@r{]})
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
484 A list of dates calculated by the function @var{function}, called with
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
485 arguments @var{args}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
486 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
487
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
488 For example, suppose you want to add Bastille Day, celebrated in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
489 France on July 14. You can do this as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
490
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
491 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
492 (setq other-holidays '((holiday-fixed 7 14 "Bastille Day")))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
493 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
494
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
495 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
496 The holiday form @code{(holiday-fixed 7 14 "Bastille Day")} specifies the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
497 fourteenth day of the seventh month (July).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
498
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
499 Many holidays occur on a specific day of the week, at a specific time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
500 of month. Here is a holiday form describing Hurricane Supplication Day,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
501 celebrated in the Virgin Islands on the fourth Monday in August:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
502
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
503 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
504 (holiday-float 8 1 4 "Hurricane Supplication Day")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
505 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
506
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
507 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
508 Here the 8 specifies August, the 1 specifies Monday (Sunday is 0,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
509 Tuesday is 2, and so on), and the 4 specifies the fourth occurrence in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
510 the month (1 specifies the first occurrence, 2 the second occurrence,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
511 @minus{}1 the last occurrence, @minus{}2 the second-to-last occurrence, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
512 so on).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
513
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
514 You can specify holidays that occur on fixed days of the Hebrew,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
515 Islamic, and Julian calendars too. For example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
516
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
517 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
518 (setq other-holidays
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
519 '((holiday-hebrew 10 2 "Last day of Hanukkah")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
520 (holiday-islamic 3 12 "Mohammed's Birthday")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
521 (holiday-julian 4 2 "Jefferson's Birthday")))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
522 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
523
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
524 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
525 adds the last day of Hanukkah (since the Hebrew months are numbered with
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
526 1 starting from Nisan), the Islamic feast celebrating Mohammed's
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
527 birthday (since the Islamic months are numbered from 1 starting with
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
528 Muharram), and Thomas Jefferson's birthday, which is 2 April 1743 on the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
529 Julian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
530
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
531 To include a holiday conditionally, use either Emacs Lisp's @code{if} or the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
532 @code{holiday-sexp} form. For example, American presidential elections
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
533 occur on the first Tuesday after the first Monday in November of years
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
534 divisible by 4:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
535
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
536 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
537 (holiday-sexp '(if (= 0 (% year 4))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
538 (calendar-gregorian-from-absolute
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
539 (1+ (calendar-dayname-on-or-before
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
540 1 (+ 6 (calendar-absolute-from-gregorian
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
541 (list 11 1 year)))))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
542 "US Presidential Election")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
543 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
544
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
545 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
546 or
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
547
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
548 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
549 (if (= 0 (% displayed-year 4))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
550 (fixed 11
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
551 (extract-calendar-day
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
552 (calendar-gregorian-from-absolute
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
553 (1+ (calendar-dayname-on-or-before
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
554 1 (+ 6 (calendar-absolute-from-gregorian
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
555 (list 11 1 displayed-year)))))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
556 "US Presidential Election"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
557 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
558
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
559 Some holidays just don't fit into any of these forms because special
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
560 calculations are involved in their determination. In such cases you
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
561 must write a Lisp function to do the calculation. To include eclipses,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
562 for example, add @code{(eclipses)} to @code{other-holidays}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
563 and write an Emacs Lisp function @code{eclipses} that returns a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
564 (possibly empty) list of the relevant Gregorian dates among the range
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
565 visible in the calendar window, with descriptive strings, like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
566
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
567 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
568 (((6 27 1991) "Lunar Eclipse") ((7 11 1991) "Solar Eclipse") ... )
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
569 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
570
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
571 @node Date Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
572 @section Date Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
573 @vindex calendar-date-display-form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
574
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
575 You can customize the manner of displaying dates in the diary, in mode
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
576 lines, and in messages by setting @code{calendar-date-display-form}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
577 This variable holds a list of expressions that can involve the variables
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
578 @code{month}, @code{day}, and @code{year}, which are all numbers in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
579 string form, and @code{monthname} and @code{dayname}, which are both
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
580 alphabetic strings. In the American style, the default value of this
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
581 list is as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
582
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
583 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
584 ((if dayname (concat dayname ", ")) monthname " " day ", " year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
585 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
586
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
587 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
588 while in the European style this value is the default:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
589
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
590 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
591 ((if dayname (concat dayname ", ")) day " " monthname " " year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
592 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
593
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
594 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
595 The ISO standard date representation is this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
596
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
597 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
598 (year "-" month "-" day)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
599 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
600
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
601 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
602 This specifies a typical American format:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
603
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
604 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
605 (month "/" day "/" (substring year -2))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
606 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
607
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
608 @node Time Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
609 @section Time Display Format
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
610 @vindex calendar-time-display-form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
611
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
612 The calendar and diary by default display times of day in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
613 conventional American style with the hours from 1 through 12, minutes,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
614 and either @samp{am} or @samp{pm}. If you prefer the European style,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
615 also known in the US as military, in which the hours go from 00 to 23,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
616 you can alter the variable @code{calendar-time-display-form}. This
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
617 variable is a list of expressions that can involve the variables
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
618 @code{12-hours}, @code{24-hours}, and @code{minutes}, which are all
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
619 numbers in string form, and @code{am-pm} and @code{time-zone}, which are
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
620 both alphabetic strings. The default value of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
621 @code{calendar-time-display-form} is as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
622
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
623 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
624 (12-hours ":" minutes am-pm
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
625 (if time-zone " (") time-zone (if time-zone ")"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
626 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
627
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
628 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
629 Here is a value that provides European style times:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
630
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
631 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
632 (24-hours ":" minutes
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
633 (if time-zone " (") time-zone (if time-zone ")"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
634 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
635
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
636 @node Daylight Savings
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
637 @section Daylight Savings Time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
638 @cindex daylight savings time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
639
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
640 Emacs understands the difference between standard time and daylight
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
641 savings time---the times given for sunrise, sunset, solstices,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
642 equinoxes, and the phases of the moon take that into account. The rules
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
643 for daylight savings time vary from place to place and have also varied
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
644 historically from year to year. To do the job properly, Emacs needs to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
645 know which rules to use.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
646
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
647 Some operating systems keep track of the rules that apply to the place
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
648 where you are; on these systems, Emacs gets the information it needs
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
649 from the system automatically. If some or all of this information is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
650 missing, Emacs fills in the gaps with the rules currently used in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
651 Cambridge, Massachusetts, which is the center of GNU's world.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
652
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
653
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
654 @vindex calendar-daylight-savings-starts
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
655 @vindex calendar-daylight-savings-ends
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
656 If the default choice of rules is not appropriate for your location,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
657 you can tell Emacs the rules to use by setting the variables
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
658 @code{calendar-daylight-savings-starts} and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
659 @code{calendar-daylight-savings-ends}. Their values should be Lisp
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
660 expressions that refer to the variable @code{year}, and evaluate to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
661 Gregorian date on which daylight savings time starts or (respectively)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
662 ends, in the form of a list @code{(@var{month} @var{day} @var{year})}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
663 The values should be @code{nil} if your area does not use daylight
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
664 savings time.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
665
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
666 Emacs uses these expressions to determine the start and end dates of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
667 daylight savings time as holidays and for correcting times of day in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
668 solar and lunar calculations.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
669
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
670 The values for Cambridge, Massachusetts are as follows:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
671
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
672 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
673 @group
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
674 (calendar-nth-named-day 1 0 4 year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
675 (calendar-nth-named-day -1 0 10 year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
676 @end group
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
677 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
678
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
679 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
680 i.e., the first 0th day (Sunday) of the fourth month (April) in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
681 the year specified by @code{year}, and the last Sunday of the tenth month
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
682 (October) of that year. If daylight savings time were
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
683 changed to start on October 1, you would set
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
684 @code{calendar-daylight-savings-starts} to this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
685
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
686 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
687 (list 10 1 year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
688 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
689
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
690 For a more complex example, suppose daylight savings time begins on
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
691 the first of Nisan on the Hebrew calendar. You should set
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
692 @code{calendar-daylight-savings-starts} to this value:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
693
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
694 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
695 (calendar-gregorian-from-absolute
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
696 (calendar-absolute-from-hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
697 (list 1 1 (+ year 3760))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
698 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
699
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
700 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
701 because Nisan is the first month in the Hebrew calendar and the Hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
702 year differs from the Gregorian year by 3760 at Nisan.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
703
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
704 If there is no daylight savings time at your location, or if you want
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
705 all times in standard time, set @code{calendar-daylight-savings-starts}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
706 and @code{calendar-daylight-savings-ends} to @code{nil}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
707
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
708 @vindex calendar-daylight-time-offset
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
709 The variable @code{calendar-daylight-time-offset} specifies the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
710 difference between daylight savings time and standard time, measured in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
711 minutes. The value for Cambridge is 60.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
712
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
713 @vindex calendar-daylight-savings-starts-time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
714 @vindex calendar-daylight-savings-ends-time
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
715 The variable @code{calendar-daylight-savings-starts-time} and the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
716 variable @code{calendar-daylight-savings-ends-time} specify the number
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
717 of minutes after midnight local time when the transition to and from
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
718 daylight savings time should occur. For Cambridge, both variables'
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
719 values are 120.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
720
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
721 @node Diary Customizing
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
722 @section Customizing the Diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
723
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
724 @vindex holidays-in-diary-buffer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
725 Ordinarily, the mode line of the diary buffer window indicates any
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
726 holidays that fall on the date of the diary entries. The process of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
727 checking for holidays can take several seconds, so including holiday
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
728 information delays the display of the diary buffer noticeably. If you'd
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
729 prefer to have a faster display of the diary buffer but without the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
730 holiday information, set the variable @code{holidays-in-diary-buffer} to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
731 @code{nil}.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
732
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
733 @vindex number-of-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
734 The variable @code{number-of-diary-entries} controls the number of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
735 days of diary entries to be displayed at one time. It affects the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
736 initial display when @code{view-diary-entries-initially} is @code{t}, as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
737 well as the command @kbd{M-x diary}. For example, the default value is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
738 1, which says to display only the current day's diary entries. If the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
739 value is 2, both the current day's and the next day's entries are
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
740 displayed. The value can also be a vector of seven elements: for
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
741 example, if the value is @code{[0 2 2 2 2 4 1]} then no diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
742 appear on Sunday, the current date's and the next day's diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
743 appear Monday through Thursday, Friday through Monday's entries appear
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
744 on Friday, while on Saturday only that day's entries appear.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
745
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
746 @vindex print-diary-entries-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
747 @findex print-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
748 The variable @code{print-diary-entries-hook} is a normal hook run
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
749 after preparation of a temporary buffer containing just the diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
750 entries currently visible in the diary buffer. (The other, irrelevant
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
751 diary entries are really absent from the temporary buffer; in the diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
752 buffer, they are merely hidden.) The default value of this hook does
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
753 the printing with the command @code{lpr-buffer}. If you want to use a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
754 different command to do the printing, just change the value of this
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
755 hook. Other uses might include, for example, rearranging the lines into
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
756 order by day and time.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
757
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
758 @vindex diary-date-forms
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
759 You can customize the form of dates in your diary file, if neither the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
760 standard American nor European styles suits your needs, by setting the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
761 variable @code{diary-date-forms}. This variable is a list of patterns
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
762 for recognizing a date. Each date pattern is a list whose elements may
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
763 be regular expressions (@pxref{Regular Expressions,,, elisp, the Emacs
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
764 Lisp Reference Manual}) or the symbols @code{month}, @code{day},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
765 @code{year}, @code{monthname}, and @code{dayname}. All these elements
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
766 serve as patterns that match certain kinds of text in the diary file.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
767 In order for the date pattern, as a whole, to match, all of its elements
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
768 must match consecutively.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
769
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
770 A regular expression in a date pattern matches in its usual fashion,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
771 using the standard syntax table altered so that @samp{*} is a word
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
772 constituent.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
773
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
774 The symbols @code{month}, @code{day}, @code{year}, @code{monthname},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
775 and @code{dayname} match the month number, day number, year number,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
776 month name, and day name of the date being considered. The symbols that
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
777 match numbers allow leading zeros; those that match names allow
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
778 three-letter abbreviations and capitalization. All the symbols can
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
779 match @samp{*}; since @samp{*} in a diary entry means ``any day'', ``any
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
780 month'', and so on, it should match regardless of the date being
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
781 considered.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
782
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
783 The default value of @code{diary-date-forms} in the American style is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
784 this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
785
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
786 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
787 ((month "/" day "[^/0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
788 (month "/" day "/" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
789 (monthname " *" day "[^,0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
790 (monthname " *" day ", *" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
791 (dayname "\\W"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
792 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
793
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
794 The date patterns in the list must be @emph{mutually exclusive} and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
795 must not match any portion of the diary entry itself, just the date and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
796 one character of whitespace. If, to be mutually exclusive, the pattern
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
797 must match a portion of the diary entry text---beyond the whitespace
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
798 that ends the date---then the first element of the date pattern
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
799 @emph{must} be @code{backup}. This causes the date recognizer to back
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
800 up to the beginning of the current word of the diary entry, after
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
801 finishing the match. Even if you use @code{backup}, the date pattern
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
802 must absolutely not match more than a portion of the first word of the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
803 diary entry. The default value of @code{diary-date-forms} in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
804 European style is this list:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
805
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
806 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
807 ((day "/" month "[^/0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
808 (day "/" month "/" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
809 (backup day " *" monthname "\\W+\\<[^*0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
810 (day " *" monthname " *" year "[^0-9]")
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
811 (dayname "\\W"))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
812 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
813
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
814 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
815 Notice the use of @code{backup} in the third pattern, because it needs
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
816 to match part of a word beyond the date itself to distinguish it from
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
817 the fourth pattern.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
818
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
819 @node Hebrew/Islamic Entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
820 @section Hebrew- and Islamic-Date Diary Entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
821
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
822 Your diary file can have entries based on Hebrew or Islamic dates, as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
823 well as entries based on the world-standard Gregorian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
824 However, because recognition of such entries is time-consuming and most
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
825 people don't use them, you must explicitly enable their use. If you
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
826 want the diary to recognize Hebrew-date diary entries, for example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
827 you must do this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
828
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
829 @vindex nongregorian-diary-listing-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
830 @vindex nongregorian-diary-marking-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
831 @findex list-hebrew-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
832 @findex mark-hebrew-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
833 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
834 (add-hook 'nongregorian-diary-listing-hook 'list-hebrew-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
835 (add-hook 'nongregorian-diary-marking-hook 'mark-hebrew-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
836 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
837
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
838 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
839 If you want Islamic-date entries, do this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
840
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
841 @findex list-islamic-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
842 @findex mark-islamic-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
843 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
844 (add-hook 'nongregorian-diary-listing-hook 'list-islamic-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
845 (add-hook 'nongregorian-diary-marking-hook 'mark-islamic-diary-entries)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
846 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
847
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
848 Hebrew- and Islamic-date diary entries have the same formats as
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
849 Gregorian-date diary entries, except that @samp{H} precedes a Hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
850 date and @samp{I} precedes an Islamic date. Moreover, because the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
851 Hebrew and Islamic month names are not uniquely specified by the first
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
852 three letters, you may not abbreviate them. For example, a diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
853 for the Hebrew date Heshvan 25 could look like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
854
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
855 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
856 HHeshvan 25 Happy Hebrew birthday!
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
857 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
858
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
859 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
860 and would appear in the diary for any date that corresponds to Heshvan 25
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
861 on the Hebrew calendar. And here is an Islamic-date diary entry that matches
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
862 Dhu al-Qada 25:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
863
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
864 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
865 IDhu al-Qada 25 Happy Islamic birthday!
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
866 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
867
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
868 As with Gregorian-date diary entries, Hebrew- and Islamic-date entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
869 are nonmarking if they are preceded with an ampersand (@samp{&}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
870
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
871 Here is a table of commands used in the calendar to create diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
872 that match the selected date and other dates that are similar in the Hebrew
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
873 or Islamic calendar:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
874
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
875 @table @kbd
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
876 @item i h d
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
877 Add a diary entry for the Hebrew date corresponding to the selected date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
878 (@code{insert-hebrew-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
879 @item i h m
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
880 Add a diary entry for the day of the Hebrew month corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
881 selected date (@code{insert-monthly-hebrew-diary-entry}). This diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
882 entry matches any date that has the same Hebrew day-within-month as the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
883 selected date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
884 @item i h y
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
885 Add a diary entry for the day of the Hebrew year corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
886 selected date (@code{insert-yearly-hebrew-diary-entry}). This diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
887 entry matches any date which has the same Hebrew month and day-within-month
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
888 as the selected date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
889 @item i i d
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
890 Add a diary entry for the Islamic date corresponding to the selected date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
891 (@code{insert-islamic-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
892 @item i i m
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
893 Add a diary entry for the day of the Islamic month corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
894 selected date (@code{insert-monthly-islamic-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
895 @item i i y
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
896 Add a diary entry for the day of the Islamic year corresponding to the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
897 selected date (@code{insert-yearly-islamic-diary-entry}).
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
898 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
899
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
900 @findex insert-hebrew-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
901 @findex insert-monthly-hebrew-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
902 @findex insert-yearly-hebrew-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
903 @findex insert-islamic-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
904 @findex insert-monthly-islamic-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
905 @findex insert-yearly-islamic-diary-entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
906 These commands work much like the corresponding commands for ordinary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
907 diary entries: they apply to the date that point is on in the calendar
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
908 window, and what they do is insert just the date portion of a diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
909 at the end of your diary file. You must then insert the rest of the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
910 diary entry.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
911
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
912 @node Fancy Diary Display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
913 @section Fancy Diary Display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
914 @vindex diary-display-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
915 @findex simple-diary-display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
916
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
917 Diary display works by preparing the diary buffer and then running the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
918 hook @code{diary-display-hook}. The default value of this hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
919 (@code{simple-diary-display}) hides the irrelevant diary entries and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
920 then displays the buffer. However, if you specify the hook as follows,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
921
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
922 @cindex diary buffer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
923 @findex fancy-diary-display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
924 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
925 (add-hook 'diary-display-hook 'fancy-diary-display)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
926 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
927
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
928 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
929 this enables fancy diary display. It displays diary entries and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
930 holidays by copying them into a special buffer that exists only for the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
931 sake of display. Copying to a separate buffer provides an opportunity
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
932 to change the displayed text to make it prettier---for example, to sort
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
933 the entries by the dates they apply to.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
934
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
935 As with simple diary display, you can print a hard copy of the buffer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
936 with @code{print-diary-entries}. To print a hard copy of a day-by-day
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
937 diary for a week, position point on Sunday of that week, type
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
938 @kbd{7 d}, and then do @kbd{M-x print-diary-entries}. As usual, the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
939 inclusion of the holidays slows down the display slightly; you can speed
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
940 things up by setting the variable @code{holidays-in-diary-buffer} to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
941 @code{nil}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
942
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
943 @vindex diary-list-include-blanks
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
944 Ordinarily, the fancy diary buffer does not show days for which there are
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
945 no diary entries, even if that day is a holiday. If you want such days to be
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
946 shown in the fancy diary buffer, set the variable
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
947 @code{diary-list-include-blanks} to @code{t}.@refill
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
948
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
949 @cindex sorting diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
950 If you use the fancy diary display, you can use the normal hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
951 @code{list-diary-entries-hook} to sort each day's diary entries by their
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
952 time of day. Here's how:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
953
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
954 @findex sort-diary-entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
955 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
956 (add-hook 'list-diary-entries-hook 'sort-diary-entries t)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
957 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
958
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
959 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
960 For each day, this sorts diary entries that begin with a recognizable
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
961 time of day according to their times. Diary entries without times come
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
962 first within each day.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
963
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
964 Fancy diary display also has the ability to process included diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
965 files. This permits a group of people to share a diary file for events
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
966 that apply to all of them. Lines in the diary file of this form:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
967
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
968 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
969 #include "@var{filename}"
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
970 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
971
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
972 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
973 includes the diary entries from the file @var{filename} in the fancy
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
974 diary buffer. The include mechanism is recursive, so that included files
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
975 can include other files, and so on; you must be careful not to have a
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
976 cycle of inclusions, of course. Here is how to enable the include
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
977 facility:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
978
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
979 @vindex list-diary-entries-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
980 @vindex mark-diary-entries-hook
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
981 @findex include-other-diary-files
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
982 @findex mark-included-diary-files
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
983 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
984 (add-hook 'list-diary-entries-hook 'include-other-diary-files)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
985 (add-hook 'mark-diary-entries-hook 'mark-included-diary-files)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
986 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
987
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
988 The include mechanism works only with the fancy diary display, because
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
989 ordinary diary display shows the entries directly from your diary file.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
990
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
991 @node Sexp Diary Entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
992 @section Sexp Entries and the Fancy Diary Display
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
993 @cindex sexp diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
994
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
995 Sexp diary entries allow you to do more than just have complicated
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
996 conditions under which a diary entry applies. If you use the fancy
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
997 diary display, sexp entries can generate the text of the entry depending
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
998 on the date itself. For example, an anniversary diary entry can insert
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
999 the number of years since the anniversary date into the text of the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1000 diary entry. Thus the @samp{%d} in this dairy entry:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1001
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1002 @findex diary-anniversary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1003 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1004 %%(diary-anniversary 10 31 1948) Arthur's birthday (%d years old)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1005 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1006
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1007 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1008 gets replaced by the age, so on October 31, 1990 the entry appears in
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1009 the fancy diary buffer like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1010
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1011 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1012 Arthur's birthday (42 years old)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1013 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1014
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1015 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1016 If the diary file instead contains this entry:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1017
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1018 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1019 %%(diary-anniversary 10 31 1948) Arthur's %d%s birthday
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1020 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1021
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1022 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1023 the entry in the fancy diary buffer for October 31, 1990 appears like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1024
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1025 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1026 Arthur's 42nd birthday
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1027 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1028
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1029 Similarly, cyclic diary entries can interpolate the number of repetitions
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1030 that have occurred:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1031
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1032 @findex diary-cyclic
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1033 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1034 %%(diary-cyclic 50 1 1 1990) Renew medication (%d%s time)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1035 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1036
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1037 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1038 looks like this:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1039
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1040 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1041 Renew medication (5th time)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1042 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1043
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1044 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1045 in the fancy diary display on September 8, 1990.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1046
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1047 There is an early reminder diary sexp that includes its entry in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1048 diary not only on the date of occurrence, but also on earlier dates.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1049 For example, if you want a reminder a week before your anniversary, you
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1050 can use
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1051
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1052 @findex diary-remind
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1053 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1054 %%(diary-remind '(diary-anniversary 12 22 1968) 7) Ed's anniversary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1055 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1056
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1057 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1058 and the fancy diary will show
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1059 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1060 Ed's anniversary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1061 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1062 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1063 both on December 15 and on December 22.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1064
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1065 @findex diary-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1066 The function @code{diary-date} applies to dates described by a month,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1067 day, year combination, each of which can be an integer, a list of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1068 integers, or @code{t}. The value @code{t} means all values. For
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1069 example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1070
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1071 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1072 %%(diary-date '(10 11 12) 22 t) Rake leaves
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1073 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1074
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1075 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1076 causes the fancy diary to show
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1077
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1078 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1079 Rake leaves
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1080 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1081
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1082 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1083 on October 22, November 22, and December 22 of every year.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1084
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1085 @findex diary-float
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1086 The function @code{diary-float} allows you to describe diary entries
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1087 that apply to dates like the third Friday of November, or the last
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1088 Tuesday in April. The parameters are the @var{month}, @var{dayname},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1089 and an index @var{n}. The entry appears on the @var{n}th @var{dayname}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1090 of @var{month}, where @var{dayname}=0 means Sunday, 1 means Monday, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1091 so on. If @var{n} is negative it counts backward from the end of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1092 @var{month}. The value of @var{month} can be a list of months, a single
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1093 month, or @code{t} to specify all months. You can also use an optional
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1094 parameter @var{day} to specify the @var{n}th @var{dayname} of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1095 @var{month} on or after/before @var{day}; the value of @var{day} defaults
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1096 to 1 if @var{n} is positive and to the last day of @var{month} if
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1097 @var{n} is negative. For example,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1098
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1099 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1100 %%(diary-float t 1 -1) Pay rent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1101 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1102
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1103 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1104 causes the fancy diary to show
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1105
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1106 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1107 Pay rent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1108 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1109
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1110 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1111 on the last Monday of every month.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1112
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1113 The generality of sexp diary entries lets you specify any diary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1114 entry that you can describe algorithmically. A sexp diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1115 contains an expression that computes whether the entry applies to any
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1116 given date. If its value is non-@code{nil}, the entry applies to that
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1117 date; otherwise, it does not. The expression can use the variable
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1118 @code{date} to find the date being considered; its value is a list
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1119 (@var{month} @var{day} @var{year}) that refers to the Gregorian
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1120 calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1121
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1122 The sexp diary entry applies to a date when the expression's value
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1123 is non-@code{nil}, but some values have more specific meanings. If
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1124 the value is a string, that string is a description of the event which
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1125 occurs on that date. The value can also have the form
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1126 @code{(@var{mark} . @var{string})}; then @var{mark} specifies how to
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1127 mark the date in the calendar, and @var{string} is the description of
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1128 the event. If @var{mark} is a single-character string, that character
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1129 appears next to the date in the calendar. If @var{mark} is a face
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1130 name, the date is displayed in that face. If @var{mark} is
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1131 @code{nil}, that specifies no particular highlighting for the date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1132
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1133 Suppose you get paid on the 21st of the month if it is a weekday, and
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1134 on the Friday before if the 21st is on a weekend. Here is how to write
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1135 a sexp diary entry that matches those dates:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1136
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1137 @smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1138 &%%(let ((dayname (calendar-day-of-week date))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1139 (day (car (cdr date))))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1140 (or (and (= day 21) (memq dayname '(1 2 3 4 5)))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1141 (and (memq day '(19 20)) (= dayname 5)))
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1142 ) Pay check deposited
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1143 @end smallexample
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1144
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1145 The following sexp diary entries take advantage of the ability (in the fancy
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1146 diary display) to concoct diary entries whose text varies based on the date:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1147
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1148 @findex diary-sunrise-sunset
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1149 @findex diary-phases-of-moon
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1150 @findex diary-day-of-year
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1151 @findex diary-iso-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1152 @findex diary-julian-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1153 @findex diary-astro-day-number
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1154 @findex diary-hebrew-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1155 @findex diary-islamic-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1156 @findex diary-french-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1157 @findex diary-mayan-date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1158 @table @code
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1159 @item %%(diary-sunrise-sunset)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1160 Make a diary entry for the local times of today's sunrise and sunset.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1161 @item %%(diary-phases-of-moon)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1162 Make a diary entry for the phases (quarters) of the moon.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1163 @item %%(diary-day-of-year)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1164 Make a diary entry with today's day number in the current year and the number
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1165 of days remaining in the current year.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1166 @item %%(diary-iso-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1167 Make a diary entry with today's equivalent ISO commercial date.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1168 @item %%(diary-julian-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1169 Make a diary entry with today's equivalent date on the Julian calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1170 @item %%(diary-astro-day-number)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1171 Make a diary entry with today's equivalent astronomical (Julian) day number.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1172 @item %%(diary-hebrew-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1173 Make a diary entry with today's equivalent date on the Hebrew calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1174 @item %%(diary-islamic-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1175 Make a diary entry with today's equivalent date on the Islamic calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1176 @item %%(diary-french-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1177 Make a diary entry with today's equivalent date on the French Revolutionary
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1178 calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1179 @item %%(diary-mayan-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1180 Make a diary entry with today's equivalent date on the Mayan calendar.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1181 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1182
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1183 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1184 Thus including the diary entry
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1185
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1186 @example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1187 &%%(diary-hebrew-date)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1188 @end example
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1189
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1190 @noindent
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1191 causes every day's diary display to contain the equivalent date on the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1192 Hebrew calendar, if you are using the fancy diary display. (With simple
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1193 diary display, the line @samp{&%%(diary-hebrew-date)} appears in the
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1194 diary for any date, but does nothing particularly useful.)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1195
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1196 These functions can be used to construct sexp diary entries based on
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1197 the Hebrew calendar in certain standard ways:
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1198
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1199 @cindex rosh hodesh
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1200 @findex diary-rosh-hodesh
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1201 @cindex parasha, weekly
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1202 @findex diary-parasha
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1203 @cindex candle lighting times
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1204 @findex diary-sabbath-candles
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1205 @cindex omer count
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1206 @findex diary-omer
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1207 @cindex yahrzeits
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1208 @findex diary-yahrzeit
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1209 @table @code
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1210 @item %%(diary-rosh-hodesh)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1211 Make a diary entry that tells the occurrence and ritual announcement of each
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1212 new Hebrew month.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1213 @item %%(diary-parasha)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1214 Make a Saturday diary entry that tells the weekly synagogue scripture reading.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1215 @item %%(diary-sabbath-candles)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1216 Make a Friday diary entry that tells the @emph{local time} of Sabbath
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1217 candle lighting.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1218 @item %%(diary-omer)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1219 Make a diary entry that gives the omer count, when appropriate.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1220 @item %%(diary-yahrzeit @var{month} @var{day} @var{year}) @var{name}
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1221 Make a diary entry marking the anniversary of a date of death. The date
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1222 is the @emph{Gregorian} (civil) date of death. The diary entry appears
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1223 on the proper Hebrew calendar anniversary and on the day before. (In
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1224 the European style, the order of the parameters is changed to @var{day},
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1225 @var{month}, @var{year}.)
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1226 @end table
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1227
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1228 All the functions documented above take an optional argument
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1229 @var{mark} which specifies how to mark the date in the calendar display.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1230 If one of these functions decides that it applies to a certain date,
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1231 it returns a value that contains @var{mark}.
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
1232
69506
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1233 @node Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1234 @chapter Merging Files with Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1235 @cindex Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1236 @cindex merging files
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1237
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1238 It's not unusual for programmers to get their signals crossed and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1239 modify the same program in two different directions. To recover from
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1240 this confusion, you need to merge the two versions. Emerge makes this
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1241 easier. For other ways to compare files, see @ref{Comparing Files,,,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1242 emacs, the Emacs Manual} and @ref{Top, Ediff,, ediff, The Ediff
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1243 Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1244
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1245 @menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1246 * Overview of Emerge:: How to start Emerge. Basic concepts.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1247 * Submodes of Emerge:: Fast mode vs. Edit mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1248 Skip Prefers mode and Auto Advance mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1249 * State of Difference:: You do the merge by specifying state A or B
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1250 for each difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1251 * Merge Commands:: Commands for selecting a difference,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1252 changing states of differences, etc.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1253 * Exiting Emerge:: What to do when you've finished the merge.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1254 * Combining in Emerge:: How to keep both alternatives for a difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1255 * Fine Points of Emerge:: Misc.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1256 @end menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1257
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1258 @node Overview of Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1259 @section Overview of Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1260
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1261 To start Emerge, run one of these four commands:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1262
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1263 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1264 @item M-x emerge-files
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1265 @findex emerge-files
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1266 Merge two specified files.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1267
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1268 @item M-x emerge-files-with-ancestor
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1269 @findex emerge-files-with-ancestor
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1270 Merge two specified files, with reference to a common ancestor.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1271
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1272 @item M-x emerge-buffers
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1273 @findex emerge-buffers
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1274 Merge two buffers.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1275
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1276 @item M-x emerge-buffers-with-ancestor
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1277 @findex emerge-buffers-with-ancestor
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1278 Merge two buffers with reference to a common ancestor in a third
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1279 buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1280 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1281
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1282 @cindex merge buffer (Emerge)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1283 @cindex A and B buffers (Emerge)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1284 The Emerge commands compare two files or buffers, and display the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1285 comparison in three buffers: one for each input text (the @dfn{A buffer}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1286 and the @dfn{B buffer}), and one (the @dfn{merge buffer}) where merging
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1287 takes place. The merge buffer shows the full merged text, not just the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1288 differences. Wherever the two input texts differ, you can choose which
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1289 one of them to include in the merge buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1290
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1291 The Emerge commands that take input from existing buffers use only
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1292 the accessible portions of those buffers, if they are narrowed.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1293 @xref{Narrowing,,, emacs, the Emacs Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1294
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1295
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1296 If a common ancestor version is available, from which the two texts to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1297 be merged were both derived, Emerge can use it to guess which
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1298 alternative is right. Wherever one current version agrees with the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1299 ancestor, Emerge presumes that the other current version is a deliberate
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1300 change which should be kept in the merged version. Use the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1301 @samp{with-ancestor} commands if you want to specify a common ancestor
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1302 text. These commands read three file or buffer names---variant A,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1303 variant B, and the common ancestor.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1304
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1305 After the comparison is done and the buffers are prepared, the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1306 interactive merging starts. You control the merging by typing special
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1307 @dfn{merge commands} in the merge buffer (@pxref{Merge Commands}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1308 For each run of differences between the input texts, you can choose
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1309 which one of them to keep, or edit them both together.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1310
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1311 The merge buffer uses a special major mode, Emerge mode, with commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1312 for making these choices. But you can also edit the buffer with
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1313 ordinary Emacs commands.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1314
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1315 At any given time, the attention of Emerge is focused on one
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1316 particular difference, called the @dfn{selected} difference. This
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1317 difference is marked off in the three buffers like this:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1318
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1319 @example
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1320 vvvvvvvvvvvvvvvvvvvv
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1321 @var{text that differs}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1322 ^^^^^^^^^^^^^^^^^^^^
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1323 @end example
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1324
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1325 @noindent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1326 Emerge numbers all the differences sequentially and the mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1327 line always shows the number of the selected difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1328
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1329 Normally, the merge buffer starts out with the A version of the text.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1330 But when the A version of a difference agrees with the common ancestor,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1331 then the B version is initially preferred for that difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1332
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1333 Emerge leaves the merged text in the merge buffer when you exit. At
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1334 that point, you can save it in a file with @kbd{C-x C-w}. If you give a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1335 numeric argument to @code{emerge-files} or
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1336 @code{emerge-files-with-ancestor}, it reads the name of the output file
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1337 using the minibuffer. (This is the last file name those commands read.)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1338 Then exiting from Emerge saves the merged text in the output file.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1339
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1340 Normally, Emerge commands save the output buffer in its file when you
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1341 exit. If you abort Emerge with @kbd{C-]}, the Emerge command does not
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1342 save the output buffer, but you can save it yourself if you wish.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1343
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1344 @node Submodes of Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1345 @section Submodes of Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1346
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1347 You can choose between two modes for giving merge commands: Fast mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1348 and Edit mode. In Fast mode, basic merge commands are single
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1349 characters, but ordinary Emacs commands are disabled. This is
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1350 convenient if you use only merge commands. In Edit mode, all merge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1351 commands start with the prefix key @kbd{C-c C-c}, and the normal Emacs
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1352 commands are also available. This allows editing the merge buffer, but
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1353 slows down Emerge operations.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1354
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1355 Use @kbd{e} to switch to Edit mode, and @kbd{C-c C-c f} to switch to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1356 Fast mode. The mode line indicates Edit and Fast modes with @samp{E}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1357 and @samp{F}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1358
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1359 Emerge has two additional submodes that affect how particular merge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1360 commands work: Auto Advance mode and Skip Prefers mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1361
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1362 If Auto Advance mode is in effect, the @kbd{a} and @kbd{b} commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1363 advance to the next difference. This lets you go through the merge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1364 faster as long as you simply choose one of the alternatives from the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1365 input. The mode line indicates Auto Advance mode with @samp{A}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1366
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1367 If Skip Prefers mode is in effect, the @kbd{n} and @kbd{p} commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1368 skip over differences in states prefer-A and prefer-B (@pxref{State of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1369 Difference}). Thus you see only differences for which neither version
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1370 is presumed ``correct.'' The mode line indicates Skip Prefers mode with
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1371 @samp{S}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1372
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1373 @findex emerge-auto-advance-mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1374 @findex emerge-skip-prefers-mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1375 Use the command @kbd{s a} (@code{emerge-auto-advance-mode}) to set or
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1376 clear Auto Advance mode. Use @kbd{s s}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1377 (@code{emerge-skip-prefers-mode}) to set or clear Skip Prefers mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1378 These commands turn on the mode with a positive argument, turns it off
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1379 with a negative or zero argument, and toggle the mode with no argument.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1380
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1381 @node State of Difference
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1382 @section State of a Difference
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1383
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1384 In the merge buffer, a difference is marked with lines of @samp{v} and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1385 @samp{^} characters. Each difference has one of these seven states:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1386
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1387 @table @asis
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1388 @item A
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1389 The difference is showing the A version. The @kbd{a} command always
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1390 produces this state; the mode line indicates it with @samp{A}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1391
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1392 @item B
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1393 The difference is showing the B version. The @kbd{b} command always
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1394 produces this state; the mode line indicates it with @samp{B}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1395
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1396 @item default-A
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1397 @itemx default-B
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1398 The difference is showing the A or the B state by default, because you
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1399 haven't made a choice. All differences start in the default-A state
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1400 (and thus the merge buffer is a copy of the A buffer), except those for
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1401 which one alternative is ``preferred'' (see below).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1402
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1403 When you select a difference, its state changes from default-A or
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1404 default-B to plain A or B. Thus, the selected difference never has
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1405 state default-A or default-B, and these states are never displayed in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1406 the mode line.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1407
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1408 The command @kbd{d a} chooses default-A as the default state, and @kbd{d
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1409 b} chooses default-B. This chosen default applies to all differences
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1410 which you haven't ever selected and for which no alternative is preferred.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1411 If you are moving through the merge sequentially, the differences you
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1412 haven't selected are those following the selected one. Thus, while
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1413 moving sequentially, you can effectively make the A version the default
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1414 for some sections of the merge buffer and the B version the default for
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1415 others by using @kbd{d a} and @kbd{d b} between sections.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1416
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1417 @item prefer-A
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1418 @itemx prefer-B
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1419 The difference is showing the A or B state because it is
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1420 @dfn{preferred}. This means that you haven't made an explicit choice,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1421 but one alternative seems likely to be right because the other
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1422 alternative agrees with the common ancestor. Thus, where the A buffer
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1423 agrees with the common ancestor, the B version is preferred, because
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1424 chances are it is the one that was actually changed.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1425
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1426 These two states are displayed in the mode line as @samp{A*} and @samp{B*}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1427
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1428 @item combined
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1429 The difference is showing a combination of the A and B states, as a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1430 result of the @kbd{x c} or @kbd{x C} commands.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1431
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1432 Once a difference is in this state, the @kbd{a} and @kbd{b} commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1433 don't do anything to it unless you give them a numeric argument.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1434
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1435 The mode line displays this state as @samp{comb}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1436 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1437
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1438 @node Merge Commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1439 @section Merge Commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1440
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1441 Here are the Merge commands for Fast mode; in Edit mode, precede them
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1442 with @kbd{C-c C-c}:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1443
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1444 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1445 @item p
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1446 Select the previous difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1447
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1448 @item n
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1449 Select the next difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1450
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1451 @item a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1452 Choose the A version of this difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1453
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1454 @item b
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1455 Choose the B version of this difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1456
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1457 @item C-u @var{n} j
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1458 Select difference number @var{n}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1459
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1460 @item .
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1461 Select the difference containing point. You can use this command in the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1462 merge buffer or in the A or B buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1463
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1464 @item q
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1465 Quit---finish the merge.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1466
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1467 @item C-]
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1468 Abort---exit merging and do not save the output.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1469
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1470 @item f
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1471 Go into Fast mode. (In Edit mode, this is actually @kbd{C-c C-c f}.)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1472
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1473 @item e
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1474 Go into Edit mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1475
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1476 @item l
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1477 Recenter (like @kbd{C-l}) all three windows.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1478
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1479 @item -
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1480 Specify part of a prefix numeric argument.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1481
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1482 @item @var{digit}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1483 Also specify part of a prefix numeric argument.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1484
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1485 @item d a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1486 Choose the A version as the default from here down in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1487 the merge buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1488
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1489 @item d b
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1490 Choose the B version as the default from here down in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1491 the merge buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1492
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1493 @item c a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1494 Copy the A version of this difference into the kill ring.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1495
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1496 @item c b
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1497 Copy the B version of this difference into the kill ring.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1498
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1499 @item i a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1500 Insert the A version of this difference at point.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1501
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1502 @item i b
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1503 Insert the B version of this difference at point.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1504
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1505 @item m
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1506 Put point and mark around the difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1507
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1508 @item ^
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1509 Scroll all three windows down (like @kbd{M-v}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1510
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1511 @item v
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1512 Scroll all three windows up (like @kbd{C-v}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1513
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1514 @item <
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1515 Scroll all three windows left (like @kbd{C-x <}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1516
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1517 @item >
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1518 Scroll all three windows right (like @kbd{C-x >}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1519
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1520 @item |
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1521 Reset horizontal scroll on all three windows.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1522
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1523 @item x 1
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1524 Shrink the merge window to one line. (Use @kbd{C-u l} to restore it
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1525 to full size.)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1526
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1527 @item x c
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1528 Combine the two versions of this difference (@pxref{Combining in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1529 Emerge}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1530
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1531 @item x f
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1532 Show the names of the files/buffers Emerge is operating on, in a Help
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1533 window. (Use @kbd{C-u l} to restore windows.)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1534
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1535 @item x j
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1536 Join this difference with the following one.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1537 (@kbd{C-u x j} joins this difference with the previous one.)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1538
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1539 @item x s
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1540 Split this difference into two differences. Before you use this
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1541 command, position point in each of the three buffers at the place where
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1542 you want to split the difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1543
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1544 @item x t
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1545 Trim identical lines off the top and bottom of the difference.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1546 Such lines occur when the A and B versions are
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1547 identical but differ from the ancestor version.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1548 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1549
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1550 @node Exiting Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1551 @section Exiting Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1552
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1553 The @kbd{q} command (@code{emerge-quit}) finishes the merge, storing
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1554 the results into the output file if you specified one. It restores the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1555 A and B buffers to their proper contents, or kills them if they were
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1556 created by Emerge and you haven't changed them. It also disables the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1557 Emerge commands in the merge buffer, since executing them later could
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1558 damage the contents of the various buffers.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1559
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1560 @kbd{C-]} aborts the merge. This means exiting without writing the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1561 output file. If you didn't specify an output file, then there is no
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1562 real difference between aborting and finishing the merge.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1563
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1564 If the Emerge command was called from another Lisp program, then its
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1565 return value is @code{t} for successful completion, or @code{nil} if you
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1566 abort.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1567
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1568 @node Combining in Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1569 @section Combining the Two Versions
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1570
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1571 Sometimes you want to keep @emph{both} alternatives for a particular
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1572 difference. To do this, use @kbd{x c}, which edits the merge buffer
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1573 like this:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1574
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1575 @example
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1576 @group
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1577 #ifdef NEW
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1578 @var{version from A buffer}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1579 #else /* not NEW */
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1580 @var{version from B buffer}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1581 #endif /* not NEW */
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1582 @end group
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1583 @end example
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1584
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1585 @noindent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1586 @vindex emerge-combine-versions-template
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1587 While this example shows C preprocessor conditionals delimiting the two
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1588 alternative versions, you can specify the strings to use by setting
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1589 the variable @code{emerge-combine-versions-template} to a string of your
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1590 choice. In the string, @samp{%a} says where to put version A, and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1591 @samp{%b} says where to put version B. The default setting, which
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1592 produces the results shown above, looks like this:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1593
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1594 @example
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1595 @group
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1596 "#ifdef NEW\n%a#else /* not NEW */\n%b#endif /* not NEW */\n"
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1597 @end group
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1598 @end example
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1599
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1600 @node Fine Points of Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1601 @section Fine Points of Emerge
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1602
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1603 During the merge, you mustn't try to edit the A and B buffers yourself.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1604 Emerge modifies them temporarily, but ultimately puts them back the way
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1605 they were.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1606
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1607 You can have any number of merges going at once---just don't use any one
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1608 buffer as input to more than one merge at once, since the temporary
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1609 changes made in these buffers would get in each other's way.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1610
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1611 Starting Emerge can take a long time because it needs to compare the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1612 files fully. Emacs can't do anything else until @code{diff} finishes.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1613 Perhaps in the future someone will change Emerge to do the comparison in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1614 the background when the input files are large---then you could keep on
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1615 doing other things with Emacs until Emerge is ready to accept
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1616 commands.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1617
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1618 @vindex emerge-startup-hook
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1619 After setting up the merge, Emerge runs the hook
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1620 @code{emerge-startup-hook}. @xref{Hooks,,, emacs, the Emacs Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1621
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1622 @node Picture Mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1623 @chapter Editing Pictures
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1624 @cindex pictures
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1625 @cindex making pictures out of text characters
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1626 @findex edit-picture
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1627
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1628 To edit a picture made out of text characters (for example, a picture
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1629 of the division of a register into fields, as a comment in a program),
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1630 use the command @kbd{M-x edit-picture} to enter Picture mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1631
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1632 In Picture mode, editing is based on the @dfn{quarter-plane} model of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1633 text, according to which the text characters lie studded on an area that
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1634 stretches infinitely far to the right and downward. The concept of the end
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1635 of a line does not exist in this model; the most you can say is where the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1636 last nonblank character on the line is found.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1637
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1638 Of course, Emacs really always considers text as a sequence of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1639 characters, and lines really do have ends. But Picture mode replaces
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1640 the most frequently-used commands with variants that simulate the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1641 quarter-plane model of text. They do this by inserting spaces or by
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1642 converting tabs to spaces.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1643
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1644 Most of the basic editing commands of Emacs are redefined by Picture mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1645 to do essentially the same thing but in a quarter-plane way. In addition,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1646 Picture mode defines various keys starting with the @kbd{C-c} prefix to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1647 run special picture editing commands.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1648
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1649 One of these keys, @kbd{C-c C-c}, is particularly important. Often a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1650 picture is part of a larger file that is usually edited in some other
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1651 major mode. @kbd{M-x edit-picture} records the name of the previous
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1652 major mode so you can use the @kbd{C-c C-c} command
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1653 (@code{picture-mode-exit}) later to go back to that mode. @kbd{C-c C-c}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1654 also deletes spaces from the ends of lines, unless given a numeric
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1655 argument.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1656
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1657 The special commands of Picture mode all work in other modes (provided
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1658 the @file{picture} library is loaded), but are not bound to keys except
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1659 in Picture mode. The descriptions below talk of moving ``one column''
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1660 and so on, but all the picture mode commands handle numeric arguments as
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1661 their normal equivalents do.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1662
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1663 @vindex picture-mode-hook
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1664 Turning on Picture mode runs the hook @code{picture-mode-hook}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1665 Additional extensions to Picture mode can be found in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1666 @file{artist.el}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1667
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1668 @menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1669 * Basic Picture:: Basic concepts and simple commands of Picture Mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1670 * Insert in Picture:: Controlling direction of cursor motion
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1671 after "self-inserting" characters.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1672 * Tabs in Picture:: Various features for tab stops and indentation.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1673 * Rectangles in Picture:: Clearing and superimposing rectangles.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1674 @end menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1675
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1676 @node Basic Picture
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1677 @section Basic Editing in Picture Mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1678
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1679 @findex picture-forward-column
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1680 @findex picture-backward-column
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1681 @findex picture-move-down
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1682 @findex picture-move-up
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1683 @cindex editing in Picture mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1684
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1685 Most keys do the same thing in Picture mode that they usually do, but
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1686 do it in a quarter-plane style. For example, @kbd{C-f} is rebound to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1687 run @code{picture-forward-column}, a command which moves point one
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1688 column to the right, inserting a space if necessary so that the actual
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1689 end of the line makes no difference. @kbd{C-b} is rebound to run
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1690 @code{picture-backward-column}, which always moves point left one
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1691 column, converting a tab to multiple spaces if necessary. @kbd{C-n} and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1692 @kbd{C-p} are rebound to run @code{picture-move-down} and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1693 @code{picture-move-up}, which can either insert spaces or convert tabs
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1694 as necessary to make sure that point stays in exactly the same column.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1695 @kbd{C-e} runs @code{picture-end-of-line}, which moves to after the last
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1696 nonblank character on the line. There is no need to change @kbd{C-a},
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1697 as the choice of screen model does not affect beginnings of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1698 lines.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1699
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1700 @findex picture-newline
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1701 Insertion of text is adapted to the quarter-plane screen model
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1702 through the use of Overwrite mode (@pxref{Minor Modes,,, emacs, the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1703 Emacs Manual}.) Self-inserting characters replace existing text,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1704 column by column, rather than pushing existing text to the right.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1705 @key{RET} runs @code{picture-newline}, which just moves to the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1706 beginning of the following line so that new text will replace that
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1707 line.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1708
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1709 @findex picture-backward-clear-column
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1710 @findex picture-clear-column
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1711 @findex picture-clear-line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1712 In Picture mode, the commands that normally delete or kill text,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1713 instead erase text (replacing it with spaces). @key{DEL}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1714 (@code{picture-backward-clear-column}) replaces the preceding
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1715 character with a space rather than removing it; this moves point
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1716 backwards. @kbd{C-d} (@code{picture-clear-column}) replaces the next
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1717 character or characters with spaces, but does not move point. (If you
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1718 want to clear characters to spaces and move forward over them, use
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1719 @key{SPC}.) @kbd{C-k} (@code{picture-clear-line}) really kills the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1720 contents of lines, but does not delete the newlines from the buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1721
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1722 @findex picture-open-line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1723 To do actual insertion, you must use special commands. @kbd{C-o}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1724 (@code{picture-open-line}) creates a blank line after the current
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1725 line; it never splits a line. @kbd{C-M-o} (@code{split-line}) makes
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1726 sense in Picture mode, so it is not changed. @kbd{C-j}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1727 (@code{picture-duplicate-line}) inserts another line with the same
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1728 contents below the current line.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1729
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1730 @kindex C-c C-d @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1731 To do actual deletion in Picture mode, use @kbd{C-w}, @kbd{C-c C-d}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1732 (which is defined as @code{delete-char}, as @kbd{C-d} is in other
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1733 modes), or one of the picture rectangle commands (@pxref{Rectangles in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1734 Picture}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1735
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1736 @node Insert in Picture
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1737 @section Controlling Motion after Insert
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1738
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1739 @findex picture-movement-up
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1740 @findex picture-movement-down
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1741 @findex picture-movement-left
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1742 @findex picture-movement-right
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1743 @findex picture-movement-nw
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1744 @findex picture-movement-ne
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1745 @findex picture-movement-sw
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1746 @findex picture-movement-se
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1747 @kindex C-c < @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1748 @kindex C-c > @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1749 @kindex C-c ^ @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1750 @kindex C-c . @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1751 @kindex C-c ` @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1752 @kindex C-c ' @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1753 @kindex C-c / @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1754 @kindex C-c \ @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1755 Since ``self-inserting'' characters in Picture mode overwrite and move
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1756 point, there is no essential restriction on how point should be moved.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1757 Normally point moves right, but you can specify any of the eight
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1758 orthogonal or diagonal directions for motion after a ``self-inserting''
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1759 character. This is useful for drawing lines in the buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1760
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1761 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1762 @item C-c <
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1763 @itemx C-c @key{LEFT}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1764 Move left after insertion (@code{picture-movement-left}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1765 @item C-c >
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1766 @itemx C-c @key{RIGHT}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1767 Move right after insertion (@code{picture-movement-right}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1768 @item C-c ^
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1769 @itemx C-c @key{UP}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1770 Move up after insertion (@code{picture-movement-up}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1771 @item C-c .
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1772 @itemx C-c @key{DOWN}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1773 Move down after insertion (@code{picture-movement-down}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1774 @item C-c `
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1775 @itemx C-c @key{HOME}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1776 Move up and left (``northwest'') after insertion (@code{picture-movement-nw}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1777 @item C-c '
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1778 @itemx C-c @key{PAGEUP}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1779 Move up and right (``northeast'') after insertion
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1780 (@code{picture-movement-ne}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1781 @item C-c /
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1782 @itemx C-c @key{END}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1783 Move down and left (``southwest'') after insertion
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1784 @*(@code{picture-movement-sw}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1785 @item C-c \
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1786 @itemx C-c @key{PAGEDOWN}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1787 Move down and right (``southeast'') after insertion
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1788 @*(@code{picture-movement-se}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1789 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1790
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1791 @kindex C-c C-f @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1792 @kindex C-c C-b @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1793 @findex picture-motion
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1794 @findex picture-motion-reverse
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1795 Two motion commands move based on the current Picture insertion
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1796 direction. The command @kbd{C-c C-f} (@code{picture-motion}) moves in the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1797 same direction as motion after ``insertion'' currently does, while @kbd{C-c
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1798 C-b} (@code{picture-motion-reverse}) moves in the opposite direction.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1799
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1800 @node Tabs in Picture
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1801 @section Picture Mode Tabs
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1802
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1803 @kindex M-TAB @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1804 @findex picture-tab-search
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1805 @vindex picture-tab-chars
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1806 Two kinds of tab-like action are provided in Picture mode. Use
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1807 @kbd{M-@key{TAB}} (@code{picture-tab-search}) for context-based tabbing.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1808 With no argument, it moves to a point underneath the next
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1809 ``interesting'' character that follows whitespace in the previous
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1810 nonblank line. ``Next'' here means ``appearing at a horizontal position
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1811 greater than the one point starts out at.'' With an argument, as in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1812 @kbd{C-u M-@key{TAB}}, this command moves to the next such interesting
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1813 character in the current line. @kbd{M-@key{TAB}} does not change the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1814 text; it only moves point. ``Interesting'' characters are defined by
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1815 the variable @code{picture-tab-chars}, which should define a set of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1816 characters. The syntax for this variable is like the syntax used inside
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1817 of @samp{[@dots{}]} in a regular expression---but without the @samp{[}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1818 and the @samp{]}. Its default value is @code{"!-~"}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1819
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1820 @findex picture-tab
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1821 @key{TAB} itself runs @code{picture-tab}, which operates based on the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1822 current tab stop settings; it is the Picture mode equivalent of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1823 @code{tab-to-tab-stop}. Normally it just moves point, but with a numeric
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1824 argument it clears the text that it moves over.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1825
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1826 @kindex C-c TAB @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1827 @findex picture-set-tab-stops
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1828 The context-based and tab-stop-based forms of tabbing are brought
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1829 together by the command @kbd{C-c @key{TAB}} (@code{picture-set-tab-stops}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1830 This command sets the tab stops to the positions which @kbd{M-@key{TAB}}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1831 would consider significant in the current line. The use of this command,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1832 together with @key{TAB}, can get the effect of context-based tabbing. But
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1833 @kbd{M-@key{TAB}} is more convenient in the cases where it is sufficient.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1834
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1835 It may be convenient to prevent use of actual tab characters in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1836 pictures. For example, this prevents @kbd{C-x @key{TAB}} from messing
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1837 up the picture. You can do this by setting the variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1838 @code{indent-tabs-mode} to @code{nil}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1839
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1840 @node Rectangles in Picture
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1841 @section Picture Mode Rectangle Commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1842 @cindex rectangles and Picture mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1843 @cindex Picture mode and rectangles
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1844
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1845 Picture mode defines commands for working on rectangular pieces of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1846 the text in ways that fit with the quarter-plane model. The standard
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1847 rectangle commands may also be useful. @xref{Rectangles,,, emacs, the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1848 Emacs Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1849
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1850 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1851 @item C-c C-k
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1852 Clear out the region-rectangle with spaces
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1853 (@code{picture-clear-rectangle}). With argument, delete the text.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1854 @item C-c C-w @var{r}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1855 Similar, but save rectangle contents in register @var{r} first
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1856 (@code{picture-clear-rectangle-to-register}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1857 @item C-c C-y
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1858 Copy last killed rectangle into the buffer by overwriting, with upper
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1859 left corner at point (@code{picture-yank-rectangle}). With argument,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1860 insert instead.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1861 @item C-c C-x @var{r}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1862 Similar, but use the rectangle in register @var{r}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1863 (@code{picture-yank-rectangle-from-register}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1864 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1865
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1866 @kindex C-c C-k @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1867 @kindex C-c C-w @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1868 @findex picture-clear-rectangle
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1869 @findex picture-clear-rectangle-to-register
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1870 The picture rectangle commands @kbd{C-c C-k}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1871 (@code{picture-clear-rectangle}) and @kbd{C-c C-w}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1872 (@code{picture-clear-rectangle-to-register}) differ from the standard
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1873 rectangle commands in that they normally clear the rectangle instead of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1874 deleting it; this is analogous with the way @kbd{C-d} is changed in Picture
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1875 mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1876
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1877 However, deletion of rectangles can be useful in Picture mode, so
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1878 these commands delete the rectangle if given a numeric argument.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1879 @kbd{C-c C-k} either with or without a numeric argument saves the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1880 rectangle for @kbd{C-c C-y}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1881
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1882 @kindex C-c C-y @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1883 @kindex C-c C-x @r{(Picture mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1884 @findex picture-yank-rectangle
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1885 @findex picture-yank-rectangle-from-register
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1886 The Picture mode commands for yanking rectangles differ from the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1887 standard ones in that they overwrite instead of inserting. This is
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1888 the same way that Picture mode insertion of other text differs from
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1889 other modes. @kbd{C-c C-y} (@code{picture-yank-rectangle}) inserts
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1890 (by overwriting) the rectangle that was most recently killed, while
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1891 @kbd{C-c C-x} (@code{picture-yank-rectangle-from-register}) does
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1892 likewise for the rectangle found in a specified register.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
1893
69945
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1894 @node Advanced VC Usage
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1895 @chapter Advanced VC Usage
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1896
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1897 Commonly used features of Emacs' version control (VC) support are
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1898 described in the main Emacs manual (@pxref{Version Control,,,emacs,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1899 the Emacs Manual}). This chapter describes more advanced VC usage.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1900
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1901 @menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1902 * VC Dired Mode:: Listing files managed by version control.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1903 * VC Dired Commands:: Commands to use in a VC Dired buffer.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1904 * Remote Repositories:: Efficient access to remote CVS servers.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1905 * Snapshots:: Sets of file versions treated as a unit.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1906 * Miscellaneous VC:: Various other commands and features of VC.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1907 * Customizing VC:: Variables that change VC's behavior.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1908 @end menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1909
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1910 @node VC Dired Mode
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1911 @section Dired under VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1912
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1913 @cindex PCL-CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1914 @pindex cvs
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1915 @cindex CVS Dired Mode
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1916 The VC Dired Mode described here works with all the version control
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1917 systems that VC supports. Another more powerful facility, designed
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1918 specifically for CVS, is called PCL-CVS. @xref{Top, , About PCL-CVS,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1919 pcl-cvs, PCL-CVS --- The Emacs Front-End to CVS}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1920
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1921 @kindex C-x v d
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1922 @findex vc-directory
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1923 When you are working on a large program, it is often useful to find
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1924 out which files have changed within an entire directory tree, or to view
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1925 the status of all files under version control at once, and to perform
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1926 version control operations on collections of files. You can use the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1927 command @kbd{C-x v d} (@code{vc-directory}) to make a directory listing
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1928 that includes only files relevant for version control.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1929
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1930 @vindex vc-dired-terse-display
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1931 @kbd{C-x v d} creates a buffer which uses VC Dired Mode. This looks
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1932 much like an ordinary Dired buffer (@pxref{Dired,,,emacs, the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1933 Emacs Manual}); however, normally it shows only the noteworthy files
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1934 (those locked or not up-to-date). This is called @dfn{terse display}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1935 If you set the variable @code{vc-dired-terse-display} to @code{nil},
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1936 then VC Dired shows all relevant files---those managed under version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1937 control, plus all subdirectories (@dfn{full display}). The command
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1938 @kbd{v t} in a VC Dired buffer toggles between terse display and full
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1939 display (@pxref{VC Dired Commands}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1940
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1941 @vindex vc-dired-recurse
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1942 By default, VC Dired produces a recursive listing of noteworthy or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1943 relevant files at or below the given directory. You can change this by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1944 setting the variable @code{vc-dired-recurse} to @code{nil}; then VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1945 Dired shows only the files in the given directory.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1946
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1947 The line for an individual file shows the version control state in the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1948 place of the hard link count, owner, group, and size of the file. If
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1949 the file is unmodified, in sync with the master file, the version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1950 control state shown is blank. Otherwise it consists of text in
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1951 parentheses. Under RCS and SCCS, the name of the user locking the file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1952 is shown; under CVS, an abbreviated version of the @samp{cvs status}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1953 output is used. Here is an example using RCS:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1954
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1955 @smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1956 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1957 /home/jim/project:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1958
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1959 -rw-r--r-- (jim) Apr 2 23:39 file1
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1960 -r--r--r-- Apr 5 20:21 file2
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1961 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1962 @end smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1963
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1964 @noindent
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1965 The files @samp{file1} and @samp{file2} are under version control,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1966 @samp{file1} is locked by user jim, and @samp{file2} is unlocked.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1967
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1968 Here is an example using CVS:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1969
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1970 @smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1971 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1972 /home/joe/develop:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1973
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1974 -rw-r--r-- (modified) Aug 2 1997 file1.c
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1975 -rw-r--r-- Apr 4 20:09 file2.c
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1976 -rw-r--r-- (merge) Sep 13 1996 file3.c
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1977 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1978 @end smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1979
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1980 Here @samp{file1.c} is modified with respect to the repository, and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1981 @samp{file2.c} is not. @samp{file3.c} is modified, but other changes
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1982 have also been checked in to the repository---you need to merge them
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1983 with the work file before you can check it in.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1984
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1985 @vindex vc-stay-local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1986 @vindex vc-cvs-stay-local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1987 In the above, if the repository were on a remote machine, VC would
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1988 only contact it when the variable @code{vc-stay-local} (or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1989 @code{vc-cvs-stay-local}) is nil (@pxref{CVS Options}). This is
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1990 because access to the repository may be slow, or you may be working
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1991 offline and not have access to the repository at all. As a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1992 consequence, VC would not be able to tell you that @samp{file3.c} is
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1993 in the ``merge'' state; you would learn that only when you try to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1994 check-in your modified copy of the file, or use a command such as
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1995 @kbd{C-x v m}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1996
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1997 In practice, this is not a problem because CVS handles this case
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1998 consistently whenever it arises. In VC, you'll simply get prompted to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
1999 merge the remote changes into your work file first. The benefits of
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2000 less network communication usually outweigh the disadvantage of not
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2001 seeing remote changes immediately.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2002
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2003 @vindex vc-directory-exclusion-list
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2004 When VC Dired displays subdirectories (in the ``full'' display mode),
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2005 it omits some that should never contain any files under version control.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2006 By default, this includes Version Control subdirectories such as
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2007 @samp{RCS} and @samp{CVS}; you can customize this by setting the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2008 variable @code{vc-directory-exclusion-list}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2009
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2010 You can fine-tune VC Dired's format by typing @kbd{C-u C-x v d}---as in
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2011 ordinary Dired, that allows you to specify additional switches for the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2012 @samp{ls} command.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2013
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2014 @node VC Dired Commands
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2015 @section VC Dired Commands
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2016
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2017 All the usual Dired commands work normally in VC Dired mode, except
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2018 for @kbd{v}, which is redefined as the version control prefix. You can
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2019 invoke VC commands such as @code{vc-diff} and @code{vc-print-log} by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2020 typing @kbd{v =}, or @kbd{v l}, and so on. Most of these commands apply
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2021 to the file name on the current line.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2022
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2023 The command @kbd{v v} (@code{vc-next-action}) operates on all the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2024 marked files, so that you can lock or check in several files at once.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2025 If it operates on more than one file, it handles each file according to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2026 its current state; thus, it might lock one file, but check in another
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2027 file. This could be confusing; it is up to you to avoid confusing
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2028 behavior by marking a set of files that are in a similar state. If no
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2029 files are marked, @kbd{v v} operates on the file in the current line.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2030
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2031 If any files call for check-in, @kbd{v v} reads a single log entry,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2032 then uses it for all the files being checked in. This is convenient for
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2033 registering or checking in several files at once, as part of the same
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2034 change.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2035
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2036 @findex vc-dired-toggle-terse-mode
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2037 @findex vc-dired-mark-locked
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2038 You can toggle between terse display (only locked files, or files not
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2039 up-to-date) and full display at any time by typing @kbd{v t}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2040 (@code{vc-dired-toggle-terse-mode}). There is also a special command
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2041 @kbd{* l} (@code{vc-dired-mark-locked}), which marks all files currently
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2042 locked (or, with CVS, all files not up-to-date). Thus, typing @kbd{* l
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2043 t k} is another way to delete from the buffer all files except those
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2044 currently locked.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2045
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2046 @node Remote Repositories
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2047 @section Remote Repositories
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2048 @cindex remote repositories (CVS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2049
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2050 A common way of using CVS is to set up a central CVS repository on
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2051 some Internet host, then have each developer check out a personal
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2052 working copy of the files on his local machine. Committing changes to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2053 the repository, and picking up changes from other users into one's own
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2054 working area, then works by direct interactions with the CVS server.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2055
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2056 One difficulty is that access to the CVS server is often slow, and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2057 that developers might need to work off-line as well. VC is designed
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2058 to reduce the amount of network interaction necessary.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2059
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2060 @menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2061 * Version Backups:: Keeping local copies of repository versions.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2062 * Local Version Control:: Using another version system for local editing.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2063 @end menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2064
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2065 @node Version Backups
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2066 @subsection Version Backups
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2067 @cindex version backups
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2068
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2069 @cindex automatic version backups
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2070 When VC sees that the CVS repository for a file is on a remote
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2071 machine, it automatically makes local backups of unmodified versions
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2072 of the file---@dfn{automatic version backups}. This means that you
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2073 can compare the file to the repository version (@kbd{C-x v =}), or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2074 revert to that version (@kbd{C-x v u}), without any network
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2075 interactions.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2076
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2077 The local copy of the unmodified file is called a @dfn{version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2078 backup} to indicate that it corresponds exactly to a version that is
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2079 stored in the repository. Note that version backups are not the same
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2080 as ordinary Emacs backup files (@pxref{Backup,,,emacs, the Emacs
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2081 Manual}). But they follow a similar naming convention.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2082
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2083 For a file that comes from a remote CVS repository, VC makes a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2084 version backup whenever you save the first changes to the file, and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2085 removes it after you have committed your modified version to the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2086 repository. You can disable the making of automatic version backups by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2087 setting @code{vc-cvs-stay-local} to @code{nil} (@pxref{CVS Options}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2088
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2089 @cindex manual version backups
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2090 The name of the automatic version backup for version @var{version}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2091 of file @var{file} is @code{@var{file}.~@var{version}.~}. This is
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2092 almost the same as the name used by @kbd{C-x v ~} (@pxref{Old
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2093 Versions,,,emacs, the Emacs Manual}), the only difference being
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2094 the additional dot (@samp{.}) after the version number. This
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2095 similarity is intentional, because both kinds of files store the same
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2096 kind of information. The file made by @kbd{C-x v ~} acts as a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2097 @dfn{manual version backup}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2098
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2099 All the VC commands that operate on old versions of a file can use
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2100 both kinds of version backups. For instance, @kbd{C-x v ~} uses
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2101 either an automatic or a manual version backup, if possible, to get
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2102 the contents of the version you request. Likewise, @kbd{C-x v =} and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2103 @kbd{C-x v u} use either an automatic or a manual version backup, if
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2104 one of them exists, to get the contents of a version to compare or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2105 revert to. If you changed a file outside of Emacs, so that no
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2106 automatic version backup was created for the previous text, you can
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2107 create a manual backup of that version using @kbd{C-x v ~}, and thus
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2108 obtain the benefit of the local copy for Emacs commands.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2109
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2110 The only difference in Emacs's handling of manual and automatic
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2111 version backups, once they exist, is that Emacs deletes automatic
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2112 version backups when you commit to the repository. By contrast,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2113 manual version backups remain until you delete them.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2114
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2115 @node Local Version Control
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2116 @subsection Local Version Control
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2117 @cindex local version control
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2118 @cindex local back end (version control)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2119
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2120 When you make many changes to a file that comes from a remote
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2121 repository, it can be convenient to have version control on your local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2122 machine as well. You can then record intermediate versions, revert to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2123 a previous state, etc., before you actually commit your changes to the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2124 remote server.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2125
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2126 VC lets you do this by putting a file under a second, local version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2127 control system, so that the file is effectively registered in two
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2128 systems at the same time. For the description here, we will assume
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2129 that the remote system is CVS, and you use RCS locally, although the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2130 mechanism works with any combination of version control systems
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2131 (@dfn{back ends}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2132
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2133 To make it work with other back ends, you must make sure that the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2134 ``more local'' back end comes before the ``more remote'' back end in
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2135 the setting of @code{vc-handled-backends} (@pxref{Customizing VC}). By
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2136 default, this variable is set up so that you can use remote CVS and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2137 local RCS as described here.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2138
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2139 To start using local RCS for a file that comes from a remote CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2140 server, you must @emph{register the file in RCS}, by typing @kbd{C-u
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2141 C-x v v rcs @key{RET}}. (In other words, use @code{vc-next-action} with a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2142 prefix argument, and specify RCS as the back end.)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2143
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2144 You can do this at any time; it does not matter whether you have
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2145 already modified the file with respect to the version in the CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2146 repository. If possible, VC tries to make the RCS master start with
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2147 the unmodified repository version, then checks in any local changes
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2148 as a new version. This works if you have not made any changes yet, or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2149 if the unmodified repository version exists locally as a version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2150 backup (@pxref{Version Backups}). If the unmodified version is not
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2151 available locally, the RCS master starts with the modified version;
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2152 the only drawback to this is that you cannot compare your changes
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2153 locally to what is stored in the repository.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2154
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2155 The version number of the RCS master is derived from the current CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2156 version, starting a branch from it. For example, if the current CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2157 version is 1.23, the local RCS branch will be 1.23.1. Version 1.23 in
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2158 the RCS master will be identical to version 1.23 under CVS; your first
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2159 changes are checked in as 1.23.1.1. (If the unmodified file is not
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2160 available locally, VC will check in the modified file twice, both as
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2161 1.23 and 1.23.1.1, to make the revision numbers consistent.)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2162
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2163 If you do not use locking under CVS (the default), locking is also
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2164 disabled for RCS, so that editing under RCS works exactly as under
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2165 CVS.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2166
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2167 When you are done with local editing, you can commit the final version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2168 back to the CVS repository by typing @kbd{C-u C-x v v cvs @key{RET}}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2169 This initializes the log entry buffer (@pxref{Log Buffer,,,emacs, the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2170 Emacs Manual}) to contain all the log entries you have recorded in the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2171 RCS master; you can edit them as you wish, and then commit in CVS by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2172 typing @kbd{C-c C-c}. If the commit is successful, VC removes the RCS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2173 master, so that the file is once again registered under CVS only.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2174 (The RCS master is not actually deleted, just renamed by appending
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2175 @samp{~} to the name, so that you can refer to it later if you wish.)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2176
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2177 While using local RCS, you can pick up recent changes from the CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2178 repository into your local file, or commit some of your changes back
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2179 to CVS, without terminating local RCS version control. To do this,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2180 switch to the CVS back end temporarily, with the @kbd{C-x v b} command:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2181
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2182 @table @kbd
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2183 @item C-x v b
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2184 Switch to another back end that the current file is registered
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2185 under (@code{vc-switch-backend}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2186
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2187 @item C-u C-x v b @var{backend} @key{RET}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2188 Switch to @var{backend} for the current file.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2189 @end table
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2190
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2191 @kindex C-x v b
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2192 @findex vc-switch-backend
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2193 @kbd{C-x v b} does not change the buffer contents, or any files; it
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2194 only changes VC's perspective on how to handle the file. Any
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2195 subsequent VC commands for that file will operate on the back end that
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2196 is currently selected.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2197
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2198 If the current file is registered in more than one back end, typing
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2199 @kbd{C-x v b} ``cycles'' through all of these back ends. With a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2200 prefix argument, it asks for the back end to use in the minibuffer.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2201
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2202 Thus, if you are using local RCS, and you want to pick up some recent
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2203 changes in the file from remote CVS, first visit the file, then type
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2204 @kbd{C-x v b} to switch to CVS, and finally use @kbd{C-x v m
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2205 @key{RET}} to merge the news (@pxref{Merging,,,emacs, the Emacs
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2206 Manual}). You can then switch back to RCS by typing @kbd{C-x v b}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2207 again, and continue to edit locally.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2208
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2209 But if you do this, the revision numbers in the RCS master no longer
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2210 correspond to those of CVS. Technically, this is not a problem, but
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2211 it can become difficult to keep track of what is in the CVS repository
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2212 and what is not. So we suggest that you return from time to time to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2213 CVS-only operation, by committing your local changes back to the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2214 repository using @kbd{C-u C-x v v cvs @key{RET}}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2215
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2216 @node Snapshots
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2217 @section Snapshots
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2218 @cindex snapshots and version control
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2219
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2220 A @dfn{snapshot} is a named set of file versions (one for each
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2221 registered file) that you can treat as a unit. One important kind of
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2222 snapshot is a @dfn{release}, a (theoretically) stable version of the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2223 system that is ready for distribution to users.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2224
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2225 @menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2226 * Making Snapshots:: The snapshot facilities.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2227 * Snapshot Caveats:: Things to be careful of when using snapshots.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2228 @end menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2229
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2230 @node Making Snapshots
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2231 @subsection Making and Using Snapshots
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2232
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2233 There are two basic commands for snapshots; one makes a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2234 snapshot with a given name, the other retrieves a named snapshot.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2235
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2236 @table @code
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2237 @kindex C-x v s
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2238 @findex vc-create-snapshot
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2239 @item C-x v s @var{name} @key{RET}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2240 Define the last saved versions of every registered file in or under the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2241 current directory as a snapshot named @var{name}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2242 (@code{vc-create-snapshot}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2243
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2244 @kindex C-x v r
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2245 @findex vc-retrieve-snapshot
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2246 @item C-x v r @var{name} @key{RET}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2247 For all registered files at or below the current directory level, select
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2248 whatever versions correspond to the snapshot @var{name}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2249 (@code{vc-retrieve-snapshot}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2250
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2251 This command reports an error if any files are locked at or below the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2252 current directory, without changing anything; this is to avoid
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2253 overwriting work in progress.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2254 @end table
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2255
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2256 A snapshot uses a very small amount of resources---just enough to record
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2257 the list of file names and which version belongs to the snapshot. Thus,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2258 you need not hesitate to create snapshots whenever they are useful.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2259
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2260 You can give a snapshot name as an argument to @kbd{C-x v =} or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2261 @kbd{C-x v ~} (@pxref{Old Versions,,,emacs, the Emacs Manual}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2262 Thus, you can use it to compare a snapshot against the current files,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2263 or two snapshots against each other, or a snapshot against a named
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2264 version.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2265
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2266 @node Snapshot Caveats
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2267 @subsection Snapshot Caveats
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2268
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2269 @cindex named configurations (RCS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2270 VC's snapshot facilities are modeled on RCS's named-configuration
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2271 support. They use RCS's native facilities for this, so
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2272 snapshots made using RCS through VC are visible even when you bypass VC.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2273
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2274 With CVS, Meta-CVS, and Subversion, VC also uses the native
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2275 mechanism provided by that back end to make snapshots and retrieve them
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2276 (@dfn{tags} for CVS and Meta-CVS, @dfn{copies} for Subversion).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2277
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2278 @c worded verbosely to avoid overfull hbox.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2279 For SCCS, VC implements snapshots itself. The files it uses contain
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2280 name/file/version-number triples. These snapshots are visible only
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2281 through VC.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2282
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2283 There is no support for VC snapshots using GNU Arch yet.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2284
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2285 A snapshot is a set of checked-in versions. So make sure that all the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2286 files are checked in and not locked when you make a snapshot.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2287
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2288 File renaming and deletion can create some difficulties with snapshots.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2289 This is not a VC-specific problem, but a general design issue in version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2290 control systems that no one has solved very well yet.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2291
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2292 If you rename a registered file, you need to rename its master along
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2293 with it (the command @code{vc-rename-file} does this automatically). If
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2294 you are using SCCS, you must also update the records of the snapshot, to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2295 mention the file by its new name (@code{vc-rename-file} does this,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2296 too). An old snapshot that refers to a master file that no longer
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2297 exists under the recorded name is invalid; VC can no longer retrieve
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2298 it. It would be beyond the scope of this manual to explain enough about
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2299 RCS and SCCS to explain how to update the snapshots by hand.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2300
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2301 Using @code{vc-rename-file} makes the snapshot remain valid for
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2302 retrieval, but it does not solve all problems. For example, some of the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2303 files in your program probably refer to others by name. At the very
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2304 least, the makefile probably mentions the file that you renamed. If you
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2305 retrieve an old snapshot, the renamed file is retrieved under its new
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2306 name, which is not the name that the makefile expects. So the program
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2307 won't really work as retrieved.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2308
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2309 @node Miscellaneous VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2310 @section Miscellaneous Commands and Features of VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2311
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2312 This section explains the less-frequently-used features of VC.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2313
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2314 @menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2315 * Change Logs and VC:: Generating a change log file from log entries.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2316 * Renaming and VC:: A command to rename both the source and master
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2317 file correctly.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2318 * Version Headers:: Inserting version control headers into working files.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2319 @end menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2320
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2321 @node Change Logs and VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2322 @subsection Change Logs and VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2323
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2324 If you use RCS or CVS for a program and also maintain a change log
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2325 file for it (@pxref{Change Log,,,emacs, the Emacs Manual}), you
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2326 can generate change log entries automatically from the version control
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2327 log entries:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2328
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2329 @table @kbd
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2330 @item C-x v a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2331 @kindex C-x v a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2332 @findex vc-update-change-log
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2333 Visit the current directory's change log file and, for registered files
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2334 in that directory, create new entries for versions checked in since the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2335 most recent entry in the change log file.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2336 (@code{vc-update-change-log}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2337
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2338 This command works with RCS or CVS only, not with any of the other
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2339 back ends.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2340
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2341 @item C-u C-x v a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2342 As above, but only find entries for the current buffer's file.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2343
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2344 @item M-1 C-x v a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2345 As above, but find entries for all the currently visited files that are
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2346 maintained with version control. This works only with RCS, and it puts
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2347 all entries in the log for the default directory, which may not be
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2348 appropriate.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2349 @end table
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2350
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2351 For example, suppose the first line of @file{ChangeLog} is dated
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2352 1999-04-10, and that the only check-in since then was by Nathaniel
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2353 Bowditch to @file{rcs2log} on 1999-05-22 with log text @samp{Ignore log
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2354 messages that start with `#'.}. Then @kbd{C-x v a} visits
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2355 @file{ChangeLog} and inserts text like this:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2356
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2357 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2358 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2359 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2360 @smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2361 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2362 1999-05-22 Nathaniel Bowditch <nat@@apn.org>
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2363
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2364 * rcs2log: Ignore log messages that start with `#'.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2365 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2366 @end smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2367 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2368 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2369 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2370
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2371 @noindent
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2372 You can then edit the new change log entry further as you wish.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2373
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2374 Some of the new change log entries may duplicate what's already in
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2375 ChangeLog. You will have to remove these duplicates by hand.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2376
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2377 Normally, the log entry for file @file{foo} is displayed as @samp{*
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2378 foo: @var{text of log entry}}. The @samp{:} after @file{foo} is omitted
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2379 if the text of the log entry starts with @w{@samp{(@var{functionname}):
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2380 }}. For example, if the log entry for @file{vc.el} is
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2381 @samp{(vc-do-command): Check call-process status.}, then the text in
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2382 @file{ChangeLog} looks like this:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2383
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2384 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2385 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2386 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2387 @smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2388 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2389 1999-05-06 Nathaniel Bowditch <nat@@apn.org>
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2390
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2391 * vc.el (vc-do-command): Check call-process status.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2392 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2393 @end smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2394 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2395 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2396 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2397
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2398 When @kbd{C-x v a} adds several change log entries at once, it groups
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2399 related log entries together if they all are checked in by the same
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2400 author at nearly the same time. If the log entries for several such
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2401 files all have the same text, it coalesces them into a single entry.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2402 For example, suppose the most recent check-ins have the following log
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2403 entries:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2404
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2405 @flushleft
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2406 @bullet{} For @file{vc.texinfo}: @samp{Fix expansion typos.}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2407 @bullet{} For @file{vc.el}: @samp{Don't call expand-file-name.}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2408 @bullet{} For @file{vc-hooks.el}: @samp{Don't call expand-file-name.}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2409 @end flushleft
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2410
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2411 @noindent
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2412 They appear like this in @file{ChangeLog}:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2413
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2414 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2415 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2416 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2417 @smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2418 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2419 1999-04-01 Nathaniel Bowditch <nat@@apn.org>
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2420
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2421 * vc.texinfo: Fix expansion typos.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2422
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2423 * vc.el, vc-hooks.el: Don't call expand-file-name.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2424 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2425 @end smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2426 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2427 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2428 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2429
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2430 Normally, @kbd{C-x v a} separates log entries by a blank line, but you
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2431 can mark several related log entries to be clumped together (without an
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2432 intervening blank line) by starting the text of each related log entry
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2433 with a label of the form @w{@samp{@{@var{clumpname}@} }}. The label
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2434 itself is not copied to @file{ChangeLog}. For example, suppose the log
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2435 entries are:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2436
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2437 @flushleft
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2438 @bullet{} For @file{vc.texinfo}: @samp{@{expand@} Fix expansion typos.}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2439 @bullet{} For @file{vc.el}: @samp{@{expand@} Don't call expand-file-name.}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2440 @bullet{} For @file{vc-hooks.el}: @samp{@{expand@} Don't call expand-file-name.}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2441 @end flushleft
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2442
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2443 @noindent
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2444 Then the text in @file{ChangeLog} looks like this:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2445
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2446 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2447 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2448 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2449 @smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2450 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2451 1999-04-01 Nathaniel Bowditch <nat@@apn.org>
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2452
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2453 * vc.texinfo: Fix expansion typos.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2454 * vc.el, vc-hooks.el: Don't call expand-file-name.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2455 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2456 @end smallexample
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2457 @iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2458 @medbreak
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2459 @end iftex
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2460
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2461 A log entry whose text begins with @samp{#} is not copied to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2462 @file{ChangeLog}. For example, if you merely fix some misspellings in
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2463 comments, you can log the change with an entry beginning with @samp{#}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2464 to avoid putting such trivia into @file{ChangeLog}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2465
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2466 @node Renaming and VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2467 @subsection Renaming VC Work Files and Master Files
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2468
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2469 @findex vc-rename-file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2470 When you rename a registered file, you must also rename its master
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2471 file correspondingly to get proper results. Use @code{vc-rename-file}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2472 to rename the source file as you specify, and rename its master file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2473 accordingly. It also updates any snapshots (@pxref{Snapshots}) that
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2474 mention the file, so that they use the new name; despite this, the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2475 snapshot thus modified may not completely work (@pxref{Snapshot
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2476 Caveats}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2477
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2478 Some back ends do not provide an explicit rename operation to their
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2479 repositories. After issuing @code{vc-rename-file}, use @kbd{C-x v v}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2480 on the original and renamed buffers and provide the necessary edit
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2481 log.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2482
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2483 You cannot use @code{vc-rename-file} on a file that is locked by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2484 someone else.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2485
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2486 @node Version Headers
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2487 @subsection Inserting Version Control Headers
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2488
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2489 Sometimes it is convenient to put version identification strings
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2490 directly into working files. Certain special strings called
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2491 @dfn{version headers} are replaced in each successive version by the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2492 number of that version, the name of the user who created it, and other
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2493 relevant information. All of the back ends that VC supports have such
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2494 a mechanism, except GNU Arch.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2495
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2496 VC does not normally use the information contained in these headers.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2497 The exception is RCS---with RCS, version headers are sometimes more
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2498 reliable than the master file to determine which version of the file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2499 you are editing. Note that in a multi-branch environment, version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2500 headers are necessary to make VC behave correctly (@pxref{Multi-User
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2501 Branching,,,emacs, the Emacs Manual}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2502
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2503 Searching for RCS version headers is controlled by the variable
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2504 @code{vc-consult-headers}. If it is non-@code{nil} (the default),
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2505 Emacs searches for headers to determine the version number you are
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2506 editing. Setting it to @code{nil} disables this feature.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2507
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2508 Note that although CVS uses the same kind of version headers as RCS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2509 does, VC never searches for these headers if you are using CVS,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2510 regardless of the above setting.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2511
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2512 @kindex C-x v h
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2513 @findex vc-insert-headers
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2514 You can use the @kbd{C-x v h} command (@code{vc-insert-headers}) to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2515 insert a suitable header string.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2516
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2517 @table @kbd
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2518 @item C-x v h
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2519 Insert headers in a file for use with your version-control system.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2520 @end table
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2521
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2522 @vindex vc-@var{backend}-header
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2523 The default header string is @samp{@w{$}Id$} for RCS and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2524 @samp{@w{%}W%} for SCCS. You can specify other headers to insert by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2525 setting the variables @code{vc-@var{backend}-header} where
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2526 @var{backend} is @code{rcs} or @code{sccs}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2527
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2528 Instead of a single string, you can specify a list of strings; then
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2529 each string in the list is inserted as a separate header on a line of
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2530 its own.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2531
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2532 It may be necessary to use apparently-superfluous backslashes when
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2533 writing the strings that you put in this variable. For instance, you
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2534 might write @code{"$Id\$"} rather than @code{"$Id@w{$}"}. The extra
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2535 backslash prevents the string constant from being interpreted as a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2536 header, if the Emacs Lisp file containing it is maintained with
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2537 version control.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2538
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2539 @vindex vc-comment-alist
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2540 Each header is inserted surrounded by tabs, inside comment delimiters,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2541 on a new line at point. Normally the ordinary comment
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2542 start and comment end strings of the current mode are used, but for
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2543 certain modes, there are special comment delimiters for this purpose;
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2544 the variable @code{vc-comment-alist} specifies them. Each element of
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2545 this list has the form @code{(@var{mode} @var{starter} @var{ender})}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2546
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2547 @vindex vc-static-header-alist
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2548 The variable @code{vc-static-header-alist} specifies further strings
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2549 to add based on the name of the buffer. Its value should be a list of
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2550 elements of the form @code{(@var{regexp} . @var{format})}. Whenever
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2551 @var{regexp} matches the buffer name, @var{format} is inserted as part
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2552 of the header. A header line is inserted for each element that matches
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2553 the buffer name, and for each string specified by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2554 @code{vc-@var{backend}-header}. The header line is made by processing the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2555 string from @code{vc-@var{backend}-header} with the format taken from the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2556 element. The default value for @code{vc-static-header-alist} is as follows:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2557
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2558 @example
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2559 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2560 (("\\.c$" .
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2561 "\n#ifndef lint\nstatic char vcid[] = \"\%s\";\n\
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2562 #endif /* lint */\n"))
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2563 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2564 @end example
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2565
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2566 @noindent
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2567 It specifies insertion of text of this form:
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2568
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2569 @example
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2570 @group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2571
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2572 #ifndef lint
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2573 static char vcid[] = "@var{string}";
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2574 #endif /* lint */
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2575 @end group
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2576 @end example
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2577
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2578 @noindent
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2579 Note that the text above starts with a blank line.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2580
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2581 If you use more than one version header in a file, put them close
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2582 together in the file. The mechanism in @code{revert-buffer} that
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2583 preserves markers may not handle markers positioned between two version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2584 headers.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2585
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2586 @node Customizing VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2587 @section Customizing VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2588
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2589 @vindex vc-handled-backends
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2590 The variable @code{vc-handled-backends} determines which version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2591 control systems VC should handle. The default value is @code{(RCS CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2592 SVN SCCS Arch MCVS)}, so it contains all six version systems that are
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2593 currently supported. If you want VC to ignore one or more of these
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2594 systems, exclude its name from the list. To disable VC entirely, set
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2595 this variable to @code{nil}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2596
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2597 The order of systems in the list is significant: when you visit a file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2598 registered in more than one system (@pxref{Local Version Control}), VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2599 uses the system that comes first in @code{vc-handled-backends} by
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2600 default. The order is also significant when you register a file for
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2601 the first time, @pxref{Registering,,,emacs, the Emacs Manual} for
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2602 details.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2603
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2604 @menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2605 * General VC Options:: Options that apply to multiple back ends.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2606 * RCS and SCCS:: Options for RCS and SCCS.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2607 * CVS Options:: Options for CVS.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2608 @end menu
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2609
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2610 @node General VC Options
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2611 @subsection General Options
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2612
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2613 @vindex vc-make-backup-files
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2614 Emacs normally does not save backup files for source files that are
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2615 maintained with version control. If you want to make backup files even
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2616 for files that use version control, set the variable
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2617 @code{vc-make-backup-files} to a non-@code{nil} value.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2618
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2619 @vindex vc-keep-workfiles
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2620 Normally the work file exists all the time, whether it is locked or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2621 not. If you set @code{vc-keep-workfiles} to @code{nil}, then checking
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2622 in a new version with @kbd{C-x v v} deletes the work file; but any
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2623 attempt to visit the file with Emacs creates it again. (With CVS, work
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2624 files are always kept.)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2625
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2626 @vindex vc-follow-symlinks
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2627 Editing a version-controlled file through a symbolic link can be
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2628 dangerous. It bypasses the version control system---you can edit the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2629 file without locking it, and fail to check your changes in. Also,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2630 your changes might overwrite those of another user. To protect against
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2631 this, VC checks each symbolic link that you visit, to see if it points
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2632 to a file under version control.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2633
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2634 The variable @code{vc-follow-symlinks} controls what to do when a
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2635 symbolic link points to a version-controlled file. If it is @code{nil},
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2636 VC only displays a warning message. If it is @code{t}, VC automatically
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2637 follows the link, and visits the real file instead, telling you about
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2638 this in the echo area. If the value is @code{ask} (the default), VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2639 asks you each time whether to follow the link.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2640
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2641 @vindex vc-suppress-confirm
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2642 If @code{vc-suppress-confirm} is non-@code{nil}, then @kbd{C-x v v}
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2643 and @kbd{C-x v i} can save the current buffer without asking, and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2644 @kbd{C-x v u} also operates without asking for confirmation. (This
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2645 variable does not affect @kbd{C-x v c}; that operation is so drastic
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2646 that it should always ask for confirmation.)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2647
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2648 @vindex vc-command-messages
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2649 VC mode does much of its work by running the shell commands for RCS,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2650 CVS and SCCS. If @code{vc-command-messages} is non-@code{nil}, VC
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2651 displays messages to indicate which shell commands it runs, and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2652 additional messages when the commands finish.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2653
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2654 @vindex vc-path
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2655 You can specify additional directories to search for version control
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2656 programs by setting the variable @code{vc-path}. These directories
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2657 are searched before the usual search path. It is rarely necessary to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2658 set this variable, because VC normally finds the proper files
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2659 automatically.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2660
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2661 @node RCS and SCCS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2662 @subsection Options for RCS and SCCS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2663
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2664 @cindex non-strict locking (RCS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2665 @cindex locking, non-strict (RCS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2666 By default, RCS uses locking to coordinate the activities of several
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2667 users, but there is a mode called @dfn{non-strict locking} in which
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2668 you can check-in changes without locking the file first. Use
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2669 @samp{rcs -U} to switch to non-strict locking for a particular file,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2670 see the @code{rcs} manual page for details.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2671
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2672 When deducing the version control state of an RCS file, VC first
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2673 looks for an RCS version header string in the file (@pxref{Version
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2674 Headers}). If there is no header string, VC normally looks at the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2675 file permissions of the work file; this is fast. But there might be
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2676 situations when the file permissions cannot be trusted. In this case
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2677 the master file has to be consulted, which is rather expensive. Also
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2678 the master file can only tell you @emph{if} there's any lock on the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2679 file, but not whether your work file really contains that locked
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2680 version.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2681
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2682 @vindex vc-consult-headers
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2683 You can tell VC not to use version headers to determine the file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2684 status by setting @code{vc-consult-headers} to @code{nil}. VC then
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2685 always uses the file permissions (if it is supposed to trust them), or
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2686 else checks the master file.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2687
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2688 @vindex vc-mistrust-permissions
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2689 You can specify the criterion for whether to trust the file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2690 permissions by setting the variable @code{vc-mistrust-permissions}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2691 Its value can be @code{t} (always mistrust the file permissions and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2692 check the master file), @code{nil} (always trust the file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2693 permissions), or a function of one argument which makes the decision.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2694 The argument is the directory name of the @file{RCS} subdirectory. A
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2695 non-@code{nil} value from the function says to mistrust the file
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2696 permissions. If you find that the file permissions of work files are
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2697 changed erroneously, set @code{vc-mistrust-permissions} to @code{t}.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2698 Then VC always checks the master file to determine the file's status.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2699
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2700 VC determines the version control state of files under SCCS much as
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2701 with RCS. It does not consider SCCS version headers, though. Thus,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2702 the variable @code{vc-mistrust-permissions} affects SCCS use, but
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2703 @code{vc-consult-headers} does not.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2704
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2705 @node CVS Options
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2706 @subsection Options specific for CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2707
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2708 @cindex locking (CVS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2709 By default, CVS does not use locking to coordinate the activities of
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2710 several users; anyone can change a work file at any time. However,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2711 there are ways to restrict this, resulting in behavior that resembles
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2712 locking.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2713
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2714 @cindex CVSREAD environment variable (CVS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2715 For one thing, you can set the @env{CVSREAD} environment variable
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2716 (the value you use makes no difference). If this variable is defined,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2717 CVS makes your work files read-only by default. In Emacs, you must
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2718 type @kbd{C-x v v} to make the file writable, so that editing works
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2719 in fact similar as if locking was used. Note however, that no actual
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2720 locking is performed, so several users can make their files writable
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2721 at the same time. When setting @env{CVSREAD} for the first time, make
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2722 sure to check out all your modules anew, so that the file protections
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2723 are set correctly.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2724
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2725 @cindex cvs watch feature
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2726 @cindex watching files (CVS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2727 Another way to achieve something similar to locking is to use the
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2728 @dfn{watch} feature of CVS. If a file is being watched, CVS makes it
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2729 read-only by default, and you must also use @kbd{C-x v v} in Emacs to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2730 make it writable. VC calls @code{cvs edit} to make the file writable,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2731 and CVS takes care to notify other developers of the fact that you
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2732 intend to change the file. See the CVS documentation for details on
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2733 using the watch feature.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2734
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2735 @vindex vc-stay-local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2736 @vindex vc-cvs-stay-local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2737 @cindex remote repositories (CVS)
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2738 When a file's repository is on a remote machine, VC tries to keep
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2739 network interactions to a minimum. This is controlled by the variable
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2740 @code{vc-cvs-stay-local}. There is another variable,
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2741 @code{vc-stay-local}, which enables the feature also for other back
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2742 ends that support it, including CVS. In the following, we will talk
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2743 only about @code{vc-cvs-stay-local}, but everything applies to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2744 @code{vc-stay-local} as well.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2745
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2746 If @code{vc-cvs-stay-local} is @code{t} (the default), then VC uses
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2747 only the entry in the local CVS subdirectory to determine the file's
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2748 state (and possibly information returned by previous CVS commands).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2749 One consequence of this is that when you have modified a file, and
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2750 somebody else has already checked in other changes to the file, you
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2751 are not notified of it until you actually try to commit. (But you can
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2752 try to pick up any recent changes from the repository first, using
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2753 @kbd{C-x v m @key{RET}}, @pxref{Merging,,,emacs, the Emacs Manual}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2754
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2755 When @code{vc-cvs-stay-local} is @code{t}, VC also makes local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2756 version backups, so that simple diff and revert operations are
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2757 completely local (@pxref{Version Backups}).
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2758
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2759 On the other hand, if you set @code{vc-cvs-stay-local} to @code{nil},
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2760 then VC queries the remote repository @emph{before} it decides what to
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2761 do in @code{vc-next-action} (@kbd{C-x v v}), just as it does for local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2762 repositories. It also does not make any version backups.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2763
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2764 You can also set @code{vc-cvs-stay-local} to a regular expression
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2765 that is matched against the repository host name; VC then stays local
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2766 only for repositories from hosts that match the pattern.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2767
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2768 @vindex vc-cvs-global-switches
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2769 You can specify additional command line options to pass to all CVS
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2770 operations in the variable @code{vc-cvs-global-switches}. These
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2771 switches are inserted immediately after the @code{cvs} command, before
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2772 the name of the operation to invoke.
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2773
87cbb18a44b0 move more advanced vc info to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69898
diff changeset
2774
69506
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2775 @node Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2776 @chapter Fortran Mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2777 @cindex Fortran mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2778 @cindex mode, Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2779
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2780 Fortran mode provides special motion commands for Fortran statements
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2781 and subprograms, and indentation commands that understand Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2782 conventions of nesting, line numbers and continuation statements.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2783 Fortran mode has support for Auto Fill mode that breaks long lines into
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2784 proper Fortran continuation lines.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2785
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2786 Special commands for comments are provided because Fortran comments
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2787 are unlike those of other languages. Built-in abbrevs optionally save
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2788 typing when you insert Fortran keywords.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2789
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2790 Use @kbd{M-x fortran-mode} to switch to this major mode. This
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2791 command runs the hook @code{fortran-mode-hook}. @xref{Hooks,,, emacs,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2792 the Emacs Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2793
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2794 @cindex Fortran77 and Fortran90
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2795 @findex f90-mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2796 @findex fortran-mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2797 Fortran mode is meant for editing Fortran77 ``fixed format'' (and also
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2798 ``tab format'') source code. For editing the modern Fortran90 or
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2799 Fortran95 ``free format'' source code, use F90 mode (@code{f90-mode}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2800 Emacs normally uses Fortran mode for files with extension @samp{.f},
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2801 @samp{.F} or @samp{.for}, and F90 mode for the extension @samp{.f90} and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2802 @samp{.f95}. GNU Fortran supports both kinds of format.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2803
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2804 @menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2805 * Motion: Fortran Motion. Moving point by statements or subprograms.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2806 * Indent: Fortran Indent. Indentation commands for Fortran.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2807 * Comments: Fortran Comments. Inserting and aligning comments.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2808 * Autofill: Fortran Autofill. Auto fill support for Fortran.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2809 * Columns: Fortran Columns. Measuring columns for valid Fortran.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2810 * Abbrev: Fortran Abbrev. Built-in abbrevs for Fortran keywords.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2811 @end menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2812
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2813 @node Fortran Motion
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2814 @section Motion Commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2815
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2816 In addition to the normal commands for moving by and operating on
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2817 ``defuns'' (Fortran subprograms---functions and subroutines, as well as
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2818 modules for F90 mode), Fortran mode provides special commands to move by
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2819 statements and other program units.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2820
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2821 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2822 @kindex C-c C-n @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2823 @findex fortran-next-statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2824 @findex f90-next-statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2825 @item C-c C-n
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2826 Move to the beginning of the next statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2827 (@code{fortran-next-statement}/@code{f90-next-statement}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2828
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2829 @kindex C-c C-p @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2830 @findex fortran-previous-statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2831 @findex f90-previous-statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2832 @item C-c C-p
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2833 Move to the beginning of the previous statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2834 (@code{fortran-previous-statement}/@code{f90-previous-statement}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2835 If there is no previous statement (i.e. if called from the first
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2836 statement in the buffer), move to the start of the buffer.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2837
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2838 @kindex C-c C-e @r{(F90 mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2839 @findex f90-next-block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2840 @item C-c C-e
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2841 Move point forward to the start of the next code block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2842 (@code{f90-next-block}). A code block is a subroutine,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2843 @code{if}--@code{endif} statement, and so forth. This command exists
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2844 for F90 mode only, not Fortran mode. With a numeric argument, this
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2845 moves forward that many blocks.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2846
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2847 @kindex C-c C-a @r{(F90 mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2848 @findex f90-previous-block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2849 @item C-c C-a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2850 Move point backward to the previous code block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2851 (@code{f90-previous-block}). This is like @code{f90-next-block}, but
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2852 moves backwards.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2853
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2854 @kindex C-M-n @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2855 @findex fortran-end-of-block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2856 @findex f90-end-of-block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2857 @item C-M-n
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2858 Move to the end of the current code block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2859 (@code{fortran-end-of-block}/@code{f90-end-of-block}). With a numeric
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2860 agument, move forward that number of blocks. The mark is set before
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2861 moving point. The F90 mode version of this command checks for
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2862 consistency of block types and labels (if present), but it does not
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2863 check the outermost block since that may be incomplete.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2864
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2865 @kindex C-M-p @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2866 @findex fortran-beginning-of-block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2867 @findex f90-beginning-of-block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2868 @item C-M-p
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2869 Move to the start of the current code block
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2870 (@code{fortran-beginning-of-block}/@code{f90-beginning-of-block}). This
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2871 is like @code{fortran-end-of-block}, but moves backwards.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2872 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2873
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2874 @node Fortran Indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2875 @section Fortran Indentation
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2876
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2877 Special commands and features are needed for indenting Fortran code in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2878 order to make sure various syntactic entities (line numbers, comment line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2879 indicators and continuation line flags) appear in the columns that are
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2880 required for standard, fixed (or tab) format Fortran.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2881
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2882 @menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2883 * Commands: ForIndent Commands. Commands for indenting and filling Fortran.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2884 * Contline: ForIndent Cont. How continuation lines indent.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2885 * Numbers: ForIndent Num. How line numbers auto-indent.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2886 * Conv: ForIndent Conv. Conventions you must obey to avoid trouble.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2887 * Vars: ForIndent Vars. Variables controlling Fortran indent style.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2888 @end menu
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2889
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2890 @node ForIndent Commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2891 @subsection Fortran Indentation and Filling Commands
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2892
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2893 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2894 @item C-M-j
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2895 Break the current line at point and set up a continuation line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2896 (@code{fortran-split-line}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2897 @item M-^
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2898 Join this line to the previous line (@code{fortran-join-line}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2899 @item C-M-q
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2900 Indent all the lines of the subprogram point is in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2901 (@code{fortran-indent-subprogram}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2902 @item M-q
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2903 Fill a comment block or statement.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2904 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2905
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2906 @kindex C-M-q @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2907 @findex fortran-indent-subprogram
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2908 The key @kbd{C-M-q} runs @code{fortran-indent-subprogram}, a command
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2909 to reindent all the lines of the Fortran subprogram (function or
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2910 subroutine) containing point.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2911
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2912 @kindex C-M-j @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2913 @findex fortran-split-line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2914 The key @kbd{C-M-j} runs @code{fortran-split-line}, which splits
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2915 a line in the appropriate fashion for Fortran. In a non-comment line,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2916 the second half becomes a continuation line and is indented
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2917 accordingly. In a comment line, both halves become separate comment
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2918 lines.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2919
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2920 @kindex M-^ @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2921 @kindex C-c C-d @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2922 @findex fortran-join-line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2923 @kbd{M-^} or @kbd{C-c C-d} runs the command @code{fortran-join-line},
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2924 which joins a continuation line back to the previous line, roughly as
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2925 the inverse of @code{fortran-split-line}. The point must be on a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2926 continuation line when this command is invoked.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2927
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2928 @kindex M-q @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2929 @kbd{M-q} in Fortran mode fills the comment block or statement that
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2930 point is in. This removes any excess statement continuations.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2931
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2932 @node ForIndent Cont
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2933 @subsection Continuation Lines
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2934 @cindex Fortran continuation lines
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2935
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2936 @vindex fortran-continuation-string
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2937 Most Fortran77 compilers allow two ways of writing continuation lines.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2938 If the first non-space character on a line is in column 5, then that
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2939 line is a continuation of the previous line. We call this @dfn{fixed
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2940 format}. (In GNU Emacs we always count columns from 0; but note that
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2941 the Fortran standard counts from 1.) The variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2942 @code{fortran-continuation-string} specifies what character to put in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2943 column 5. A line that starts with a tab character followed by any digit
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2944 except @samp{0} is also a continuation line. We call this style of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2945 continuation @dfn{tab format}. (Fortran90 introduced ``free format'',
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2946 with another style of continuation lines).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2947
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2948 @vindex indent-tabs-mode @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2949 @vindex fortran-analyze-depth
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2950 @vindex fortran-tab-mode-default
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2951 Fortran mode can use either style of continuation line. When you
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2952 enter Fortran mode, it tries to deduce the proper continuation style
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2953 automatically from the buffer contents. It does this by scanning up to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2954 @code{fortran-analyze-depth} (default 100) lines from the start of the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2955 buffer. The first line that begins with either a tab character or six
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2956 spaces determines the choice. If the scan fails (for example, if the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2957 buffer is new and therefore empty), the value of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2958 @code{fortran-tab-mode-default} (@code{nil} for fixed format, and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2959 non-@code{nil} for tab format) is used. @samp{/t} in the mode line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2960 indicates tab format is selected. Fortran mode sets the value of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2961 @code{indent-tabs-mode} accordingly.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2962
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2963 If the text on a line starts with the Fortran continuation marker
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2964 @samp{$}, or if it begins with any non-whitespace character in column
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2965 5, Fortran mode treats it as a continuation line. When you indent a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2966 continuation line with @key{TAB}, it converts the line to the current
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2967 continuation style. When you split a Fortran statement with
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2968 @kbd{C-M-j}, the continuation marker on the newline is created according
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2969 to the continuation style.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2970
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2971 The setting of continuation style affects several other aspects of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2972 editing in Fortran mode. In fixed format mode, the minimum column
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2973 number for the body of a statement is 6. Lines inside of Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2974 blocks that are indented to larger column numbers always use only the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2975 space character for whitespace. In tab format mode, the minimum
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2976 column number for the statement body is 8, and the whitespace before
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2977 column 8 must always consist of one tab character.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2978
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2979 @node ForIndent Num
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2980 @subsection Line Numbers
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2981
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2982 If a number is the first non-whitespace in the line, Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2983 indentation assumes it is a line number and moves it to columns 0
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2984 through 4. (Columns always count from 0 in GNU Emacs.)
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2985
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2986 @vindex fortran-line-number-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2987 Line numbers of four digits or less are normally indented one space.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2988 The variable @code{fortran-line-number-indent} controls this; it
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2989 specifies the maximum indentation a line number can have. The default
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2990 value of the variable is 1. Fortran mode tries to prevent line number
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2991 digits passing column 4, reducing the indentation below the specified
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2992 maximum if necessary. If @code{fortran-line-number-indent} has the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2993 value 5, line numbers are right-justified to end in column 4.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2994
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2995 @vindex fortran-electric-line-number
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2996 Simply inserting a line number is enough to indent it according to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2997 these rules. As each digit is inserted, the indentation is recomputed.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2998 To turn off this feature, set the variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
2999 @code{fortran-electric-line-number} to @code{nil}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3000
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3001
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3002 @node ForIndent Conv
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3003 @subsection Syntactic Conventions
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3004
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3005 Fortran mode assumes that you follow certain conventions that simplify
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3006 the task of understanding a Fortran program well enough to indent it
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3007 properly:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3008
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3009 @itemize @bullet
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3010 @item
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3011 Two nested @samp{do} loops never share a @samp{continue} statement.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3012
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3013 @item
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3014 Fortran keywords such as @samp{if}, @samp{else}, @samp{then}, @samp{do}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3015 and others are written without embedded whitespace or line breaks.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3016
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3017 Fortran compilers generally ignore whitespace outside of string
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3018 constants, but Fortran mode does not recognize these keywords if they
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3019 are not contiguous. Constructs such as @samp{else if} or @samp{end do}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3020 are acceptable, but the second word should be on the same line as the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3021 first and not on a continuation line.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3022 @end itemize
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3023
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3024 @noindent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3025 If you fail to follow these conventions, the indentation commands may
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3026 indent some lines unaesthetically. However, a correct Fortran program
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3027 retains its meaning when reindented even if the conventions are not
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3028 followed.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3029
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3030 @node ForIndent Vars
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3031 @subsection Variables for Fortran Indentation
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3032
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3033 @vindex fortran-do-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3034 @vindex fortran-if-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3035 @vindex fortran-structure-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3036 @vindex fortran-continuation-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3037 @vindex fortran-check-all-num@dots{}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3038 @vindex fortran-minimum-statement-indent@dots{}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3039 Several additional variables control how Fortran indentation works:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3040
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3041 @table @code
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3042 @item fortran-do-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3043 Extra indentation within each level of @samp{do} statement (default 3).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3044
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3045 @item fortran-if-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3046 Extra indentation within each level of @samp{if}, @samp{select case}, or
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3047 @samp{where} statements (default 3).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3048
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3049 @item fortran-structure-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3050 Extra indentation within each level of @samp{structure}, @samp{union},
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3051 @samp{map}, or @samp{interface} statements (default 3).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3052
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3053 @item fortran-continuation-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3054 Extra indentation for bodies of continuation lines (default 5).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3055
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3056 @item fortran-check-all-num-for-matching-do
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3057 In Fortran77, a numbered @samp{do} statement is ended by any statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3058 with a matching line number. It is common (but not compulsory) to use a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3059 @samp{continue} statement for this purpose. If this variable has a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3060 non-@code{nil} value, indenting any numbered statement must check for a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3061 @samp{do} that ends there. If you always end @samp{do} statements with
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3062 a @samp{continue} line (or if you use the more modern @samp{enddo}),
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3063 then you can speed up indentation by setting this variable to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3064 @code{nil}. The default is @code{nil}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3065
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3066 @item fortran-blink-matching-if
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3067 If this is @code{t}, indenting an @samp{endif} (or @samp{enddo}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3068 statement moves the cursor momentarily to the matching @samp{if} (or
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3069 @samp{do}) statement to show where it is. The default is @code{nil}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3070
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3071 @item fortran-minimum-statement-indent-fixed
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3072 Minimum indentation for Fortran statements when using fixed format
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3073 continuation line style. Statement bodies are never indented less than
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3074 this much. The default is 6.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3075
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3076 @item fortran-minimum-statement-indent-tab
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3077 Minimum indentation for Fortran statements for tab format continuation line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3078 style. Statement bodies are never indented less than this much. The
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3079 default is 8.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3080 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3081
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3082 The variables controlling the indentation of comments are described in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3083 the following section.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3084
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3085 @node Fortran Comments
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3086 @section Fortran Comments
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3087
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3088 The usual Emacs comment commands assume that a comment can follow a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3089 line of code. In Fortran77, the standard comment syntax requires an
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3090 entire line to be just a comment. Therefore, Fortran mode replaces the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3091 standard Emacs comment commands and defines some new variables.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3092
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3093 @vindex fortran-comment-line-start
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3094 Fortran mode can also handle the Fortran90 comment syntax where comments
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3095 start with @samp{!} and can follow other text. Because only some Fortran77
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3096 compilers accept this syntax, Fortran mode will not insert such comments
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3097 unless you have said in advance to do so. To do this, set the variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3098 @code{fortran-comment-line-start} to @samp{"!"}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3099
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3100 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3101 @item M-;
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3102 Align comment or insert new comment (@code{fortran-indent-comment}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3103
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3104 @item C-x ;
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3105 Applies to nonstandard @samp{!} comments only.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3106
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3107 @item C-c ;
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3108 Turn all lines of the region into comments, or (with argument) turn them back
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3109 into real code (@code{fortran-comment-region}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3110 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3111
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3112 @findex fortran-indent-comment
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3113 @kbd{M-;} in Fortran mode is redefined as the command
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3114 @code{fortran-indent-comment}. Like the usual @kbd{M-;} command, this
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3115 recognizes any kind of existing comment and aligns its text appropriately;
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3116 if there is no existing comment, a comment is inserted and aligned. But
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3117 inserting and aligning comments are not the same in Fortran mode as in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3118 other modes.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3119
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3120 When a new comment must be inserted, if the current line is blank, a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3121 full-line comment is inserted. On a non-blank line, a nonstandard @samp{!}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3122 comment is inserted if you have said you want to use them. Otherwise a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3123 full-line comment is inserted on a new line before the current line.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3124
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3125 Nonstandard @samp{!} comments are aligned like comments in other
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3126 languages, but full-line comments are different. In a standard full-line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3127 comment, the comment delimiter itself must always appear in column zero.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3128 What can be aligned is the text within the comment. You can choose from
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3129 three styles of alignment by setting the variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3130 @code{fortran-comment-indent-style} to one of these values:
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3131
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3132 @vindex fortran-comment-indent-style
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3133 @vindex fortran-comment-line-extra-indent
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3134 @table @code
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3135 @item fixed
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3136 Align the text at a fixed column, which is the sum of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3137 @code{fortran-comment-line-extra-indent} and the minimum statement
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3138 indentation. This is the default.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3139
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3140 The minimum statement indentation is
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3141 @code{fortran-minimum-statement-indent-fixed} for fixed format
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3142 continuation line style and @code{fortran-minimum-statement-indent-tab}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3143 for tab format style.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3144
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3145 @item relative
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3146 Align the text as if it were a line of code, but with an additional
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3147 @code{fortran-comment-line-extra-indent} columns of indentation.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3148
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3149 @item nil
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3150 Don't move text in full-line comments automatically.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3151 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3152
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3153 @vindex fortran-comment-indent-char
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3154 In addition, you can specify the character to be used to indent within
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3155 full-line comments by setting the variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3156 @code{fortran-comment-indent-char} to the single-character string you want
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3157 to use.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3158
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3159 @vindex fortran-directive-re
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3160 Compiler directive lines, or preprocessor lines, have much the same
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3161 appearance as comment lines. It is important, though, that such lines
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3162 never be indented at all, no matter what the value of
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3163 @code{fortran-comment-indent-style}. The variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3164 @code{fortran-directive-re} is a regular expression that specifies which
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3165 lines are directives. Matching lines are never indented, and receive
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3166 distinctive font-locking.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3167
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3168 The normal Emacs comment command @kbd{C-x ;} has not been redefined. If
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3169 you use @samp{!} comments, this command can be used with them. Otherwise
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3170 it is useless in Fortran mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3171
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3172 @kindex C-c ; @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3173 @findex fortran-comment-region
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3174 @vindex fortran-comment-region
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3175 The command @kbd{C-c ;} (@code{fortran-comment-region}) turns all the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3176 lines of the region into comments by inserting the string @samp{C$$$} at
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3177 the front of each one. With a numeric argument, it turns the region
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3178 back into live code by deleting @samp{C$$$} from the front of each line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3179 in it. The string used for these comments can be controlled by setting
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3180 the variable @code{fortran-comment-region}. Note that here we have an
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3181 example of a command and a variable with the same name; these two uses
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3182 of the name never conflict because in Lisp and in Emacs it is always
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3183 clear from the context which one is meant.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3184
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3185 @node Fortran Autofill
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3186 @section Auto Fill in Fortran Mode
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3187
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3188 Fortran mode has specialized support for Auto Fill mode, which is a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3189 minor mode that automatically splits statements as you insert them
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3190 when they become too wide. Splitting a statement involves making
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3191 continuation lines using @code{fortran-continuation-string}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3192 (@pxref{ForIndent Cont}). This splitting happens when you type
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3193 @key{SPC}, @key{RET}, or @key{TAB}, and also in the Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3194 indentation commands. You activate Auto Fill in Fortran mode in the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3195 normal way. @xref{Auto Fill,,, emacs, the Emacs Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3196
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3197 @vindex fortran-break-before-delimiters
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3198 Auto Fill breaks lines at spaces or delimiters when the lines get
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3199 longer than the desired width (the value of @code{fill-column}). The
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3200 delimiters (besides whitespace) that Auto Fill can break at are
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3201 @samp{+}, @samp{-}, @samp{/}, @samp{*}, @samp{=}, @samp{<}, @samp{>},
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3202 and @samp{,}. The line break comes after the delimiter if the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3203 variable @code{fortran-break-before-delimiters} is @code{nil}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3204 Otherwise (and by default), the break comes before the delimiter.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3205
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3206 To enable Auto Fill in all Fortran buffers, add
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3207 @code{turn-on-auto-fill} to @code{fortran-mode-hook}. @xref{Hooks,,,
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3208 emacs, the Emacs Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3209
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3210 @node Fortran Columns
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3211 @section Checking Columns in Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3212
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3213 @table @kbd
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3214 @item C-c C-r
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3215 Display a ``column ruler'' momentarily above the current line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3216 (@code{fortran-column-ruler}).
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3217 @item C-c C-w
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3218 Split the current window horizontally temporarily so that it is 72
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3219 columns wide (@code{fortran-window-create-momentarily}). This may
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3220 help you avoid making lines longer than the 72-character limit that
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3221 some Fortran compilers impose.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3222 @item C-u C-c C-w
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3223 Split the current window horizontally so that it is 72 columns wide
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3224 (@code{fortran-window-create}). You can then continue editing.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3225 @item M-x fortran-strip-sequence-nos
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3226 Delete all text in column 72 and beyond.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3227 @end table
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3228
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3229 @kindex C-c C-r @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3230 @findex fortran-column-ruler
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3231 The command @kbd{C-c C-r} (@code{fortran-column-ruler}) shows a column
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3232 ruler momentarily above the current line. The comment ruler is two lines
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3233 of text that show you the locations of columns with special significance in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3234 Fortran programs. Square brackets show the limits of the columns for line
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3235 numbers, and curly brackets show the limits of the columns for the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3236 statement body. Column numbers appear above them.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3237
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3238 Note that the column numbers count from zero, as always in GNU Emacs.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3239 As a result, the numbers may be one less than those you are familiar
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3240 with; but the positions they indicate in the line are standard for
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3241 Fortran.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3242
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3243 @vindex fortran-column-ruler-fixed
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3244 @vindex fortran-column-ruler-tabs
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3245 The text used to display the column ruler depends on the value of the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3246 variable @code{indent-tabs-mode}. If @code{indent-tabs-mode} is
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3247 @code{nil}, then the value of the variable
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3248 @code{fortran-column-ruler-fixed} is used as the column ruler.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3249 Otherwise, the value of the variable @code{fortran-column-ruler-tab} is
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3250 displayed. By changing these variables, you can change the column ruler
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3251 display.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3252
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3253 @kindex C-c C-w @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3254 @findex fortran-window-create-momentarily
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3255 @kbd{C-c C-w} (@code{fortran-window-create-momentarily}) temporarily
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3256 splits the current window horizontally, making a window 72 columns
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3257 wide, so you can see any lines that are too long. Type a space to
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3258 restore the normal width.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3259
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3260 @kindex C-u C-c C-w @r{(Fortran mode)}
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3261 @findex fortran-window-create
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3262 You can also split the window horizontally and continue editing with
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3263 the split in place. To do this, use @kbd{C-u C-c C-w} (@code{M-x
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3264 fortran-window-create}). By editing in this window you can
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3265 immediately see when you make a line too wide to be correct Fortran.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3266
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3267 @findex fortran-strip-sequence-nos
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3268 The command @kbd{M-x fortran-strip-sequence-nos} deletes all text in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3269 column 72 and beyond, on all lines in the current buffer. This is the
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3270 easiest way to get rid of old sequence numbers.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3271
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3272 @node Fortran Abbrev
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3273 @section Fortran Keyword Abbrevs
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3274
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3275 Fortran mode provides many built-in abbrevs for common keywords and
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3276 declarations. These are the same sort of abbrev that you can define
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3277 yourself. To use them, you must turn on Abbrev mode.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3278 @xref{Abbrevs,,, emacs, the Emacs Manual}.
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3279
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3280 The built-in abbrevs are unusual in one way: they all start with a
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3281 semicolon. You cannot normally use semicolon in an abbrev, but Fortran
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3282 mode makes this possible by changing the syntax of semicolon to ``word
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3283 constituent.''
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3284
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3285 For example, one built-in Fortran abbrev is @samp{;c} for
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3286 @samp{continue}. If you insert @samp{;c} and then insert a punctuation
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3287 character such as a space or a newline, the @samp{;c} expands automatically
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3288 to @samp{continue}, provided Abbrev mode is enabled.@refill
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3289
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3290 Type @samp{;?} or @samp{;C-h} to display a list of all the built-in
91970b147f39 * emacs-xtra.texi (Emerge, Picture Mode. Fortran): New chapters,
Chong Yidong <cyd@stupidchicken.com>
parents: 68639
diff changeset
3291 Fortran abbrevs and what they stand for.
61000
7493ddb113fc (Advanced Calendar/Diary Usage): New section; move here from Emacs
Glenn Morris <rgm@gnu.org>
parents: 59996
diff changeset
3292
69898
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3293
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3294 @node MS-DOG
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3295 @chapter Emacs and MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3296 @cindex MS-DOG
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3297 @cindex MS-DOS peculiarities
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3298
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3299 This section briefly describes the peculiarities of using Emacs on
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3300 the MS-DOS ``operating system'' (also known as ``MS-DOG'').
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3301 Information about Emacs and Microsoft's current operating system
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3302 Windows (also known as ``Losedows) is in the main Emacs manual
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3303 (@pxref{Emacs and Microsoft Systems,,, emacs, the Emacs Manual}).
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3304
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3305 If you build Emacs for MS-DOS, the binary will also run on Windows
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3306 3.X, Windows NT, Windows 9X/ME, Windows 2000, or OS/2 as a DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3307 application; all of this chapter applies for all of those systems, if
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3308 you use an Emacs that was built for MS-DOS.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3309
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3310 @xref{Text and Binary,,,emacs, the Emacs Manual}, for information
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3311 about Emacs' special handling of text files under MS-DOS (and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3312 Windows).
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3313
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3314 @menu
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3315 * Keyboard: MS-DOS Keyboard. Keyboard conventions on MS-DOS.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3316 * Mouse: MS-DOS Mouse. Mouse conventions on MS-DOS.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3317 * Display: MS-DOS Display. Fonts, frames and display size on MS-DOS.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3318 * Files: MS-DOS File Names. File name conventions on MS-DOS.
70154
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3319 * Printing: MS-DOS Printing. Printing specifics on MS-DOS.
69898
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3320 * I18N: MS-DOS and MULE. Support for internationalization on MS-DOS.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3321 * Processes: MS-DOS Processes. Running subprocesses on MS-DOS.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3322 @end menu
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3323
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3324 @node MS-DOS Keyboard
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3325 @section Keyboard Usage on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3326
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3327 @kindex DEL @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3328 @kindex BS @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3329 The key that is called @key{DEL} in Emacs (because that's how it is
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3330 designated on most workstations) is known as @key{BS} (backspace) on a
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3331 PC. That is why the PC-specific terminal initialization remaps the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3332 @key{BS} key to act as @key{DEL}; the @key{DELETE} key is remapped to act
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3333 as @kbd{C-d} for the same reasons.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3334
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3335 @kindex C-g @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3336 @kindex C-BREAK @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3337 @cindex quitting on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3338 Emacs built for MS-DOS recognizes @kbd{C-@key{BREAK}} as a quit
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3339 character, just like @kbd{C-g}. This is because Emacs cannot detect
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3340 that you have typed @kbd{C-g} until it is ready for more input. As a
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3341 consequence, you cannot use @kbd{C-g} to stop a running command
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3342 (@pxref{Quitting,,,emacs, the Emacs Manual}). By contrast,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3343 @kbd{C-@key{BREAK}} @emph{is} detected as soon as you type it (as
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3344 @kbd{C-g} is on other systems), so it can be used to stop a running
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3345 command and for emergency escape (@pxref{Emergency Escape,,,emacs, the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3346 Emacs Manual}).
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3347
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3348 @cindex Meta (under MS-DOS)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3349 @cindex Hyper (under MS-DOS)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3350 @cindex Super (under MS-DOS)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3351 @vindex dos-super-key
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3352 @vindex dos-hyper-key
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3353 The PC keyboard maps use the left @key{ALT} key as the @key{META} key.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3354 You have two choices for emulating the @key{SUPER} and @key{HYPER} keys:
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3355 choose either the right @key{CTRL} key or the right @key{ALT} key by
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3356 setting the variables @code{dos-hyper-key} and @code{dos-super-key} to 1
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3357 or 2 respectively. If neither @code{dos-super-key} nor
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3358 @code{dos-hyper-key} is 1, then by default the right @key{ALT} key is
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3359 also mapped to the @key{META} key. However, if the MS-DOS international
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3360 keyboard support program @file{KEYB.COM} is installed, Emacs will
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3361 @emph{not} map the right @key{ALT} to @key{META}, since it is used for
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3362 accessing characters like @kbd{~} and @kbd{@@} on non-US keyboard
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3363 layouts; in this case, you may only use the left @key{ALT} as @key{META}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3364 key.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3365
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3366 @kindex C-j @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3367 @vindex dos-keypad-mode
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3368 The variable @code{dos-keypad-mode} is a flag variable that controls
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3369 what key codes are returned by keys in the numeric keypad. You can also
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3370 define the keypad @key{ENTER} key to act like @kbd{C-j}, by putting the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3371 following line into your @file{_emacs} file:
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3372
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3373 @smallexample
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3374 ;; @r{Make the @key{ENTER} key from the numeric keypad act as @kbd{C-j}.}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3375 (define-key function-key-map [kp-enter] [?\C-j])
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3376 @end smallexample
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3377
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3378 @node MS-DOS Mouse
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3379 @section Mouse Usage on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3380
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3381 @cindex mouse support under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3382 Emacs on MS-DOS supports a mouse (on the default terminal only).
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3383 The mouse commands work as documented, including those that use menus
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3384 and the menu bar (@pxref{Menu Bar,,,emacs, the Emacs Manual}). Scroll
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3385 bars don't work in MS-DOS Emacs. PC mice usually have only two
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3386 buttons; these act as @kbd{Mouse-1} and @kbd{Mouse-2}, but if you
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3387 press both of them together, that has the effect of @kbd{Mouse-3}. If
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3388 the mouse does have 3 buttons, Emacs detects that at startup, and all
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3389 the 3 buttons function normally, as on X.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3390
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3391 Help strings for menu-bar and pop-up menus are displayed in the echo
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3392 area when the mouse pointer moves across the menu items. Highlighting
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3393 of mouse-sensitive text (@pxref{Mouse References,,,emacs, the Emacs
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3394 Manual}) is also supported.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3395
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3396 @cindex mouse, set number of buttons
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3397 @findex msdos-set-mouse-buttons
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3398 Some versions of mouse drivers don't report the number of mouse
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3399 buttons correctly. For example, mice with a wheel report that they
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3400 have 3 buttons, but only 2 of them are passed to Emacs; the clicks on
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3401 the wheel, which serves as the middle button, are not passed. In
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3402 these cases, you can use the @kbd{M-x msdos-set-mouse-buttons} command
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3403 to tell Emacs how many mouse buttons to expect. You could make such a
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3404 setting permanent by adding this fragment to your @file{_emacs} init
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3405 file:
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3406
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3407 @example
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3408 ;; @r{Treat the mouse like a 2-button mouse.}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3409 (msdos-set-mouse-buttons 2)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3410 @end example
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3411
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3412 @cindex Windows clipboard support
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3413 Emacs built for MS-DOS supports clipboard operations when it runs on
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3414 Windows. Commands that put text on the kill ring, or yank text from
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3415 the ring, check the Windows clipboard first, just as Emacs does on the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3416 X Window System (@pxref{Mouse Commands,,,emacs, the Emacs Manual}).
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3417 Only the primary selection and the cut buffer are supported by MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3418 Emacs on Windows; the secondary selection always appears as empty.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3419
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3420 Due to the way clipboard access is implemented by Windows, the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3421 length of text you can put into the clipboard is limited by the amount
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3422 of free DOS memory that is available to Emacs. Usually, up to 620KB of
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3423 text can be put into the clipboard, but this limit depends on the system
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3424 configuration and is lower if you run Emacs as a subprocess of
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3425 another program. If the killed text does not fit, Emacs outputs a
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3426 message saying so, and does not put the text into the clipboard.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3427
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3428 Null characters also cannot be put into the Windows clipboard. If the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3429 killed text includes null characters, Emacs does not put such text into
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3430 the clipboard, and displays in the echo area a message to that effect.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3431
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3432 @vindex dos-display-scancodes
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3433 The variable @code{dos-display-scancodes}, when non-@code{nil},
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3434 directs Emacs to display the @acronym{ASCII} value and the keyboard scan code of
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3435 each keystroke; this feature serves as a complement to the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3436 @code{view-lossage} command, for debugging.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3437
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3438 @node MS-DOS Display
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3439 @section Display on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3440 @cindex faces under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3441 @cindex fonts, emulating under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3442
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3443 Display on MS-DOS cannot use font variants, like bold or italic, but
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3444 it does support multiple faces, each of which can specify a foreground
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3445 and a background color. Therefore, you can get the full functionality
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3446 of Emacs packages that use fonts (such as @code{font-lock}, Enriched
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3447 Text mode, and others) by defining the relevant faces to use different
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3448 colors. Use the @code{list-colors-display} command (@pxref{Frame
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3449 Parameters,,,emacs, the Emacs Manual}) and the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3450 @code{list-faces-display} command (@pxref{Faces,,,emacs, the Emacs
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3451 Manual}) to see what colors and faces are available and what they look
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3452 like.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3453
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3454 @xref{MS-DOS and MULE}, later in this chapter, for information on
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3455 how Emacs displays glyphs and characters that aren't supported by the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3456 native font built into the DOS display.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3457
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3458 @cindex cursor shape on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3459 When Emacs starts, it changes the cursor shape to a solid box. This
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3460 is for compatibility with other systems, where the box cursor is the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3461 default in Emacs. This default shape can be changed to a bar by
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3462 specifying the @code{cursor-type} parameter in the variable
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3463 @code{default-frame-alist} (@pxref{Creating Frames,,,emacs, the Emacs
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3464 Manual}). The MS-DOS terminal doesn't support a vertical-bar cursor,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3465 so the bar cursor is horizontal, and the @code{@var{width}} parameter,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3466 if specified by the frame parameters, actually determines its height.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3467 For this reason, the @code{bar} and @code{hbar} cursor types produce
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3468 the same effect on MS-DOS. As an extension, the bar cursor
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3469 specification can include the starting scan line of the cursor as well
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3470 as its width, like this:
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3471
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3472 @example
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3473 '(cursor-type bar @var{width} . @var{start})
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3474 @end example
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3475
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3476 @noindent
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3477 In addition, if the @var{width} parameter is negative, the cursor bar
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3478 begins at the top of the character cell.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3479
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3480 @cindex frames on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3481 The MS-DOS terminal can only display a single frame at a time. The
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3482 Emacs frame facilities work on MS-DOS much as they do on text-only
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3483 terminals (@pxref{Frames,,,emacs, the Emacs Manual}). When you run
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3484 Emacs from a DOS window on MS-Windows, you can make the visible frame
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3485 smaller than the full screen, but Emacs still cannot display more than
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3486 a single frame at a time.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3487
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3488 @cindex frame size under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3489 @findex mode4350
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3490 @findex mode25
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3491 The @code{mode4350} command switches the display to 43 or 50
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3492 lines, depending on your hardware; the @code{mode25} command switches
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3493 to the default 80x25 screen size.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3494
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3495 By default, Emacs only knows how to set screen sizes of 80 columns by
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3496 25, 28, 35, 40, 43 or 50 rows. However, if your video adapter has
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3497 special video modes that will switch the display to other sizes, you can
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3498 have Emacs support those too. When you ask Emacs to switch the frame to
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3499 @var{n} rows by @var{m} columns dimensions, it checks if there is a
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3500 variable called @code{screen-dimensions-@var{n}x@var{m}}, and if so,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3501 uses its value (which must be an integer) as the video mode to switch
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3502 to. (Emacs switches to that video mode by calling the BIOS @code{Set
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3503 Video Mode} function with the value of
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3504 @code{screen-dimensions-@var{n}x@var{m}} in the @code{AL} register.)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3505 For example, suppose your adapter will switch to 66x80 dimensions when
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3506 put into video mode 85. Then you can make Emacs support this screen
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3507 size by putting the following into your @file{_emacs} file:
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3508
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3509 @example
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3510 (setq screen-dimensions-66x80 85)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3511 @end example
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3512
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3513 Since Emacs on MS-DOS can only set the frame size to specific
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3514 supported dimensions, it cannot honor every possible frame resizing
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3515 request. When an unsupported size is requested, Emacs chooses the next
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3516 larger supported size beyond the specified size. For example, if you
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3517 ask for 36x80 frame, you will get 40x80 instead.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3518
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3519 The variables @code{screen-dimensions-@var{n}x@var{m}} are used only
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3520 when they exactly match the specified size; the search for the next
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3521 larger supported size ignores them. In the above example, even if your
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3522 VGA supports 38x80 dimensions and you define a variable
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3523 @code{screen-dimensions-38x80} with a suitable value, you will still get
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3524 40x80 screen when you ask for a 36x80 frame. If you want to get the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3525 38x80 size in this case, you can do it by setting the variable named
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3526 @code{screen-dimensions-36x80} with the same video mode value as
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3527 @code{screen-dimensions-38x80}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3528
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3529 Changing frame dimensions on MS-DOS has the effect of changing all the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3530 other frames to the new dimensions.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3531
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3532 @node MS-DOS File Names
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3533 @section File Names on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3534 @cindex file names under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3535 @cindex init file, default name under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3536
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3537 On MS-DOS, file names are case-insensitive and limited to eight
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3538 characters, plus optionally a period and three more characters. Emacs
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3539 knows enough about these limitations to handle file names that were
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3540 meant for other operating systems. For instance, leading dots
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3541 @samp{.} in file names are invalid in MS-DOS, so Emacs transparently
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3542 converts them to underscores @samp{_}; thus your default init file
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3543 (@pxref{Init File,,,emacs, the Emacs Manual}) is called @file{_emacs}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3544 on MS-DOS. Excess characters before or after the period are generally
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3545 ignored by MS-DOS itself; thus, if you visit the file
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3546 @file{LongFileName.EvenLongerExtension}, you will silently get
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3547 @file{longfile.eve}, but Emacs will still display the long file name
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3548 on the mode line. Other than that, it's up to you to specify file
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3549 names which are valid under MS-DOS; the transparent conversion as
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3550 described above only works on file names built into Emacs.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3551
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3552 @cindex backup file names on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3553 The above restrictions on the file names on MS-DOS make it almost
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3554 impossible to construct the name of a backup file (@pxref{Backup
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3555 Names,,,emacs, the Emacs Manual}) without losing some of the original
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3556 file name characters. For example, the name of a backup file for
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3557 @file{docs.txt} is @file{docs.tx~} even if single backup is used.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3558
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3559 @cindex file names under Windows 95/NT
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3560 @cindex long file names in DOS box under Windows 95/NT
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3561 If you run Emacs as a DOS application under Windows 9X, Windows ME, or
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3562 Windows 2000, you can turn on support for long file names. If you do
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3563 that, Emacs doesn't truncate file names or convert them to lower case;
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3564 instead, it uses the file names that you specify, verbatim. To enable
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3565 long file name support, set the environment variable @env{LFN} to
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3566 @samp{y} before starting Emacs. Unfortunately, Windows NT doesn't allow
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3567 DOS programs to access long file names, so Emacs built for MS-DOS will
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3568 only see their short 8+3 aliases.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3569
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3570 @cindex @env{HOME} directory under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3571 MS-DOS has no notion of home directory, so Emacs on MS-DOS pretends
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3572 that the directory where it is installed is the value of the @env{HOME}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3573 environment variable. That is, if your Emacs binary,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3574 @file{emacs.exe}, is in the directory @file{c:/utils/emacs/bin}, then
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3575 Emacs acts as if @env{HOME} were set to @samp{c:/utils/emacs}. In
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3576 particular, that is where Emacs looks for the init file @file{_emacs}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3577 With this in mind, you can use @samp{~} in file names as an alias for
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3578 the home directory, as you would on GNU or Unix. You can also set
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3579 @env{HOME} variable in the environment before starting Emacs; its
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3580 value will then override the above default behavior.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3581
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3582 Emacs on MS-DOS handles the directory name @file{/dev} specially,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3583 because of a feature in the emulator libraries of DJGPP that pretends
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3584 I/O devices have names in that directory. We recommend that you avoid
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3585 using an actual directory named @file{/dev} on any disk.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3586
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3587 @node MS-DOS Printing
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3588 @section Printing and MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3589
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3590 Printing commands, such as @code{lpr-buffer}
70154
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3591 (@pxref{Printing,,,emacs, the Emacs Manual}) and
69898
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3592 @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual})
70154
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3593 can work on MS-DOS by sending the output to one of the printer ports,
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3594 if a Posix-style @code{lpr} program is unavailable. The same Emacs
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3595 variables control printing on all systems, but in some cases they have
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3596 different default values on MS-DOS.
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3597
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3598 @xref{MS-Windows Printing,,,emacs, the Emacs Manual}, for details.
69898
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3599
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3600 Some printers expect DOS codepage encoding of non-@acronym{ASCII} text, even
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3601 though they are connected to a Windows machine which uses a different
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3602 encoding for the same locale. For example, in the Latin-1 locale, DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3603 uses codepage 850 whereas Windows uses codepage 1252. @xref{MS-DOS and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3604 MULE}. When you print to such printers from Windows, you can use the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3605 @kbd{C-x RET c} (@code{universal-coding-system-argument}) command before
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3606 @kbd{M-x lpr-buffer}; Emacs will then convert the text to the DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3607 codepage that you specify. For example, @kbd{C-x RET c cp850-dos RET
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3608 M-x lpr-region RET} will print the region while converting it to the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3609 codepage 850 encoding. You may need to create the @code{cp@var{nnn}}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3610 coding system with @kbd{M-x codepage-setup}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3611
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3612 @vindex dos-printer
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3613 @vindex dos-ps-printer
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3614 For backwards compatibility, the value of @code{dos-printer}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3615 (@code{dos-ps-printer}), if it has a value, overrides the value of
70154
ab05f8713897 (MS-DOS File Names): Remove section about backslashes and case-insensitivity
Eli Zaretskii <eliz@gnu.org>
parents: 69945
diff changeset
3616 @code{printer-name} (@code{ps-printer-name}), on MS-DOS.
69898
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3617
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3618
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3619 @node MS-DOS and MULE
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3620 @section International Support on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3621 @cindex international support @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3622
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3623 Emacs on MS-DOS supports the same international character sets as it
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3624 does on GNU, Unix and other platforms (@pxref{International,,,emacs,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3625 the Emacs Manual}), including coding systems for converting between
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3626 the different character sets. However, due to incompatibilities
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3627 between MS-DOS/MS-Windows and other systems, there are several
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3628 DOS-specific aspects of this support that you should be aware of.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3629 This section describes these aspects.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3630
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3631 The description below is largely specific to the MS-DOS port of
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3632 Emacs, especially where it talks about practical implications for
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3633 Emacs users. For other operating systems, see the @file{code-pages.el}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3634 package, which implements support for MS-DOS- and MS-Windows-specific
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3635 encodings for all platforms other than MS-DOS.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3636
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3637 @table @kbd
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3638 @item M-x dos-codepage-setup
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3639 Set up Emacs display and coding systems as appropriate for the current
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3640 DOS codepage.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3641
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3642 @item M-x codepage-setup
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3643 Create a coding system for a certain DOS codepage.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3644 @end table
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3645
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3646 @cindex codepage, MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3647 @cindex DOS codepages
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3648 MS-DOS is designed to support one character set of 256 characters at
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3649 any given time, but gives you a variety of character sets to choose
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3650 from. The alternative character sets are known as @dfn{DOS codepages}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3651 Each codepage includes all 128 @acronym{ASCII} characters, but the other 128
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3652 characters (codes 128 through 255) vary from one codepage to another.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3653 Each DOS codepage is identified by a 3-digit number, such as 850, 862,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3654 etc.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3655
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3656 In contrast to X, which lets you use several fonts at the same time,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3657 MS-DOS normally doesn't allow use of several codepages in a single
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3658 session. MS-DOS was designed to load a single codepage at system
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3659 startup, and require you to reboot in order to change
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3660 it@footnote{Normally, one particular codepage is burnt into the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3661 display memory, while other codepages can be installed by modifying
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3662 system configuration files, such as @file{CONFIG.SYS}, and rebooting.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3663 While there is third-party software that allows changing the codepage
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3664 without rebooting, we describe here how a stock MS-DOS system
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3665 behaves.}. Much the same limitation applies when you run DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3666 executables on other systems such as MS-Windows.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3667
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3668 @cindex unibyte operation @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3669 If you invoke Emacs on MS-DOS with the @samp{--unibyte} option
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3670 (@pxref{Initial Options,,,emacs, the Emacs Manual}), Emacs does not
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3671 perform any conversion of non-@acronym{ASCII} characters. Instead, it
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3672 reads and writes any non-@acronym{ASCII} characters verbatim, and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3673 sends their 8-bit codes to the display verbatim. Thus, unibyte Emacs
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3674 on MS-DOS supports the current codepage, whatever it may be, but
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3675 cannot even represent any other characters.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3676
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3677 @vindex dos-codepage
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3678 For multibyte operation on MS-DOS, Emacs needs to know which
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3679 characters the chosen DOS codepage can display. So it queries the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3680 system shortly after startup to get the chosen codepage number, and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3681 stores the number in the variable @code{dos-codepage}. Some systems
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3682 return the default value 437 for the current codepage, even though the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3683 actual codepage is different. (This typically happens when you use the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3684 codepage built into the display hardware.) You can specify a different
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3685 codepage for Emacs to use by setting the variable @code{dos-codepage} in
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3686 your init file.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3687
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3688 @cindex language environment, automatic selection on @r{MS-DOS}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3689 Multibyte Emacs supports only certain DOS codepages: those which can
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3690 display Far-Eastern scripts, like the Japanese codepage 932, and those
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3691 that encode a single ISO 8859 character set.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3692
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3693 The Far-Eastern codepages can directly display one of the MULE
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3694 character sets for these countries, so Emacs simply sets up to use the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3695 appropriate terminal coding system that is supported by the codepage.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3696 The special features described in the rest of this section mostly
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3697 pertain to codepages that encode ISO 8859 character sets.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3698
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3699 For the codepages which correspond to one of the ISO character sets,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3700 Emacs knows the character set name based on the codepage number. Emacs
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3701 automatically creates a coding system to support reading and writing
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3702 files that use the current codepage, and uses this coding system by
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3703 default. The name of this coding system is @code{cp@var{nnn}}, where
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3704 @var{nnn} is the codepage number.@footnote{The standard Emacs coding
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3705 systems for ISO 8859 are not quite right for the purpose, because
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3706 typically the DOS codepage does not match the standard ISO character
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3707 codes. For example, the letter @samp{@,{c}} (@samp{c} with cedilla) has
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3708 code 231 in the standard Latin-1 character set, but the corresponding
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3709 DOS codepage 850 uses code 135 for this glyph.}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3710
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3711 @cindex mode line @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3712 All the @code{cp@var{nnn}} coding systems use the letter @samp{D}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3713 (for ``DOS'') as their mode-line mnemonic. Since both the terminal
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3714 coding system and the default coding system for file I/O are set to
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3715 the proper @code{cp@var{nnn}} coding system at startup, it is normal
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3716 for the mode line on MS-DOS to begin with @samp{-DD\-}. @xref{Mode
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3717 Line,,,emacs, the Emacs Manual}. Far-Eastern DOS terminals do not use
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3718 the @code{cp@var{nnn}} coding systems, and thus their initial mode
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3719 line looks like the Emacs default.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3720
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3721 Since the codepage number also indicates which script you are using,
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3722 Emacs automatically runs @code{set-language-environment} to select the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3723 language environment for that script (@pxref{Language
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3724 Environments,,,emacs, the Emacs Manual}).
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3725
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3726 If a buffer contains a character belonging to some other ISO 8859
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3727 character set, not the one that the chosen DOS codepage supports, Emacs
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3728 displays it using a sequence of @acronym{ASCII} characters. For example, if the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3729 current codepage doesn't have a glyph for the letter @samp{@`o} (small
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3730 @samp{o} with a grave accent), it is displayed as @samp{@{`o@}}, where
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3731 the braces serve as a visual indication that this is a single character.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3732 (This may look awkward for some non-Latin characters, such as those from
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3733 Greek or Hebrew alphabets, but it is still readable by a person who
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3734 knows the language.) Even though the character may occupy several
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3735 columns on the screen, it is really still just a single character, and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3736 all Emacs commands treat it as one.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3737
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3738 @cindex IBM graphics characters (MS-DOS)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3739 @cindex box-drawing characters (MS-DOS)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3740 @cindex line-drawing characters (MS-DOS)
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3741 Not all characters in DOS codepages correspond to ISO 8859
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3742 characters---some are used for other purposes, such as box-drawing
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3743 characters and other graphics. Emacs maps these characters to two
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3744 special character sets called @code{eight-bit-control} and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3745 @code{eight-bit-graphic}, and displays them as their IBM glyphs.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3746 However, you should be aware that other systems might display these
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3747 characters differently, so you should avoid them in text that might be
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3748 copied to a different operating system, or even to another DOS machine
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3749 that uses a different codepage.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3750
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3751 @vindex dos-unsupported-character-glyph
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3752 Emacs supports many other characters sets aside from ISO 8859, but it
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3753 cannot display them on MS-DOS. So if one of these multibyte characters
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3754 appears in a buffer, Emacs on MS-DOS displays them as specified by the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3755 @code{dos-unsupported-character-glyph} variable; by default, this glyph
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3756 is an empty triangle. Use the @kbd{C-u C-x =} command to display the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3757 actual code and character set of such characters. @xref{Position
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3758 Info,,,emacs, the Emacs Manual}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3759
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3760 @findex codepage-setup
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3761 By default, Emacs defines a coding system to support the current
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3762 codepage. To define a coding system for some other codepage (e.g., to
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3763 visit a file written on a DOS machine in another country), use the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3764 @kbd{M-x codepage-setup} command. It prompts for the 3-digit code of
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3765 the codepage, with completion, then creates the coding system for the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3766 specified codepage. You can then use the new coding system to read and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3767 write files, but you must specify it explicitly for the file command
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3768 when you want to use it (@pxref{Text Coding,,,emacs, the Emacs Manual}).
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3769
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3770 These coding systems are also useful for visiting a file encoded using
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3771 a DOS codepage, using Emacs running on some other operating system.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3772
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3773 @cindex MS-Windows codepages
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3774 MS-Windows provides its own codepages, which are different from the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3775 DOS codepages for the same locale. For example, DOS codepage 850
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3776 supports the same character set as Windows codepage 1252; DOS codepage
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3777 855 supports the same character set as Windows codepage 1251, etc.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3778 The MS-Windows version of Emacs uses the current codepage for display
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3779 when invoked with the @samp{-nw} option. Support for codepages in the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3780 Windows port of Emacs is part of the @file{code-pages.el} package.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3781
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3782 @node MS-DOS Processes
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3783 @section Subprocesses on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3784
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3785 @cindex compilation under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3786 @cindex inferior processes under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3787 @findex compile @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3788 @findex grep @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3789 Because MS-DOS is a single-process ``operating system,''
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3790 asynchronous subprocesses are not available. In particular, Shell
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3791 mode and its variants do not work. Most Emacs features that use
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3792 asynchronous subprocesses also don't work on MS-DOS, including
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3793 Shell mode and GUD. When in doubt, try and see; commands that
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3794 don't work output an error message saying that asynchronous processes
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3795 aren't supported.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3796
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3797 Compilation under Emacs with @kbd{M-x compile}, searching files with
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3798 @kbd{M-x grep} and displaying differences between files with @kbd{M-x
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3799 diff} do work, by running the inferior processes synchronously. This
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3800 means you cannot do any more editing until the inferior process
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3801 finishes.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3802
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3803 Spell checking also works, by means of special support for synchronous
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3804 invocation of the @code{ispell} program. This is slower than the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3805 asynchronous invocation on other platforms
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3806
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3807 Instead of the Shell mode, which doesn't work on MS-DOS, you can use
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3808 the @kbd{M-x eshell} command. This invokes the Eshell package that
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3809 implements a Posix-like shell entirely in Emacs Lisp.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3810
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3811 By contrast, Emacs compiled as a native Windows application
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3812 @strong{does} support asynchronous subprocesses. @xref{Windows
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3813 Processes,,,emacs, the Emacs Manual}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3814
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3815 @cindex printing under MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3816 Printing commands, such as @code{lpr-buffer}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3817 (@pxref{Printing,,,emacs, the Emacs Manual}) and
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3818 @code{ps-print-buffer} (@pxref{PostScript,,,emacs, the Emacs Manual}),
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3819 work in MS-DOS by sending the output to one of the printer ports.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3820 @xref{MS-DOS Printing,,,emacs, the Emacs Manual}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3821
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3822 When you run a subprocess synchronously on MS-DOS, make sure the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3823 program terminates and does not try to read keyboard input. If the
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3824 program does not terminate on its own, you will be unable to terminate
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3825 it, because MS-DOS provides no general way to terminate a process.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3826 Pressing @kbd{C-c} or @kbd{C-@key{BREAK}} might sometimes help in these
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3827 cases.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3828
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3829 Accessing files on other machines is not supported on MS-DOS. Other
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3830 network-oriented commands such as sending mail, Web browsing, remote
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3831 login, etc., don't work either, unless network access is built into
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3832 MS-DOS with some network redirector.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3833
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3834 @cindex directory listing on MS-DOS
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3835 @vindex dired-listing-switches @r{(MS-DOS)}
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3836 Dired on MS-DOS uses the @code{ls-lisp} package where other
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3837 platforms use the system @code{ls} command. Therefore, Dired on
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3838 MS-DOS supports only some of the possible options you can mention in
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3839 the @code{dired-listing-switches} variable. The options that work are
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3840 @samp{-A}, @samp{-a}, @samp{-c}, @samp{-i}, @samp{-r}, @samp{-S},
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3841 @samp{-s}, @samp{-t}, and @samp{-u}.
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3842
601830ae280c move MS-DOS material to emacs-xtra.texi
Karl Berry <karl@gnu.org>
parents: 69681
diff changeset
3843
56119
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3844 @node Index
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3845 @unnumbered Index
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3846
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3847 @printindex cp
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3848
23a626038a46 New file.
Luc Teirlinck <teirllm@auburn.edu>
parents:
diff changeset
3849 @bye
56131
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
3850
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
3851 @ignore
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
3852 arch-tag: 75c33f13-32c6-41b6-9537-847a312e2e49
0806d31e3c9c Changes from arch/CVS synchronization
Miles Bader <miles@gnu.org>
parents: 56128
diff changeset
3853 @end ignore