comparison man/faq.texi @ 34741:13240ff7920b

Many changes to make it consistent with Emacs 21.
author Eli Zaretskii <eliz@gnu.org>
date Wed, 20 Dec 2000 14:22:27 +0000
parents 33df9c2e70bf
children 962646fc3a58
comparison
equal deleted inserted replaced
34740:dcaa1969ddf8 34741:13240ff7920b
3 @setfilename ../info/efaq 3 @setfilename ../info/efaq
4 @settitle GNU Emacs FAQ 4 @settitle GNU Emacs FAQ
5 @c %**end of header 5 @c %**end of header
6 6
7 @setchapternewpage odd 7 @setchapternewpage odd
8
9 @c This is used in many places
10 @set VER 21.1
8 11
9 @c The @ifinfo stuff only appears in the Info version 12 @c The @ifinfo stuff only appears in the Info version
10 @ifinfo 13 @ifinfo
11 @dircategory Emacs 14 @dircategory Emacs
12 @direntry 15 @direntry
13 * Emacs FAQ: (efaq). Frequently Asked Questions about Emacs. 16 * Emacs FAQ: (efaq). Frequently Asked Questions about Emacs.
14 @end direntry 17 @end direntry
15 18
16 Copyright 1994,1995,1996,1997,1998,1999 Reuven M. Lerner@* 19 Copyright 1994,1995,1996,1997,1998,1999,2000 Reuven M. Lerner@*
17 Copyright 1992,1993 Steven Byrnes@* 20 Copyright 1992,1993 Steven Byrnes@*
18 Copyright 1990,1991,1992 Joseph Brian Wells@* 21 Copyright 1990,1991,1992 Joseph Brian Wells@*
19 22
20 This list of frequently asked questions about GNU Emacs with answers 23 This list of frequently asked questions about GNU Emacs with answers
21 ("FAQ") may be translated into other languages, transformed into other 24 ("FAQ") may be translated into other languages, transformed into other
42 @center @titlefont{GNU Emacs FAQ} 45 @center @titlefont{GNU Emacs FAQ}
43 46
44 @c The following two commands start the copyright page. 47 @c The following two commands start the copyright page.
45 @page 48 @page
46 @vskip 0pt plus 1filll 49 @vskip 0pt plus 1filll
47 Copyright @copyright{} 1994,1995,1996,1997,1998,1999 Reuven M. Lerner@* 50 Copyright @copyright{} 1994,1995,1996,1997,1998,1999,2000 Reuven M. Lerner@*
48 Copyright @copyright{} 1992,1993 Steven Byrnes@* 51 Copyright @copyright{} 1992,1993 Steven Byrnes@*
49 Copyright @copyright{} 1990,1991,1992 Joseph Brian Wells@* 52 Copyright @copyright{} 1990,1991,1992 Joseph Brian Wells@*
50 53
51 This list of frequently asked questions about GNU Emacs with answers 54 This list of frequently asked questions about GNU Emacs with answers
52 ("FAQ") may be translated into other languages, transformed into other 55 ("FAQ") may be translated into other languages, transformed into other
68 71
69 @node Top, FAQ notation, (dir), (dir) 72 @node Top, FAQ notation, (dir), (dir)
70 73
71 This is the GNU Emacs FAQ, last updated on @today{}. 74 This is the GNU Emacs FAQ, last updated on @today{}.
72 75
73 The FAQ is slowly but surely being turned into a Texinfo document, 76 The FAQ is maintained as a Texinfo document, allowing us to create HTML,
74 allowing us to create HTML, Info, and TeX documents from a single source 77 Info, and TeX documents from a single source file, and is slowly but
75 file. Please bear with us as we improve on this format. If you have 78 surely being improved. Please bear with us as we improve on this
76 any suggestions or questions, please contact 79 format. If you have any suggestions or questions, please contact
77 @email{emacs-faq@@lerner.co.il, the FAQ maintainers}. 80 @email{emacs-faq@@lerner.co.il, the FAQ maintainers}.
78 81
79 @menu 82 @menu
80 * FAQ notation:: 83 * FAQ notation::
81 * General questions:: 84 * General questions::
95 @c ------------------------------------------------------------ 98 @c ------------------------------------------------------------
96 @node FAQ notation, General questions, Top, Top 99 @node FAQ notation, General questions, Top, Top
97 @chapter FAQ notation 100 @chapter FAQ notation
98 @cindex FAQ notation 101 @cindex FAQ notation
99 102
100 This section describes notation used in the GNU Emacs FAQ, as well as in 103 This chapter describes notation used in the GNU Emacs FAQ, as well as in
101 the Emacs documentation. Consult this section if this is the first time 104 the Emacs documentation. Consult this section if this is the first time
102 you are reading the FAQ, or if you are confused by notation or terms 105 you are reading the FAQ, or if you are confused by notation or terms
103 used in the FAQ. 106 used in the FAQ.
104 107
105 @menu 108 @menu
113 @node Basic keys, Extended commands, FAQ notation, FAQ notation 116 @node Basic keys, Extended commands, FAQ notation, FAQ notation
114 @section What do these mean: @kbd{C-h}, @kbd{M-C-a}, @key{RET}, @kbd{@key{ESC} a}, etc.? 117 @section What do these mean: @kbd{C-h}, @kbd{M-C-a}, @key{RET}, @kbd{@key{ESC} a}, etc.?
115 @cindex Basic keys 118 @cindex Basic keys
116 @cindex Control key, notation for 119 @cindex Control key, notation for
117 @cindex @key{Meta} key, notation for 120 @cindex @key{Meta} key, notation for
118 @cindex Control-meta characters, notation for 121 @cindex Control-Meta characters, notation for
119 @cindex @kbd{C-h}, definition of 122 @cindex @kbd{C-h}, definition of
120 @cindex @kbd{M-C-h}, definition of 123 @cindex @kbd{M-C-h}, definition of
121 @cindex @key{DEL}, definition of 124 @cindex @key{DEL}, definition of
122 @cindex @key{ESC}, definition of 125 @cindex @key{ESC}, definition of
123 @cindex @key{LFD}, definition of 126 @cindex @key{LFD}, definition of
124 @cindex @key{RET}, definition of 127 @cindex @key{RET}, definition of
125 @cindex @key{SPC}, definition of 128 @cindex @key{SPC}, definition of
126 @cindex @key{TAB}, definition of 129 @cindex @key{TAB}, definition of
130 @cindex Notation for keys
127 131
128 @itemize @bullet 132 @itemize @bullet
129 133
130 @item 134 @item
131 @kbd{C-x}: press the @key{x} key while holding down the @key{Control} key 135 @kbd{C-x}: press the @key{x} key while holding down the @key{Control} key
132 136
133 @item 137 @item
134 @kbd{M-x}: press the @key{x} key while holding down the @key{Meta} key 138 @kbd{M-x}: press the @key{x} key while holding down the @key{Meta} key
135 (if your computer doesn't have a @key{Meta} key, see @pxref{No Meta key}) 139 (if your computer doesn't have a @key{Meta} key, @pxref{No Meta key})
136 140
137 @item 141 @item
138 @kbd{M-C-x}: press the @key{x} key while holding down both @key{Control} 142 @kbd{M-C-x}: press the @key{x} key while holding down both @key{Control}
139 and @key{Meta} 143 and @key{Meta}
140 144
146 150
147 @item 151 @item
148 @key{RET}: @key{Return}, sometimes marked @key{Enter}; same as @kbd{C-m} 152 @key{RET}: @key{Return}, sometimes marked @key{Enter}; same as @kbd{C-m}
149 153
150 @item 154 @item
151 @key{DEL}: @key{Delete}, usually not the same as @key{Backspace}; same 155 @key{DEL}: @key{Delete}, usually @strong{not} the same as
152 as @kbd{C-?} (@pxref{Backspace invokes help} if deleting invokes Emacs help) 156 @key{Backspace}; same as @kbd{C-?} (see @ref{Backspace invokes help}, if
157 deleting invokes Emacs help)
153 158
154 @item 159 @item
155 @key{ESC}: Escape; same as @kbd{C-[} 160 @key{ESC}: Escape; same as @kbd{C-[}
156 161
157 @item 162 @item
161 @key{SPC}: Space bar 166 @key{SPC}: Space bar
162 167
163 @end itemize 168 @end itemize
164 169
165 Key sequences longer than one key (and some single-key sequences) are 170 Key sequences longer than one key (and some single-key sequences) are
166 inside double quotes or on lines by themselves. Any real spaces in such 171 written inside quotes or on lines by themselves, like this:
167 a key sequence should be ignored; only @key{SPC} really means press the 172
168 space key. 173 @display
174 @kbd{M-x frobnicate-while-foo RET}
175 @end display
176
177 @noindent
178 Any real spaces in such a key sequence should be ignored; only @key{SPC}
179 really means press the space key.
169 180
170 The ASCII code sent by @kbd{C-x} (except for @kbd{C-?}) is the value 181 The ASCII code sent by @kbd{C-x} (except for @kbd{C-?}) is the value
171 that would be sent by pressing just @key{x} minus 96 (or 64 for 182 that would be sent by pressing just @key{x} minus 96 (or 64 for
172 uppercase @key{X}) and will be from 0 to 31. The ASCII code sent by 183 uppercase @key{X}) and will be from 0 to 31. On Unix and GNU/Linux
173 @kbd{M-x} is the sum of 128 and the ASCII code that would be sent by 184 terminals, the ASCII code sent by @kbd{M-x} is the sum of 128 and the
174 pressing just @key{x}. Essentially, @key{Control} turns off bits 5 and 185 ASCII code that would be sent by pressing just @key{x}. Essentially,
175 6 and @key{Meta} turns on bit 7. 186 @key{Control} turns off bits 5 and 6 and @key{Meta} turns on bit
187 7@footnote{
188 DOS and Windows terminals don't set bit 7 when the @key{Meta} key is
189 pressed.}.
176 190
177 @kbd{C-?} (aka @key{DEL}) is ASCII code 127. It is a misnomer to call 191 @kbd{C-?} (aka @key{DEL}) is ASCII code 127. It is a misnomer to call
178 @kbd{C-?} a "control" key, since 127 has both bits 5 and 6 turned ON. 192 @kbd{C-?} a ``control'' key, since 127 has both bits 5 and 6 turned ON.
179 Also, on very few keyboards does @kbd{C-?} generate ASCII code 127. 193 Also, on very few keyboards does @kbd{C-?} generate ASCII code 127.
180 194
181 @inforef{Characters, Characters, emacs} and @inforef{Keys, Keys, emacs} 195 @inforef{Characters, Characters, emacs}, and @inforef{Keys, Keys, emacs},
182 for more information. (@pxref{On-line manual} for more information about 196 for more information. (@xref{On-line manual}, for more information about
183 Info.) 197 Info.)
184 198
185 @node Extended commands, On-line manual, Basic keys, FAQ notation 199 @node Extended commands, On-line manual, Basic keys, FAQ notation
186 @section What does @file{M-x @var{command}} mean? 200 @section What does @file{M-x @var{command}} mean?
187 @cindex Extended commands 201 @cindex Extended commands
188 @cindex Commands, extended 202 @cindex Commands, extended
189 @cindex M-x, meaning of 203 @cindex M-x, meaning of
190 204
191 @kbd{M-x @var{command}} means type @kbd{M-x}, then type the name of the 205 @kbd{M-x @var{command}} means type @kbd{M-x}, then type the name of the
192 command, then type @key{RET}. (@pxref{Basic keys} if you're not sure 206 command, then type @key{RET}. (@xref{Basic keys}, if you're not sure
193 what @kbd{M-x} and @key{RET} mean.) 207 what @kbd{M-x} and @key{RET} mean.)
194 208
195 @kbd{M-x} (by default) invokes the command 209 @kbd{M-x} (by default) invokes the command
196 @code{execute-extended-command}. This command allows you to run any 210 @code{execute-extended-command}. This command allows you to run any
197 Emacs command if you can remember the command's name. If you can't 211 Emacs command if you can remember the command's name. If you can't
198 remember the command's name, you can type @key{TAB} and @key{SPC} for 212 remember the command's name, you can type @key{TAB} and @key{SPC} for
199 completion, @key{?} for a list of possibilities, and @kbd{M-p} and 213 completion, @key{?} for a list of possibilities, and @kbd{M-p} and
200 @kbd{M-n} to see previous commands entered. An Emacs "command" is any 214 @kbd{M-n} (or up-arrow and down-arrow on terminals that have these
201 "interactive" Emacs function. 215 editing keys) to see previous commands entered. An Emacs @dfn{command}
202 216 is an @dfn{interactive} Emacs function.
217
218 @cindex @key{Do} key
203 Your system administrator may have bound other key sequences to invoke 219 Your system administrator may have bound other key sequences to invoke
204 @code{execute-extended-command}. A function key labeled @kbd{Do} is a 220 @code{execute-extended-command}. A function key labeled @kbd{Do} is a
205 good candidate for this. 221 good candidate for this, on keyboards that have such a key.
206 222
207 To run non-interactive Emacs functions, @pxref{Evaluating Emacs Lisp code}. 223 If you need to run non-interactive Emacs functions, see @ref{Evaluating
224 Emacs Lisp code}.
208 225
209 @node On-line manual, Filename conventions, Extended commands, FAQ notation 226 @node On-line manual, Filename conventions, Extended commands, FAQ notation
210 @section How do I read topic XXX in the on-line manual? 227 @section How do I read topic XXX in the on-line manual?
211 @cindex On-line manual, reading topics in 228 @cindex On-line manual, reading topics in
212 @cindex Reading topics in the on-line manual 229 @cindex Reading topics in the on-line manual
213 @cindex Finding topics in the on-line manual 230 @cindex Finding topics in the on-line manual
214 @cindex Info, finding topics in 231 @cindex Info, finding topics in
215 232
216 When we refer you to topic XXX in the on-line manual, you can read this 233 When we refer you to some @var{topic} in the on-line manual, you can
217 manual node inside Emacs (assuming nothing is broken) by typing @kbd{C-h 234 read this manual node inside Emacs (assuming nothing is broken) by
218 i m emacs @key{RET} m XXX @key{RET}}. 235 typing @kbd{C-h i m emacs @key{RET} m @var{topic} @key{RET}}.
219 236
220 This invokes Info, the GNU hypertext documentation browser. If you don't 237 This invokes Info, the GNU hypertext documentation browser. If you don't
221 already know how to use Info, type @key{?} from within Info. 238 already know how to use Info, type @key{?} from within Info.
222 239
223 If we refer to topic XXX:YYY, type @kbd{C-h i m emacs @key{RET} m XXX 240 If we refer to @var{topic}:@var{subtopic}, type @kbd{C-h i m emacs
224 @key{RET} m YYY @key{RET}}. 241 @key{RET} m @var{topic} @key{RET} m @var{subtopic} @key{RET}}.
225 242
226 Your system administrator may not have installed the Info files, or may 243 If these commands don't work as expected, your system administrator may
227 have installed them improperly. In this case you should complain. 244 not have installed the Info files, or may have installed them
245 improperly. In this case you should complain.
228 246
229 @xref{Getting a printed manual}, if you would like a paper copy of the 247 @xref{Getting a printed manual}, if you would like a paper copy of the
230 Emacs manual. 248 Emacs manual.
231 249
232 @node Filename conventions, Common acronyms, On-line manual, FAQ notation 250 @node Filename conventions, Common acronyms, On-line manual, FAQ notation
240 @file{src}. 258 @file{src}.
241 259
242 If you use Emacs, but don't know where it is kept on your system, start 260 If you use Emacs, but don't know where it is kept on your system, start
243 Emacs, then type @kbd{C-h v data-directory @key{RET}}. The directory 261 Emacs, then type @kbd{C-h v data-directory @key{RET}}. The directory
244 name displayed by this will be the full pathname of the installed 262 name displayed by this will be the full pathname of the installed
245 @file{etc} directory. 263 @file{etc} directory. (This full path is recorded in the Emacs variable
264 @code{data-directory}, and @kbd{C-h v} displays the value and the
265 documentation of a variable.)
246 266
247 The location of your Info directory (i.e., where on-line documentation 267 The location of your Info directory (i.e., where on-line documentation
248 is stored) is kept in the variable @code{Info-default-directory-list}. Use 268 is stored) is kept in the variable @code{Info-default-directory-list}. Use
249 @kbd{C-h v Info-default-directory-list @key{RET}} to see the contents of 269 @kbd{C-h v Info-default-directory-list @key{RET}} to see the value of
250 this variable, which will be a list of directory names. The last 270 this variable, which will be a list of directory names. The last
251 directory in that list is probably where most Info files are stored. By 271 directory in that list is probably where most Info files are stored. By
252 default, Info documentation is placed in @file{/usr/local/info}. 272 default, Info documentation is placed in @file{/usr/local/info}.
253 273
254 Some of these files are available individually via FTP or e-mail; 274 Some of these files are available individually via FTP or e-mail; see
255 @pxref{Informational files for Emacs}. All are available in the source 275 @ref{Informational files for Emacs}. They all are available in the
256 distribution. Many of the files in the @file{etc} directory are also 276 source distribution. Many of the files in the @file{etc} directory are
257 available via the Emacs "help" menu, or by typing @kbd{C-h ?} (@kbd{M-x 277 also available via the Emacs "@samp{Help} menu, or by typing @kbd{C-h ?}
258 help-for-help}). 278 (@kbd{M-x help-for-help}).
259 279
260 Your system administrator may have removed the @file{src} directory and 280 Your system administrator may have removed the @file{src} directory and
261 many files from the @file{etc} directory. 281 many files from the @file{etc} directory.
262 282
263 @node Common acronyms, , Filename conventions, FAQ notation 283 @node Common acronyms, , Filename conventions, FAQ notation
303 look-and-feel copyrights and software patents. The FSF aims to make 323 look-and-feel copyrights and software patents. The FSF aims to make
304 high quality free software available for everyone. The OSF is a 324 high quality free software available for everyone. The OSF is a
305 consortium of computer vendors which develops commercial software for 325 consortium of computer vendors which develops commercial software for
306 Unix systems. 326 Unix systems.
307 327
308 The word "free" in the title of the Free Software Foundation refers to 328 The word ``free'' in the title of the Free Software Foundation refers to
309 "freedom," not "zero dollars." Anyone can charge any price for 329 ``freedom,'' not ``zero dollars.'' Anyone can charge any price for
310 GPL-covered software that they want to. However, in practice, the 330 GPL-covered software that they want to. However, in practice, the
311 freedom enforced by the GPL leads to low prices, because you can always 331 freedom enforced by the GPL leads to low prices, because you can always
312 get the software for less money from someone else, because everyone has 332 get the software for less money from someone else, since everyone has
313 the right to resell or give away GPL-covered software. 333 the right to resell or give away GPL-covered software.
314 334
315 @c ------------------------------------------------------------ 335 @c ------------------------------------------------------------
316 @node General questions, Getting help, FAQ notation, Top 336 @node General questions, Getting help, FAQ notation, Top
317 @chapter General questions 337 @chapter General questions
318 @cindex General questions 338 @cindex General questions
319 339
320 This section contains general questions having to do with Emacs, the 340 This chapter contains general questions having to do with Emacs, the
321 Free Software Foundation, and related organizations. 341 Free Software Foundation, and related organizations.
322 342
323 @menu 343 @menu
324 * The LPF:: 344 * The LPF::
325 * Real meaning of copyleft:: 345 * Real meaning of copyleft::
338 @cindex Patents for software, opposition to 358 @cindex Patents for software, opposition to
339 359
340 The LPF opposes the expanding danger of software patents and 360 The LPF opposes the expanding danger of software patents and
341 look-and-feel copyrights. To get more information, feel free to contact 361 look-and-feel copyrights. To get more information, feel free to contact
342 the LPF via e-mail or otherwise. You may also contact 362 the LPF via e-mail or otherwise. You may also contact
343 @email{jbw@@cs.bu.edu, Joe Wells}; he will be happy to talk with you 363 @email{jbw@@cs.bu.edu, Joe Wells}; he will be happy to talk to you
344 about the LPF. 364 about the LPF.
345 365
346 You can find more information about the LPF in the file @file{etc/LPF}. 366 You can find more information about the LPF in the file @file{etc/LPF}.
347 More papers describing the LPF's views are available on the Internet and 367 More papers describing the LPF's views are available on the Internet and
348 also from @uref{http://lpf.ai.mit.edu/, the LPF}. 368 also from @uref{http://lpf.ai.mit.edu/, the LPF home page}.
349 369
350 @node Real meaning of copyleft, Guidelines for newsgroup postings, The LPF, General questions 370 @node Real meaning of copyleft, Guidelines for newsgroup postings, The LPF, General questions
351 @section What is the real legal meaning of the GNU copyleft? 371 @section What is the real legal meaning of the GNU copyleft?
352 @cindex Copyleft, real meaning of 372 @cindex Copyleft, real meaning of
353 @cindex GPL, real meaning of 373 @cindex GPL, real meaning of
364 RMS writes: 384 RMS writes:
365 385
366 @quotation 386 @quotation
367 The legal meaning of the GNU copyleft is less important than the spirit, 387 The legal meaning of the GNU copyleft is less important than the spirit,
368 which is that Emacs is a free software project and that work pertaining 388 which is that Emacs is a free software project and that work pertaining
369 to Emacs should also be free software. "Free" means that all users have 389 to Emacs should also be free software. ``Free'' means that all users
370 the freedom to study, share, change and improve Emacs. To make sure 390 have the freedom to study, share, change and improve Emacs. To make
371 everyone has this freedom, pass along source code when you distribute 391 sure everyone has this freedom, pass along source code when you
372 any version of Emacs or a related program, and give the recipients the 392 distribute any version of Emacs or a related program, and give the
373 same freedom that you enjoyed. 393 recipients the same freedom that you enjoyed.
374 @end quotation 394 @end quotation
375 395
376 @node Guidelines for newsgroup postings, Newsgroup archives, Real meaning of copyleft, General questions 396 @node Guidelines for newsgroup postings, Newsgroup archives, Real meaning of copyleft, General questions
377 @section What are appropriate messages for @uref{news:gnu.emacs.help}, @uref{news:gnu.emacs.bug}, @uref{news:comp.emacs}, etc.? 397 @section What are appropriate messages for @uref{news:gnu.emacs.help}, @uref{news:gnu.emacs.bug}, @uref{news:comp.emacs}, etc.?
378 @cindex Newsgroups, appropriate messages for 398 @cindex Newsgroups, appropriate messages for
379 @cindex GNU newsgroups, appropriate messages for 399 @cindex GNU newsgroups, appropriate messages for
380 @cindex Usenet groups, appropriate messages for 400 @cindex Usenet groups, appropriate messages for
381 @cindex Mailing lists, appropriate messages for 401 @cindex Mailing lists, appropriate messages for
382 402 @cindex Posting messages to newsgroups
383 The file @file{etc/MAILINGLISTS} discusses the purpose of each GNU 403
384 mailing-list. (@pxref{Informational files for Emacs} if you want a copy 404 @cindex GNU mailing lists
405 The file @file{etc/MAILINGLISTS} describes the purpose of each GNU
406 mailing list. (@xref{Informational files for Emacs}, if you want a copy
385 of the file.) For those lists which are gatewayed with newsgroups, it 407 of the file.) For those lists which are gatewayed with newsgroups, it
386 lists both the newsgroup name and the mailing list address. 408 lists both the newsgroup name and the mailing list address.
387 409
388 @uref{news:comp.emacs} is for discussion of Emacs programs in general. 410 The newsgroup @uref{news:comp.emacs} is for discussion of Emacs programs
389 This includes Emacs along with various other implementations, such as 411 in general. This includes Emacs along with various other
390 JOVE, MicroEmacs, Freemacs, MG, Unipress, CCA, and Epsilon. 412 implementations, such as XEmacs, JOVE, MicroEmacs, Freemacs, MG,
413 Unipress, CCA, and Epsilon.
391 414
392 Many people post Emacs questions to @uref{news:comp.emacs} because they 415 Many people post Emacs questions to @uref{news:comp.emacs} because they
393 don't receive any of the gnu.* newsgroups. Arguments have been made 416 don't receive any of the @code{gnu.*} newsgroups. Arguments have been
394 both for and against posting GNU-Emacs-specific material to 417 made both for and against posting GNU-Emacs-specific material to
395 @uref{news:comp.emacs}. You have to decide for yourself. 418 @uref{news:comp.emacs}. You have to decide for yourself.
396 419
397 Messages advocating "non-free" software are considered unacceptable on 420 Messages advocating ``non-free'' software are considered unacceptable on
398 any of the gnu.* newsgroups except for @uref{news:gnu.misc.discuss}, 421 any of the @code{gnu.*} newsgroups except for @uref{news:gnu.misc.discuss},
399 which was created to hold the extensive flame-wars on the subject. 422 which was created to hold the extensive flame-wars on the subject.
400 "Non-free" software includes any software for which the end user can't 423 ``Non-free'' software includes any software for which the end user can't
401 freely modify the source code and exchange enhancements. Be careful to 424 freely modify the source code and exchange enhancements. Be careful to
402 remove the gnu.* groups from the "Newsgroups:" line when posting a 425 remove the @code{gnu.*} groups from the @samp{Newsgroups:} line when
403 followup that recommends such software. 426 posting a followup that recommends such software.
404 427
405 @uref{news:gnu.emacs.bug} is a place where bug reports appear, but avoid 428 @uref{news:gnu.emacs.bug} is a place where bug reports appear, but avoid
406 posting bug reports to this newsgroup (@pxref{Reporting bugs}). 429 posting bug reports to this newsgroup directly (@pxref{Reporting bugs}).
407 430
408 @node Newsgroup archives, Reporting bugs, Guidelines for newsgroup postings, General questions 431 @node Newsgroup archives, Reporting bugs, Guidelines for newsgroup postings, General questions
409 @section Where can I get old postings to @uref{news:gnu.emacs.help} and other GNU groups? 432 @section Where can I get old postings to @uref{news:gnu.emacs.help} and other GNU groups?
410 @cindex Archived postings from @uref{news:gnu.emacs.help} 433 @cindex Archived postings from @uref{news:gnu.emacs.help}
411 @cindex Usenet archives for GNU groups 434 @cindex Usenet archives for GNU groups
420 443
421 As of this writing, the archives are not yet working. 444 As of this writing, the archives are not yet working.
422 445
423 Web-based Usenet search services, such as 446 Web-based Usenet search services, such as
424 @uref{http://www.dejanews.com, DejaNews}, also archive the 447 @uref{http://www.dejanews.com, DejaNews}, also archive the
425 gnu.* groups. 448 @code{gnu.*} groups.
426 449
427 @node Reporting bugs, Unsubscribing from Emacs lists, Newsgroup archives, General questions 450 @node Reporting bugs, Unsubscribing from Emacs lists, Newsgroup archives, General questions
428 @section Where should I report bugs and other problems with Emacs? 451 @section Where should I report bugs and other problems with Emacs?
429 @cindex Bug reporting 452 @cindex Bug reporting
430 @cindex Good bug reports 453 @cindex Good bug reports
435 @email{bug-gnu-emacs@@gnu.org}. Anything sent here also appears in the 458 @email{bug-gnu-emacs@@gnu.org}. Anything sent here also appears in the
436 newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of 459 newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of
437 news to submit the bug report. This ensures a reliable return address 460 news to submit the bug report. This ensures a reliable return address
438 so you can be contacted for further details. 461 so you can be contacted for further details.
439 462
440 Be sure to read the "Bugs" section of the Emacs manual before reporting 463 Be sure to read the ``Bugs'' section of the Emacs manual before reporting
441 a bug to bug-gnu-emacs! The manual describes in detail how to submit a 464 a bug to bug-gnu-emacs! The manual describes in detail how to submit a
442 useful bug report. (@pxref{On-line manual} if you don't know how to read the 465 useful bug report. (@xref{On-line manual}, if you don't know how to read the
443 manual.) 466 manual.)
444 467
445 RMS says: 468 RMS says:
446 469
447 @quotation 470 @quotation
457 RMS says it is sometimes fine to post to @uref{news:gnu.emacs.help}: 480 RMS says it is sometimes fine to post to @uref{news:gnu.emacs.help}:
458 481
459 @quotation 482 @quotation
460 If you have reported a bug and you don't hear about a possible fix, 483 If you have reported a bug and you don't hear about a possible fix,
461 then after a suitable delay (such as a week) it is okay to post on 484 then after a suitable delay (such as a week) it is okay to post on
462 gnu.emacs.help asking if anyone can help you. 485 @code{gnu.emacs.help} asking if anyone can help you.
463 @end quotation 486 @end quotation
464 487
465 If you are unsure whether you have found a bug, consider the following 488 If you are unsure whether you have found a bug, consider the following
466 non-exhaustive list, courtesy of RMS: 489 non-exhaustive list, courtesy of RMS:
467 490
475 @node Unsubscribing from Emacs lists, Contacting the FSF, Reporting bugs, General questions 498 @node Unsubscribing from Emacs lists, Contacting the FSF, Reporting bugs, General questions
476 @section How do I unsubscribe from this mailing list? 499 @section How do I unsubscribe from this mailing list?
477 @cindex Unsubscribing from GNU mailing lists 500 @cindex Unsubscribing from GNU mailing lists
478 @cindex Removing yourself from GNU mailing lists 501 @cindex Removing yourself from GNU mailing lists
479 502
480 If you are receiving a GNU mailing list named "XXX", you might be able 503 If you are receiving a GNU mailing list named @var{list}, you might be
481 to unsubscribe from it by sending a request to the address 504 able to unsubscribe from it by sending a request to the address
482 @email{XXX-request@@gnu.org}. However, this will not work if you are 505 @email{@var{list}-request@@gnu.org}. However, this will not work if you are
483 not listed on the main mailing list, but instead receive the mail from a 506 not listed on the main mailing list, but instead receive the mail from a
484 distribution point. In that case, you will have to track down at which 507 distribution point. In that case, you will have to track down at which
485 distribution point you are listed. Inspecting the @samp{Received} headers 508 distribution point you are listed. Inspecting the @samp{Received} headers
486 on the mail messages may help, along with liberal use of the "EXPN" or 509 on the mail messages may help, along with liberal use of the @samp{EXPN} or
487 "VRFY" sendmail commands through "telnet <site-address> smtp". Ask your 510 @samp{VRFY} sendmail commands through @samp{telnet @var{site-address}
488 postmaster for help. 511 smtp}. Ask your postmaster for help, if you cannot figure out these
512 details.
489 513
490 @node Contacting the FSF, , Unsubscribing from Emacs lists, General questions 514 @node Contacting the FSF, , Unsubscribing from Emacs lists, General questions
491 @section What is the current address of the FSF? 515 @section What is the current address of the FSF?
492 @cindex Snail mail address of the FSF 516 @cindex Snail mail address of the FSF
493 @cindex Postal address of the FSF 517 @cindex Postal address of the FSF
514 Boston, MA 02111-1307@* 538 Boston, MA 02111-1307@*
515 USA@* 539 USA@*
516 540
517 @end table 541 @end table
518 542
519 For details on how to order items directly from the FSF, see the file 543 @cindex Ordering GNU software
520 @file{etc/ORDERS}. 544 For details on how to order items directly from the FSF, see the
545 @uref{http://www.gnu.org/order/order.html, GNU Web site}, and also the
546 files @file{etc/ORDERS}, @file{ORDERS.EUROPE}, and @file{ORDERS.JAPAN}.
521 547
522 @c ------------------------------------------------------------ 548 @c ------------------------------------------------------------
523 @node Getting help, Status of Emacs, General questions, Top 549 @node Getting help, Status of Emacs, General questions, Top
524 @chapter Getting help 550 @chapter Getting help
525 @cindex Getting help 551 @cindex Getting help
526 552
527 This section tells you how to get help with Emacs 553 This chapter tells you how to get help with Emacs
528 554
529 @menu 555 @menu
530 * Basic editing:: 556 * Basic editing::
531 * Learning how to do something:: 557 * Learning how to do something::
532 * Getting a printed manual:: 558 * Getting a printed manual::
560 586
561 Emacs help works best if it is invoked by a single key whose value 587 Emacs help works best if it is invoked by a single key whose value
562 should be stored in the variable @code{help-char}. 588 should be stored in the variable @code{help-char}.
563 589
564 There is also a WWW-based tutorial for Emacs 18, much of which is also 590 There is also a WWW-based tutorial for Emacs 18, much of which is also
565 relevant for Emacs 20, available at 591 relevant for later versions of Emacs, available at
566 592
567 @uref{http://kufacts.cc.ukans.edu/cwis/writeups/misc/emacsguide.html} 593 @uref{http://kufacts.cc.ukans.edu/cwis/writeups/misc/emacsguide.html}
568 594
569 @node Learning how to do something, Getting a printed manual, Basic editing, Getting help 595 @node Learning how to do something, Getting a printed manual, Basic editing, Getting help
570 @section How do I find out how to do something in Emacs? 596 @section How do I find out how to do something in Emacs?
575 601
576 There are several methods for finding out how to do things in Emacs. 602 There are several methods for finding out how to do things in Emacs.
577 603
578 @itemize @bullet 604 @itemize @bullet
579 605
606 @cindex Reading the Emacs manual
580 @item 607 @item
581 The complete text of the Emacs manual is available on-line via the Info 608 The complete text of the Emacs manual is available on-line via the Info
582 hypertext reader. Type @kbd{C-h i} to invoke Info. Typing @key{h} 609 hypertext reader. Type @kbd{C-h i} to invoke Info. Typing @key{h}
583 immediately after entering Info will provide a short tutorial on how to 610 immediately after entering Info will provide a short tutorial on how to
584 use it. 611 use it.
585 612
613 @cindex Lookup a subject in a manual
614 @cindex Index search in a manual
615 @item
616 To quickly locate the section of the manual which discusses a certain
617 issue, or describes a command or a variable, type @kbd{C-h i m emacs
618 @key{RET} i @var{topic} @key{RET}}, where @var{topic} is the name of the
619 topic, the command, or the variable which you are looking for. If this
620 does not land you on the right place in the manual, press @kbd{,}
621 (comma) repeatedly until you find what you need. (The @kbd{i} and
622 @kbd{,} keys invoke the index-searching functions, which look for the
623 @var{topic} you type in all the indices of the Emacs manual.)
624
625 @cindex Apropos
626 @item
627 You can list all of the commands whose names contain a certain word
628 (actually which match a regular expression) using @kbd{C-h a} (@kbd{M-x
629 command-apropos}).
630
631 @cindex Command description in the manual
632 @item
633 The command @kbd{C-h C-f} (@code{Info-goto-emacs-command-node}) prompts
634 for the name of a command, and then attempts to find the section in the
635 Emacs manual where that command is described.
636
637 @cindex Finding commands and variables
638 @item
639 You can list all of the functions and variables whose names contain a
640 certain word using @kbd{M-x apropos}.
641
642 @item
643 You can list all of the functions and variables whose documentation
644 matches a regular expression or a string, using @kbd{M-x
645 apropos-documentation}.
646
586 @item 647 @item
587 You can order a hardcopy of the manual from the FSF. @xref{Getting a 648 You can order a hardcopy of the manual from the FSF. @xref{Getting a
588 printed manual}. 649 printed manual}.
589 650
651 @cindex Reference cards, in other languages
590 @item 652 @item
591 You can get a printed reference card listing commands and keys to 653 You can get a printed reference card listing commands and keys to
592 invoke them. You can order one from the FSF for $1 (or 10 for $5), 654 invoke them. You can order one from the FSF for $1 (or 10 for $5),
593 or you can print your own from the @file{etc/refcard.tex} or 655 or you can print your own from the @file{etc/refcard.tex} or
594 @file{etc/refcard.ps} files in the Emacs distribution. 656 @file{etc/refcard.ps} files in the Emacs distribution. Beginning with
595 657 version 21.1, the Emacs distribution comes with translations of the
596 @item 658 reference card into several languages; look for files named
597 You can list all of the commands whose names contain a certain word 659 @file{etc/@var{lang}-refcard.*}, where @var{lang} is a two-letter code
598 (actually which match a regular expression) using @kbd{C-h a} (@kbd{M-x 660 of the language. For example, the German version of the reference card
599 command-apropos}). 661 is in the files @file{etc/de-refcard.tex} and @file{etc/de-refcard.ps}.
600
601 @item
602 You can list all of the functions and variables whose names contain a
603 certain word using @kbd{M-x apropos}.
604 662
605 @item 663 @item
606 There are many other commands in Emacs for getting help and 664 There are many other commands in Emacs for getting help and
607 information. To get a list of these commands, type @samp{?} after 665 information. To get a list of these commands, type @samp{?} after
608 @kbd{C-h}. 666 @kbd{C-h}.
614 @cindex Printed Emacs manual, obtaining 672 @cindex Printed Emacs manual, obtaining
615 @cindex Manual, obtaining a printed copy of 673 @cindex Manual, obtaining a printed copy of
616 @cindex Emacs manual, obtaining a printed copy of 674 @cindex Emacs manual, obtaining a printed copy of
617 675
618 You can order a printed copy of the Emacs manual from the FSF. For 676 You can order a printed copy of the Emacs manual from the FSF. For
619 details see the file @file{etc/ORDERS}. 677 details see the @uref{http://www.gnu.org/order/order.html, GNU Web site}
620 678 and the file @file{etc/ORDERS}.
621 The full @TeX{} source for the manual also comes in the @file{man} 679
680 @c The number 620 below is version-dependent!
681 The full Texinfo source for the manual also comes in the @file{man}
622 directory of the Emacs distribution, if you're daring enough to try to 682 directory of the Emacs distribution, if you're daring enough to try to
623 print out this 440-page manual yourself (@pxref{Printing a Texinfo 683 print out this 620-page manual yourself (@pxref{Printing a Texinfo
624 file}). 684 file}).
625 685
626 If you absolutely have to print your own copy, and you don't have @TeX{}, 686 If you absolutely have to print your own copy, and you don't have @TeX{},
627 you can get a PostScript version from 687 you can get a PostScript version from
628 688
629 @uref{http://www.gnu.org/manual/emacs/ps/emacs.ps.gz} 689 @uref{http://www.gnu.org/manual/emacs/ps/emacs.ps.gz}
630 690
631 A WWW version of the manual is at 691 An HTML version of the manual is at
632 692
633 @uref{www.gnu.org/manual/emacs/index.html} 693 @uref{www.gnu.org/manual/emacs/index.html}
634 694
635 @xref{Learning how to do something}, for how to view the manual on-line. 695 @xref{Learning how to do something}, for how to view the manual on-line.
636 696
643 @cindex Reference manual for Emacs Lisp 703 @cindex Reference manual for Emacs Lisp
644 704
645 Within Emacs, you can type @kbd{C-h f} to get the documentation for a 705 Within Emacs, you can type @kbd{C-h f} to get the documentation for a
646 function, @kbd{C-h v} for a variable. 706 function, @kbd{C-h v} for a variable.
647 707
648 For more information, obtain the Emacs Lisp Reference Manual. Details on 708 For more information, obtain the Emacs Lisp Reference Manual. Details
649 ordering it from FSF are in file @file{etc/ORDERS}. 709 on ordering it from FSF are on the
710 @uref{http://www.gnu.org/order/order.html, GNU Web site} and in the file
711 @file{etc/ORDERS}.
650 712
651 The Emacs Lisp Reference Manual is also available on-line, in Info 713 The Emacs Lisp Reference Manual is also available on-line, in Info
652 format. Texinfo source for the manual (along with pregenerated Info 714 format. Texinfo source for the manual (along with pregenerated Info
653 files) is available at 715 files) is available at
654 716
655 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/elisp-manual-20-2.5.tar.gz} 717 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/elisp-manual-21-2.6.tar.gz}
656 718
657 and all mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} for a 719 and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU
658 list). @xref{Installing Texinfo documentation}, if you want to install 720 distributions}). @xref{Installing Texinfo documentation}, if you want
659 the Info files, or @ref{Printing a Texinfo file} if you want to use the 721 to install the Info files, or @ref{Printing a Texinfo file}, if you want
660 Texinfo source to print the manual yourself. 722 to use the Texinfo source to print the manual yourself.
661 723
662 A WWW version of the Emacs Lisp Reference Manual is available at 724 An HTML version of the Emacs Lisp Reference Manual is available at
663 725
664 @uref{http://www.gnu.org/manual/elisp-manual-20-2.5/elisp.html} 726 @uref{http://www.gnu.org/manual/elisp-manual-21-2.6/elisp.html}
665 727
666 @node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help 728 @node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help
667 @section How do I install a piece of Texinfo documentation? 729 @section How do I install a piece of Texinfo documentation?
668 @cindex Texinfo documentation, installing 730 @cindex Texinfo documentation, installing
669 @cindex Installing Texinfo documentation 731 @cindex Installing Texinfo documentation
670 @cindex New Texinfo files, installing 732 @cindex New Texinfo files, installing
671 @cindex Documentation, installing new Texinfo files 733 @cindex Documentation, installing new Texinfo files
734 @cindex Info files, how to install
672 735
673 First, you must turn the Texinfo files into Info files. You may do this 736 First, you must turn the Texinfo files into Info files. You may do this
674 using the stand-alone @file{makeinfo} program, available as part of the latest 737 using the stand-alone @file{makeinfo} program, available as part of the latest
675 Texinfo package at 738 Texinfo package at
676 739
677 @uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-3.12.tar.gz} 740 @uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.0.tar.gz}
678 741
679 and all mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} for a list). 742 and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU
743 distributions}).
680 744
681 For information about the Texinfo format, read the Texinfo manual which 745 For information about the Texinfo format, read the Texinfo manual which
682 comes with Emacs. This manual also comes installed in Info format, so 746 comes with the Texinfo package. This manual also comes installed in
683 you can read it on-line. 747 Info format, so you can read it on-line; type @kbd{C-h i m texinfo
748 @key{RET}}.
749
750 Alternatively, you could use the Emacs command @kbd{M-x
751 texinfo-format-buffer}, after visiting the Texinfo source file of the
752 manual you want to convert.
684 753
685 Neither @code{texinfo-format-buffer} nor @file{makeinfo} installs the 754 Neither @code{texinfo-format-buffer} nor @file{makeinfo} installs the
686 resulting Info files in Emacs's Info tree. To install Info files: 755 resulting Info files in Emacs's Info tree. To install Info files,
756 perform these steps:
687 757
688 @enumerate 758 @enumerate
689 759 @item
690 @item Move the files to the @file{info} directory in the installed Emacs 760 Move the files to the @file{info} directory in the installed Emacs
691 distribution. @xref{Filename conventions}, if you don't know where that is. 761 distribution. @xref{Filename conventions}, if you don't know where that
692 762 is.
693 @item Edit the file @file{info/dir} in the installed Emacs distribution, 763
694 and add a line for the top level node in the Info package that you are 764 @item
695 installing. Follow the examples already in this file. The format is: 765 Run the @code{install-info} command, which is part of the Texinfo
766 distribution, to update the main Info directory menu, like this:
767
768 @example
769 install-info --info-dir=@var{dir-path} @var{dir-path}/@var{file}
770 @end example
771
772 @noindent
773 where @var{dir-path} is the full path to the directory where you copied
774 the produced Info file(s), and @var{file} is the name of the Info file
775 you produced and want to install.
776
777 If you don't have the @code{install-info} command installed, you can
778 edit the file @file{info/dir} in the installed Emacs distribution, and
779 add a line for the top level node in the Info package that you are
780 installing. Follow the examples already in this file. The format is:
696 781
697 @example 782 @example
698 * Topic: (relative-pathname). Short description of topic. 783 * Topic: (relative-pathname). Short description of topic.
699 @end example 784 @end example
700 785
702 787
703 If you want to install Info files and you don't have the necessary 788 If you want to install Info files and you don't have the necessary
704 privileges, you have several options: 789 privileges, you have several options:
705 790
706 @itemize @bullet 791 @itemize @bullet
707
708 @item 792 @item
709 Info files don't actually need to be installed before being used. You 793 Info files don't actually need to be installed before being used. You
710 can feed a file name to the @code{Info-goto-node} command (invoked by 794 can feed a file name to the @code{Info-goto-node} command (invoked by
711 pressing @key{g} in Info mode) by typing the name of the file in 795 pressing @key{g} in Info mode) by typing the name of the file in
712 parentheses. This goes to the node named "Top" in that file. For 796 parentheses. This goes to the node named ``Top'' in that file. For
713 example, to view a Info file named "XXX" in your home directory, you can 797 example, to view a Info file named @file{@var{info-file}} in your home
714 type this: 798 directory, you can type this:
715 799
716 @lisp 800 @lisp
717 C-h i g (~/XXX) @key{RET} 801 C-h i g (~/@var{info-file}) @key{RET}
718 @end lisp 802 @end lisp
719 803
720 @item 804 @item
721 You can create your own Info directory. You can tell Emacs where the 805 You can create your own Info directory. You can tell Emacs where that
722 Info directory is by adding its pathname to the value of the variable 806 Info directory is by adding its pathname to the value of the variable
723 @code{Info-default-directory-list}. For example, to use a private Info 807 @code{Info-default-directory-list}. For example, to use a private Info
724 directory which is a subdirectory of your home directory named "Info", 808 directory which is a subdirectory of your home directory named @file{Info},
725 you could put this in your @file{.emacs} file: 809 you could put this in your @file{.emacs} file:
726 810
727 @lisp 811 @lisp
728 (setq Info-default-directory-list 812 (setq Info-default-directory-list
729 (cons "~/Info" Info-default-directory-list)) 813 (cons "~/Info" Info-default-directory-list))
730 @end lisp 814 @end lisp
731 815
732 You will need a top-level Info file named @file{dir} in this directory 816 You will need a top-level Info file named @file{dir} in this directory
733 which has everything the system dir file has in it, except it should 817 which has everything the system @file{dir} file has in it, except it should
734 list only entries for Info files in that directory. You might not need 818 list only entries for Info files in that directory. You might not need
735 it if all files in this directory were referenced by other @file{dir} 819 it if all files in this directory were referenced by other @file{dir}
736 files. The node lists from all @file{dir} files in 820 files. The node lists from all @file{dir} files in
737 @code{Info-default-directory-list} are merged by the Info system. 821 @code{Info-default-directory-list} are merged by the Info system.
738 822
740 824
741 @node Printing a Texinfo file, Viewing Info files outside of Emacs, Installing Texinfo documentation, Getting help 825 @node Printing a Texinfo file, Viewing Info files outside of Emacs, Installing Texinfo documentation, Getting help
742 @section How do I print a Texinfo file? 826 @section How do I print a Texinfo file?
743 @cindex Printing a Texinfo file 827 @cindex Printing a Texinfo file
744 @cindex Texinfo file, printing 828 @cindex Texinfo file, printing
829 @cindex Printing documentation
745 830
746 You can't get nicely printed output from Info files; you must still have 831 You can't get nicely printed output from Info files; you must still have
747 the original Texinfo source file for the manual you want to print. 832 the original Texinfo source file for the manual you want to print.
748 833
749 Assuming you have @TeX{} installed on your system, follow these steps: 834 Assuming you have @TeX{} installed on your system, follow these steps:
750 835
751 @enumerate 836 @enumerate
752 837
753 @item Make sure the first line of the Texinfo file looks like this: 838 @item
839 Make sure the first line of the Texinfo file looks like this:
754 840
755 @example 841 @example
756 \input texinfo 842 \input texinfo
757 @end example 843 @end example
758 844
759 You may need to change @samp{texinfo} to the full pathname of the 845 You may need to change @samp{texinfo} to the full pathname of the
760 texinfo.tex file, which comes with Emacs as @samp{man/texinfo.tex} (or 846 @file{texinfo.tex} file, which comes with Emacs as
761 copy or link it into the current directory). 847 @file{man/texinfo.tex} (or copy or link it into the current directory).
762 848
763 @item @code{tex XXX.texinfo} 849 @item
764 850 Type @kbd{texi2dvi @var{texinfo-source}}, where @var{texinfo-source} is
765 @item @code{texindex XXX.??} 851 the name of the Texinfo source file for which you want to produce a
766 852 printed copy.
767 The @samp{texindex} program comes with Emacs as @file{man/texindex.c}. 853
768 854 The @samp{texi2dvi} script is part of the GNU Texinfo distribution
769 @item @code{tex XXX.texinfo} 855 (@pxref{Installing Texinfo documentation}).
770 856
771 @item Print the DVI file @file{XXX.dvi} in the normal way for printing DVI files at your site. 857 @item
858 Print the DVI file @file{@var{texinfo-source}.dvi} in the normal way for
859 printing DVI files at your site. For example, if you have a PostScript
860 printer, run the @code{dvips} program to print the DVI file on that
861 printer.
772 862
773 @end enumerate 863 @end enumerate
774 864
775 To get more general instructions, retrieve the latest Texinfo package 865 To get more general instructions, retrieve the latest Texinfo package
776 (@pxref{Installing Texinfo documentation}). 866 (@pxref{Installing Texinfo documentation}).
783 873
784 Yes. Here are some alternative programs: 874 Yes. Here are some alternative programs:
785 875
786 @itemize @bullet 876 @itemize @bullet
787 877
788 @item Info, a stand-alone version of the Info program, comes as part of the 878 @item
789 Texinfo package. @xref{Installing Texinfo documentation}, for details. 879 @code{info}, a stand-alone version of the Info program, comes as part of
790 880 the Texinfo package. @xref{Installing Texinfo documentation}, for
791 @item Xinfo, a stand-alone version of the Info program that runs under X 881 details.
792 Windows. You can get it at 882
883 @item
884 Xinfo, a stand-alone version of the Info program that runs under X
885 Window system. You can get it at
793 @uref{ftp://ftp.gnu.org/pub/gnu/xinfo/xinfo-1.01.01.tar.gz} and all 886 @uref{ftp://ftp.gnu.org/pub/gnu/xinfo/xinfo-1.01.01.tar.gz} and all
794 mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} for a list). 887 mirrors of @samp{ftp.gnu.org} (see @ref{Current GNU distributions}, for a
795 888 list of mirrors).
796 @item Tkinfo, an Info viewer that runs under X Windows and uses Tcl/Tk. You 889
797 can get Tkinfo at @uref{http://math-www.uni-paderborn.de/~axel/tkinfo/}. 890 @item
891 Tkinfo, an Info viewer that runs under X Window system and uses Tcl/Tk.
892 You can get Tkinfo at
893 @uref{http://math-www.uni-paderborn.de/~axel/tkinfo/}.
798 894
799 @end itemize 895 @end itemize
800 896
801 @node Informational files for Emacs, Help installing Emacs, Viewing Info files outside of Emacs, Getting help 897 @node Informational files for Emacs, Help installing Emacs, Viewing Info files outside of Emacs, Getting help
802 @section What informational files are available for Emacs? 898 @section What informational files are available for Emacs?
803 @cindex Informational files included with Emacs 899 @cindex Informational files included with Emacs
804 @cindex Files included with Emacs 900 @cindex Files included with Emacs
805 @cindex @file{COPYING}, description of file 901 @cindex @file{COPYING}, description of file
806 @cindex @file{DISTRIB}, description of file 902 @cindex @file{DISTRIB}, description of file
807 @cindex @file{FAQ}, description of file
808 @cindex @file{FTP}, description of file 903 @cindex @file{FTP}, description of file
809 @cindex @file{GNU}, description of file 904 @cindex @file{GNU}, description of file
810 @cindex @file{INTERVIEW}, description of file 905 @cindex @file{INTERVIEW}, description of file
811 @cindex @file{LPF}, description of file 906 @cindex @file{LPF}, description of file
812 @cindex @file{MACHINES}, description of file 907 @cindex @file{MACHINES}, description of file
818 This isn't a frequently asked question, but it should be! A variety of 913 This isn't a frequently asked question, but it should be! A variety of
819 informational files about Emacs and relevant aspects of the GNU project 914 informational files about Emacs and relevant aspects of the GNU project
820 are available for you to read. 915 are available for you to read.
821 916
822 The following files are available in the @file{etc} directory of the 917 The following files are available in the @file{etc} directory of the
823 Emacs distribution (@pxref{Filename conventions} if you're not sure where that is). 918 Emacs distribution (see @ref{Filename conventions}, if you're not sure
919 where that is).
824 920
825 @table @file 921 @table @file
826 922
827 @item COPYING 923 @item COPYING
828 Emacs General Public License 924 Emacs General Public License
829 925
830 @item DISTRIB 926 @item DISTRIB
831 Emacs Availability Information, including the popular "Free Software 927 Emacs Availability Information, including the popular "Free Software
832 Foundation Order Form" 928 Foundation Order Form"
833 929
834 @item FAQ
835 Emacs Frequently Asked Questions (You're reading it)
836
837 @item FTP 930 @item FTP
838 How to get GNU Software by Internet FTP or by UUCP 931 How to get GNU Software by Internet FTP or by UUCP
839 932
840 @item GNU 933 @item GNU
841 The GNU Manifesto 934 The GNU Manifesto
852 945
853 @item MAILINGLISTS 946 @item MAILINGLISTS
854 GNU Project Electronic Mailing Lists 947 GNU Project Electronic Mailing Lists
855 948
856 @item NEWS 949 @item NEWS
857 Emacs news, a history of user-visible changes 950 Emacs news, a history of recent user-visible changes
858 951
859 @item SERVICE 952 @item SERVICE
860 GNU Service Directory 953 GNU Service Directory
861 954
862 @item SUN-SUPPORT 955 @item SUN-SUPPORT
866 959
867 Latest versions of the above files also available at 960 Latest versions of the above files also available at
868 961
869 @uref{ftp://ftp.gnu.org/pub/gnu/GNUinfo/} 962 @uref{ftp://ftp.gnu.org/pub/gnu/GNUinfo/}
870 963
871 More GNU information, including back issues of the "GNU's Bulletin", are 964 More GNU information, including back issues of the @cite{GNU's
872 at 965 Bulletin}, are at
873 966
874 @uref{http://www.gnu.org/bulletins/bulletins.html} and 967 @uref{http://www.gnu.org/bulletins/bulletins.html} and
875 968
876 @uref{http://www.cs.pdx.edu/~trent/gnu/gnu.html} 969 @uref{http://www.cs.pdx.edu/~trent/gnu/gnu.html}
877 970
878 @node Help installing Emacs, Obtaining the FAQ, Informational files for Emacs, Getting help 971 @node Help installing Emacs, Obtaining the FAQ, Informational files for Emacs, Getting help
879 @section Where can I get help in installing Emacs? 972 @section Where can I get help in installing Emacs?
880 @cindex Installation help 973 @cindex Installation help
881 @cindex Help installing Emacs 974 @cindex Help installing Emacs
882 975
883 @xref{Installing Emacs}, for some basic installation hints, and question 976 @xref{Installing Emacs}, for some basic installation hints, and see
884 83 if you have problems with the installation. 977 @ref{Problems building Emacs}, or @ref{Linking with -lX11 fails}, if you
885 978 have problems with the installation.
886 The file @file{etc/SERVICE} (@pxref{Filename conventions} if you're not 979
887 sure where that is) lists companies and individuals willing to sell you 980 The file @file{etc/SERVICE} (see @ref{Filename conventions}, if you're
888 help in installing or using Emacs. An up-to-date version this file is 981 not sure where that is) lists companies and individuals willing to sell
889 available on @samp{ftp.gnu.org} (@pxref{Informational files for Emacs}). 982 you help in installing or using Emacs. An up-to-date version this file
983 is available on @samp{ftp.gnu.org} (@pxref{Informational files for
984 Emacs}).
890 985
891 @node Obtaining the FAQ, , Help installing Emacs, Getting help 986 @node Obtaining the FAQ, , Help installing Emacs, Getting help
892 @section Where can I get the latest version of this FAQ? 987 @section Where can I get the latest version of this FAQ?
893 @cindex FAQ, obtaining the 988 @cindex FAQ, obtaining the
894 @cindex Latest FAQ version, obtaining the 989 @cindex Latest FAQ version, obtaining the
899 The Emacs FAQ is available in several ways: 994 The Emacs FAQ is available in several ways:
900 995
901 @itemize @bullet 996 @itemize @bullet
902 997
903 @item 998 @item
904 Inside of Emacs itself. You can get it from selecting the "Emacs FAQ" 999 Inside of Emacs itself. You can get it from selecting the @samp{Emacs
905 option from the "Help" menu at the top of any Emacs frame, or by typing 1000 FAQ} option from the @samp{Help} menu of the Emacs menu bar at the top
906 @kbd{C-h F} (@kbd{M-x view-emacs-FAQ}). 1001 of any Emacs frame, or by typing @kbd{C-h F} (@kbd{M-x view-emacs-FAQ}).
907 1002
908 @item 1003 @item
909 Via USENET. If you can read news, the FAQ should be available in your 1004 Via USENET. If you can read news, the FAQ should be available in your
910 news spool, in both the @uref{news:gnu.emacs.help} and 1005 news spool, in both the @uref{news:gnu.emacs.help} and
911 @uref{news:comp.emacs} newsgroups. Every news reader should allow you 1006 @uref{news:comp.emacs} newsgroups. Every news reader should allow you
920 1015
921 In Gnus, you should type @kbd{C-u C-x C-s} from the @file{*Summary*} 1016 In Gnus, you should type @kbd{C-u C-x C-s} from the @file{*Summary*}
922 buffer or @kbd{C-u @key{SPC}} from the @file{*Newsgroup*} buffer to view 1017 buffer or @kbd{C-u @key{SPC}} from the @file{*Newsgroup*} buffer to view
923 all articles in a newsgroup. 1018 all articles in a newsgroup.
924 1019
925 If the FAQ articles have expired and been deleted from your news spool, 1020 If the FAQ articles have expired and have been deleted from your news
926 it might (or might not) do some good to complain to your news 1021 spool, it might (or might not) do some good to complain to your news
927 administrator, because the most recent FAQ should not expire for a 1022 administrator, because the most recent FAQ should not expire for a
928 while. 1023 while.
929 1024
930 @item Via HTTP or FTP. You can always fetch the latest FAQ from 1025 @item
1026 Via HTTP or FTP. You can always fetch the latest FAQ from
931 1027
932 @uref{http://www.lerner.co.il/emacs/} and 1028 @uref{http://www.lerner.co.il/emacs/} and
933 1029
934 @uref{ftp://ftp.lerner.co.il/pub/emacs/} 1030 @uref{ftp://ftp.lerner.co.il/pub/emacs/}
935 1031
936 @item 1032 @item
937 In the Emacs distribution. Since Emacs 18.56, the FAQ at the time 1033 In the Emacs distribution. Since Emacs 18.56, the FAQ at the time
938 of release has been part of the Emacs distribution as @file{etc/FAQ} 1034 of release has been part of the Emacs distribution as
939 (@pxref{Filename conventions}). 1035 @file{man/faq.texi} (@pxref{Filename conventions}).
940 1036
941 @item 1037 @item
942 Via the World Wide Web. A hypertext version is available at 1038 Via the World Wide Web. A hypertext version is available at
943 1039
944 @uref{http://www.lerner.co.il/emacs/} 1040 @uref{http://www.lerner.co.il/emacs/}
970 with "help" and "index" in the body on separate lines. 1066 with "help" and "index" in the body on separate lines.
971 1067
972 @item 1068 @item
973 As the very last resort, you can e-mail a request to 1069 As the very last resort, you can e-mail a request to
974 @email{emacs-faq@@lerner.co.il}. Don't do this unless you have made a 1070 @email{emacs-faq@@lerner.co.il}. Don't do this unless you have made a
975 serious effort to obtain the FAQ list via one of the methods listed 1071 good-faith effort to obtain the FAQ list via one of the methods listed
976 above. 1072 above.
977 1073
978 @end itemize 1074 @end itemize
979 1075
980 @c ------------------------------------------------------------ 1076 @c ------------------------------------------------------------
981 @node Status of Emacs, Common requests, Getting help, Top 1077 @node Status of Emacs, Common requests, Getting help, Top
982 @chapter Status of Emacs 1078 @chapter Status of Emacs
983 @cindex Status of Emacs 1079 @cindex Status of Emacs
984 1080
985 This section gives you basic information about Emacs, including its 1081 This chapter gives you basic information about Emacs, including its
986 latest version status. 1082 latest version status.
987 1083
988 @menu 1084 @menu
989 * Origin of the term Emacs:: 1085 * Origin of the term Emacs::
990 * Latest version of Emacs:: 1086 * Latest version of Emacs::
991 * New in Emacs 20:: 1087 * New in Emacs 20::
1088 * New in Emacs 21::
992 @end menu 1089 @end menu
993 1090
994 @node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs 1091 @node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs
995 @section Where does the name "Emacs" come from? 1092 @section Where does the name ``Emacs'' come from?
996 @cindex Origin of the term "Emacs" 1093 @cindex Origin of the term ``Emacs''
997 @cindex Emacs name origin 1094 @cindex Emacs name origin
998 @cindex TECO 1095 @cindex TECO
999 @cindex Original version of Emacs 1096 @cindex Original version of Emacs
1000 1097
1001 Emacs originally was an acronym for Editor MACroS. RMS says he "picked 1098 Emacs originally was an acronym for Editor MACroS. RMS says he ``picked
1002 the name Emacs because @key{E} was not in use as an abbreviation on ITS at 1099 the name Emacs because @key{E} was not in use as an abbreviation on ITS at
1003 the time." The first Emacs was a set of macros written in 1976 at MIT 1100 the time.'' The first Emacs was a set of macros written in 1976 at MIT
1004 by RMS for the editor TECO (Text Editor and COrrector, originally Tape 1101 by RMS for the editor TECO (Text Editor and COrrector, originally Tape
1005 Editor and COrrector) under ITS on a PDP-10. RMS had already extended 1102 Editor and COrrector) under ITS on a PDP-10. RMS had already extended
1006 TECO with a "real-time" full screen mode with reprogrammable keys. 1103 TECO with a ``real-time'' full-screen mode with reprogrammable keys.
1007 Emacs was started by @email{gls@@east.sun.com, Guy Steele} as a project 1104 Emacs was started by @email{gls@@east.sun.com, Guy Steele} as a project
1008 to unify the many divergent TECO command sets and key bindings at MIT, 1105 to unify the many divergent TECO command sets and key bindings at MIT,
1009 and completed by RMS. 1106 and completed by RMS.
1010 1107
1011 Many people have said that TECO code looks a lot like line noise; you 1108 Many people have said that TECO code looks a lot like line noise; you
1012 can read more at @uref{news:alt.lang.teco}. Someone has written a TECO 1109 can read more at @uref{news:alt.lang.teco}. Someone has written a TECO
1013 implementation in Emacs Lisp (to find it, @ref{Packages that do not come 1110 implementation in Emacs Lisp (to find it, see @ref{Packages that do not
1014 with Emacs}); it would be an interesting project to run the original 1111 come with Emacs}); it would be an interesting project to run the
1015 TECO Emacs inside of Emacs. 1112 original TECO Emacs inside of Emacs.
1016 1113
1114 @cindex Why Emacs?
1017 For some not-so-serious alternative reasons for Emacs to have that 1115 For some not-so-serious alternative reasons for Emacs to have that
1018 name, check out @file{etc/JOKES} (@pxref{Filename conventions}). 1116 name, check out the file @file{etc/JOKES} (@pxref{Filename
1117 conventions}).
1019 1118
1020 @node Latest version of Emacs, New in Emacs 20, Origin of the term Emacs, Status of Emacs 1119 @node Latest version of Emacs, New in Emacs 20, Origin of the term Emacs, Status of Emacs
1021 @section What is the latest version of Emacs? 1120 @section What is the latest version of Emacs?
1022 @cindex Version, latest 1121 @cindex Version, latest
1023 @cindex Latest version 1122 @cindex Latest version of Emacs
1024 1123
1025 Emacs 20.5 is the current version as of this writing. 1124 Emacs @value{VER} is the current version as of this writing.
1026 1125
1027 @node New in Emacs 20, , Latest version of Emacs, Status of Emacs 1126 @node New in Emacs 20, New in Emacs 21, Latest version of Emacs, Status of Emacs
1028 @section What is different about Emacs 20? 1127 @section What is different about Emacs 20?
1029 @cindex Differences between Emacs 19 and Emacs 20 1128 @cindex Differences between Emacs 19 and Emacs 20
1030 @cindex Emacs 20, new features in 1129 @cindex Emacs 20, new features in
1031 @cindex Recently introduced features
1032 1130
1033 To find out what has changed in recent versions, type @kbd{C-h n} 1131 To find out what has changed in recent versions, type @kbd{C-h n}
1034 (@kbd{M-x view-emacs-news}). The oldest changes are at the bottom of 1132 (@kbd{M-x view-emacs-news}). The oldest changes are at the bottom of
1035 the file, so you might want to read it starting there, rather than at 1133 the file, so you might want to read it starting there, rather than at
1036 the top. 1134 the top.
1039 the introduction of frames, faces, and colors on windowing systems was 1137 the introduction of frames, faces, and colors on windowing systems was
1040 obvious to even the most casual user. 1138 obvious to even the most casual user.
1041 1139
1042 There are differences between Emacs versions 19 and 20 as well, but many 1140 There are differences between Emacs versions 19 and 20 as well, but many
1043 are more subtle or harder to find. Among the changes are the inclusion 1141 are more subtle or harder to find. Among the changes are the inclusion
1044 of MULE code for languages that use non-Latin characters, the "customize" 1142 of MULE code for languages that use non-Latin characters and for mixing
1045 facility for modifying variables without having to use Lisp, and 1143 several languages in the same document; the ``Customize'' facility for
1046 automatic conversion of files from Macintosh, Microsoft, and Unix 1144 modifying variables without having to use Lisp; and automatic conversion
1047 platforms. 1145 of files from Macintosh, Microsoft, and Unix platforms.
1048 1146
1049 A number of older Lisp packages, such as Gnus, Supercite and the 1147 A number of older Lisp packages, such as Gnus, Supercite and the
1050 calendar/diary, have been updated and enhanced to work with Emacs 20, 1148 calendar/diary, have been updated and enhanced to work with Emacs 20,
1051 and are now included with the standard distribution. 1149 and are now included with the standard distribution.
1052 1150
1151
1152 @node New in Emacs 21, , New in Emacs 20, Status of Emacs
1153 @section What is different about Emacs 21?
1154 @cindex Differences between Emacs 20 and Emacs 21
1155 @cindex Emacs 21, new features in
1156 @cindex Recently introduced features
1157
1158 @cindex Variable-size fonts
1159 @cindex Toolbar support
1160 Emacs 21 features a thorough rewrite of the display engine. The new
1161 display engine supports variable-size fonts, images, and can play sounds
1162 on platforms which support that. As a result, the visual appearence of
1163 Emacs, when it runs on a windowed display, is much more reminiscent of
1164 modern GUI programs, and includes 3D widgets (used for the mode line and
1165 the scroll bars), a configurable and extensible toolbar, tooltips
1166 (a.k.a.@: balloon help), and other niceties.
1167
1168 @cindex Colors on character terminals
1169 @cindex TTY colors
1170 In addition, Emacs 21 supports faces on character terminals. This means
1171 that you can now have colors when you run Emacs on a GNU/Linux console
1172 and on @code{xterm} with @kbd{emacs -nw}.
1053 1173
1054 @c ------------------------------------------------------------ 1174 @c ------------------------------------------------------------
1055 @node Common requests, Bugs and problems, Status of Emacs, Top 1175 @node Common requests, Bugs and problems, Status of Emacs, Top
1056 @chapter Common requests 1176 @chapter Common requests
1057 @cindex Common requests 1177 @cindex Common requests
1058 1178
1059 @menu 1179 @menu
1060 * Setting up a customization file:: 1180 * Setting up a customization file::
1061 * Debugging a customization file:: 1181 * Debugging a customization file::
1182 * Colors on a TTY::
1062 * Displaying the current line or column:: 1183 * Displaying the current line or column::
1063 * Displaying the current filename in the titlebar:: 1184 * Displaying the current filename in the titlebar::
1064 * Turning on abbrevs by default:: 1185 * Turning on abbrevs by default::
1065 * Turning on auto-fill by default:: 1186 * Turning on auto-fill by default::
1066 * Associating modes with files:: 1187 * Associating modes with files::
1102 * Replacing highlighted text:: 1223 * Replacing highlighted text::
1103 * Editing MS-DOS files:: 1224 * Editing MS-DOS files::
1104 * Filling paragraphs with a single space:: 1225 * Filling paragraphs with a single space::
1105 @end menu 1226 @end menu
1106 1227
1107 @node Setting up a customization file, Debugging a customization file, Common requests, Common requests 1228 @node Setting up a customization file, Colors on a TTY, Common requests, Common requests
1108 @section How do I set up a @file{.emacs} file properly? 1229 @section How do I set up a @file{.emacs} file properly?
1109 @cindex @file{.emacs} file, setting up 1230 @cindex @file{.emacs} file, setting up
1110 @cindex Init file, setting up 1231 @cindex Init file, setting up
1111 @cindex Customization file, setting up 1232 @cindex Customization file, setting up
1112 1233
1115 In general, new Emacs users should not have @file{.emacs} files, because 1236 In general, new Emacs users should not have @file{.emacs} files, because
1116 it causes confusing non-standard behavior. Then they send questions to 1237 it causes confusing non-standard behavior. Then they send questions to
1117 @email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as 1238 @email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as
1118 documented. 1239 documented.
1119 1240
1120 Emacs 20 includes the new @code{customize} facility, which can be 1241 Beginning with version 20.1, Emacs includes the new Customize
1121 invoked using @kbd{M-x customize @key{RET}}. This allows users who are 1242 facility, which can be invoked using @kbd{M-x customize @key{RET}}.
1122 unfamiliar with Emacs Lisp to modify their @file{.emacs} files in a 1243 This allows users who are unfamiliar with Emacs Lisp to modify their
1123 relatively straightforward way, using menus rather than Lisp code. Not 1244 @file{.emacs} files in a relatively straightforward way, using menus
1124 all packages support Customize as of this writing, but the number is 1245 rather than Lisp code. Not all packages support Customize as of this
1125 growing fairly steadily. 1246 writing, but the number is growing fairly steadily.
1126 1247
1127 While @code{customize} might indeed make it easier to configure Emacs, 1248 While Customize might indeed make it easier to configure Emacs,
1128 consider taking a bit of time to learn Emacs Lisp and modifying your 1249 consider taking a bit of time to learn Emacs Lisp and modifying your
1129 @file{.emacs} directly. Simple configuration options are described 1250 @file{.emacs} directly. Simple configuration options are described
1130 rather completely in @inforef{Init File, Init File, emacs}, for users 1251 rather completely in @inforef{Init File, Init File, emacs}, for users
1131 interested in performing frequently requested, basic tasks. 1252 interested in performing frequently requested, basic tasks.
1132 1253
1133 @node Debugging a customization file, Displaying the current line or column, Setting up a customization file, Common requests 1254 @node Colors on a TTY, Debugging a customization file, Setting up a customization file, Common requests
1255 @section How do I get colors and syntax highlighting on a TTY?
1256 @cindex Colors on a TTY
1257 @cindex Syntax highlighting on a TTY
1258 @cindex Console, colors
1259
1260 As of Emacs 21.1, colors and faces are supported in non-windowed mode,
1261 i.e.@: on Unix and GNU/Linux character terminals and consoles, and when
1262 invoked as @samp{emacs -nw} on X and MS-Windows. (Colors and faces were
1263 supported in the MS-DOS port since Emacs 19.29.) Emacs automatically
1264 detects color support at startup and uses it if available. If you think
1265 that your terminal supports colors, but Emacs won't use them, check the
1266 @code{termcap} entry for your display type for color-related
1267 capabilities.
1268
1269 The command @kbd{M-x list-colors-display} pops up a window which
1270 exhibits all the colors Emacs knows about on the current display.
1271
1272 Syntax highlighting is usually turned off by default; see @ref{Turning
1273 on syntax highlighting}, for instructions how to turn it on.
1274
1275 @node Debugging a customization file, Displaying the current line or column, Colors on a TTY, Common requests
1134 @section How do I debug a @file{.emacs} file? 1276 @section How do I debug a @file{.emacs} file?
1135 @cindex Debugging @file{.emacs} file 1277 @cindex Debugging @file{.emacs} file
1136 @cindex @file{.emacs} debugging 1278 @cindex @file{.emacs} debugging
1137 @cindex Init file debugging 1279 @cindex Init file debugging
1138 @cindex @samp{-debug-init} 1280 @cindex @samp{-debug-init} option
1139 1281
1140 Start Emacs with the @samp{-debug-init} command-line option. This 1282 Start Emacs with the @samp{-debug-init} command-line option. This
1141 enables the Emacs Lisp debugger before evaluating your @file{.emacs} 1283 enables the Emacs Lisp debugger before evaluating your @file{.emacs}
1142 file, and places you in the debugger if something goes wrong. The top 1284 file, and places you in the debugger if something goes wrong. The top
1143 line in the @file{trace-back} buffer will be the error message, and the 1285 line in the @file{trace-back} buffer will be the error message, and the
1166 1308
1167 @lisp 1309 @lisp
1168 (setq line-number-mode t) 1310 (setq line-number-mode t)
1169 @end lisp 1311 @end lisp
1170 1312
1313 @noindent
1171 in your @file{.emacs} file to achieve this whenever you start Emacs. 1314 in your @file{.emacs} file to achieve this whenever you start Emacs.
1172 Note that Emacs will not display the line number if the buffer is larger 1315 (Line number display is on by default, unless your site-specific
1173 than the value of the variable @code{line-number-display-limit}. 1316 initialization disables it.) Note that Emacs will not display the line
1317 number if the buffer's size in bytes is larger than the value of the
1318 variable @code{line-number-display-limit}.
1174 1319
1175 As of Emacs 20, you can similarly display the current column with 1320 As of Emacs 20, you can similarly display the current column with
1176 @kbd{M-x column-number-mode}, or by putting the form 1321 @kbd{M-x column-number-mode}, or by putting the form
1177 1322
1178 @lisp 1323 @lisp
1179 (setq column-number-mode t) 1324 (setq column-number-mode t)
1180 @end lisp 1325 @end lisp
1181 1326
1327 @noindent
1182 in your @file{.emacs} file. 1328 in your @file{.emacs} file.
1183 1329
1184 The "%c" format specifier in the variable @code{mode-line-format} will 1330 The @code{"%c"} format specifier in the variable @code{mode-line-format}
1185 insert the current column's value into the mode line. See the 1331 will insert the current column's value into the mode line. See the
1186 documentation for @code{mode-line-format} (using @kbd{C-h v 1332 documentation for @code{mode-line-format} (using @kbd{C-h v
1187 mode-line-format @key{RET}}) for more information on how to set and use 1333 mode-line-format @key{RET}}) for more information on how to set and use
1188 this variable. 1334 this variable.
1189 1335
1190 Users of all Emacs versions can display the current column using 1336 Users of all Emacs versions can display the current column using the
1191 @email{abraham@@iesd.auc.dk, Per Abrahamsen's} "column" package. 1337 @samp{column} package written by @email{abraham@@dina.kvl.dk, Per
1192 @xref{Packages that do not come with Emacs}, for instructions on how to 1338 Abrahamsen}. @xref{Packages that do not come with Emacs}, for
1193 get it. 1339 instructions on how to get it.
1194 1340
1195 None of the vi emulation modes provide the "set number" capability of vi 1341 @cindex Set number capability in @code{vi} emulators
1196 (as far as we know). 1342 None of the @code{vi} emulation modes provide the ``set number''
1343 capability of @code{vi} (as far as we know).
1197 1344
1198 @node Displaying the current filename in the titlebar, Turning on abbrevs by default, Displaying the current line or column, Common requests 1345 @node Displaying the current filename in the titlebar, Turning on abbrevs by default, Displaying the current line or column, Common requests
1199 @section How can I modify the titlebar to contain the current filename? 1346 @section How can I modify the titlebar to contain the current filename?
1200 @cindex Titlebar, displaying the current filename in 1347 @cindex Titlebar, displaying the current filename in
1201 @cindex Filename, displaying in the titlebar 1348 @cindex Filename, displaying in the titlebar
1202 @cindex @code{frame-title-format} 1349 @cindex @code{frame-title-format}
1203 1350
1204 The contains of an Emacs frame's titlebar is controlled by the variable 1351 The contents of an Emacs frame's titlebar is controlled by the variable
1205 @code{frame-title-format}, which has the same structure as the variable 1352 @code{frame-title-format}, which has the same structure as the variable
1206 @code{mode-line-format}. (Use @kbd{C-h v} or @kbd{M-x 1353 @code{mode-line-format}. (Use @kbd{C-h v} or @kbd{M-x
1207 describe-variable} to get information about one or both of these 1354 describe-variable} to get information about one or both of these
1208 variables.) 1355 variables.)
1209 1356
1224 @lisp 1371 @lisp
1225 (setq frame-title-format "%b") 1372 (setq frame-title-format "%b")
1226 @end lisp 1373 @end lisp
1227 1374
1228 @node Turning on abbrevs by default, Turning on auto-fill by default, Displaying the current filename in the titlebar, Common requests 1375 @node Turning on abbrevs by default, Turning on auto-fill by default, Displaying the current filename in the titlebar, Common requests
1229 @section How do I turn on abbrevs by default just in mode XXX? 1376 @section How do I turn on abbrevs by default just in mode @var{mymode}?
1230 @cindex Abbrevs, turning on by default 1377 @cindex Abbrevs, turning on by default
1231 1378
1232 Put this in your @file{.emacs} file: 1379 Put this in your @file{.emacs} file:
1233 1380
1234 @lisp 1381 @lisp
1235 (condition-case () 1382 (condition-case ()
1236 (quietly-read-abbrev-file) 1383 (quietly-read-abbrev-file)
1237 (file-error nil)) 1384 (file-error nil))
1238 1385
1239 (add-hook 'XXX-mode-hook 1386 (add-hook '@var{mymode}-mode-hook
1240 (lambda () 1387 (lambda ()
1241 (setq abbrev-mode t))) 1388 (setq abbrev-mode t)))
1242 @end lisp 1389 @end lisp
1243 1390
1244 @node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests 1391 @node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests
1269 @cindex Associating modes with files 1416 @cindex Associating modes with files
1270 @cindex File extensions and modes 1417 @cindex File extensions and modes
1271 @cindex @code{auto-mode-alist}, modifying 1418 @cindex @code{auto-mode-alist}, modifying
1272 @cindex Modes, associating with file extensions 1419 @cindex Modes, associating with file extensions
1273 1420
1274 If you want to use XXX mode for all files which end with the extension 1421 If you want to use a certain mode @var{foo} for all files whose names end
1275 @samp{.YYY}, this will do it for you: 1422 with the extension @file{.@var{bar}}, this will do it for you:
1276 1423
1277 @lisp 1424 @lisp
1278 (setq auto-mode-alist (cons '("\\.YYY\\'" . XXX-mode) auto-mode-alist)) 1425 (setq auto-mode-alist (cons '("\\.@var{bar}\\'" . @var{foo}-mode) auto-mode-alist))
1279 @end lisp 1426 @end lisp
1280 1427
1281 Otherwise put this somewhere in the first line of any file you want to 1428 Otherwise put this somewhere in the first line of any file you want to
1282 edit in XXX mode (in the second line, if the first line begins with 1429 edit in the mode @var{foo} (in the second line, if the first line begins
1283 @samp{#!}): 1430 with @samp{#!}):
1284 1431
1285 @example 1432 @example
1286 -*-XXX-*- 1433 -*- @var{foo} -*-
1287 @end example 1434 @end example
1288 1435
1436 @cindex Major mode for shell scripts
1289 Beginning with Emacs 19, the variable @code{interpreter-mode-alist} 1437 Beginning with Emacs 19, the variable @code{interpreter-mode-alist}
1290 specifies which mode to use when loading a shell script. (Emacs 1438 specifies which mode to use when loading a shell script. (Emacs
1291 determines which interpreter you're using by examining the first line of 1439 determines which interpreter you're using by examining the first line of
1292 the file.) This feature only applies when the file name doesn't 1440 the script.) This feature only applies when the file name doesn't
1293 indicate which mode to use. Use @kbd{C-h v} (or @kbd{M-x 1441 indicate which mode to use. Use @kbd{C-h v} (or @kbd{M-x
1294 describe-variable}) on @code{interpreter-mode-alist} to learn more. 1442 describe-variable}) on @code{interpreter-mode-alist} to learn more.
1295 1443
1296 @node Working with unprintable characters, Highlighting a region, Associating modes with files, Common requests 1444 @node Working with unprintable characters, Highlighting a region, Associating modes with files, Common requests
1297 @section How do I search for, delete, or replace unprintable (eight-bit or control) characters? 1445 @section How do I search for, delete, or replace unprintable (eight-bit or control) characters?
1303 @cindex Regexps and unprintable characters 1451 @cindex Regexps and unprintable characters
1304 1452
1305 To search for a single character that appears in the buffer as, for 1453 To search for a single character that appears in the buffer as, for
1306 example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}. (This assumes 1454 example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}. (This assumes
1307 the value of @code{search-quote-char} is 17 (i.e., @kbd{C-q}).) 1455 the value of @code{search-quote-char} is 17 (i.e., @kbd{C-q}).)
1308 Searching for ALL unprintable characters is best done with a regular 1456 Searching for @strong{all} unprintable characters is best done with a
1309 expression ("regexp") search. The easiest regexp to use for the 1457 regular expression (@dfn{regexp}) search. The easiest regexp to use for
1310 unprintable chars is the complement of the regexp for the printable 1458 the unprintable chars is the complement of the regexp for the printable
1311 chars. 1459 chars.
1312 1460
1313 @itemize @bullet 1461 @itemize @bullet
1314 1462
1315 @item 1463 @item
1341 1489
1342 M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET} 1490 M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET}
1343 1491
1344 @itemize @bullet 1492 @itemize @bullet
1345 1493
1346 @item You don't need to quote @key{TAB} with either isearch or typing 1494 @item
1495 You don't need to quote @key{TAB} with either isearch or typing
1347 something in the minibuffer. 1496 something in the minibuffer.
1348 1497
1349 @end itemize 1498 @end itemize
1350 1499
1351 @node Highlighting a region, Controlling case sensitivity, Working with unprintable characters, Common requests 1500 @node Highlighting a region, Controlling case sensitivity, Working with unprintable characters, Common requests
1360 1509
1361 @lisp 1510 @lisp
1362 (transient-mark-mode t) 1511 (transient-mark-mode t)
1363 @end lisp 1512 @end lisp
1364 1513
1365 in your @file{.emacs} file. (Also see @xref{Turning on syntax highlighting}.) 1514 in your @file{.emacs} file. (Also see @ref{Turning on syntax
1515 highlighting}.)
1366 1516
1367 @node Controlling case sensitivity, Wrapping words automatically, Highlighting a region, Common requests 1517 @node Controlling case sensitivity, Wrapping words automatically, Highlighting a region, Common requests
1368 @section How do I control Emacs's case-sensitivity when searching/replacing? 1518 @section How do I control Emacs's case-sensitivity when searching/replacing?
1369 @cindex @code{case-fold-search} 1519 @cindex @code{case-fold-search}
1370 @cindex Case sensitivity of searches 1520 @cindex Case sensitivity of searches
1371 @cindex @code{case-replace}
1372 @cindex Searching without case sensitivity 1521 @cindex Searching without case sensitivity
1373 @cindex Ignoring case in searches 1522 @cindex Ignoring case in searches
1374 1523
1375 For searching, the value of the variable @code{case-fold-search} 1524 For searching, the value of the variable @code{case-fold-search}
1376 determines whether they are case sensitive: 1525 determines whether they are case sensitive:
1378 @lisp 1527 @lisp
1379 (setq case-fold-search nil) ; make searches case sensitive 1528 (setq case-fold-search nil) ; make searches case sensitive
1380 (setq case-fold-search t) ; make searches case insensitive 1529 (setq case-fold-search t) ; make searches case insensitive
1381 @end lisp 1530 @end lisp
1382 1531
1383 Similarly, for replacing the variable @code{case-replace} determines 1532 @cindex Case sensitivity in replacements
1533 @cindex Replacing, and case sensitivity
1534 @cindex @code{case-replace}
1535 Similarly, for replacing, the variable @code{case-replace} determines
1384 whether replacements preserve case. 1536 whether replacements preserve case.
1385 1537
1386 To change the case sensitivity just for one major mode, use the major 1538 To change the case sensitivity just for one major mode, use the major
1387 mode's hook. For example: 1539 mode's hook. For example:
1388 1540
1389 @lisp 1541 @lisp
1390 (add-hook 'XXX-mode-hook 1542 (add-hook '@var{foo}-mode-hook
1391 (lambda () 1543 (lambda ()
1392 (setq case-fold-search nil))) 1544 (setq case-fold-search nil)))
1393 @end lisp 1545 @end lisp
1394 1546
1395 @node Wrapping words automatically, Spell-checkers, Controlling case sensitivity, Common requests 1547 @node Wrapping words automatically, Spell-checkers, Controlling case sensitivity, Common requests
1396 @section How do I make Emacs wrap words for me? 1548 @section How do I make Emacs wrap words for me?
1397 @cindex Wrapping word automatically 1549 @cindex Wrapping word automatically
1550 @cindex Wrapping lines
1551 @cindex Line wrap
1398 @cindex @code{auto-fill-mode}, introduction to 1552 @cindex @code{auto-fill-mode}, introduction to
1399 @cindex Maximum line width, default value 1553 @cindex Maximum line width, default value
1400 @cindex @code{fill-column}, default value 1554 @cindex @code{fill-column}, default value
1401 1555
1402 Use @code{auto-fill-mode}, activated by typing @kbd{M-x auto-fill-mode}. 1556 Use @code{auto-fill-mode}, activated by typing @kbd{M-x auto-fill-mode}.
1403 The default maximum line width is 70, determined by the variable 1557 The default maximum line width is 70, determined by the variable
1404 @code{fill-column}. To learn how to turn this on automatically, @pxref{Turning on auto-fill by default}. 1558 @code{fill-column}. To learn how to turn this on automatically, see
1559 @ref{Turning on auto-fill by default}.
1405 1560
1406 @node Spell-checkers, Checking TeX and *roff documents, Wrapping words automatically, Common requests 1561 @node Spell-checkers, Checking TeX and *roff documents, Wrapping words automatically, Common requests
1407 @section Where can I get a better spelling checker for Emacs? 1562 @section Where can I get a better spelling checker for Emacs?
1408 @cindex Checking spelling 1563 @cindex Checking spelling
1409 @cindex Spelling, checking text documents 1564 @cindex Spelling, checking text documents
1423 @cindex @code{load-path}, modifying 1578 @cindex @code{load-path}, modifying
1424 @cindex Modifying @code{load-path} 1579 @cindex Modifying @code{load-path}
1425 @cindex Adding to @code{load-path} 1580 @cindex Adding to @code{load-path}
1426 1581
1427 In general, you should only add to the @code{load-path}. You can add 1582 In general, you should only add to the @code{load-path}. You can add
1428 directory @var{/XXX/YYY} to the load path like this: 1583 directory @var{/dir/subdir} to the load path like this:
1429 1584
1430 @lisp 1585 @lisp
1431 (setq load-path (cons "/XXX/YYY/" load-path)) 1586 (setq load-path (cons "/dir/subdir/" load-path))
1432 @end lisp 1587 @end lisp
1433 1588
1434 To do this relative to your home directory: 1589 To do this relative to your home directory:
1435 1590
1436 @lisp 1591 @lisp
1437 (setq load-path (cons "~/YYY/" load-path) 1592 (setq load-path (cons "~/mysubdir/" load-path)
1438 @end lisp 1593 @end lisp
1439 1594
1440 @node Using an already running Emacs process, Compiler error messages, Changing load-path, Common requests 1595 @node Using an already running Emacs process, Compiler error messages, Changing load-path, Common requests
1441 @section How do I use an already running Emacs from another window? 1596 @section How do I use an already running Emacs from another window?
1442 @cindex @code{emacsclient} 1597 @cindex @code{emacsclient}
1449 expecting the request. 1604 expecting the request.
1450 1605
1451 @itemize @bullet 1606 @itemize @bullet
1452 1607
1453 @item 1608 @item
1454 Setup 1609 Setup:
1455 1610
1456 Emacs must have executed the @code{server-start} function for 1611 Emacs must have executed the @code{server-start} function for
1457 @samp{emacsclient} to work. This can be done either by a command line 1612 @samp{emacsclient} to work. This can be done either by a command line
1458 option: 1613 option:
1459 1614
1462 @end example 1617 @end example
1463 1618
1464 or by invoking @code{server-start} from @file{.emacs}: 1619 or by invoking @code{server-start} from @file{.emacs}:
1465 1620
1466 @lisp 1621 @lisp
1467 (if (some conditions are met) (server-start)) 1622 (if (@var{some conditions are met}) (server-start))
1468 @end lisp 1623 @end lisp
1469 1624
1470 When this is done, Emacs starts a subprocess running a program called 1625 When this is done, Emacs starts a subprocess running a program called
1471 @samp{server}. @samp{server} creates a Unix domain socket. The socket 1626 @samp{server}. @samp{server} creates a Unix domain socket. The socket
1472 is either named @file{.emacs_server}, in the user's home directory, 1627 is either named @file{.emacs_server}, in the user's home directory,
1473 or @file{esrv-@var{USER-ID}-@var{SYSTEM-NAME}}, in the @file{/tmp} 1628 or @file{esrv-@var{user-id}-@var{system-name}}, in the @file{/tmp}
1474 directory, depending on how @samp{emacsserver} was compiled. 1629 directory, depending on how @samp{emacsserver} was compiled.
1475 1630
1476 To get your news reader, mail reader, etc., to invoke 1631 To get your news reader, mail reader, etc., to invoke
1477 @samp{emacsclient}, try setting the environment variable @code{EDITOR} 1632 @samp{emacsclient}, try setting the environment variable @code{EDITOR}
1478 (or sometimes @code{VISUAL}) to the value @samp{emacsclient}. You may 1633 (or sometimes @code{VISUAL}) to the value @samp{emacsclient}. You may
1488 1643
1489 # sh command: 1644 # sh command:
1490 EDITOR=emacsclient ; export EDITOR 1645 EDITOR=emacsclient ; export EDITOR
1491 @end example 1646 @end example
1492 1647
1493 @item Normal use 1648 @item
1649 Normal use:
1494 1650
1495 When @samp{emacsclient} is run, it connects to the @file{.emacs_server} 1651 When @samp{emacsclient} is run, it connects to the @file{.emacs_server}
1496 socket and passes its command line options to @samp{server}. When 1652 socket and passes its command line options to @samp{server}. When
1497 @samp{server} receives these requests, it sends this information on the 1653 @samp{server} receives these requests, it sends this information to the
1498 the Emacs process, which at the next opportunity will visit the files 1654 the Emacs process, which at the next opportunity will visit the files
1499 specified. (Line numbers can be specified just like with Emacs.) The 1655 specified. (Line numbers can be specified just like with Emacs.) The
1500 user will have to switch to the Emacs window by hand. When the user is 1656 user will have to switch to the Emacs window by hand. When the user is
1501 done editing a file, the user can type @kbd{C-x #} (or @kbd{M-x 1657 done editing a file, the user can type @kbd{C-x #} (or @kbd{M-x
1502 server-edit}) to indicate this. If there is another buffer requested by 1658 server-edit}) to indicate this. If there is another buffer requested by
1503 emacsclient, Emacs will switch to it; otherwise emacsclient will exit, 1659 @code{emacsclient}, Emacs will switch to it; otherwise
1504 signaling the calling program to continue. 1660 @code{emacsclient} will exit, signaling the calling program to continue.
1505 1661
1506 @samp{emacsclient} and @samp{server} must be running on machines which 1662 @samp{emacsclient} and @samp{server} must be running on machines which
1507 share the same filesystem for this to work. The pathnames that 1663 share the same filesystem for this to work. The pathnames that
1508 @samp{emacsclient} specifies should be correct for the filesystem that 1664 @samp{emacsclient} specifies should be correct for the filesystem that
1509 the Emacs process sees. The Emacs process should not be suspended at 1665 the Emacs process sees. The Emacs process should not be suspended at
1510 the time @samp{emacsclient} is invoked. @samp{emacsclient} should 1666 the time @samp{emacsclient} is invoked. On Unix and GNU/Linux systems,
1511 either be invoked from another X window or from a shell window inside 1667 @samp{emacsclient} should either be invoked from another X window or
1512 Emacs itself. 1668 from a shell window inside Emacs itself.
1513 1669
1670 @cindex @code{gnuserv}
1514 There is an enhanced version of @samp{emacsclient}/server called 1671 There is an enhanced version of @samp{emacsclient}/server called
1515 @samp{gnuserv} by @email{ange@@hplb.hpl.hp.com, Andy Norman} which is 1672 @samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman}
1516 available in the Emacs Lisp Archive (@pxref{Packages that do not come 1673 which is available in the Emacs Lisp Archive (@pxref{Packages that do
1517 with Emacs}). @samp{gnuserv} uses Internet domain sockets, so it can 1674 not come with Emacs}). @samp{gnuserv} uses Internet domain sockets, so
1518 work across most network connections. It also supports the execution of 1675 it can work across most network connections. It also supports the
1519 arbitrary Emacs Lisp forms and does not require the client program to 1676 execution of arbitrary Emacs Lisp forms and does not require the client
1520 wait for completion. 1677 program to wait for completion.
1521 1678
1522 The alpha version of an enhanced @samp{gnuserv} is available 1679 The alpha version of an enhanced @samp{gnuserv} is available at
1523 at
1524 1680
1525 @uref{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz} 1681 @uref{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz}
1526 1682
1527 @end itemize 1683 @end itemize
1528 1684
1532 @cindex Recognizing non-standard compiler errors 1688 @cindex Recognizing non-standard compiler errors
1533 @cindex Regexps for recognizing compiler errors 1689 @cindex Regexps for recognizing compiler errors
1534 @cindex Errors, recognizing compiler 1690 @cindex Errors, recognizing compiler
1535 1691
1536 The variable @code{compilation-error-regexp-alist} helps control how 1692 The variable @code{compilation-error-regexp-alist} helps control how
1537 Emacs parses your compiler output. It is a list of triples of the form: 1693 Emacs parses your compiler output. It is a list of triplets of the form:
1538 @code{(@var{regexp} @var{file-idx} @var{line-idx})}, where @var{regexp}, @var{file-idx} and 1694 @code{(@var{regexp} @var{file-idx} @var{line-idx})}, where @var{regexp},
1539 @var{line-idx} are strings. To help determine what the constituent 1695 @var{file-idx} and @var{line-idx} are strings. To help determine what
1540 elements should be, load @file{compile.el} and then use @kbd{C-h v 1696 the constituent elements should be, load @file{compile.el} and then type
1541 compilation-error-regexp-alist @key{RET}} 1697 @kbd{C-h v compilation-error-regexp-alist @key{RET}} to see the current
1542 1698 value. A good idea is to look at @file{compile.el} itself as the
1543 to see the current value. A good idea is to look at @file{compile.el} 1699 comments included for this variable are quite useful---the regular
1544 itself as the comments included for this variable are quite useful --- 1700 expressions required for your compiler's output may be very close to one
1545 the regular expressions required for your compiler's output may be very 1701 already provided. Once you have determined the proper regexps, use the
1546 close to one already provided. Once you have determined the proper 1702 following to inform Emacs of your changes:
1547 regexps, use the following to inform Emacs of your changes:
1548 1703
1549 @lisp 1704 @lisp
1550 (setq compilation-error-regexp-alist 1705 (setq compilation-error-regexp-alist
1551 (cons '(REGEXP FILE-IDX LINE-IDX) 1706 (cons '(@var{regexp} @var{file-idx} @var{line-idx})
1552 compilation-error-regexp-alist)) 1707 compilation-error-regexp-alist))
1553 @end lisp 1708 @end lisp
1554 1709
1555 @node Indenting switch statements, Horizontal scrolling, Compiler error messages, Common requests 1710 @node Indenting switch statements, Horizontal scrolling, Compiler error messages, Common requests
1556 @section How do I change the indentation for @code{switch}? 1711 @section How do I change the indentation for @code{switch}?
1577 1732
1578 The solution at first appears to be: set @code{c-indent-level} to 4 and 1733 The solution at first appears to be: set @code{c-indent-level} to 4 and
1579 @code{c-label-offset} to -2. However, this will give you an indentation 1734 @code{c-label-offset} to -2. However, this will give you an indentation
1580 spacing of four instead of two. 1735 spacing of four instead of two.
1581 1736
1582 The solution is to use @code{cc-mode} (the default mode for C 1737 The @emph{real} solution is to use @code{cc-mode} (the default mode for
1583 programming in Emacs 20) and add the following line: 1738 C programming in Emacs 20 and later) and add the following line to yoyr
1739 @file{.emacs}:
1584 1740
1585 @lisp 1741 @lisp
1586 (c-set-offset 'case-label '+) 1742 (c-set-offset 'case-label '+)
1587 @end lisp 1743 @end lisp
1588 1744
1592 @section How can I make Emacs automatically scroll horizontally? 1748 @section How can I make Emacs automatically scroll horizontally?
1593 @cindex @code{hscroll-mode} 1749 @cindex @code{hscroll-mode}
1594 @cindex Horizontal scrolling 1750 @cindex Horizontal scrolling
1595 @cindex Scrolling horizontally 1751 @cindex Scrolling horizontally
1596 1752
1597 Use @code{hscroll-mode}, included in Emacs 20. Here is some information from 1753 In Emacs 21 and later, this is on by default: if the variable
1754 @code{truncate-lines} is non-@code{nil} in the current buffer, Emacs
1755 automatically scrolls the display horizontally when point moves off the
1756 left or right edge of the window.
1757
1758 In Emacs 20, use the @code{hscroll-mode}. Here is some information from
1598 the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}: 1759 the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}:
1599 1760
1600 Automatically scroll horizontally when the point moves off the 1761 Automatically scroll horizontally when the point moves off the
1601 left or right edge of the window. 1762 left or right edge of the window.
1602 1763
1603 @itemize @minus 1764 @itemize @minus
1604 1765 @item
1605 @item Type @kbd{M-x hscroll-mode} to enable it in the current buffer. 1766 Type @kbd{M-x hscroll-mode} to enable it in the current buffer.
1606 @item Type @kbd{M-x hscroll-global-mode} to enable it in every buffer. 1767
1607 @item @code{turn-on-hscroll} is useful in mode hooks as in: 1768 @item
1769 Type @kbd{M-x hscroll-global-mode} to enable it in every buffer.
1770
1771 @item
1772 @code{turn-on-hscroll} is useful in mode hooks as in:
1608 1773
1609 @lisp 1774 @lisp
1610 (add-hook 'text-mode-hook 'turn-on-hscroll) 1775 (add-hook 'text-mode-hook 'turn-on-hscroll)
1611 @end lisp 1776 @end lisp
1612 1777
1613 @item @code{hscroll-margin} controls how close the cursor can get to the 1778 @item
1779 @code{hscroll-margin} controls how close the cursor can get to the
1614 edge of the window. 1780 edge of the window.
1615 1781
1616 @item @code{hscroll-step-percent} controls how far to jump once we decide to do so. 1782 @item
1617 1783 @code{hscroll-step-percent} controls how far to jump once we decide to do so.
1618 @end itemize 1784 @end itemize
1619 1785
1620 @node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests 1786 @node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests
1621 @section How do I make Emacs "typeover" or "overwrite" instead of inserting? 1787 @section How do I make Emacs "typeover" or "overwrite" instead of inserting?
1622 @cindex @key{Insert} 1788 @cindex @key{Insert}
1626 1792
1627 @kbd{M-x overwrite-mode} (a minor mode). This toggles 1793 @kbd{M-x overwrite-mode} (a minor mode). This toggles
1628 @code{overwrite-mode} on and off, so exiting from @code{overwrite-mode} 1794 @code{overwrite-mode} on and off, so exiting from @code{overwrite-mode}
1629 is as easy as another @kbd{M-x overwrite-mode}. 1795 is as easy as another @kbd{M-x overwrite-mode}.
1630 1796
1631 On some workstations, @key{Insert} toggles @code{overwrite-mode} on and off. 1797 On some systems, @key{Insert} toggles @code{overwrite-mode} on and off.
1632 1798
1633 @node Turning off beeping, Turning the volume down, Overwrite mode, Common requests 1799 @node Turning off beeping, Turning the volume down, Overwrite mode, Common requests
1634 @section How do I stop Emacs from beeping on a terminal? 1800 @section How do I stop Emacs from beeping on a terminal?
1635 @cindex Beeping, turning off 1801 @cindex Beeping, turning off
1636 @cindex Visible bell 1802 @cindex Visible bell
1637 @cindex Bell, visible 1803 @cindex Bell, visible
1638 1804
1639 @email{martin@@cc.gatech.edu, Martin R. Frank} writes: 1805 @email{martin@@cc.gatech.edu, Martin R. Frank} writes:
1640 1806
1641 Tell Emacs to use the "visible bell" instead of the audible bell, and 1807 Tell Emacs to use the @dfn{visible bell} instead of the audible bell,
1642 set the visible bell to nothing. 1808 and set the visible bell to nothing.
1643 1809
1644 That is, put the following in your @code{TERMCAP} environment variable 1810 That is, put the following in your @code{TERMCAP} environment variable
1645 (assuming you have one): 1811 (assuming you have one):
1646 1812
1647 @example 1813 @example
1657 @node Turning the volume down, Automatic indentation, Turning off beeping, Common requests 1823 @node Turning the volume down, Automatic indentation, Turning off beeping, Common requests
1658 @section How do I turn down the bell volume in Emacs running under X Windows? 1824 @section How do I turn down the bell volume in Emacs running under X Windows?
1659 @cindex Bell, volume of 1825 @cindex Bell, volume of
1660 @cindex Volume of bell 1826 @cindex Volume of bell
1661 1827
1662 You can adjust the bell volume and duration for all programs with the 1828 On X Window system, you can adjust the bell volume and duration for all
1663 shell command @file{xset}. 1829 programs with the shell command @code{xset}.
1664 1830
1665 Invoking @file{xset} without any arguments produces some basic information, 1831 Invoking @code{xset} without any arguments produces some basic
1666 including the following: 1832 information, including the following:
1667 1833
1668 @example 1834 @example
1669 usage: xset [-display host:dpy] option ... 1835 usage: xset [-display host:dpy] option ...
1670 To turn bell off: 1836 To turn bell off:
1671 -b b off b 0 1837 -b b off b 0
1676 @node Automatic indentation, Matching parentheses, Turning the volume down, Common requests 1842 @node Automatic indentation, Matching parentheses, Turning the volume down, Common requests
1677 @section How do I tell Emacs to automatically indent a new line to the indentation of the previous line? 1843 @section How do I tell Emacs to automatically indent a new line to the indentation of the previous line?
1678 @cindex Indenting new lines 1844 @cindex Indenting new lines
1679 @cindex New lines, indenting of 1845 @cindex New lines, indenting of
1680 @cindex Previous line, indenting according to 1846 @cindex Previous line, indenting according to
1681 1847 @cindex Text indentation
1682 Such behavior is automatic in Emacs 20. From the NEWS file for Emacs 1848
1683 20.2: 1849 Such behavior is automatic in Emacs 20 and later. From the
1850 @file{etc/NEWS} file for Emacs 20.2:
1684 1851
1685 @example 1852 @example
1686 ** In Text mode, now only blank lines separate paragraphs. This makes 1853 ** In Text mode, now only blank lines separate paragraphs. This makes
1687 it possible to get the full benefit of Adaptive Fill mode in Text mode, 1854 it possible to get the full benefit of Adaptive Fill mode in Text mode,
1688 and other modes derived from it (such as Mail mode). @key{TAB} in Text 1855 and other modes derived from it (such as Mail mode). @key{TAB} in Text
1694 1861
1695 If you want spaces at the beginning of a line to start a paragraph, use 1862 If you want spaces at the beginning of a line to start a paragraph, use
1696 the new mode, Paragraph Indent Text mode. 1863 the new mode, Paragraph Indent Text mode.
1697 @end example 1864 @end example
1698 1865
1699 If you have @code{auto-fill-mode} on (@pxref{Turning on auto-fill by 1866 @cindex Prefixing lines
1700 default}), you can tell Emacs to prefix every line with a certain 1867 @cindex Fill prefix
1701 character sequence, the "fill prefix." Type the prefix at the beginning 1868 If you have @code{auto-fill-mode} turned on (@pxref{Turning on auto-fill
1702 of a line, position point after it, and then type @kbd{C-x .} 1869 by default}), you can tell Emacs to prefix every line with a certain
1870 character sequence, the @dfn{fill prefix}. Type the prefix at the
1871 beginning of a line, position point after it, and then type @kbd{C-x .}
1703 (@code{set-fill-prefix}) to set the fill prefix. Thereafter, 1872 (@code{set-fill-prefix}) to set the fill prefix. Thereafter,
1704 auto-filling will automatically put the fill prefix at the beginning of 1873 auto-filling will automatically put the fill prefix at the beginning of
1705 new lines, and @kbd{M-q} (@code{fill-paragraph}) will maintain any fill 1874 new lines, and @kbd{M-q} (@code{fill-paragraph}) will maintain any fill
1706 prefix when refilling the paragraph. 1875 prefix when refilling the paragraph.
1707 1876
1708 If you have paragraphs with different levels of indentation, you will 1877 If you have paragraphs with different levels of indentation, you will
1709 have to set the fill prefix to the correct value each time you move to a 1878 have to set the fill prefix to the correct value each time you move to a
1710 new paragraph. To avoid this hassle, try one of the many packages 1879 new paragraph. To avoid this hassle, try one of the many packages
1711 available from the Emacs Lisp Archive (@pxref{Packages that do not come 1880 available from the Emacs Lisp Archive (@pxref{Packages that do not come
1712 with Emacs}.) Look up "fill" and "indent" in the Lisp Code Directory 1881 with Emacs}.) Look up ``fill'' and ``indent'' in the Lisp Code
1713 for guidance. 1882 Directory for guidance.
1714 1883
1715 @node Matching parentheses, Hiding #ifdef lines, Automatic indentation, Common requests 1884 @node Matching parentheses, Hiding #ifdef lines, Automatic indentation, Common requests
1716 @section How do I show which parenthesis matches the one I'm looking at? 1885 @section How do I show which parenthesis matches the one I'm looking at?
1717 @cindex Parentheses, matching 1886 @cindex Parentheses, matching
1718 @cindex @file{paren.el} 1887 @cindex @file{paren.el}
1735 1904
1736 @lisp 1905 @lisp
1737 (show-paren-mode 1) 1906 (show-paren-mode 1)
1738 @end lisp 1907 @end lisp
1739 1908
1740 @code{customize} will let you turn on @code{show-paren-mode}. Use 1909 Customize will let you turn on @code{show-paren-mode}. Use @kbd{M-x
1741 @kbd{M-x customize-group @key{RET} paren-showing @key{RET}}. From 1910 customize-group @key{RET} paren-showing @key{RET}}. From within
1742 within @code{customize}, you can also go directly to the "paren-showing" 1911 Customize, you can also go directly to the ``paren-showing'' group.
1743 group. 1912
1744 1913 Alternatives to paren include:
1745 Alternatives to paren include:
1746 1914
1747 @itemize @bullet 1915 @itemize @bullet
1748 1916
1749 @item 1917 @item
1750 If you're looking at a right parenthesis (or brace or bracket) you can 1918 If you're looking at a right parenthesis (or brace or bracket) you can
1751 delete it and reinsert it. Emacs will blink the cursor on the matching 1919 delete it and reinsert it. Emacs will momentarily move the cursor to
1752 parenthesis. 1920 the matching parenthesis.
1753 1921
1754 @item 1922 @item
1755 @kbd{M-C-f} (@code{forward-sexp}) and @kbd{M-C-b} (@code{backward-sexp}) 1923 @kbd{M-C-f} (@code{forward-sexp}) and @kbd{M-C-b} (@code{backward-sexp})
1756 will skip over one set of balanced parentheses, so you can see which 1924 will skip over one set of balanced parentheses, so you can see which
1757 parentheses match. (You can train it to skip over balanced brackets 1925 parentheses match. (You can train it to skip over balanced brackets
1758 and braces at the same time by modifying the syntax @key{TAB}le.) 1926 and braces at the same time by modifying the syntax table.)
1759 1927
1928 @cindex Show matching paren as in @code{vi}
1760 @item 1929 @item
1761 Here is some Emacs Lisp that will make the @key{%} key show the matching 1930 Here is some Emacs Lisp that will make the @key{%} key show the matching
1762 parenthesis, like in vi. In addition, if the cursor isn't over a 1931 parenthesis, like in @code{vi}. In addition, if the cursor isn't over a
1763 parenthesis, it simply inserts a % like normal. 1932 parenthesis, it simply inserts a % like normal.
1764 1933
1765 @lisp 1934 @lisp
1766 ;; By an unknown contributor 1935 ;; By an unknown contributor
1767 1936
1788 to try @file{cpp.el}, available at the Emacs Lisp Archive 1957 to try @file{cpp.el}, available at the Emacs Lisp Archive
1789 (@pxref{Packages that do not come with Emacs}). 1958 (@pxref{Packages that do not come with Emacs}).
1790 1959
1791 @node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests 1960 @node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests
1792 @section Is there an equivalent to the @code{.} (dot) command of vi? 1961 @section Is there an equivalent to the @code{.} (dot) command of vi?
1793 @cindex Repeating commands as with vi 1962 @cindex Repeating commands as with @code{vi}
1794 @cindex Command, repeat last 1963 @cindex Command, repeat last
1795 @cindex @code{.}, equivalent to vi command 1964 @cindex @code{.}, equivalent to @code{vi} command
1796 1965
1797 (@code{.} is the redo command in vi. It redoes the last insertion/deletion.) 1966 (@code{.} is the redo command in @code{vi}. It redoes the last
1798 1967 insertion/deletion.)
1799 As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x .}) 1968
1969 As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x z})
1800 that repeats the last command. If you preface it with a prefix 1970 that repeats the last command. If you preface it with a prefix
1801 argument, the prefix arg is applied to the command. 1971 argument, the prefix arg is applied to the command.
1802 1972
1803 You can also type @kbd{C-x @key{ESC} @key{ESC}} 1973 You can also type @kbd{C-x @key{ESC} @key{ESC}}
1804 (@code{repeat-complex-command}) to reinvoke commands that used the 1974 (@code{repeat-complex-command}) to reinvoke commands that used the
1805 minibuffer to get arguments. In @code{repeat-complex-command} you can 1975 minibuffer to get arguments. In @code{repeat-complex-command} you can
1806 type @kbd{M-p} and @kbd{M-n} to scan through all the different complex 1976 type @kbd{M-p} and @kbd{M-n} (and also up-arrow and down-arrow, if your
1977 keyboard has these keys) to scan through all the different complex
1807 commands you've typed. 1978 commands you've typed.
1808 1979
1809 To repeat a set of commands, use keyboard macros. (@inforef{Keyboard 1980 To repeat a set of commands, use keyboard macros. (@inforef{Keyboard
1810 Macros, Keyboard Macros, emacs}.) 1981 Macros, Keyboard Macros, emacs}.)
1811 1982
1812 If you're really desperate for the @code{.} command, use VIPER, which comes 1983 If you're really desperate for the @code{.} command, use VIPER, a
1813 with Emacs, and which appears to support it. (@xref{VIPER}.) 1984 @code{vi} emulation mode which comes with Emacs, and which appears to
1985 support it. (@xref{VIPER}.)
1814 1986
1815 @node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests 1987 @node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests
1816 @section What are the valid X resource settings (i.e., stuff in .Xdefaults)? 1988 @section What are the valid X resource settings (i.e., stuff in .Xdefaults)?
1817 @cindex Resources, X 1989 @cindex Resources, X
1818 @cindex X resources 1990 @cindex X resources
1827 @node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests 1999 @node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests
1828 @section How do I execute ("evaluate") a piece of Emacs Lisp code? 2000 @section How do I execute ("evaluate") a piece of Emacs Lisp code?
1829 @cindex Evaluating Lisp code 2001 @cindex Evaluating Lisp code
1830 @cindex Lisp forms, evaluating 2002 @cindex Lisp forms, evaluating
1831 2003
1832 There are a number of ways to execute ("evaluate," in Lisp lingo) an 2004 There are a number of ways to execute (@dfn{evaluate}, in Lisp lingo) an
1833 Emacs Lisp "form": 2005 Emacs Lisp @dfn{form}:
1834 2006
1835 @itemize @bullet 2007 @itemize @bullet
1836 2008
1837 @item 2009 @item
1838 If you want it evaluated every time you run Emacs, put it in a file 2010 If you want it evaluated every time you run Emacs, put it in a file
1839 named @file{.emacs} in your home directory. This is known as your ".emacs 2011 named @file{.emacs} in your home directory. This is known as ``your
1840 file," and contains all of your personal customizations. 2012 @file{.emacs} file,'' and contains all of your personal customizations.
1841 2013
1842 @item 2014 @item
1843 You can type the form in the @file{*scratch*} buffer, and then type 2015 You can type the form in the @file{*scratch*} buffer, and then type
1844 @key{LFD} (or @kbd{C-j}) after it. The result of evaluating the form 2016 @key{LFD} (or @kbd{C-j}) after it. The result of evaluating the form
1845 will be inserted in the buffer. 2017 will be inserted in the buffer.
1852 Typing @kbd{C-x C-e} in any buffer evaluates the Lisp form immediately 2024 Typing @kbd{C-x C-e} in any buffer evaluates the Lisp form immediately
1853 before point and prints its value in the echo area. 2025 before point and prints its value in the echo area.
1854 2026
1855 @item 2027 @item
1856 Typing @kbd{M-:} or @kbd{M-x eval-expression} allows you to type a Lisp 2028 Typing @kbd{M-:} or @kbd{M-x eval-expression} allows you to type a Lisp
1857 form in the minibuffer which will be evaluated. 2029 form in the minibuffer which will be evaluated once you press @key{RET}.
1858 2030
1859 @item 2031 @item
1860 You can use @kbd{M-x load-file} to have Emacs evaluate all the Lisp 2032 You can use @kbd{M-x load-file} to have Emacs evaluate all the Lisp
1861 forms in a file. (To do this from Lisp use the function @code{load} 2033 forms in a file. (To do this from Lisp use the function @code{load}
1862 instead.) 2034 instead.)
1863 2035
1864 The functions @code{load-library}, @code{eval-region}, 2036 The functions @code{load-library}, @code{eval-region},
1865 @code{eval-current-buffer}, @code{require}, and @code{autoload} are also 2037 @code{eval-current-buffer}, @code{require}, and @code{autoload} are also
1866 useful; @pxref{Emacs Lisp documentation} if you want to learn more about 2038 useful; see @ref{Emacs Lisp documentation}, if you want to learn more
1867 them. 2039 about them.
1868 2040
1869 @end itemize 2041 @end itemize
1870 2042
1871 @node Changing the length of a Tab, Inserting > at the beginning of each line, Evaluating Emacs Lisp code, Common requests 2043 @node Changing the length of a Tab, Inserting > at the beginning of each line, Evaluating Emacs Lisp code, Common requests
1872 @section How do I change Emacs's idea of the @key{TAB} character's length? 2044 @section How do I change Emacs's idea of the @key{TAB} character's length?
1903 want to prefix, move the cursor to last line to be prefixed, and type 2075 want to prefix, move the cursor to last line to be prefixed, and type
1904 @kbd{C-x r t > @key{RET}}. To do this for the whole buffer, type 2076 @kbd{C-x r t > @key{RET}}. To do this for the whole buffer, type
1905 @kbd{C-x h C-x r t > @key{RET}}. 2077 @kbd{C-x h C-x r t > @key{RET}}.
1906 2078
1907 If you are trying to prefix a yanked mail message with @samp{>}, you 2079 If you are trying to prefix a yanked mail message with @samp{>}, you
1908 might want to set the variable @code{mail-yank-prefix}. Better yet, get 2080 might want to set the variable @code{mail-yank-prefix}. Better yet, use
1909 the Supercite package (@pxref{Supercite}), which provides flexible 2081 the Supercite package (@pxref{Supercite}), which provides flexible
1910 citation for yanked mail and news messages. @xref{Changing the included 2082 citation for yanked mail and news messages; it is included in Emacs
1911 text prefix}, for additional information. 2083 since version 19.20. @xref{Changing the included text prefix}, for
2084 additional information.
1912 2085
1913 @node Underlining paragraphs, Repeating a command as many times as possible, Inserting > at the beginning of each line, Common requests 2086 @node Underlining paragraphs, Repeating a command as many times as possible, Inserting > at the beginning of each line, Common requests
1914 @section How do I insert "_^H" before each character in a region to get an underlined paragraph? 2087 @section How do I insert "_^H" before each character in a region to get an underlined paragraph?
1915 @cindex Underlining a region of text 2088 @cindex Underlining a region of text
1916 @cindex @code{underline-region} 2089 @cindex @code{underline-region}
1917 2090
1918 @kbd{M-x underline-region}. 2091 Mark the region and then type @kbd{M-x underline-region @key{RET}}.
1919 2092
1920 @node Repeating a command as many times as possible, Forcing the cursor to remain in the same column, Underlining paragraphs, Common requests 2093 @node Repeating a command as many times as possible, Forcing the cursor to remain in the same column, Underlining paragraphs, Common requests
1921 @section How do I repeat a command as many times as possible? 2094 @section How do I repeat a command as many times as possible?
1922 @cindex Repeating commands 2095 @cindex Repeating commands many times
1923 @cindex Commands, repeating 2096 @cindex Commands, repeating many times
1924 2097
1925 Use @kbd{C-x (} and @kbd{C-x )} to make a keyboard macro that invokes 2098 Use @kbd{C-x (} and @kbd{C-x )} to make a keyboard macro that invokes
1926 the command and then type @kbd{M-0 C-x e}. 2099 the command and then type @kbd{M-0 C-x e}.
1927 2100
1928 Any messages your command prints in the echo area will be suppressed. 2101 Any messages your command prints in the echo area will be suppressed.
2102
2103 If you need to repeat a command a small number of times, you can use
2104 @kbd{C-x z}, see @ref{Repeating commands}.
1929 2105
1930 @node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests 2106 @node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests
1931 @section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short? 2107 @section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short?
1932 @cindex @code{picture-mode} 2108 @cindex @code{picture-mode}
1933 @cindex Remaining in the same column, regardless of contents 2109 @cindex Remaining in the same column, regardless of contents
1952 @cindex Unix regeps, differences from Emacs 2128 @cindex Unix regeps, differences from Emacs
1953 @cindex Text strings, putting regexps in 2129 @cindex Text strings, putting regexps in
1954 2130
1955 @inforef{Regexps, Regexps, emacs}. 2131 @inforef{Regexps, Regexps, emacs}.
1956 2132
1957 The "or" operator is @samp{\|}, not @samp{|}, and the grouping operators 2133 The @code{or} operator is @samp{\|}, not @samp{|}, and the grouping operators
1958 are @samp{\(} and @samp{\)}. Also, the string syntax for a backslash is 2134 are @samp{\(} and @samp{\)}. Also, the string syntax for a backslash is
1959 @samp{\\}. To specify a regular expression like @samp{xxx\(foo\|bar\)} 2135 @samp{\\}. To specify a regular expression like @samp{xxx\(foo\|bar\)}
1960 in a Lisp string, use @samp{xxx\\(foo\\|bar\\)}. 2136 in a Lisp string, use @samp{xxx\\(foo\\|bar\\)}.
1961 2137
1962 Notice the doubled backslashes! 2138 Note the doubled backslashes!
1963 2139
1964 @itemize @bullet 2140 @itemize @bullet
1965 2141
1966 @item Unlike in Unix @file{grep}, @file{sed}, etc., a complement 2142 @item
1967 character set (@samp{[^...]}) can match a newline character (@key{LFD} 2143 Unlike in Unix @file{grep}, @file{sed}, etc., a complement character set
1968 aka @kbd{C-j} aka @samp{\n}), unless newline is mentioned as one of the 2144 (@samp{[^...]}) can match a newline character (@key{LFD} a.k.a.@:
2145 @kbd{C-j} a.k.a.@: @samp{\n}), unless newline is mentioned as one of the
1969 characters not to match. 2146 characters not to match.
1970 2147
1971 @item The character syntax regexps (e.g., @samp{\sw}) are not 2148 @item
2149 The character syntax regexps (e.g., @samp{\sw}) are not
1972 meaningful inside character set regexps (e.g., @samp{[aeiou]}). (This 2150 meaningful inside character set regexps (e.g., @samp{[aeiou]}). (This
1973 is actually typical for regexp syntax.) 2151 is actually typical for regexp syntax.)
1974 2152
1975 @end itemize 2153 @end itemize
1976 2154
1978 @section How do I perform a replace operation across more than one file? 2156 @section How do I perform a replace operation across more than one file?
1979 @cindex Replacing strings across files 2157 @cindex Replacing strings across files
1980 @cindex Multiple files, replacing across 2158 @cindex Multiple files, replacing across
1981 @cindex Files, replacing strings across multiple 2159 @cindex Files, replacing strings across multiple
1982 2160
1983 The "tags" feature of Emacs includes the command 2161 The ``tags'' feature of Emacs includes the command
1984 @code{tags-query-replace} which performs a query-replace across all the 2162 @code{tags-query-replace} which performs a query-replace across all the
1985 files mentioned in the TAGS file. @inforef{Tags Search, Tags Search, 2163 files mentioned in the @file{TAGS} file. @inforef{Tags Search, Tags Search,
1986 emacs}. 2164 emacs}.
1987 2165
1988 As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x 2166 As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x
1989 d}) supports the command @code{dired-do-query-replace}, which allows 2167 d}) supports the command @code{dired-do-query-replace}, which allows
1990 users to replace regular expressions in multiple files. 2168 users to replace regular expressions in multiple files.
1991 2169
1992 @node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests 2170 @node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests
1993 @section Where is the documentation for @file{etags}? 2171 @section Where is the documentation for @code{etags}?
1994 @cindex Documentation for @file{etags} 2172 @cindex Documentation for @code{etags}
1995 @cindex @file{etags}, documentation for 2173 @cindex @code{etags}, documentation for
1996 2174
1997 The @file{etags} man page should be in the same place as the 2175 The @code{etags} man page should be in the same place as the
1998 @file{emacs} man page. 2176 @code{emacs} man page.
1999 2177
2000 Quick command-line switch descriptions are also available. For example, 2178 Quick command-line switch descriptions are also available. For example,
2001 @samp{etags -H}. 2179 @samp{etags -H}.
2002 2180
2003 @node Disabling backups, Disabling auto-save-mode, Documentation for etags, Common requests 2181 @node Disabling backups, Disabling auto-save-mode, Documentation for etags, Common requests
2004 @section How do I disable backup files? 2182 @section How do I disable backup files?
2005 @cindex Backups, disabling 2183 @cindex Backups, disabling
2006 @cindex Disabling backups 2184 @cindex Disabling backups
2007 2185
2008 You probably don't want to do this, since backups are useful. 2186 You probably don't want to do this, since backups are useful, especially
2187 when something goes wrong.
2009 2188
2010 To avoid seeing backup files (and other "uninteresting" files) in Dired, 2189 To avoid seeing backup files (and other "uninteresting" files) in Dired,
2011 load dired-x by adding the following to your @file{.emacs} file: 2190 load @code{dired-x} by adding the following to your @file{.emacs} file:
2012 2191
2013 @lisp 2192 @lisp
2014 (add-hook 'dired-load-hook 2193 (add-hook 'dired-load-hook
2015 (lambda () 2194 (lambda ()
2016 (load "dired-x"))) 2195 (load "dired-x")))
2017 @end lisp 2196 @end lisp
2018 2197
2019 With dired-x loaded, @kbd{M-o} toggles omitting in each dired buffer. 2198 With @code{dired-x} loaded, @kbd{M-o} toggles omitting in each dired buffer.
2020 You can make omitting the default for new dired buffers by putting the 2199 You can make omitting the default for new dired buffers by putting the
2021 following in your @file{.emacs}: 2200 following in your @file{.emacs}:
2022 2201
2023 @lisp 2202 @lisp
2024 (add-hook 'dired-mode-hook 'dired-omit-toggle) 2203 (add-hook 'dired-mode-hook 'dired-omit-toggle)
2025 @end lisp 2204 @end lisp
2026 2205
2027 If you're tired of seeing backup files whenever you do an "ls" at the 2206 If you're tired of seeing backup files whenever you do an @samp{ls} at
2028 Unix shell, try GNU ls with the "-B" option. GNU ls is part of the GNU 2207 the Unix shell, try GNU @code{ls} with the @samp{-B} option. GNU
2029 fileutils package, available at mirrors of @samp{ftp.gnu.org} (@pxref{Current GNU distributions} ). 2208 @code{ls} is part of the GNU Fileutils package, available from
2030 2209 @samp{ftp.gnu.org} and its mirrors (@pxref{Current GNU distributions}).
2031 To disable or change how backups are made, see "Backup Names" in the 2210
2032 on-line manual. 2211 To disable or change the way backups are made, @inforef{Backup Names, ,
2212 emacs}.
2213
2214 @cindex Backup files in a single directory
2215 Beginning with Emacs 21.1, you can control where Emacs puts backup files
2216 by customizing the variable @code{backup-directory-alist}. This
2217 variable's value specifies that files whose names match specific patters
2218 should have their backups put in certain directories. A typical use is
2219 to add the element @code{("." . @var{dir})} to force Emacs to put
2220 @strong{all} backup files in the directory @file{dir}.
2033 2221
2034 @node Disabling auto-save-mode, Modifying pull-down menus, Disabling backups, Common requests 2222 @node Disabling auto-save-mode, Modifying pull-down menus, Disabling backups, Common requests
2035 @section How do I disable @code{auto-save-mode}? 2223 @section How do I disable @code{auto-save-mode}?
2036 @cindex Disabling @code{auto-save-mode} 2224 @cindex Disabling @code{auto-save-mode}
2037 @cindex Auto-saving 2225 @cindex Auto-saving
2050 package, available from the Lisp Code Archive (@pxref{Packages that do not come 2238 package, available from the Lisp Code Archive (@pxref{Packages that do not come
2051 with Emacs}). This 2239 with Emacs}). This
2052 package also allows you to place all auto-save files in one directory, 2240 package also allows you to place all auto-save files in one directory,
2053 such as @file{/tmp}. 2241 such as @file{/tmp}.
2054 2242
2055 To disable or change how @code{auto-save-mode} works, see "Auto Save" in the 2243 To disable or change how @code{auto-save-mode} works, @inforef{Auto
2056 on-line manual. 2244 Save, , emacs}.
2057 2245
2058 @node Modifying pull-down menus, Deleting menus and menu options, Disabling auto-save-mode, Common requests 2246 @node Modifying pull-down menus, Deleting menus and menu options, Disabling auto-save-mode, Common requests
2059 @section How can I create or modify new pull-down menu options? 2247 @section How can I create or modify new pull-down menu options?
2060 @cindex Pull-down menus, creating or modifying 2248 @cindex Pull-down menus, creating or modifying
2061 @cindex Menus, creating or modifying 2249 @cindex Menus, creating or modifying
2062 @cindex Creating new menu options 2250 @cindex Creating new menu options
2063 @cindex Modifying pull-down menus 2251 @cindex Modifying pull-down menus
2064 @cindex Menus and keymaps 2252 @cindex Menus and keymaps
2065 @cindex Keymaps and menus 2253 @cindex Keymaps and menus
2066 2254
2067 Each menu title (e.g., Buffers, File, Edit) represents a local or global 2255 Each menu title (e.g., @samp{File}, @samp{Edit}, @samp{Buffers})
2068 keymap. Selecting a menu title with the mouse displays that keymap's 2256 represents a local or global keymap. Selecting a menu title with the
2069 non-nil contents in the form of a menu. 2257 mouse displays that keymap's non-nil contents in the form of a menu.
2070 2258
2071 So to add a menu option to an existing menu, all you have to do is add a 2259 So to add a menu option to an existing menu, all you have to do is add a
2072 new definition to the appropriate keymap. Adding a "forward word" 2260 new definition to the appropriate keymap. Adding a @samp{Forward Word}
2073 command to the "Edit" menu thus requires the following Lisp code: 2261 item to the @samp{Edit} menu thus requires the following Lisp code:
2074 2262
2075 @lisp 2263 @lisp
2076 (define-key global-map 2264 (define-key global-map
2077 [menu-bar edit forward] 2265 [menu-bar edit forward]
2078 '("Forward word" . forward-word)) 2266 '("Forward word" . forward-word))
2079 @end lisp 2267 @end lisp
2080 2268
2269 @noindent
2081 The first line adds the entry to the global keymap, which includes 2270 The first line adds the entry to the global keymap, which includes
2082 global menu bar entries. Replacing the reference to @code{global-map} 2271 global menu bar entries. Replacing the reference to @code{global-map}
2083 with a local keymap would add this menu option only within a particular 2272 with a local keymap would add this menu option only within a particular
2084 mode. 2273 mode.
2085 2274
2086 The second line describes the path from the menu-bar to the new entry. 2275 The second line describes the path from the menu-bar to the new entry.
2087 Placing this menu entry underneath the "File" menu would mean changing 2276 Placing this menu entry underneath the @samp{File} menu would mean
2088 the word "edit" in the second line to "file." 2277 changing the word @code{edit} in the second line to @code{file}.
2089 2278
2090 The third line is a cons cell whose first element is the title that will 2279 The third line is a cons cell whose first element is the title that will
2091 be displayed, and whose second element is the function that will be 2280 be displayed, and whose second element is the function that will be
2092 called when that menu option is invoked. 2281 called when that menu option is invoked.
2093 2282
2097 @lisp 2286 @lisp
2098 (define-key global-map [menu-bar words] 2287 (define-key global-map [menu-bar words]
2099 (cons "Words" (make-sparse-keymap "Words"))) 2288 (cons "Words" (make-sparse-keymap "Words")))
2100 @end lisp 2289 @end lisp
2101 2290
2102 The above code creates a new sparse keymap, gives it the name "Words", 2291 The above code creates a new sparse keymap, gives it the name
2103 and attaches it to the global menu bar. Adding the "forward word" 2292 @samp{Words}, and attaches it to the global menu bar. Adding the
2104 command to this new menu would thus require the following code: 2293 @samp{Forward Word} item to this new menu would thus require the
2294 following code:
2105 2295
2106 @lisp 2296 @lisp
2107 (define-key global-map 2297 (define-key global-map
2108 [menu-bar words forward] 2298 [menu-bar words forward]
2109 '("Forward word" . forward-word)) 2299 '("Forward word" . forward-word))
2110 @end lisp 2300 @end lisp
2111 2301
2302 @noindent
2112 Note that because of the way keymaps work, menu options are displayed 2303 Note that because of the way keymaps work, menu options are displayed
2113 with the more recently defined items at the top. Thus if you were to 2304 with the more recently defined items at the top. Thus if you were to
2114 define menu options "foo", "bar", and "baz" (in that order), menu option 2305 define menu options @samp{foo}, @samp{bar}, and @samp{baz} (in that
2115 "baz" would appear at the top, and "foo" would be at the bottom. 2306 order), the menu option @samp{baz} would appear at the top, and
2307 @samp{foo} would be at the bottom.
2116 2308
2117 One way to avoid this problem is to use the function @code{define-key-after}, 2309 One way to avoid this problem is to use the function @code{define-key-after},
2118 which works the same as @code{define-key}, but lets you modify where items 2310 which works the same as @code{define-key}, but lets you modify where items
2119 appear. The following Lisp code would insert the "forward word" function 2311 appear. The following Lisp code would insert the @samp{Forward Word}
2120 in the "edit" menu immediately following the "undo" option: 2312 item in the @samp{Edit} menu immediately following the @samp{Undo} item:
2121 2313
2122 @lisp 2314 @lisp
2123 (define-key-after 2315 (define-key-after
2124 (lookup-key global-map [menu-bar edit]) 2316 (lookup-key global-map [menu-bar edit])
2125 [forward] 2317 [forward]
2133 defined. 2325 defined.
2134 2326
2135 To move a menu option from one position to another, simply evaluate 2327 To move a menu option from one position to another, simply evaluate
2136 @code{define-key-after} with the appropriate final argument. 2328 @code{define-key-after} with the appropriate final argument.
2137 2329
2138 More detailed information --- and more examples of how to create and 2330 More detailed information---and more examples of how to create and
2139 modify menu options --- are in the Emacs Lisp Reference Manual, under 2331 modify menu options---are in the @cite{Emacs Lisp Reference Manual}, under
2140 "Keymaps". (@pxref{Emacs Lisp documentation} for information on this 2332 ``Keymaps''. (@xref{Emacs Lisp documentation}, for information on this
2141 manual.) 2333 manual.)
2142 2334
2143 @node Deleting menus and menu options, Turning on syntax highlighting, Modifying pull-down menus, Common requests 2335 @node Deleting menus and menu options, Turning on syntax highlighting, Modifying pull-down menus, Common requests
2144 @section How do I delete menus and menu options? 2336 @section How do I delete menus and menu options?
2145 @cindex Deleting menus and menu options 2337 @cindex Deleting menus and menu options
2146 @cindex Menus, deleting 2338 @cindex Menus, deleting
2147 2339
2148 The simplest way to remove a menu is to set its keymap to @samp{nil}. 2340 The simplest way to remove a menu is to set its keymap to @samp{nil}.
2149 For example, to delete the "Words" menu (@pxref{Modifying pull-down 2341 For example, to delete the @samp{Words} menu (@pxref{Modifying pull-down
2150 menus}), use: 2342 menus}), use:
2151 2343
2152 @lisp 2344 @lisp
2153 (define-key global-map [menu-bar words] nil) 2345 (define-key global-map [menu-bar words] nil)
2154 @end lisp 2346 @end lisp
2155 2347
2156 Similarly, removing a menu option requires redefining a keymap entry to 2348 Similarly, removing a menu option requires redefining a keymap entry to
2157 @code{nil}. For example, to delete the "Forward word" menu option from the 2349 @code{nil}. For example, to delete the @samp{Forward word} menu option
2158 "Edit" menu (we added it in @ref{Modifying pull-down menus}), use: 2350 from the @samp{Edit} menu (we added it in @ref{Modifying pull-down
2351 menus}), use:
2159 2352
2160 @lisp 2353 @lisp
2161 (define-key global-map [menu-bar edit forward] nil) 2354 (define-key global-map [menu-bar edit forward] nil)
2162 @end lisp 2355 @end lisp
2163 2356
2168 @cindex Highlighting based on syntax 2361 @cindex Highlighting based on syntax
2169 @cindex Colorizing text 2362 @cindex Colorizing text
2170 @cindex FAQ, @code{font-lock-mode} 2363 @cindex FAQ, @code{font-lock-mode}
2171 2364
2172 @code{font-lock-mode} is the standard way to have Emacs perform syntax 2365 @code{font-lock-mode} is the standard way to have Emacs perform syntax
2173 highlighting. With @code{font-lock-mode} invoked, different types of 2366 highlighting in the current buffer. With @code{font-lock-mode} turned
2174 text will appear in different colors. For instance, if you turn on 2367 on, different types of text will appear in different colors. For
2175 @code{font-lock-mode} in a programming mode, variables will appear in one 2368 instance, if you turn on @code{font-lock-mode} in a programming mode,
2176 face, keywords in a second, and comments in a third. 2369 variables will appear in one face, keywords in a second, and comments in
2177 2370 a third.
2371
2372 @cindex hilit19 is deprecated
2178 Earlier versions of Emacs supported hilit19, a similar package. Use of 2373 Earlier versions of Emacs supported hilit19, a similar package. Use of
2179 hilit19 is now considered non-standard, although @file{hilit19.el} comes 2374 hilit19 is now considered non-standard, although @file{hilit19.el} comes
2180 with the stock Emacs distribution. It is no longer maintained. 2375 with the stock Emacs distribution. It is no longer maintained.
2181 2376
2182 To turn @code{font-lock-mode} on within an existing buffer, use @kbd{M-x 2377 To turn @code{font-lock-mode} on within an existing buffer, use @kbd{M-x
2196 2391
2197 @lisp 2392 @lisp
2198 (global-font-lock-mode 1) 2393 (global-font-lock-mode 1)
2199 @end lisp 2394 @end lisp
2200 2395
2396 @noindent
2201 This instructs Emacs to turn on font-lock mode in those buffers for 2397 This instructs Emacs to turn on font-lock mode in those buffers for
2202 which a font-lock mode definition has been provided (in the variable 2398 which a font-lock mode definition has been provided (in the variable
2203 @code{font-lock-global-modes}). If you edit a file in 2399 @code{font-lock-global-modes}). If you edit a file in
2204 @code{pie-ala-mode}, and no font-lock definitions have been provided for 2400 @code{pie-ala-mode}, and no font-lock definitions have been provided for
2205 @code{pie-ala} files, then the above setting will have no effect on that 2401 @code{pie-ala} files, then the above setting will have no effect on that
2206 particular buffer. 2402 particular buffer.
2207 2403
2208 Highlighting with @code{font-lock-mode} can take quite a while, and thus 2404 Highlighting a buffer with @code{font-lock-mode} can take quite a while,
2209 different levels of decoration are available, from slight to gaudy. To 2405 and cause an annoying delay in display, so several features exist to
2406 work around this.
2407
2408 @cindex Just-In-Time syntax highlighting
2409 In Emacs 21 and later, turning on @code{font-lock-mode} automatically
2410 activates the new @dfn{Just-In-Time fontification} provided by
2411 @code{jit-lock-mode}. @code{jit-lock-mode} defers the fontification of
2412 portions of buffer until you actually need to see them, and can also
2413 fontify while Emacs is idle. This makes display of the visible portion
2414 of a buffer almost instantaneous. For details about customizing
2415 @code{jit-lock-mode}, type @kbd{C-h f jit-lock-mode @key{RET}}.
2416
2417 @cindex Levels of syntax highlighting
2418 @cindex Decoration level, in @code{font-lock-mode}
2419 In versions of Emacs before 21, different levels of decoration are
2420 available, from slight to gaudy. More decoration means you need to wait
2421 more time for a buffer to be fontified (or a faster machine). To
2210 control how decorated your buffers should become, set the value of 2422 control how decorated your buffers should become, set the value of
2211 @code{font-lock-maximum-decoration} in your @file{.emacs} file, with a 2423 @code{font-lock-maximum-decoration} in your @file{.emacs} file, with a
2212 @code{nil} value indicating default (usually minimum) decoration, and a 2424 @code{nil} value indicating default (usually minimum) decoration, and a
2213 @code{t} value indicating the maximum decoration. For the gaudiest 2425 @code{t} value indicating the maximum decoration. For the gaudiest
2214 possible look, then, include the line 2426 possible look, then, include the line
2215 2427
2216 @lisp 2428 @lisp
2217 (setq font-lock-maximum-decoration t) 2429 (setq font-lock-maximum-decoration t)
2218 @end lisp 2430 @end lisp
2219 2431
2432 @noindent
2220 in your @file{.emacs} file. You can also set this variable such that 2433 in your @file{.emacs} file. You can also set this variable such that
2221 different modes are highlighted in a different ways; for more 2434 different modes are highlighted in a different ways; for more
2222 information, see the documentation for 2435 information, see the documentation for
2223 @code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x 2436 @code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x
2224 describe-variable @key{RET}}). 2437 describe-variable @key{RET}}).
2225 2438
2439 @cindex Lazy font-lock
2226 You might also want to investigate @code{fast-lock-mode} and 2440 You might also want to investigate @code{fast-lock-mode} and
2227 @code{lazy-lock-mode}, versions of @code{font-lock-mode} that speed up 2441 @code{lazy-lock-mode}, versions of @code{font-lock-mode} that speed up
2228 highlighting. The advantage of @code{lazy-lock-mode} is that it only 2442 highlighting. These are the alternatives for @code{jit-lock-mode} in
2229 fontifies buffers when certain conditions are met, such as after a 2443 versions of Emacs before 21.1. The advantage of @code{lazy-lock-mode}
2230 certain amount of idle time, or after you have finished scrolling 2444 is that it only fontifies buffers when certain conditions are met, such
2231 through text. See the documentation for @code{lazy-lock-mode} by typing @kbd{C-h f 2445 as after a certain amount of idle time, or after you have finished
2232 @code{lazy-lock-mode}} (@kbd{M-x describe-function @key{RET} 2446 scrolling through text. See the documentation for @code{lazy-lock-mode}
2233 lazy-lock-mode @key{RET}}). 2447 by typing @kbd{C-h f @code{lazy-lock-mode}} (@kbd{M-x describe-function
2448 @key{RET} lazy-lock-mode @key{RET}}).
2234 2449
2235 Also see the documentation for the function @code{font-lock-mode}, 2450 Also see the documentation for the function @code{font-lock-mode},
2236 available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x 2451 available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x
2237 describe-function @key{RET} font-lock-mode @key{RET}}). 2452 describe-function @key{RET} font-lock-mode @key{RET}}).
2238 2453
2242 2457
2243 @uref{ftp://cs.uta.fi/pub/ssjaaa/ema-font.gui} 2458 @uref{ftp://cs.uta.fi/pub/ssjaaa/ema-font.gui}
2244 2459
2245 To print buffers with the faces (i.e., colors and fonts) intact, use 2460 To print buffers with the faces (i.e., colors and fonts) intact, use
2246 @kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x 2461 @kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x
2247 ps-print-region-with-faces}. 2462 ps-print-region-with-faces}. You will need a way to send text to a
2463 PostScript printer, or a PostScript interpreter such as Ghostscript;
2464 consult the documentation of the variables @code{ps-printer-name},
2465 @code{ps-lpr-command}, and @code{ps-lpr-switches} for more details.
2248 2466
2249 @node Scrolling only one line, Replacing highlighted text, Turning on syntax highlighting, Common requests 2467 @node Scrolling only one line, Replacing highlighted text, Turning on syntax highlighting, Common requests
2250 @section How can I force Emacs to scroll only one line when I move past the bottom of the screen? 2468 @section How can I force Emacs to scroll only one line when I move past the bottom of the screen?
2251 @cindex Scrolling only one line 2469 @cindex Scrolling only one line
2252 @cindex Reducing the increment when scrollng 2470 @cindex Reducing the increment when scrollng
2263 @section How can I replace highlighted text with what I type? 2481 @section How can I replace highlighted text with what I type?
2264 @cindex @code{delete-selection-mode} 2482 @cindex @code{delete-selection-mode}
2265 @cindex Replacing highlighted text 2483 @cindex Replacing highlighted text
2266 @cindex Highlighing and replacing text 2484 @cindex Highlighing and replacing text
2267 2485
2268 Use @code{delete-selection mode}, which you can start automatically by 2486 Use @code{delete-selection-mode}, which you can start automatically by
2269 placing the following Lisp form in your @file{.emacs} file: 2487 placing the following Lisp form in your @file{.emacs} file:
2270 2488
2271 @lisp 2489 @lisp
2272 (delete-selection-mode t) 2490 (delete-selection-mode t)
2273 @end lisp 2491 @end lisp
2274 2492
2275 According to the documentation string for delete-selection mode (which 2493 According to the documentation string for @code{delete-selection-mode}
2276 you can read using @kbd{M-x describe-function @key{RET} 2494 (which you can read using @kbd{M-x describe-function @key{RET}
2277 delete-selection-mode @key{RET}}): 2495 delete-selection-mode @key{RET}}):
2278 2496
2279 @quotation 2497 @quotation
2280 When ON, typed text replaces the selection if the selection is active. 2498 When ON, typed text replaces the selection if the selection is active.
2281 When OFF, typed text is just inserted at point. 2499 When OFF, typed text is just inserted at point.
2290 @cindex MS-DOS files, editing 2508 @cindex MS-DOS files, editing
2291 @cindex Microsoft files, editing 2509 @cindex Microsoft files, editing
2292 @cindex Windows files, editing 2510 @cindex Windows files, editing
2293 2511
2294 As of Emacs 20, detection and handling of MS-DOS (and Windows) files is 2512 As of Emacs 20, detection and handling of MS-DOS (and Windows) files is
2295 performed transparently. You can open MS-DOS files on a Unix system, 2513 performed transparently. You can open MS-DOS files on a Unix system,
2296 edit it, and save it without having to worry about the file format. 2514 edit it, and save it without having to worry about the file format.
2297 2515
2298 When editing an MS-DOS style file, a backslash (@samp{\}) will appear in 2516 When editing an MS-DOS style file, the mode line will indicate that it
2299 the mode line. 2517 is a DOS file. On Unix and GNU/Linux systems, and also on a Macintosh,
2300 2518 the string @samp{(DOS)} will appear near the left edge of the mode line;
2301 If you are running an earlier version of Emacs, get @code{crypt++} from 2519 on DOS and Windows, where the DOS end-of-line (EOL) format is the
2302 the Emacs Lisp Archive (@pxref{Packages that do not come with Emacs}). 2520 default, a backslash (@samp{\}) will appear in the mode line.
2303 Among other things, @code{crypt++} transparently modifies MS-DOS files 2521
2304 as they are loaded and saved, allowing you to ignore the different 2522 If you are running a version of Emacs before 20.1, get @code{crypt++}
2305 conventions that Unix and MS-DOS have for delineating the end of a line. 2523 from the Emacs Lisp Archive (@pxref{Packages that do not come with
2524 Emacs}). Among other things, @code{crypt++} transparently modifies
2525 MS-DOS files as they are loaded and saved, allowing you to ignore the
2526 different conventions that Unix and MS-DOS have for delineating the end
2527 of a line.
2306 2528
2307 @node Filling paragraphs with a single space, , Editing MS-DOS files, Common requests 2529 @node Filling paragraphs with a single space, , Editing MS-DOS files, Common requests
2308 @section How can I tell Emacs to fill paragraphs with a single space after each period? 2530 @section How can I tell Emacs to fill paragraphs with a single space after each period?
2309 @cindex One space following periods 2531 @cindex One space following periods
2310 @cindex Single space following periods 2532 @cindex Single space following periods
2347 @cindex Maximum file size 2569 @cindex Maximum file size
2348 @cindex Files, maximum size 2570 @cindex Files, maximum size
2349 2571
2350 Old versions (i.e., anything before 19.29) of Emacs had problems editing 2572 Old versions (i.e., anything before 19.29) of Emacs had problems editing
2351 files larger than 8 megabytes. As of version 19.29, the maximum buffer 2573 files larger than 8 megabytes. As of version 19.29, the maximum buffer
2352 size is at least 2^27-1, or 134,217,727 bytes. 2574 size is at least 2^27-1, or 134,217,727 bytes, or 132 MBytes. Emacs 20
2353 2575 can be compiled on some 64-bit systems in a way that enlarges the buffer
2354 If you are using an older version of Emacs and cannot upgrade, you will 2576 size up to 576,460,752,303,423,487 bytes, or 549,755,813 GBytes.
2355 have to recompile. @email{lnz@@lucid.com, Leonard N. Zubkoff} suggests 2577
2356 putting the following two lines in @file{src/config.h} before compiling 2578 If you are using a version of Emacs older than 19.29 and cannot upgrade,
2357 Emacs to allow for 26-bit integers and pointers (and thus file sizes of 2579 you will have to recompile. @email{lnz@@lucid.com, Leonard N. Zubkoff}
2358 up to 33,554,431 bytes): 2580 suggests putting the following two lines in @file{src/config.h} before
2581 compiling Emacs to allow for 26-bit integers and pointers (and thus file
2582 sizes of up to 33,554,431 bytes):
2359 2583
2360 @example 2584 @example
2361 #define VALBITS 26 2585 #define VALBITS 26
2362 #define GCTYPEBITS 5 2586 #define GCTYPEBITS 5
2363 @end example 2587 @end example
2364 2588
2589 @noindent
2365 This method may result in "ILLEGAL DATATYPE" and other random errors on 2590 This method may result in "ILLEGAL DATATYPE" and other random errors on
2366 some machines. 2591 some machines.
2367 2592
2368 @email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this 2593 @email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this
2369 problems crops up; while his numbers are true only for pre-19.29 2594 problems crops up; while his numbers are true only for pre-19.29
2371 2596
2372 @quotation 2597 @quotation
2373 Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed 2598 Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed
2374 language in the sense that you can put any value of any type into any 2599 language in the sense that you can put any value of any type into any
2375 variable, or return it from a function, and so on. So each value 2600 variable, or return it from a function, and so on. So each value
2376 must carry a "tag" along with it identifying what kind of thing it is, 2601 must carry a @dfn{tag} along with it identifying what kind of thing it
2377 e.g., integer, pointer to a list, pointer to an editing buffer, and so 2602 is, e.g., integer, pointer to a list, pointer to an editing buffer, and
2378 on. Emacs uses standard 32-bit integers for data objects, taking the 2603 so on. Emacs uses standard 32-bit integers for data objects, taking the
2379 top 8 bits for the tag and the bottom 24 bits for the value. So 2604 top 8 bits for the tag and the bottom 24 bits for the value. So
2380 integers (and pointers) are somewhat restricted compared to true C 2605 integers (and pointers) are somewhat restricted compared to true C
2381 integers and pointers. 2606 integers and pointers.
2382 @end quotation 2607 @end quotation
2383 2608
2387 @cindex Echoed commands in @code{shell-mode} 2612 @cindex Echoed commands in @code{shell-mode}
2388 2613
2389 Try typing @kbd{M-x shell-strip-ctrl-m @key{RET}} while in @code{shell-mode} to 2614 Try typing @kbd{M-x shell-strip-ctrl-m @key{RET}} while in @code{shell-mode} to
2390 make them go away. If that doesn't work, you have several options: 2615 make them go away. If that doesn't work, you have several options:
2391 2616
2392 For tcsh, put this in your @file{.cshrc} (or @file{.tcshrc}) file: 2617 For @code{tcsh}, put this in your @file{.cshrc} (or @file{.tcshrc})
2618 file:
2393 2619
2394 @example 2620 @example
2395 if ($?EMACS) then 2621 if ($?EMACS) then
2396 if ("$EMACS" == t) then 2622 if ("$EMACS" == t) then
2397 if ($?tcsh) unset edit 2623 if ($?tcsh) unset edit
2405 @example 2631 @example
2406 unset edit 2632 unset edit
2407 stty nl 2633 stty nl
2408 @end example 2634 @end example
2409 2635
2410 Alternatively, use @file{csh} in your shell buffers instead of 2636 Alternatively, use @code{csh} in your shell buffers instead of
2411 @file{tcsh}. One way is: 2637 @code{tcsh}. One way is:
2412 2638
2413 @lisp 2639 @lisp
2414 (setq explicit-shell-file-name "/bin/csh") 2640 (setq explicit-shell-file-name "/bin/csh")
2415 @end lisp 2641 @end lisp
2416 2642
2643 @noindent
2417 and another is to do this in your @file{.cshrc} (or @file{.tcshrc}) 2644 and another is to do this in your @file{.cshrc} (or @file{.tcshrc})
2418 file: 2645 file:
2419 2646
2420 @example 2647 @example
2421 setenv ESHELL /bin/csh 2648 setenv ESHELL /bin/csh
2422 @end example 2649 @end example
2423 2650
2651 @noindent
2424 (You must start Emacs over again with the environment variable properly 2652 (You must start Emacs over again with the environment variable properly
2425 set for this to take effect.) 2653 set for this to take effect.)
2426 2654
2427 You can also set the @code{ESHELL} environment variable in Emacs Lisp 2655 You can also set the @code{ESHELL} environment variable in Emacs Lisp
2428 with the following Lisp form, 2656 with the following Lisp form,
2441 2669
2442 @node Shell process exits abnormally, Termcap/Terminfo entries for Emacs, ^M in the shell buffer, Bugs and problems 2670 @node Shell process exits abnormally, Termcap/Terminfo entries for Emacs, ^M in the shell buffer, Bugs and problems
2443 @section Why do I get "Process shell exited abnormally with code 1"? 2671 @section Why do I get "Process shell exited abnormally with code 1"?
2444 @cindex Abnormal exits from @code{shell-mode} 2672 @cindex Abnormal exits from @code{shell-mode}
2445 @cindex @code{shell-mode} exits 2673 @cindex @code{shell-mode} exits
2674 @cindex Process shell exited
2446 2675
2447 The most likely reason for this message is that the @samp{env} program 2676 The most likely reason for this message is that the @samp{env} program
2448 is not properly installed. Compile this program for your architecture, 2677 is not properly installed. Compile this program for your architecture,
2449 and install it with @samp{a+x} permission in the architecture-dependent 2678 and install it with @samp{a+x} permission in the architecture-dependent
2450 Emacs program directory. (You can find what this directory is at your 2679 Emacs program directory. (You can find what this directory is at your
2480 2709
2481 @example 2710 @example
2482 emacs:tc=unknown: 2711 emacs:tc=unknown:
2483 @end example 2712 @end example
2484 2713
2485 To make a terminfo entry for "emacs", use "tic" or "captoinfo." You need 2714 To make a terminfo entry for @samp{emacs}, use @code{tic} or
2486 to generate @file{/usr/lib/terminfo/e/emacs}. It may work to simply copy 2715 @code{captoinfo}. You need to generate
2487 @file{/usr/lib/terminfo/d/dumb} to @file{/usr/lib/terminfo/e/emac}s. 2716 @file{/usr/lib/terminfo/e/emacs}. It may work to simply copy
2717 @file{/usr/lib/terminfo/d/dumb} to @file{/usr/lib/terminfo/e/emacs}.
2488 2718
2489 Having a termcap/terminfo entry will not enable the use of full screen 2719 Having a termcap/terminfo entry will not enable the use of full screen
2490 programs in shell buffers. Use @kbd{M-x terminal-emulator} for that 2720 programs in shell buffers. Use @kbd{M-x terminal-emulator} for that
2491 instead. 2721 instead.
2492 2722
2493 A workaround to the problem of missing termcap/terminfo entries is to 2723 A workaround to the problem of missing termcap/terminfo entries is to
2494 change terminal type "emacs" to type "dumb" or "unknown" in your shell 2724 change terminal type @samp{emacs} to type @samp{dumb} or @samp{unknown}
2495 start up file. "csh" users could put this in their .cshrc files: 2725 in your shell start up file. @code{csh} users could put this in their
2726 @file{.cshrc} files:
2496 2727
2497 @example 2728 @example
2498 if ("$term" == emacs) set term=dumb 2729 if ("$term" == emacs) set term=dumb
2499 @end example 2730 @end example
2500 2731
2506 2737
2507 Your terminal (or something between your terminal and the computer) is 2738 Your terminal (or something between your terminal and the computer) is
2508 sending @kbd{C-s} and @kbd{C-q} for flow control, and Emacs is receiving 2739 sending @kbd{C-s} and @kbd{C-q} for flow control, and Emacs is receiving
2509 these characters and interpreting them as commands. (The @kbd{C-s} 2740 these characters and interpreting them as commands. (The @kbd{C-s}
2510 character normally invokes the @code{isearch-forward} command.) For 2741 character normally invokes the @code{isearch-forward} command.) For
2511 possible solutions, @pxref{Handling C-s and C-q with flow control}. 2742 possible solutions, see @ref{Handling C-s and C-q with flow control}.
2512 2743
2513 @node Problems talking to certain hosts, Errors with init files, Spontaneous entry into isearch-mode, Bugs and problems 2744 @node Problems talking to certain hosts, Errors with init files, Spontaneous entry into isearch-mode, Bugs and problems
2514 @section Why can't Emacs talk to certain hosts (or certain hostnames)? 2745 @section Why can't Emacs talk to certain hosts (or certain hostnames)?
2515 @cindex Hosts, Emacs cannot talk to 2746 @cindex Hosts, Emacs cannot talk to
2516 @cindex @code{gethostbyname}, problematic version 2747 @cindex @code{gethostbyname}, problematic version
2517 2748
2518 The problem may be that Emacs is linked with a wimpier version of 2749 The problem may be that Emacs is linked with a wimpier version of
2519 @code{gethostbyname} than the rest of the programs on the machine. This 2750 @code{gethostbyname} than the rest of the programs on the machine. This
2520 is often manifested as a message on startup of "X server not responding. 2751 is often manifested as a message on startup of ``X server not responding.
2521 Check your @samp{DISPLAY} environment variable." or a message of 2752 Check your @samp{DISPLAY} environment variable.'' or a message of
2522 "Unknown host" from @code{open-network-stream}. 2753 ``Unknown host'' from @code{open-network-stream}.
2523 2754
2524 On a Sun, this may be because Emacs had to be linked with the static C 2755 On a Sun, this may be because Emacs had to be linked with the static C
2525 library. The version of @code{gethostbyname} in the static C library 2756 library. The version of @code{gethostbyname} in the static C library
2526 may only look in @file{/etc/hosts} and the NIS (YP) maps, while the 2757 may only look in @file{/etc/hosts} and the NIS (YP) maps, while the
2527 version in the dynamic C library may be smart enough to check DNS in 2758 version in the dynamic C library may be smart enough to check DNS in
2548 Replace @code{gethostbyname} and friends in @file{libc.a} with more 2779 Replace @code{gethostbyname} and friends in @file{libc.a} with more
2549 useful versions such as the ones in @file{libresolv.a}. Then relink 2780 useful versions such as the ones in @file{libresolv.a}. Then relink
2550 Emacs. 2781 Emacs.
2551 2782
2552 @item 2783 @item
2553 If you are actually running NIS, make sure that "ypbind" is properly 2784 If you are actually running NIS, make sure that @code{ypbind} is
2554 told to do DNS lookups with the correct command line switch. 2785 properly told to do DNS lookups with the correct command line switch.
2555 2786
2556 @end itemize 2787 @end itemize
2557 2788
2558 @node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems 2789 @node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems
2559 @section Why does Emacs say "Error in init file"? 2790 @section Why does Emacs say "Error in init file"?
2562 @cindex Init file, errors in 2793 @cindex Init file, errors in
2563 @cindex @file{.emacs} file, errors in 2794 @cindex @file{.emacs} file, errors in
2564 @cindex Debugging @file{.emacs} file 2795 @cindex Debugging @file{.emacs} file
2565 2796
2566 An error occurred while loading either your @file{.emacs} file or the 2797 An error occurred while loading either your @file{.emacs} file or the
2567 system-wide file @file{lisp/default.el}. 2798 system-wide file @file{lisp/default.el}. Emacs 21.1 and later pops the
2568 2799 @file{*Messages*} buffer, and puts there some additional information
2569 For information on how to debug your @file{.emacs} file, 2800 about the error, to provide some hints for debugging.
2570 @pxref{Debugging a customization file}. 2801
2802 For information on how to debug your @file{.emacs} file, see
2803 @ref{Debugging a customization file}.
2571 2804
2572 It may be the case that you need to load some package first, or use a 2805 It may be the case that you need to load some package first, or use a
2573 hook that will be evaluated after the package is loaded. A common case 2806 hook that will be evaluated after the package is loaded. A common case
2574 of this is explained in @ref{Terminal setup code works after Emacs has 2807 of this is explained in @ref{Terminal setup code works after Emacs has
2575 begun}. 2808 begun}.
2589 @item @code{XUSERFILESEARCHPATH} 2822 @item @code{XUSERFILESEARCHPATH}
2590 @item @code{XAPPLRESDIR} 2823 @item @code{XAPPLRESDIR}
2591 2824
2592 @end itemize 2825 @end itemize
2593 2826
2594 This emulates the functionality provided by programs written using Xt. 2827 This emulates the functionality provided by programs written using the
2828 Xt toolkit.
2595 2829
2596 @code{XFILESEARCHPATH} and @code{XUSERFILESEARCHPATH} should be a list 2830 @code{XFILESEARCHPATH} and @code{XUSERFILESEARCHPATH} should be a list
2597 of file names separated by colons. @code{XAPPLRESDIR} should be a list 2831 of file names separated by colons. @code{XAPPLRESDIR} should be a list
2598 of directory names separated by colons. 2832 of directory names separated by colons.
2599 2833
2600 Emacs searches for X resources: 2834 Emacs searches for X resources:
2601 2835
2602 @enumerate 2836 @enumerate
2603 2837
2604 @item specified on the command line, with the @samp{-xrm RESOURCESTRING} option, 2838 @item
2605 @item then in the value of the @samp{XENVIRONMENT} environment variable, 2839 specified on the command line, with the @samp{-xrm RESOURCESTRING} option,
2840
2841 @item
2842 then in the value of the @samp{XENVIRONMENT} environment variable,
2606 2843
2607 @itemize @minus 2844 @itemize @minus
2608 2845
2609 @item or if that is unset, in the file named @samp{~/.Xdefaults-HOSTNAME} if it exists (where @samp{HOSTNAME} is the hostname of the machine Emacs is running on), 2846 @item
2847 or if that is unset, in the file named
2848 @file{~/.Xdefaults-@var{hostname}} if it exists (where @var{hostname} is
2849 the name of the machine Emacs is running on),
2610 2850
2611 @end itemize 2851 @end itemize
2612 2852
2613 @item then in the screen-specific and server-wide resource properties provided by the server, 2853 @item
2854 then in the screen-specific and server-wide resource properties provided
2855 by the server,
2614 2856
2615 @itemize @minus 2857 @itemize @minus
2616 2858
2617 @item or if those properties are unset, in the file named ~/.Xdefaults if it exists, 2859 @item
2860 or if those properties are unset, in the file named @file{~/.Xdefaults}
2861 if it exists,
2618 2862
2619 @end itemize 2863 @end itemize
2620 2864
2621 @item then in the files listed in @samp{XUSERFILESEARCHPATH}, 2865 @item
2866 then in the files listed in @samp{XUSERFILESEARCHPATH},
2622 2867
2623 @itemize @minus 2868 @itemize @minus
2624 2869
2625 @item or in files named @file{LANG/Emacs} in directories listed in @samp{XAPPLRESDIR} (where @samp{LANG} is the value of the @samp{LANG} environment variable), if the @samp{LANG} environment variable is set, 2870 @item
2626 @item or in files named Emacs in the directories listed in @samp{XAPPLRESDIR} 2871 or in files named @file{@var{lang}/Emacs} in directories listed in
2627 @item or in @file{~/LANG/Emacs} (if the @samp{LANG} environment variable is set), 2872 @samp{XAPPLRESDIR} (where @var{lang} is the value of the @code{LANG}
2628 @item or in @file{~/Emacs}, 2873 environment variable), if the @samp{LANG} environment variable is set,
2874 @item
2875 or in files named Emacs in the directories listed in @samp{XAPPLRESDIR}
2876 @item
2877 or in @file{~/@var{lang}/Emacs} (if the @code{LANG} environment variable
2878 is set),
2879 @item
2880 or in @file{~/Emacs},
2629 2881
2630 @end itemize 2882 @end itemize
2631 2883
2632 @item then in the files listed in @code{XFILESEARCHPATH}. 2884 @item
2885 then in the files listed in @code{XFILESEARCHPATH}.
2633 2886
2634 @end enumerate 2887 @end enumerate
2635 2888
2636 @node Emacs takes a long time to visit files, Editing files with $ in the name, Emacs ignores X resources, Bugs and problems 2889 @node Emacs takes a long time to visit files, Editing files with $ in the name, Emacs ignores X resources, Bugs and problems
2637 @section Why does Emacs take 20 seconds to visit a file? 2890 @section Why does Emacs take 20 seconds to visit a file?
2638 @cindex Visiting files takes a long time 2891 @cindex Visiting files takes a long time
2639 @cindex Delay when visiting files 2892 @cindex Delay when visiting files
2640 @cindex Files, take a long time to visit 2893 @cindex Files, take a long time to visit
2641 2894
2642 Old versions of Emacs (i.e., versions before Emacs 20.x) often 2895 Old versions of Emacs (i.e., versions before Emacs 20.x) often
2643 encountered this when the master lock file, @file{!!!SuperLock!!!} has 2896 encountered this when the master lock file, @file{!!!SuperLock!!!}, has
2644 been left in the lock directory somehow. Delete it. 2897 been left in the lock directory somehow. Delete it.
2645 2898
2646 @email{meuer@@geom.umn.edu, Mark Meuer} says that NeXT NFS has a bug 2899 @email{meuer@@geom.umn.edu, Mark Meuer} says that NeXT NFS has a bug
2647 where an exclusive create succeeds but returns an error status. This 2900 where an exclusive create succeeds but returns an error status. This
2648 can cause the same problem. Since Emacs's file locking doesn't work 2901 can cause the same problem. Since Emacs's file locking doesn't work
2665 @cindex @code{shell-mode} and current directory 2918 @cindex @code{shell-mode} and current directory
2666 @cindex Directory, current in @code{shell-mode} 2919 @cindex Directory, current in @code{shell-mode}
2667 2920
2668 Emacs has no way of knowing when the shell actually changes its 2921 Emacs has no way of knowing when the shell actually changes its
2669 directory. This is an intrinsic limitation of Unix. So it tries to 2922 directory. This is an intrinsic limitation of Unix. So it tries to
2670 guess by recognizing @samp{cd} commands. If you type "cd" followed by a 2923 guess by recognizing @samp{cd} commands. If you type @kbd{cd} followed
2671 directory name with a variable reference (@samp{cd $HOME/bin}) or with a 2924 by a directory name with a variable reference (@kbd{cd $HOME/bin}) or
2672 shell metacharacter (@samp{cd ../lib*}), Emacs will fail to correctly 2925 with a shell metacharacter (@kbd{cd ../lib*}), Emacs will fail to
2673 guess the shell's new current directory. A huge variety of fixes and 2926 correctly guess the shell's new current directory. A huge variety of
2674 enhancements to shell mode for this problem have been written to handle 2927 fixes and enhancements to shell mode for this problem have been written
2675 this problem. Check the Lisp Code Directory (@pxref{Finding a package 2928 to handle this problem. Check the Lisp Code Directory (@pxref{Finding a
2676 with particular functionality}). 2929 package with particular functionality}).
2677 2930
2678 You can tell Emacs the shell's current directory with the command 2931 You can tell Emacs the shell's current directory with the command
2679 @kbd{M-x dirs}. 2932 @kbd{M-x dirs}.
2680 2933
2681 @node Security risks with Emacs, Dired claims that no file is on this line, Shell mode loses the current directory, Bugs and problems 2934 @node Security risks with Emacs, Dired claims that no file is on this line, Shell mode loses the current directory, Bugs and problems
2686 @cindex Synthetic X events and security 2939 @cindex Synthetic X events and security
2687 @cindex X events and security 2940 @cindex X events and security
2688 2941
2689 @itemize @bullet 2942 @itemize @bullet
2690 2943
2691 @item The @file{movemail} incident (No, this is not a risk.) 2944 @item
2692 2945 The @file{movemail} incident. (No, this is not a risk.)
2693 In his book @emph{The Cuckoo's Egg}, Cliff Stoll describes this in 2946
2694 chapter 4. The site at LBL had installed the @file{etc/movemail} 2947 In his book @cite{The Cuckoo's Egg}, Cliff Stoll describes this in
2948 chapter 4. The site at LBL had installed the @file{/etc/movemail}
2695 program setuid root. (As of version 19, @file{movemail} is in your 2949 program setuid root. (As of version 19, @file{movemail} is in your
2696 architecture-specific directory; type @kbd{C-h v exec-directory 2950 architecture-specific directory; type @kbd{C-h v exec-directory
2697 @key{RET}} to see what it is.) Since @file{movemail} had not been 2951 @key{RET}} to see what it is.) Since @code{movemail} had not been
2698 designed for this situation, a security hole was created and users could 2952 designed for this situation, a security hole was created and users could
2699 get root privileges. 2953 get root privileges.
2700 2954
2701 @file{movemail} has since been changed so that this security hole will 2955 @code{movemail} has since been changed so that this security hole will
2702 not exist, even if it is installed setuid root. However, 2956 not exist, even if it is installed setuid root. However,
2703 @file{movemail} no longer needs to be installed setuid root, which 2957 @code{movemail} no longer needs to be installed setuid root, which
2704 should eliminate this particular risk. 2958 should eliminate this particular risk.
2705 2959
2706 We have heard unverified reports that the 1988 Internet worm took 2960 We have heard unverified reports that the 1988 Internet worm took
2707 advantage of this configuration problem. 2961 advantage of this configuration problem.
2708 2962
2709 @item The @code{file-local-variable} feature (Yes, a risk, but easy to change.) 2963 @item
2964 The @code{file-local-variable} feature. (Yes, a risk, but easy to
2965 change.)
2710 2966
2711 There is an Emacs feature that allows the setting of local values for 2967 There is an Emacs feature that allows the setting of local values for
2712 variables when editing a file by including specially formatted text near 2968 variables when editing a file by including specially formatted text near
2713 the end of the file. This feature also includes the ability to have 2969 the end of the file. This feature also includes the ability to have
2714 arbitrary Emacs Lisp code evaluated when the file is visited. 2970 arbitrary Emacs Lisp code evaluated when the file is visited.
2724 whether to allow the evaluation of Emacs Lisp code found at the bottom 2980 whether to allow the evaluation of Emacs Lisp code found at the bottom
2725 of files by setting the variable @code{enable-local-eval}. 2981 of files by setting the variable @code{enable-local-eval}.
2726 2982
2727 For more information, @inforef{File Variables, File Variables, emacs}. 2983 For more information, @inforef{File Variables, File Variables, emacs}.
2728 2984
2729 @item Synthetic X events (Yes, a risk; use @samp{MIT-MAGIC-COOKIE-1} or better.) 2985 @item
2730 2986 Synthetic X events. (Yes, a risk; use @samp{MIT-MAGIC-COOKIE-1} or
2731 Emacs accepts synthetic X events generated by the SendEvent request as 2987 better.)
2732 though they were regular events. As a result, if you are using the 2988
2733 trivial host-based authentication, other users who can open X 2989 Emacs accepts synthetic X events generated by the @code{SendEvent}
2990 request as though they were regular events. As a result, if you are
2991 using the trivial host-based authentication, other users who can open X
2734 connections to your X workstation can make your Emacs process do 2992 connections to your X workstation can make your Emacs process do
2735 anything, including run other processes with your privileges. 2993 anything, including run other processes with your privileges.
2736 2994
2737 The only fix for this is to prevent other users from being able to open 2995 The only fix for this is to prevent other users from being able to open
2738 X connections. The standard way to prevent this is to use a real 2996 X connections. The standard way to prevent this is to use a real
2739 authentication mechanism, such as @samp{MIT-MAGIC-COOKIE-1}. If using 2997 authentication mechanism, such as @samp{MIT-MAGIC-COOKIE-1}. If using
2740 the @file{xauth} program has any effect, then you are probably using 2998 the @code{xauth} program has any effect, then you are probably using
2741 @samp{MIT-MAGIC-COOKIE-1}. Your site may be using a superior 2999 @samp{MIT-MAGIC-COOKIE-1}. Your site may be using a superior
2742 authentication method; ask your system administrator. 3000 authentication method; ask your system administrator.
2743 3001
2744 If real authentication is not a possibility, you may be satisfied by 3002 If real authentication is not a possibility, you may be satisfied by
2745 just allowing hosts access for brief intervals while you start your X 3003 just allowing hosts access for brief intervals while you start your X
2746 programs, then removing the access. This reduces the risk somewhat by 3004 programs, then removing the access. This reduces the risk somewhat by
2747 narrowing the time window when hostile users would have access, but 3005 narrowing the time window when hostile users would have access, but
2748 @emph{does not eliminate the risk}. 3006 @emph{does not eliminate the risk}.
2749 3007
2750 On most computers running Unix and X Windows, you enable and disable 3008 On most computers running Unix and X Windows, you enable and disable
2751 access using the @file{xhost} command. To allow all hosts access to 3009 access using the @code{xhost} command. To allow all hosts access to
2752 your X server, use 3010 your X server, use
2753 3011
2754 @example 3012 @example
2755 xhost + 3013 xhost +
2756 @end example 3014 @end example
2757 3015
3016 @noindent
2758 at the shell prompt, which (on an HP machine, at least) produces the 3017 at the shell prompt, which (on an HP machine, at least) produces the
2759 following message: 3018 following message:
2760 3019
2761 @example 3020 @example
2762 access control disabled, clients can connect from any host 3021 access control disabled, clients can connect from any host
2779 3038
2780 @node Dired claims that no file is on this line, , Security risks with Emacs, Bugs and problems 3039 @node Dired claims that no file is on this line, , Security risks with Emacs, Bugs and problems
2781 @section Dired says, "no file on this line" when I try to do something. 3040 @section Dired says, "no file on this line" when I try to do something.
2782 @cindex Dired does not see a file 3041 @cindex Dired does not see a file
2783 3042
3043 @c FIXME: I think this is fixed in Emacs 21, but I didn't have time to
3044 @c check.
2784 Chances are you're using a localized version of Unix that doesn't use US 3045 Chances are you're using a localized version of Unix that doesn't use US
2785 date format in dired listings. You can check this by looking at dired 3046 date format in dired listings. You can check this by looking at dired
2786 listings or by typing @code{ls -l} to a shell and looking at the dates that 3047 listings or by typing @kbd{ls -l} to a shell and looking at the dates that
2787 come out. 3048 come out.
2788 3049
2789 Dired uses a regular expression to find the beginning of a file name. 3050 Dired uses a regular expression to find the beginning of a file name.
2790 In a long Unix-style directory listing ("ls -l"), the file name starts 3051 In a long Unix-style directory listing (@samp{ls -l}), the file name
2791 after the date. The regexp has thus been written to look for the date, 3052 starts after the date. The regexp has thus been written to look for the
2792 the format of which can vary on non-US systems. 3053 date, the format of which can vary on non-US systems.
2793 3054
2794 There are two approaches to solving this. The first one involves 3055 There are two approaches to solving this. The first one involves
2795 setting things up so that "ls -l" outputs US date format. This can be 3056 setting things up so that @samp{ls -l} outputs US date format. This can
2796 done by setting the locale. See your OS manual for more information. 3057 be done by setting the locale. See your OS manual for more information.
2797 3058
2798 The second approach involves changing the regular expression used by 3059 The second approach involves changing the regular expression used by
2799 dired, @code{dired-move-to-filename-regexp}. 3060 dired, @code{dired-move-to-filename-regexp}.
2800 3061
2801 @c ------------------------------------------------------------ 3062 @c ------------------------------------------------------------
2821 @cindex Unpacking and installing Emacs 3082 @cindex Unpacking and installing Emacs
2822 3083
2823 This answer is meant for users of Unix and Unix-like systems. Users of 3084 This answer is meant for users of Unix and Unix-like systems. Users of
2824 other operating systems should see the series of questions beginning 3085 other operating systems should see the series of questions beginning
2825 with @ref{Emacs for MS-DOS}, which describe where to get non-Unix source 3086 with @ref{Emacs for MS-DOS}, which describe where to get non-Unix source
2826 and binaries. These packages should come with installation 3087 and binaries, and how to install Emacs on those systems.
2827 instructions.
2828 3088
2829 For Unix and Unix-like systems, the easiest way is often to compile it 3089 For Unix and Unix-like systems, the easiest way is often to compile it
2830 from scratch. You will need: 3090 from scratch. You will need:
2831 3091
2832 @itemize @bullet 3092 @itemize @bullet
2833 3093
2834 @item 3094 @item
2835 Emacs sources. @xref{Current GNU distributions}, for a list of ftp sites 3095 Emacs sources. @xref{Current GNU distributions}, for a list of ftp sites
2836 that make them available. On @file{ftp.gnu.org}, the main GNU 3096 that make them available. On @file{ftp.gnu.org}, the main GNU
2837 distribution site, sources are available at 3097 distribution site, sources are available as
2838 3098
2839 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-20.5.tar.gz} 3099 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-@value{VER}.tar.gz}
2840 3100
2841 The above will obviously change as new versions of Emacs come out. For 3101 The above will obviously change as new versions of Emacs come out. For
2842 instance, when Emacs 21 is released, it will most probably be 3102 instance, when Emacs 21.42 is released, it will most probably be
2843 available at 3103 available as
2844 3104
2845 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-21.1.tar.gz} 3105 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-21.42.tar.gz}
2846 3106
2847 Again, you should use one of the GNU mirror sites (@xref{Current GNU 3107 Again, you should use one of the GNU mirror sites (see @ref{Current GNU
2848 distributions}, and adjust the URL accordingly) so as to reduce load on 3108 distributions}, and adjust the URL accordingly) so as to reduce load on
2849 @file{ftp.gnu.org}. 3109 @file{ftp.gnu.org}.
2850 3110
2851 @item 3111 @item
2852 @code{gzip}, the GNU compression utility. You can get @code{gzip} via 3112 @code{gzip}, the GNU compression utility. You can get @code{gzip} via
2854 and install without much trouble on most systems. Once you have 3114 and install without much trouble on most systems. Once you have
2855 retrieved the Emacs sources, you will probably be able to uncompress 3115 retrieved the Emacs sources, you will probably be able to uncompress
2856 them with the command 3116 them with the command
2857 3117
2858 @example 3118 @example
2859 gunzip --verbose emacs-20.5.tar.gz 3119 gunzip --verbose emacs-@value{VER}.tar.gz
2860 @end example 3120 @end example
2861 3121
2862 changing the Emacs version (20.5), as necessary. Once gunzip has 3122 @noindent
2863 finished doing its job, a file by the name of "emacs-20.5.tar" should 3123 changing the Emacs version (@value{VER}), as necessary. Once
2864 be in your build directory. 3124 @code{gunzip} has finished doing its job, a file by the name of
3125 @file{emacs-@value{VER}.tar} should be in your build directory.
2865 3126
2866 @item 3127 @item
2867 @file{tar}, the "tape archiving" program, which moves multiple files 3128 @code{tar}, the @dfn{tape archiving} program, which moves multiple files
2868 into and out of archive files, or "tarfiles." All of the files 3129 into and out of archive files, or @dfn{tarfiles}. All of the files
2869 comprising the Emacs source come in a single tarfile, and must be 3130 comprising the Emacs source come in a single tarfile, and must be
2870 extracted using @file{tar} before you can build Emacs. Typically, the 3131 extracted using @code{tar} before you can build Emacs. Typically, the
2871 extraction command would look like 3132 extraction command would look like
2872 3133
2873 @example 3134 @example
2874 tar -xvvf emacs-20.5.tar 3135 tar -xvvf emacs-@value{VER}.tar
2875 @end example 3136 @end example
2876 3137
3138 @noindent
2877 The @samp{x} indicates that we want to extract files from this tarfile, 3139 The @samp{x} indicates that we want to extract files from this tarfile,
2878 the two @samp{v}s force verbose output, and the @samp{f} tells 3140 the two @samp{v}s force verbose output, and the @samp{f} tells
2879 @file{tar} to use a disk file, rather than one on tape. 3141 @code{tar} to use a disk file, rather than one on the tape drive.
2880 3142
2881 If you're using GNU @file{tar} (available at mirrors of 3143 If you're using GNU @code{tar} (available at mirrors of
2882 @file{ftp.gnu.org}), you can combine this step and the previous one by 3144 @file{ftp.gnu.org}), you can combine this step and the previous one by
2883 using the command 3145 using the command
2884 3146
2885 @example 3147 @example
2886 tar -zxvvf emacs-20.5.tar.gz 3148 tar -zxvvf emacs-@value{VER}.tar.gz
2887 @end example 3149 @end example
2888 3150
2889 The additional @samp{z} at the beginning of the options list tells GNU tar 3151 @noindent
2890 to uncompress the file with gunzip before extracting the tarfile's 3152 The additional @samp{z} at the beginning of the options list tells GNU
2891 components. 3153 @code{tar} to uncompress the file with @code{gunzip} before extracting
3154 the tarfile's components.
2892 3155
2893 @end itemize 3156 @end itemize
2894 3157
2895 At this point, the Emacs sources (all 25+ megabytes of them) should be 3158 At this point, the Emacs sources (all 70+ megabytes of them) should be
2896 sitting in a directory called @file{emacs-20.5}. On most common Unix and 3159 sitting in a directory called @file{emacs-@value{VER}}. On most common
2897 Unix-like systems, you should be able to compile Emacs (with X Windows 3160 Unix and Unix-like systems, you should be able to compile Emacs (with X
2898 support) with the following commands: 3161 Window system support) with the following commands:
2899 3162
2900 @example 3163 @example
2901 cd emacs-20.5 # change directory to emacs-20.5 3164 cd emacs-@value{VER} # change directory to emacs-@value{VER}
2902 ./configure # configure Emacs for your particular system 3165 ./configure # configure Emacs for your particular system
2903 make # use Makefile to build components, then Emacs 3166 make # use Makefile to build components, then Emacs
2904 @end example 3167 @end example
2905 3168
2906 If the @code{make} completes successfully, the odds are fairly good that 3169 If the @code{make} completes successfully, the odds are fairly good that
2907 the build has gone well. (@pxref{Problems building Emacs} if you weren't 3170 the build has gone well. (@xref{Problems building Emacs}, if you weren't
2908 successful.) 3171 successful.)
2909 3172
2910 By default, Emacs is installed in the following directories: 3173 By default, Emacs is installed in the following directories:
2911 3174
2912 @table @file 3175 @table @file
2913
2914 @item /usr/local/bin 3176 @item /usr/local/bin
2915 binaries 3177 binaries.
2916 3178
2917 @item /usr/local/share/emacs/20.xx 3179 @item /usr/local/share/emacs/@value{VER}
2918 Lisp code and support files 3180 Lisp code and support files.
2919 3181
2920 @item /usr/local/info 3182 @item /usr/local/info
2921 Info documentation 3183 Info documentation.
2922
2923 @end table 3184 @end table
2924 3185
2925 To install files in those default directories, become the superuser and 3186 To install files in those default directories, become the superuser and
2926 type 3187 type
2927 3188
2928 @example 3189 @example
2929 make install 3190 make install
2930 @end example 3191 @end example
2931 3192
2932 Note that @code{make install} will overwrite @file{/usr/local/bin/emacs} 3193 Note that @samp{make install} will overwrite @file{/usr/local/bin/emacs}
2933 and any Emacs Info files that might be in @file{/usr/local/info}. 3194 and any Emacs Info files that might be in @file{/usr/local/info}.
2934 3195
2935 Much more verbose instructions (with many more hints and suggestions) 3196 Much more verbose instructions (with many more hints and suggestions)
2936 come with the Emacs sources, in the file @file{INSTALL}. 3197 come with the Emacs sources, in the file @file{INSTALL}.
2937 3198
2940 @cindex Updating Emacs 3201 @cindex Updating Emacs
2941 3202
2942 @xref{Installing Emacs}, and follow the instructions there for 3203 @xref{Installing Emacs}, and follow the instructions there for
2943 installation. 3204 installation.
2944 3205
2945 Most files are placed in version-specific directories. Emacs 20.5, for 3206 Most files are placed in version-specific directories. Emacs
2946 instance, places files in @file{/usr/local/share/emacs/20.5}. 3207 @value{VER}, for instance, places files in
3208 @file{/usr/local/share/emacs/@value{VER}}.
2947 3209
2948 Upgrading should overwrite only, @file{/usr/local/bin/emacs} (the Emacs 3210 Upgrading should overwrite only, @file{/usr/local/bin/emacs} (the Emacs
2949 binary) and documentation in @file{/usr/local/info}. Back up these 3211 binary) and documentation in @file{/usr/local/info}. Back up these
2950 files before you upgrade, and you shouldn't have too much trouble. 3212 files before you upgrade, and you shouldn't have too much trouble.
2951 3213
2958 you unpack the Emacs source) to see if there is already a solution for 3220 you unpack the Emacs source) to see if there is already a solution for
2959 your problem. Next, look for other questions in this FAQ that have to 3221 your problem. Next, look for other questions in this FAQ that have to
2960 do with Emacs installation and compilation problems. 3222 do with Emacs installation and compilation problems.
2961 3223
2962 If you'd like to have someone look at your problem and help solve it, 3224 If you'd like to have someone look at your problem and help solve it,
2963 @pxref{Help installing Emacs}. 3225 see @ref{Help installing Emacs}.
2964 3226
2965 If you cannot find a solution in the documentation, send a message to 3227 If you cannot find a solution in the documentation, send a message to
2966 @email{bug-gnu-emacs@@gnu.org}. 3228 @email{bug-gnu-emacs@@gnu.org}.
2967 3229
2968 Please do not post it to @uref{news:gnu.emacs.help} or send e-mail to 3230 Please do not post it to @uref{news:gnu.emacs.help} or send e-mail to
2969 @email{help-gnu-emacs@@gnu.org}. For further guidelines, 3231 @email{help-gnu-emacs@@gnu.org}. For further guidelines, see
2970 @pxref{Guidelines for newsgroup postings} and @ref{Reporting bugs}. 3232 @ref{Guidelines for newsgroup postings} and @ref{Reporting bugs}.
2971 3233
2972 @node Linking with -lX11 fails, , Problems building Emacs, Compiling and installing Emacs 3234 @node Linking with -lX11 fails, , Problems building Emacs, Compiling and installing Emacs
2973 @section Why does linking Emacs with -lX11 fail? 3235 @section Why does linking Emacs with -lX11 fail?
2974 @cindex Linking with -lX11 fails 3236 @cindex Linking with -lX11 fails
2975 @cindex lX11, linking fails with 3237 @cindex lX11, linking fails with
2976 3238
2977 Emacs needs to be linked with the static version of the X11 library, 3239 Emacs needs to be linked with the static version of the X11 library,
2978 @file{libX11.a}. This may be missing. 3240 @file{libX11.a}. This may be missing.
2979 3241
2980 Under OpenWindows, you may need to use "add_services" to add the 3242 On OpenWindows, you may need to use @code{add_services} to add the
2981 "OpenWindows Programmers" optional software category from the CD-ROM. 3243 "OpenWindows Programmers" optional software category from the CD-ROM.
2982 3244
2983 Under HP-UX 8.0, you may need to run "update" again to load the X11-PRG 3245 On HP-UX 8.0, you may need to run @code{update} again to load the
2984 "fileset". This may be missing even if you specified "all filesets" the 3246 X11-PRG ``fileset''. This may be missing even if you specified ``all
2985 first time. If @file{libcurses.a} is missing, you may need to load the 3247 filesets'' the first time. If @file{libcurses.a} is missing, you may
2986 "Berkeley Development Option." 3248 need to load the ``Berkeley Development Option.''
2987 3249
2988 @email{zoo@@armadillo.com, David Zuhn} says that MIT X builds shared 3250 @email{zoo@@armadillo.com, David Zuhn} says that MIT X builds shared
2989 libraries by default, and only shared libraries, on those platforms that 3251 libraries by default, and only shared libraries, on those platforms that
2990 support them. These shared libraries can't be used when undumping 3252 support them. These shared libraries can't be used when undumping
2991 temacs (the last stage of the Emacs build process). To get regular 3253 @code{temacs} (the last stage of the Emacs build process). To get
2992 libraries in addition to shared libraries, add this to @file{site.cf}: 3254 regular libraries in addition to shared libraries, add this to
3255 @file{site.cf}:
2993 3256
2994 @example 3257 @example
2995 #define ForceNormalLib YES 3258 #define ForceNormalLib YES
2996 @end example 3259 @end example
2997 3260
2998 Other systems may have similar problems. You can always define 3261 Other systems may have similar problems. You can always define
2999 CANNOT_DUMP and link with the shared libraries instead. 3262 @code{CANNOT_DUMP} and link with the shared libraries instead.
3000 3263
3264 @cindex X Menus don't work
3001 To get the Xmenu stuff to work, you need to find a copy of MIT's 3265 To get the Xmenu stuff to work, you need to find a copy of MIT's
3002 @file{liboldX.a}. 3266 @file{liboldX.a}.
3003 3267
3004 @c ------------------------------------------------------------ 3268 @c ------------------------------------------------------------
3005 @node Finding Emacs and related packages, Major packages and programs, Compiling and installing Emacs, Top 3269 @node Finding Emacs and related packages, Major packages and programs, Compiling and installing Emacs, Top
3033 @cindex Distribution, retrieving Emacs 3297 @cindex Distribution, retrieving Emacs
3034 @cindex Internet, retreiving from 3298 @cindex Internet, retreiving from
3035 3299
3036 Look in the files @file{etc/DISTRIB} and @file{etc/FTP} for information 3300 Look in the files @file{etc/DISTRIB} and @file{etc/FTP} for information
3037 on nearby archive sites and @file{etc/ORDERS} for mail orders. If you 3301 on nearby archive sites and @file{etc/ORDERS} for mail orders. If you
3038 don't already have Emacs, @pxref{Informational files for Emacs} for how 3302 don't already have Emacs, see @ref{Informational files for Emacs}, for how
3039 to get these files. 3303 to get these files.
3040 3304
3041 @xref{Installing Emacs}, for information on how to obtain and build the latest 3305 @xref{Installing Emacs}, for information on how to obtain and build the latest
3042 version of Emacs, and @pxref{Current GNU distributions} for a list of 3306 version of Emacs, and see @ref{Current GNU distributions}, for a list of
3043 archive sites that make GNU software available. 3307 archive sites that make GNU software available.
3044 3308
3045 @node Finding a package with particular functionality, Packages that do not come with Emacs, Finding Emacs on the Internet, Finding Emacs and related packages 3309 @node Finding a package with particular functionality, Packages that do not come with Emacs, Finding Emacs on the Internet, Finding Emacs and related packages
3046 @section How do I find a Emacs Lisp package that does XXX? 3310 @section How do I find a Emacs Lisp package that does XXX?
3047 @cindex Package, finding 3311 @cindex Package, finding
3055 3319
3056 It is also possible that the package is on your system, but has not been 3320 It is also possible that the package is on your system, but has not been
3057 loaded. To see which packages are available for loading, look through 3321 loaded. To see which packages are available for loading, look through
3058 your computer's lisp directory (@pxref{Filename conventions}). The Lisp 3322 your computer's lisp directory (@pxref{Filename conventions}). The Lisp
3059 source to most most packages contains a short description of how they 3323 source to most most packages contains a short description of how they
3060 should be loaded, invoked, and configured --- so before you use or 3324 should be loaded, invoked, and configured---so before you use or
3061 modify a Lisp package, see if the author has provided any hints in the 3325 modify a Lisp package, see if the author has provided any hints in the
3062 source code. 3326 source code.
3063 3327
3064 If a package does not come with Emacs, check the Lisp Code Directory. 3328 If a package does not come with Emacs, check the Lisp Code Directory.
3065 The LCD was originally maintained by @email{brennan@@hal.com, Dave 3329 The LCD was originally maintained by @email{brennan@@hal.com, Dave
3121 3385
3122 You can access the Emacs Lisp Archive at 3386 You can access the Emacs Lisp Archive at
3123 3387
3124 @uref{ftp://archive.cis.ohio-state.edu/pub/emacs-lisp/} 3388 @uref{ftp://archive.cis.ohio-state.edu/pub/emacs-lisp/}
3125 3389
3390 @noindent
3391 or at
3392
3393 @uref{http://www.cis.ohio-state.edu/emacs-lisp}
3394
3395 @noindent
3126 Retrieve and read the file @file{README} first. 3396 Retrieve and read the file @file{README} first.
3127 3397
3128 @itemize @bullet 3398 @itemize @bullet
3129 3399
3130 @item The archive maintainers do not have time to answer individual 3400 @item
3401 The archive maintainers do not have time to answer individual
3131 requests for packages or the list of packages in the archive. If you 3402 requests for packages or the list of packages in the archive. If you
3132 cannot use FTP or UUCP to access the archive yourself, try to find a 3403 cannot use FTP or UUCP to access the archive yourself, try to find a
3133 friend who can, but please don't ask the maintainers. 3404 friend who can, but please don't ask the maintainers.
3134 3405
3135 @item Any files with names ending in @samp{.Z}, @samp{.z}, or @samp{.gz} are 3406 @item
3407 Any files with names ending in @file{.Z}, @file{.z}, or @file{.gz} are
3136 compressed, so you should use "binary" mode in FTP to retrieve them. 3408 compressed, so you should use "binary" mode in FTP to retrieve them.
3137 You should also use binary mode whenever you retrieve any files with 3409 You should also use binary mode whenever you retrieve any files with
3138 names ending in @samp{.elc}. 3410 names ending in @file{.elc}.
3139 3411
3140 @end itemize 3412 @end itemize
3141 3413
3142 @node Submitting to the Emacs Lisp Archive, Current GNU distributions, Packages that do not come with Emacs, Finding Emacs and related packages 3414 @node Submitting to the Emacs Lisp Archive, Current GNU distributions, Packages that do not come with Emacs, Finding Emacs and related packages
3143 @section How do I submit code to the Emacs Lisp Archive? 3415 @section How do I submit code to the Emacs Lisp Archive?
3145 @cindex Emacs Lisp Archive, submissions to 3417 @cindex Emacs Lisp Archive, submissions to
3146 @cindex Lisp Archive, submissions to 3418 @cindex Lisp Archive, submissions to
3147 @cindex Archive, submitting to the Emacs Lisp 3419 @cindex Archive, submitting to the Emacs Lisp
3148 3420
3149 Guidelines and procedures for submission to the archive can be found in 3421 Guidelines and procedures for submission to the archive can be found in
3150 the file @file{GUIDELINES} in the archive directory (@ref{Packages that 3422 the file @file{GUIDELINES} in the archive directory (@pxref{Packages that
3151 do not come with Emacs}). It covers documentation, copyrights, 3423 do not come with Emacs}). It covers documentation, copyrights,
3152 packaging, submission, and the Lisp Code Directory Record. Anonymous 3424 packaging, submission, and the Lisp Code Directory Record. Anonymous
3153 FTP uploads are not permitted. Instead, all submissions are mailed to 3425 FTP uploads are not permitted. Instead, all submissions are mailed to
3154 @email{elisp-archive@@cis.ohio-state.edu}. The @file{lispdir.el} 3426 @email{elisp-archive@@cis.ohio-state.edu}. The @file{lispdir.el}
3155 package has a function named @code{submit-lcd-entry} which will help you 3427 package has a function named @code{submit-lcd-entry} which will help you
3182 @cindex Lucid Emacs 3454 @cindex Lucid Emacs
3183 @cindex Epoch 3455 @cindex Epoch
3184 3456
3185 First of all, they're both GNU Emacs. XEmacs is just as much a later 3457 First of all, they're both GNU Emacs. XEmacs is just as much a later
3186 version of GNU Emacs as the FSF-distributed version. This FAQ refers to 3458 version of GNU Emacs as the FSF-distributed version. This FAQ refers to
3187 the latest version to be distributed by the FSF as "Emacs," partly 3459 the latest version to be distributed by the FSF as ``Emacs,'' partly
3188 because the XEmacs maintainers now refer to their product using the 3460 because the XEmacs maintainers now refer to their product using the
3189 "XEmacs" name, and partly because there isn't any accurate way to 3461 ``XEmacs'' name, and partly because there isn't any accurate way to
3190 differentiate between the two without getting mired in paragraphs of 3462 differentiate between the two without getting mired in paragraphs of
3191 legalese and history. 3463 legalese and history.
3192 3464
3193 XEmacs, which began life as Lucid Emacs, is based on an early version of 3465 XEmacs, which began life as Lucid Emacs, is based on an early version of
3194 Emacs 19 and Epoch, an X-aware version of Emacs 18. 3466 Emacs 19 and Epoch, an X-aware version of Emacs 18.
3196 Emacs (i.e., the version distributed by the FSF) has a larger installed 3468 Emacs (i.e., the version distributed by the FSF) has a larger installed
3197 base and now always contains the MULE multilingual facilities. 3469 base and now always contains the MULE multilingual facilities.
3198 XEmacs can do some clever tricks with X Windows, such as 3470 XEmacs can do some clever tricks with X Windows, such as
3199 putting arbitrary graphics in a buffer. Similar facilities have been 3471 putting arbitrary graphics in a buffer. Similar facilities have been
3200 implemented for Emacs as part of a new redisplay implementation for 3472 implemented for Emacs as part of a new redisplay implementation for
3201 Emacs 21, expected to be released after Emacs 20.5. 3473 Emacs 21, and are available in the latest Emacs releases.
3202 Emacs and XEmacs each come with 3474 Emacs and XEmacs each come with
3203 Lisp packages that are lacking in the other; RMS says that the FSF would 3475 Lisp packages that are lacking in the other; RMS says that the FSF would
3204 include more packages that come with XEmacs, but that the XEmacs 3476 include more packages that come with XEmacs, but that the XEmacs
3205 maintainers don't always keep track of the authors of contributed code, 3477 maintainers don't always keep track of the authors of contributed code,
3206 which makes it impossible for the FSF to have certain legal papers 3478 which makes it impossible for the FSF to have certain legal papers
3210 3482
3211 Many XEmacs features have found their way into recent versions of Emacs, 3483 Many XEmacs features have found their way into recent versions of Emacs,
3212 and more features can be expected in the future, but there are still many 3484 and more features can be expected in the future, but there are still many
3213 differences between the two. 3485 differences between the two.
3214 3486
3487 The latest stable version of XEmacs as of this writing is 21.1; you can
3488 get it at
3489
3490 @uref{ftp://ftp.xemacs.org/pub/xemacs/current/xemacs-21.1.13.tar.gz}
3491
3492 More information about XEmacs, including a list of frequently asked
3493 questions (FAQ), is available at
3494
3495 @uref{http://www.xemacs.org/}
3496
3215 @node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages 3497 @node Emacs for MS-DOS, Emacs for Windows, Difference between Emacs and XEmacs, Finding Emacs and related packages
3216 @section Where can I get Emacs for my PC running MS-DOS? 3498 @section Where can I get Emacs for my PC running MS-DOS?
3217 @cindex MS-DOS, Emacs for 3499 @cindex MS-DOS, Emacs for
3218 @cindex DOS, Emacs for 3500 @cindex DOS, Emacs for
3219 @cindex Compiling Emacs for DOS 3501 @cindex Compiling Emacs for DOS
3220 @cindex Emacs for MS-DOS 3502 @cindex Emacs for MS-DOS
3221 @cindex Tools needed to compile Emacs under DOS 3503 @cindex Tools needed to compile Emacs under DOS
3222 3504
3223 A pre-built binary distribution of Emacs is available from the Simtel 3505 A pre-built binary distribution of Emacs is available from the
3224 archives. This version apparently works under MS-DOS and Windows (3.x, 3506 SimTel.NET archives. This version apparently works under MS-DOS and
3225 95x, and NT) and supports long file names under Windows 9x. More 3507 Windows (3.X, 9X, ME, NT, and 2000) and supports long file names under
3226 information is available from 3508 Windows 9X, Windows ME, and Windows 2000. More information is available
3509 from
3227 3510
3228 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/emacs.README} 3511 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/emacs.README}
3229 3512
3230 The binary itself is available in the files em1934*.zip in the 3513 The binary itself is available in the files @file{em*.zip} in the
3231 directory 3514 directory
3232 3515
3233 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/} 3516 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/}
3234 3517
3235 If you prefer to compile Emacs for yourself, you can do so with the 3518 If you prefer to compile Emacs for yourself, you can do so with the
3240 following: 3523 following:
3241 3524
3242 @table @emph 3525 @table @emph
3243 3526
3244 @item Compiler 3527 @item Compiler
3245 djgpp version 1.12 maint 1 or later. Djgpp 2.0 or later is 3528 DJGPP version 1.12 maint 1 or later. Djgpp 2.0 or later is
3246 recommended, since 1.x is being phased out. Djgpp 2 supports 3529 recommended, since 1.x is very old an unmaintained. Djgpp 2 supports
3247 long filenames under Windows 9x. 3530 long filenames on Windows 9X/ME/2K.
3248 3531
3249 You can get the latest release of djgpp by retrieving all of 3532 You can get the latest release of DJGPP by retrieving all of
3250 the files in 3533 the files in
3251 3534
3252 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp} 3535 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2*}
3253 3536
3254 @item Gunzip and tar 3537 @item Unpacking program
3255 The easiest way is to use "djtar" which comes with djgpp v2.x, 3538 The easiest way is to use @code{djtar} which comes with DJGPP v2.x,
3256 because it can open gzip'ed tarfiles (i.e., those ending with 3539 because it can open gzip'ed tarfiles (i.e., those ending with
3257 ".tar.gz") in one step. Djtar comes in "djdev201.zip", from 3540 @file{.tar.gz}) in one step. @code{Djtar} comes in
3258 the URL mentioned above. 3541 @file{djdev@var{nnn}.zip} archive (where @var{nnn} is the DJGPP version
3542 number), from the URL mentioned above.
3543
3544 @strong{Warning!} Do @strong{not} use the popular WinZip program to
3545 unpack the Emacs distribution! WinZip is known to corrupt some of the
3546 files by converting them to the DOS CR-LF format, it doesn't always
3547 preserve the directory structure recorded in the compressed Emacs
3548 archive, and commits other atrocities. Some of these problems could
3549 actually prevent Emacs from building successfully!
3259 3550
3260 @item make, mv, sed, and rm 3551 @item make, mv, sed, and rm
3261 All of these utilities are available at 3552 All of these utilities are available at
3262 3553
3263 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu} 3554 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu}
3264 3555
3265 16-bit utilities can be found in GNUish, at 3556 16-bit utilities can be found in GNUish, at
3266 3557
3267 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/gnuish} 3558 @uref{ftp://ftp.simtel.net/pub/simtelnet/gnu/gnuish}
3268 3559
3560 @noindent
3561 (@code{mv} and @code{rm} are in the Fileutils package, @code{sed} and
3562 @code{make} are each one in a separate package named after them.)
3563
3269 @end table 3564 @end table
3270 3565
3271 The files @file{INSTALL} and @file{PROBLEMS} in the top-level directory 3566 The files @file{INSTALL} (near its end) and @file{PROBLEMS} in the
3272 of the Emacs source contains some additional information regarding Emacs 3567 top-level directory of the Emacs source contains some additional
3273 under MS-DOS. 3568 information regarding Emacs under MS-DOS.
3274 3569
3275 For a list of other MS-DOS implementations of Emacs (and Emacs 3570 For a list of other MS-DOS implementations of Emacs (and Emacs
3276 look-alikes), consult the list of "Emacs implementations and literature," 3571 look-alikes), consult the list of "Emacs implementations and literature,"
3277 available at 3572 available at
3278 3573
3283 3578
3284 @node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages 3579 @node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages
3285 @section Where can I get Emacs for Microsoft Windows 3580 @section Where can I get Emacs for Microsoft Windows
3286 @cindex FAQ for NT Emacs 3581 @cindex FAQ for NT Emacs
3287 @cindex Microsoft Windows, Emacs for 3582 @cindex Microsoft Windows, Emacs for
3288 @cindex Windows NT, Emacs for 3583 @cindex Windows NT and Windows 2K, Emacs for
3289 @cindex Windows '95 and '98, Emacs for 3584 @cindex Windows 95, 98, and ME, Emacs for
3290 3585
3291 For information on Emacs for Windows 95 and NT, read the FAQ produced by 3586 For information on Emacs for Windows 95 and NT, read the FAQ produced by
3292 @email{voelker@@cs.washington.edu, Geoff Voelker}, available at 3587 @email{voelker@@cs.washington.edu, Geoff Voelker}, available at
3293 3588
3294 @uref{http://www.gnu.org/software/emacs/windows/ntemacs.html} 3589 @uref{http://www.gnu.org/software/emacs/windows/ntemacs.html}
3335 @uref{ftp://next-ftp.peak.org/pub/next/apps/emacs/Emacs_for_NeXTstep.4.20a1.NIHS.b.tar.gz} 3630 @uref{ftp://next-ftp.peak.org/pub/next/apps/emacs/Emacs_for_NeXTstep.4.20a1.NIHS.b.tar.gz}
3336 3631
3337 @node Emacs for Apple computers, Emacs for VMS and DECwindows, Emacs for NeXTSTEP, Finding Emacs and related packages 3632 @node Emacs for Apple computers, Emacs for VMS and DECwindows, Emacs for NeXTSTEP, Finding Emacs and related packages
3338 @section Where can I get Emacs for my Apple computer? 3633 @section Where can I get Emacs for my Apple computer?
3339 @cindex Apple computers, Emacs for 3634 @cindex Apple computers, Emacs for
3635 @cindex Macintosh, Emacs for
3340 3636
3341 An unofficial port of GNU Emacs 18.59 to the Macintosh is available at a 3637 An unofficial port of GNU Emacs 18.59 to the Macintosh is available at a
3342 number of ftp sites, the home being 3638 number of ftp sites, the home being
3343 @uref{ftp://ftp.cs.cornell.edu/pub/parmet/Emacs-1.17.sit.bin}. 3639 @uref{ftp://ftp.cs.cornell.edu/pub/parmet/Emacs-1.17.sit.bin}.
3344 3640
3345 A port of Emacs 20.4 is available at 3641 A port of Emacs 20.4 is available at
3346 @uref{http://www.cs.hku.hk/~choi/emacs/index.html}. 3642 @uref{http://www.cs.hku.hk/~choi/emacs/index.html}.
3643
3644 Beginning with version 21.1, the Macintosh is supported in the official
3645 Emacs distribution; see the files @file{mac/README} and
3646 @file{mac/INSTALL} in the Emacs distribution for build instructions.
3347 3647
3348 Apple's forthcoming "OS X" is based largely on NeXTSTEP and OpenStep. 3648 Apple's forthcoming "OS X" is based largely on NeXTSTEP and OpenStep.
3349 @xref{Emacs for NeXTSTEP}, for more details about that version. 3649 @xref{Emacs for NeXTSTEP}, for more details about that version.
3350 3650
3351 @node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages 3651 @node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages
3355 3655
3356 Up-to-date information about GNU software (including Emacs) for VMS is 3656 Up-to-date information about GNU software (including Emacs) for VMS is
3357 available at @uref{http://vms.gnu.org/}. 3657 available at @uref{http://vms.gnu.org/}.
3358 3658
3359 @node Modes for various languages, Translating names to IP addresses, Emacs for VMS and DECwindows, Finding Emacs and related packages 3659 @node Modes for various languages, Translating names to IP addresses, Emacs for VMS and DECwindows, Finding Emacs and related packages
3360 @section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C++, Objective-C, Pascal, Java, and Awk? 3660 @section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk?
3361 @cindex Awk, mode for 3661 @cindex Awk, mode for
3362 @cindex @code{awk-mode} 3662 @cindex @code{awk-mode}
3363 @cindex Bison, mode for 3663 @cindex Bison, mode for
3364 @cindex Bourne Shell, mode for 3664 @cindex Bourne Shell, mode for
3365 @cindex C++, mode for 3665 @cindex C@t{++}, mode for
3366 @cindex Java, mode for 3666 @cindex Java, mode for
3367 @cindex Lex mode 3667 @cindex Lex mode
3368 @cindex Objective-C, mode for 3668 @cindex Objective-C, mode for
3369 @cindex @code{pascal-mode} 3669 @cindex @code{pascal-mode}
3370 @cindex Shell mode 3670 @cindex Shell mode
3373 @cindex @code{sh-mode} 3673 @cindex @code{sh-mode}
3374 @cindex @code{cc-mode} 3674 @cindex @code{cc-mode}
3375 3675
3376 Most of these modes are now available in standard Emacs distribution. 3676 Most of these modes are now available in standard Emacs distribution.
3377 To get additional modes, look in the Lisp Code Directory (@pxref{Finding 3677 To get additional modes, look in the Lisp Code Directory (@pxref{Finding
3378 a package with particular functionality}). For C++, if you use 3678 a package with particular functionality}). For C@t{++}, if you use
3379 @code{lisp-dir-apropos}, you must specify the pattern with something 3679 @code{lisp-dir-apropos}, you must specify the pattern with something
3380 like @kbd{M-x lisp-dir-apropos @key{RET} c\+\+ @key{RET}}. 3680 like @kbd{M-x lisp-dir-apropos @key{RET} c\+\+ @key{RET}}.@footnote{
3381 3681 The backslashes in @samp{\+\+} are required because @kbd{M-x
3382 Barry Warsaw's @code{cc-mode} now works for C, C++, Objective-C, and 3682 lisp-dir-apropos} expects a regular expression as its argument
3683 (@pxref{Using regular expressions}), and @samp{+} has a special meaning
3684 in regular expressions.}
3685
3686 Barry Warsaw's @code{cc-mode} now works for C, C@t{++}, Objective-C, and
3383 Java code. You can get the latest version from the Emacs Lisp Archive; 3687 Java code. You can get the latest version from the Emacs Lisp Archive;
3384 @pxref{Packages that do not come with Emacs} for details. A FAQ for 3688 @pxref{Packages that do not come with Emacs} for details. A FAQ for
3385 @code{cc-mode} is available at 3689 @code{cc-mode} is available at
3386 @uref{http://www.python.org/emacs/cc-mode/}. 3690 @uref{http://www.python.org/emacs/cc-mode/}.
3387 3691
3395 If you are on a Unix machine, try using the @samp{nslookup} command, 3699 If you are on a Unix machine, try using the @samp{nslookup} command,
3396 included in the Berkeley BIND package. For example, to find the IP 3700 included in the Berkeley BIND package. For example, to find the IP
3397 address of @samp{ftp.gnu.org}, you would type @code{nslookup 3701 address of @samp{ftp.gnu.org}, you would type @code{nslookup
3398 ftp.gnu.org}. 3702 ftp.gnu.org}.
3399 3703
3400 Your computer should then provide the IP address of that computer. 3704 Your computer should then provide the IP address of that machine.
3401 3705
3402 If your site's nameserver is deficient, you can use IP addresses to FTP 3706 If your site's nameserver is deficient, you can use IP addresses to FTP
3403 files. You can get this information by 3707 files. You can get this information by e-mail:
3404
3405 * E-mail:
3406 3708
3407 @example 3709 @example
3408 To: dns@@[134.214.84.25] (to grasp.insa-lyon.fr) 3710 To: dns@@[134.214.84.25] (to grasp.insa-lyon.fr)
3409 Body: ip XXX.YYY.ZZZ (or "help" for more information 3711 Body: ip XXX.YYY.ZZZ (or "help" for more information
3410 and options - no quotes) 3712 and options - no quotes)
3411 @end example 3713 @end example
3412 3714
3715 @noindent
3413 or: 3716 or:
3414 3717
3415 @example 3718 @example
3416 To: resolve@@[147.31.254.130] (to laverne.cs.widener.edu) 3719 To: resolve@@[147.31.254.130] (to laverne.cs.widener.edu)
3417 Body: site XXX.YYY.ZZZ 3720 Body: site XXX.YYY.ZZZ
3465 Subscription requests to @email{bug-vm-request@@uunet.uu.net}@* 3768 Subscription requests to @email{bug-vm-request@@uunet.uu.net}@*
3466 Submissions to @email{bug-vm@@uunet.uu.net} 3769 Submissions to @email{bug-vm@@uunet.uu.net}
3467 @end table 3770 @end table
3468 3771
3469 VM 6 works with Emacs 20.4, and may cause problems with Emacs 20.3 and 3772 VM 6 works with Emacs 20.4, and may cause problems with Emacs 20.3 and
3470 below. (Note that many people seem to use Emacs 20.3 with VM 6, without 3773 below. (But note that many people seem to use Emacs 20.3 with VM 6,
3471 any problems.) Risk-averse users might wish to try VM 5.97, available 3774 without any problems.) Risk-averse users might wish to try VM 5.97,
3472 from @uref{ftp://ftp.wonderworks.com/pub/vm/, the same FTP site}. 3775 available from @uref{ftp://ftp.wonderworks.com/pub/vm/, the same FTP
3776 site}.
3473 3777
3474 @node Supercite, Calc, VM, Major packages and programs 3778 @node Supercite, Calc, VM, Major packages and programs
3475 @section Supercite --- mail and news citation package within Emacs 3779 @section Supercite --- mail and news citation package within Emacs
3476 @cindex Supercite 3780 @cindex Supercite
3477 @cindex Superyank 3781 @cindex Superyank
3483 3787
3484 @item Author 3788 @item Author
3485 @email{bwarsaw@@cen.com, Barry Warsaw} 3789 @email{bwarsaw@@cen.com, Barry Warsaw}
3486 3790
3487 @item Latest version 3791 @item Latest version
3488 3.1 (comes with Emacs 20) 3792 3.54 (comes bundled with Emacs 20)
3489 3793
3490 @item Distribution 3794 @item Distribution
3491 @uref{http://www.python.org/emacs/supercite.tar.gz} 3795 @uref{http://www.python.org/emacs/supercite.tar.gz}
3492 3796
3493 @item Mailing list 3797 @item Mailing list
3500 3804
3501 @node Calc, VIPER, Supercite, Major packages and programs 3805 @node Calc, VIPER, Supercite, Major packages and programs
3502 @section Calc --- poor man's Mathematica within Emacs 3806 @section Calc --- poor man's Mathematica within Emacs
3503 @cindex Programmable calculator 3807 @cindex Programmable calculator
3504 @cindex Calc 3808 @cindex Calc
3809 @cindex Mathematical package
3505 3810
3506 @table @b 3811 @table @b
3507 3812
3508 @item Author 3813 @item Author
3509 @email{daveg@@csvax.cs.caltech.edu, Dave Gillespie} 3814 @email{daveg@@csvax.cs.caltech.edu, Dave Gillespie}
3514 @item Distribution 3819 @item Distribution
3515 @uref{ftp://ftp.gnu.org/pub/gnu/calc/calc-2.02f.tar.gz} 3820 @uref{ftp://ftp.gnu.org/pub/gnu/calc/calc-2.02f.tar.gz}
3516 3821
3517 @end table 3822 @end table
3518 3823
3824 Note that Calc 2.02f needs patching to work with Emacs 21 and later.
3825
3826 @cindex @code{calculator}, a package
3827 Emacs 21.1 and later comes with a package called @file{calculator.el}.
3828 It doesn't support all the mathematical wizardry offered by Calc, such
3829 as matrices, special functions, and statistics, but is more than
3830 adequate as a replacement for @code{xcalc} and similar programs.
3831
3519 @node VIPER, AUC-TeX, Calc, Major packages and programs 3832 @node VIPER, AUC-TeX, Calc, Major packages and programs
3520 @section VIPER --- vi emulation for Emacs 3833 @section VIPER --- @code{vi} emulation for Emacs
3521 @cindex vi emulation 3834 @cindex @code{vi} emulation
3522 @cindex VIPER 3835 @cindex VIPER
3523 @cindex Emulation of vi 3836 @cindex Emulation of @code{vi}
3524 3837
3525 Since Emacs 19.29, the preferred vi emulation in Emacs is VIPER 3838 Since Emacs 19.29, the preferred @code{vi} emulation in Emacs is VIPER
3526 (@kbd{M-x viper-mode @key{RET}}), which comes with Emacs. It extends 3839 (@kbd{M-x viper-mode @key{RET}}), which comes with Emacs. It extends
3527 and supersedes VIP (including VIP 4.3) and provides vi emulation at 3840 and supersedes VIP (including VIP 4.3) and provides @code{vi} emulation
3528 several levels, from one that closely follows vi to one that departs 3841 at several levels, from one that closely follows @code{vi} to one that
3529 from vi in several significant ways. 3842 departs from @code{vi} in several significant ways.
3530 3843
3531 For Emacs 19.28 and earlier, the following version of VIP is generally 3844 For Emacs 19.28 and earlier, the following version of VIP is generally
3532 better than the one distributed with Emacs: 3845 better than the one distributed with Emacs:
3533 3846
3534 @table @b 3847 @table @b
3552 3865
3553 @table @b 3866 @table @b
3554 3867
3555 @item Authors 3868 @item Authors
3556 @email{krab@@iesd.auc.dk, Kresten Krab Thorup} and@* 3869 @email{krab@@iesd.auc.dk, Kresten Krab Thorup} and@*
3557 @email{abraham@@iesd.auc.dk, Per Abrahamsen} 3870 @email{abraham@@dina.kvl.dk, Per Abrahamsen}
3558 3871
3559 @item Latest version 3872 @item Latest version
3560 9.9p 3873 9.9p
3561 3874
3562 @item Distribution 3875 @item Distribution
3621 3934
3622 @end table 3935 @end table
3623 3936
3624 @itemize @bullet 3937 @itemize @bullet
3625 3938
3626 @item Do not ask Geoff to send you the latest version of Ispell. He does not have free e-mail. 3939 @item
3627 3940 Do not ask Geoff to send you the latest version of Ispell. He does not
3628 @item This Ispell program is distinct from GNU Ispell 4.0. GNU Ispell 3941 have free e-mail.
3629 4.0 is no longer a supported product. 3942
3943 @item
3944 This Ispell program is distinct from GNU Ispell 4.0. GNU Ispell 4.0 is
3945 no longer a supported product.
3630 3946
3631 @end itemize 3947 @end itemize
3632 3948
3633 @node w3-mode, EDB, Ispell, Major packages and programs 3949 @node w3-mode, EDB, Ispell, Major packages and programs
3634 @section w3-mode --- A World Wide Web browser inside of Emacs 3950 @section w3-mode --- A World Wide Web browser inside of Emacs
3635 @cindex WWW browser 3951 @cindex WWW browser
3636 @cindex Web browser 3952 @cindex Web browser
3637 @cindex Browser in Emacs 3953 @cindex HTML browser in Emacs
3638 @cindex @code{w3-mode} 3954 @cindex @code{w3-mode}
3639 3955
3640 @table @b 3956 @table @b
3641 3957
3642 @item Author 3958 @item Author
3683 @cindex Encryption software, interface to 3999 @cindex Encryption software, interface to
3684 4000
3685 @table @b 4001 @table @b
3686 4002
3687 @item Authors 4003 @item Authors
3688 @email{patl@@lcs.mit.edu, Patrick J. LoPresti} and @email{jin@@atype.com, Jin S. Choi} 4004 @email{patl@@lcs.mit.edu, Patrick J. LoPresti} and
4005 @email{jin@@atype.com, Jin S. Choi}
3689 4006
3690 @item Maintainer 4007 @item Maintainer
3691 @email{lbudney@@pobox.com, Len Budney} 4008 @email{lbudney@@pobox.com, Len Budney}
3692 4009
3693 @item Latest version 4010 @item Latest version
3734 4051
3735 @item Author 4052 @item Author
3736 @email{lwall@@wall.org, Larry Wall} (with GNU modifications) 4053 @email{lwall@@wall.org, Larry Wall} (with GNU modifications)
3737 4054
3738 @item Latest version 4055 @item Latest version
3739 2.5 4056 2.5.4
3740 4057
3741 @item Distribution 4058 @item Distribution
3742 @xref{Current GNU distributions}. 4059 @xref{Current GNU distributions}.
3743 4060
3744 @end table 4061 @end table
3775 @cindex Keys, binding to commands 4092 @cindex Keys, binding to commands
3776 @cindex Commands, binding keys to 4093 @cindex Commands, binding keys to
3777 4094
3778 Keys can be bound to commands either interactively or in your 4095 Keys can be bound to commands either interactively or in your
3779 @file{.emacs} file. To interactively bind keys for all modes, type 4096 @file{.emacs} file. To interactively bind keys for all modes, type
3780 @kbd{M-x global-set-key @key{RET} KEY CMD @key{RET}}. 4097 @kbd{M-x global-set-key @key{RET} @var{key} @var{cmd} @key{RET}}.
3781 4098
3782 To bind a key just in the current major mode, type @kbd{M-x local-set-key @key{RET} KEY CMD @key{RET}}. 4099 To bind a key just in the current major mode, type @kbd{M-x
3783 4100 local-set-key @key{RET} @var{key} @var{cmd} @key{RET}}.
3784 See @inforef{Key Bindings, Key Bindings, emacs} for further details. 4101
3785 4102 @inforef{Key Bindings, Key Bindings, emacs}, for further details.
3786 To bind keys on starting Emacs or on starting any given mode, use the 4103
3787 following "trick": First bind the key interactively, then immediately 4104 To make the process of binding keys interactively eaiser, use the
4105 following ``trick'': First bind the key interactively, then immediately
3788 type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed 4106 type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed
3789 to bind the key is in the kill ring, and can be yanked into your 4107 to bind the key is in the kill ring, and can be yanked into your
3790 @file{.emacs} file. If the key binding is global, no changes to the 4108 @file{.emacs} file. If the key binding is global, no changes to the
3791 command are required. For example, 4109 command are required. For example,
3792 4110
3793 @lisp 4111 @lisp
3794 (global-set-key (quote [f1]) (quote help-for-help)) 4112 (global-set-key (quote [f1]) (quote help-for-help))
3795 @end lisp 4113 @end lisp
3796 4114
4115 @noindent
3797 can be placed directly into the @file{.emacs} file. If the key binding is 4116 can be placed directly into the @file{.emacs} file. If the key binding is
3798 local, the command is used in conjunction with the "add-hook" command. 4117 local, the command is used in conjunction with the "add-hook" command.
3799 For example, in tex-mode, a local binding might be 4118 For example, in tex-mode, a local binding might be
3800 4119
3801 @lisp 4120 @lisp
3805 @end lisp 4124 @end lisp
3806 4125
3807 4126
3808 @itemize @bullet 4127 @itemize @bullet
3809 4128
3810 @item Control characters in key sequences, in the form yanked from the 4129 @item
3811 kill ring are given in their graphic form --- i.e., @key{CTRL} is shown 4130 Control characters in key sequences, in the form yanked from the kill
3812 as @samp{^}, @key{TAB} as a set of spaces (usually 8), etc. You may 4131 ring are given in their graphic form---i.e., @key{CTRL} is shown as
3813 want to convert these into their vector or string forms. 4132 @samp{^}, @key{TAB} as a set of spaces (usually 8), etc. You may want
3814 4133 to convert these into their vector or string forms.
3815 @item If a prefix key of the character sequence to be bound is already 4134
4135 @item
4136 If a prefix key of the character sequence to be bound is already
3816 bound as a complete key, then you must unbind it before the new 4137 bound as a complete key, then you must unbind it before the new
3817 binding. For example, if "ESC @{" is previously bound: 4138 binding. For example, if @kbd{ESC @{} is previously bound:
3818 4139
3819 @lisp 4140 @lisp
3820 (global-unset-key [?\e ?@{]) ;; or 4141 (global-unset-key [?\e ?@{]) ;; or
3821 (local-unset-key [?\e ?@{]) 4142 (local-unset-key [?\e ?@{])
3822 @end lisp 4143 @end lisp
3823 4144
3824 @item Aside from commands and "lambda lists," a vector or string also 4145 @item
4146 Aside from commands and ``lambda lists,'' a vector or string also
3825 can be bound to a key and thus treated as a macro. For example: 4147 can be bound to a key and thus treated as a macro. For example:
3826 4148
3827 @lisp 4149 @lisp
3828 (global-set-key [f10] [?\C-x?\e?\e?\C-a?\C-k?\C-g]) ;; or 4150 (global-set-key [f10] [?\C-x?\e?\e?\C-a?\C-k?\C-g]) ;; or
3829 (global-set-key [f10] "\C-x\e\e\C-a\C-k\C-g") 4151 (global-set-key [f10] "\C-x\e\e\C-a\C-k\C-g")
3838 @cindex Misspecified key sequences 4160 @cindex Misspecified key sequences
3839 4161
3840 Usually, one of two things has happened. In one case, the control 4162 Usually, one of two things has happened. In one case, the control
3841 character in the key sequence has been misspecified (e.g. @samp{C-f} 4163 character in the key sequence has been misspecified (e.g. @samp{C-f}
3842 used instead of @samp{\C-f} within a Lisp expression). In the other 4164 used instead of @samp{\C-f} within a Lisp expression). In the other
3843 case, a "prefix key" in the keystroke sequence you were trying to bind 4165 case, a @dfn{prefix key} in the keystroke sequence you were trying to bind
3844 was already bound as a "complete key." Historically, the @samp{ESC [} 4166 was already bound as a @dfn{complete key}. Historically, the @samp{ESC [}
3845 prefix was usually the problem, in which case you should evaluate either 4167 prefix was usually the problem, in which case you should evaluate either
3846 of these forms before attempting to bind the key sequence: 4168 of these forms before attempting to bind the key sequence:
3847 4169
3848 @lisp 4170 @lisp
3849 (global-unset-key [?\e ?[]) ;; or 4171 (global-unset-key [?\e ?[]) ;; or
3859 be postponed until the initial terminal or window-system setup code has 4181 be postponed until the initial terminal or window-system setup code has
3860 been executed but is not, then you will experience this problem (this 4182 been executed but is not, then you will experience this problem (this
3861 code/file execution order is not enforced after startup). 4183 code/file execution order is not enforced after startup).
3862 4184
3863 To postpone the execution of Emacs Lisp code until after terminal or 4185 To postpone the execution of Emacs Lisp code until after terminal or
3864 window-system setup, treat the code as a "lambda list" and set the value 4186 window-system setup, treat the code as a @dfn{lambda list} and set the
3865 of either the @code{term-setup-hook} or @code{window-setup-hook} 4187 value of either the @code{term-setup-hook} or @code{window-setup-hook}
3866 variable to this "lambda function." For example, 4188 variable to this lambda function. For example,
3867 4189
3868 @lisp 4190 @lisp
3869 (add-hook 'term-setup-hook 4191 (add-hook 'term-setup-hook
3870 (lambda () 4192 (lambda ()
3871 (when (string-match "\\`vt220" (or (getenv "TERM") "")) 4193 (when (string-match "\\`vt220" (or (getenv "TERM") ""))
3896 return either a function key symbol or character sequence (see the 4218 return either a function key symbol or character sequence (see the
3897 Emacs on-line documentation for an explanation). This works for other 4219 Emacs on-line documentation for an explanation). This works for other
3898 keys as well. 4220 keys as well.
3899 4221
3900 @node X key translations for Emacs, Handling C-s and C-q with flow control, Working with function and arrow keys, Key bindings 4222 @node X key translations for Emacs, Handling C-s and C-q with flow control, Working with function and arrow keys, Key bindings
3901 @section How do I set the X key "translations" for Emacs? 4223 @section How do I set the X key ``translations'' for Emacs?
3902 @cindex X key translations 4224 @cindex X key translations
3903 @cindex Key translations under X 4225 @cindex Key translations under X
3904 @cindex Translations for keys under X 4226 @cindex Translations for keys under X
3905 4227
3906 Emacs is not written using the Xt library by default, so there are no 4228 Emacs is not written using the Xt library by default, so there are no
3907 "translations" to be set. (We aren't sure how to set such translations 4229 ``translations'' to be set. (We aren't sure how to set such translations
3908 if you do build Emacs with Xt; please let us know if you've done this!) 4230 if you do build Emacs with Xt; please let us know if you've done this!)
3909 4231
3910 The only way to affect the behavior of keys within Emacs is through 4232 The only way to affect the behavior of keys within Emacs is through
3911 "xmodmap" (outside Emacs) or @code{define-key} (inside Emacs). The 4233 @code{xmodmap} (outside Emacs) or @code{define-key} (inside Emacs). The
3912 @code{define-key} command should be used in conjunction with the 4234 @code{define-key} command should be used in conjunction with the
3913 @code{function-key-map} map. For instance, 4235 @code{function-key-map} map. For instance,
3914 4236
3915 @lisp 4237 @lisp
3916 (define-key function-key-map [M-@key{TAB}] [?\M-\t]) 4238 (define-key function-key-map [M-@key{TAB}] [?\M-\t])
3917 @end lisp 4239 @end lisp
3918 4240
4241 @noindent
3919 defines the @kbd{M-@key{TAB}} key sequence. 4242 defines the @kbd{M-@key{TAB}} key sequence.
3920 4243
3921 @node Handling C-s and C-q with flow control, Binding C-s and C-q, X key translations for Emacs, Key bindings 4244 @node Handling C-s and C-q with flow control, Binding C-s and C-q, X key translations for Emacs, Key bindings
3922 @section How do I handle @kbd{C-s} and @kbd{C-q} being used for flow control? 4245 @section How do I handle @kbd{C-s} and @kbd{C-q} being used for flow control?
3923 @cindex Flow control, @kbd{C-s} and @kbd{C-q} with 4246 @cindex Flow control, @kbd{C-s} and @kbd{C-q} with
3924 @cindex @kbd{C-s} and @kbd{C-q} with flow control 4247 @cindex @kbd{C-s} and @kbd{C-q} with flow control
3925 4248
3926 @kbd{C-s} and @kbd{C-q} are used in the XON/XOFF flow control protocol. 4249 @kbd{C-s} and @kbd{C-q} are used in the XON/XOFF flow control protocol.
3927 This messes things up when you're using Emacs, because Emacs binds these 4250 This messes things up when you're using Emacs over a serial line,
3928 keys to commands by default. Because Emacs won't honor them as flow 4251 because Emacs binds these keys to commands by default. Because Emacs
3929 control characters, too many of these characters are not passed on and 4252 won't honor them as flow control characters, too many of these
3930 overwhelm output buffers. Sometimes, intermediate software using 4253 characters are not passed on and overwhelm output buffers. Sometimes,
3931 XON/XOFF flow control will prevent Emacs from ever seeing @kbd{C-s} and 4254 intermediate software using XON/XOFF flow control will prevent Emacs
3932 @kbd{C-q}. 4255 from ever seeing @kbd{C-s} and @kbd{C-q}.
3933 4256
3934 Possible solutions: 4257 Possible solutions:
3935 4258
3936 @itemize @bullet 4259 @itemize @bullet
3937 4260
3938 @item Disable the use of @kbd{C-s} and @kbd{C-q} for flow control. 4261 @item
4262 Disable the use of @kbd{C-s} and @kbd{C-q} for flow control.
3939 4263
3940 You need to determine the cause of the flow control. 4264 You need to determine the cause of the flow control.
3941 4265
3942 @itemize @minus 4266 @itemize @minus
3943 4267
3944 @item your terminal 4268 @item
4269 your terminal
3945 4270
3946 Your terminal may use XON/XOFF flow control to have time to display 4271 Your terminal may use XON/XOFF flow control to have time to display
3947 all the characters it receives. For example, VT series terminals do 4272 all the characters it receives. For example, VT series terminals do
3948 this. It may be possible to turn this off from a setup menu. For 4273 this. It may be possible to turn this off from a setup menu. For
3949 example, on a VT220 you may select "No XOFF" in the setup menu. This 4274 example, on a VT220 you may select ``No XOFF'' in the setup menu. This
3950 is also true for some terminal emulation programs on PCs. 4275 is also true for some terminal emulation programs on PCs.
3951 4276
3952 When you turn off flow control at the terminal, you will also need to 4277 When you turn off flow control at the terminal, you will also need to
3953 turn it off at the other end, which might be at the computer you are 4278 turn it off at the other end, which might be at the computer you are
3954 logged in to or at some terminal server in between. 4279 logged in to or at some terminal server in between.
3955 4280
3956 If you turn off flow control, characters may be lost; using a printer 4281 If you turn off flow control, characters may be lost; using a printer
3957 connected to the terminal may fail. You may be able to get around 4282 connected to the terminal may fail. You may be able to get around
3958 this problem by modifying the "termcap" entry for your terminal to 4283 this problem by modifying the @samp{termcap} entry for your terminal to
3959 include extra NUL padding characters. 4284 include extra NUL padding characters.
3960 4285
3961 @item a modem 4286 @item
4287 a modem
3962 4288
3963 If you are using a dialup connection, the modems may be using 4289 If you are using a dialup connection, the modems may be using
3964 XON/XOFF flow control. It's not clear how to get around this. 4290 XON/XOFF flow control. It's not clear how to get around this.
3965 4291
3966 @item a router or terminal server 4292 @item
4293 a router or terminal server
3967 4294
3968 Some network box between the terminal and your computer may be using 4295 Some network box between the terminal and your computer may be using
3969 XON/XOFF flow control. It may be possible to make it use some other 4296 XON/XOFF flow control. It may be possible to make it use some other
3970 kind of flow control. You will probably have to ask your local 4297 kind of flow control. You will probably have to ask your local
3971 network experts for help with this. 4298 network experts for help with this.
3972 4299
3973 @item tty and/or pty devices 4300 @item
3974 4301 @code{tty} and/or @code{pty} devices
3975 If your connection to Emacs goes through multiple tty and/or pty 4302
3976 devices, they may be using XON/XOFF flow control even when it is not 4303 If your connection to Emacs goes through multiple @code{tty} and/or
3977 necessary. 4304 @code{pty} devices, they may be using XON/XOFF flow control even when it
4305 is not necessary.
3978 4306
3979 @email{eirik@@theory.tn.cornell.edu, Eirik Fuller} writes: 4307 @email{eirik@@theory.tn.cornell.edu, Eirik Fuller} writes:
3980 4308
3981 @quotation 4309 @quotation
3982 Some versions of "rlogin" (and possibly telnet) do not pass flow 4310 Some versions of @code{rlogin} (and possibly @code{telnet}) do not pass
3983 control characters to the remote system to which they connect. On 4311 flow control characters to the remote system to which they connect. On
3984 such systems, Emacs on the remote system cannot disable flow 4312 such systems, Emacs on the remote system cannot disable flow control on
3985 control on the local system. Sometimes "rlogin -8" will avoid this 4313 the local system. Sometimes @samp{rlogin -8} will avoid this problem.
3986 problem. 4314
3987 4315 One way to cure this is to disable flow control on the local host (the
3988 One way to cure this is to disable flow control on the local host 4316 one running @code{rlogin}, not the one running @code{rlogind}) using the
3989 (the one running rlogin, not the one running rlogind) using the 4317 @code{stty} command, before starting the @code{rlogin} process. On many
3990 stty command, before starting the rlogin process. On many systems, 4318 systems, @samp{stty start u stop u} will do this.
3991 @samp{stty start u stop u} will do this.
3992 4319
3993 Some versions of @samp{tcsh} will prevent even this from working. One 4320 Some versions of @samp{tcsh} will prevent even this from working. One
3994 way around this is to start another shell before starting rlogin, 4321 way around this is to start another shell before starting rlogin,
3995 and issue the @samp{stty} command to disable flow control from that shell. 4322 and issue the @samp{stty} command to disable flow control from that shell.
3996 @end quotation 4323 @end quotation
3997 4324
3998 Use @samp{stty -ixon} instead of @samp{stty start u stop u} on some systems. 4325 Use @samp{stty -ixon} instead of @samp{stty start u stop u} on some systems.
3999 4326
4000 @end itemize 4327 @end itemize
4001 4328
4002 @item Make Emacs speak the XON/XOFF flow control protocol. 4329 @item
4330 Make Emacs speak the XON/XOFF flow control protocol.
4003 4331
4004 You can make Emacs treat @kbd{C-s} and @kbd{C-q} as flow control characters by 4332 You can make Emacs treat @kbd{C-s} and @kbd{C-q} as flow control characters by
4005 evaluating the form 4333 evaluating the form
4006 4334
4007 @lisp 4335 @lisp
4008 (enable-flow-control) 4336 (enable-flow-control)
4009 @end lisp 4337 @end lisp
4010 4338
4339 @noindent
4011 to unconditionally enable flow control or 4340 to unconditionally enable flow control or
4012 4341
4013 @lisp 4342 @lisp
4014 (enable-flow-control-on "vt100" "h19") 4343 (enable-flow-control-on "vt100" "h19")
4015 @end lisp 4344 @end lisp
4016 4345
4346 @noindent
4017 (using your terminal names instead of @samp{vt100} or @samp{h19}) to 4347 (using your terminal names instead of @samp{vt100} or @samp{h19}) to
4018 enable selectively. These commands will automatically swap @kbd{C-s} 4348 enable selectively. These commands will automatically swap @kbd{C-s}
4019 and @kbd{C-q} to @kbd{C-\} and @kbd{C-^}. Variables can be used to 4349 and @kbd{C-q} to @kbd{C-\} and @kbd{C-^}. Variables can be used to
4020 change the default swap keys (@code{flow-control-c-s-replacement} and 4350 change the default swap keys (@code{flow-control-c-s-replacement} and
4021 @code{flow-control-c-q-replacement}). 4351 @code{flow-control-c-q-replacement}).
4027 @file{.emacs} file has an error, this will prevent 4357 @file{.emacs} file has an error, this will prevent
4028 @file{lisp/default.el} from being loaded and Emacs may be unusable for 4358 @file{lisp/default.el} from being loaded and Emacs may be unusable for
4029 the user, even for correcting their @file{.emacs} file (unless they're 4359 the user, even for correcting their @file{.emacs} file (unless they're
4030 smart enough to move it to another name). 4360 smart enough to move it to another name).
4031 4361
4362 @code{enable-flow-control} can be invoked interactively as well:
4363 @kbd{M-x enable-flow-control @key{RET}}.
4364
4032 @end itemize 4365 @end itemize
4033 4366
4034 For further discussion of this issue, read the file @file{PROBLEMS} (in 4367 For further discussion of this issue, read the file @file{etc/PROBLEMS}
4035 the top-level directory when you unpack the Emacs source). 4368 (in the Emacs source directory when you unpack the Emacs distribution).
4036 4369
4037 @node Binding C-s and C-q, Backspace invokes help, Handling C-s and C-q with flow control, Key bindings 4370 @node Binding C-s and C-q, Backspace invokes help, Handling C-s and C-q with flow control, Key bindings
4038 @section How do I bind @kbd{C-s} and @kbd{C-q} (or any key) if these keys are filtered out? 4371 @section How do I bind @kbd{C-s} and @kbd{C-q} (or any key) if these keys are filtered out?
4039 @cindex Binding @kbd{C-s} and @kbd{C-q} 4372 @cindex Binding @kbd{C-s} and @kbd{C-q}
4040 @cindex @kbd{C-s} and @kbd{C-q}, binding 4373 @cindex @kbd{C-s} and @kbd{C-q}, binding
4041 4374
4042 To bind @kbd{C-s} and @kbd{C-q}, use either @code{enable-flow-control} 4375 To bind @kbd{C-s} and @kbd{C-q}, use either @code{enable-flow-control}
4043 or @sc{enable-flow-control-on}. @xref{Handling C-s and C-q with flow 4376 or @code{enable-flow-control-on}. @xref{Handling C-s and C-q with flow
4044 control}, for usage and implementation details. 4377 control}, for usage and implementation details.
4045 4378
4046 To bind other keys, use @code{keyboard-translate}. @xref{Swapping keys}, 4379 To bind other keys, use @code{keyboard-translate}. @xref{Swapping keys},
4047 for usage details. To do this for an entire site, you should swap the 4380 for usage details. To do this for an entire site, you should swap the
4048 keys in @file{lisp/site-start.el}. @xref{Handling C-s and C-q with flow 4381 keys in @file{lisp/site-start.el}. @xref{Handling C-s and C-q with flow
4049 control}, for an explanation of why @file{lisp/default.el} should not be 4382 control}, for an explanation of why @file{lisp/default.el} should not be
4050 used. 4383 used.
4051 4384
4052 @itemize @bullet 4385 @itemize @bullet
4053 4386
4054 @item If you do this for an entire site, the users will be confused by 4387 @item
4388 If you do this for an entire site, the users will be confused by
4055 the disparity between what the documentation says and how Emacs 4389 the disparity between what the documentation says and how Emacs
4056 actually behaves. 4390 actually behaves.
4057 4391
4058 @end itemize 4392 @end itemize
4059 4393
4082 @example 4416 @example
4083 stty erase `^?' 4417 stty erase `^?'
4084 @end example 4418 @end example
4085 4419
4086 @item 4420 @item
4087 The person may prefer using the @key{Backspace} key for deleting the 4421 The user may prefer the @key{Backspace} key for deleting the
4088 previous character because it is more conveniently located on their 4422 previous character because it is more conveniently located on their
4089 keyboard or because they don't even have a separate Delete key. In 4423 keyboard or because they don't even have a separate @key{Delete} key.
4090 this case, the @key{Backspace} key should be made to behave like 4424 In this case, the @key{Backspace} key should be made to behave like
4091 @key{Delete}. There are several methods. 4425 @key{Delete}. There are several methods.
4092 4426
4093 @item 4427 @item
4094 Some terminals (e.g., VT3## terminals) allow the character generated 4428 Some terminals (e.g., VT3## terminals) allow the character generated
4095 by the @key{Backspace} key to be changed from a setup menu. 4429 by the @key{Backspace} key to be changed from a setup menu.
4122 4456
4123 Don't try to bind @key{DEL} to @code{help-command}, because there are 4457 Don't try to bind @key{DEL} to @code{help-command}, because there are
4124 many modes that have local bindings of @key{DEL} that will interfere. 4458 many modes that have local bindings of @key{DEL} that will interfere.
4125 4459
4126 @end itemize 4460 @end itemize
4461
4462 When Emacs 21 or later runs on a windowed display, it binds the
4463 @key{Delete} key to a command which deletes the character at point, to
4464 make Emacs more consistent with keyboard operation on these systems.
4127 4465
4128 @node stty and Backspace key, Swapping keys, Backspace invokes help, Key bindings 4466 @node stty and Backspace key, Swapping keys, Backspace invokes help, Key bindings
4129 @section Why doesn't Emacs look at the @file{stty} settings for @key{Backspace} vs. @key{Delete}? 4467 @section Why doesn't Emacs look at the @file{stty} settings for @key{Backspace} vs. @key{Delete}?
4130 @cindex @file{stty} and Emacs 4468 @cindex @file{stty} and Emacs
4131 @cindex Backspace and @file{stty} 4469 @cindex Backspace and @file{stty}
4132 @cindex Delete and @file{stty} 4470 @cindex Delete and @file{stty}
4133 4471
4134 Good question! 4472 Good question!
4135 4473
4474 @c FIXME: RMS explained the reasons for this on emacs-hackers. It's
4475 @c probably worth putting that explanation here.
4476
4136 @node Swapping keys, Producing C-XXX with the keyboard, stty and Backspace key, Key bindings 4477 @node Swapping keys, Producing C-XXX with the keyboard, stty and Backspace key, Key bindings
4137 @section How do I swap two keys? 4478 @section How do I swap two keys?
4138 @cindex Swapping keys 4479 @cindex Swapping keys
4139 @cindex Keys, swapping 4480 @cindex Keys, swapping
4140 @cindex @code{keyboard-translate} 4481 @cindex @code{keyboard-translate}
4146 @lisp 4487 @lisp
4147 (keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL 4488 (keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL
4148 (keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'. 4489 (keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'.
4149 @end lisp 4490 @end lisp
4150 4491
4492 @noindent
4151 The first key sequence of the pair after the function identifies what is 4493 The first key sequence of the pair after the function identifies what is
4152 produced by the keyboard; the second, what is matched for in the 4494 produced by the keyboard; the second, what is matched for in the
4153 keymaps. 4495 keymaps.
4154 4496
4155 Keyboard translations are not the same as key bindings in keymaps. 4497 Keyboard translations are not the same as key bindings in keymaps.
4200 @node No Meta key, No Escape key, Producing C-XXX with the keyboard, Key bindings 4542 @node No Meta key, No Escape key, Producing C-XXX with the keyboard, Key bindings
4201 @section What if I don't have a @key{Meta} key? 4543 @section What if I don't have a @key{Meta} key?
4202 @cindex No @key{Meta} key 4544 @cindex No @key{Meta} key
4203 @cindex @key{Meta} key, what to do if you lack it 4545 @cindex @key{Meta} key, what to do if you lack it
4204 4546
4547 On many keyboards, the @key{Alt} key acts as @key{Meta}, so try it.
4548
4205 Instead of typing @kbd{M-a}, you can type @kbd{@key{ESC} a}. In fact, 4549 Instead of typing @kbd{M-a}, you can type @kbd{@key{ESC} a}. In fact,
4206 Emacs converts @kbd{M-a} internally into @kbd{@key{ESC} a} anyway 4550 Emacs converts @kbd{M-a} internally into @kbd{@key{ESC} a} anyway
4207 (depending on the value of @code{meta-prefix-char}). Note that you 4551 (depending on the value of @code{meta-prefix-char}). Note that you
4208 press @key{Meta} and @key{a} together, while you press @kbd{ESC}, 4552 press @key{Meta} and @key{a} together, but with @key{ESC}, you press
4209 release it, and then press @key{a}. 4553 @key{ESC}, release it, and then press @key{a}.
4210 4554
4211 @node No Escape key, Compose Character, No Meta key, Key bindings 4555 @node No Escape key, Compose Character, No Meta key, Key bindings
4212 @section What if I don't have an @key{Escape} key? 4556 @section What if I don't have an @key{Escape} key?
4213 @cindex No Escape key 4557 @cindex No Escape key
4214 @cindex Lacking an Escape key 4558 @cindex Lacking an Escape key
4229 @cindex @key{Compose Character} key, using as @key{Meta} 4573 @cindex @key{Compose Character} key, using as @key{Meta}
4230 @cindex @key{Meta}, using @key{Compose Character} for 4574 @cindex @key{Meta}, using @key{Compose Character} for
4231 4575
4232 On a dumb terminal such as a VT220, no. It is rumored that certain 4576 On a dumb terminal such as a VT220, no. It is rumored that certain
4233 VT220 clones could have their @key{Compose} key configured this way. If 4577 VT220 clones could have their @key{Compose} key configured this way. If
4234 you're using X, you might be able to do this with the @file{xmodmap} program. 4578 you're using X, you might be able to do this with the @code{xmodmap}
4579 command.
4235 4580
4236 @node Binding combinations of modifiers and function keys, Meta key does not work in xterm, Compose Character, Key bindings 4581 @node Binding combinations of modifiers and function keys, Meta key does not work in xterm, Compose Character, Key bindings
4237 @section How do I bind a combination of modifier key and function key? 4582 @section How do I bind a combination of modifier key and function key?
4238 @cindex Modifiers and function keys 4583 @cindex Modifiers and function keys
4239 @cindex Function keys and modifiers 4584 @cindex Function keys and modifiers
4240 @cindex Binding modifiers and function keys 4585 @cindex Binding modifiers and function keys
4241 4586
4242 With Emacs 19 you can represent modified function keys in vector format 4587 With Emacs 19 and later, you can represent modified function keys in
4243 by adding prefixes to the function key symbol. For example (from the 4588 vector format by adding prefixes to the function key symbol. For
4244 on-line documentation): 4589 example (from the on-line documentation):
4245 4590
4246 @lisp 4591 @lisp
4247 (global-set-key [?\C-x right] 'forward-page) 4592 (global-set-key [?\C-x right] 'forward-page)
4248 @end lisp 4593 @end lisp
4249 4594
4595 @noindent
4250 where @samp{?\C-x} is the Lisp character constant for the character @kbd{C-x}. 4596 where @samp{?\C-x} is the Lisp character constant for the character @kbd{C-x}.
4251 4597
4252 You can use the modifier keys @key{Control}, @key{Meta}, @key{Hyper}, 4598 You can use the modifier keys @key{Control}, @key{Meta}, @key{Hyper},
4253 @key{Super}, @key{Alt}, and @key{Shift} with function keys. To 4599 @key{Super}, @key{Alt}, and @key{Shift} with function keys. To
4254 represent these modifiers, prepend the strings @samp{C-}, @samp{M-}, 4600 represent these modifiers, prepend the strings @samp{C-}, @samp{M-},
4259 (global-set-key [H-M-right] 'forward-word) 4605 (global-set-key [H-M-right] 'forward-word)
4260 @end lisp 4606 @end lisp
4261 4607
4262 @itemize @bullet 4608 @itemize @bullet
4263 4609
4264 @item Not all modifiers are permitted in all situations. @key{Hyper}, 4610 @item
4265 @key{Super}, and @key{Alt} are available only under X (provided there 4611 Not all modifiers are permitted in all situations. @key{Hyper},
4266 are such keys). Non-ASCII keys and mouse events (e.g. @kbd{C-=} and 4612 @key{Super}, and @key{Alt} are not available on Unix character
4613 terminals. Non-ASCII keys and mouse events (e.g. @kbd{C-=} and
4267 @kbd{mouse-1}) also fall under this category. 4614 @kbd{mouse-1}) also fall under this category.
4268 4615
4269 @end itemize 4616 @end itemize
4270 4617
4271 @xref{Binding keys to commands}, for general key binding instructions. 4618 @xref{Binding keys to commands}, for general key binding instructions.
4272 4619
4273 @node Meta key does not work in xterm, ExtendChar key does not work as Meta, Binding combinations of modifiers and function keys, Key bindings 4620 @node Meta key does not work in xterm, ExtendChar key does not work as Meta, Binding combinations of modifiers and function keys, Key bindings
4274 @section Why doesn't my @key{Meta} key work in an xterm window? 4621 @section Why doesn't my @key{Meta} key work in an @code{xterm} window?
4275 @cindex @key{Meta} key and xterm 4622 @cindex @key{Meta} key and @code{xterm}
4276 @cindex Xterm and @key{Meta} key 4623 @cindex Xterm and @key{Meta} key
4277 4624
4278 Try all of these methods before asking for further help: 4625 @inforef{Single-Byte Character Support, Single-Byte Character Set
4626 Support, emacs}.
4627
4628 If the advice in the Emacs manual fails, try all of these methods before
4629 asking for further help:
4279 4630
4280 @itemize @bullet 4631 @itemize @bullet
4281 4632
4282 @item 4633 @item
4283 You may have big problems using @file{mwm} as your window manager. 4634 You may have big problems using @code{mwm} as your window manager.
4284 (Does anyone know a good generic solution to allow the use of the 4635 (Does anyone know a good generic solution to allow the use of the
4285 @key{Meta} key in Emacs with @file{mwm}?) 4636 @key{Meta} key in Emacs with @file{mwm}?)
4286 4637
4287 @item 4638 @item
4288 For X11: Make sure it really is a @key{Meta} key. Use @file{xev} to 4639 For X11: Make sure it really is a @key{Meta} key. Use @code{xev} to
4289 find out what keysym your @key{Meta} key generates. It should be either 4640 find out what keysym your @key{Meta} key generates. It should be either
4290 @key{Meta}_L or @key{Meta}_R. If it isn't, use @file{xmodmap} to fix 4641 @key{Meta}_L or @key{Meta}_R. If it isn't, use @file{xmodmap} to fix
4291 the situation. 4642 the situation.
4292 4643
4293 @item 4644 @item
4294 Make sure the pty the xterm is using is passing 8 bit characters. 4645 Make sure the @code{pty} the @code{xterm} is using is passing 8 bit
4295 @samp{stty -a} (or @samp{stty everything}) should show @samp{cs8} somewhere. 4646 characters. @samp{stty -a} (or @samp{stty everything}) should show
4296 If it shows @samp{cs7} instead, use @samp{stty cs8 -istrip} (or @samp{stty 4647 @samp{cs8} somewhere. If it shows @samp{cs7} instead, use @samp{stty
4297 pass8}) to fix it. 4648 cs8 -istrip} (or @samp{stty pass8}) to fix it.
4298 4649
4299 @item 4650 @item
4300 If there is an rlogin connection between the xterm and the Emacs, the 4651 If there is an @code{rlogin} connection between @code{xterm} and Emacs, the
4301 "-8" argument may need to be given to rlogin to make it pass all 8 bits 4652 @samp{-8} argument may need to be given to rlogin to make it pass all 8 bits
4302 of every character. 4653 of every character.
4303 4654
4304 @item 4655 @item
4305 If the Emacs is running under Ultrix, it is reported that evaluating 4656 If Emacs is running on Ultrix, it is reported that evaluating
4306 @code{(set-input-mode t nil)} helps. 4657 @code{(set-input-mode t nil)} helps.
4307 4658
4308 @item 4659 @item
4309 If all else fails, you can make xterm generate @kbd{@key{ESC} W} when 4660 If all else fails, you can make @code{xterm} generate @kbd{@key{ESC} W} when
4310 you type @kbd{M-W}, which is the same conversion Emacs would make if it 4661 you type @kbd{M-W}, which is the same conversion Emacs would make if it
4311 got the @kbd{M-W} anyway. In X11R4, the following resource 4662 got the @kbd{M-W} anyway. In X11R4, the following resource
4312 specification will do this: 4663 specification will do this:
4313 4664
4314 @example 4665 @example
4315 XTerm.VT100.EightBitInput: false 4666 XTerm.VT100.EightBitInput: false
4316 @end example 4667 @end example
4317 4668
4669 @noindent
4318 (This changes the behavior of the @code{insert-eight-bit} action.) 4670 (This changes the behavior of the @code{insert-eight-bit} action.)
4319 4671
4320 With older xterms, you can specify this behavior with a translation: 4672 With older @code{xterm}s, you can specify this behavior with a translation:
4321 4673
4322 @example 4674 @example
4323 XTerm.VT100.Translations: #override \ 4675 XTerm.VT100.Translations: #override \
4324 Meta<KeyPress>: string(0x1b) insert() 4676 Meta<KeyPress>: string(0x1b) insert()
4325 @end example 4677 @end example
4326 4678
4679 @noindent
4327 You might have to replace @samp{Meta} with @samp{Alt}. 4680 You might have to replace @samp{Meta} with @samp{Alt}.
4328 4681
4329 @end itemize 4682 @end itemize
4330 4683
4331 @node ExtendChar key does not work as Meta, , Meta key does not work in xterm, Key bindings 4684 @node ExtendChar key does not work as Meta, , Meta key does not work in xterm, Key bindings
4332 @section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x? 4685 @section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x?
4333 @cindex @key{ExtendChar} key as @key{Meta} 4686 @cindex @key{ExtendChar} key as @key{Meta}
4334 @cindex @key{Meta}, using @key{ExtendChar} for 4687 @cindex @key{Meta}, using @key{ExtendChar} for
4688 @cindex HP-UX, the @key{ExtendChar} key
4335 4689
4336 This is a result of an internationalization extension in X11R4 and the 4690 This is a result of an internationalization extension in X11R4 and the
4337 fact that HP is now using this extension. Emacs assumes that 4691 fact that HP is now using this extension. Emacs assumes that the
4338 XLookupString returns the same result regardless of the @key{Meta} key 4692 @code{XLookupString} function returns the same result regardless of the
4339 state which is no longer necessarily true. Until Emacs is fixed, the 4693 @key{Meta} key state which is no longer necessarily true. Until Emacs
4340 temporary kludge is to run this command after each time the X server is 4694 is fixed, the temporary kludge is to run this command after each time
4341 started but preferably before any xterm clients are: 4695 the X server is started but preferably before any xterm clients are:
4342 4696
4343 @example 4697 @example
4344 xmodmap -e 'remove mod1 = Mode_switch' 4698 xmodmap -e 'remove mod1 = Mode_switch'
4345 @end example 4699 @end example
4700
4701 @c FIXME: Emacs 21 supports I18N in X11; does that mean that this bug is
4702 @c solved?
4346 4703
4347 This will disable the use of the extra keysyms systemwide, which may be 4704 This will disable the use of the extra keysyms systemwide, which may be
4348 undesirable if you actually intend to use them. 4705 undesirable if you actually intend to use them.
4349 4706
4350 @c ------------------------------------------------------------ 4707 @c ------------------------------------------------------------
4362 @node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets 4719 @node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets
4363 @section How do I make Emacs display 8-bit characters? 4720 @section How do I make Emacs display 8-bit characters?
4364 @cindex Displaying eight-bit characters 4721 @cindex Displaying eight-bit characters
4365 @cindex Eight-bit characters, displaying 4722 @cindex Eight-bit characters, displaying
4366 4723
4367 See @inforef{Single-Byte European Support, Single-byte European 4724 @inforef{Single-Byte Character Support, Single-byte Character Set
4368 Character Support, emacs}. On a non-window-system display you typically 4725 Support, emacs}. On a Unix, when Emacs runs on a character terminal
4369 need to use @code{set-terminal-coding-system} to tell Emacs what the 4726 display or is invoked with @samp{emacs -nw}, you typically need to use
4370 terminal can display, even after setting the language environment. 4727 @code{set-terminal-coding-system} to tell Emacs what the terminal can
4371 Otherwise non-ASCII characters will display as @samp{?}. 4728 display, even after setting the language environment; otherwise
4729 non-ASCII characters will display as @samp{?}. On other operating
4730 systems, such as MS-DOS and MS-Windows, Emacs queries the OS about the
4731 character set supported by the display, and sets up the required
4732 terminal coding system automatically.
4372 4733
4373 @node Inputting eight-bit characters, Kanji and Chinese characters, Emacs does not display 8-bit characters, Alternate character sets 4734 @node Inputting eight-bit characters, Kanji and Chinese characters, Emacs does not display 8-bit characters, Alternate character sets
4374 @section How do I input eight-bit characters? 4735 @section How do I input eight-bit characters?
4375 @cindex Entering eight-bit characters 4736 @cindex Entering eight-bit characters
4376 @cindex Eight-bit characters, entering 4737 @cindex Eight-bit characters, entering
4738 @cindex Input, 8-bit characters
4377 4739
4378 Various methods are available for input of eight-bit characters. See 4740 Various methods are available for input of eight-bit characters. See
4379 @inforef{Single-Byte European Support, Single-byte European Character 4741 @inforef{Single-Byte Character Support, Single-byte Character Set
4380 Support, emacs}. For more sophisticated methods, see @inforef{Input 4742 Support, emacs}. For more sophisticated methods, @inforef{Input
4381 Methods, Input Methods, emacs}. 4743 Methods, Input Methods, emacs}.
4382 4744
4383 @node Kanji and Chinese characters, Right-to-left alphabets, Inputting eight-bit characters, Alternate character sets 4745 @node Kanji and Chinese characters, Right-to-left alphabets, Inputting eight-bit characters, Alternate character sets
4384 @section Where can I get an Emacs that handles kanji, Chinese, or other character sets? 4746 @section Where can I get an Emacs that handles kanji, Chinese, or other Far-Eastern character sets?
4385 @cindex Kanji, handling with Emacs 4747 @cindex Kanji, handling with Emacs
4386 @cindex Chinese, handling with Emacs 4748 @cindex Chinese, handling with Emacs
4387 @cindex Japanese, handling with Emacs 4749 @cindex Japanese, handling with Emacs
4388 @cindex Korean, handling with Emacs 4750 @cindex Korean, handling with Emacs
4389 4751
4390 Emacs 20 now includes many of the features of MULE, the Multilingual 4752 Emacs 20 and later includes many of the features of MULE, the MULtilingual
4391 Enhancement of Emacs. @xref{Installing Emacs}, for information on where 4753 Enhancement to Emacs. @xref{Installing Emacs}, for information on where
4392 to find and download Emacs. 4754 to find and download the latest version of Emacs.
4393 4755
4394 @node Right-to-left alphabets, , Kanji and Chinese characters, Alternate character sets 4756 @node Right-to-left alphabets, , Kanji and Chinese characters, Alternate character sets
4395 @section Where is an Emacs that can handle Semitic (right-to-left) alphabets? 4757 @section Where is an Emacs that can handle Semitic (right-to-left) alphabets?
4396 @cindex Right-to-left alphabets 4758 @cindex Right-to-left alphabets
4397 @cindex Hebrew, handling with Emacs 4759 @cindex Hebrew, handling with Emacs
4398 @cindex Semitic alphabets 4760 @cindex Semitic alphabets
4399 4761 @cindex Arabic alphabets
4400 Emacs 20 supports Hebrew characters (ISO 8859-8), but does not yet 4762
4401 support right-to-left character entry. 4763 Emacs 20 and later supports Hebrew characters (ISO 8859-8), but does not
4764 yet support right-to-left character entry and display.
4402 4765
4403 @email{joel@@exc.com, Joel M. Hoffman} has written a Lisp package called 4766 @email{joel@@exc.com, Joel M. Hoffman} has written a Lisp package called
4404 @file{hebrew.el} that allows right-to-left editing of Hebrew. It 4767 @file{hebrew.el} that allows right-to-left editing of Hebrew. It
4405 reportedly works out of the box with Emacs 19, but requires patches for 4768 reportedly works out of the box with Emacs 19, but requires patches for
4406 Emacs 18. Write to Joel if you want the patches or package. 4769 Emacs 18. Write to Joel if you want the patches or package.
4407 4770
4408 @file{hebrew.el} requires a Hebrew screen font, but no other Hardware support. 4771 @c FIXME: Should we mention Ehud Karni's package?
4772
4773 @file{hebrew.el} requires a Hebrew screen font, but no other hardware support.
4409 Joel has a screen font for PCs running MS-DOS and Linux. 4774 Joel has a screen font for PCs running MS-DOS and Linux.
4410 4775
4411 You might also try to query archie for files named with "hebrew"; 4776 You might also try to query archie for files named with @file{hebrew};
4412 several ftp sites in Israel may also have the necessary files. 4777 several ftp sites in Israel may also have the necessary files.
4413 4778
4414 @c ------------------------------------------------------------ 4779 @c ------------------------------------------------------------
4415 @node Mail and news, Concept index, Alternate character sets, Top 4780 @node Mail and news, Concept index, Alternate character sets, Top
4416 @chapter Mail and news 4781 @chapter Mail and news
4443 @node Changing the included text prefix, Saving a copy of outgoing mail, Mail and news, Mail and news 4808 @node Changing the included text prefix, Saving a copy of outgoing mail, Mail and news, Mail and news
4444 @section How do I change the included text prefix in mail/news followups? 4809 @section How do I change the included text prefix in mail/news followups?
4445 @cindex Prefix in mail/news followups, changing 4810 @cindex Prefix in mail/news followups, changing
4446 @cindex Included text prefix, changing 4811 @cindex Included text prefix, changing
4447 @cindex Setting the included text character 4812 @cindex Setting the included text character
4813 @cindex Quoting in mail messages
4448 4814
4449 If you read mail with Rmail or news with Gnus, set the variable 4815 If you read mail with Rmail or news with Gnus, set the variable
4450 @code{mail-yank-prefix}. For VM, set @code{vm-included-text-prefix}. 4816 @code{mail-yank-prefix}. For VM, set @code{vm-included-text-prefix}.
4451 For mh-e, set @code{mh-ins-buf-prefix}. 4817 For mh-e, set @code{mh-ins-buf-prefix}.
4452 4818
4473 4839
4474 @lisp 4840 @lisp
4475 (setq mail-self-blind t) 4841 (setq mail-self-blind t)
4476 @end lisp 4842 @end lisp
4477 4843
4478 in your @file{.emacs} file. You can automatically include an "FCC:" field by 4844 @noindent
4479 putting something like the following in your @file{.emacs} file: 4845 in your @file{.emacs} file. You can automatically include an @samp{FCC}
4846 field by putting something like the following in your @file{.emacs}
4847 file:
4480 4848
4481 @lisp 4849 @lisp
4482 (setq mail-archive-file-name (expand-file-name "~/outgoing")) 4850 (setq mail-archive-file-name (expand-file-name "~/outgoing"))
4483 @end lisp 4851 @end lisp
4484 4852
4486 by VM, but not always by Rmail. @xref{Learning how to do something}. 4854 by VM, but not always by Rmail. @xref{Learning how to do something}.
4487 4855
4488 If you use @code{mh-e}, add an @samp{FCC} or @samp{BCC} field to your 4856 If you use @code{mh-e}, add an @samp{FCC} or @samp{BCC} field to your
4489 components file. 4857 components file.
4490 4858
4491 It does not work to put "set record filename" in the @file{.mailrc} 4859 It does not work to put @samp{set record filename} in the @file{.mailrc}
4492 file. 4860 file.
4493 4861
4494 @node Expanding aliases when sending mail, Rmail thinks all messages are one big one, Saving a copy of outgoing mail, Mail and news 4862 @node Expanding aliases when sending mail, Rmail thinks all messages are one big one, Saving a copy of outgoing mail, Mail and news
4495 @section Why doesn't Emacs expand my aliases when sending mail? 4863 @section Why doesn't Emacs expand my aliases when sending mail?
4496 @cindex Expanding aliases when sending mail 4864 @cindex Expanding aliases when sending mail
4506 4874
4507 @example 4875 @example
4508 To: Willy Smith <wks@@xpnsv.lwyrs.com> 4876 To: Willy Smith <wks@@xpnsv.lwyrs.com>
4509 @end example 4877 @end example
4510 4878
4511 However, you do not need to --- and probably should not, unless your 4879 However, you do not need to---and probably should not, unless your
4512 system's version of @file{/usr/ucb/mail} (aka mailx) supports RFC822 4880 system's version of @file{/usr/ucb/mail} (a.k.a.@: @code{mailx})
4513 -- separate addresses with commas in your @file{~/.mailrc} file. 4881 supports RFC822---separate addresses with commas in your
4882 @file{~/.mailrc} file.
4514 4883
4515 @item 4884 @item
4516 Emacs normally only reads the @file{.mailrc} file once per session, 4885 Emacs normally only reads the @file{.mailrc} file once per session,
4517 when you start to compose your first mail message. If you edit 4886 when you start to compose your first mail message. If you edit
4518 .mailrc, you can type @kbd{M-x rebuild-mail-abbrevs @key{RET}} to 4887 @file{.mailrc}, you can type @kbd{M-x rebuild-mail-abbrevs @key{RET}} to
4519 make Emacs reread @file{~/.mailrc}. 4888 make Emacs reread @file{~/.mailrc}.
4520 4889
4521 @item 4890 @item
4522 If you like, you can expand mail aliases as abbrevs, as soon as you 4891 If you like, you can expand mail aliases as abbrevs, as soon as you
4523 type them in. To enable this feature, execute the following: 4892 type them in. To enable this feature, execute the following:
4527 @end lisp 4896 @end lisp
4528 4897
4529 Note that the aliases are expanded automatically only after you type 4898 Note that the aliases are expanded automatically only after you type
4530 @key{RET} or a punctuation character (e.g. @kbd{,}). You can force their 4899 @key{RET} or a punctuation character (e.g. @kbd{,}). You can force their
4531 expansion by moving point to the end of the alias and typing @kbd{C-x a e} 4900 expansion by moving point to the end of the alias and typing @kbd{C-x a e}
4532 @kbd{M-x expand-abbrev}. 4901 (@kbd{M-x expand-abbrev}).
4533 @end itemize 4902 @end itemize
4534 4903
4535 @node Rmail thinks all messages are one big one, Sorting the messages in an Rmail folder, Expanding aliases when sending mail, Mail and news 4904 @node Rmail thinks all messages are one big one, Sorting the messages in an Rmail folder, Expanding aliases when sending mail, Mail and news
4536 @section Why does Rmail think all my saved messages are one big message? 4905 @section Why does Rmail think all my saved messages are one big message?
4537 @cindex Rmail thinks all messages are one large message 4906 @cindex Rmail thinks all messages are one large message
4555 @node Rmail writes to /usr/spool/mail, Recovering mail files when Rmail munges them, Sorting the messages in an Rmail folder, Mail and news 4924 @node Rmail writes to /usr/spool/mail, Recovering mail files when Rmail munges them, Sorting the messages in an Rmail folder, Mail and news
4556 @section Why does Rmail need to write to @file{/usr/spool/mail}? 4925 @section Why does Rmail need to write to @file{/usr/spool/mail}?
4557 @cindex Rmail and @file{/usr/spool/mail} 4926 @cindex Rmail and @file{/usr/spool/mail}
4558 @cindex @file{/usr/spool/mail} and Rmail 4927 @cindex @file{/usr/spool/mail} and Rmail
4559 4928
4560 This is the behavior of the @file{movemail} program which Rmail uses. 4929 This is the behavior of the @code{movemail} program which Rmail uses.
4561 This indicates that @file{movemail} is configured to use lock files. 4930 This indicates that @code{movemail} is configured to use lock files.
4562 4931
4563 RMS writes: 4932 RMS writes:
4564 4933
4565 @quotation 4934 @quotation
4566 Certain systems require lock files to interlock access to mail files. 4935 Certain systems require lock files to interlock access to mail files.
4567 On these systems, @file{movemail} must write lock files, or you risk losing 4936 On these systems, @code{movemail} must write lock files, or you risk losing
4568 mail. You simply must arrange to let @file{movemail} write them. 4937 mail. You simply must arrange to let @code{movemail} write them.
4569 4938
4570 Other systems use the flock system call to interlock access. On these 4939 Other systems use the @code{flock} system call to interlock access. On
4571 systems, you should configure @file{movemail} to use @code{flock}. 4940 these systems, you should configure @code{movemail} to use @code{flock}.
4572 @end quotation 4941 @end quotation
4573 4942
4574 @node Recovering mail files when Rmail munges them, Replying to the sender of a message, Rmail writes to /usr/spool/mail, Mail and news 4943 @node Recovering mail files when Rmail munges them, Replying to the sender of a message, Rmail writes to /usr/spool/mail, Mail and news
4575 @section How do I recover my mail files after Rmail munges their format? 4944 @section How do I recover my mail files after Rmail munges their format?
4576 @cindex Recovering munged mail files 4945 @cindex Recovering munged mail files
4577 @cindex Rmail munged my files 4946 @cindex Rmail munged my files
4578 @cindex Mail files, recovering those munged by Rmail 4947 @cindex Mail files, recovering those munged by Rmail
4579 4948
4580 If you have just done @code{rmail-input} on a file and you don't want to 4949 If you have just done @kbd{M-x rmail-input} on a file and you don't want
4581 save it in Rmail's format (called BABYL), just kill the buffer (with 4950 to save it in Rmail's format (called BABYL), just kill the buffer (with
4582 @kbd{C-x k}). 4951 @kbd{C-x k}).
4583 4952
4953 @cindex Exporting messages as Unix mail files
4584 If you typed @kbd{M-x rmail} and it read some messages out of your inbox 4954 If you typed @kbd{M-x rmail} and it read some messages out of your inbox
4585 and you want to put them in a Unix mail file, use @kbd{C-o} on each 4955 and you want to put them in a Unix mail file, use @kbd{C-o} on each
4586 message. 4956 message.
4587 4957
4958 @cindex Converting from BABYL to Unix mail format
4959 @cindex @code{unrmail} command
4588 If you want to convert an existing file from BABYL format to Unix mail 4960 If you want to convert an existing file from BABYL format to Unix mail
4589 format, use the command @kbd{M-x unrmail}: it will prompt you for the 4961 format, use the command @kbd{M-x unrmail}: it will prompt you for the
4590 input and output file names. 4962 input and output file names.
4591 4963
4592 @node Replying to the sender of a message, MIME with Emacs mail packages, Recovering mail files when Rmail munges them, Mail and news 4964 @node Replying to the sender of a message, MIME with Emacs mail packages, Recovering mail files when Rmail munges them, Mail and news
4624 Read the Emacs MIME FAQ, maintained by @email{trey@@cs.berkeley.edu, 4996 Read the Emacs MIME FAQ, maintained by @email{trey@@cs.berkeley.edu,
4625 MacDonald Hall Jackson} at 4997 MacDonald Hall Jackson} at
4626 4998
4627 @uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html} 4999 @uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html}
4628 5000
4629 Version 6.x of VM supports MIME. @xref{VM}. 5001 Version 6.x of VM supports MIME. @xref{VM}. Gnus supports MIME in mail
5002 and news messages as of version 5.8.1 (Pterodactyl). Rmail has limited
5003 support for single-part MIME messages beginning with Emacs 20.3.
4630 5004
4631 @node Automatically starting a mail or news reader, Reading news with Emacs, MIME with Emacs mail packages, Mail and news 5005 @node Automatically starting a mail or news reader, Reading news with Emacs, MIME with Emacs mail packages, Mail and news
4632 @section How do I make Emacs automatically start my mail/news reader? 5006 @section How do I make Emacs automatically start my mail/news reader?
4633 @cindex Mail reader, starting automatically 5007 @cindex Mail reader, starting automatically
4634 @cindex News reader, starting automatically 5008 @cindex News reader, starting automatically
4638 5012
4639 @example 5013 @example
4640 emacs -f gnus 5014 emacs -f gnus
4641 @end example 5015 @end example
4642 5016
5017 @noindent
4643 in Rmail: 5018 in Rmail:
4644 5019
4645 @example 5020 @example
4646 emacs -f rmail 5021 emacs -f rmail
4647 @end example 5022 @end example
4653 gnus 5028 gnus
4654 @end example 5029 @end example
4655 5030
4656 It is probably unwise to automatically start your mail or news reader 5031 It is probably unwise to automatically start your mail or news reader
4657 from your @file{.emacs} file. This would cause problems if you needed to run 5032 from your @file{.emacs} file. This would cause problems if you needed to run
4658 two copies of Emacs at one time. Also, this would make it difficult for 5033 two copies of Emacs at the same time. Also, this would make it difficult for
4659 you to start Emacs quickly when you needed to. 5034 you to start Emacs quickly when you needed to.
4660 5035
4661 @node Reading news with Emacs, Gnus does not work with NNTP, Automatically starting a mail or news reader, Mail and news 5036 @node Reading news with Emacs, Gnus does not work with NNTP, Automatically starting a mail or news reader, Mail and news
4662 @section How do I read news under Emacs? 5037 @section How do I read news under Emacs?
4663 @cindex Reading news under Emacs 5038 @cindex Reading news under Emacs
4664 @cindex Usenet reader in Emacs 5039 @cindex Usenet reader in Emacs
4665 @cindex Gnus newsreader 5040 @cindex Gnus newsreader
4666 5041
4667 Use @kbd{M-x gnus}. It is documented in Info (@pxref{Learning how to do something}). 5042 Use @kbd{M-x gnus}. It is documented in Info (@pxref{Learning how to do
5043 something}).
4668 5044
4669 @node Gnus does not work with NNTP, Viewing articles with embedded underlining, Reading news with Emacs, Mail and news 5045 @node Gnus does not work with NNTP, Viewing articles with embedded underlining, Reading news with Emacs, Mail and news
4670 @section Why doesn't Gnus work via NNTP? 5046 @section Why doesn't Gnus work via NNTP?
4671 @cindex Gnus and NNTP 5047 @cindex Gnus and NNTP
4672 @cindex NNTP, Gnus fails to work with 5048 @cindex NNTP, Gnus fails to work with
4682 (setq nntp-maximum-request 1) 5058 (setq nntp-maximum-request 1)
4683 @end lisp 5059 @end lisp
4684 5060
4685 You can find out what version of NNTP your news server is running by 5061 You can find out what version of NNTP your news server is running by
4686 telnetting to the NNTP port (usually 119) on the news server machine 5062 telnetting to the NNTP port (usually 119) on the news server machine
4687 (i.e., "telnet server-machine 119"). The server should give its version 5063 (i.e., @kbd{telnet server-machine 119}). The server should give its
4688 number in the welcome message. Type "quit" to get out. 5064 version number in the welcome message. Type @kbd{quit} to get out.
4689 5065
4690 @xref{Spontaneous entry into isearch-mode}, for some additional ideas. 5066 @xref{Spontaneous entry into isearch-mode}, for some additional ideas.
4691 5067
4692 @node Viewing articles with embedded underlining, Saving a multi-part Gnus posting, Gnus does not work with NNTP, Mail and news 5068 @node Viewing articles with embedded underlining, Saving a multi-part Gnus posting, Gnus does not work with NNTP, Mail and news
4693 @section How do I view news articles with embedded underlining (e.g., ClariNews)? 5069 @section How do I view news articles with embedded underlining (e.g., ClariNews)?
4699 5075
4700 @example 5076 @example
4701 _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg 5077 _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg
4702 @end example 5078 @end example
4703 5079
4704 @email{amanda@@iesd.auc.dk, Per Abrahamsen} suggests using the following 5080 @email{abraham@@dina.kvl.dk, Per Abrahamsen} suggests using the following
4705 code, which uses the underline face to turn such text into true 5081 code, which uses the underline face to turn such text into true
4706 underlining: 5082 underlining, inconjunction with Gnus:
4707 5083
4708 @lisp 5084 @lisp
4709 (defun gnus-article-prepare-overstrike () 5085 (defun gnus-article-prepare-overstrike ()
4710 ;; Prepare article for overstrike commands. 5086 ;; Prepare article for overstrike commands.
4711 (save-excursion 5087 (save-excursion
4729 'face 'underline)))))))) 5105 'face 'underline))))))))
4730 5106
4731 (add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike) 5107 (add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike)
4732 @end lisp 5108 @end lisp
4733 5109
5110 Latest versions of Gnus do such a conversion automatically.
5111
4734 If you prefer to do away with underlining altogether, you can 5112 If you prefer to do away with underlining altogether, you can
4735 destructively remove it with @kbd{M-x ununderline-region}; do this 5113 destructively remove it with @kbd{M-x ununderline-region}; do this
4736 automatically via 5114 automatically via
4737 5115
4738 @lisp 5116 @lisp
4788 @cindex Newsgroups header, killing articles based on 5166 @cindex Newsgroups header, killing articles based on
4789 @cindex Keywords header, killing articles based on 5167 @cindex Keywords header, killing articles based on
4790 @cindex Control header, killing articles based on 5168 @cindex Control header, killing articles based on
4791 5169
4792 Gnus will complain that the @samp{Newsgroups}, @samp{Keywords}, and 5170 Gnus will complain that the @samp{Newsgroups}, @samp{Keywords}, and
4793 @samp{Control} headers are "Unknown header" fields. 5171 @samp{Control} headers are ``Unknown header'' fields.
4794 5172
4795 For the @samp{Newsgroups} header, there is an easy workaround: kill on the 5173 For the @samp{Newsgroups} header, there is an easy workaround: kill on the
4796 @samp{Xref} header instead, which will be present on any cross-posted article 5174 @samp{Xref} header instead, which will be present on any cross-posted article
4797 (as long as your site carries the cross-post group). 5175 (as long as your site carries the cross-post group).
4798 5176
4829 5207
4830 @email{tale@@uunet.uu.net, David Lawrence} explains: 5208 @email{tale@@uunet.uu.net, David Lawrence} explains:
4831 5209
4832 @quotation 5210 @quotation
4833 The problem is almost always interaction between NNTP and C News. NNTP 5211 The problem is almost always interaction between NNTP and C News. NNTP
4834 POST asks C News's inews to not background itself but rather hang around 5212 POST asks C News's @code{inews} to not background itself but rather hang
4835 and give its exit status so it knows whether the post was successful. 5213 around and give its exit status so it knows whether the post was successful.
4836 (That wait will on some systems not return the exit status of the 5214 (That wait will on some systems not return the exit status of the
4837 waited for job is a different sort of problem.) It ends up taking a 5215 waited for job is a different sort of problem.) It ends up taking a
4838 long time because inews is calling relaynews, which often waits for 5216 long time because @code{inews} is calling @code{relaynews}, which often
4839 another relaynews to free the lock on the news system so it can file the 5217 waits for another @code{relaynews} to free the lock on the news system
4840 article. 5218 so it can file the article.
4841 5219
4842 My preferred solution is to change inews to not call relaynews, but 5220 My preferred solution is to change @code{inews} to not call
4843 rather use newsspool. This loses some error-catching functionality, but 5221 @code{relaynews}, but rather use @code{newsspool}. This loses some
4844 is for the most part safe as inews will detect a lot of the errors on 5222 error-catching functionality, but is for the most part safe as
4845 its own. The C News folks have sped up inews, too, so speed should look 5223 @code{inews} will detect a lot of the errors on its own. The C News
4846 better to most folks as that update propagates around. 5224 folks have sped up @code{inews}, too, so speed should look better to
5225 most folks as that update propagates around.
4847 @end quotation 5226 @end quotation
4848 5227
4849 @node Learning more about Gnus, , Gnus hangs for a long time, Mail and news 5228 @node Learning more about Gnus, , Gnus hangs for a long time, Mail and news
4850 @section Where can I find out more about Gnus? 5229 @section Where can I find out more about Gnus?
4851 @cindex FAQ for Gnus 5230 @cindex FAQ for Gnus