Somewhat edited copy of the most recently posted version.
[bpt/emacs.git] / etc / FAQ
1 GNU Emacs FAQ: Introduction
2
3 This is the introduction to a list of frequently asked questions (FAQ)
4 about GNU Emacs 20 with answers. Some of the answers are not valid for GNU
5 Emacs 18 or 19.
6
7 [This version has been somewhat edited from the last-posted version
8 (as of early December 1998) for inclusion in the Emacs distribution.]
9
10 The FAQ is posted (in five parts) to reduce the noise level in the
11 gnu.emacs.help newsgroup (which is also the help-gnu-emacs mailing list)
12 which results from the repetition of frequently asked questions, wrong
13 answers to these questions, corrections to the wrong answers, corrections
14 to the corrections, debate, name calling, and generally unproductive use of
15 the mailing list. Also, it serves as a repository of the canonical "best"
16 answers to these questions. However, if you know a better answer or even a
17 slight change that improves an answer, please tell us!
18
19 If you know the answer to a question in the FAQ list, please reply to the
20 question by e-mail instead of posting. Help reduce noise!
21
22 The FAQ is crossposted to comp.emacs because some sites do not receive the
23 gnu.* newsgroups. The FAQ is also crossposted to news.answers.
24
25 Full instructions for getting the latest FAQ are in question 22.
26
27 A diff file between the last version of the FAQ and this one should have
28 been posted along with the FAQ. If you did not receive the diff file, you
29 can get it at
30
31 ftp://the-tech.mit.edu/pub/GNU-Emacs/faq-diffs
32
33 Please suggest new questions, answers, wording changes, and deletions by
34 sending mail to emacs-faq@lerner.co.il. The most helpful form for
35 suggestions is a context diff (i.e., the output of `diff -c'). Include
36 "FAQ" in the subject of messages about the FAQ list.
37
38 Please do not send questions to us just because you do not want to disturb
39 a lot of people and you think we would know the answer. We do not have
40 time to answer questions individually. :-(
41
42 --
43 Reuven M. Lerner <reuven@lerner.co.il> and the FAQ team (a full list is
44 at the bottom of the FAQ).
45
46 ----------------------------------------------------------------------
47
48 Notation Used in FAQ
49
50 1: What do these mean: C-h, M-C-a, RET, "ESC a", etc.?
51 2: What does "M-x command" mean?
52 3: How do I read topic XXX in the on-line manual?
53 4: What do these mean: etc/SERVICE, src/config.h, lisp/default.el?
54 5: What are FSF, LPF, OSF, GNU, RMS, FTP, and GPL?
55
56 General Questions
57
58 6: What is the LPF?
59 7: What is the real legal meaning of the GNU copyleft?
60 8: What are appropriate messages for gnu.emacs.help, gnu.emacs.bug,
61 comp.emacs, etc.?
62 9: Where can I get old postings to gnu.emacs.help and other GNU groups?
63 10: Where should I report bugs and other problems with Emacs?
64 11: How do I unsubscribe from this mailing list?
65 12: What is the current address of the FSF?
66
67 On-line Help, Printed Manuals, Other Sources of Help
68
69 13: I'm just starting Emacs; how do I do basic editing?
70 14: How do I find out how to do something in Emacs?
71 15: How do I get a printed copy of the Emacs manual?
72 16: Where can I get documentation on Emacs Lisp?
73 17: How do I install a piece of Texinfo documentation?
74 18: How do I print a Texinfo file?
75 19: Can I view Info files without using Emacs?
76 20: What informational files are available for Emacs?
77 21: Where can I get help in installing Emacs?
78 22: Where can I get the latest version of this document (the FAQ list)?
79
80 Status of Emacs
81
82 23: Where does the name "Emacs" come from?
83 24: What is the latest version of Emacs?
84 25: What is different about Emacs 20?
85
86 Common Things People Want To Do
87
88 26: How do I set up a .emacs file properly?
89 27: How do I debug a .emacs file?
90 28: How do I make Emacs display the current line (or column) number?
91 29: How can I modify the titlebar to contain the current filename?
92 30: How do I turn on abbrevs by default just in mode XXX?
93 31: How do I turn on auto-fill mode by default?
94 32: How do I make Emacs use a certain major mode for certain files?
95 33: How do I search for, delete, or replace unprintable (8-bit or control)
96 characters?
97 34: How can I highlight a region of text in Emacs?
98 35: How do I control Emacs's case-sensitivity when searching/replacing?
99 36: How do I make Emacs wrap words for me?
100 37: Where can I get a better spelling checker for Emacs?
101 38: How can I spell-check TeX or *roff documents?
102 39: How do I change load-path?
103 40: How do I use an already running Emacs from another window?
104 41: How do I make Emacs recognize my compiler's funny error messages?
105 42: How do I indent switch statements like this?
106 43: How can I make Emacs automatically scroll horizontally?
107 44: How do I make Emacs "typeover" or "overwrite" instead of inserting?
108 45: How do I stop Emacs from beeping on a terminal?
109 46: How do I turn down the bell volume in Emacs running under X Windows?
110 47: How do I tell Emacs to automatically indent a new line to the
111 indentation of the previous line?
112 48: How do I show which parenthesis matches the one I'm looking at?
113 49: In C mode, can I show just the lines that will be left after #ifdef
114 commands are handled by the compiler?
115 50: Is there an equivalent to the `.' (dot) command of vi?
116 51: What are the valid X resource settings (i.e., stuff in .Xdefaults)?
117 52: How do I execute ("evaluate") a piece of Emacs Lisp code?
118 53: How do I change Emacs's idea of the tab character's length?
119 54: How do I insert `>' at the beginning of every line?
120 55: How do I insert "_^H" before each character in a region to get an
121 underlined paragraph?
122 56: How do I repeat a command as many times as possible?
123 57: How do I make Emacs behave like this: when I go up or down, the cursor
124 should stay in the same column even if the line is too short?
125 58: How do I tell Emacs to iconify itself?
126 59: How do I use regexps (regular expressions) in Emacs?
127 60: How do I perform a replace operation across more than one file?
128 61: Where is the documentation for "etags"?
129 62: How do I disable backup files?
130 63: How do I disable auto-save-mode?
131 64: How can I create or modify new pull-down menu options?
132 65: How do I delete menus and menu options?
133 66: How do I turn on syntax highlighting?
134 67: How can I force Emacs to scroll only one line when I move past the
135 bottom of the screen?
136 68: How can I replace highlighted text with what I type?
137 69: How can I edit MS-DOS files using Emacs?
138 70: How can I tell Emacs to fill paragraphs with a single space after
139 each period?
140
141 Bugs/Problems
142
143 71: Does Emacs have problems with files larger than 8 megabytes?
144 72: How do I get rid of ^M or echoed commands in my shell buffer?
145 73: Why do I get "Process shell exited abnormally with code 1"?
146 74: Where is the termcap/terminfo entry for terminal type "emacs"?
147 75: Why does Emacs spontaneously start displaying "I-search:" and beeping?
148 76: Why can't Emacs talk to certain hosts (or certain hostnames)?
149 77: Why does Emacs say "Error in init file"?
150 78: Why does Emacs ignore my X resources (my .Xdefaults file)?
151 79: Why does Emacs take 20 seconds to visit a file?
152 80: How do I edit a file with a `$' in its name?
153 81: Why does shell mode lose track of the shell's current directory?
154 82: Are there any security risks in Emacs?
155 83: Dired says, "no file on this line" when I try to do something.
156
157 Difficulties Building/Installing/Porting Emacs
158
159 84: How do I install Emacs?
160 85: How do I update Emacs to the latest version?
161 86: What should I do if I have trouble building Emacs?
162 87: Why does linking Emacs with -lX11 fail?
163
164 Finding/Getting Emacs and Related Packages
165
166 88: Where can I get Emacs on the net (or by snail mail)?
167 89: How do I find a Emacs Lisp package that does XXX?
168 90: Where can I get Emacs Lisp packages that don't come with Emacs?
169 91: How do I submit code to the Emacs Lisp Archive?
170 92: Where can I get other up-to-date GNU stuff?
171 93: What is the difference between Emacs and XEmacs (formerly "Lucid
172 Emacs")?
173 94: Where can I get Emacs for my PC running MS-DOS?
174 95: Where can I get Emacs for Microsoft Windows, Windows '95, or Windows
175 NT?
176 96: Where can I get Emacs for my PC running OS/2?
177 97: Where can I get Emacs for my Atari ST?
178 98: Where can I get Emacs for my Amiga?
179 99: Where can I get Emacs for NeXTSTEP?
180 100: Where can I get Emacs for my Apple computer?
181 101: Where do I get Emacs that runs on VMS under DECwindows?
182 102: Where can I get modes for Lex, Yacc/Bison, Bourne shell, Csh, C++,
183 Objective-C, Pascal, Java, and Awk?
184 103: What is the IP address of XXX.YYY.ZZZ?
185
186 Major Emacs Lisp Packages, Emacs Extensions, and Related Programs
187
188 104: VM (View Mail) -- another mail reader within Emacs, with MIME support
189 105: SuperCite -- mail and news citation package within Emacs
190 106: Calc -- poor man's Mathematica within Emacs
191 107: VIPER -- vi emulation for Emacs
192 108: AUC TeX -- enhanced LaTeX mode with debugging facilities
193 109: BBDB -- personal Info Rolodex integrated with mail/news readers
194 110: Ispell -- spell checker in C with interface for Emacs
195 111: W3-mode -- A World Wide Web browser inside of Emacs
196 112: EDB -- Database program for Emacs; replaces forms editing modes
197 113: Mailcrypt -- PGP interface within Emacs mail and news
198 114: Patch -- program to apply "diffs" for updating files
199
200 Changing Key Bindings and Handling Key Binding Problems
201
202 115: How do I bind keys (including function keys) to commands?
203 116: Why does Emacs say "Key sequence XXX uses invalid prefix characters"?
204 117: Why doesn't this [terminal or window-system setup] code work in my
205 .emacs file, but it works just fine after Emacs starts up?
206 118: How do I use function keys under X Windows?
207 119: How do I tell what characters or symbols my function or arrow keys
208 emit?
209 120: How do I set the X key "translations" for Emacs?
210 121: How do I handle C-s and C-q being used for flow control?
211 122: How do I bind `C-s' and `C-q' (or any key) if these keys are filtered
212 out?
213 123: Why does the "Backspace" key invoke help?
214 124: Why doesn't Emacs look at the stty settings for Backspace vs. Delete?
215 125: How do I "swap" two keys?
216 126: How do I produce C-XXX with my keyboard?
217 127: What if I don't have a Meta key?
218 128: What if I don't have an Escape key?
219 129: Can I make my "Compose Character" key behave like a Meta key?
220 130: How do I bind a combination of modifier key and function key?
221 131: Why doesn't my Meta key work in an xterm window?
222 132: Why doesn't my ExtendChar key work as a Meta key under HP-UX 8.0
223 and 9.x?
224
225 Using Emacs with Alternate Character Sets
226
227 133: How do I make Emacs display 8-bit characters?
228 134: How do I input 8-bit characters?
229 135: Where can I get an Emacs that handles kanji, Chinese, or other
230 character sets?
231 136: Where is an Emacs that can handle Semitic (right-to-left) alphabets?
232
233 Mail and News
234
235 137: How do I change the included text prefix in mail/news followups?
236 138: How do I save a copy of outgoing mail?
237 139: Why doesn't Emacs expand my aliases when sending mail?
238 140: Why does Rmail think all my saved messages are one big message?
239 141: How can I sort the messages in my Rmail folder?
240 142: Why does Rmail need to write to /usr/spool/mail?
241 143: How do I recover my mail files after Rmail munges their format?
242 144: How can I force Rmail to reply to the sender of a message, but not the
243 other recipients?
244 145: How can I get my favorite Emacs mail package to support MIME?
245 146: How do I make Emacs automatically start my mail/news reader?
246 147: How do I read news under Emacs?
247 148: Why doesn't Gnus work via NNTP?
248 149: How do I view news articles with embedded underlining (e.g.,
249 ClariNews)?
250 150: How do I save all the items of a multi-part posting in Gnus?
251 151: How do I make Gnus start up faster?
252 152: How do I catch up all newsgroups in Gnus?
253 153: Why can't I kill in Gnus based on the Newsgroups/Keywords/Control
254 headers?
255 154: How do I get rid of flashing messages in Gnus for slow connections?
256 155: Why is catch up slow in Gnus?
257 156: Why does Gnus hang for a long time when posting?
258 157: Where can I find out more about Gnus?
259
260 ------------------------------------------------------------
261
262 If you are viewing this text in a GNU Emacs Buffer, you can type "M-2 C-x
263 $" to get an overview of just the questions. Then, when you want to look
264 at the text of the answers, just type "C-x $".
265
266 To search for a question numbered XXX, type "M-C-s ^XXX:", followed by a
267 C-r if that doesn't work. Type RET to end the search.
268
269 If you have a web browser and the browse-url package configured for
270 it, you can visit ftp and HTTP uniform resource locators (URLs) by
271 placing the cursor on the URL and typing M-x browse-url-at-point.
272
273 The FAQ is posted in five parts; if you are missing a section or would
274 prefer to read the FAQ in a single file, see question 22.
275
276 ------------------------------------------------------------
277 Time-stamp: <1998-09-18 14:41:10 reuven>
278
279
280 Notation Used in FAQ
281
282 Skip this section and then come back if you don't understand some of the
283 later answers.
284
285 1: What do these mean: C-h, M-C-a, RET, "ESC a", etc.?
286
287 C-x: press the `x' key while holding down the Control key
288
289 M-x: press the `x' key while holding down the Meta key (if your computer
290 doesn't have a Meta key, see question 127)
291
292 M-C-x: press the `x' key while holding down both Control and Meta
293 C-M-x: a synonym for the above
294
295 LFD: Linefeed or Newline; same as C-j
296 RET: Return, sometimes marked Enter; same as C-m
297 DEL: Delete, usually not the same as Backspace; same as C-? (See
298 question 123 if deleting invokes Emacs help)
299 ESC: Escape; same as C-[
300 TAB: Tab; same as C-i
301 SPC: Space bar
302
303 Key sequences longer than one key (and some single-key sequences) are
304 inside double quotes or on lines by themselves. Any real spaces in such
305 a key sequence should be ignored; only SPC really means press the space
306 key.
307
308 The ASCII code sent by C-x (except for C-?) is the value that would be
309 sent by pressing just `x' minus 96 (or 64 for uppercase `X') and will be
310 from 0 to 31. The ASCII code sent by M-x is the sum of 128 and the ASCII
311 code that would be sent by pressing just the `x' key. Essentially, the
312 Control key turns off bits 5 and 6 and the Meta key turns on bit 7.
313
314 NOTE: C-? (aka DEL) is ASCII code 127. It is a misnomer to call C-? a
315 "control" key, since 127 has both bits 5 and 6 turned ON. Also, on very
316 few keyboards does C-? generate ASCII code 127.
317
318 For further information, see "Characters" and "Keys" in the on-line
319 manual. (See question 3 if you don't know how.)
320
321 2: What does "M-x command" mean?
322
323 "M-x command" means type M-x, then type the name of the command, then
324 type RET. (See question 1 if you're not sure what "M-x" and "RET" mean.)
325
326 M-x (by default) invokes the command "execute-extended-command". This
327 command allows you to run any Emacs command if you can remember the
328 command's name. If you can't remember the command's name, you can type
329 TAB and SPC for completion, `?' for a list of possibilities, and M-p and
330 M-n to see previous commands entered. An Emacs "command" is any
331 "interactive" Emacs function.
332
333 NOTE: Your system administrator may have bound other key sequences to
334 invoke execute-extended-command. A function key labeled `Do' is a good
335 candidate for this.
336
337 To run non-interactive Emacs functions, see question 52.
338
339 3: How do I read topic XXX in the on-line manual?
340
341 When we refer you to topic XXX in the on-line manual, you can read this
342 manual node inside Emacs (assuming nothing is broken) by typing this:
343
344 C-h i m emacs RET m XXX RET
345
346 This invokes Info, the GNU hypertext documentation browser. If you don't
347 already know how to use Info, type `?' from within Info.
348
349 If we refer to topic XXX:YYY, type this:
350
351 C-h i m emacs RET m XXX RET m YYY RET
352
353 WARNING: Your system administrator may not have installed the Info files,
354 or may have installed them improperly. In this case you should complain.
355
356 See question 15 if you would like a paper copy of the Emacs manual.
357
358 4: What do these mean: etc/SERVICE, src/config.h, lisp/default.el?
359
360 These are files that come with Emacs. The Emacs distribution is divided
361 into subdirectories; the important ones are "etc", "lisp", and "src".
362
363 If you use Emacs, but don't know where it is kept on your system, start
364 Emacs, then type "C-h v data-directory RET". The directory name
365 displayed by this will be the full pathname of the installed "etc"
366 directory.
367
368 The location of your Info directory (i.e., where on-line documentation is
369 stored) is kept in the variable Info-default-directory-list. Use "C-h v
370 Info-default-directory-list RET" to see the contents of this variable,
371 which will be a list of directory names. The last directory in that list
372 is probably where most Info files are stored. By default, Info
373 documentation is placed in /usr/local/info.
374
375 Some of these files are available individually via FTP or e-mail; see
376 question 20. All are available in the source distribution. Many of the
377 files in the "etc" directory are also available via the Emacs "help"
378 menu, or by typing "C-h ?" (M-x help-for-help).
379
380 WARNING: Your system administrator may have removed the src directory and
381 many files from the etc directory.
382
383 5: What are FSF, LPF, OSF, GNU, RMS, FTP, and GPL?
384
385 FSF == Free Software Foundation
386 LPF == League for Programming Freedom
387 OSF == Open Software Foundation
388 GNU == GNU's Not Unix
389 RMS == Richard Matthew Stallman
390 FTP == File Transfer Protocol
391 GPL == GNU General Public License
392
393 NOTE: Avoid confusing the FSF, the LPF, and the OSF. The LPF opposes
394 look-and-feel copyrights and software patents. The FSF aims to make high
395 quality free software available for everyone. The OSF is a consortium of
396 computer vendors which develops commercial software for Unix systems.
397
398 NOTE: The word "free" in the title of the Free Software Foundation refers
399 to "freedom," not "zero dollars." Anyone can charge any price for
400 GPL-covered software that they want to. However, in practice, the
401 freedom enforced by the GPL leads to low prices, because you can always
402 get the software for less money from someone else, because everyone has
403 the right to resell or give away GPL-covered software.
404
405
406 General Questions
407
408 6: What is the LPF?
409
410 The LPF opposes the expanding danger of software patents and
411 look-and-feel copyrights. To get more information, feel free to contact
412 the LPF via e-mail or otherwise. You may also contact Joe Wells
413 <jbw@cs.bu.edu>; he will be happy to talk with you about the LPF.
414
415 You can find more information about the LPF in the file etc/LPF. More
416 papers describing the LPF's views are available on the Internet and also
417 from the LPF:
418
419 http://lpf.ai.mit.edu/
420
421 7: What is the real legal meaning of the GNU copyleft?
422
423 The real legal meaning of the GNU General Public License (copyleft) will
424 only be known if and when a judge rules on its validity and scope. There
425 has never been a copyright infringement case involving the GPL to set any
426 precedents. Please take any discussion regarding this issue to the
427 newsgroup gnu.misc.discuss, which was created to hold the extensive flame
428 wars on the subject.
429
430 RMS writes:
431
432 The legal meaning of the GNU copyleft is less important than the
433 spirit, which is that Emacs is a free software project and that work
434 pertaining to Emacs should also be free software. "Free" means that
435 all users have the freedom to study, share, change and improve Emacs.
436 To make sure everyone has this freedom, pass along source code when you
437 distribute any version of Emacs or a related program, and give the
438 recipients the same freedom that you enjoyed.
439
440 8: What are appropriate messages for gnu.emacs.help, gnu.emacs.bug,
441 comp.emacs, etc.?
442
443 The file etc/MAILINGLISTS discusses the purpose of each GNU mailing-list.
444 (See question 20 if you want a copy of the file.) For those lists which
445 are gatewayed with newsgroups, it lists both the newsgroup name and the
446 mailing list address.
447
448 comp.emacs is for discussion of Emacs programs in general. This includes
449 Emacs along with various other implementations, such as JOVE, MicroEmacs,
450 Freemacs, MG, Unipress, CCA, and Epsilon.
451
452 Many people post Emacs questions to comp.emacs because they don't receive
453 any of the gnu.* newsgroups. Arguments have been made both for and
454 against posting GNU-Emacs-specific material to comp.emacs. You have to
455 decide for yourself.
456
457 Messages advocating "non-free" software are considered unacceptable on
458 any of the gnu.* newsgroups except for gnu.misc.discuss, which was
459 created to hold the extensive flame-wars on the subject. "Non-free"
460 software includes any software for which the end user can't freely modify
461 the source code and exchange enhancements. Be careful to remove the
462 gnu.* groups from the "Newsgroups:" line when posting a followup that
463 recommends such software.
464
465 gnu.emacs.bug is a place where bug reports appear, but avoid posting bug
466 reports to this newsgroup (see question 10).
467
468 9: Where can I get old postings to gnu.emacs.help and other GNU groups?
469
470 The FSF has maintained archives of all of the GNU mailing lists for many
471 years, although there may be some unintentional gaps in coverage. The
472 archive is not particularly well organized or easy to retrieve individual
473 postings from, but pretty much everything is there. The latest archives
474 are available at
475
476 ftp://ftp.gnu.org/pub/gnu/MailingListArchives/current
477
478 Web-based Usenet search services, such as DejaNews, also archive the
479 gnu.* groups. You can reach DejaNews at
480
481 http://www.dejanews.com
482
483 10: Where should I report bugs and other problems with Emacs?
484
485 The correct way to report Emacs bugs is by e-mail to
486 bug-gnu-emacs@gnu.org. Anything sent here also appears in the
487 newsgroup gnu.emacs.bug, but please use e-mail instead of news to submit
488 the bug report. This ensures a reliable return address so you can be
489 contacted for further details.
490
491 Be sure to read the "Bugs" section of the Emacs manual before reporting a
492 bug to bug-gnu-emacs! The manual describes in detail how to submit a
493 useful bug report. (See question 3 if you don't know how to read the
494 manual.)
495
496 RMS says:
497
498 Sending bug reports to help-gnu-emacs (which has the effect of posting
499 on gnu.emacs.help) is undesirable because it takes the time of an
500 unnecessarily large group of people, most of whom are just users and
501 have no idea how to fix these problem. bug-gnu-emacs reaches a much
502 smaller group of people who are more likely to know what to do and have
503 expressed a wish to receive more messages about Emacs than the others.
504
505 However, RMS says there are circumstances when it is okay to post to
506 gnu.emacs.help:
507
508 If you have reported a bug and you don't hear about a possible fix,
509 then after a suitable delay (such as a week) it is okay to post on
510 gnu.emacs.help asking if anyone can help you.
511
512 If you are unsure whether you have found a bug, consider the following
513 non-exhaustive list, courtesy of RMS:
514
515 If Emacs crashes, that is a bug. If Emacs gets compilation errors
516 while building, that is a bug. If Emacs crashes while building, that
517 is a bug. If Lisp code does not do what the documentation says it
518 does, that is a bug.
519
520 11: How do I unsubscribe from this mailing list?
521
522 If you are receiving a GNU mailing list named "XXX", you might be able to
523 unsubscribe from it by sending a request to the address
524 <XXX-request@gnu.org>. However, this will not work if you are
525 not listed on the main mailing list, but instead receive the mail from a
526 distribution point. In that case, you will have to track down at which
527 distribution point you are listed. Inspecting the "Received:" headers on
528 the mail messages may help, along with liberal use of the "EXPN" or
529 "VRFY" sendmail commands through "telnet <site-address> smtp". Ask your
530 postmaster for help.
531
532 12: What is the current address of the FSF?
533
534 E-mail: gnu@gnu.org
535 Telephone: +1-617-542-5942
536 Fax: +1-617-542-2652
537 World Wide Web: http://www.gnu.org/
538
539 Postal address:
540 Free Software Foundation
541 59 Temple Place - Suite 330
542 Boston, MA 02111-1307
543 USA
544
545 For details on how to order items directly from the FSF, see the file
546 etc/ORDERS.
547
548
549 On-line Help, Printed Manuals, Other Sources of Help
550
551 13: I'm just starting Emacs; how do I do basic editing?
552
553 Type "C-h t" to invoke the self-paced tutorial. Just typing `C-h' enters
554 the help system.
555
556 WARNING: Your system administrator may have changed `C-h' to act like DEL
557 to deal with local keyboards. You can use M-x help-for-help instead to
558 invoke help. To discover what key (if any) invokes help on your system,
559 type "M-x where-is RET help-for-help RET". This will print a
560 comma-separated list of key sequences in the echo area. Ignore the last
561 character in each key sequence listed. Each of the resulting key
562 sequences invokes help.
563
564 NOTE: Emacs help works best if it is invoked by a single key whose value
565 should be stored in the variable help-char.
566
567 There is also a WWW-based tutorial for Emacs 18, much of which is also
568 relevant for Emacs 20, available at
569
570 http://kufacts.cc.ukans.edu/cwis/writeups/misc/emacsguide.html
571
572 14: How do I find out how to do something in Emacs?
573
574 There are several methods for finding out how to do things in Emacs.
575
576 * The complete text of the Emacs manual is available on-line via the Info
577 hypertext reader. Type "C-h i" to invoke Info. Typing `h' immediately
578 after entering Info will provide a short tutorial on how to use it.
579
580 * You can order a hardcopy of the manual from the FSF. See question 15.
581
582 * You can get a printed reference card listing commands and keys to
583 invoke them. You can order one from the FSF for $1 (or 10 for $5), or
584 you can print your own from the etc/refcard.tex or etc/refcard.ps files
585 in the Emacs distribution.
586
587 * You can list all of the commands whose names contain a certain word
588 (actually which match a regular expression) using "C-h a" (M-x
589 command-apropos).
590
591 * You can list all of the functions and variables whose names contain a
592 certain word using M-x apropos.
593
594 * There are many other commands in Emacs for getting help and
595 information. To get a list of these commands, type `?' after `C-h'.
596
597 15: How do I get a printed copy of the Emacs manual?
598
599 You can order a printed copy of the Emacs manual from the FSF. For
600 details see the file etc/ORDERS.
601
602 The full TeX source for the manual also comes in the "man" directory of
603 the Emacs distribution, if you're daring enough to try to print out this
604 440-page manual yourself (see question 18).
605
606 If you absolutely have to print your own copy, and you don't have TeX,
607 you can get a PostScript version from
608
609 ftp://ftp.cs.ubc.ca/pub/archive/gnu/manuals_ps/emacs-19.21.ps.gz
610
611 Note that the above document is somewhat out of date, although most major
612 concepts are still relevant. This site requests that you please *confine
613 any major ftping to late evenings or early mornings, local time* (Pacific
614 time zone, GMT-8).
615
616 A WWW version of the (somewhat outdated) Emacs 19.34 manual is at
617
618 http://www.cl.cam.ac.uk/texinfodoc/emacs_toc.html
619
620 See also question 14 for how to view the manual on-line.
621
622 16: Where can I get documentation on Emacs Lisp?
623
624 Within Emacs, you can type "C-h f" to get the documentation for a
625 function, "C-h v" for a variable.
626
627 For more information, obtain the Emacs Lisp Reference Manual. Details on
628 ordering it from FSF are in file etc/ORDERS.
629
630 The Emacs Lisp Reference Manual is also available on-line, in Info
631 format. Texinfo source for the manual (along with pregenerated Info
632 files) is available at
633
634 ftp://ftp.gnu.org/pub/gnu/elisp-manual-20-2.5.tar.gz
635
636 and all mirrors of ftp.gnu.org (See question 92 for a list). See
637 question 17 if you want to install the Info files, or question 18 if you
638 want to use the Texinfo source to print the manual yourself.
639
640 WWW versions of the Emacs Lisp Reference Manual are available at
641
642 http://www.cl.cam.ac.uk/texinfodoc/elisp_1.html
643 http://www.cs.indiana.edu/usr/local/www/elisp/lispref/elisp_toc.html
644
645 17: How do I install a piece of Texinfo documentation?
646
647 First, you must turn the Texinfo files into Info files. You may do this
648 using the stand-alone "makeinfo" program, available as part of the latest
649 Texinfo package at
650
651 ftp://ftp.gnu.org/pub/gnu/texinfo-3.12.tar.gz
652
653 and all mirrors of ftp.gnu.org (see question 92 for a list).
654
655 For information about the Texinfo format, read the Texinfo manual which
656 comes with Emacs. This manual also comes installed in Info format, so
657 you can read it on-line.
658
659 Neither texinfo-format-buffer nor makeinfo installs the resulting Info
660 files in Emacs's Info tree. To install Info files:
661
662 1. Move the files to the "info" directory in the installed Emacs
663 distribution. See question 4 if you don't know where that is.
664
665 2. Edit the file info/dir in the installed Emacs distribution, and add a
666 line for the top level node in the Info package that you are
667 installing. Follow the examples already in this file. The format is:
668
669 * Topic: (relative-pathname). Short description of topic.
670
671 If (as it should have done) the Texinfo file used the @direntry
672 command, you can run the "install-info" command from the current
673 Texinfo distribution to do this automatically -- see the example in
674 the top-level Makefile in the Emacs source.
675
676 If you want to install Info files and you don't have the necessary
677 privileges, you have several options:
678
679 * Info files don't actually need to be installed before being used. You
680 can feed a file name to the Info-goto-node command (invoked by pressing
681 `g' in Info mode) by typing the name of the file in parentheses. This
682 goes to the node named "Top" in that file. For example, to view a Info
683 file named "XXX" in your home directory, you can type this:
684
685 C-h i g (~/XXX) RET
686
687 * You can create your own Info directory. You can tell Emacs where the
688 Info directory is by adding its pathname to the value of the variable
689 Info-default-directory-list. For example, to use a private Info
690 directory which is a subdirectory of your home directory named "Info",
691 you could put this in your .emacs file:
692
693 (setq Info-default-directory-list
694 (cons "~/Info" Info-default-directory-list))
695
696 You will need a top-level Info file named "dir" in this directory which
697 has everything the system dir file has in it, except it should list
698 only entries for Info files in that directory. You might not need it
699 if all files in this directory were referenced by other "dir" files.
700 The node lists from all dir files in Info-default-directory-list are
701 merged by the Info system.
702
703 18: How do I print a Texinfo file?
704
705 NOTE: You can't get nicely printed output from Info files; you must still
706 have the original Texinfo source file for the manual you want to print.
707
708 Assuming you have TeX installed on your system, follow these steps:
709
710 1. Make sure the first line of the Texinfo file looks like this:
711
712 \input texinfo
713
714 You may need to change "texinfo" to the full pathname of the
715 texinfo.tex file, which comes with Emacs as man/texinfo.tex (or copy
716 or link it into the current directory).
717
718 2. tex XXX.texinfo
719
720 3. texindex XXX.??
721
722 The texindex program comes with Emacs as man/texindex.c.
723
724 4. tex XXX.texinfo
725
726 5. Print the DVI file XXX.dvi in the normal way for printing DVI files at
727 your site.
728
729 To get more general instructions, retrieve the latest Texinfo package
730 mentioned in question 17. The "texi2dvi" command from it will perform
731 the above steps 1 to 4 for you.
732
733 19: Can I view Info files without using Emacs?
734
735 Yes. Here are some alternative programs:
736
737 * Info, a stand-alone version of the Info program, comes as part of the
738 Texinfo package. See question 17 for details.
739
740 * Xinfo, a stand-alone version of the Info program that runs under X
741 Windows. You can get it at
742
743 ftp://ftp.gnu.org/pub/gnu/xinfo-1.01.01.tar.gz
744
745 and all mirrors of ftp.gnu.org (See question 92 for a list).
746
747 * Tkinfo, an Info viewer that runs under X Windows and uses Tcl/Tk. You
748 can get Tkinfo at
749
750 http://math-www.uni-paderborn.de/~axel/tkinfo/
751
752 20: What informational files are available for Emacs?
753
754 This isn't a frequently asked question, but it should be! A variety of
755 informational files about Emacs and relevant aspects of the GNU project
756 are available for you to read.
757
758 The following files are available in the "etc" directory of the Emacs
759 distribution (see question 4 if you're not sure where that is).
760
761 COPYING -- Emacs General Public License
762 DISTRIB -- Emacs Availability Information, including the popular
763 "Free Software Foundation Order Form"
764 FAQ -- Emacs Frequently Asked Questions (You're reading it)
765 FTP -- How to get GNU Software by Internet FTP or by UUCP
766 GNU -- The GNU Manifesto
767 INTERVIEW -- Richard Stallman discusses his public-domain
768 UNIX-compatible software system with BYTE editors
769 LPF -- Why you should join the League for Programming Freedom
770 MACHINES -- Status of Emacs on Various Machines and Systems
771 MAILINGLISTS -- GNU Project Electronic Mailing Lists
772 NEWS -- Emacs news, a history of user-visible changes
773 PROBLEMS -- Known problems with building and running Emacs in various
774 situations, often with workarounds.
775 SERVICE -- GNU Service Directory
776 SUN-SUPPORT -- including "Using Emacstool with GNU Emacs"
777
778 Latest versions of some of the above files are also available at
779
780 ftp://ftp.gnu.org/pub/gnu/GNUinfo/
781
782 More GNU information, including back issues of the "GNU's Bulletin", are at
783
784 http://www.gnu.org/bulletins/bulletins.html
785 http://www.cs.pdx.edu/~trent/gnu/gnu.html
786
787 21: Where can I get help in installing Emacs?
788
789 See question 84 for some basic installation hints, and question 83 if you
790 have problems with the installation.
791
792 The file etc/SERVICE (see question 4 if you're not sure where that is)
793 lists companies and individuals willing to sell you help in installing or
794 using Emacs. An up-to-date version this file is available on ftp.gnu.org
795 (see question 20).
796
797 22: Where can I get the latest version of this document (the FAQ list)?
798
799 The Emacs FAQ is available in several ways:
800
801 * Inside of Emacs itself. You can get it from selecting the "Emacs FAQ"
802 option from the "Help" menu at the top of any Emacs frame, or by typing
803 C-h F (M-x view-emacs-FAQ).
804
805 * Via USENET. If you can read news, the FAQ should be available in your
806 news spool, in both the gnu.emacs.help and comp.emacs newsgroups.
807 Every news reader should allow you to read any news article that is
808 still in the news spool, even if you have read the article before. You
809 may need to read the instructions for your news reader to discover how
810 to do this. In rn, this command will do this for you at the article
811 selection level:
812
813 ?GNU Emacs Frequently Asked Questions?rc:m
814
815 In Gnus, you should type "C-u c-x c-s" from the *Summary* buffer or
816 "C-u SPC" from the *Newsgroup* buffer to view all articles in a
817 newsgroup.
818
819 If the FAQ articles have expired and been deleted from your news spool,
820 it might (or might not) do some good to complain to your news
821 administrator, because the most recent FAQ should not expire for a
822 while.
823
824 * Via anonymous FTP. You can always fetch the latest FAQ at
825
826 ftp://ftp.lerner.co.il/pub/emacs/faq.txt
827 ftp://ftp.lerner.co.il/pub/emacs/faq.gz
828
829 http://ftp.lerner.co.il/emacs/faq.txt
830 http://ftp.lerner.co.il/emacs/faq.gz
831
832 * In the Emacs distribution. Since Emacs 18.56, the FAQ at the time of
833 release has been part of the Emacs distribution as etc/FAQ (see
834 question 4).
835
836 * Via the World Wide Web. Point your favorite Web browser at:
837
838 http://www.geek-girl.com/emacs/faq/index.html
839
840 This is an old version, but it works.
841
842 * Via anonymous ftp and e-mail from rtfm.mit.edu (and its mirror in
843 Europe), the main repository for FAQs and other items posted to
844 news.answers. The Emacs FAQs are available at
845
846 ftp://rtfm.mit.edu/pub/usenet/comp.emacs/
847 ftp://ftp.uni-paderborn.de/pub/doc/FAQ/comp/emacs/
848
849 If you do not have access to anonymous FTP, you can access the archives
850 using the rtfm.mit.edu mail server. The Emacs FAQ can be retrieved by
851 sending mail to mail-server@rtfm.mit.edu with a blank subject and
852 containing
853
854 send usenet/news.answers/GNU-Emacs-FAQ/diffs
855 send usenet/news.answers/GNU-Emacs-FAQ/part1
856 send usenet/news.answers/GNU-Emacs-FAQ/part2
857 send usenet/news.answers/GNU-Emacs-FAQ/part3
858 send usenet/news.answers/GNU-Emacs-FAQ/part4
859 send usenet/news.answers/GNU-Emacs-FAQ/part5
860
861 For more information, send email to mail-server@rtfm.mit.edu with
862 "help" and "index" in the body on separate lines.
863
864 * As the very last resort, you can e-mail a request to
865 emacs-faq@lerner.co.il. Don't do this unless you have made a serious
866 effort to obtain the FAQ list via one of the methods listed above.
867
868
869 Status of Emacs
870
871 23: Where does the name "Emacs" come from?
872
873 Emacs originally was an acronym for Editor MACroS. RMS says he "picked
874 the name Emacs because `E' was not in use as an abbreviation on ITS at
875 the time." The first Emacs was a set of macros written in 1976 at MIT by
876 RMS for the editor TECO (Text Editor and COrrector, originally Tape
877 Editor and COrrector) under ITS on a PDP-10. RMS had already extended
878 TECO with a "real-time" full screen mode with reprogrammable keys. Emacs
879 was started by Guy Steele <gls@east.sun.com> as a project to unify the
880 many divergent TECO command sets and key bindings at MIT, and completed
881 by RMS.
882
883 Many people have said that TECO code looks a lot like line noise. See
884 alt.lang.teco if you are interested. Someone has written a TECO
885 implementation in Emacs Lisp (to find it, see question 90); it would be
886 an interesting project to run the original TECO Emacs inside of Emacs.
887
888 For some not-so-serious alternative reasons for Emacs to have that name,
889 check out etc/JOKES (see question 4).
890
891 24: What is the latest version of Emacs?
892
893 Emacs 20.4 is the current version as of this writing.
894
895 25: What is different about Emacs 20?
896
897 To find out what has changed in recent versions, type C-h n (M-x
898 view-emacs-news). The oldest changes are at the bottom of the file, so
899 you might want to read it starting there, rather than at the top.
900
901 The differences between Emacs versions 18 and 19 was rather dramatic; the
902 introduction of frames, faces, and colors on windowing systems was
903 obvious to even the most casual user.
904
905 There are differences between Emacs versions 19 and 20 as well, but many
906 are more subtle or harder to find. Among the changes are the inclusion
907 of MULE code for languages that use non-Latin characters, the "customize"
908 facility for modifying variables without having to use Lisp, and
909 automatic conversion of files from Macintosh, Microsoft, and Unix
910 platforms.
911
912 Many Lisp packages have been updated and enhanced for Emacs 20.
913
914
915 Common Things People Want To Do
916
917 26: How do I set up a .emacs file properly?
918
919 See "Init File" in the on-line manual.
920
921 WARNING: In general, new Emacs users should not have .emacs files,
922 because it causes confusing non-standard behavior. Then they send
923 questions to help-gnu-emacs asking why Emacs isn't behaving as
924 documented. :-)
925
926 Emacs 20 includes the new "customize" facility, which can be invoked
927 using M-x customize RET or via the Help menu. This allows users who are
928 unfamiliar with Emacs Lisp to modify their .emacs files in a relatively
929 straightforward way, using menus rather than Lisp code. While all the
930 packages included with Emacs (are meant to) support Customize now,
931 packages from other sources may not.
932
933 While Customize might indeed make it easier to configure Emacs, consider
934 taking a bit of time to learn Emacs Lisp and modifying your .emacs
935 directly. Simple configuration options are described rather completely in
936 the "Init File" section of the on-line manual, for users interested in
937 performing frequently requested, basic tasks.
938
939 27: How do I debug a .emacs file?
940
941 Start Emacs with the "-debug-init" command-line option. This enables the
942 Emacs Lisp debugger before evaluating your .emacs file, and places you in
943 the debugger if something goes wrong. The top line in the trace-back
944 buffer will be the error message, and the second or third line of that
945 buffer will display the Lisp code from your .emacs file that caused the
946 problem.
947
948 You can also evaluate an individual function or argument to a function in
949 your .emacs file by moving the cursor to the end of the function or
950 argument and typing "C-x C-e" (M-x eval-last-sexp). "C-M-x" (M-x
951 eval-defun) is particularly useful for re-evaluating "defvar" and
952 "customize" forms.
953
954 Use "C-h v" (M-x describe-variable) to check the value of variables which
955 you are trying to set or use.
956
957 28: How do I make Emacs display the current line (or column) number?
958
959 To toggle having Emacs automatically display the current line number of the
960 point in the mode line, do "M-x line-number-mode". (This option is on by
961 default.) Note that Emacs will not display the line number if the buffer is
962 larger than the value of the variable line-number-display-limit.
963
964 As of Emacs 20, you can similarly display the current column with "M-x
965 column-number-mode", by putting the form
966
967 (setq column-number-mode t)
968
969 in your .emacs file or by using Customize.
970
971 The "%c" format specifier in the variable mode-line-format will insert
972 the current column's value into the mode line. See the documentation for
973 mode-line-format (using "C-h v mode-line-format RET") for more
974 information on how to set and use this variable.
975
976 Users of all Emacs versions can display the current column using Per
977 Abrahamsen's <abraham@iesd.auc.dk> "column" package. See question 90 for
978 instructions on how to get it.
979
980 None of the vi emulation modes provide the "set number" capability of vi
981 (as far as we know) but Kyle Jones's setnu.el package implements such a
982 feature.
983
984 29: How can I modify the titlebar to contain the current filename?
985
986 The contains of an Emacs frame's titlebar is controlled by the variable
987 frame-title-format, which has the same structure as the variable
988 mode-line-format. (Use "C-h v" or "M-x describe-variable" to get
989 information about one or both of these variables.)
990
991 By default, the titlebar for a frame does contain the name of the buffer
992 currently being visited, except if there is a single frame. In such a
993 case, the titlebar contains the name of the user and the machine at which
994 Emacs was invoked. This is done by setting frame-title-format to the
995 default value of
996
997 (multiple-frames "%b" ("" invocation-name "@" system-name))
998
999 To modify the behavior such that frame titlebars contain the buffer's
1000 name regardless of the number of existing frames, include the following
1001 in your .emacs:
1002
1003 (setq frame-title-format "%b")
1004
1005 30: How do I turn on abbrevs by default just in mode XXX?
1006
1007 Put this in your .emacs file:
1008
1009 (condition-case ()
1010 (quietly-read-abbrev-file)
1011 (file-error nil))
1012
1013 (add-hook 'XXX-mode-hook
1014 (lambda ()
1015 (setq abbrev-mode t)))
1016
1017 31: How do I turn on auto-fill mode by default?
1018
1019 To turn on auto-fill mode just once for one buffer, use "M-x
1020 auto-fill-mode".
1021
1022 To turn it on for every buffer in a certain mode, you must use the hook
1023 for that mode. For example, to turn on auto-fill mode for all text
1024 buffers, including the following in your .emacs file:
1025
1026 (add-hook 'text-mode-hook 'turn-on-auto-fill)
1027
1028 You can also do this via the Help -> Options menu, which runs the command
1029 toggle-text-mode-auto-fill.
1030
1031 If you want auto-fill mode on in all major modes, do this:
1032
1033 (setq-default auto-fill-function 'do-auto-fill)
1034
1035 32: How do I make Emacs use a certain major mode for certain files?
1036
1037 If you want to use XXX mode for all files which end with the extension
1038 ".YYY", this will do it for you:
1039
1040 (add-to-list 'auto-mode-alist '("\\.YYY\\'" . XXX-mode))
1041
1042 Otherwise put this somewhere in the first line of any file you want to
1043 edit in XXX mode (in the second line, if the first line begins with
1044 "#!"):
1045
1046 -*-XXX-*-
1047
1048 Beginning with Emacs 19, the variable interpreter-mode-alist specifies
1049 which mode to use when loading a shell script. (Emacs determines which
1050 interpreter you're using by examining the first line of the file.) This
1051 feature only applies when the file name doesn't indicate which mode to
1052 use. Use "C-h v" (or M-x describe-variable) on interpreter-mode-alist to
1053 learn more.
1054
1055 33: How do I search for, delete, or replace unprintable (8-bit or control)
1056 characters?
1057
1058 To search for a single character that appears in the buffer as, for
1059 example, "\237", you can type "C-s C-q 2 3 7". (This assumes the value
1060 of search-quote-char is 17 (i.e., `C-q').) Searching for ALL unprintable
1061 characters is best done with a regular expression ("regexp") search. The
1062 easiest regexp to use for the unprintable chars is the complement of the
1063 regexp for the printable chars.
1064
1065 Regexp for the printable chars: [\t\n\r\f -~]
1066 Regexp for the unprintable chars: [^\t\n\r\f -~]
1067
1068 To type these special characters in an interactive argument to
1069 isearch-forward-regexp or re-search-forward, you need to use C-q. (`\t',
1070 `\n', `\r', and `\f' stand respectively for TAB, LFD, RET, and C-l.) So,
1071 to search for unprintable characters using re-search-forward:
1072
1073 M-x re-search-forward RET [^ TAB C-q LFD C-q RET C-q C-l SPC -~] RET
1074
1075 Using isearch-forward-regexp:
1076
1077 M-C-s [^ TAB RET C-q RET C-q C-l SPC -~]
1078
1079 To delete all unprintable characters, simply use replace-regexp:
1080
1081 M-x replace-regexp RET [^ TAB C-q LFD C-q RET C-q C-l SPC -~] RET RET
1082
1083 Replacing is similar to the above. To replace all unprintable characters
1084 with a colon, use:
1085
1086 M-x replace-regexp RET [^ TAB C-q LFD C-q RET C-q C-l SPC -~] RET : RET
1087
1088 NOTE: * You don't need to quote TAB with either isearch or typing
1089 something in the minibuffer.
1090
1091 34: How can I highlight a region of text in Emacs?
1092
1093 If you are using a windowing system such as X, you can cause the region
1094 to be highlighted when the mark is active by including
1095
1096 (transient-mark-mode t)
1097
1098 in your .emacs file, using Customize or via the Help->Options menu.
1099 (Also see question 66.)
1100
1101 35: How do I control Emacs's case-sensitivity when searching/replacing?
1102
1103 For searching, the value of the variable case-fold-search determines
1104 whether they are case sensitive:
1105
1106 (setq case-fold-search nil) ; make searches case sensitive
1107 (setq case-fold-search t) ; make searches case insensitive
1108
1109 To change this or similar variables during an Emacs session, use
1110 M-x set-variable.
1111
1112 Similarly, for replacing, the variable case-replace determines whether
1113 replacements preserve case.
1114
1115 To change the case sensitivity just for one major mode, use the major
1116 mode's hook. For example:
1117
1118 (add-hook 'XXX-mode-hook
1119 (lambda ()
1120 (setq case-fold-search nil)))
1121
1122 36: How do I make Emacs wrap words for me?
1123
1124 Use auto-fill mode, activated by typing "M-x auto-fill-mode". The
1125 default maximum line width is 70, determined by the variable fill-column.
1126 To learn how to turn this on automatically, see question 31.
1127
1128 37: Where can I get a better spelling checker for Emacs?
1129
1130 Use Ispell. See question 110.
1131
1132 38: How can I spell-check TeX or *roff documents?
1133
1134 Use Ispell. See question 110. Ispell can handle TeX and *roff
1135 documents.
1136
1137 39: How do I change load-path?
1138
1139 In general, you should only *add* to the load-path. You can add
1140 directory /XXX/YYY to the load path like this:
1141
1142 (setq load-path (cons "/XXX/YYY/" load-path))
1143
1144 To do this relative to your home directory:
1145
1146 (setq load-path (cons "~/YYY/" load-path)
1147
1148 40: How do I use an already running Emacs from another window?
1149
1150 Emacsclient, which comes with Emacs, is for editing a file using an
1151 already running Emacs rather than starting up a new Emacs. It does this
1152 by sending a request to the already running Emacs, which must be
1153 expecting the request.
1154
1155 * Setup
1156
1157 Emacs must have executed the "server-start" function for emacsclient to
1158 work. This can be done either by a command line option:
1159
1160 emacs -f server-start
1161
1162 or by invoking server-start from the .emacs file:
1163
1164 (if (some conditions are met) (server-start))
1165
1166 When this is done, Emacs starts a subprocess running a program called
1167 "server". "server" creates a Unix domain socket in the user's home
1168 directory named .emacs_server.
1169
1170 To get your news reader, mail reader, etc., to invoke emacsclient, try
1171 setting the environment variable EDITOR (or sometimes VISUAL) to the
1172 value "emacsclient". You may have to specify the full pathname of the
1173 emacsclient program instead. Examples:
1174
1175 # csh commands:
1176 setenv EDITOR emacsclient
1177 setenv EDITOR /usr/local/emacs/etc/emacsclient # using full pathname
1178
1179 # sh command:
1180 EDITOR=emacsclient ; export EDITOR
1181
1182 * Normal use
1183
1184 When emacsclient is run, it connects to the ".emacs_server" socket and
1185 passes its command line options to "server". When "server" receives
1186 these requests, it sends this information on the the Emacs process,
1187 which at the next opportunity will visit the files specified. (Line
1188 numbers can be specified just like with Emacs.) The user will have to
1189 switch to the Emacs window by hand. When the user is done editing a
1190 file, the user can type "C-x #" (or M-x server-edit) to indicate this.
1191 If there is another buffer requested by emacsclient, Emacs will switch
1192 to it; otherwise emacsclient will exit, signaling the calling program
1193 to continue.
1194
1195 NOTE: "emacsclient" and "server" must be running on machines which
1196 share the same filesystem for this to work. The pathnames that
1197 emacsclient specifies should be correct for the filesystem that the
1198 Emacs process sees. The Emacs process should not be suspended at the
1199 time emacsclient is invoked. emacsclient should either be invoked from
1200 another X window or from a shell window inside Emacs itself.
1201
1202 There is an enhanced version of emacsclient/server called "gnuserv" by
1203 Andy Norman <ange@hplb.hpl.hp.com> which is available in the Emacs Lisp
1204 Archive (see question 90). Gnuserv uses Internet domain sockets, so it
1205 can work across most network connections. It also supports the
1206 execution of arbitrary Emacs Lisp forms and does not require the client
1207 program to wait for completion.
1208
1209 The alpha version of an enhanced version of gnuserv is available at
1210
1211 ftp://ftp.splode.com/pub/users/friedman/packages/fgnuserv-1.0.tar.gz
1212
1213 41: How do I make Emacs recognize my compiler's funny error messages?
1214
1215 The variable compilation-error-regexp-alist helps control how Emacs
1216 parses your compiler output. It is a list of triples of the form:
1217
1218 (REGEXP FILE-IDX LINE-IDX)
1219
1220 where REGEXP, FILE-IDX and LINE-IDX are strings. To help determine what
1221 the constituent elements should be, load compile.el and then use
1222
1223 C-h v compilation-error-regexp-alist RET
1224
1225 to see the current value. A good idea is to look at compile.el itself as
1226 the comments included for this variable are quite useful -- the regular
1227 expressions required for your compiler's output may be very close to one
1228 already provided. Once you have determined the proper regexps, use the
1229 following to inform Emacs of your changes:
1230
1231 (add-to-list 'compilation-error-regexp-alist
1232 '(REGEXP FILE-IDX LINE-IDX))
1233
1234 42: How do I indent C switch statements like this?
1235
1236 Many people want to indent their switch statements like this:
1237
1238 f()
1239 {
1240 switch(x) {
1241 case A:
1242 x1;
1243 break;
1244 case B:
1245 x2;
1246 break;
1247 default:
1248 x3;
1249 }
1250 }
1251
1252 The solution at first appears to be: set c-indent-level to 4 and
1253 c-label-offset to -2. However, this will give you an indentation spacing
1254 of four instead of two.
1255
1256 The solution is to use cc-mode (the default mode for C programming in
1257 Emacs 20) and add the following line:
1258
1259 (c-set-offset 'case-label '+)
1260
1261 There appears to be no way to do this with the old c-mode.
1262
1263 43: How can I make Emacs automatically scroll horizontally?
1264
1265 Use hscroll-mode, included in Emacs 20. Here is some information from
1266 the documentation, available by typing C-h f hscroll-mode RET:
1267
1268 Automatically scroll horizontally when the point moves off the
1269 left or right edge of the window.
1270
1271 - Type "M-x hscroll-mode" to enable it in the current buffer.
1272 - Type "M-x hscroll-global-mode" to enable it in every buffer.
1273 - "turn-on-hscroll" is useful in mode hooks as in:
1274 (add-hook 'text-mode-hook 'turn-on-hscroll)
1275
1276 - hscroll-margin controls how close the cursor can get to the edge
1277 of the window.
1278 - hscroll-step-percent controls how far to jump once we decide to do so.
1279
1280 44: How do I make Emacs "typeover" or "overwrite" instead of inserting?
1281
1282 M-x overwrite-mode (a minor mode). This toggles overwrite-mode on and
1283 off, so exiting from overwrite-mode is as easy as another M-x
1284 overwrite-mode.
1285
1286 On some systems the "Insert" key toggles overwrite-mode on and off.
1287
1288 45: How do I stop Emacs from beeping on a terminal?
1289
1290 Martin R. Frank <martin@cc.gatech.edu> writes:
1291
1292 Tell Emacs to use the "visible bell" instead of the audible bell, and
1293 set the visible bell to nothing.
1294
1295 That is, put the following in your TERMCAP environment variable
1296 (assuming you have one):
1297
1298 ... :vb=: ...
1299
1300 And evaluate the following Lisp form:
1301
1302 (setq visible-bell t)
1303
1304 46: How do I turn down the bell volume in Emacs running under X Windows?
1305
1306 You can adjust the bell volume and duration for all programs with the
1307 shell command xset.
1308
1309 Invoking xset without any arguments produces some basic information,
1310 including the following:
1311
1312 usage: xset [-display host:dpy] option ...
1313 To turn bell off:
1314 -b b off b 0
1315 To set bell volume, pitch and duration:
1316 b [vol [pitch [dur]]] b on
1317
1318 47: How do I tell Emacs to automatically indent a new line to the
1319 indentation of the previous line?
1320
1321 Such behavior is automatic in text mode in Emacs 20. From the NEWS file
1322 for Emacs 20.2:
1323
1324 ** In Text mode, now only blank lines separate paragraphs. This makes
1325 it possible to get the full benefit of Adaptive Fill mode in Text mode,
1326 and other modes derived from it (such as Mail mode). TAB in Text mode
1327 now runs the command indent-relative; this makes a practical difference
1328 only when you use indented paragraphs.
1329
1330 As a result, the old Indented Text mode is now identical to Text mode,
1331 and is an alias for it.
1332
1333 If you want spaces at the beginning of a line to start a paragraph, use
1334 the new mode, Paragraph Indent Text mode.
1335
1336 If you have auto-fill mode on (see question 31), you can tell Emacs to
1337 prefix every line with a certain character sequence, the "fill prefix."
1338 Type the prefix at the beginning of a line, position point after it, and
1339 then type "C-x ." (set-fill-prefix) to set the fill prefix. Thereafter,
1340 auto-filling will automatically put the fill prefix at the beginning of
1341 new lines, and M-q (fill-paragraph) will maintain any fill prefix when
1342 refilling the paragraph.
1343
1344 NOTE: If you have paragraphs with different levels of indentation, you
1345 will have to set the fill prefix to the correct value each time you move
1346 to a new paragraph. To avoid this hassle, try one of the many packages
1347 available from the Emacs Lisp Archive (see question 90.) Look up "fill"
1348 and "indent" in the Lisp Code Directory for guidance.
1349
1350 48: How do I show which parenthesis matches the one I'm looking at?
1351
1352 As of version 19, Emacs comes with paren.el, which (when loaded) will
1353 automatically highlight matching parentheses whenever point (i.e., the
1354 cursor) is located over one. To load paren automatically, include the
1355 line
1356
1357 (require 'paren)
1358
1359 in your .emacs file. As of version 20.1, you must instead call
1360 show-paren-mode in your .emacs file:
1361
1362 (show-paren-mode 1)
1363
1364 and the "require" is redundant.
1365
1366 The "customize" facility will let you turn on show-paren-mode. Use M-x
1367 customize-group RET paren-showing RET. From within customize, you can
1368 also go directly to the "paren-showing" group.
1369
1370 Alternatives to paren include:
1371
1372 * If you're looking at a right parenthesis (or brace or bracket) you can
1373 delete it and reinsert it. Emacs will blink the cursor on the matching
1374 parenthesis.
1375
1376 * M-C-f (forward-sexp) and M-C-b (backward-sexp) will skip over one set
1377 of balanced parentheses, so you can see which parentheses match. (You
1378 can train it to skip over balanced brackets and braces at the same time
1379 by modifying the syntax table.)
1380
1381 * Here is some Emacs Lisp that will make the % key show the matching
1382 parenthesis, like in vi. In addition, if the cursor isn't over a
1383 parenthesis, it simply inserts a % like normal. (`Parenthesis' actually
1384 includes and character with `open' or `close' syntax, which usually means
1385 "()[]{}".)
1386
1387 ;; By an unknown contributor
1388
1389 (global-set-key "%" 'match-paren)
1390
1391 (defun match-paren (arg)
1392 "Go to the matching parenthesis if on parenthesis otherwise insert %."
1393 (interactive "p")
1394 (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1))
1395 ((looking-at "\\s\)") (forward-char 1) (backward-list 1))
1396 (t (self-insert-command (or arg 1)))))
1397
1398 49: In C mode, can I show just the lines that will be left after #ifdef
1399 commands are handled by the compiler?
1400
1401 M-x hide-ifdef-mode. (This is a minor mode.) You might also want to try
1402 cpp.el, available at the Emacs Lisp Archive (see question 90).
1403
1404 50: Is there an equivalent to the `.' (dot) command of vi?
1405
1406 (`.' is the redo command in vi. It redoes the last insertion/deletion.)
1407
1408 In Emacs 20.3 and later, use the C-x z ("repeat") command to repeat `simple
1409 commands'.
1410
1411 Otherwise you can type "C-x ESC ESC" (repeat-complex-command) to reinvoke
1412 commands that used the minibuffer to get arguments. In
1413 repeat-complex-command you can type M-p and M-n to scan through all the
1414 different complex commands you've typed.
1415
1416 To repeat a set of commands, use keyboard macros. (See "Keyboard Macros"
1417 in the on-line manual.)
1418
1419 VIPER, which comes with Emacs, emulates vi, including `.'. (See question
1420 107.)
1421
1422 51: What are the valid X resource settings (i.e., stuff in .Xdefaults)?
1423
1424 See Emacs man page, or "Resources X" in the on-line manual.
1425
1426 You can also use a resource editor, such as editres (for X11R5 and
1427 onwards), to look at the resource names for the menu bar, assuming Emacs
1428 was compiled with the X toolkit.
1429
1430 52: How do I execute ("evaluate") a piece of Emacs Lisp code?
1431
1432 There are a number of ways to execute ("evaluate," in Lisp lingo) an
1433 Emacs Lisp "form":
1434
1435 * If you want it evaluated every time you run Emacs, put it in a file
1436 named ".emacs" in your home directory. This is known as your ".emacs
1437 file," and contains all of your personal customizations.
1438
1439 * You can type the form in the *scratch* buffer, and then type LFD (or
1440 C-j) after it. The result of evaluating the form will be inserted in
1441 the buffer.
1442
1443 * In Emacs-Lisp mode, typing M-C-x evaluates a top-level form before or
1444 around point.
1445
1446 * Typing "C-x C-e" in any buffer evaluates the Lisp form immediately
1447 before point and prints its value in the echo area.
1448
1449 * Typing M-: or M-x eval-expression allows you to type a Lisp form
1450 in the minibuffer which will be evaluated.
1451
1452 * You can use M-x load-file to have Emacs evaluate all the Lisp forms in
1453 a file. (To do this from Lisp use the function "load" instead.)
1454
1455 These functions are also useful (see question 16 if you want to learn
1456 more about them):
1457
1458 load-library, eval-region, eval-current-buffer, require, autoload
1459
1460 53: How do I change Emacs's idea of the tab character's length?
1461
1462 Set the variable default-tab-width. For example, to set tab stops every
1463 10 characters, insert the following in your .emacs file:
1464
1465 (setq default-tab-width 10)
1466
1467 Do not confuse variable tab-width with variable tab-stop-list. The
1468 former is used for the display of literal tab characters. The latter
1469 controls what characters are inserted when you press the TAB character in
1470 certain modes.
1471
1472 54: How do I insert `>' at the beginning of every line?
1473
1474 To do this to an entire buffer, type "M-< M-x replace-regexp RET ^ RET >
1475 RET".
1476
1477 To do this to a region, use "string-rectangle" ("C-x r t"). Set the mark
1478 (`C-SPC') at the beginning of the first line you want to prefix, move the
1479 cursor to last line to be prefixed, and type "C-x r t > RET". To do this
1480 for the whole buffer, type "C-x h C-x r t > RET". In Emacs 20.3 and
1481 later, this will affect only the current region if Transient Mark mode is
1482 on (see NEWS via C-h N).
1483
1484 If you are trying to prefix a yanked mail message with '>', you might
1485 want to set the variable mail-yank-prefix. Better yet, get the SuperCite
1486 package (see question 105), which provides flexible citation for yanked
1487 mail and news messages.
1488
1489 55: How do I insert "_^H" before each character in a region to get an
1490 underlined paragraph?
1491
1492 M-x underline-region.
1493
1494 56: How do I repeat a command as many times as possible?
1495
1496 Use "C-x (" and "C-x )" to make a keyboard macro that invokes the command
1497 and then type "M-0 C-x e".
1498
1499 WARNING: any messages your command prints in the echo area will be
1500 suppressed.
1501
1502 57: How do I make Emacs behave like this: when I go up or down, the cursor
1503 should stay in the same column even if the line is too short?
1504
1505 M-x picture-mode.
1506
1507 58: How do I tell Emacs to iconify itself?
1508
1509 "C-z" iconifies Emacs when running under X Windows and suspends Emacs
1510 otherwise. See "Misc X" in the on-line manual.
1511
1512 59: How do I use regexps (regular expressions) in Emacs?
1513
1514 See "Regexps" in the on-line manual.
1515
1516 WARNING: The "or" operator is `\|', not `|', and the grouping operators
1517 are `\(' and `\)'. Also, the string syntax for a backslash is `\\'. To
1518 specify a regular expression like xxx\(foo\|bar\) in a Lisp string, use
1519
1520 "xxx\\(foo\\|bar\\)"
1521
1522 Notice the doubled backslashes!
1523
1524 WARNING: Unlike in Unix grep, sed, etc., a complement character set
1525 ([^...]) can match a newline character (LFD aka C-j aka \n), unless
1526 newline is mentioned as one of the characters not to match.
1527
1528 WARNING: The character syntax regexps (e.g., "\sw") are not meaningful
1529 inside character set regexps (e.g., "[aeiou]"). (This is actually
1530 typical for regexp syntax.)
1531
1532 60: How do I perform a replace operation across more than one file?
1533
1534 The "tags" feature of Emacs includes the command tags-query-replace which
1535 performs a query-replace across all the files mentioned in the TAGS file.
1536 See "Tags Search" in the on-line manual.
1537
1538 As of Emacs 19.29, Dired mode ("M-x dired RET", or C-x d) supports the
1539 command dired-do-query-replace, which allows users to replace regular
1540 expressions in multiple files.
1541
1542 61: Where is the documentation for "etags"?
1543
1544 "etags" is documented in the Tags node of the Emacs manual. The "etags"
1545 man page should be in the same place as the "emacs" man page.
1546
1547 Quick command-line switch descriptions are also available. For example,
1548 "etags -H".
1549
1550 62: How do I disable backup files?
1551
1552 You probably don't want to do this, since backups are useful.
1553
1554 To avoid seeing backup files (and other "uninteresting" files) in Dired,
1555 load dired-x by adding the following to your .emacs file:
1556
1557 (add-hook 'dired-load-hook
1558 (function (lambda ()
1559 (load "dired-x"))))
1560
1561 With dired-x loaded, `M-o' toggles omitting in each dired buffer. You
1562 can make omitting the default for new dired buffers by putting the
1563 following in your .emacs:
1564
1565 (setq initial-dired-omit-files-p t)
1566
1567 If you're tired of seeing backup files whenever you do an "ls" at the
1568 Unix shell, try GNU ls with the "-B" option. GNU ls is part of the GNU
1569 fileutils package, available at mirrors of ftp.gnu.org (see question 92).
1570
1571 To disable or change how backups are made, see "Backup Names" in the
1572 on-line manual.
1573
1574 63: How do I disable auto-save-mode?
1575
1576 You probably don't want to do this, since auto-saving is useful,
1577 especially when Emacs or your computer crashes while you are editing a
1578 document.
1579
1580 Instead, you might want to change the variable auto-save-interval, which
1581 specifies how many keystrokes Emacs waits before auto-saving. Increasing
1582 this value forces Emacs to wait longer between auto-saves, which might
1583 annoy you less.
1584
1585 You might also want to look into Sebastian Kremer's auto-save package,
1586 available from the Lisp Code Archive (see question 90). This package
1587 also allows you to place all auto-save files in one directory, such as
1588 /tmp.
1589
1590 To disable or change how auto-save-mode works, see "Auto Save" in the
1591 on-line manual.
1592
1593 64: How can I create or modify new pull-down menu options?
1594
1595 Each menu title (e.g., Buffers, File, Edit) represents a local or global
1596 keymap. Selecting a menu title with the mouse displays that keymap's
1597 non-nil contents in the form of a menu.
1598
1599 So to add a menu option to an existing menu, all you have to do is add a
1600 new definition to the appropriate keymap. Adding a "forward word"
1601 command to the "Edit" menu thus requires the following Lisp code:
1602
1603 (define-key global-map
1604 [menu-bar edit forward]
1605 '("Forward word" . forward-word))
1606
1607 The first line adds the entry to the global keymap, which includes global
1608 menu bar entries. Replacing the reference to "global-map" with a local
1609 keymap would add this menu option only within a particular mode.
1610
1611 The second line describes the path from the menu-bar to the new entry.
1612 Placing this menu entry underneath the "File" menu would mean changing
1613 the word "edit" in the second line to "file."
1614
1615 The third line is a cons cell whose first element is the title that will
1616 be displayed, and whose second element is the function that will be
1617 called when that menu option is invoked.
1618
1619 To add a new menu, rather than a new option to an existing menu, we must
1620 define an entirely new keymap:
1621
1622 (define-key global-map [menu-bar words]
1623 (cons "Words" (make-sparse-keymap "Words")))
1624
1625 The above code creates a new sparse keymap, gives it the name "Words",
1626 and attaches it to the global menu bar. Adding the "forward word"
1627 command to this new menu would thus require the following code:
1628
1629 (define-key global-map
1630 [menu-bar words forward]
1631 '("Forward word" . forward-word))
1632
1633 Note that because of the way keymaps work, menu options are displayed
1634 with the more recently defined items at the top. Thus if you were to
1635 define menu options "foo", "bar", and "baz" (in that order), menu option
1636 "baz" would appear at the top, and "foo" would be at the bottom.
1637
1638 One way to avoid this problem is to use the function define-key-after,
1639 which works the same as define-key, but lets you modify where items
1640 appear. The following Lisp code would insert the "forward word" function
1641 in the "edit" menu immediately following the "undo" option:
1642
1643 (define-key-after
1644 (lookup-key global-map [menu-bar edit])
1645 [forward]
1646 '("Forward word" . forward-word)
1647 'undo)
1648
1649 Note how the second and third arguments to define-key-after are different
1650 from those of define-key, and that we have added a new (final) argument,
1651 the function after which our new key should be defined.
1652
1653 To move a menu option from one position to another, simply evaluate
1654 define-key-after with the appropriate final argument.
1655
1656 More detailed information -- and more examples of how to create and
1657 modify menu options -- are in the Emacs Lisp Reference Manual, under
1658 "Menu Keymaps." (See question 16 for information on this manual.)
1659
1660 Note that Emacs 20.3 introduced a better (`extended') format for menu
1661 items, described in the NEWS file and the Lisp Manual. The "easymenu"
1662 package provides support for defining menus conveniently with some
1663 portability amongst Emacs versions.
1664
1665 65: How do I delete menus and menu options?
1666
1667 The simplest way to remove a menu is to set its keymap to nil. For
1668 example, to delete the "Words" menu (from question 64), use:
1669
1670 (define-key global-map [menu-bar words] nil)
1671
1672 Similarly, removing a menu option requires redefining a keymap entry to
1673 nil. For example, to delete the "Forward word" menu option from the
1674 "Edit" menu (we added it in question 64), use:
1675
1676 (define-key global-map [menu-bar edit forward] nil)
1677
1678 66: How do I turn on syntax highlighting?
1679
1680 Font-lock mode is the standard way to have Emacs perform syntax
1681 highlighting. With font-lock mode invoked, different types of text will
1682 appear in different colors. For instance, if you turn on font-lock in a
1683 programming mode, variables will appear in one face, keywords in a
1684 second, and comments in a third.
1685
1686 Earlier versions of Emacs supported hilit19, a similar package. Use of
1687 hilit19 is now considered non-standard, although hilit19.el comes with
1688 the stock Emacs distribution. It is no longer maintained.
1689
1690 To turn font-lock mode on within an existing buffer, use "M-x
1691 font-lock-mode RET".
1692
1693 To automatically invoke font-lock mode when a particular major mode is
1694 invoked, set the major mode's hook or define font-lock-global-modes as a
1695 list with the mode name as an element. For example, to fontify all
1696 c-mode buffers, add the following to your .emacs file:
1697
1698 (add-hook 'c-mode-hook 'turn-on-font-lock)
1699
1700 To automatically invoke font-lock mode for all major modes, you can turn
1701 on global-font-lock mode by including the following line in your .emacs
1702 file (or use Custom):
1703
1704 (global-font-lock-mode 1)
1705
1706 This instructs Emacs to turn on font-lock mode in those buffers for which
1707 a font-lock mode definition has been provided (in the variable
1708 font-lock-global-modes or via the variable font-lock-defaults-alist). If
1709 you edit a file in pie-ala-mode, and no font-lock definitions have been
1710 provided for pie-ala files, then the above setting will have no effect on
1711 that particular buffer.
1712
1713 Highlighting with font-lock mode can take quite a while, and thus
1714 different levels of decoration are available, from slight to gaudy. To
1715 control how decorated your buffers should become, set the value of
1716 font-lock-maximum-decoration in your .emacs file, with a nil value
1717 indicating default (usually minimum) decoration, and a t value indicating
1718 the maximum decoration. For the gaudiest possible look, then, include
1719 the line
1720
1721 (setq font-lock-maximum-decoration t)
1722
1723 in your .emacs file. You can also set this variable such that different
1724 modes are highlighted in a different ways; for more information, see the
1725 documentation for font-lock-maximum-decoration with "C-h v" (or "M-x
1726 describe-variable RET").
1727
1728 You might also want to investigate fast-lock-mode and lazy-lock-mode,
1729 versions of font-lock-mode that speed up highlighting. The advantage of
1730 lazy-lock-mode is that it only fontifies buffers when certain conditions
1731 are met, such as after a certain amount of idle time, or after you have
1732 finished scrolling through text. See the documentation for
1733 lazy-lock-mode by typing C-h f lazy-lock-mode ("M-x describe-function RET
1734 lazy-lock-mode RET").
1735
1736 Also see the documentation for the function font-lock-mode, available by
1737 typing C-h f font-lock-mode ("M-x describe-function RET font-lock-mode
1738 RET").
1739
1740 For more information on font-lock mode, particularly adding new patterns,
1741 see the Lisp Reference Manual and the commentary in the source
1742 font-lock.el, which you can find in Emacs 20 (if it is installed) using,
1743 say, M-x find-function font-lock-mode.
1744
1745 To print buffers with the faces (i.e., colors and fonts) intact, use
1746 "M-x ps-print-buffer-with-faces" or "M-x ps-print-region-with-faces".
1747
1748 67: How can I force Emacs to scroll only one line when I move past the
1749 bottom of the screen?
1750
1751 Place the following Lisp form in your .emacs file:
1752
1753 (setq scroll-step 1)
1754
1755 Also see "Scrolling" in the on-line manual.
1756
1757 68: How can I replace highlighted text with what I type?
1758
1759 Use delete-selection mode, which you can start automatically by placing
1760 the following Lisp form in your .emacs file:
1761
1762 (delete-selection-mode t)
1763
1764 According to the documentation string for delete-selection mode (which
1765 you can read using M-x describe-function RET delete-selection-mode RET):
1766
1767 When ON, typed text replaces the selection if the selection is active.
1768 When OFF, typed text is just inserted at point.
1769
1770 This mode also allows you to delete (not kill) the highlighted region by
1771 pressing DEL.
1772
1773 69: How can I edit MS-DOS files using Emacs?
1774
1775 As of Emacs 20, detection and handling of MS-DOS (and Windows) files is
1776 performed transparently. You can open an MS-DOS file on a Unix system
1777 (and vice versa), edit it, and save it without having to worry about the
1778 file format. To save it with a different end-of-line convention use
1779 C-x RET c to specify a new coding system such as undecided-unix.
1780
1781 When editing an MS-DOS style file, a backslash (\) will appear in the
1782 mode line.
1783
1784 You can avoid translation of the end-of-line conventions either by
1785 visiting a file using M-x find-file-literally or by setting the variable
1786 inhibit-eol-conversion to t.
1787
1788 If you are running an earlier version of Emacs, get crypt++ from
1789 ftp://ftp.cs.umb.edu/pub/misc/crypt++.el. Among other things, crypt++
1790 transparently modifies MS-DOS files as they are loaded and saved,
1791 allowing you to ignore the different conventions that Unix and MS-DOS
1792 have for delineating the end of a line.
1793
1794 70: How can I tell Emacs to fill paragraphs with a single space after
1795 each period?
1796
1797 Ulrich Mueller <ulm@vsnhd1.cern.ch> suggests adding the following two
1798 lines to your .emacs file:
1799
1800 (setq sentence-end "[.?!][]\"')}]*\\($\\|[ \t]\\)[ \t\n]*")
1801 (setq sentence-end-double-space nil)
1802
1803 See "Sentences" in the online manual.
1804
1805
1806 Bugs/Problems
1807
1808 71: Does Emacs have problems with files larger than 8 megabytes?
1809
1810 Old versions (i.e., anything before 19.29) of Emacs had problems editing
1811 files larger than 8 megabytes. As of version 19.29, the maximum buffer
1812 size is at least 2^27-1, or 134,217,727 bytes.
1813
1814 If you are using an older version of Emacs and cannot upgrade, you will
1815 have to recompile. Leonard N. Zubkoff <lnz@lucid.com> suggests putting
1816 the following two lines in src/config.h before compiling Emacs to allow
1817 for 26-bit integers and pointers (and thus file sizes of up to 33,554,431
1818 bytes):
1819
1820 #define VALBITS 26
1821 #define GCTYPEBITS 5
1822
1823 WARNING: This method may result in "ILLEGAL DATATYPE" and other random
1824 errors on some machines.
1825
1826 David Gillespie <daveg@csvax.cs.caltech.edu> explains how this problems
1827 crops up; while his numbers are true only for pre-19.29 versions of
1828 Emacs, the theory remains the same with current versions.
1829
1830 Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed
1831 language in the sense that you can put any value of any type into any
1832 variable, or return it from a function, and so on. So each value must
1833 carry a "tag" along with it identifying what kind of thing it is, e.g.,
1834 integer, pointer to a list, pointer to an editing buffer, and so on.
1835 Emacs uses standard 32-bit integers for data objects, taking the top 8
1836 bits for the tag and the bottom 24 bits for the value. So integers
1837 (and pointers) are somewhat restricted compared to true C integers and
1838 pointers.
1839
1840 72: How do I get rid of ^M or echoed commands in my shell buffer?
1841
1842 Try typing "M-x shell-strip-ctrl-m RET" while in shell-mode to make them
1843 go away. You might add this function to comint-output-filter-functions:
1844
1845 (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m)
1846
1847 If that doesn't work, you have several options:
1848
1849 For tcsh, put this in your .cshrc (or .tcshrc) file:
1850
1851 if ($?EMACS) then
1852 if ("$EMACS" == t) then
1853 if ($?tcsh) unset edit
1854 stty nl
1855 endif
1856 endif
1857
1858 Or put this in your .emacs_tcsh file:
1859
1860 unset edit
1861 stty nl
1862
1863 Alternatively, use csh in your shell buffers instead of tcsh. One way
1864 is:
1865
1866 (setq explicit-shell-file-name "/bin/csh")
1867
1868 and another is to do this in your .cshrc (or .tcshrc) file:
1869
1870 setenv ESHELL /bin/csh
1871
1872 (You must start Emacs over again with the environment variable properly
1873 set for this to take effect.)
1874
1875 You can also set the ESHELL environment variable in Emacs Lisp with
1876 the following Lisp form,
1877
1878 (setenv "ESHELL" "/bin/csh")
1879
1880 On a related note: If your shell is echoing your input line in the shell
1881 buffer, you might want to try the following command in your shell
1882 start-up file:
1883
1884 stty -icrnl -onlcr -echo susp ^Z
1885
1886 73: Why do I get "Process shell exited abnormally with code 1"?
1887
1888 The most likely reason for this message is that the "env" program is not
1889 properly installed. Compile this program for your architecture, and
1890 install it with a+x permission in the architecture-dependent Emacs
1891 program directory. (You can find what this directory is at your site by
1892 inspecting the value of the variable exec-directory by typing "C-h v
1893 exec-directory RET".)
1894
1895 You should also check for other programs named "env" in your path (e.g.,
1896 SunOS has a program named /usr/bin/env). We don't understand why this
1897 can cause a failure and don't know a general solution for working around
1898 the problem in this case.
1899
1900 It has been reported that this sometimes happened when Emacs was started
1901 as an X client from an xterm window (i.e., had a controlling tty) but the
1902 xterm was later terminated.
1903
1904 See also etc/PROBLEMS for other possible causes of this message.
1905
1906 74: Where is the termcap/terminfo entry for terminal type "emacs"?
1907
1908 The termcap entry for terminal type "emacs" is ordinarily put in the
1909 TERMCAP environment variable of subshells. It may help in certain
1910 situations (e.g., using rlogin from shell buffer) to add an entry for
1911 "emacs" to the system-wide termcap file. Here is a correct termcap entry
1912 for "emacs":
1913
1914 emacs:tc=unknown:
1915
1916 To make a terminfo entry for "emacs", use "tic" or "captoinfo." You need
1917 to generate /usr/lib/terminfo/e/emacs. It may work to simply copy
1918 /usr/lib/terminfo/d/dumb to /usr/lib/terminfo/e/emacs.
1919
1920 Having a termcap/terminfo entry will not enable the use of full screen
1921 programs in shell buffers. Use M-x terminal-emulator for that instead.
1922
1923 A workaround to the problem of missing termcap/terminfo entries is to
1924 change terminal type "emacs" to type "dumb" or "unknown" in your shell
1925 start up file. "csh" users could put this in their .cshrc files:
1926
1927 if ("$term" == emacs) set term=dumb
1928
1929 75: Why does Emacs spontaneously start displaying "I-search:" and beeping?
1930
1931 Your terminal (or something between your terminal and the computer) is
1932 sending C-s and C-q for flow control, and Emacs is receiving these
1933 characters and interpreting them as commands. (The C-s character
1934 normally invokes the isearch-forward command.) For possible solutions,
1935 see question 121.
1936
1937 76: Why can't Emacs talk to certain hosts (or certain hostnames)?
1938
1939 The problem may be that Emacs is linked with a wimpier version of
1940 gethostbyname than the rest of the programs on the machine. This is
1941 often manifested as a message on startup of "X server not responding.
1942 Check your DISPLAY environment variable." or a message of "Unknown host"
1943 from open-network-stream.
1944
1945 On a Sun, this may be because Emacs had to be linked with the static C
1946 library. The version of gethostbyname in the static C library may only
1947 look in /etc/hosts and the NIS (YP) maps, while the version in the
1948 dynamic C library may be smart enough to check DNS in addition to or
1949 instead of NIS. On a Motorola Delta running System V R3.6, the version
1950 of gethostbyname in the standard library works, but the one that works
1951 with NIS doesn't (the one you get with -linet). Other operating systems
1952 have similar problems.
1953
1954 Try these options:
1955
1956 * Explicitly add the host you want to communicate with to /etc/hosts.
1957
1958 * Relink Emacs with this line in src/config.h:
1959
1960 #define LIBS_SYSTEM -lresolv
1961
1962 * Replace gethostbyname and friends in libc.a with more useful versions
1963 such as the ones in libresolv.a. Then relink Emacs.
1964
1965 * If you are actually running NIS, make sure that "ypbind" is properly
1966 told to do DNS lookups with the correct command line switch.
1967
1968 77: Why does Emacs say "Error in init file"?
1969
1970 An error occurred while loading either your .emacs file or the
1971 system-wide lisp/default.el file. For information on how to debug your
1972 .emacs file, see question 27.
1973
1974 It may be the case that you need to load some package first, or use a
1975 hook that will be evaluated after the package is loaded. A common case
1976 of this is explained in question 117.
1977
1978 78: Why does Emacs ignore my X resources (my .Xdefaults file)?
1979
1980 As of version 19, Emacs searches for X resources in the files specified
1981 by the XFILESEARCHPATH, XUSERFILESEARCHPATH, and XAPPLRESDIR environment
1982 variables, emulating the functionality provided by programs written using
1983 Xt.
1984
1985 XFILESEARCHPATH and XUSERFILESEARCHPATH should be a list of file names
1986 separated by colons; XAPPLRESDIR should be a list of directory names
1987 separated by colons.
1988
1989 Emacs searches for X resources
1990
1991 + specified on the command line, with the "-xrm RESOURCESTRING"
1992 option,
1993 + then in the value of the XENVIRONMENT environment variable,
1994 - or if that is unset, in the file named ~/.Xdefaults-HOSTNAME if it
1995 exists
1996 (where HOSTNAME is the hostname of the machine Emacs is running on),
1997 + then in the screen-specific and server-wide resource properties
1998 provided by the server,
1999 - or if those properties are unset, in the file named ~/.Xdefaults
2000 if it exists,
2001 + then in the files listed in XUSERFILESEARCHPATH,
2002 - or in files named LANG/Emacs in directories listed in XAPPLRESDIR
2003 (where LANG is the value of the LANG environment variable), if
2004 the LANG environment variable is set,
2005 - or in files named Emacs in the directories listed in XAPPLRESDIR
2006 - or in ~/LANG/Emacs (if the LANG environment variable is set),
2007 - or in ~/Emacs,
2008 + then in the files listed in XFILESEARCHPATH.
2009
2010 79: Why does Emacs take 20 seconds to visit a file?
2011
2012 Old versions of Emacs (i.e., versions before Emacs 20.x) often
2013 encountered this when the master lock file, "!!!SuperLock!!!" has been
2014 left in the lock directory somehow. Delete it.
2015
2016 Mark Meuer <meuer@geom.umn.edu> says that NeXT NFS has a bug where an
2017 exclusive create succeeds but returns an error status. This can cause
2018 the same problem. Since Emacs's file locking doesn't work over NFS
2019 anyway, the best solution is to recompile Emacs with CLASH_DETECTION
2020 undefined.
2021
2022 80: How do I edit a file with a `$' in its name?
2023
2024 When entering a filename in the minibuffer, Emacs will attempt to expand
2025 a `$' followed by a word as an environment variable. To suppress this
2026 behavior, type "$$" instead.
2027
2028 81: Why does shell mode lose track of the shell's current directory?
2029
2030 Emacs has no way of knowing when the shell actually changes its
2031 directory. This is an intrinsic limitation of Unix. So it tries to
2032 guess by recognizing "cd" commands. If you type "cd" followed by a
2033 directory name with a variable reference ("cd $HOME/bin") or with a shell
2034 metacharacter ("cd ../lib*"), Emacs will fail to correctly guess the
2035 shell's new current directory. A huge variety of fixes and enhancements
2036 to shell mode for this problem have been written to handle this problem.
2037 Check the Lisp Code Directory (see question 89).
2038
2039 You can tell Emacs the shell's current directory with the command "M-x
2040 dirs".
2041
2042 82: Are there any security risks in Emacs?
2043
2044 * the "movemail" incident (No, this is not a risk.)
2045
2046 In his book "The Cuckoo's Egg," Cliff Stoll describes this in chapter
2047 4. The site at LBL had installed the "etc/movemail" program setuid
2048 root. (As of version 19, movemail is in your architecture-specific
2049 directory; type "C-h v exec-directory RET" to see what it is.) Since
2050 "movemail" had not been designed for this situation, a security hole
2051 was created and users could get root privileges.
2052
2053 "movemail" has since been changed so that this security hole will not
2054 exist, even if it is installed setuid root. However, movemail no
2055 longer needs to be installed setuid root, which should eliminate this
2056 particular risk.
2057
2058 We have heard unverified reports that the 1988 Internet worm took
2059 advantage of this configuration problem.
2060
2061 * the file-local-variable feature (Yes, a risk, but easy to change.)
2062
2063 There is an Emacs feature that allows the setting of local values for
2064 variables when editing a file by including specially formatted text
2065 near the end of the file. This feature also includes the ability to
2066 have arbitrary Emacs Lisp code evaluated when the file is visited.
2067 Obviously, there is a potential for Trojan horses to exploit this
2068 feature.
2069
2070 Emacs 18 allowed this feature by default; users could disable it by
2071 setting the variable inhibit-local-variables to a non-nil value.
2072
2073 As of Emacs 19, Emacs has a list of local variables that create a
2074 security risk. If a file tries to set one of them, it asks the user to
2075 confirm whether the variables should be set. You can also tell Emacs
2076 whether to allow the evaluation of Emacs Lisp code found at the bottom
2077 of files by setting the variable enable-local-eval.
2078
2079 For more information, see "File Variables" in the on-line manual.
2080
2081 * synthetic X events (Yes, a risk; use MIT-MAGIC-COOKIE-1 or better.)
2082
2083 Emacs accepts synthetic X events generated by the SendEvent request as
2084 though they were regular events. As a result, if you are using the
2085 trivial host-based authentication, other users who can open X
2086 connections to your X workstation can make your Emacs process do
2087 anything, including run other processes with your privileges.
2088
2089 The only fix for this is to prevent other users from being able to open
2090 X connections. The standard way to prevent this is to use a real
2091 authentication mechanism, such as MIT-MAGIC-COOKIE-1. If using the
2092 "xauth" program has any effect, then you are probably using
2093 MIT-MAGIC-COOKIE-1. Your site may be using a superior authentication
2094 method; ask your system administrator.
2095
2096 If real authentication is not a possibility, you may be satisfied by
2097 just allowing hosts access for brief intervals while you start your X
2098 programs, then removing the access. This reduces the risk somewhat by
2099 narrowing the time window when hostile users would have access, but
2100 DOES NOT ELIMINATE THE RISK.
2101
2102 On most computers running Unix and X Windows, you enable and disable
2103 access using the "xhost" command. To allow all hosts access to your X
2104 server, use
2105
2106 xhost +
2107
2108 at the shell prompt, which (on an HP machine, at least) produces the
2109 following message:
2110
2111 access control disabled, clients can connect from any host
2112
2113 To deny all hosts access to your X server (except those explicitly
2114 allowed by name), use
2115
2116 xhost -
2117
2118 On the test HP computer, this command generated the following message:
2119
2120 access control enabled, only authorized clients can connect
2121
2122 83: Dired says, "no file on this line" when I try to do something.
2123
2124 Chances are you're using a localized version of Unix that doesn't
2125 use US date format in dired listings. You can check this by looking
2126 at dired listings or by typing `ls -l' to a shell and looking at the
2127 dates that come out.
2128
2129 Dired uses a regular expression to find the beginning of a file
2130 name. In a long Unix-style directory listing ("ls -l"), the file
2131 name starts after the date. The regexp has thus been written to
2132 look for the date, the format of which can vary on non-US systems.
2133
2134 There are two approaches to solving this. The first one involves
2135 setting things up so that "ls -l" outputs US date format. This can
2136 be done by setting the locale. See your OS manual for more
2137 information.
2138
2139 The second approach involves changing the regular expression used by
2140 dired, dired-move-to-filename-regexp.
2141
2142
2143 Difficulties Building/Installing/Porting Emacs
2144
2145 84: How do I install Emacs?
2146
2147 This answer is meant for users of Unix and Unix-like systems. Users of
2148 other operating systems should see the series of questions beginning with
2149 question 94, which describe where to get non-Unix source and binaries.
2150 These packages should come with installation instructions.
2151
2152 For Unix and Unix-like systems, the easiest way is often to compile it
2153 from scratch. You will need:
2154
2155 * Emacs sources. See question 92 for a list of ftp sites that make them
2156 available. On ftp.gnu.org, the main GNU distribution site, sources are
2157 available at
2158
2159 ftp://ftp.gnu.org/pub/gnu/emacs-20.4.tar.gz
2160
2161 The above will obviously change as new versions of Emacs come out. For
2162 instance, when Emacs 20.5 is released, it will most probably be
2163 available at
2164
2165 ftp://ftp.gnu.org/pub/gnu/emacs-20.5.tar.gz
2166
2167 Again, you should use one of the mirror sites in question 92 (and
2168 adjust the URL accordingly) so as to reduce load on ftp.gnu.org.
2169
2170 * Gzip, the GNU compression utility. You can get gzip via anonymous ftp
2171 at mirrors of ftp.gnu.org sites; it should compile and install without
2172 much trouble on most systems. Once you have retrieved the Emacs
2173 sources, you will probably be able to uncompress them with the command
2174
2175 gunzip --verbose emacs-20.4.tar.gz
2176
2177 changing the Emacs version (20.4), as necessary. Once gunzip has
2178 finished doing its job, a file by the name of "emacs-20.4.tar" should
2179 be in your build directory.
2180
2181 * Tar, the "tape archiving" program, which moves multiple files into and
2182 out of archive files, or "tarfiles." All of the files comprising the
2183 Emacs source come in a single tarfile, and must be extracted using tar
2184 before you can build Emacs. Typically, the extraction command would
2185 look like
2186
2187 tar -xvvf emacs-20.4.tar
2188
2189 The `x' indicates that we want to extract files from this tarfile, the
2190 two `v's force verbose output, and the `f' tells tar to use a disk
2191 file, rather than one on tape.
2192
2193 If you're using GNU tar (available at mirrors of ftp.gnu.org), you can
2194 combine this step and the previous one by using the command
2195
2196 tar -zxvvf emacs-20.4.tar.gz
2197
2198 The additional `z' at the beginning of the options list tells GNU tar
2199 to uncompress the file with gunzip before extracting the tarfile's
2200 components.
2201
2202 At this point, the Emacs sources (all 25+ megabytes of them) should be
2203 sitting in a directory called "emacs-20.4". On most common Unix and
2204 Unix-like systems, you should be able to compile Emacs (with X Windows
2205 support) with the following commands:
2206
2207 cd emacs-20.4 [ change directory to emacs-20.4 ]
2208 ./configure [ configure Emacs for your particular system ]
2209 make [ use Makefile to build components, then Emacs ]
2210
2211 If the "make" completes successfully, the odds are fairly good that the
2212 build has gone well. (See question 86 if you weren't successful.)
2213
2214 To install Emacs in its default directories of /usr/local/bin (binaries),
2215 /usr/local/share/emacs/20.xx (Lisp code and support files),
2216 /usr/local/libexec/CONFIGURATION/emacs/VERSION (executable files to be
2217 run by Emacs rather than users), /usr/local/man/man1 (man pages) and
2218 /usr/local/info (Info documentation), become the super-user and type
2219
2220 make install
2221
2222 Note that "make install" will overwrite /usr/local/bin/emacs and any
2223 Emacs Info files that might be in /usr/local/info.
2224
2225 Much more verbose instructions (with many more hints and suggestions)
2226 come with the Emacs sources, in the file "INSTALL".
2227
2228 85: How do I update Emacs to the latest version?
2229
2230 Follow the instructions in question 84.
2231
2232 Emacs places nearly everything in version-specific directories (e.g.,
2233 /usr/local/share/emacs/20.4), so the only files that can be overwritten
2234 when installing a new release are /usr/local/bin/emacs and the Emacs Info
2235 documentation in /usr/local/info. Back up these files before you install
2236 a new release, and you shouldn't have too much trouble.
2237
2238 86: What should I do if I have trouble building Emacs?
2239
2240 First look in the file PROBLEMS (in the top-level directory when you
2241 unpack the Emacs source) to see if there is already a solution for your
2242 problem. Next, look for other questions in this FAQ that have to do with
2243 Emacs installation and compilation problems.
2244
2245 If you'd like to have someone look at your problem and help solve it, see
2246 question 21.
2247
2248 If you don't find a solution, then report your problem via e-mail to
2249 bug-gnu-emacs@gnu.org. Please do not post it to gnu.emacs.help
2250 or e-mail it to help-gnu-emacs@gnu.org. For further guidelines,
2251 see question 8 and question 10.
2252
2253 87: Why does linking Emacs with -lX11 fail?
2254
2255 Emacs needs to be linked with the static version of the X11 library,
2256 libX11.a. This may be missing.
2257
2258 Under OpenWindows, you may need to use "add_services" to add the
2259 "OpenWindows Programmers" optional software category from the CD-ROM.
2260
2261 Under HP-UX 8.0, you may need to run "update" again to load the X11-PRG
2262 "fileset". This may be missing even if you specified "all filesets" the
2263 first time. If libcurses.a is missing, you may need to load the
2264 "Berkeley Development Option."
2265
2266 David Zuhn <zoo@armadillo.com> says that MIT X builds shared libraries by
2267 default, and only shared libraries, on those platforms that support them.
2268 These shared libraries can't be used when undumping temacs (the last
2269 stage of the Emacs build process). To get regular libraries in addition
2270 to shared libraries, add this to site.cf:
2271
2272 #define ForceNormalLib YES
2273
2274 Other systems may have similar problems. You can always define
2275 CANNOT_DUMP and link with the shared libraries instead.
2276
2277 To get the Xmenu stuff to work, you need to find a copy of MIT's
2278 liboldX.a.
2279
2280
2281 Finding/Getting Emacs and Related Packages
2282
2283 88: Where can I get Emacs on the net (or by snail mail)?
2284
2285 Look in the files etc/DISTRIB and etc/FTP for information on nearby
2286 archive sites and etc/ORDERS for mail orders. If you don't already have
2287 Emacs, see question 20 for how to get these files.
2288
2289 See question 84 for information on how to obtain and build the latest
2290 version of Emacs, and question 92 for a list of archive sites that make
2291 GNU software available.
2292
2293 89: How do I find a Emacs Lisp package that does XXX?
2294
2295 First of all, you should check to make sure that the package isn't
2296 already available. For example, typing "M-x apropos RET wordstar RET"
2297 lists all functions and variables containing the string "wordstar".
2298
2299 It is also possible that the package is on your system, but has not been
2300 loaded. To see which packages are available for loading, look through your
2301 computer's lisp directory (see question 4) or use the Finder (C-h p) to
2302 search under keywords. The Lisp source to most most packages contains a
2303 short description of how they should be loaded, invoked, and configured --
2304 so before you use or modify a Lisp package, see if the author has provided
2305 any hints in the source code.
2306
2307 If a package does not come with Emacs, check the Lisp Code Directory,
2308 maintained by Dave Brennan <brennan@hal.com>. The directory is contained
2309 in the file LCD-datafile.Z, available from the Emacs Lisp Archive (see
2310 question 90), and is accessed using the "lispdir" package, available from
2311 the same site. Note that lispdir.el requires crypt++, which you can grab
2312 from the Emacs Lisp Archive's "misc" subdirectory when you get
2313 lispdir.el.
2314
2315 Once you have installed lispdir.el and LCD-datafile, you can use "M-x
2316 lisp-dir-apropos" to search the listing. For example, "M-x
2317 lisp-dir-apropos RET ange-ftp RET" produces this output:
2318
2319 GNU Emacs Lisp Code Directory Apropos -- "ange-ftp"
2320 "~/" refers to ftp.cs.ohio-state.edu:pub/gnu/emacs/elisp-archive/
2321
2322 ange-ftp (4.18) 15-Jul-1992
2323 Andy Norman, <ange@hplb.hpl.hp.com>
2324 ~/packages/ange-ftp.tar.Z
2325 transparent FTP Support for GNU Emacs
2326 auto-save (1.19) 01-May-1992
2327 Sebastian Kremer, <sk@thp.uni-koeln.de>
2328 ~/misc/auto-save.el.Z
2329 Safer autosaving with support for ange-ftp and /tmp
2330 ftp-quik (1.0) 28-Jul-1993
2331 Terrence Brannon, <tb06@pl122f.eecs.lehigh.edu>
2332 ~/modes/ftp-quik.el.Z
2333 Quik access to dired'ing of ange-ftp and normal paths
2334
2335 You actually don't need the directory file LCD-datafile if your computer
2336 is on the Internet, since the latest version is retrieved automatically
2337 the first time you type "M-x lisp-dir-apropos" in a particular Emacs
2338 session. If you would prefer to use a local copy of LCD-datafile, be
2339 sure to set the variable lisp-code-directory at the top of the lispdir.el
2340 source code.
2341
2342 A searchable version of the LCD is also available at
2343
2344 http://www.cs.indiana.edu/LCD/cover.html
2345
2346 90: Where can I get Emacs Lisp packages that don't come with Emacs?
2347
2348 First, check the Lisp Code Directory to find the name of the package you
2349 are looking for (see question 89). Next, check local archives and the
2350 Emacs Lisp Archive to find a copy of the relevant files. If you still
2351 haven't found it, you can send e-mail to the author asking for a copy.
2352 If you find Emacs Lisp code that doesn't appear in the LCD, please submit
2353 a copy to the LCD (see question 91).
2354
2355 You can access the Emacs Lisp Archive at the following sites:
2356
2357 ftp://ftp.cs.ohio-state.edu/pub/gnu/emacs/elisp-archive/
2358 ftp://calypso-2.oit.unc.edu/pub/gnu/elisp-archive/
2359 ftp://faui43.informatik.uni-erlangen.de/pub/gnu/elisp-archive/
2360 ftp://ftp.cs.umn.edu/pub/elisp-archive/
2361 ftp://ftp.diku.dk/pub/elisp-archive/
2362 ftp://ftp.uni-mainz.de/pub/gnu/elisp-archive/
2363 ftp://ftp.uu.net/packages/gnu/emacs-lisp/
2364 ftp://gatekeeper.dec.com/pub/GNU/elisp-archive/
2365 ftp://nic.funet.fi/pub/gnu/emacs/elisp-archive/
2366 ftp://nic.switch.ch/mirror/elisp-archive/
2367 ftp://quepasa.cs.tu-berlin.de/pub/gnu/elisp/
2368 ftp://src.doc.ic.ac.uk/gnu/EmacsBits/elisp-archive/
2369
2370 Retrieve and read the file README first.
2371
2372 NOTE: * The archive maintainers do not have time to answer individual
2373 requests for packages or the list of packages in the archive. If
2374 you cannot use FTP or UUCP to access the archive yourself, try to
2375 find a friend who can, but please don't ask the maintainers.
2376
2377 * Any files with names ending in ".Z", ".z", or ".gz" are
2378 compressed, so you should use "binary" mode in FTP to retrieve
2379 them. You should also use binary mode whenever you retrieve any
2380 files with names ending in ".elc".
2381
2382 Note that the archive is apparently not being maintained at the time of
2383 writing; a volunteer to take on the task would be welcome.
2384
2385 Packages which have been posted to gnu.emacs.sources should be locatable
2386 via a service like Dejanews.
2387
2388 91: How do I submit code to the Emacs Lisp Archive?
2389
2390 Guidelines and procedures for submission to the archive can be found in
2391 the file GUIDELINES in the archive directory (see question 90). It
2392 covers documentation, copyrights, packaging, submission, and the Lisp
2393 Code Directory Record. Anonymous FTP uploads are not permitted.
2394 Instead, all submissions are mailed to elisp-archive@cis.ohio-state.edu.
2395 The lispdir.el package has a function named submit-lcd-entry which will
2396 help you with this.
2397
2398 See question 90 regarding non-maintenance of the archive.
2399
2400 92: Where can I get other up-to-date GNU stuff?
2401
2402 The most up-to-date official GNU software is normally kept on
2403 ftp.gnu.org and is available at
2404
2405 ftp://ftp.gnu.org/pub/gnu
2406
2407 Read the files etc/DISTRIB and etc/FTP for more information.
2408
2409 The following sites are all mirror images of the GNU distribution area:
2410
2411 ASIA: ftp://cair.kaist.ac.kr/pub/gnu,
2412 ftp://ftp.nectec.or.th/pub/mirrors/gnu,
2413 ftp://utsun.s.u-tokyo.ac.jp/ftpsync/prep,
2414 ftp://ftp.cs.titech.ac.jp/pub/gnu
2415
2416 AUSTRALIA: ftp://archie.au/gnu (archie.oz or archie.oz.au for ACSnet)
2417
2418 AFRICA: ftp://ftp.sun.ac.za/pub/gnu
2419
2420 EUROPE: ftp://ftp.denet.dk/pub/gnu,
2421 ftp://ftp.funet.fi/pub/gnu,
2422 ftp://ftp.informatik.rwth-aachen.de/pub/gnu,
2423 ftp://ftp.informatik.tu-muenchen.de/pub/comp/gnu,
2424 ftp://ftp.luth.se/pub/unix/gnu,
2425 ftp://ftp.stacken.kth.se/pub/gnu,
2426 ftp://ftp.win.tue.nl/pub/gnu,
2427 ftp://isy.liu.se/pub/gnu,
2428 ftp://nic.switch.ch/mirror/gnu,
2429 ftp://archive.eu.net/pub/gnu,
2430 ftp://ftp.eunet.ch/software/gnu,
2431 ftp://ftp.ieunet.ie/pub/gnu,
2432 ftp://ftp.mcc.ac.uk/pub/gnu,
2433 ftp://ftp.sunet.se:/pub/gnu,
2434 ftp://ftp.univ-lyon1.fr/pub/gnu,
2435 ftp://irisa.irisa.fr/pub/gnu,
2436 ftp://src.doc.ic.ac.uk/gnu,
2437 ftp://unix.hensa.ac.uk/pub/uunet/systems/gnu
2438
2439 SOUTH AMERICA: ftp.unicamp.br:/pub/gnu
2440
2441 WESTERN CANADA: ftp.cs.ubc.ca:/mirror2/gnu
2442
2443 USA: ftp://col.hp.com/mirrors/gnu,
2444 ftp://f.ms.uky.edu/pub3/gnu,
2445 ftp://ftp.cs.columbia.edu/archives/gnu/prep,
2446 ftp://ftp.digex.net/pub/gnu,
2447 ftp://ftp.hawaii.edu/mirrors/gnu,
2448 ftp://ftp.kpc.com/pub/mirror/gnu,
2449 ftp://ftp.uu.net/systems/gnu,
2450 ftp://gatekeeper.dec.com/pub/GNU,
2451 ftp://jaguar.utah.edu/gnustuff,
2452 ftp://labrea.stanford.edu/pub/gnu,
2453 ftp://mrcnext.cso.uiuc.edu/pub/gnu,
2454 ftp://vixen.cso.uiuc.edu/gnu,
2455 ftp://wuarchive.wustl.edu/systems/gnu
2456
2457 The directory at ftp.uu.net is a mirror of ftp.gnu.org except that files
2458 larger than one megabyte are split into multiple parts. If you have
2459 trouble transferring large files, you should try that site. A file
2460 normally named "XXX" is split into files XXX-split/part[0-9][0-9], and
2461 there will be a file named XXX-split/README which contains the list of
2462 parts (especially helpful when FTP-ing by e-mail), their checksums, and
2463 reassembly instructions.
2464
2465 93: What is the difference between Emacs and XEmacs (formerly "Lucid
2466 Emacs")?
2467
2468 XEmacs is a modified version of GNU Emacs.
2469
2470 This FAQ refers to the latest version to be distributed by the FSF
2471 as "Emacs," partly because the XEmacs maintainers now refer to their
2472 product using the "XEmacs" name, and partly because there isn't any
2473 accurate way to differentiate between the two without getting mired
2474 in paragraphs of legalese and history.
2475
2476 XEmacs, which began life as Lucid Emacs, is based on an early version of
2477 Emacs 19 and Epoch, an X-aware version of Emacs 18.
2478
2479 Emacs (i.e., the version distributed by the FSF) has a larger installed
2480 base and now always contains the MULE multilingual facilities. XEmacs
2481 can do some clever tricks with X Windows, such as putting arbitrary
2482 graphics in a buffer; similar facilities have been implemented for Emacs,
2483 which will be integrated after version 20.4. Emacs and XEmacs each come
2484 with some Lisp packages that are lacking or more up-to-date in the other;
2485 RMS says that the FSF would include more packages that come with XEmacs,
2486 but that the XEmacs maintainers don't always keep track of the authors of
2487 contributed code, which makes it impossible for the FSF to have certain
2488 legal papers signed. (Without these legal papers, the FSF will not
2489 distribute Lisp packages with Emacs.) The two versions have some
2490 significant differences at the Lisp programming level.
2491
2492 94: Where can I get Emacs for my PC running MS-DOS?
2493
2494 A pre-built binary distribution of Emacs is available from the Simtel
2495 archives. This version works under MS-DOS and Windows (3.x, 95, and NT) and
2496 supports long file names under Windows 95. More information is available
2497 from:
2498
2499 ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/emacs.README
2500
2501 And the binary itself is available in the files
2502
2503 ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu/em1934*.zip
2504
2505 where * indicates that you should retrieve all of the files beginning
2506 with "em1934" and ending with "zip".
2507
2508 If you prefer to compile Emacs for yourself, you will need a 386 (or
2509 better) processor, and are running MS-DOS 3.0 or later. According to Eli
2510 Zaretskii <eliz@is.elta.co.il> and Darrel Hankerson
2511 <hankedr@dms.auburn.edu>, you will need the following:
2512
2513 Compiler: djgpp version 1.12 maint 1 or later. Djgpp 2.0 or later is
2514 recommended, since 1.x is being phased out. Djgpp 2 supports
2515 long filenames under Windows 95.
2516
2517 You can get the latest release of djgpp by retrieving
2518 all of the files in
2519
2520 ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp
2521
2522 Gunzip and tar:
2523
2524 The easiest way is to use "djtar" which comes with djgpp v2.x,
2525 because it can open gzip'ed tarfiles (i.e., those ending with
2526 ".tar.gz") in one step. Djtar comes in "djdev201.zip", from
2527 the URL mentioned above.
2528
2529 Utilities: make, mv, sed, rm.
2530
2531 All of these utilities are available at
2532
2533 ftp://ftp.simtel.net/pub/simtelnet/gnu/djgpp/v2gnu
2534
2535 16-bit utilities can be found in GNUish:
2536
2537 ftp://ftp.simtel.net/pub/simtelnet/gnu/gnuish
2538
2539 The files INSTALL and PROBLEMS in the top-level directory of the Emacs
2540 source contains some additional information regarding Emacs under MS-DOS.
2541
2542 For a list of other MS-DOS implementations of Emacs (and Emacs
2543 look-alikes), consult the list of "Emacs implementations and literature,"
2544 available at
2545
2546 ftp://rtfm.mit.edu/pub/usenet/comp.emacs/
2547
2548 Note that while many of these programs look similar to Emacs, they often
2549 lack certain features, particularly as the Emacs Lisp extension language.
2550
2551 95: Where can I get Emacs for Microsoft Windows, Windows '95, or Windows
2552 NT?
2553
2554 GNU Emacs has been fully ported to Windows NT and Windows 95/98.
2555 If you have MSVC 4.0 or greater, then you can compile GNU Emacs
2556 directly from the source distribution. First read the file
2557 nt/README, and then the file nt/INSTALL, for step by step
2558 instructions on how to compile and install GNU Emacs on your system.
2559
2560 You can also download precompiled distributions of GNU Emacs from:
2561
2562 ftp://ftp.cs.washington.edu/pub/ntemacs
2563
2564 If you need the gunzip and tar utilities for unpacking distributions,
2565 you can download precompiled versions from:
2566
2567 ftp://ftp.cs.washington.edu/pub/ntemacs/utilities
2568
2569 For more information on configuring your favorite package to run with
2570 GNU Emacs on Windows NT/95/98, see the following FAQ:
2571
2572 http://www.cs.washington.edu/homes/voelker/ntemacs.html
2573 ftp://ftp.cs.washington.edu/pub/ntemacs/docs/ntemacs.html
2574
2575 If you are running Windows 3.11, and if you compile GNU Emacs for MSDOS
2576 with the tools listed in the previous question, it will run under
2577 Microsoft Windows in a DOS box.
2578
2579 96: Where can I get Emacs for my PC running OS/2?
2580
2581 Emacs 19.33 is ported for emx on OS/2 2.0 or 2.1, and is available at:
2582
2583 ftp://hobbes.nmsu.edu/os2/unix/apps/emacs/v.19.33/
2584
2585 97: Where can I get Emacs for my Atari ST?
2586
2587 Roland Schäuble reports that Emacs 18.58 running on plain TOS and MiNT
2588 is available at
2589
2590 ftp://atari.archive.umich.edu/Editors/Emacs-18-58/1858b-d3.zoo
2591
2592 98: Where can I get Emacs for my Amiga?
2593
2594 The files you need are available at
2595
2596 ftp://ftp.wustl.edu/pub/aminet/util/gnu/
2597
2598 David Gilbert <dgilbert@gamiga.guelphnet.dweomer.org> has released a beta
2599 version of Emacs 19.25 for the Amiga. You can get the binary at
2600
2601 ftp://ftp.wustl.edu/pub/aminet/util/gnu/a2.0bEmacs-bin.lha
2602
2603 99: Where can I get Emacs for NeXTSTEP?
2604
2605 Emacs.app is a NeXTSTEP version of Emacs 19.34 which supports colors,
2606 menus, and multiple frames. You can get it from
2607
2608 ftp://next-ftp.peak.org/pub/next/apps/emacs/Emacs_for_NeXTstep.4.20a1.NIHS.b.tar.gz
2609
2610 100: Where can I get Emacs for my Apple computer?
2611
2612
2613 There used to be a boycott of Apple because of its "look and feel"
2614 lawsuit. The lawsuit failed, and the boycott is over.
2615 Currently the GNU project treats Apple like other computer companies.
2616
2617 Since the Mac operating system is very different from Unix and GNU,
2618 support for it would be a big job. And this job would be tangential
2619 to the GNU project's goals. Meanwhile, we don't have the resources
2620 to do all we want to do on supporting Emacs for GNU-like systems.
2621 So if we had to do work on support for the Macintosh, that would
2622 directly harm the GNU project.
2623
2624 Of course, the same is true for MSDOS and Windows NT. We decided to
2625 incorporate support for those systems because the code was very modular,
2626 because volunteers not only wrote all the code but also investigate
2627 all the bugs reported on those systems, and because we hoped that we
2628 will be able to raise funds for GNU using these versions, and in this
2629 way these ports will make up for the effort that they took. (We still
2630 hope so, but it has not happened yet.)
2631
2632 An unofficial port of GNU Emacs 18.59 to the Macintosh is available at a
2633 number of ftp sites, the home being
2634
2635 ftp://ftp.cs.cornell.edu/pub/parmet/Emacs-1.17.sit.bin
2636
2637 To the best of our knowledge, Emacs 19 has not been ported to the
2638 Macintosh.
2639
2640 Apple's forthcoming "OS X" is based largely on NeXTSTEP and OpenStep.
2641 See question 99 for more details about that version.
2642
2643 101: Where do I get Emacs that runs on VMS under DECwindows?
2644
2645 Up-to-date information about GNU software (including Emacs) for VMS is
2646 available at
2647
2648 http://vms.gnu.org/
2649
2650 102: Where can I get modes for Lex, Yacc/Bison, Bourne shell, Csh, C++,
2651 Objective-C, Pascal, Java, and Awk?
2652
2653 Most of these modes are now available in standard Emacs distribution. To
2654 get additional modes, look in the Lisp Code Directory (see question 89).
2655 For C++, if you use lisp-dir-apropos, you must specify the pattern like
2656 this:
2657
2658 M-x lisp-dir-apropos RET c\+\+ RET
2659
2660 Note that Barry Warsaw's cc-mode now works for C, C++, Objective-C, and
2661 Java code. You can get the latest version from the Emacs Lisp Archive;
2662 see question 90 for details. A FAQ for cc-mode is available at
2663
2664 http://www.python.org/ftp/emacs/cc-mode.html/Top.html
2665
2666 103: What is the IP address of XXX.YYY.ZZZ?
2667
2668 If you are on a Unix machine, try using the "nslookup" command, included
2669 in the Berkeley BIND package. For example, to find the IP address of
2670 "ftp.gnu.org", you would type
2671
2672 nslookup ftp.gnu.org
2673
2674 Your computer should then provide the IP address of that computer.
2675
2676 If your site's nameserver is deficient, you can use IP addresses to FTP
2677 files. You can get this information by
2678
2679 * E-mail:
2680
2681 To: dns@[134.214.84.25] (to grasp.insa-lyon.fr)
2682 Body: ip XXX.YYY.ZZZ (or "help" for more information
2683 and options - no quotes)
2684 or:
2685
2686 To: resolve@[147.31.254.130] (to laverne.cs.widener.edu)
2687 Body: site XXX.YYY.ZZZ
2688
2689
2690 Major Emacs Lisp Packages, Emacs Extensions, and Related Programs
2691
2692 104: VM (View Mail) -- another mail reader within Emacs, with MIME support
2693
2694 Author: Kyle Jones <kyle@uunet.uu.net>
2695 Latest version: 6.62
2696 Anonymous FTP:
2697 ftp://ftp.uu.net/networking/mail/vm/vm.tar.gz
2698 Newsgroups and mailing lists:
2699 Informational newsgroup/mailing list:
2700 gnu.emacs.vm.info (newsgroup)
2701 info-vm-request@uunet.uu.net (for subscriptions)
2702 info-vm@uunet.uu.net (for submissions)
2703 Bug reports newsgroup/mailing list:
2704 gnu.emacs.vm.bug (newsgroup)
2705 bug-vm-request@uunet.uu.net (for subscriptions)
2706 bug-vm@uunet.uu.net (for submissions)
2707 NOTE: VM 6 is not guaranteed to work under Emacs 20 (although many people
2708 seem to use it without too much trouble). Users of Emacs 20 might prefer
2709 to use VM 5.97, available from the same FTP site.
2710
2711 105: SuperCite -- mail and news citation package within Emacs
2712
2713 Author: Barry Warsaw <bwarsaw@cen.com>
2714 Latest version: 3.1 (comes with Emacs 20)
2715 Anonymous FTP:
2716 ftp://ftp.python.org/pub/emacs/sc3.1.tar.gz
2717 Mailing list:
2718 supercite-request@merlin.cnri.reston.va.us (for subscriptions)
2719 supercite@merlin.cnri.reston.va.us (for submissions)
2720 NOTE: Superyank is an old version of SuperCite.
2721
2722 106: Calc -- poor man's Mathematica within Emacs
2723
2724 Author: Dave Gillespie <daveg@csvax.cs.caltech.edu>
2725 Latest version: 2.02f
2726 Anonymous FTP:
2727 ftp://ftp.gnu.org/pub/gnu/calc-2.02f.tar.gz
2728 NOTE: Unlike Wolfram Research, Dave has never threatened to sue
2729 anyone for having a program with a similar command language to
2730 Calc. :-)
2731
2732 107: VIPER -- vi emulation for Emacs
2733
2734 Since Emacs 19.29, the preferred vi emulation in Emacs is VIPER (M-x
2735 viper-mode RET), which comes with Emacs. It extends and supersedes VIP
2736 (including VIP 4.3) and provides vi emulation at several levels, from one
2737 that closely follows vi to one that departs from vi in several
2738 significant ways.
2739
2740 For Emacs 19.28 and earlier, the following version of VIP is generally
2741 better than the one distributed with Emacs:
2742
2743 Author: Aamod Sane <sane@cs.uiuc.edu>
2744 Latest version: 4.3
2745 Anonymous FTP:
2746 ftp://ftp.cs.ohio-state.edu/pub/gnu/emacs/elisp-archive/modes/vip-mode.tar.Z
2747
2748 108: AUC TeX -- enhanced LaTeX mode with debugging facilities
2749
2750 Authors: Kresten Krab Thorup <krab@iesd.auc.dk>
2751 and Per Abrahamsen <abraham@iesd.auc.dk>
2752 Latest version: 9.8l
2753 Anonymous FTP:
2754 ftp://sunsite.auc.dk/packages/auctex/auctex.tar.gz
2755 Mailing list:
2756 auc-tex-request@iesd.auc.dk (for subscriptions)
2757 auc-tex@iesd.auc.dk (for submissions)
2758 auc-tex_mgr@iesd.auc.dk (auc-tex development team)
2759 World Wide Web:
2760 http://www.iesd.auc.dk/~amanda/auctex/
2761
2762 109: BBDB -- personal Info Rolodex integrated with mail/news readers
2763
2764 Maintainer: Matt Simmons <simmonmt@acm.org>
2765 Latest released version: 2.00
2766 Available from:
2767 http://www.netcom.com/~simmonmt/bbdb/index.html
2768 Mailing lists:
2769 info-bbdb-request@xemacs.org (for subscriptions)
2770 info-bbdb@xemacs.org (for submissions)
2771 bbdb-announce-request@xemacs.org (to be informed of new releases)
2772
2773 110: Ispell -- spell checker in C with interface for Emacs
2774
2775 Author: Geoff Kuenning <geoff@itcorp.com>
2776 Latest released version: 3.1.20
2777 Anonymous FTP:
2778 Master Sites:
2779 ftp://ftp.cs.ucla.edu/pub/ispell/ispell-3.1.20.tar.gz
2780 Known Mirror Sites:
2781 ftp://ftp.th-darmstadt.de/pub/dicts/ispell/
2782 ftp://ftp.nl.net/pub/textproc/ispell/
2783 World Wide Web:
2784 http://fmg-www.cs.ucla.edu/geoff/ispell.html
2785
2786 NOTE: * Do not ask Geoff to send you the latest version of Ispell.
2787 He does not have free e-mail.
2788
2789 * This Ispell program is distinct from GNU Ispell 4.0. GNU
2790 Ispell 4.0 is no longer a supported product.
2791
2792 111: W3-mode -- A World Wide Web browser inside of Emacs
2793
2794 Author: Bill Perry <wmperry@spry.com>
2795 Latest version: 4.0pre.23
2796 Anonymous FTP:
2797 ftp://ftp.cs.indiana.edu/pub/elisp/w3/.betas/w3.tar.gz
2798 Mailing lists:
2799 w3-announce-request@indiana.edu (to get announcements of new versions)
2800 w3-beta-request@indiana.edu (for beta-testers of new versions)
2801 w3-dev@indiana.edu (for developers of W3)
2802
2803 112: EDB -- Database program for Emacs; replaces forms editing modes
2804
2805 Author: Michael Ernst <mernst@theory.lcs.mit.edu>
2806 Latest version: 1.21
2807 Anonymous FTP:
2808 ftp://theory.lcs.mit.edu/pub/emacs/edb
2809
2810 113: Mailcrypt -- PGP interface within Emacs mail and news
2811
2812 Authors: Patrick J. LoPresti <patl@lcs.mit.edu> and
2813 Jin S. Choi <jin@atype.com>
2814 Maintainer: Len Budney <lbudney@pobox.com>
2815 Latest version: 3.5b6
2816 Anonymous FTP:
2817 http://www.nb.net/~lbudney/linux/software/mailcrypt/mailcrypt-3.5b6.tar.gz
2818 World Wide Web:
2819 http://www.nb.net/~lbudney/linux/software/mailcrypt.html
2820
2821 114: Patch -- program to apply "diffs" for updating files
2822
2823 Author: Larry Wall <lwall@wall.org> (with GNU modifications)
2824 Latest version: 2.5
2825 Anonymous FTP: See question 92
2826
2827
2828 Changing Key Bindings and Handling Key Binding Problems
2829
2830 115: How do I bind keys (including function keys) to commands?
2831
2832 Keys can be bound to commands either interactively or in your .emacs
2833 file. To interactively bind keys for all modes, type
2834
2835 M-x global-set-key RET KEY CMD RET
2836
2837 To bind a key just in the current major mode, type
2838
2839 M-x local-set-key RET KEY CMD RET
2840
2841 See "Key Bindings" in the on-line manual for further details.
2842
2843 To bind keys on starting Emacs or on starting any given mode, use the
2844 following "trick": First bind the key interactively, then immediately
2845 type "C-x ESC ESC C-a C-k C-g". Now, the command needed to bind the key
2846 is in the kill ring, and can be yanked into your .emacs file. If the key
2847 binding is global, no changes to the command are required. For example,
2848
2849 (global-set-key [f1] 'help-for-help)
2850
2851 can be placed directly into the .emacs file. If the key binding is
2852 local, the command is used in conjunction with the "add-hook" command.
2853 For example, in tex-mode, a local binding might be
2854
2855 (add-hook 'tex-mode-hook
2856 (lambda ()
2857 (local-set-key [f1] 'help-for-help)))
2858
2859 NOTE: * Control characters in key sequences, in the form yanked from the
2860 kill ring are given in their graphic form -- i.e., CTRL is shown
2861 as `^', TAB as a set of spaces (usually 8), etc. You may want to
2862 convert these into their vector or string forms.
2863
2864 * If a prefix key of the character sequence to be bound is already
2865 bound as a complete key, then you must unbind it before the new
2866 binding. For example, if "ESC {" is previously bound:
2867
2868 (global-unset-key [?\e ?{]) ;; or
2869 (local-unset-key [?\e ?{])
2870
2871 * Aside from commands and "lambda lists," a vector or string also
2872 can be bound to a key and thus treated as a macro. For example:
2873
2874 (global-set-key [f10] [?\C-x?\e?\e?\C-a?\C-k?\C-g]) ;; or
2875 (global-set-key [f10] "\C-x\e\e\C-a\C-k\C-g")
2876
2877 * The "kbd" macro is convenient for converting a key description in
2878 the form used in documentation or printed by C-h c (except that
2879 function key symbols must be enclosed in angle brackets). For
2880 example:
2881
2882 (global-set-key (kbd "<f1>") 'help-for-help)
2883 (global-set-key (kbd "C-h") 'help-for-help)
2884 (local-set-key (kbd "DEL") 'scroll-down)
2885
2886 116: Why does Emacs say "Key sequence XXX uses invalid prefix characters"?
2887
2888 Usually, one of two things has happened. In one case, the control
2889 character in the key sequence has been misspecified (e.g. "C-f" used
2890 instead of "\C-f" within a Lisp expression). In the other case, a
2891 "prefix key" in the keystroke sequence you were trying to bind was
2892 already bound as a "complete key." Historically, the "ESC [" prefix was
2893 usually the problem, in which case you should evaluate either of these
2894 forms before attempting to bind the key sequence:
2895
2896 (global-unset-key [?\e ?[]) ;; or
2897 (global-unset-key "\e[")
2898
2899 117: Why doesn't this [terminal or window-system setup] code work in my
2900 .emacs file, but it works just fine after Emacs starts up?
2901
2902 During startup, Emacs initializes itself according to a given code/file
2903 order. If some of the code executed in your .emacs file needs to be
2904 postponed until the initial terminal or window-system setup code has been
2905 executed but is not, then you will experience this problem (this
2906 code/file execution order is not enforced after startup).
2907
2908 To postpone the execution of Emacs Lisp code until after terminal or
2909 window-system setup, treat the code as a "lambda list" and set the value
2910 of either the "term-setup-hook" or "window-setup-hook" variable to this
2911 "lambda function." For example,
2912
2913 (setq term-setup-hook
2914 (function
2915 (lambda ()
2916 (cond ((string-match "\\`vt220" (or (getenv "TERM") ""))
2917 ;; Make vt220's "Do" key behave like M-x:
2918 (global-set-key [do] 'execute-extended-command))
2919 ))))
2920
2921 For information on what Emacs does every time it is started, see
2922 "Starting Up Emacs" in the Lisp Reference Manual.
2923
2924 118: How do I use function keys under X Windows?
2925
2926 With Emacs 19, functions keys under X are bound like any other key. See
2927 question 115 for details.
2928
2929 119: How do I tell what characters or symbols my function or arrow keys
2930 emit?
2931
2932 Type "C-h c" then the function or arrow keys. The command will return
2933 either a function key symbol or character sequence (see the Emacs on-line
2934 documentation for an explanation). This works for other keys as well.
2935
2936 120: How do I set the X key "translations" for Emacs?
2937
2938 Emacs is not written using the Xt library by default, so there are no
2939 "translations" to be set. (We aren't sure how to set such translations
2940 if you do build Emacs with Xt; please let us know if you've done this!)
2941
2942 The only way to affect the behavior of keys within Emacs is through
2943 "xmodmap" (outside Emacs) or "define-key" (inside Emacs). The
2944 "define-key" command should be used in conjunction with the
2945 "function-key-map" map. For instance,
2946
2947 (define-key function-key-map [M-tab] [?\M-\t])
2948
2949 defines the "M-TAB" key sequence.
2950
2951 121: How do I handle C-s and C-q being used for flow control?
2952
2953 C-s and C-q are used in the XON/XOFF flow control protocol. This messes
2954 things up when you're using Emacs, because Emacs binds these keys to
2955 commands by default. Because Emacs won't honor them as flow control
2956 characters, too many of these characters are not passed on and overwhelm
2957 output buffers. Sometimes, intermediate software using XON/XOFF flow
2958 control will prevent Emacs from ever seeing C-s and C-q.
2959
2960 Possible solutions:
2961
2962 * Disable the use of C-s and C-q for flow control.
2963
2964 You need to determine the cause of the flow control.
2965
2966 * your terminal
2967
2968 Your terminal may use XON/XOFF flow control to have time to display
2969 all the characters it receives. For example, VT series terminals do
2970 this. It may be possible to turn this off from a setup menu. For
2971 example, on a VT220 you may select "No XOFF" in the setup menu. This
2972 is also true for some terminal emulation programs on PCs.
2973
2974 When you turn off flow control at the terminal, you will also need to
2975 turn it off at the other end, which might be at the computer you are
2976 logged in to or at some terminal server in between.
2977
2978 If you turn off flow control, characters may be lost; using a printer
2979 connected to the terminal may fail. You may be able to get around
2980 this problem by modifying the "termcap" entry for your terminal to
2981 include extra NUL padding characters.
2982
2983 * a modem
2984
2985 If you are using a dialup connection, the modems may be using
2986 XON/XOFF flow control. It's not clear how to get around this.
2987
2988 * a router or terminal server
2989
2990 Some network box between the terminal and your computer may be using
2991 XON/XOFF flow control. It may be possible to make it use some other
2992 kind of flow control. You will probably have to ask your local
2993 network experts for help with this.
2994
2995 * tty and/or pty devices
2996
2997 If your connection to Emacs goes through multiple tty and/or pty
2998 devices, they may be using XON/XOFF flow control even when it is not
2999 necessary.
3000
3001 Eirik Fuller <eirik@theory.tn.cornell.edu> writes:
3002
3003 Some versions of "rlogin" (and possibly telnet) do not pass flow
3004 control characters to the remote system to which they connect. On
3005 such systems, Emacs on the remote system cannot disable flow
3006 control on the local system. Sometimes "rlogin -8" will avoid this
3007 problem.
3008
3009 One way to cure this is to disable flow control on the local host
3010 (the one running rlogin, not the one running rlogind) using the
3011 stty command, before starting the rlogin process. On many systems,
3012 "stty start u stop u" will do this.
3013
3014 Some versions of "tcsh" will prevent even this from working. One
3015 way around this is to start another shell before starting rlogin,
3016 and issue the stty command to disable flow control from that shell.
3017
3018 Use "stty -ixon" instead of "stty start u stop u" on some systems.
3019
3020 * Make Emacs speak the XON/XOFF flow control protocol.
3021
3022 You can make Emacs treat C-s and C-q as flow control characters by
3023 evaluating the form
3024
3025 (enable-flow-control)
3026
3027 to unconditionally enable flow control or
3028
3029 (enable-flow-control-on "vt100" "h19")
3030
3031 (using your terminal names instead of "vt100" or "h19") to enable
3032 selectively. These commands will automatically swap `C-s' and `C-q' to
3033 `C-\' and `C-^'. Variables can be used to change the default swap keys
3034 ("flow-control-c-s-replacement" and "flow-control-c-q-replacement").
3035
3036 If you are fixing this for yourself, simply put the form in your .emacs
3037 file. If you are fixing this for your entire site, the best place to
3038 put it is in the lisp/site-start.el file. Putting this form in
3039 lisp/default.el has the problem that if the user's .emacs file has an
3040 error, this will prevent lisp/default.el from being loaded and Emacs
3041 may be unusable for the user, even for correcting their .emacs file
3042 (unless they're smart enough to move it to another name).
3043
3044 For further discussion of this issue, read the file PROBLEMS (in the
3045 top-level directory when you unpack the Emacs source).
3046
3047 122: How do I bind `C-s' and `C-q' (or any key) if these keys are filtered
3048 out?
3049
3050 To bind `C-s' and `C-q', use either "enable-flow-control" or
3051 "enable-flow-control-on". See question 121 for usage and implementation
3052 details.
3053
3054 To bind other keys, use "keyboard-translate". See question 125 for usage
3055 details. To do this for an entire site, you should swap the keys in
3056 lisp/site-start.el. See question 121 for an explanation of why
3057 lisp/default.el should not be used.
3058
3059 NOTE: * If you do this for an entire site, the users will be confused by
3060 the disparity between what the documentation says and how Emacs
3061 actually behaves.
3062
3063 123: Why does the "Backspace" key invoke help?
3064
3065 The "Backspace" key (on most keyboards) generates ASCII code 8. `C-h'
3066 sends the same code. In Emacs by default `C-h' invokes help-command.
3067 This is intended to be easy to remember since the first letter of "help"
3068 is `h'. The easiest solution to this problem is to use `C-h' (and
3069 Backspace) for help and DEL (the Delete key) for deleting the previous
3070 character.
3071
3072 For many people this solution may be problematic:
3073
3074 * They normally use Backspace outside of Emacs for deleting the previous
3075 character. This can be solved by making DEL the command for deleting
3076 the previous character outside of Emacs. On many Unix systems, this
3077 command will remap DEL:
3078
3079 stty erase `^?'
3080
3081 * The person may prefer using the Backspace key for deleting the previous
3082 character because it is more conveniently located on their keyboard or
3083 because they don't even have a separate Delete key. In this case, the
3084 Backspace key should be made to behave like Delete. There are several
3085 methods.
3086
3087 * Some terminals (e.g., VT3## terminals) allow the character generated by
3088 the Backspace key to be changed from a setup menu.
3089
3090 * You may be able to get a keyboard that is completely programmable.
3091
3092 * Under X or on a dumb terminal, it is possible to swap the Backspace and
3093 Delete keys inside Emacs:
3094
3095 (keyboard-translate ?\C-h ?\C-?)
3096
3097 See question 125 for further details of "keyboard-translate".
3098
3099 * Another approach is to switch key bindings and put help on "C-x h"
3100 instead:
3101
3102 (global-set-key "\C-h" 'delete-backward-char)
3103 (global-set-key "\C-xh" 'help-command) ;; overrides mark-whole-buffer
3104
3105 Other popular key bindings for help are M-? and "C-x ?".
3106
3107 NOTE: * Don't try to bind DEL to help-command, because there are many
3108 modes that have local bindings of DEL that will interfere.
3109
3110 124: Why doesn't Emacs look at the stty settings for Backspace vs. Delete?
3111
3112 Good question!
3113
3114 125: How do I "swap" two keys?
3115
3116 In Emacs 19, you can swap two keys (or key sequences) by using the
3117 "keyboard-translate" function. For example, to turn `C-h' into DEL and
3118 DEL to `C-h', use
3119
3120 (keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL
3121 (keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'.
3122
3123 The first key sequence of the pair after the function identifies what is
3124 produced by the keyboard; the second, what is matched for in the keymaps.
3125
3126 Keyboard translations are not the same as key bindings in keymaps. Emacs
3127 contains numerous keymaps that apply in different situations, but there
3128 is only one set of keyboard translations, and it applies to every
3129 character that Emacs reads from the terminal. Keyboard translations take
3130 place at the lowest level of input processing; the keys that are looked
3131 up in keymaps contain the characters that result from keyboard
3132 translation.
3133
3134 Also see "Keyboard Translations" in the on-line manual.
3135
3136 126: How do I produce C-XXX with my keyboard?
3137
3138 On terminals (but not under X), some common "aliases" are:
3139
3140 C-2 or C-SPC for C-@
3141 C-6 for C-^
3142 C-7 or C-S-- for C-_
3143 C-4 for C-\
3144 C-5 for C-]
3145 C-/ for C-?
3146
3147 Often other aliases exist; use the "C-h c" command and try `CTRL' with
3148 all of the digits on your keyboard to see what gets generated. You can
3149 also try the "C-h w" command if you know the name of the command.
3150
3151 127: What if I don't have a Meta key?
3152
3153 Instead of typing "M-a", you can type "ESC a". In fact, Emacs converts
3154 M-a internally into "ESC a" anyway (depending on the value of
3155 meta-prefix-char). Note that you press "Meta" and `a' together, while
3156 you press `ESC', release it, and then press `a'.
3157
3158 128: What if I don't have an Escape key?
3159
3160 Type `C-[' instead. This should send ASCII code 27 just like an Escape
3161 key would. `C-3' may also work on some terminal (but not under X). For
3162 many terminals (notably DEC terminals) `F11' generates ESC. If not, the
3163 following form can be used to bind it:
3164
3165 (define-key function-key-map [f11] [?\e]) ; F11 is the documented ESC
3166 ; replacement on DEC terminals.
3167
3168 129: Can I make my "Compose Character" key behave like a Meta key?
3169
3170 On a dumb terminal such as a VT220, no. It is rumored that certain VT220
3171 clones could have their Compose key configured this way. If you're using
3172 X, you might be able to do this with the "xmodmap" program.
3173
3174 130: How do I bind a combination of modifier key and function key?
3175
3176 With Emacs 19 you can represent modified function keys in vector format
3177 by adding prefixes to the function key symbol. For example (from the
3178 on-line documentation):
3179
3180 (global-set-key [?\C-x right] 'forward-page)
3181
3182 where "?\C-x" is the Lisp character constant for the character "C-x".
3183
3184 You can use the modifier keys Control, Meta, Hyper, Super, Alt, and Shift
3185 with function keys. To represent these modifiers, prepend the strings
3186 "C-", "M-", "H-", "s-", "A-", and "S-" to the symbol name. Here is how
3187 to make "Hyper-Meta-RIGHT" move forward a word:
3188
3189 (global-set-key [H-M-right] 'forward-word)
3190
3191 In recent Emacs versions this may also be written as:
3192
3193 (global-set-key [(hyper meta right)] 'forward-word)
3194
3195 NOTE: * Not all modifiers are permitted in all situations. Hyper, Super,
3196 and Alt are available only under X (provided there are such
3197 keys). Non-ASCII keys and mouse events (e.g. "C-=" and
3198 "mouse-1") also fall under this category.
3199
3200 See question 115 for general key binding instructions.
3201
3202 131: Why doesn't my Meta key work in an xterm window?
3203
3204 Try all of these methods before asking for further help:
3205
3206 * You may have big problems using "mwm" as your window manager. {Does
3207 anyone know a good generic solution to allow the use of the Meta key in
3208 Emacs with mwm?}
3209
3210 * For X11: Make sure it really is a Meta key. Use "xev" to find out what
3211 keysym your Meta key generates. It should be either Meta_L or Meta_R.
3212 If it isn't, use xmodmap to fix the situation.
3213
3214 * Make sure the pty the xterm is using is passing 8 bit characters.
3215 "stty -a" (or "stty everything") should show "cs8" somewhere. If it
3216 shows "cs7" instead, use "stty cs8 -istrip" (or "stty pass8") to fix
3217 it.
3218
3219 * If there is an rlogin connection between the xterm and the Emacs, the
3220 "-8" argument may need to be given to rlogin to make it pass all 8 bits
3221 of every character.
3222
3223 * If the Emacs is running under Ultrix, it is reported that evaluating
3224 (set-input-mode t nil) helps.
3225
3226 * If all else fails, you can make xterm generate "ESC W" when you type
3227 M-W, which is the same conversion Emacs would make if it got the M-W
3228 anyway. In X11R4, the following resource specification will do this:
3229
3230 XTerm.VT100.EightBitInput: false
3231
3232 (This changes the behavior of the insert-eight-bit action.)
3233
3234 With older xterms, you can specify this behavior with a translation:
3235
3236 XTerm.VT100.Translations: #override \
3237 Meta<KeyPress>: string(0x1b) insert()
3238
3239 You might have to replace "Meta" with "Alt".
3240
3241 132: Why doesn't my ExtendChar key work as a Meta key under HP-UX 8.0
3242 and 9.x?
3243
3244 This is a result of an internationalization extension in X11R4 and the
3245 fact that HP is now using this extension. Emacs assumes that
3246 XLookupString returns the same result regardless of the Meta key state
3247 which is no longer necessarily true. Until Emacs is fixed, the temporary
3248 kludge is to run this command after each time the X server is started but
3249 preferably before any xterm clients are:
3250
3251 xmodmap -e 'remove mod1 = Mode_switch'
3252
3253 NOTE: This will disable the use of the extra keysyms systemwide, which
3254 may be undesirable if you actually intend to use them.
3255
3256
3257 Using Emacs with Alternate Character Sets
3258
3259 133: How do I make Emacs display 8-bit characters?
3260
3261 Emacs 19 introduced built-in support for 8-bit characters. Emacs 20 can
3262 operate similarly in Unibyte mode or else in Multibyte mode. See the
3263 "International" node in the online manual, specifically "Single-Byte
3264 European Support".
3265
3266 134: How do I input 8-bit characters?
3267
3268 Again, see the "International" node of the on-line manual.
3269
3270 135: Where can I get an Emacs that handles kanji, Chinese, or other
3271 character sets?
3272
3273 Emacs 20 now includes many of the features of MULE, the Multilingual
3274 Enhancement of Emacs. See question 84 for information on where to find
3275 and download Emacs.
3276
3277 The original MULE is available at
3278
3279 ftp://sh.wide.ad.jp/JAPAN/mule/mule-19.33-delta.tar.gz
3280
3281 136: Where is an Emacs that can handle Semitic (right-to-left) alphabets?
3282
3283 Emacs 20 supports Hebrew characters (ISO 8859-8), but does not yet
3284 support right-to-left character entry.
3285
3286 Joel M. Hoffman <joel@exc.com> has written a Lisp package called
3287 hebrew.el that allows right-to-left editing of Hebrew. It reportedly
3288 works out of the box with Emacs 19, but requires patches for Emacs 18.
3289 Write to Joel if you want the patches or package.
3290
3291 Hebrew.el requires a Hebrew screen font, but no other Hardware support.
3292 Joel has a screen font for PCs running MS-DOS and Linux.
3293
3294 You might also try to query archie for files named with "hebrew"; several
3295 ftp sites in Israel may also have the necessary files.
3296
3297
3298 Mail and News
3299
3300 137: How do I change the included text prefix in mail/news followups?
3301
3302 If you read mail with Rmail or news with Gnus, set the variable
3303 mail-yank-prefix. For VM, set vm-included-text-prefix. For mh-e, set
3304 mh-ins-buf-prefix.
3305
3306 For fancier control of citations, use SuperCite. See question 105.
3307
3308 To prevent Emacs from including various headers of the replied-to
3309 message, set the value of mail-yank-ignored-headers to an appropriate
3310 regexp.
3311
3312 138: How do I save a copy of outgoing mail?
3313
3314 You can either mail yourself a copy by including a "BCC:" header in the
3315 mail message, or store a copy of the message directly to a file by
3316 including an "FCC:" header.
3317
3318 If you use standard mail, you can automatically create a "BCC:" to
3319 yourself by putting
3320
3321 (setq mail-self-blind t)
3322
3323 in your .emacs file. You can automatically include an "FCC:" field by
3324 putting something like the following in your .emacs file:
3325
3326 (setq mail-archive-file-name (expand-file-name "~/outgoing"))
3327
3328 The output file will be in Unix mail format, which can be read directly
3329 by VM, but not always by Rmail. See question 140.
3330
3331 For Gnus, see the `Archived Messages node of the Gnus manual.
3332
3333 If you use mh-e, add an "FCC:" or "BCC:" field to your components file.
3334
3335 It does not work to put "set record filename" in the .mailrc file.
3336
3337 139: Why doesn't Emacs expand my aliases when sending mail?
3338
3339 * You must separate multiple addresses in the headers of the mail buffer
3340 with commas. This is because Emacs supports RFC822 standard addresses
3341 like this one:
3342
3343 To: Willy Smith <wks@xpnsv.lwyrs.com>
3344
3345 However, you do not need to -- and probably should not, unless your
3346 system's version of /usr/ucb/mail (aka mailx) supports RFC822 --
3347 separate addresses with commas in your ~/.mailrc file.
3348
3349 * Emacs normally only reads the ".mailrc" file once per session, when you
3350 start to compose your first mail message. If you edit .mailrc, you can
3351 type "M-x rebuild-mail-abbrevs RET" to make Emacs reread your ~/.mailrc
3352 file.
3353
3354 * If you like, you can expand mail aliases as abbrevs, as soon as you
3355 type them in. To enable this feature, execute the following:
3356
3357 (add-hook 'mail-setup-hook 'mail-abbrevs-setup)
3358
3359 Note that the aliases are expanded automatically only after you type
3360 RET or a punctuation character (e.g. `,'). You can force their
3361 expansion by moving point to the end of the alias and typing "C-x a e"
3362 (M-x expand-abbrev).
3363
3364 140: Why does Rmail think all my saved messages are one big message?
3365
3366 A file created through the FCC: field in a message is in Unix mail
3367 format, not the format that Rmail uses (BABYL format). Rmail will try to
3368 convert a Unix mail file into BABYL format on input, but sometimes it
3369 makes errors. For guaranteed safety, you can make the saved-messages
3370 file be an inbox for your Rmail file by using the function
3371 set-rmail-inbox-list.
3372
3373 141: How can I sort the messages in my Rmail folder?
3374
3375 In Rmail, type "C-c C-s C-h" to get a list of sorting functions and their
3376 key bindings.
3377
3378 142: Why does Rmail need to write to /usr/spool/mail?
3379
3380 This is the behavior of the "movemail" program which Rmail uses. This
3381 indicates that movemail is configured to use lock files.
3382
3383 RMS writes:
3384
3385 Certain systems require lock files to interlock access to mail files.
3386 On these systems, movemail must write lock files, or you risk losing
3387 mail. You simply must arrange to let movemail write them.
3388
3389 Other systems use the flock system call to interlock access. On these
3390 systems, you should configure movemail to use flock.
3391
3392 143: How do I recover my mail files after Rmail munges their format?
3393
3394 If you have just done rmail-input on a file and you don't want to save it
3395 in Rmail's format (called BABYL), just kill the buffer (with C-x k).
3396
3397 If you typed M-x rmail and it read some messages out of your inbox and
3398 you want to put them in a Unix mail file, use C-o on each message.
3399
3400 If you want to convert an existing file from BABYL format to Unix mail
3401 format, use the command M-x unrmail: it will prompt you for the input and
3402 output file names.
3403
3404 144: How can I force Rmail to reply to the sender of a message, but not the
3405 other recipients?
3406
3407 Ron Isaacson <isaacson@seas.upenn.edu> says: When you hit "r" to reply in
3408 Rmail, by default it CCs all of the original recipients (everyone on the
3409 original "To" and "CC" lists). With a prefix argument (i.e., typing "C-u"
3410 before "r"), it replies only to the sender. However, going through the
3411 whole C-u business every time you want to reply is a pain. This is the
3412 best fix I've been able to come up with:
3413
3414 (defun rmail-reply-t ()
3415 "Reply only to the sender of the current message. (See rmail-reply.)"
3416 (interactive)
3417 (rmail-reply t))
3418
3419 (add-hook 'rmail-mode-hook
3420 '(lambda ()
3421 (define-key rmail-mode-map "r" 'rmail-reply-t)
3422 (define-key rmail-mode-map "R" 'rmail-reply)))
3423
3424 145: How can I get my favorite Emacs mail package to support MIME?
3425
3426 Look at the Emacs MIME FAQ, maintained by MacDonald Hall Jackson
3427 <trey@cs.berkeley.edu> at
3428
3429 http://bmrc.berkeley.edu/~trey/emacs/mime.html
3430
3431 Version 6.x of VM supports MIME. See question 104.
3432
3433 MIME support has been added in the development version of Gnus which will
3434 be included with a future version of Emacs.
3435
3436 146: How do I make Emacs automatically start my mail/news reader?
3437
3438 To start Emacs in Gnus:
3439
3440 emacs -f gnus
3441
3442 in Rmail:
3443
3444 emacs -f rmail
3445
3446 A more convenient way to start with Gnus:
3447
3448 alias gnus 'emacs -f gnus'
3449 gnus
3450
3451 It is probably unwise to automatically start your mail or news reader
3452 from your .emacs file. This would cause problems if you needed to run
3453 two copies of Emacs at one time. Also, this would make it difficult for
3454 you to start Emacs quickly when you needed to.
3455
3456 147: How do I read news under Emacs?
3457
3458 Use M-x gnus. It is documented in Info (see question 14).
3459
3460 148: Why doesn't Gnus work via NNTP?
3461
3462 There is a bug in NNTP version 1.5.10, such that when multiple requests
3463 are sent to the NNTP server, the server only handles the first one before
3464 blocking waiting for more input which never comes. NNTP version 1.5.11
3465 claims to fix this.
3466
3467 You can work around the bug inside Emacs like this:
3468
3469 (setq nntp-maximum-request 1)
3470
3471 You can find out what version of NNTP your news server is running by
3472 telnetting to the NNTP port (usually 119) on the news server machine
3473 (i.e., "telnet server-machine 119"). The server should give its version
3474 number in the welcome message. Type "quit" to get out.
3475
3476 Also see question 75 in this FAQ for some additional ideas.
3477
3478 149: How do I view news articles with embedded underlining (e.g.,
3479 ClariNews)?
3480
3481 Underlining appears like this:
3482
3483 _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg
3484
3485 Use Gnus' "Overstrike" function from the Article -> Washing menu (or type
3486 "W o"). You can do this for all articles with:
3487
3488 (add-hook 'gnus-article-prepare-hook 'gnus-article-treat-overstrike)
3489
3490 If you prefer to do away with underlining altogether, you can
3491 destructively remove it with M-x ununderline-region; do this
3492 automatically via
3493
3494 (add-hook 'gnus-article-prepare-hook
3495 (lambda () (ununderline-region (point-min) (point-max))))
3496
3497 See the Gnus manual for more information about this and similar methods
3498 for treating article contents.
3499
3500 150: How do I save all the items of a multi-part posting in Gnus?
3501
3502 Use gnus-uu. Type C-c C-v C-h in the Gnus summary buffer to see a list
3503 of available commands.
3504
3505 151: How do I make Gnus start up faster?
3506
3507 From the Gnus FAQ (see question 157):
3508
3509 Pranav Kumar Tiwari <pktiwari@eos.ncsu.edu> writes: I posted the same
3510 query recently and I got an answer to it. I am going to repeat the
3511 answer. What you need is a newer version of gnus, version 5.0.4+. I am
3512 using 5.0.12 and it works fine with me with the following settings:
3513
3514 (setq gnus-check-new-newsgroups nil
3515 gnus-read-active-file 'some
3516 gnus-nov-is-evil nil
3517 gnus-select-method '(nntp gnus-nntp-server))
3518
3519 152: How do I catch up all newsgroups in Gnus?
3520
3521 In the "*Newsgroup*" buffer, type the following magical incantation:
3522
3523 M-< C-x ( c y C-x ) M-0 C-x e
3524
3525 Leave off the "M-<" if you only want to catch up from point to the end of
3526 the "*Newsgroup" buffer.
3527
3528 153: Why can't I kill in Gnus based on the Newsgroups/Keywords/Control
3529 headers?
3530
3531 Gnus will complain that the "Newsgroups:", "Keywords:", and "Control:"
3532 headers are "Unknown header" fields.
3533
3534 For the "Newsgroups:" header, there is an easy workaround: kill on the
3535 "Xref" header instead, which will be present on any cross-posted article
3536 (as long as your site carries the cross-post group).
3537
3538 If you really want to kill on one of these headers, you can do it like
3539 this:
3540
3541 (gnus-kill nil "^Newsgroups: .*\\(bad\\.group\\|worse\\.group\\)")
3542
3543 154: How do I get rid of flashing messages in Gnus for slow connections?
3544
3545 Set nntp-debug-read to nil.
3546
3547 155: Why is catch up slow in Gnus?
3548
3549 Because Gnus is marking crosspostings read. You can control this with
3550 the variable gnus-use-cross-reference.
3551
3552 156: Why does Gnus hang for a long time when posting?
3553
3554 David Lawrence <tale@uunet.uu.net> explains:
3555
3556 The problem is almost always interaction between NNTP and C News. NNTP
3557 POST asks C News's inews to not background itself but rather hang
3558 around and give its exit status so it knows whether the post was
3559 successful. (That wait will on some systems not return the exit status
3560 of the waited for job is a different sort of problem.) It ends up
3561 taking a long time because inews is calling relaynews, which often
3562 waits for another relaynews to free the lock on the news system so it
3563 can file the article.
3564
3565 My preferred solution is to change inews to not call relaynews, but
3566 rather use newsspool. This loses some error-catching functionality,
3567 but is for the most part safe as inews will detect a lot of the errors
3568 on its own. The C News folks have sped up inews, too, so speed should
3569 look better to most folks as that update propagates around.
3570
3571 157: Where can I find out more about Gnus?
3572
3573 Visit http://www.gnus.org/, which has a pointer to the current Gnus FAQ and
3574 more information. The relevant newsgroup is gnu.emacs.gnus.
3575
3576 ------------------------------------------------------------
3577 Modified, with permission, for the Emacs 20.4 distribution by Dave Love.
3578
3579 Copyright 1994-1998 Reuven M. Lerner
3580 Copyright 1992-1993 Steven Byrnes
3581 Copyright 1990-1992 Joseph Brian Wells
3582
3583 This list of frequently asked questions about GNU Emacs with answers
3584 ("FAQ") may be translated into other languages, transformed into other
3585 formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information.
3586
3587 The same conditions apply to any derivative of the FAQ as apply to the FAQ
3588 itself. Every copy of the FAQ must include this notice or an approved
3589 translation, information on who is currently maintaining the FAQ and how to
3590 contact them (including their e-mail address), and information on where the
3591 latest version of the FAQ is archived (including FTP information).
3592
3593 The FAQ may be copied and redistributed under these conditions, except that
3594 the FAQ may not be embedded in a larger literary work unless that work
3595 itself allows free copying and redistribution.
3596
3597 ------------------------------------------------------------
3598
3599 People who helped with this version of the FAQ:
3600
3601 Ethan Bradford <ethanb@u.washington.edu>, William G. Dubuque
3602 <wgd@martigny.ai.mit.edu>, Michael Ernst <mernst@theory.lcs.mit.edu>,
3603 and Denby Wong <3dw16@qlink.QueensU.CA>.