Mercurial > emacs
annotate doc/misc/faq.texi @ 103383:288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
(The LPF): Make the updated URL the sole reference point.
(Learning how to do something): Update refcard price and format.
(Getting a printed manual): Sources in doc/emacs/, not man/.
Also available in PDF format. Since the page count varies, be less precise.
(Informational files for Emacs): Remove references to deleted files
LPF and SUN-SUPPORT, and to UUCP.
(Obtaining the FAQ): Refer to the service web-page rather than SERVICE.
Remove many obsolete ways to get the FAQ, which now seems only to be
distributed with Emacs.
(Mail and news): Remove sections about Rmail Babyl that no longer apply.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 11 Jun 2009 07:40:19 +0000 |
parents | 75e6ecda8c42 |
children | 1a60127fa212 |
rev | line source |
---|---|
84296 | 1 \input texinfo @c -*- mode: texinfo; -*- |
2 @c %**start of header | |
84329
3d431f1997d8
(setfilename): Go up one more level to ../../info.
Glenn Morris <rgm@gnu.org>
parents:
84296
diff
changeset
|
3 @setfilename ../../info/efaq |
84296 | 4 @settitle GNU Emacs FAQ |
5 @c %**end of header | |
6 | |
7 @c This is used in many places | |
103279
75e6ecda8c42
Bump version to 23.0.94.
Chong Yidong <cyd@stupidchicken.com>
parents:
103130
diff
changeset
|
8 @set VER 23.0.94 |
84296 | 9 |
10 @c This file is maintained by Romain Francoise <rfrancoise@gnu.org>. | |
11 @c Feel free to install changes without prior permission (but I'd | |
12 @c appreciate a notice if you do). | |
13 | |
14 @copying | |
100974 | 15 Copyright @copyright{} 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 |
84296 | 16 Free Software Foundation, Inc.@* |
17 Copyright 1994,1995,1996,1997,1998,1999,2000 Reuven M. Lerner@* | |
18 Copyright 1992,1993 Steven Byrnes@* | |
19 Copyright 1990,1991,1992 Joseph Brian Wells@* | |
20 | |
21 @quotation | |
22 This list of frequently asked questions about GNU Emacs with answers | |
23 (``FAQ'') may be translated into other languages, transformed into other | |
24 formats (e.g. Texinfo, Info, WWW, WAIS), and updated with new information. | |
25 | |
26 The same conditions apply to any derivative of the FAQ as apply to the FAQ | |
27 itself. Every copy of the FAQ must include this notice or an approved | |
28 translation, information on who is currently maintaining the FAQ and how to | |
29 contact them (including their e-mail address), and information on where the | |
30 latest version of the FAQ is archived (including FTP information). | |
31 | |
32 The FAQ may be copied and redistributed under these conditions, except that | |
33 the FAQ may not be embedded in a larger literary work unless that work | |
34 itself allows free copying and redistribution. | |
35 | |
36 [This version has been heavily edited since it was included in the Emacs | |
37 distribution.] | |
38 @end quotation | |
39 @end copying | |
40 | |
41 @dircategory Emacs | |
42 @direntry | |
43 * Emacs FAQ: (efaq). Frequently Asked Questions about Emacs. | |
44 @end direntry | |
45 | |
46 @c The @titlepage stuff only appears in the printed version | |
47 @titlepage | |
48 @sp 10 | |
49 @center @titlefont{GNU Emacs FAQ} | |
50 | |
51 @c The following two commands start the copyright page. | |
52 @page | |
53 @vskip 0pt plus 1filll | |
54 @insertcopying | |
55 @end titlepage | |
56 | |
102059
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
101743
diff
changeset
|
57 @contents |
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
101743
diff
changeset
|
58 |
84296 | 59 @node Top, FAQ notation, (dir), (dir) |
60 | |
61 This is the GNU Emacs FAQ, last updated on @today{}. | |
62 | |
63 This FAQ is maintained as a part of GNU Emacs. If you find any errors, | |
64 or have any suggestions, please use @kbd{M-x report-emacs-bug} to report | |
65 them. | |
66 | |
102059
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
101743
diff
changeset
|
67 @ifnottex |
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
101743
diff
changeset
|
68 @insertcopying |
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
101743
diff
changeset
|
69 @end ifnottex |
9bcea07061a8
consistently use @insertcopying, @direntry, @contents
Karl Berry <karl@gnu.org>
parents:
101743
diff
changeset
|
70 |
84296 | 71 @menu |
72 * FAQ notation:: | |
73 * General questions:: | |
74 * Getting help:: | |
75 * Status of Emacs:: | |
76 * Common requests:: | |
77 * Bugs and problems:: | |
78 * Compiling and installing Emacs:: | |
79 * Finding Emacs and related packages:: | |
80 * Major packages and programs:: | |
81 * Key bindings:: | |
82 * Alternate character sets:: | |
83 * Mail and news:: | |
84 * Concept index:: | |
85 @end menu | |
86 | |
87 @c ------------------------------------------------------------ | |
88 @node FAQ notation, General questions, Top, Top | |
89 @chapter FAQ notation | |
90 @cindex FAQ notation | |
91 | |
92 This chapter describes notation used in the GNU Emacs FAQ, as well as in | |
93 the Emacs documentation. Consult this section if this is the first time | |
94 you are reading the FAQ, or if you are confused by notation or terms | |
95 used in the FAQ. | |
96 | |
97 @menu | |
98 * Basic keys:: | |
99 * Extended commands:: | |
100 * On-line manual:: | |
101 * File-name conventions:: | |
102 * Common acronyms:: | |
103 @end menu | |
104 | |
105 @node Basic keys, Extended commands, FAQ notation, FAQ notation | |
106 @section What do these mean: @kbd{C-h}, @kbd{C-M-a}, @key{RET}, @kbd{@key{ESC} a}, etc.? | |
107 @cindex Basic keys | |
108 @cindex Control key, notation for | |
109 @cindex @key{Meta} key, notation for | |
110 @cindex Control-Meta characters, notation for | |
111 @cindex @kbd{C-h}, definition of | |
112 @cindex @kbd{C-M-h}, definition of | |
113 @cindex @key{DEL}, definition of | |
114 @cindex @key{ESC}, definition of | |
115 @cindex @key{LFD}, definition of | |
116 @cindex @key{RET}, definition of | |
117 @cindex @key{SPC}, definition of | |
118 @cindex @key{TAB}, definition of | |
119 @cindex Notation for keys | |
120 | |
121 @itemize @bullet | |
122 | |
123 @item | |
124 @kbd{C-x}: press the @key{x} key while holding down the @key{Control} key | |
125 | |
126 @item | |
127 @kbd{M-x}: press the @key{x} key while holding down the @key{Meta} key | |
128 (if your computer doesn't have a @key{Meta} key, @pxref{No Meta key}) | |
129 | |
130 @item | |
131 @kbd{M-C-x}: press the @key{x} key while holding down both @key{Control} | |
132 and @key{Meta} | |
133 | |
134 @item | |
135 @kbd{C-M-x}: a synonym for the above | |
136 | |
137 @item | |
138 @key{LFD}: Linefeed or Newline; same as @kbd{C-j} | |
139 | |
140 @item | |
141 @key{RET}: @key{Return}, sometimes marked @key{Enter}; same as @kbd{C-m} | |
142 | |
143 @item | |
144 @key{DEL}: @key{Delete}, usually @strong{not} the same as | |
145 @key{Backspace}; same as @kbd{C-?} (see @ref{Backspace invokes help}, if | |
146 deleting invokes Emacs help) | |
147 | |
148 @item | |
149 @key{ESC}: Escape; same as @kbd{C-[} | |
150 | |
151 @item | |
152 @key{TAB}: Tab; same as @kbd{C-i} | |
153 | |
154 @item | |
155 @key{SPC}: Space bar | |
156 | |
157 @end itemize | |
158 | |
159 Key sequences longer than one key (and some single-key sequences) are | |
160 written inside quotes or on lines by themselves, like this: | |
161 | |
162 @display | |
163 @kbd{M-x frobnicate-while-foo RET} | |
164 @end display | |
165 | |
166 @noindent | |
167 Any real spaces in such a key sequence should be ignored; only @key{SPC} | |
168 really means press the space key. | |
169 | |
170 The @acronym{ASCII} code sent by @kbd{C-x} (except for @kbd{C-?}) is the value | |
171 that would be sent by pressing just @key{x} minus 96 (or 64 for | |
172 upper-case @key{X}) and will be from 0 to 31. On Unix and GNU/Linux | |
173 terminals, the @acronym{ASCII} code sent by @kbd{M-x} is the sum of 128 and the | |
174 @acronym{ASCII} code that would be sent by pressing just @key{x}. Essentially, | |
175 @key{Control} turns off bits 5 and 6 and @key{Meta} turns on bit | |
176 7@footnote{ | |
177 DOS and Windows terminals don't set bit 7 when the @key{Meta} key is | |
178 pressed.}. | |
179 | |
180 @kbd{C-?} (aka @key{DEL}) is @acronym{ASCII} code 127. It is a misnomer to call | |
181 @kbd{C-?} a ``control'' key, since 127 has both bits 5 and 6 turned ON. | |
182 Also, on very few keyboards does @kbd{C-?} generate @acronym{ASCII} code 127. | |
183 | |
184 @inforef{Text Characters, Text Characters, emacs}, and @inforef{Keys, | |
185 Keys, emacs}, for more information. (@xref{On-line manual}, for more | |
186 information about Info.) | |
187 | |
188 @node Extended commands, On-line manual, Basic keys, FAQ notation | |
189 @section What does @file{M-x @var{command}} mean? | |
190 @cindex Extended commands | |
191 @cindex Commands, extended | |
192 @cindex M-x, meaning of | |
193 | |
194 @kbd{M-x @var{command}} means type @kbd{M-x}, then type the name of the | |
195 command, then type @key{RET}. (@xref{Basic keys}, if you're not sure | |
196 what @kbd{M-x} and @key{RET} mean.) | |
197 | |
198 @kbd{M-x} (by default) invokes the command | |
199 @code{execute-extended-command}. This command allows you to run any | |
200 Emacs command if you can remember the command's name. If you can't | |
201 remember the command's name, you can type @key{TAB} and @key{SPC} for | |
202 completion, @key{?} for a list of possibilities, and @kbd{M-p} and | |
203 @kbd{M-n} (or up-arrow and down-arrow on terminals that have these | |
204 editing keys) to see previous commands entered. An Emacs @dfn{command} | |
205 is an @dfn{interactive} Emacs function. | |
206 | |
207 @cindex @key{Do} key | |
208 Your system administrator may have bound other key sequences to invoke | |
209 @code{execute-extended-command}. A function key labeled @kbd{Do} is a | |
210 good candidate for this, on keyboards that have such a key. | |
211 | |
212 If you need to run non-interactive Emacs functions, see @ref{Evaluating | |
213 Emacs Lisp code}. | |
214 | |
215 @node On-line manual, File-name conventions, Extended commands, FAQ notation | |
216 @section How do I read topic XXX in the on-line manual? | |
217 @cindex On-line manual, reading topics in | |
218 @cindex Reading topics in the on-line manual | |
219 @cindex Finding topics in the on-line manual | |
220 @cindex Info, finding topics in | |
221 | |
222 When we refer you to some @var{topic} in the on-line manual, you can | |
223 read this manual node inside Emacs (assuming nothing is broken) by | |
224 typing @kbd{C-h i m emacs @key{RET} m @var{topic} @key{RET}}. | |
225 | |
226 This invokes Info, the GNU hypertext documentation browser. If you don't | |
227 already know how to use Info, type @key{?} from within Info. | |
228 | |
229 If we refer to @var{topic}:@var{subtopic}, type @kbd{C-h i m emacs | |
230 @key{RET} m @var{topic} @key{RET} m @var{subtopic} @key{RET}}. | |
231 | |
232 If these commands don't work as expected, your system administrator may | |
233 not have installed the Info files, or may have installed them | |
234 improperly. In this case you should complain. | |
235 | |
236 @xref{Getting a printed manual}, if you would like a paper copy of the | |
237 Emacs manual. | |
238 | |
239 @node File-name conventions, Common acronyms, On-line manual, FAQ notation | |
240 @section What are @file{etc/SERVICE}, @file{src/config.h}, and @file{lisp/default.el}? | |
241 @cindex File-name conventions | |
242 @cindex Conventions for file names | |
243 @cindex Directories and files that come with Emacs | |
244 | |
245 These are files that come with Emacs. The Emacs distribution is divided | |
246 into subdirectories; the important ones are @file{etc}, @file{lisp}, and | |
247 @file{src}. | |
248 | |
249 If you use Emacs, but don't know where it is kept on your system, start | |
250 Emacs, then type @kbd{C-h v data-directory @key{RET}}. The directory | |
251 name displayed by this will be the full pathname of the installed | |
252 @file{etc} directory. (This full path is recorded in the Emacs variable | |
253 @code{data-directory}, and @kbd{C-h v} displays the value and the | |
254 documentation of a variable.) | |
255 | |
256 The location of your Info directory (i.e., where on-line documentation | |
257 is stored) is kept in the variable @code{Info-default-directory-list}. Use | |
258 @kbd{C-h v Info-default-directory-list @key{RET}} to see the value of | |
259 this variable, which will be a list of directory names. The last | |
260 directory in that list is probably where most Info files are stored. By | |
261 default, Info documentation is placed in @file{/usr/local/info}. | |
262 | |
263 Some of these files are available individually via FTP or e-mail; see | |
264 @ref{Informational files for Emacs}. They all are available in the | |
265 source distribution. Many of the files in the @file{etc} directory are | |
266 also available via the Emacs @samp{Help} menu, or by typing @kbd{C-h ?} | |
267 (@kbd{M-x help-for-help}). | |
268 | |
269 Your system administrator may have removed the @file{src} directory and | |
270 many files from the @file{etc} directory. | |
271 | |
272 @node Common acronyms, , File-name conventions, FAQ notation | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
273 @section What are FSF, LPF, GNU, RMS, FTP, and GPL? |
84296 | 274 @cindex FSF, definition of |
275 @cindex LPF, definition of | |
276 @cindex GNU, definition of | |
277 @cindex RMS, definition of | |
278 @cindex Stallman, Richard, acronym for | |
279 @cindex Richard Stallman, acronym for | |
280 @cindex FTP, definition of | |
281 @cindex GPL, definition of | |
282 @cindex Acronyms, definitions for | |
283 @cindex Common acronyms, definitions for | |
284 | |
285 @table @asis | |
286 | |
287 @item FSF | |
288 Free Software Foundation | |
289 | |
290 @item LPF | |
291 League for Programming Freedom | |
292 | |
293 @item GNU | |
294 GNU's Not Unix | |
295 | |
296 @item RMS | |
297 Richard Matthew Stallman | |
298 | |
299 @item FTP | |
300 File Transfer Protocol | |
301 | |
302 @item GPL | |
303 GNU General Public License | |
304 | |
305 @end table | |
306 | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
307 Avoid confusing the FSF and the LPF. The LPF opposes |
84296 | 308 look-and-feel copyrights and software patents. The FSF aims to make |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
309 high quality free software available for everyone. |
84296 | 310 |
311 The word ``free'' in the title of the Free Software Foundation refers to | |
312 ``freedom,'' not ``zero cost.'' Anyone can charge any price for | |
313 GPL-covered software that they want to. However, in practice, the | |
314 freedom enforced by the GPL leads to low prices, because you can always | |
315 get the software for less money from someone else, since everyone has | |
316 the right to resell or give away GPL-covered software. | |
317 | |
318 @c ------------------------------------------------------------ | |
319 @node General questions, Getting help, FAQ notation, Top | |
320 @chapter General questions | |
321 @cindex General questions | |
322 | |
323 This chapter contains general questions having to do with Emacs, the | |
324 Free Software Foundation, and related organizations. | |
325 | |
326 @menu | |
327 * The LPF:: | |
328 * Real meaning of copyleft:: | |
329 * Guidelines for newsgroup postings:: | |
330 * Newsgroup archives:: | |
331 * Reporting bugs:: | |
332 * Unsubscribing from Emacs lists:: | |
333 * Contacting the FSF:: | |
334 @end menu | |
335 | |
336 @node The LPF, Real meaning of copyleft, General questions, General questions | |
337 @section What is the LPF? | |
338 @cindex LPF, description of | |
339 @cindex League for Programming Freedom | |
340 @cindex Software patents, opposition to | |
341 @cindex Patents for software, opposition to | |
342 | |
343 The LPF opposes the expanding danger of software patents and | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
344 look-and-feel copyrights. More information on the LPF's views is |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
345 available at @uref{http://progfree.org/, the LPF home page}. |
84296 | 346 |
347 @node Real meaning of copyleft, Guidelines for newsgroup postings, The LPF, General questions | |
348 @section What is the real legal meaning of the GNU copyleft? | |
349 @cindex Copyleft, real meaning of | |
350 @cindex GPL, real meaning of | |
351 @cindex General Public License, real meaning of | |
352 @cindex Discussion of the GPL | |
353 | |
354 The real legal meaning of the GNU General Public License (copyleft) will | |
355 only be known if and when a judge rules on its validity and scope. | |
356 There has never been a copyright infringement case involving the GPL to | |
357 set any precedents. Please take any discussion regarding this issue to | |
358 the newsgroup @uref{news:gnu.misc.discuss}, which was created to hold the | |
359 extensive flame wars on the subject. | |
360 | |
361 RMS writes: | |
362 | |
363 @quotation | |
364 The legal meaning of the GNU copyleft is less important than the spirit, | |
365 which is that Emacs is a free software project and that work pertaining | |
366 to Emacs should also be free software. ``Free'' means that all users | |
367 have the freedom to study, share, change and improve Emacs. To make | |
368 sure everyone has this freedom, pass along source code when you | |
369 distribute any version of Emacs or a related program, and give the | |
370 recipients the same freedom that you enjoyed. | |
371 @end quotation | |
372 | |
373 @node Guidelines for newsgroup postings, Newsgroup archives, Real meaning of copyleft, General questions | |
374 @section What are appropriate messages for @uref{news:gnu.emacs.help}, @uref{news:gnu.emacs.bug}, @uref{news:comp.emacs}, etc.? | |
375 @cindex Newsgroups, appropriate messages for | |
376 @cindex GNU newsgroups, appropriate messages for | |
377 @cindex Usenet groups, appropriate messages for | |
378 @cindex Mailing lists, appropriate messages for | |
379 @cindex Posting messages to newsgroups | |
380 | |
381 @cindex GNU mailing lists | |
382 The file @file{etc/MAILINGLISTS} describes the purpose of each GNU | |
383 mailing list. (@xref{Informational files for Emacs}, if you want a copy | |
384 of the file.) For those lists which are gatewayed with newsgroups, it | |
385 lists both the newsgroup name and the mailing list address. | |
386 | |
387 The newsgroup @uref{news:comp.emacs} is for discussion of Emacs programs | |
388 in general. This includes Emacs along with various other | |
389 implementations, such as XEmacs, JOVE, MicroEmacs, Freemacs, MG, | |
390 Unipress, CCA, and Epsilon. | |
391 | |
392 Many people post Emacs questions to @uref{news:comp.emacs} because they | |
393 don't receive any of the @code{gnu.*} newsgroups. Arguments have been | |
394 made both for and against posting GNU-Emacs-specific material to | |
395 @uref{news:comp.emacs}. You have to decide for yourself. | |
396 | |
397 Messages advocating ``non-free'' software are considered unacceptable on | |
398 any of the @code{gnu.*} newsgroups except for @uref{news:gnu.misc.discuss}, | |
399 which was created to hold the extensive flame-wars on the subject. | |
400 ``Non-free'' software includes any software for which the end user can't | |
401 freely modify the source code and exchange enhancements. Be careful to | |
402 remove the @code{gnu.*} groups from the @samp{Newsgroups:} line when | |
403 posting a followup that recommends such software. | |
404 | |
405 @uref{news:gnu.emacs.bug} is a place where bug reports appear, but avoid | |
406 posting bug reports to this newsgroup directly (@pxref{Reporting bugs}). | |
407 | |
408 @node Newsgroup archives, Reporting bugs, Guidelines for newsgroup postings, General questions | |
409 @section Where can I get old postings to @uref{news:gnu.emacs.help} and other GNU groups? | |
410 @cindex Archived postings from @code{gnu.emacs.help} | |
411 @cindex Usenet archives for GNU groups | |
412 @cindex Old Usenet postings for GNU groups | |
413 | |
414 The FSF has maintained archives of all of the GNU mailing lists for many | |
415 years, although there may be some unintentional gaps in coverage. The | |
416 archive is not particularly well organized or easy to retrieve | |
417 individual postings from, but pretty much everything is there. | |
418 | |
419 The archive is at @uref{ftp://lists.gnu.org/}. | |
420 | |
421 The archive can be browsed over the web at | |
422 @uref{http://lists.gnu.org/archive/html/, the GNU mail archive}. | |
423 | |
424 Web-based Usenet search services, such as | |
425 @uref{http://groups.google.com/groups/dir?sel=33592484, Google}, also | |
426 archive the @code{gnu.*} groups. | |
427 | |
428 You can read the archives of the @code{gnu.*} groups and post new | |
429 messages at @uref{http://gmane.org/, Gmane}. | |
430 | |
431 @node Reporting bugs, Unsubscribing from Emacs lists, Newsgroup archives, General questions | |
432 @section Where should I report bugs and other problems with Emacs? | |
433 @cindex Bug reporting | |
434 @cindex Good bug reports | |
435 @cindex How to submit a bug report | |
436 @cindex Reporting bugs | |
437 | |
438 The correct way to report Emacs bugs is to use the command | |
439 @kbd{M-x report-emacs-bug}. It sets up a mail buffer with the | |
440 essential information and the correct e-mail address which is | |
441 @email{bug-gnu-emacs@@gnu.org} for the released versions of Emacs. | |
442 Anything sent to @email{bug-gnu-emacs@@gnu.org} also appears in the | |
443 newsgroup @uref{news:gnu.emacs.bug}, but please use e-mail instead of | |
444 news to submit the bug report. This ensures a reliable return address | |
445 so you can be contacted for further details. | |
446 | |
447 Be sure to read the ``Bugs'' section of the Emacs manual before reporting | |
448 a bug! The manual describes in detail how to submit a useful bug | |
449 report (@pxref{Bugs, , Reporting Bugs, emacs, The GNU Emacs Manual}). | |
450 (@xref{On-line manual}, if you don't know how to read the manual.) | |
451 | |
452 RMS says: | |
453 | |
454 @quotation | |
455 Sending bug reports to @email{help-gnu-emacs@@gnu.org} (which has the | |
456 effect of posting on @uref{news:gnu.emacs.help}) is undesirable because | |
457 it takes the time of an unnecessarily large group of people, most of | |
458 whom are just users and have no idea how to fix these problem. | |
459 @email{bug-gnu-emacs@@gnu.org} reaches a much smaller group of people | |
460 who are more likely to know what to do and have expressed a wish to | |
461 receive more messages about Emacs than the others. | |
462 @end quotation | |
463 | |
464 RMS says it is sometimes fine to post to @uref{news:gnu.emacs.help}: | |
465 | |
466 @quotation | |
467 If you have reported a bug and you don't hear about a possible fix, | |
468 then after a suitable delay (such as a week) it is okay to post on | |
469 @code{gnu.emacs.help} asking if anyone can help you. | |
470 @end quotation | |
471 | |
472 If you are unsure whether you have found a bug, consider the following | |
473 non-exhaustive list, courtesy of RMS: | |
474 | |
475 @quotation | |
476 If Emacs crashes, that is a bug. If Emacs gets compilation errors | |
477 while building, that is a bug. If Emacs crashes while building, that | |
478 is a bug. If Lisp code does not do what the documentation says it | |
479 does, that is a bug. | |
480 @end quotation | |
481 | |
482 @node Unsubscribing from Emacs lists, Contacting the FSF, Reporting bugs, General questions | |
483 @section How do I unsubscribe from this mailing list? | |
484 @cindex Unsubscribing from GNU mailing lists | |
485 @cindex Removing yourself from GNU mailing lists | |
486 | |
487 If you are receiving a GNU mailing list named @var{list}, you might be | |
488 able to unsubscribe from it by sending a request to the address | |
489 @email{@var{list}-request@@gnu.org}. However, this will not work if you are | |
490 not listed on the main mailing list, but instead receive the mail from a | |
491 distribution point. In that case, you will have to track down at which | |
492 distribution point you are listed. Inspecting the @samp{Received} headers | |
493 on the mail messages may help, along with liberal use of the @samp{EXPN} or | |
494 @samp{VRFY} sendmail commands through @samp{telnet @var{site-address} | |
495 smtp}. Ask your postmaster for help, if you cannot figure out these | |
496 details. | |
497 | |
498 @node Contacting the FSF, , Unsubscribing from Emacs lists, General questions | |
499 @section What is the current address of the FSF? | |
500 @cindex Snail mail address of the FSF | |
501 @cindex Postal address of the FSF | |
502 @cindex Contracting the FSF | |
503 @cindex Free Software Foundation, contacting | |
504 | |
505 @table @asis | |
506 | |
507 @item E-mail | |
508 gnu@@gnu.org | |
509 | |
510 @item Telephone | |
511 +1-617-542-5942 | |
512 | |
513 @item Fax | |
514 +1-617-542-2652 | |
515 | |
516 @item World Wide Web | |
517 @uref{http://www.gnu.org/} | |
518 | |
519 @item Postal address | |
520 Free Software Foundation@* | |
521 51 Franklin Street, Fifth Floor@* | |
522 Boston, MA 02110-1301@* | |
523 USA@* | |
524 | |
525 @end table | |
526 | |
527 @cindex Ordering GNU software | |
528 For details on how to order items directly from the FSF, see the | |
529 @uref{http://www.gnu.org/order/order.html, GNU Web site}. | |
530 | |
531 @c ------------------------------------------------------------ | |
532 @node Getting help, Status of Emacs, General questions, Top | |
533 @chapter Getting help | |
534 @cindex Getting help | |
535 | |
536 This chapter tells you how to get help with Emacs | |
537 | |
538 @menu | |
539 * Basic editing:: | |
540 * Learning how to do something:: | |
541 * Getting a printed manual:: | |
542 * Emacs Lisp documentation:: | |
543 * Installing Texinfo documentation:: | |
544 * Printing a Texinfo file:: | |
545 * Viewing Info files outside of Emacs:: | |
546 * Informational files for Emacs:: | |
547 * Help installing Emacs:: | |
548 * Obtaining the FAQ:: | |
549 @end menu | |
550 | |
551 @node Basic editing, Learning how to do something, Getting help, Getting help | |
552 @section I'm just starting Emacs; how do I do basic editing? | |
553 @cindex Basic editing with Emacs | |
554 @cindex Beginning editing | |
555 @cindex Tutorial, invoking the | |
556 @cindex Self-paced tutorial, invoking the | |
557 @cindex Help system, entering the | |
558 | |
559 Type @kbd{C-h t} to invoke the self-paced tutorial. Just typing | |
560 @kbd{C-h} enters the help system. Starting with Emacs 22, the tutorial | |
561 is available in many foreign languages such as French, German, Japanese, | |
562 Russian, etc. Use @kbd{M-x help-with-tutorial-spec-language @key{RET}} | |
563 to choose your language and start the tutorial. | |
564 | |
565 Your system administrator may have changed @kbd{C-h} to act like | |
566 @key{DEL} to deal with local keyboards. You can use @kbd{M-x | |
567 help-for-help} instead to invoke help. To discover what key (if any) | |
568 invokes help on your system, type @kbd{M-x where-is @key{RET} | |
569 help-for-help @key{RET}}. This will print a comma-separated list of key | |
570 sequences in the echo area. Ignore the last character in each key | |
571 sequence listed. Each of the resulting key sequences invokes help. | |
572 | |
573 Emacs help works best if it is invoked by a single key whose value | |
574 should be stored in the variable @code{help-char}. | |
575 | |
576 @node Learning how to do something, Getting a printed manual, Basic editing, Getting help | |
577 @section How do I find out how to do something in Emacs? | |
578 @cindex Help for Emacs | |
579 @cindex Learning to do something in Emacs | |
580 @cindex Reference card for Emacs | |
581 @cindex Overview of help systems | |
582 | |
583 There are several methods for finding out how to do things in Emacs. | |
584 | |
585 @itemize @bullet | |
586 | |
587 @cindex Reading the Emacs manual | |
588 @item | |
589 The complete text of the Emacs manual is available on-line via the Info | |
590 hypertext reader. Type @kbd{C-h r} to display the manual in Info mode. | |
591 Typing @key{h} immediately after entering Info will provide a short | |
592 tutorial on how to use it. | |
593 | |
594 @cindex Lookup a subject in a manual | |
595 @cindex Index search in a manual | |
596 @item | |
597 To quickly locate the section of the manual which discusses a certain | |
598 issue, or describes a command or a variable, type @kbd{C-h i m emacs | |
599 @key{RET} i @var{topic} @key{RET}}, where @var{topic} is the name of the | |
600 topic, the command, or the variable which you are looking for. If this | |
601 does not land you on the right place in the manual, press @kbd{,} | |
602 (comma) repeatedly until you find what you need. (The @kbd{i} and | |
603 @kbd{,} keys invoke the index-searching functions, which look for the | |
604 @var{topic} you type in all the indices of the Emacs manual.) | |
605 | |
606 @cindex Apropos | |
607 @item | |
608 You can list all of the commands whose names contain a certain word | |
609 (actually which match a regular expression) using @kbd{C-h a} (@kbd{M-x | |
610 command-apropos}). | |
611 | |
612 @cindex Command description in the manual | |
613 @item | |
614 The command @kbd{C-h F} (@code{Info-goto-emacs-command-node}) prompts | |
615 for the name of a command, and then attempts to find the section in the | |
616 Emacs manual where that command is described. | |
617 | |
618 @cindex Finding commands and variables | |
619 @item | |
620 You can list all of the functions and variables whose names contain a | |
621 certain word using @kbd{M-x apropos}. | |
622 | |
623 @item | |
624 You can list all of the functions and variables whose documentation | |
625 matches a regular expression or a string, using @kbd{M-x | |
626 apropos-documentation}. | |
627 | |
628 @item | |
629 You can order a hardcopy of the manual from the FSF. @xref{Getting a | |
630 printed manual}. | |
631 | |
632 @cindex Reference cards, in other languages | |
633 @item | |
634 You can get a printed reference card listing commands and keys to | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
635 invoke them. You can order one from the FSF for $2 (or 10 for $18), |
84296 | 636 or you can print your own from the @file{etc/refcards/refcard.tex} or |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
637 @file{etc/refcards/refcard.pdf} files in the Emacs distribution. |
84296 | 638 Beginning with version 21.1, the Emacs distribution comes with |
639 translations of the reference card into several languages; look for | |
640 files named @file{etc/refcards/@var{lang}-refcard.*}, where @var{lang} | |
641 is a two-letter code of the language. For example, the German version | |
642 of the reference card is in the files @file{etc/refcards/de-refcard.tex} | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
643 and @file{etc/recards/de-refcard.pdf}. |
84296 | 644 |
645 @item | |
646 There are many other commands in Emacs for getting help and | |
647 information. To get a list of these commands, type @samp{?} after | |
648 @kbd{C-h}. | |
649 | |
650 @end itemize | |
651 | |
652 @node Getting a printed manual, Emacs Lisp documentation, Learning how to do something, Getting help | |
653 @section How do I get a printed copy of the Emacs manual? | |
654 @cindex Printed Emacs manual, obtaining | |
655 @cindex Manual, obtaining a printed or HTML copy of | |
656 @cindex Emacs manual, obtaining a printed or HTML copy of | |
657 | |
658 You can order a printed copy of the Emacs manual from the FSF. For | |
659 details see the @uref{http://www.gnu.org/order/order.html, GNU Web site}. | |
660 | |
661 @c The number 620 below is version-dependent! | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
662 The full Texinfo source for the manual also comes in the @file{doc/emacs} |
84296 | 663 directory of the Emacs distribution, if you're daring enough to try to |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
664 print out this several-hundred-page manual yourself (@pxref{Printing a Texinfo |
84296 | 665 file}). |
666 | |
667 If you absolutely have to print your own copy, and you don't have @TeX{}, | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
668 you can get a PostScript or PDF (or HTML) version from |
84296 | 669 |
670 @uref{http://www.gnu.org/software/emacs/manual/} | |
671 | |
672 @xref{Learning how to do something}, for how to view the manual on-line. | |
673 | |
674 @node Emacs Lisp documentation, Installing Texinfo documentation, Getting a printed manual, Getting help | |
675 @section Where can I get documentation on Emacs Lisp? | |
676 @cindex Documentation on Emacs Lisp | |
677 @cindex Function documentation | |
678 @cindex Variable documentation | |
679 @cindex Emacs Lisp Reference Manual | |
680 @cindex Reference manual for Emacs Lisp | |
681 | |
682 Within Emacs, you can type @kbd{C-h f} to get the documentation for a | |
683 function, @kbd{C-h v} for a variable. | |
684 | |
685 For more information, the Emacs Lisp Reference Manual is available | |
686 on-line, in Info format. @xref{Top, Emacs Lisp,, elisp, The | |
687 Emacs Lisp Reference Manual}. | |
688 | |
689 You can also order a hardcopy of the manual, details on ordering it from | |
690 FSF are on the @uref{http://www.gnu.org/order/order.html, GNU Web site}. | |
691 | |
692 An HTML version of the Emacs Lisp Reference Manual is available at | |
693 | |
694 @uref{http://www.gnu.org/software/emacs/elisp-manual/elisp.html} | |
695 | |
696 @node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help | |
697 @section How do I install a piece of Texinfo documentation? | |
698 @cindex Texinfo documentation, installing | |
699 @cindex Installing Texinfo documentation | |
700 @cindex New Texinfo files, installing | |
701 @cindex Documentation, installing new Texinfo files | |
702 @cindex Info files, how to install | |
703 | |
704 First, you must turn the Texinfo files into Info files. You may do this | |
705 using the stand-alone @file{makeinfo} program, available as part of the latest | |
706 Texinfo package at | |
707 | |
708 @uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.8.tar.gz} | |
709 | |
710 and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU | |
711 distributions}). | |
712 | |
713 For information about the Texinfo format, read the Texinfo manual which | |
714 comes with the Texinfo package. This manual also comes installed in | |
715 Info format, so you can read it on-line; type @kbd{C-h i m texinfo | |
716 @key{RET}}. | |
717 | |
718 Alternatively, you could use the Emacs command @kbd{M-x | |
719 texinfo-format-buffer}, after visiting the Texinfo source file of the | |
720 manual you want to convert. | |
721 | |
722 Neither @code{texinfo-format-buffer} nor @file{makeinfo} installs the | |
723 resulting Info files in Emacs's Info tree. To install Info files, | |
724 perform these steps: | |
725 | |
726 @enumerate | |
727 @item | |
728 Move the files to the @file{info} directory in the installed Emacs | |
729 distribution. @xref{File-name conventions}, if you don't know where that | |
730 is. | |
731 | |
732 @item | |
733 Run the @code{install-info} command, which is part of the Texinfo | |
734 distribution, to update the main Info directory menu, like this: | |
735 | |
736 @example | |
737 install-info --info-dir=@var{dir-path} @var{dir-path}/@var{file} | |
738 @end example | |
739 | |
740 @noindent | |
741 where @var{dir-path} is the full path to the directory where you copied | |
742 the produced Info file(s), and @var{file} is the name of the Info file | |
743 you produced and want to install. | |
744 | |
745 If you don't have the @code{install-info} command installed, you can | |
746 edit the file @file{info/dir} in the installed Emacs distribution, and | |
747 add a line for the top level node in the Info package that you are | |
748 installing. Follow the examples already in this file. The format is: | |
749 | |
750 @example | |
751 * Topic: (relative-pathname). Short description of topic. | |
752 @end example | |
753 | |
754 @end enumerate | |
755 | |
756 If you want to install Info files and you don't have the necessary | |
757 privileges, you have several options: | |
758 | |
759 @itemize @bullet | |
760 @item | |
761 Info files don't actually need to be installed before being used. | |
762 You can use a prefix argument for the @code{info} command and specify | |
763 the name of the Info file in the minibuffer. This goes to the node | |
764 named @samp{Top} in that file. For example, to view a Info file named | |
765 @file{@var{info-file}} in your home directory, you can type this: | |
766 | |
767 @example | |
768 @kbd{C-u C-h i ~/@var{info-file} @key{RET}} | |
769 @end example | |
770 | |
771 Alternatively, you can feed a file name to the @code{Info-goto-node} | |
772 command (invoked by pressing @key{g} in Info mode) by typing the name | |
773 of the file in parentheses, like this: | |
774 | |
775 @example | |
776 @kbd{C-h i g (~/@var{info-file}) @key{RET}} | |
777 @end example | |
778 | |
779 @item | |
780 You can create your own Info directory. You can tell Emacs where that | |
781 Info directory is by adding its pathname to the value of the variable | |
782 @code{Info-default-directory-list}. For example, to use a private Info | |
783 directory which is a subdirectory of your home directory named @file{Info}, | |
784 you could put this in your @file{.emacs} file: | |
785 | |
786 @lisp | |
787 (setq Info-default-directory-list | |
788 (cons "~/Info" Info-default-directory-list)) | |
789 @end lisp | |
790 | |
791 You will need a top-level Info file named @file{dir} in this directory | |
792 which has everything the system @file{dir} file has in it, except it should | |
793 list only entries for Info files in that directory. You might not need | |
794 it if all files in this directory were referenced by other @file{dir} | |
795 files. The node lists from all @file{dir} files in | |
796 @code{Info-default-directory-list} are merged by the Info system. | |
797 | |
798 @end itemize | |
799 | |
800 @node Printing a Texinfo file, Viewing Info files outside of Emacs, Installing Texinfo documentation, Getting help | |
801 @section How do I print a Texinfo file? | |
802 @cindex Printing a Texinfo file | |
803 @cindex Texinfo file, printing | |
804 @cindex Printing documentation | |
805 | |
806 You can't get nicely printed output from Info files; you must still have | |
807 the original Texinfo source file for the manual you want to print. | |
808 | |
809 Assuming you have @TeX{} installed on your system, follow these steps: | |
810 | |
811 @enumerate | |
812 | |
813 @item | |
814 Make sure the first line of the Texinfo file looks like this: | |
815 | |
816 @example | |
817 \input texinfo | |
818 @end example | |
819 | |
820 You may need to change @samp{texinfo} to the full pathname of the | |
821 @file{texinfo.tex} file, which comes with Emacs as | |
84329
3d431f1997d8
(setfilename): Go up one more level to ../../info.
Glenn Morris <rgm@gnu.org>
parents:
84296
diff
changeset
|
822 @file{doc/misc/texinfo.tex} (or copy or link it into the current directory). |
84296 | 823 |
824 @item | |
825 Type @kbd{texi2dvi @var{texinfo-source}}, where @var{texinfo-source} is | |
826 the name of the Texinfo source file for which you want to produce a | |
827 printed copy. | |
828 | |
829 The @samp{texi2dvi} script is part of the GNU Texinfo distribution | |
830 (@pxref{Installing Texinfo documentation}). | |
831 | |
832 @item | |
833 Print the DVI file @file{@var{texinfo-source}.dvi} in the normal way for | |
834 printing DVI files at your site. For example, if you have a PostScript | |
835 printer, run the @code{dvips} program to print the DVI file on that | |
836 printer. | |
837 | |
838 @end enumerate | |
839 | |
840 To get more general instructions, retrieve the latest Texinfo package | |
841 (@pxref{Installing Texinfo documentation}). | |
842 | |
843 @node Viewing Info files outside of Emacs, Informational files for Emacs, Printing a Texinfo file, Getting help | |
844 @section Can I view Info files without using Emacs? | |
845 @cindex Viewing Info files | |
846 @cindex Info file viewers | |
847 @cindex Alternative Info file viewers | |
848 | |
849 Yes. Here are some alternative programs: | |
850 | |
851 @itemize @bullet | |
852 | |
853 @item | |
854 @code{info}, a stand-alone version of the Info program, comes as part of | |
855 the Texinfo package. @xref{Installing Texinfo documentation}, for | |
856 details. | |
857 | |
858 @item | |
859 Xinfo, a stand-alone version of the Info program that runs under X | |
860 Window system. You can get it at | |
861 @uref{ftp://ftp.gnu.org/pub/gnu/xinfo/xinfo-1.01.01.tar.gz} and all | |
862 mirrors of @samp{ftp.gnu.org} (see @ref{Current GNU distributions}, for a | |
863 list of mirrors). | |
864 | |
865 @item | |
866 Tkinfo, an Info viewer that runs under X Window system and uses Tcl/Tk. | |
867 You can get Tkinfo at | |
868 @uref{http://math-www.uni-paderborn.de/~axel/tkinfo/}. | |
869 | |
870 @end itemize | |
871 | |
872 @node Informational files for Emacs, Help installing Emacs, Viewing Info files outside of Emacs, Getting help | |
873 @section What informational files are available for Emacs? | |
874 @cindex Informational files included with Emacs | |
875 @cindex Files included with Emacs | |
876 @cindex @file{COPYING}, description of file | |
877 @cindex @file{DISTRIB}, description of file | |
878 @cindex @file{FTP}, description of file | |
879 @cindex @file{GNU}, description of file | |
880 @cindex @file{INTERVIEW}, description of file | |
881 @cindex @file{MACHINES}, description of file | |
882 @cindex @file{MAILINGLISTS}, description of file | |
883 @cindex @file{NEWS}, description of file | |
884 @cindex @file{SERVICE}, description of file | |
885 | |
886 This isn't a frequently asked question, but it should be! A variety of | |
887 informational files about Emacs and relevant aspects of the GNU project | |
888 are available for you to read. | |
889 | |
890 The following files are available in the @file{etc} directory of the | |
891 Emacs distribution (see @ref{File-name conventions}, if you're not sure | |
892 where that is). | |
893 | |
894 @table @file | |
895 | |
896 @item COPYING | |
897 GNU General Public License | |
898 | |
899 @item DISTRIB | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
900 Emacs Availability Information |
84296 | 901 |
902 @item FTP | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
903 How to get GNU Software by Internet FTP |
84296 | 904 |
905 @item GNU | |
906 The GNU Manifesto | |
907 | |
908 @item INTERVIEW | |
909 Richard Stallman discusses his public-domain UNIX-compatible software | |
910 system with BYTE editors | |
911 | |
912 @item MACHINES | |
913 Status of Emacs on Various Machines and Systems | |
914 | |
915 @item MAILINGLISTS | |
916 GNU Project Electronic Mailing Lists | |
917 | |
918 @item NEWS | |
919 Emacs news, a history of recent user-visible changes | |
920 | |
921 @item SERVICE | |
922 GNU Service Directory | |
923 | |
924 @end table | |
925 | |
926 More GNU information, including back issues of the @cite{GNU's | |
927 Bulletin}, are at | |
928 | |
929 @uref{http://www.gnu.org/bulletins/bulletins.html} and | |
930 | |
931 @uref{http://www.cs.pdx.edu/~trent/gnu/gnu.html} | |
932 | |
933 @node Help installing Emacs, Obtaining the FAQ, Informational files for Emacs, Getting help | |
934 @section Where can I get help in installing Emacs? | |
935 @cindex Installation help | |
936 @cindex Help installing Emacs | |
937 | |
938 @xref{Installing Emacs}, for some basic installation hints, and see | |
939 @ref{Problems building Emacs}, or @ref{Linking with -lX11 fails}, if you | |
940 have problems with the installation. | |
941 | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
942 The web-page @uref{http://www.fsf.org/resources/service/} lists |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
943 companies and individuals willing to sell you help in installing or |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
944 using Emacs. |
84296 | 945 |
946 @node Obtaining the FAQ, , Help installing Emacs, Getting help | |
947 @section Where can I get the latest version of this FAQ? | |
948 @cindex FAQ, obtaining the | |
949 @cindex Latest FAQ version, obtaining the | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
950 |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
951 The Emacs FAQ is distributed with Emacs in Info format. You can read it |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
952 by selecting the @samp{Emacs FAQ} option from the @samp{Help} menu of |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
953 the Emacs menu bar at the top of any Emacs frame, or by typing @kbd{C-h |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
954 C-f} (@kbd{M-x view-emacs-FAQ}). |
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
955 |
84296 | 956 |
957 @c ------------------------------------------------------------ | |
958 @node Status of Emacs, Common requests, Getting help, Top | |
959 @chapter Status of Emacs | |
960 @cindex Status of Emacs | |
961 | |
962 This chapter gives you basic information about Emacs, including its | |
963 latest version status. | |
964 | |
965 @menu | |
966 * Origin of the term Emacs:: | |
967 * Latest version of Emacs:: | |
968 * New in Emacs 20:: | |
969 * New in Emacs 21:: | |
970 * New in Emacs 22:: | |
971 @end menu | |
972 | |
973 @node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs | |
974 @section Where does the name ``Emacs'' come from? | |
975 @cindex Origin of the term ``Emacs'' | |
976 @cindex Emacs name origin | |
977 @cindex TECO | |
978 @cindex Original version of Emacs | |
979 | |
980 Emacs originally was an acronym for Editor MACroS. RMS says he ``picked | |
981 the name Emacs because @key{E} was not in use as an abbreviation on ITS at | |
982 the time.'' The first Emacs was a set of macros written in 1976 at MIT | |
983 by RMS for the editor TECO (Text Editor and COrrector, originally Tape | |
984 Editor and COrrector) under ITS on a PDP-10. RMS had already extended | |
985 TECO with a ``real-time'' full-screen mode with reprogrammable keys. | |
986 Emacs was started by @email{gls@@east.sun.com, Guy Steele} as a project | |
987 to unify the many divergent TECO command sets and key bindings at MIT, | |
988 and completed by RMS. | |
989 | |
990 Many people have said that TECO code looks a lot like line noise; you | |
991 can read more at @uref{news:alt.lang.teco}. Someone has written a TECO | |
992 implementation in Emacs Lisp (to find it, see @ref{Packages that do not | |
993 come with Emacs}); it would be an interesting project to run the | |
994 original TECO Emacs inside of Emacs. | |
995 | |
996 @cindex Why Emacs? | |
997 For some not-so-serious alternative reasons for Emacs to have that | |
998 name, check out the file @file{etc/JOKES} (@pxref{File-name | |
999 conventions}). | |
1000 | |
1001 @node Latest version of Emacs, New in Emacs 20, Origin of the term Emacs, Status of Emacs | |
1002 @section What is the latest version of Emacs? | |
1003 @cindex Version, latest | |
1004 @cindex Latest version of Emacs | |
1005 | |
1006 Emacs @value{VER} is the current version as of this writing. | |
1007 | |
1008 @node New in Emacs 20, New in Emacs 21, Latest version of Emacs, Status of Emacs | |
1009 @section What is different about Emacs 20? | |
1010 @cindex Differences between Emacs 19 and Emacs 20 | |
1011 @cindex Emacs 20, new features in | |
1012 | |
1013 To find out what has changed in recent versions, type @kbd{C-h C-n} | |
1014 (@kbd{M-x view-emacs-news}). The oldest changes are at the bottom of | |
1015 the file, so you might want to read it starting there, rather than at | |
1016 the top. | |
1017 | |
1018 The differences between Emacs versions 18 and 19 was rather dramatic; | |
1019 the introduction of frames, faces, and colors on windowing systems was | |
1020 obvious to even the most casual user. | |
1021 | |
1022 There are differences between Emacs versions 19 and 20 as well, but many | |
1023 are more subtle or harder to find. Among the changes are the inclusion | |
1024 of MULE code for languages that use non-Latin characters and for mixing | |
1025 several languages in the same document; the ``Customize'' facility for | |
1026 modifying variables without having to use Lisp; and automatic conversion | |
1027 of files from Macintosh, Microsoft, and Unix platforms. | |
1028 | |
1029 A number of older Lisp packages, such as Gnus, Supercite and the | |
1030 calendar/diary, have been updated and enhanced to work with Emacs 20, | |
1031 and are now included with the standard distribution. | |
1032 | |
1033 | |
1034 @node New in Emacs 21, New in Emacs 22, New in Emacs 20, Status of Emacs | |
1035 @section What is different about Emacs 21? | |
1036 @cindex Differences between Emacs 20 and Emacs 21 | |
1037 @cindex Emacs 21, new features in | |
1038 @cindex Recently introduced features | |
1039 | |
1040 @cindex Variable-size fonts | |
1041 @cindex Toolbar support | |
1042 Emacs 21 features a thorough rewrite of the display engine. The new | |
1043 display engine supports variable-size fonts, images, and can play sounds | |
1044 on platforms which support that. As a result, the visual appearance of | |
1045 Emacs, when it runs on a windowed display, is much more reminiscent of | |
1046 modern GUI programs, and includes 3D widgets (used for the mode line and | |
1047 the scroll bars), a configurable and extensible toolbar, tooltips | |
1048 (a.k.a.@: balloon help), and other niceties. | |
1049 | |
1050 @cindex Colors on text-only terminals | |
1051 @cindex TTY colors | |
1052 In addition, Emacs 21 supports faces on text-only terminals. This means | |
1053 that you can now have colors when you run Emacs on a GNU/Linux console | |
1054 and on @code{xterm} with @kbd{emacs -nw}. | |
1055 | |
1056 @node New in Emacs 22, , New in Emacs 21, Status of Emacs | |
1057 @section What is different about Emacs 22? | |
1058 @cindex Differences between Emacs 21 and Emacs 22 | |
1059 @cindex Emacs 22, new features in | |
1060 @cindex Recently introduced features | |
1061 @cindex Default features | |
1062 | |
1063 @itemize | |
1064 @cindex GTK+ Toolkit | |
1065 @cindex Drag-and-drop | |
1066 @item | |
1067 Emacs can be built with GTK+ widgets, and supports drag-and-drop | |
1068 operation on X. | |
1069 | |
1070 @cindex Supported systems | |
1071 @item | |
1072 Emacs 22 features support for GNU/Linux systems on S390 and x86-64 | |
1073 machines, as well as support for the Mac OS X and Cygwin operating | |
1074 systems. | |
1075 | |
1076 @item | |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95940
diff
changeset
|
1077 The native MS-Windows, and Mac OS X builds include full support |
84296 | 1078 for images, toolbar, and tooltips. |
1079 | |
1080 @item | |
1081 Font Lock mode, Auto Compression mode, and File Name Shadow Mode are | |
1082 enabled by default. | |
1083 | |
1084 @item | |
1085 The maximum size of buffers has been doubled and is 256M on 32-bit | |
1086 machines. | |
1087 | |
1088 @item | |
1089 Links can be followed with @kbd{mouse-1}, in addition to @kbd{mouse-2}. | |
1090 | |
1091 @cindex Mouse wheel | |
1092 @item | |
1093 Mouse wheel support is enabled by default. | |
1094 | |
1095 @item | |
1096 Window fringes are customizable. | |
1097 | |
1098 @item | |
1099 The mode line of the selected window is now highlighted. | |
1100 | |
1101 @item | |
1102 The minibuffer prompt is displayed in a distinct face. | |
1103 | |
1104 @item | |
1105 Abbrev definitions are read automatically at startup. | |
1106 | |
1107 @item | |
1108 Grep mode is separate from Compilation mode and has many new options and | |
1109 commands specific to grep. | |
1110 | |
1111 @item | |
1112 The original Emacs macro system has been replaced by the new Kmacro | |
1113 package, which provides many new commands and features and a simple | |
1114 interface that uses the function keys F3 and F4. Macros are stored in a | |
1115 macro ring, and can be debugged and edited interactively. | |
1116 | |
1117 @item | |
1118 The Grand Unified Debugger (GUD) can be used with a full graphical user | |
1119 interface to GDB; this provides many features found in traditional | |
1120 development environments, making it easy to manipulate breakpoints, add | |
1121 watch points, display the call stack, etc. Breakpoints are visually | |
1122 indicated in the source buffer. | |
1123 | |
1124 @item | |
1125 @cindex New modes | |
1126 Many new modes and packages have been included in Emacs, such as Calc, | |
1127 TRAMP, URL, IDO, CUA, ERC, rcirc, Table, Image-Dired, SES, Ruler, Org, | |
1128 PGG, Flymake, Password, Printing, Reveal, wdired, t-mouse, longlines, | |
1129 savehist, Conf mode, Python mode, DNS mode, etc. | |
1130 | |
1131 @cindex Multilingual Environment | |
1132 @item | |
1133 Leim is now part of Emacs. Unicode support has been much improved, and | |
1134 the following input methods have been added: belarusian, bulgarian-bds, | |
1135 bulgarian-phonetic, chinese-sisheng, croatian, dutch, georgian, | |
1136 latin-alt-postfix, latin-postfix, latin-prefix, latvian-keyboard, | |
1137 lithuanian-numeric, lithuanian-keyboard, malayalam-inscript, rfc1345, | |
1138 russian-computer, sgml, slovenian, tamil-inscript, ucs, | |
1139 ukrainian-computer, vietnamese-telex, and welsh. | |
1140 | |
1141 The following language environments have also been added: Belarusian, | |
1142 Bulgarian, Chinese-EUC-TW, Croatian, French, Georgian, Italian, Latin-6, | |
1143 Latin-7, Latvian, Lithuanian, Malayalam, Russian, Slovenian, Swedish, | |
1144 Tajik, Tamil, UTF-8, Ukrainian, Welsh, and Windows-1255. | |
1145 | |
1146 @cindex Documentation | |
1147 @cindex Emacs Lisp Manual | |
1148 @item | |
1149 In addition, Emacs 22 now includes the Emacs Lisp Reference Manual | |
1150 (@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro. | |
1151 @end itemize | |
1152 | |
1153 Many other changes have been made in Emacs 22, use @kbd{C-h n} to get a | |
1154 full list. | |
1155 | |
1156 @c ------------------------------------------------------------ | |
1157 @node Common requests, Bugs and problems, Status of Emacs, Top | |
1158 @chapter Common requests | |
1159 @cindex Common requests | |
1160 | |
1161 @menu | |
1162 * Setting up a customization file:: | |
1163 * Using Customize:: | |
1164 * Colors on a TTY:: | |
1165 * Debugging a customization file:: | |
1166 * Displaying the current line or column:: | |
1167 * Displaying the current file name in the titlebar:: | |
1168 * Turning on abbrevs by default:: | |
1169 * Associating modes with files:: | |
1170 * Highlighting a region:: | |
1171 * Replacing highlighted text:: | |
1172 * Controlling case sensitivity:: | |
1173 * Working with unprintable characters:: | |
1174 * Searching for/replacing newlines:: | |
1175 * Yanking text in isearch:: | |
1176 * Wrapping words automatically:: | |
1177 * Turning on auto-fill by default:: | |
1178 * Spell-checkers:: | |
1179 * Checking TeX and *roff documents:: | |
1180 * Changing load-path:: | |
1181 * Using an already running Emacs process:: | |
1182 * Compiler error messages:: | |
1183 * Indenting switch statements:: | |
1184 * Customizing C and C++ indentation:: | |
1185 * Horizontal scrolling:: | |
1186 * Overwrite mode:: | |
1187 * Turning off beeping:: | |
1188 * Turning the volume down:: | |
1189 * Automatic indentation:: | |
1190 * Matching parentheses:: | |
1191 * Hiding #ifdef lines:: | |
1192 * Repeating commands:: | |
1193 * Valid X resources:: | |
1194 * Evaluating Emacs Lisp code:: | |
1195 * Changing the length of a Tab:: | |
1196 * Inserting text at the beginning of each line:: | |
1197 * Underlining paragraphs:: | |
1198 * Forcing the cursor to remain in the same column:: | |
1199 * Forcing Emacs to iconify itself:: | |
1200 * Using regular expressions:: | |
1201 * Replacing text across multiple files:: | |
1202 * Documentation for etags:: | |
1203 * Disabling backups:: | |
1204 * Disabling auto-save-mode:: | |
1205 * Going to a line by number:: | |
1206 * Modifying pull-down menus:: | |
1207 * Deleting menus and menu options:: | |
1208 * Turning on syntax highlighting:: | |
1209 * Scrolling only one line:: | |
1210 * Editing MS-DOS files:: | |
1211 * Filling paragraphs with a single space:: | |
1212 * Escape sequences in shell output:: | |
1213 * Fullscreen mode on MS-Windows:: | |
1214 @end menu | |
1215 | |
1216 @node Setting up a customization file, Using Customize, Common requests, Common requests | |
1217 @section How do I set up a @file{.emacs} file properly? | |
1218 @cindex @file{.emacs} file, setting up | |
1219 @cindex @file{.emacs} file, locating | |
1220 @cindex Init file, setting up | |
1221 @cindex Customization file, setting up | |
1222 | |
1223 @inforef{Init File, Init File, emacs}. | |
1224 | |
1225 In general, new Emacs users should not have @file{.emacs} files, because | |
1226 it causes confusing non-standard behavior. Then they send questions to | |
1227 @email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as | |
1228 documented. | |
1229 | |
1230 Beginning with version 20.1, Emacs includes the new Customize facility | |
1231 (@pxref{Using Customize}). This allows users who are unfamiliar with | |
1232 Emacs Lisp to modify their @file{.emacs} files in a relatively | |
1233 straightforward way, using menus rather than Lisp code. Most packages | |
1234 support Customize as of this writing. | |
1235 | |
1236 While Customize might indeed make it easier to configure Emacs, | |
1237 consider taking a bit of time to learn Emacs Lisp and modifying your | |
1238 @file{.emacs} directly. Simple configuration options are described | |
1239 rather completely in @inforef{Init File, Init File, emacs}, for users | |
1240 interested in performing frequently requested, basic tasks. | |
1241 | |
1242 Sometimes users are unsure as to where their @file{.emacs} file should | |
1243 be found. Visiting the file as @file{~/.emacs} from Emacs will find | |
1244 the correct file. | |
1245 | |
1246 @node Using Customize, Colors on a TTY, Setting up a customization file, Common requests | |
1247 @section How do I start using Customize? | |
1248 @cindex Customize groups | |
1249 @cindex Customizing variables | |
1250 @cindex Customizing faces | |
1251 | |
1252 The main Customize entry point is @kbd{M-x customize @key{RET}}. This | |
1253 command takes you to a buffer listing all the available Customize | |
1254 groups. From there, you can access all customizable options and faces, | |
1255 change their values, and save your changes to your init file. | |
1256 @inforef{Easy Customization, Easy Customization, emacs}. | |
1257 | |
1258 If you know the name of the group in advance (e.g. ``shell''), use | |
1259 @kbd{M-x customize-group @key{RET}}. | |
1260 | |
1261 If you wish to customize a single option, use @kbd{M-x customize-option | |
1262 @key{RET}}. This command prompts you for the name of the option to | |
1263 customize, with completion. | |
1264 | |
1265 @node Colors on a TTY, Debugging a customization file, Using Customize, Common requests | |
1266 @section How do I get colors and syntax highlighting on a TTY? | |
1267 @cindex Colors on a TTY | |
1268 @cindex Syntax highlighting on a TTY | |
1269 @cindex Console, colors | |
1270 | |
1271 In Emacs 21.1 and later, colors and faces are supported in non-windowed mode, | |
1272 i.e.@: on Unix and GNU/Linux text-only terminals and consoles, and when | |
97043
9592c50233ab
Remove support for Mac Carbon.
Dan Nicolaescu <dann@ics.uci.edu>
parents:
95940
diff
changeset
|
1273 invoked as @samp{emacs -nw} on X, and MS-Windows. (Colors and faces were |
84296 | 1274 supported in the MS-DOS port since Emacs 19.29.) Emacs automatically |
1275 detects color support at startup and uses it if available. If you think | |
1276 that your terminal supports colors, but Emacs won't use them, check the | |
1277 @code{termcap} entry for your display type for color-related | |
1278 capabilities. | |
1279 | |
1280 The command @kbd{M-x list-colors-display} pops up a window which | |
1281 exhibits all the colors Emacs knows about on the current display. | |
1282 | |
1283 Syntax highlighting is on by default since version 22.1. | |
1284 | |
1285 @node Debugging a customization file, Displaying the current line or column, Colors on a TTY, Common requests | |
1286 @section How do I debug a @file{.emacs} file? | |
1287 @cindex Debugging @file{.emacs} file | |
1288 @cindex @file{.emacs} debugging | |
1289 @cindex Init file debugging | |
1290 @cindex @samp{-debug-init} option | |
1291 | |
1292 Start Emacs with the @samp{-debug-init} command-line option. This | |
1293 enables the Emacs Lisp debugger before evaluating your @file{.emacs} | |
1294 file, and places you in the debugger if something goes wrong. The top | |
1295 line in the @file{trace-back} buffer will be the error message, and the | |
1296 second or third line of that buffer will display the Lisp code from your | |
1297 @file{.emacs} file that caused the problem. | |
1298 | |
1299 You can also evaluate an individual function or argument to a function | |
1300 in your @file{.emacs} file by moving the cursor to the end of the | |
1301 function or argument and typing @kbd{C-x C-e} (@kbd{M-x | |
1302 eval-last-sexp}). | |
1303 | |
1304 Use @kbd{C-h v} (@kbd{M-x describe-variable}) to check the value of | |
1305 variables which you are trying to set or use. | |
1306 | |
1307 @node Displaying the current line or column, Displaying the current file name in the titlebar, Debugging a customization file, Common requests | |
1308 @section How do I make Emacs display the current line (or column) number? | |
1309 @cindex @code{line-number-mode} | |
1310 @cindex Displaying the current line or column | |
1311 @cindex Line number, displaying the current | |
1312 @cindex Column, displaying the current | |
1313 @cindex @code{mode-line-format} | |
1314 | |
1315 To have Emacs automatically display the current line number of the point | |
1316 in the mode line, do @kbd{M-x line-number-mode}. You can also put the | |
1317 form | |
1318 | |
1319 @lisp | |
1320 (setq line-number-mode t) | |
1321 @end lisp | |
1322 | |
1323 @noindent | |
1324 in your @file{.emacs} file to achieve this whenever you start Emacs. | |
1325 (Line number display is on by default, unless your site-specific | |
1326 initialization disables it.) Note that Emacs will not display the line | |
1327 number if the buffer's size in bytes is larger than the value of the | |
1328 variable @code{line-number-display-limit}. | |
1329 | |
1330 You can similarly display the current column with | |
1331 @kbd{M-x column-number-mode}, or by putting the form | |
1332 | |
1333 @lisp | |
1334 (setq column-number-mode t) | |
1335 @end lisp | |
1336 | |
1337 @noindent | |
1338 in your @file{.emacs} file. | |
1339 | |
1340 The @code{"%c"} format specifier in the variable @code{mode-line-format} | |
1341 will insert the current column's value into the mode line. See the | |
1342 documentation for @code{mode-line-format} (using @kbd{C-h v | |
1343 mode-line-format @key{RET}}) for more information on how to set and use | |
1344 this variable. | |
1345 | |
1346 Users of all Emacs versions can display the current column using the | |
1347 @samp{column} package written by @email{abraham@@dina.kvl.dk, Per | |
1348 Abrahamsen}. @xref{Packages that do not come with Emacs}, for | |
1349 instructions on how to get it. | |
1350 | |
1351 @cindex Set number capability in @code{vi} emulators | |
1352 None of the @code{vi} emulation modes provide the ``set number'' | |
1353 capability of @code{vi} (as far as we know). The @samp{setnu} package | |
1354 written by @email{kyle@@wonderworks.com, Kyle Jones} provides this | |
1355 feature. So too does @samp{wb-line-number}, written by | |
1356 @email{naoki.y.nakamura@@nifty.com, Naoki Nakamura}. | |
1357 | |
1358 @node Displaying the current file name in the titlebar, Turning on abbrevs by default, Displaying the current line or column, Common requests | |
1359 @section How can I modify the titlebar to contain the current file name? | |
1360 @cindex Titlebar, displaying the current file name in | |
1361 @cindex File name, displaying in the titlebar | |
1362 @cindex @code{frame-title-format} | |
1363 | |
1364 The contents of an Emacs frame's titlebar is controlled by the variable | |
1365 @code{frame-title-format}, which has the same structure as the variable | |
1366 @code{mode-line-format}. (Use @kbd{C-h v} or @kbd{M-x | |
1367 describe-variable} to get information about one or both of these | |
1368 variables.) | |
1369 | |
1370 By default, the titlebar for a frame does contain the name of the buffer | |
1371 currently being visited, except if there is a single frame. In such a | |
1372 case, the titlebar contains Emacs invocation name and the name of the | |
1373 machine at which Emacs was invoked. This is done by setting | |
1374 @code{frame-title-format} to the default value of | |
1375 | |
1376 @lisp | |
1377 (multiple-frames "%b" ("" invocation-name "@@" system-name)) | |
1378 @end lisp | |
1379 | |
1380 To modify the behavior such that frame titlebars contain the buffer's | |
1381 name regardless of the number of existing frames, include the following | |
1382 in your @file{.emacs}: | |
1383 | |
1384 @lisp | |
1385 (setq frame-title-format "%b") | |
1386 @end lisp | |
1387 | |
1388 @node Turning on abbrevs by default, Associating modes with files, Displaying the current file name in the titlebar, Common requests | |
1389 @section How do I turn on abbrevs by default just in mode @var{mymode}? | |
1390 @cindex Abbrevs, turning on by default | |
1391 | |
1392 Put this in your @file{.emacs} file: | |
1393 | |
1394 @lisp | |
1395 (condition-case () | |
1396 (quietly-read-abbrev-file) | |
1397 (file-error nil)) | |
1398 | |
1399 (add-hook '@var{mymode}-mode-hook | |
1400 (lambda () | |
1401 (setq abbrev-mode t))) | |
1402 @end lisp | |
1403 | |
1404 Starting with Emacs 22, the standard abbrevs file is read automatically | |
1405 at startup, so the first of these two forms becomes unnecessary. | |
1406 | |
1407 @node Associating modes with files, Highlighting a region, Turning on abbrevs by default, Common requests | |
1408 @section How do I make Emacs use a certain major mode for certain files? | |
1409 @cindex Associating modes with files | |
1410 @cindex File extensions and modes | |
1411 @cindex @code{auto-mode-alist}, modifying | |
1412 @cindex Modes, associating with file extensions | |
1413 | |
1414 If you want to use a certain mode @var{foo} for all files whose names end | |
1415 with the extension @file{.@var{bar}}, this will do it for you: | |
1416 | |
1417 @lisp | |
1418 (setq auto-mode-alist (cons '("\\.@var{bar}\\'" . @var{foo}-mode) auto-mode-alist)) | |
1419 @end lisp | |
1420 | |
1421 Otherwise put this somewhere in the first line of any file you want to | |
1422 edit in the mode @var{foo} (in the second line, if the first line begins | |
1423 with @samp{#!}): | |
1424 | |
1425 @example | |
1426 -*- @var{foo} -*- | |
1427 @end example | |
1428 | |
1429 @cindex Major mode for shell scripts | |
1430 Beginning with Emacs 19, the variable @code{interpreter-mode-alist} | |
1431 specifies which mode to use when loading a shell script. (Emacs | |
1432 determines which interpreter you're using by examining the first line of | |
1433 the script.) This feature only applies when the file name doesn't | |
1434 indicate which mode to use. Use @kbd{C-h v} (or @kbd{M-x | |
1435 describe-variable}) on @code{interpreter-mode-alist} to learn more. | |
1436 | |
1437 @node Highlighting a region, Replacing highlighted text, Associating modes with files, Common requests | |
1438 @section How can I highlight a region of text in Emacs? | |
1439 @cindex Highlighting text | |
1440 @cindex Text, highlighting | |
1441 @cindex @code{transient-mark-mode} | |
1442 @cindex Region, highlighting a | |
1443 | |
1444 You can cause the region to be highlighted when the mark is active by | |
1445 including | |
1446 | |
1447 @lisp | |
1448 (transient-mark-mode t) | |
1449 @end lisp | |
1450 | |
1451 @noindent | |
1452 in your @file{.emacs} file. | |
1453 | |
1454 @node Replacing highlighted text, Controlling case sensitivity, Highlighting a region, Common requests | |
1455 @section How can I replace highlighted text with what I type? | |
1456 @cindex @code{delete-selection-mode} | |
1457 @cindex Replacing highlighted text | |
1458 @cindex Highlighting and replacing text | |
1459 | |
1460 Use @code{delete-selection-mode}, which you can start automatically by | |
1461 placing the following Lisp form in your @file{.emacs} file: | |
1462 | |
1463 @lisp | |
1464 (delete-selection-mode 1) | |
1465 @end lisp | |
1466 | |
1467 According to the documentation string for @code{delete-selection-mode} | |
1468 (which you can read using @kbd{M-x describe-function @key{RET} | |
1469 delete-selection-mode @key{RET}}): | |
1470 | |
1471 @quotation | |
1472 When ON, typed text replaces the selection if the selection is active. | |
1473 When OFF, typed text is just inserted at point. | |
1474 @end quotation | |
1475 | |
1476 This mode also allows you to delete (not kill) the highlighted region by | |
1477 pressing @key{DEL}. | |
1478 | |
1479 @node Controlling case sensitivity, Working with unprintable characters, Replacing highlighted text, Common requests | |
1480 @section How do I control Emacs's case-sensitivity when searching/replacing? | |
1481 @cindex @code{case-fold-search} | |
1482 @cindex Case sensitivity of searches | |
1483 @cindex Searching without case sensitivity | |
1484 @cindex Ignoring case in searches | |
1485 | |
1486 For searching, the value of the variable @code{case-fold-search} | |
1487 determines whether they are case sensitive: | |
1488 | |
1489 @lisp | |
1490 (setq case-fold-search nil) ; make searches case sensitive | |
1491 (setq case-fold-search t) ; make searches case insensitive | |
1492 @end lisp | |
1493 | |
1494 @cindex Case sensitivity in replacements | |
1495 @cindex Replacing, and case sensitivity | |
1496 @cindex @code{case-replace} | |
1497 Similarly, for replacing, the variable @code{case-replace} determines | |
1498 whether replacements preserve case. | |
1499 | |
1500 You can also toggle case sensitivity at will in isearch with @kbd{M-c}. | |
1501 | |
1502 To change the case sensitivity just for one major mode, use the major | |
1503 mode's hook. For example: | |
1504 | |
1505 @lisp | |
1506 (add-hook '@var{foo}-mode-hook | |
1507 (lambda () | |
1508 (setq case-fold-search nil))) | |
1509 @end lisp | |
1510 | |
1511 @node Working with unprintable characters, Searching for/replacing newlines, Controlling case sensitivity, Common requests | |
1512 @section How do I search for, delete, or replace unprintable (eight-bit or control) characters? | |
1513 @cindex Unprintable characters, working with | |
1514 @cindex Working with unprintable characters | |
1515 @cindex Control characters, working with | |
1516 @cindex Eight-bit characters, working with | |
1517 @cindex Searching for unprintable characters | |
1518 @cindex Regexps and unprintable characters | |
1519 | |
1520 To search for a single character that appears in the buffer as, for | |
1521 example, @samp{\237}, you can type @kbd{C-s C-q 2 3 7}. (This assumes | |
1522 the value of @code{search-quote-char} is 17 (i.e., @kbd{C-q}).) | |
1523 Searching for @strong{all} unprintable characters is best done with a | |
1524 regular expression (@dfn{regexp}) search. The easiest regexp to use for | |
1525 the unprintable chars is the complement of the regexp for the printable | |
1526 chars. | |
1527 | |
1528 @itemize @bullet | |
1529 | |
1530 @item | |
1531 Regexp for the printable chars: @samp{[\t\n\r\f -~]} | |
1532 | |
1533 @item | |
1534 Regexp for the unprintable chars: @samp{[^\t\n\r\f -~]} | |
1535 | |
1536 @end itemize | |
1537 | |
1538 To type these special characters in an interactive argument to | |
1539 @code{isearch-forward-regexp} or @code{re-search-forward}, you need to | |
1540 use @kbd{C-q}. (@samp{\t}, @samp{\n}, @samp{\r}, and @samp{\f} stand | |
1541 respectively for @key{TAB}, @key{LFD}, @key{RET}, and @kbd{C-l}.) So, | |
1542 to search for unprintable characters using @code{re-search-forward}: | |
1543 | |
1544 @kbd{M-x re-search-forward @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET}} | |
1545 | |
1546 Using @code{isearch-forward-regexp}: | |
1547 | |
1548 @kbd{C-M-s [^ @key{TAB} @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~]} | |
1549 | |
1550 To delete all unprintable characters, simply use replace-regexp: | |
1551 | |
1552 @kbd{M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} @key{RET}} | |
1553 | |
1554 Replacing is similar to the above. To replace all unprintable | |
1555 characters with a colon, use: | |
1556 | |
1557 M-x replace-regexp @key{RET} [^ @key{TAB} C-q @key{LFD} C-q @key{RET} C-q C-l @key{SPC} -~] @key{RET} : @key{RET} | |
1558 | |
1559 @node Searching for/replacing newlines, Yanking text in isearch, Working with unprintable characters, Common requests | |
1560 @section How do I input a newline character in isearch or query-replace? | |
1561 @cindex Searching for newlines | |
1562 @cindex Replacing newlines | |
1563 | |
1564 Use @kbd{C-q C-j}. For more information, see @inforef{Special Isearch, | |
1565 Special Input for Incremental Search, emacs}. | |
1566 | |
1567 | |
1568 @node Yanking text in isearch, Wrapping words automatically, Searching for/replacing newlines, Common requests | |
1569 @section How do I copy text from the kill ring into the search string? | |
1570 @cindex Yanking text into the search string | |
1571 @cindex isearch yanking | |
1572 | |
1573 Use @kbd{M-y}. @inforef{Isearch Yank, Isearch Yanking, emacs}. | |
1574 | |
1575 @node Wrapping words automatically, Turning on auto-fill by default, Yanking text in isearch, Common requests | |
1576 @section How do I make Emacs wrap words for me? | |
1577 @cindex Wrapping word automatically | |
1578 @cindex Wrapping lines | |
1579 @cindex Line wrap | |
1580 @cindex @code{auto-fill-mode}, introduction to | |
1581 @cindex Maximum line width, default value | |
1582 @cindex @code{fill-column}, default value | |
1583 | |
1584 Use @code{auto-fill-mode}, activated by typing @kbd{M-x auto-fill-mode}. | |
1585 The default maximum line width is 70, determined by the variable | |
1586 @code{fill-column}. To learn how to turn this on automatically, see | |
1587 @ref{Turning on auto-fill by default}. | |
1588 | |
1589 @node Turning on auto-fill by default, Spell-checkers, Wrapping words automatically, Common requests | |
1590 @section How do I turn on @code{auto-fill-mode} by default? | |
1591 @cindex @code{auto-fill-mode}, activating automatically | |
1592 @cindex Filling automatically | |
1593 @cindex Automatic entry to @code{auto-fill-mode} | |
1594 | |
1595 To turn on @code{auto-fill-mode} just once for one buffer, use @kbd{M-x | |
1596 auto-fill-mode}. | |
1597 | |
1598 To turn it on for every buffer in a certain mode, you must use the hook | |
1599 for that mode. For example, to turn on @code{auto-fill} mode for all | |
1600 text buffers, including the following in your @file{.emacs} file: | |
1601 | |
1602 @lisp | |
1603 (add-hook 'text-mode-hook 'turn-on-auto-fill) | |
1604 @end lisp | |
1605 | |
1606 If you want @code{auto-fill} mode on in all major modes, do this: | |
1607 | |
1608 @lisp | |
1609 (setq-default auto-fill-function 'do-auto-fill) | |
1610 @end lisp | |
1611 | |
1612 @node Spell-checkers, Checking TeX and *roff documents, Turning on auto-fill by default, Common requests | |
1613 @section Where can I get a better spelling checker for Emacs? | |
1614 @cindex Checking spelling | |
1615 @cindex Spelling, checking text documents | |
1616 | |
1617 Use Ispell. @xref{Ispell}. | |
1618 | |
1619 @node Checking TeX and *roff documents, Changing load-path, Spell-checkers, Common requests | |
1620 @section How can I spell-check @TeX{} or *roff documents? | |
1621 @cindex Spelling, checking @TeX{} documents | |
1622 @cindex @TeX{} documents, checking spelling in | |
1623 | |
1624 Use Ispell. Ispell can handle @TeX{} and *roff documents. | |
1625 @xref{Ispell}. | |
1626 | |
1627 @node Changing load-path, Using an already running Emacs process, Checking TeX and *roff documents, Common requests | |
1628 @section How do I change @code{load-path}? | |
1629 @cindex @code{load-path}, modifying | |
1630 @cindex Modifying @code{load-path} | |
1631 @cindex Adding to @code{load-path} | |
1632 | |
1633 In general, you should only add to the @code{load-path}. You can add | |
1634 directory @var{/dir/subdir} to the load path like this: | |
1635 | |
1636 @lisp | |
1637 (setq load-path (cons "/dir/subdir/" load-path)) | |
1638 @end lisp | |
1639 | |
1640 To do this relative to your home directory: | |
1641 | |
1642 @lisp | |
1643 (setq load-path (cons "~/mysubdir/" load-path)) | |
1644 @end lisp | |
1645 | |
1646 @node Using an already running Emacs process, Compiler error messages, Changing load-path, Common requests | |
1647 @section How do I use an already running Emacs from another window? | |
1648 @cindex @code{emacsclient} | |
1649 @cindex Emacs server functions | |
1650 @cindex Using an existing Emacs process | |
1651 | |
1652 @code{emacsclient}, which comes with Emacs, is for editing a file using | |
1653 an already running Emacs rather than starting up a new Emacs. It does | |
1654 this by sending a request to the already running Emacs, which must be | |
1655 expecting the request. | |
1656 | |
1657 @itemize @bullet | |
1658 | |
1659 @item | |
1660 Setup: | |
1661 | |
1662 Emacs must have executed the @code{server-start} function for | |
1663 @samp{emacsclient} to work. This can be done either by a command line | |
1664 option: | |
1665 | |
1666 @example | |
1667 emacs -f server-start | |
1668 @end example | |
1669 | |
1670 or by invoking @code{server-start} from @file{.emacs}: | |
1671 | |
1672 @lisp | |
1673 (if (@var{some conditions are met}) (server-start)) | |
1674 @end lisp | |
1675 | |
1676 When this is done, Emacs creates a Unix domain socket named | |
1677 @file{server} in @file{/tmp/emacs@var{userid}}. See | |
1678 @code{server-socket-dir}. | |
1679 | |
1680 To get your news reader, mail reader, etc., to invoke | |
1681 @samp{emacsclient}, try setting the environment variable @code{EDITOR} | |
1682 (or sometimes @code{VISUAL}) to the value @samp{emacsclient}. You may | |
1683 have to specify the full pathname of the @samp{emacsclient} program | |
1684 instead. Examples: | |
1685 | |
1686 @example | |
1687 # csh commands: | |
1688 setenv EDITOR emacsclient | |
1689 | |
1690 # using full pathname | |
1691 setenv EDITOR /usr/local/emacs/etc/emacsclient | |
1692 | |
1693 # sh command: | |
1694 EDITOR=emacsclient ; export EDITOR | |
1695 @end example | |
1696 | |
1697 @item | |
1698 Normal use: | |
1699 | |
1700 When @samp{emacsclient} is run, it connects to the socket and passes its | |
1701 command line options to Emacs, which at the next opportunity will visit | |
1702 the files specified. (Line numbers can be specified just like with | |
1703 Emacs.) The user will have to switch to the Emacs window by hand. When | |
1704 the user is done editing a file, the user can type @kbd{C-x #} (or | |
1705 @kbd{M-x server-edit}) to indicate this. If there is another buffer | |
1706 requested by @code{emacsclient}, Emacs will switch to it; otherwise | |
1707 @code{emacsclient} will exit, signaling the calling program to continue. | |
1708 | |
1709 @cindex @code{gnuserv} | |
1710 There is an enhanced version of @samp{emacsclient} called | |
1711 @samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman} | |
1712 (@pxref{Packages that do not come with Emacs}). @samp{gnuserv} uses | |
1713 Internet domain sockets, so it can work across most network connections. | |
1714 | |
1715 The most recent @samp{gnuserv} package is available at | |
1716 | |
1717 @uref{http://meltin.net/hacks/emacs/} | |
1718 | |
1719 @end itemize | |
1720 | |
1721 @node Compiler error messages, Indenting switch statements, Using an already running Emacs process, Common requests | |
1722 @section How do I make Emacs recognize my compiler's funny error messages? | |
1723 @cindex Compiler error messages, recognizing | |
1724 @cindex Recognizing non-standard compiler errors | |
1725 @cindex Regexps for recognizing compiler errors | |
1726 @cindex Errors, recognizing compiler | |
1727 | |
1728 Customize the @code{compilation-error-regexp-alist} variable. | |
1729 | |
1730 @node Indenting switch statements, Customizing C and C++ indentation, Compiler error messages, Common requests | |
1731 @section How do I change the indentation for @code{switch}? | |
1732 @cindex @code{switch}, indenting | |
1733 @cindex Indenting of @code{switch} | |
1734 | |
1735 Many people want to indent their @code{switch} statements like this: | |
1736 | |
1737 @example | |
1738 f() | |
1739 @{ | |
1740 switch(x) @{ | |
1741 case A: | |
1742 x1; | |
1743 break; | |
1744 case B: | |
1745 x2; | |
1746 break; | |
1747 default: | |
1748 x3; | |
1749 @} | |
1750 @} | |
1751 @end example | |
1752 | |
1753 The solution at first appears to be: set @code{c-indent-level} to 4 and | |
1754 @code{c-label-offset} to -2. However, this will give you an indentation | |
1755 spacing of four instead of two. | |
1756 | |
1757 The @emph{real} solution is to use @code{cc-mode} (the default mode for | |
1758 C programming in Emacs 20 and later) and add the following line to your | |
1759 @file{.emacs}: | |
1760 | |
1761 @lisp | |
1762 (c-set-offset 'case-label '+) | |
1763 @end lisp | |
1764 | |
1765 There appears to be no way to do this with the old @code{c-mode}. | |
1766 | |
1767 @node Customizing C and C++ indentation, Horizontal scrolling, Indenting switch statements, Common requests | |
1768 @section How to customize indentation in C, C@t{++}, and Java buffers? | |
1769 @cindex Indentation, how to customize | |
1770 @cindex Customize indentation | |
1771 | |
1772 The Emacs @code{cc-mode} features an interactive procedure for | |
1773 customizing the indentation style, which is fully explained in the | |
1774 @cite{CC Mode} manual that is part of the Emacs distribution, see | |
1775 @ref{Customizing Indentation, , Customization Indentation, ccmode, | |
1776 The CC Mode Manual}. Here's a short summary of the procedure: | |
1777 | |
1778 @enumerate | |
1779 @item | |
1780 Go to the beginning of the first line where you don't like the | |
1781 indentation and type @kbd{C-c C-o}. Emacs will prompt you for the | |
1782 syntactic symbol; type @key{RET} to accept the default it suggests. | |
1783 | |
1784 @item | |
1785 Emacs now prompts for the offset of this syntactic symbol, showing the | |
1786 default (the current definition) inside parentheses. You can choose | |
1787 one of these: | |
1788 | |
1789 @table @code | |
1790 @item 0 | |
1791 No extra indentation. | |
1792 @item + | |
1793 Indent one basic offset. | |
1794 @item - | |
1795 Outdent one basic offset. | |
1796 @item ++ | |
1797 Indent two basic offsets | |
1798 @item -- | |
1799 Outdent two basic offsets. | |
1800 @item * | |
1801 Indent half basic offset. | |
1802 @item / | |
1803 Outdent half basic offset. | |
1804 @end table | |
1805 | |
1806 @item | |
1807 After choosing one of these symbols, type @kbd{C-c C-q} to reindent | |
1808 the line or the block according to what you just specified. | |
1809 | |
1810 @item | |
1811 If you don't like the result, go back to step 1. Otherwise, add the | |
1812 following line to your @file{.emacs}: | |
1813 | |
1814 @lisp | |
1815 (c-set-offset '@var{syntactic-symbol} @var{offset}) | |
1816 @end lisp | |
1817 | |
1818 @noindent | |
1819 where @var{syntactic-symbol} is the name Emacs shows in the minibuffer | |
1820 when you type @kbd{C-c C-o} at the beginning of the line, and | |
1821 @var{offset} is one of the indentation symbols listed above (@code{+}, | |
1822 @code{/}, @code{0}, etc.) that you've chosen during the interactive | |
1823 procedure. | |
1824 | |
1825 @item | |
1826 Go to the next line whose indentation is not to your liking and repeat | |
1827 the process there. | |
1828 @end enumerate | |
1829 | |
1830 It is recommended to put all the resulting @code{(c-set-offset ...)} | |
1831 customizations inside a C mode hook, like this: | |
1832 | |
1833 @lisp | |
1834 (defun my-c-mode-hook () | |
1835 (c-set-offset ...) | |
1836 (c-set-offset ...)) | |
1837 (add-hook 'c-mode-hook 'my-c-mode-hook) | |
1838 @end lisp | |
1839 | |
1840 @noindent | |
1841 Using @code{c-mode-hook} avoids the need to put a @w{@code{(require | |
1842 'cc-mode)}} into your @file{.emacs} file, because @code{c-set-offset} | |
1843 might be unavailable when @code{cc-mode} is not loaded. | |
1844 | |
1845 Note that @code{c-mode-hook} runs for C source files only; use | |
1846 @code{c++-mode-hook} for C@t{++} sources, @code{java-mode-hook} for | |
1847 Java sources, etc. If you want the same customizations to be in | |
1848 effect in @emph{all} languages supported by @code{cc-mode}, use | |
1849 @code{c-mode-common-hook}. | |
1850 | |
1851 @node Horizontal scrolling, Overwrite mode, Customizing C and C++ indentation, Common requests | |
1852 @section How can I make Emacs automatically scroll horizontally? | |
1853 @cindex @code{hscroll-mode} | |
1854 @cindex Horizontal scrolling | |
1855 @cindex Scrolling horizontally | |
1856 | |
1857 In Emacs 21 and later, this is on by default: if the variable | |
1858 @code{truncate-lines} is non-@code{nil} in the current buffer, Emacs | |
1859 automatically scrolls the display horizontally when point moves off the | |
1860 left or right edge of the window. | |
1861 | |
1862 Note that this is overridden by the variable | |
1863 @code{truncate-partial-width-windows} if that variable is non-nil | |
1864 and the current buffer is not full-frame width. | |
1865 | |
1866 In Emacs 20, use the @code{hscroll-mode}. Here is some information from | |
1867 the documentation, available by typing @kbd{C-h f hscroll-mode @key{RET}}: | |
1868 | |
1869 Automatically scroll horizontally when the point moves off the | |
1870 left or right edge of the window. | |
1871 | |
1872 @itemize @minus | |
1873 @item | |
1874 Type @kbd{M-x hscroll-mode} to enable it in the current buffer. | |
1875 | |
1876 @item | |
1877 Type @kbd{M-x hscroll-global-mode} to enable it in every buffer. | |
1878 | |
1879 @item | |
1880 @code{turn-on-hscroll} is useful in mode hooks as in: | |
1881 | |
1882 @lisp | |
1883 (add-hook 'text-mode-hook 'turn-on-hscroll) | |
1884 @end lisp | |
1885 | |
1886 @item | |
1887 @code{hscroll-margin} controls how close the cursor can get to the | |
1888 edge of the window. | |
1889 | |
1890 @item | |
1891 @code{hscroll-step-percent} controls how far to jump once we decide to do so. | |
1892 @end itemize | |
1893 | |
1894 @node Overwrite mode, Turning off beeping, Horizontal scrolling, Common requests | |
1895 @section How do I make Emacs ``typeover'' or ``overwrite'' instead of inserting? | |
1896 @cindex @key{Insert} | |
1897 @cindex @code{overwrite-mode} | |
1898 @cindex Overwriting existing text | |
1899 @cindex Toggling @code{overwrite-mode} | |
1900 | |
1901 @kbd{M-x overwrite-mode} (a minor mode). This toggles | |
1902 @code{overwrite-mode} on and off, so exiting from @code{overwrite-mode} | |
1903 is as easy as another @kbd{M-x overwrite-mode}. | |
1904 | |
1905 On some systems, @key{Insert} toggles @code{overwrite-mode} on and off. | |
1906 | |
1907 @node Turning off beeping, Turning the volume down, Overwrite mode, Common requests | |
1908 @section How do I stop Emacs from beeping on a terminal? | |
1909 @cindex Beeping, turning off | |
1910 @cindex Visible bell | |
1911 @cindex Bell, visible | |
1912 | |
1913 @email{martin@@cc.gatech.edu, Martin R. Frank} writes: | |
1914 | |
1915 Tell Emacs to use the @dfn{visible bell} instead of the audible bell, | |
1916 and set the visible bell to nothing. | |
1917 | |
1918 That is, put the following in your @code{TERMCAP} environment variable | |
1919 (assuming you have one): | |
1920 | |
1921 @example | |
1922 ... :vb=: ... | |
1923 @end example | |
1924 | |
1925 And evaluate the following Lisp form: | |
1926 | |
1927 @example | |
1928 (setq visible-bell t) | |
1929 @end example | |
1930 | |
1931 @node Turning the volume down, Automatic indentation, Turning off beeping, Common requests | |
1932 @section How do I turn down the bell volume in Emacs running under X? | |
1933 @cindex Bell, volume of | |
1934 @cindex Volume of bell | |
1935 | |
1936 On X Window system, you can adjust the bell volume and duration for all | |
1937 programs with the shell command @code{xset}. | |
1938 | |
1939 Invoking @code{xset} without any arguments produces some basic | |
1940 information, including the following: | |
1941 | |
1942 @example | |
1943 usage: xset [-display host:dpy] option ... | |
1944 To turn bell off: | |
1945 -b b off b 0 | |
1946 To set bell volume, pitch and duration: | |
1947 b [vol [pitch [dur]]] b on | |
1948 @end example | |
1949 | |
1950 @node Automatic indentation, Matching parentheses, Turning the volume down, Common requests | |
1951 @section How do I tell Emacs to automatically indent a new line to the indentation of the previous line? | |
1952 @cindex Indenting new lines | |
1953 @cindex New lines, indenting of | |
1954 @cindex Previous line, indenting according to | |
1955 @cindex Text indentation | |
1956 | |
1957 Such behavior is automatic in Emacs 20 and later. From the | |
1958 @file{etc/NEWS} file for Emacs 20.2: | |
1959 | |
1960 @example | |
1961 ** In Text mode, now only blank lines separate paragraphs. This makes | |
1962 it possible to get the full benefit of Adaptive Fill mode in Text mode, | |
1963 and other modes derived from it (such as Mail mode). @key{TAB} in Text | |
1964 mode now runs the command @code{indent-relative}; this makes a practical | |
1965 difference only when you use indented paragraphs. | |
1966 | |
1967 As a result, the old Indented Text mode is now identical to Text mode, | |
1968 and is an alias for it. | |
1969 | |
1970 If you want spaces at the beginning of a line to start a paragraph, use | |
1971 the new mode, Paragraph Indent Text mode. | |
1972 @end example | |
1973 | |
1974 @cindex Prefixing lines | |
1975 @cindex Fill prefix | |
1976 If you have @code{auto-fill-mode} turned on (@pxref{Turning on auto-fill | |
1977 by default}), you can tell Emacs to prefix every line with a certain | |
1978 character sequence, the @dfn{fill prefix}. Type the prefix at the | |
1979 beginning of a line, position point after it, and then type @kbd{C-x .} | |
1980 (@code{set-fill-prefix}) to set the fill prefix. Thereafter, | |
1981 auto-filling will automatically put the fill prefix at the beginning of | |
1982 new lines, and @kbd{M-q} (@code{fill-paragraph}) will maintain any fill | |
1983 prefix when refilling the paragraph. | |
1984 | |
1985 If you have paragraphs with different levels of indentation, you will | |
1986 have to set the fill prefix to the correct value each time you move to a | |
1987 new paragraph. There are many packages available to deal with this | |
1988 (@pxref{Packages that do not come with Emacs}). Look for ``fill'' and | |
1989 ``indent'' keywords for guidance. | |
1990 | |
1991 @node Matching parentheses, Hiding #ifdef lines, Automatic indentation, Common requests | |
1992 @section How do I show which parenthesis matches the one I'm looking at? | |
1993 @cindex Parentheses, matching | |
1994 @cindex @file{paren.el} | |
1995 @cindex Highlighting matching parentheses | |
1996 @cindex Pairs of parentheses, highlighting | |
1997 @cindex Matching parentheses | |
1998 | |
1999 Call @code{show-paren-mode} in your @file{.emacs} file: | |
2000 | |
2001 @lisp | |
2002 (show-paren-mode 1) | |
2003 @end lisp | |
2004 | |
2005 You can also enable this mode by selecting the @samp{Paren Match | |
2006 Highlighting} option from the @samp{Options} menu of the Emacs menu bar | |
2007 at the top of any Emacs frame. | |
2008 | |
2009 Alternatives to this mode include: | |
2010 | |
2011 @itemize @bullet | |
2012 | |
2013 @item | |
2014 If you're looking at a right parenthesis (or brace or bracket) you can | |
2015 delete it and reinsert it. Emacs will momentarily move the cursor to | |
2016 the matching parenthesis. | |
2017 | |
2018 @item | |
2019 @kbd{C-M-f} (@code{forward-sexp}) and @kbd{C-M-b} (@code{backward-sexp}) | |
2020 will skip over one set of balanced parentheses, so you can see which | |
2021 parentheses match. (You can train it to skip over balanced brackets | |
2022 and braces at the same time by modifying the syntax table.) | |
2023 | |
2024 @cindex Show matching paren as in @code{vi} | |
2025 @item | |
2026 Here is some Emacs Lisp that will make the @key{%} key show the matching | |
2027 parenthesis, like in @code{vi}. In addition, if the cursor isn't over a | |
2028 parenthesis, it simply inserts a % like normal. | |
2029 | |
2030 @lisp | |
2031 ;; By an unknown contributor | |
2032 | |
2033 (global-set-key "%" 'match-paren) | |
2034 | |
2035 (defun match-paren (arg) | |
2036 "Go to the matching paren if on a paren; otherwise insert %." | |
2037 (interactive "p") | |
2038 (cond ((looking-at "\\s\(") (forward-list 1) (backward-char 1)) | |
2039 ((looking-at "\\s\)") (forward-char 1) (backward-list 1)) | |
2040 (t (self-insert-command (or arg 1))))) | |
2041 @end lisp | |
2042 | |
2043 @end itemize | |
2044 | |
2045 @node Hiding #ifdef lines, Repeating commands, Matching parentheses, Common requests | |
2046 @section In C mode, can I show just the lines that will be left after @code{#ifdef} commands are handled by the compiler? | |
2047 @cindex @code{#ifdef}, selective display of | |
2048 @cindex @code{hide-ifdef-mode} | |
2049 @cindex Hiding @code{#ifdef} text | |
2050 @cindex Selectively displaying @code{#ifdef} code | |
2051 | |
2052 @kbd{M-x hide-ifdef-mode}. (This is a minor mode.) You might also want | |
2053 to investigate @file{cpp.el}, which is distributed with Emacs. | |
2054 | |
2055 @node Repeating commands, Valid X resources, Hiding #ifdef lines, Common requests | |
2056 @section How do I repeat a command as many times as possible? | |
2057 @cindex Repeating commands many times | |
2058 @cindex Commands, repeating many times | |
2059 @cindex @code{.}, equivalent to @code{vi} command | |
2060 | |
2061 As of Emacs 20.3, there is indeed a @code{repeat} command (@kbd{C-x z}) | |
2062 that repeats the last command. If you preface it with a prefix | |
2063 argument, the prefix arg is applied to the command. | |
2064 | |
2065 You can also type @kbd{C-x @key{ESC} @key{ESC}} | |
2066 (@code{repeat-complex-command}) to reinvoke commands that used the | |
2067 minibuffer to get arguments. In @code{repeat-complex-command} you can | |
2068 type @kbd{M-p} and @kbd{M-n} (and also up-arrow and down-arrow, if your | |
2069 keyboard has these keys) to scan through all the different complex | |
2070 commands you've typed. | |
2071 | |
2072 To repeat a set of commands, use keyboard macros. Use @kbd{C-x (} and | |
2073 @kbd{C-x )} to make a keyboard macro that invokes the command and then | |
2074 type @kbd{C-x e}. (@inforef{Keyboard Macros, Keyboard Macros, emacs}.) | |
2075 | |
2076 If you're really desperate for the @code{.} command in @code{vi} that | |
2077 redoes the last insertion/deletion, use VIPER, a @code{vi} emulation | |
2078 mode which comes with Emacs, and which appears to support it. | |
2079 | |
2080 @node Valid X resources, Evaluating Emacs Lisp code, Repeating commands, Common requests | |
2081 @section What are the valid X resource settings (i.e., stuff in .Xdefaults)? | |
2082 @cindex Resources, X | |
2083 @cindex X resources | |
2084 @cindex Setting X resources | |
2085 | |
2086 @inforef{X Resources, X Resources, emacs}. | |
2087 | |
2088 You can also use a resource editor, such as editres (for X11R5 and | |
2089 onwards), to look at the resource names for the menu bar, assuming Emacs | |
2090 was compiled with the X toolkit. | |
2091 | |
2092 @node Evaluating Emacs Lisp code, Changing the length of a Tab, Valid X resources, Common requests | |
2093 @section How do I execute (``evaluate'') a piece of Emacs Lisp code? | |
2094 @cindex Evaluating Lisp code | |
2095 @cindex Lisp forms, evaluating | |
2096 | |
2097 There are a number of ways to execute (@dfn{evaluate}, in Lisp lingo) an | |
2098 Emacs Lisp @dfn{form}: | |
2099 | |
2100 @itemize @bullet | |
2101 | |
2102 @item | |
2103 If you want it evaluated every time you run Emacs, put it in a file | |
2104 named @file{.emacs} in your home directory. This is known as ``your | |
2105 @file{.emacs} file,'' and contains all of your personal customizations. | |
2106 | |
2107 @item | |
2108 You can type the form in the @file{*scratch*} buffer, and then type | |
2109 @key{LFD} (or @kbd{C-j}) after it. The result of evaluating the form | |
2110 will be inserted in the buffer. | |
2111 | |
2112 @item | |
2113 In @code{emacs-lisp-mode}, typing @kbd{C-M-x} evaluates a top-level form | |
2114 before or around point. | |
2115 | |
2116 @item | |
2117 Typing @kbd{C-x C-e} in any buffer evaluates the Lisp form immediately | |
2118 before point and prints its value in the echo area. | |
2119 | |
2120 @item | |
2121 Typing @kbd{M-:} or @kbd{M-x eval-expression} allows you to type a Lisp | |
2122 form in the minibuffer which will be evaluated once you press @key{RET}. | |
2123 | |
2124 @item | |
2125 You can use @kbd{M-x load-file} to have Emacs evaluate all the Lisp | |
2126 forms in a file. (To do this from Lisp use the function @code{load} | |
2127 instead.) | |
2128 | |
2129 The functions @code{load-library}, @code{eval-region}, | |
2130 @code{eval-buffer}, @code{require}, and @code{autoload} are also | |
2131 useful; see @ref{Emacs Lisp documentation}, if you want to learn more | |
2132 about them. | |
2133 | |
2134 @end itemize | |
2135 | |
2136 @node Changing the length of a Tab, Inserting text at the beginning of each line, Evaluating Emacs Lisp code, Common requests | |
2137 @section How do I change Emacs's idea of the @key{TAB} character's length? | |
2138 @cindex Tab length | |
2139 @cindex Length of tab character | |
2140 @cindex @code{default-tab-width} | |
2141 | |
2142 Set the variable @code{default-tab-width}. For example, to set | |
2143 @key{TAB} stops every 10 characters, insert the following in your | |
2144 @file{.emacs} file: | |
2145 | |
2146 @lisp | |
2147 (setq default-tab-width 10) | |
2148 @end lisp | |
2149 | |
2150 Do not confuse variable @code{tab-width} with variable | |
2151 @code{tab-stop-list}. The former is used for the display of literal | |
2152 @key{TAB} characters. The latter controls what characters are inserted | |
2153 when you press the @key{TAB} character in certain modes. | |
2154 | |
2155 @node Inserting text at the beginning of each line, Underlining paragraphs, Changing the length of a Tab, Common requests | |
2156 @section How do I insert <some text> at the beginning of every line? | |
2157 @cindex Prefixing a region with some text | |
2158 @cindex Prefix character, inserting in mail/news replies | |
2159 @cindex Replies to mail/news, inserting a prefix character | |
2160 @cindex @code{mail-yank-prefix} | |
2161 @cindex Mail replies, inserting a prefix character | |
2162 @cindex News replies, inserting a prefix character | |
2163 | |
2164 To do this to an entire buffer, type @kbd{M-< M-x replace-regexp | |
2165 @key{RET} ^ @key{RET} your text @key{RET}}. | |
2166 | |
2167 To do this to a region, use @code{string-insert-rectangle}. | |
2168 Set the mark (@kbd{C-@key{SPC}}) at the beginning of the first line you | |
2169 want to prefix, move the cursor to last line to be prefixed, and type | |
2170 @kbd{M-x string-insert-rectangle @key{RET}}. To do this for the whole | |
2171 buffer, type @kbd{C-x h M-x string-insert-rectangle @key{RET}}. | |
2172 | |
2173 If you are trying to prefix a yanked mail message with @samp{>}, you | |
2174 might want to set the variable @code{mail-yank-prefix}. In Message | |
2175 buffers, you can even use @kbd{M-;} to cite yanked messages (@kbd{M-;} | |
2176 runs the function @code{comment-region}, it is a general-purpose | |
2177 mechanism to comment regions) (@pxref{Changing the included text prefix}). | |
2178 | |
2179 @node Underlining paragraphs, Forcing the cursor to remain in the same column, Inserting text at the beginning of each line, Common requests | |
2180 @section How do I insert @samp{_^H} before each character in a region to get an underlined paragraph? | |
2181 @cindex Underlining a region of text | |
2182 @cindex @code{underline-region} | |
2183 | |
2184 Mark the region and then type @kbd{M-x underline-region @key{RET}}. | |
2185 | |
2186 @node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Underlining paragraphs, Common requests | |
2187 @section How do I make Emacs behave like this: when I go up or down, the cursor should stay in the same column even if the line is too short? | |
2188 @cindex @code{picture-mode} | |
2189 @cindex Remaining in the same column, regardless of contents | |
2190 @cindex Vertical movement in empty documents | |
2191 | |
2192 Use @kbd{M-x picture-mode}. | |
2193 | |
2194 See also the variable @code{track-eol} and the command | |
2195 @code{set-goal-column} bound to @kbd{C-x C-n} | |
2196 (@pxref{Moving Point, , , emacs, The GNU Emacs Manual}). | |
2197 | |
2198 @node Forcing Emacs to iconify itself, Using regular expressions, Forcing the cursor to remain in the same column, Common requests | |
2199 @section How do I tell Emacs to iconify itself? | |
2200 @cindex Iconification under the X Window System | |
2201 @cindex X Window System and iconification | |
2202 @cindex Suspending Emacs | |
2203 | |
2204 @kbd{C-z} iconifies Emacs when running under X and suspends Emacs | |
2205 otherwise. @inforef{Frame Commands, Frame Commands, emacs}. | |
2206 | |
2207 @node Using regular expressions, Replacing text across multiple files, Forcing Emacs to iconify itself, Common requests | |
2208 @section How do I use regexps (regular expressions) in Emacs? | |
2209 @cindex Regexps | |
2210 @cindex Regular expressions | |
2211 @cindex Differences between Unix and Emacs regexps | |
2212 @cindex Unix regexps, differences from Emacs | |
2213 @cindex Text strings, putting regexps in | |
2214 | |
2215 @inforef{Regexp Backslash, Regexp Backslash, emacs}. | |
2216 | |
2217 The @code{or} operator is @samp{\|}, not @samp{|}, and the grouping operators | |
2218 are @samp{\(} and @samp{\)}. Also, the string syntax for a backslash is | |
2219 @samp{\\}. To specify a regular expression like @samp{xxx\(foo\|bar\)} | |
2220 in a Lisp string, use @samp{xxx\\(foo\\|bar\\)}. | |
2221 | |
2222 Note the doubled backslashes! | |
2223 | |
2224 @itemize @bullet | |
2225 | |
2226 @item | |
2227 Unlike in Unix @file{grep}, @file{sed}, etc., a complement character set | |
2228 (@samp{[^...]}) can match a newline character (@key{LFD} a.k.a.@: | |
2229 @kbd{C-j} a.k.a.@: @samp{\n}), unless newline is mentioned as one of the | |
2230 characters not to match. | |
2231 | |
2232 @item | |
2233 The character syntax regexps (e.g., @samp{\sw}) are not | |
2234 meaningful inside character set regexps (e.g., @samp{[aeiou]}). (This | |
2235 is actually typical for regexp syntax.) | |
2236 | |
2237 @end itemize | |
2238 | |
2239 @node Replacing text across multiple files, Documentation for etags, Using regular expressions, Common requests | |
2240 @section How do I perform a replace operation across more than one file? | |
2241 @cindex Replacing strings across files | |
2242 @cindex Multiple files, replacing across | |
2243 @cindex Files, replacing strings across multiple | |
2244 @cindex Recursive search/replace operations | |
2245 | |
2246 As of Emacs 19.29, Dired mode (@kbd{M-x dired @key{RET}}, or @kbd{C-x | |
2247 d}) supports the command @code{dired-do-query-replace} (@kbd{Q}), which | |
2248 allows users to replace regular expressions in multiple files. | |
2249 | |
2250 You can use this command to perform search/replace operations on | |
2251 multiple files by following the following steps: | |
2252 | |
2253 @itemize @bullet | |
2254 @item | |
2255 Assemble a list of files you want to operate on with either | |
2256 @code{find-dired}, @code{find-name-dired} or @code{find-grep-dired}. | |
2257 | |
2258 @item | |
2259 Mark all files in the resulting Dired buffer using @kbd{t}. | |
2260 | |
2261 @item | |
2262 Use @kbd{Q} to start a @code{query-replace-regexp} session on the marked | |
2263 files. | |
2264 | |
2265 @item | |
2266 To accept all replacements in each file, hit @kbd{!}. | |
2267 @end itemize | |
2268 | |
2269 Another way to do the same thing is to use the ``tags'' feature of | |
2270 Emacs: it includes the command @code{tags-query-replace} which performs | |
2271 a query-replace across all the files mentioned in the @file{TAGS} file. | |
2272 @inforef{Tags Search, Tags Search, emacs}. | |
2273 | |
2274 @node Documentation for etags, Disabling backups, Replacing text across multiple files, Common requests | |
2275 @section Where is the documentation for @code{etags}? | |
2276 @cindex Documentation for @code{etags} | |
2277 @cindex @code{etags}, documentation for | |
2278 | |
2279 The @code{etags} man page should be in the same place as the | |
2280 @code{emacs} man page. | |
2281 | |
2282 Quick command-line switch descriptions are also available. For example, | |
2283 @samp{etags -H}. | |
2284 | |
2285 @node Disabling backups, Disabling auto-save-mode, Documentation for etags, Common requests | |
2286 @section How do I disable backup files? | |
2287 @cindex Backups, disabling | |
2288 @cindex Disabling backups | |
2289 | |
2290 You probably don't want to do this, since backups are useful, especially | |
2291 when something goes wrong. | |
2292 | |
2293 To avoid seeing backup files (and other ``uninteresting'' files) in Dired, | |
2294 load @code{dired-x} by adding the following to your @file{.emacs} file: | |
2295 | |
2296 @lisp | |
2297 (add-hook 'dired-load-hook | |
2298 (lambda () | |
2299 (load "dired-x"))) | |
2300 @end lisp | |
2301 | |
2302 With @code{dired-x} loaded, @kbd{M-o} toggles omitting in each dired buffer. | |
2303 You can make omitting the default for new dired buffers by putting the | |
2304 following in your @file{.emacs}: | |
2305 | |
2306 @lisp | |
2307 (add-hook 'dired-mode-hook 'dired-omit-toggle) | |
2308 @end lisp | |
2309 | |
2310 If you're tired of seeing backup files whenever you do an @samp{ls} at | |
2311 the Unix shell, try GNU @code{ls} with the @samp{-B} option. GNU | |
2312 @code{ls} is part of the GNU Fileutils package, available from | |
2313 @samp{ftp.gnu.org} and its mirrors (@pxref{Current GNU distributions}). | |
2314 | |
2315 To disable or change the way backups are made, @inforef{Backup Names, , | |
2316 emacs}. | |
2317 | |
2318 @cindex Backup files in a single directory | |
2319 Beginning with Emacs 21.1, you can control where Emacs puts backup files | |
2320 by customizing the variable @code{backup-directory-alist}. This | |
2321 variable's value specifies that files whose names match specific patters | |
2322 should have their backups put in certain directories. A typical use is | |
2323 to add the element @code{("." . @var{dir})} to force Emacs to put | |
2324 @strong{all} backup files in the directory @file{dir}. | |
2325 | |
2326 @node Disabling auto-save-mode, Going to a line by number, Disabling backups, Common requests | |
2327 @section How do I disable @code{auto-save-mode}? | |
2328 @cindex Disabling @code{auto-save-mode} | |
2329 @cindex Auto-saving | |
2330 @cindex Saving at frequent intervals | |
2331 | |
2332 You probably don't want to do this, since auto-saving is useful, | |
2333 especially when Emacs or your computer crashes while you are editing a | |
2334 document. | |
2335 | |
2336 Instead, you might want to change the variable | |
2337 @code{auto-save-interval}, which specifies how many keystrokes Emacs | |
2338 waits before auto-saving. Increasing this value forces Emacs to wait | |
2339 longer between auto-saves, which might annoy you less. | |
2340 | |
2341 You might also want to look into Sebastian Kremer's @code{auto-save} | |
2342 package (@pxref{Packages that do not come with Emacs}). This | |
2343 package also allows you to place all auto-save files in one directory, | |
2344 such as @file{/tmp}. | |
2345 | |
2346 To disable or change how @code{auto-save-mode} works, @inforef{Auto | |
2347 Save, , emacs}. | |
2348 | |
2349 @node Going to a line by number, Modifying pull-down menus, Disabling auto-save-mode, Common requests | |
2350 @section How can I go to a certain line given its number? | |
2351 @cindex Going to a line by number | |
2352 @cindex Compilation error messages | |
2353 @cindex Recompilation | |
2354 | |
2355 Are you sure you indeed need to go to a line by its number? Perhaps all | |
2356 you want is to display a line in your source file for which a compiler | |
2357 printed an error message? If so, compiling from within Emacs using the | |
2358 @kbd{M-x compile} and @kbd{M-x recompile} commands is a much more | |
2359 effective way of doing that. Emacs automatically intercepts the compile | |
2360 error messages, inserts them into a special buffer called | |
2361 @code{*compilation*}, and lets you visit the locus of each message in | |
2362 the source. Type @kbd{C-x `} to step through the offending lines one by | |
2363 one (starting with Emacs 22, you can also use @kbd{M-g M-p} and | |
2364 @kbd{M-g M-n} to go to the previous and next matches directly). Click | |
2365 @kbd{Mouse-2} or press @key{RET} on a message text in the | |
2366 @code{*compilation*} buffer to go to the line whose number is mentioned | |
2367 in that message. | |
2368 | |
2369 But if you indeed need to go to a certain text line, type @kbd{M-g M-g} | |
2370 (which is the default binding of the @code{goto-line} function starting | |
2371 with Emacs 22). Emacs will prompt you for the number of the line and go | |
2372 to that line. | |
2373 | |
2374 You can do this faster by invoking @code{goto-line} with a numeric | |
2375 argument that is the line's number. For example, @kbd{C-u 286 M-g M-g} | |
2376 will jump to line number 286 in the current buffer. | |
2377 | |
2378 @node Modifying pull-down menus, Deleting menus and menu options, Going to a line by number, Common requests | |
2379 @section How can I create or modify new pull-down menu options? | |
2380 @cindex Pull-down menus, creating or modifying | |
2381 @cindex Menus, creating or modifying | |
2382 @cindex Creating new menu options | |
2383 @cindex Modifying pull-down menus | |
2384 @cindex Menus and keymaps | |
2385 @cindex Keymaps and menus | |
2386 | |
2387 Each menu title (e.g., @samp{File}, @samp{Edit}, @samp{Buffers}) | |
2388 represents a local or global keymap. Selecting a menu title with the | |
2389 mouse displays that keymap's non-@code{nil} contents in the form of a menu. | |
2390 | |
2391 So to add a menu option to an existing menu, all you have to do is add a | |
2392 new definition to the appropriate keymap. Adding a @samp{Forward Word} | |
2393 item to the @samp{Edit} menu thus requires the following Lisp code: | |
2394 | |
2395 @lisp | |
2396 (define-key global-map | |
2397 [menu-bar edit forward] | |
2398 '("Forward word" . forward-word)) | |
2399 @end lisp | |
2400 | |
2401 @noindent | |
2402 The first line adds the entry to the global keymap, which includes | |
2403 global menu bar entries. Replacing the reference to @code{global-map} | |
2404 with a local keymap would add this menu option only within a particular | |
2405 mode. | |
2406 | |
2407 The second line describes the path from the menu-bar to the new entry. | |
2408 Placing this menu entry underneath the @samp{File} menu would mean | |
2409 changing the word @code{edit} in the second line to @code{file}. | |
2410 | |
2411 The third line is a cons cell whose first element is the title that will | |
2412 be displayed, and whose second element is the function that will be | |
2413 called when that menu option is invoked. | |
2414 | |
2415 To add a new menu, rather than a new option to an existing menu, we must | |
2416 define an entirely new keymap: | |
2417 | |
2418 @lisp | |
2419 (define-key global-map [menu-bar words] | |
2420 (cons "Words" (make-sparse-keymap "Words"))) | |
2421 @end lisp | |
2422 | |
2423 The above code creates a new sparse keymap, gives it the name | |
2424 @samp{Words}, and attaches it to the global menu bar. Adding the | |
2425 @samp{Forward Word} item to this new menu would thus require the | |
2426 following code: | |
2427 | |
2428 @lisp | |
2429 (define-key global-map | |
2430 [menu-bar words forward] | |
2431 '("Forward word" . forward-word)) | |
2432 @end lisp | |
2433 | |
2434 @noindent | |
2435 Note that because of the way keymaps work, menu options are displayed | |
2436 with the more recently defined items at the top. Thus if you were to | |
2437 define menu options @samp{foo}, @samp{bar}, and @samp{baz} (in that | |
2438 order), the menu option @samp{baz} would appear at the top, and | |
2439 @samp{foo} would be at the bottom. | |
2440 | |
2441 One way to avoid this problem is to use the function @code{define-key-after}, | |
2442 which works the same as @code{define-key}, but lets you modify where items | |
2443 appear. The following Lisp code would insert the @samp{Forward Word} | |
2444 item in the @samp{Edit} menu immediately following the @samp{Undo} item: | |
2445 | |
2446 @lisp | |
2447 (define-key-after | |
2448 (lookup-key global-map [menu-bar edit]) | |
2449 [forward] | |
2450 '("Forward word" . forward-word) | |
2451 'undo) | |
2452 @end lisp | |
2453 | |
2454 Note how the second and third arguments to @code{define-key-after} are | |
2455 different from those of @code{define-key}, and that we have added a new | |
2456 (final) argument, the function after which our new key should be | |
2457 defined. | |
2458 | |
2459 To move a menu option from one position to another, simply evaluate | |
2460 @code{define-key-after} with the appropriate final argument. | |
2461 | |
2462 More detailed information---and more examples of how to create and | |
2463 modify menu options---are in the @cite{Emacs Lisp Reference Manual}, under | |
2464 ``Menu Keymaps.'' (@xref{Emacs Lisp documentation}, for information on | |
2465 this manual.) | |
2466 | |
2467 @node Deleting menus and menu options, Turning on syntax highlighting, Modifying pull-down menus, Common requests | |
2468 @section How do I delete menus and menu options? | |
2469 @cindex Deleting menus and menu options | |
2470 @cindex Menus, deleting | |
2471 | |
2472 The simplest way to remove a menu is to set its keymap to @samp{nil}. | |
2473 For example, to delete the @samp{Words} menu (@pxref{Modifying pull-down | |
2474 menus}), use: | |
2475 | |
2476 @lisp | |
2477 (define-key global-map [menu-bar words] nil) | |
2478 @end lisp | |
2479 | |
2480 Similarly, removing a menu option requires redefining a keymap entry to | |
2481 @code{nil}. For example, to delete the @samp{Forward word} menu option | |
2482 from the @samp{Edit} menu (we added it in @ref{Modifying pull-down | |
2483 menus}), use: | |
2484 | |
2485 @lisp | |
2486 (define-key global-map [menu-bar edit forward] nil) | |
2487 @end lisp | |
2488 | |
2489 @node Turning on syntax highlighting, Scrolling only one line, Deleting menus and menu options, Common requests | |
2490 @section How do I turn on syntax highlighting? | |
2491 @cindex Syntax highlighting | |
2492 @cindex @code{font-lock-mode} | |
2493 @cindex Highlighting based on syntax | |
2494 @cindex Colorizing text | |
2495 @cindex FAQ, @code{font-lock-mode} | |
2496 | |
2497 @code{font-lock-mode} is the standard way to have Emacs perform syntax | |
2498 highlighting in the current buffer. It is enabled by default in Emacs | |
2499 22.1 and later. | |
2500 | |
2501 With @code{font-lock-mode} turned on, different types of text will | |
2502 appear in different colors. For instance, in a programming mode, | |
2503 variables will appear in one face, keywords in a second, and comments in | |
2504 a third. | |
2505 | |
2506 @cindex hilit19 is deprecated | |
2507 Earlier versions of Emacs supported hilit19, a similar package. Use of | |
2508 hilit19 is now considered non-standard, although @file{hilit19.el} comes | |
2509 with the stock Emacs distribution. It is no longer maintained. | |
2510 | |
2511 To turn @code{font-lock-mode} off within an existing buffer, use | |
2512 @kbd{M-x font-lock-mode @key{RET}}. | |
2513 | |
2514 In Emacs 21 and earlier versions, you could use the following code in | |
2515 your @file{.emacs} file to turn on @code{font-lock-mode} globally: | |
2516 | |
2517 @lisp | |
2518 (global-font-lock-mode 1) | |
2519 @end lisp | |
2520 | |
2521 Highlighting a buffer with @code{font-lock-mode} can take quite a while, | |
2522 and cause an annoying delay in display, so several features exist to | |
2523 work around this. | |
2524 | |
2525 @cindex Just-In-Time syntax highlighting | |
2526 In Emacs 21 and later, turning on @code{font-lock-mode} automatically | |
2527 activates the new @dfn{Just-In-Time fontification} provided by | |
2528 @code{jit-lock-mode}. @code{jit-lock-mode} defers the fontification of | |
2529 portions of buffer until you actually need to see them, and can also | |
2530 fontify while Emacs is idle. This makes display of the visible portion | |
2531 of a buffer almost instantaneous. For details about customizing | |
2532 @code{jit-lock-mode}, type @kbd{C-h f jit-lock-mode @key{RET}}. | |
2533 | |
2534 @cindex Levels of syntax highlighting | |
2535 @cindex Decoration level, in @code{font-lock-mode} | |
2536 In versions of Emacs before 21, different levels of decoration are | |
2537 available, from slight to gaudy. More decoration means you need to wait | |
2538 more time for a buffer to be fontified (or a faster machine). To | |
2539 control how decorated your buffers should become, set the value of | |
2540 @code{font-lock-maximum-decoration} in your @file{.emacs} file, with a | |
2541 @code{nil} value indicating default (usually minimum) decoration, and a | |
2542 @code{t} value indicating the maximum decoration. For the gaudiest | |
2543 possible look, then, include the line | |
2544 | |
2545 @lisp | |
2546 (setq font-lock-maximum-decoration t) | |
2547 @end lisp | |
2548 | |
2549 @noindent | |
2550 in your @file{.emacs} file. You can also set this variable such that | |
2551 different modes are highlighted in a different ways; for more | |
2552 information, see the documentation for | |
2553 @code{font-lock-maximum-decoration} with @kbd{C-h v} (or @kbd{M-x | |
2554 describe-variable @key{RET}}). | |
2555 | |
2556 Also see the documentation for the function @code{font-lock-mode}, | |
2557 available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x | |
2558 describe-function @key{RET} font-lock-mode @key{RET}}). | |
2559 | |
2560 To print buffers with the faces (i.e., colors and fonts) intact, use | |
2561 @kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x | |
2562 ps-print-region-with-faces}. You will need a way to send text to a | |
2563 PostScript printer, or a PostScript interpreter such as Ghostscript; | |
2564 consult the documentation of the variables @code{ps-printer-name}, | |
2565 @code{ps-lpr-command}, and @code{ps-lpr-switches} for more details. | |
2566 | |
2567 @node Scrolling only one line, Editing MS-DOS files, Turning on syntax highlighting, Common requests | |
2568 @section How can I force Emacs to scroll only one line when I move past the bottom of the screen? | |
2569 @cindex Scrolling only one line | |
2570 @cindex Reducing the increment when scrolling | |
2571 | |
2572 Customize the @code{scroll-conservatively} variable with @kbd{M-x | |
2573 customize-variable @key{RET} scroll-conservatively @key{RET}} and set it | |
2574 to a large value like, say, 10000. For an explanation of what this | |
2575 means, @inforef{Auto Scrolling, Auto Scrolling, emacs}. | |
2576 | |
2577 Alternatively, use the following Lisp form in your @file{.emacs}: | |
2578 | |
2579 @lisp | |
2580 (setq scroll-conservatively most-positive-fixnum) | |
2581 @end lisp | |
2582 | |
2583 @node Editing MS-DOS files, Filling paragraphs with a single space, Scrolling only one line, Common requests | |
2584 @section How can I edit MS-DOS files using Emacs? | |
2585 @cindex Editing MS-DOS files | |
2586 @cindex MS-DOS files, editing | |
2587 @cindex Microsoft files, editing | |
2588 @cindex Windows files, editing | |
2589 | |
2590 As of Emacs 20, detection and handling of MS-DOS (and Windows) files is | |
2591 performed transparently. You can open MS-DOS files on a Unix system, | |
2592 edit it, and save it without having to worry about the file format. | |
2593 | |
2594 When editing an MS-DOS style file, the mode line will indicate that it | |
2595 is a DOS file. On Unix and GNU/Linux systems, and also on a Macintosh, | |
2596 the string @samp{(DOS)} will appear near the left edge of the mode line; | |
2597 on DOS and Windows, where the DOS end-of-line (EOL) format is the | |
2598 default, a backslash (@samp{\}) will appear in the mode line. | |
2599 | |
2600 If you are running a version of Emacs before 20.1, get @code{crypt++} | |
2601 (@pxref{Packages that do not come with Emacs}). Among other things, | |
2602 @code{crypt++} transparently modifies MS-DOS files as they are loaded | |
2603 and saved, allowing you to ignore the different conventions that Unix | |
2604 and MS-DOS have for delineating the end of a line. | |
2605 | |
2606 @node Filling paragraphs with a single space, Escape sequences in shell output, Editing MS-DOS files, Common requests | |
2607 @section How can I tell Emacs to fill paragraphs with a single space after each period? | |
2608 @cindex One space following periods | |
2609 @cindex Single space following periods | |
2610 @cindex Periods, one space following | |
2611 | |
2612 Add the following line to your @file{.emacs} file: | |
2613 | |
2614 @lisp | |
2615 (setq sentence-end-double-space nil) | |
2616 @end lisp | |
2617 | |
2618 @node Escape sequences in shell output, Fullscreen mode on MS-Windows, Filling paragraphs with a single space, Common requests | |
2619 @section Why these strange escape sequences from @code{ls} from the Shell mode? | |
2620 @cindex Escape sequences in @code{ls} output | |
2621 @cindex @code{ls} in Shell mode | |
2622 | |
2623 This happens because @code{ls} is aliased to @samp{ls --color} in your | |
2624 shell init file. You have two alternatives to solve this: | |
2625 | |
2626 @itemize @bullet | |
2627 @item | |
2628 Make the alias conditioned on the @code{EMACS} variable in the | |
2629 environment. When Emacs runs a subsidiary shell, it exports the | |
2630 @code{EMACS} variable to that shell, with value equal to the absolute | |
2631 file name of Emacs. You can | |
2632 unalias @code{ls} when that happens, thus limiting the alias to your | |
2633 interactive sessions. | |
2634 | |
2635 @item | |
2636 Install the @code{ansi-color} package (bundled with Emacs 21.1 and | |
2637 later), which converts these ANSI escape sequences into colors. | |
2638 @end itemize | |
2639 | |
2640 @node Fullscreen mode on MS-Windows, , Escape sequences in shell output, Common requests | |
2641 @section How can I start Emacs in fullscreen mode on MS-Windows? | |
2642 @cindex Maximize frame | |
2643 @cindex Fullscreen mode | |
2644 | |
2645 Use the function @code{w32-send-sys-command}. For example, you can | |
2646 put the following in your @file{.emacs} file: | |
2647 | |
2648 @lisp | |
2649 (add-hook 'term-setup-hook | |
2650 #'(lambda () (w32-send-sys-command ?\xF030))) | |
2651 @end lisp | |
2652 | |
2653 To avoid the slightly distracting visual effect of Emacs starting with | |
2654 its default frame size and then growing to fullscreen, you can add an | |
2655 @samp{Emacs.Geometry} entry to the Windows registry settings (see | |
2656 @pxref{(emacs)X Resources}). | |
2657 | |
2658 To compute the correct values for width and height, first maximize the | |
2659 Emacs frame and then evaluate @code{(frame-height)} and | |
2660 @code{(frame-width)} with @kbd{M-:}. | |
2661 | |
2662 @c ------------------------------------------------------------ | |
2663 @node Bugs and problems, Compiling and installing Emacs, Common requests, Top | |
2664 @chapter Bugs and problems | |
2665 @cindex Bugs and problems | |
2666 | |
2667 The Emacs manual lists some common kinds of trouble users could get | |
2668 into, see @ref{Lossage, , Dealing with Emacs Trouble, emacs, The GNU | |
2669 Emacs Manual}, so you might look there if the problem you encounter | |
2670 isn't described in this chapter. If you decide you've discovered a bug, | |
2671 see @ref{Bugs, , Reporting Bugs, emacs, The GNU Emacs Manual}, for | |
2672 instructions how to do that. | |
2673 | |
2674 The file @file{etc/PROBLEMS} in the Emacs distribution lists various | |
2675 known problems with building and using Emacs on specific platforms; | |
2676 type @kbd{C-h C-e} to read it. | |
2677 | |
2678 @menu | |
2679 * Problems with very large files:: | |
2680 * ^M in the shell buffer:: | |
2681 * Shell process exits abnormally:: | |
2682 * Problems with Shell Mode on MS-Windows:: | |
2683 * Termcap/Terminfo entries for Emacs:: | |
2684 * Spontaneous entry into isearch-mode:: | |
2685 * Problems talking to certain hosts:: | |
2686 * Errors with init files:: | |
2687 * Emacs ignores X resources:: | |
2688 * Emacs ignores frame parameters:: | |
2689 * Emacs takes a long time to visit files:: | |
2690 * Editing files with $ in the name:: | |
2691 * Shell mode loses the current directory:: | |
2692 * Security risks with Emacs:: | |
2693 * Dired claims that no file is on this line:: | |
2694 @end menu | |
2695 | |
2696 @node Problems with very large files, ^M in the shell buffer, Bugs and problems, Bugs and problems | |
2697 @section Does Emacs have problems with files larger than 8 megabytes? | |
2698 @cindex Very large files, opening | |
2699 @cindex Large files, opening | |
2700 @cindex Opening very large files | |
2701 @cindex Maximum file size | |
2702 @cindex Files, maximum size | |
2703 | |
2704 Old versions (i.e., anything before 19.29) of Emacs had problems editing | |
2705 files larger than 8 megabytes. In versions 19.29 and later, the maximum | |
2706 buffer size is at least 2^27-1, or 134,217,727 bytes, or 132 MBytes. | |
2707 And in Emacs 22, the maximum buffer size has been increased to | |
2708 268,435,455 bytes (or 256 MBytes) on 32-bit machines. | |
2709 | |
2710 @node ^M in the shell buffer, Shell process exits abnormally, Problems with very large files, Bugs and problems | |
2711 @section How do I get rid of @samp{^M} or echoed commands in my shell buffer? | |
2712 @cindex Shell buffer, echoed commands and @samp{^M} in | |
2713 @cindex Echoed commands in @code{shell-mode} | |
2714 | |
2715 Try typing @kbd{M-x shell-strip-ctrl-m @key{RET}} while in @code{shell-mode} to | |
2716 make them go away. If that doesn't work, you have several options: | |
2717 | |
2718 For @code{tcsh}, put this in your @file{.cshrc} (or @file{.tcshrc}) | |
2719 file: | |
2720 | |
2721 @example | |
2722 if ($?EMACS) then | |
2723 if ("$EMACS" =~ /*) then | |
2724 if ($?tcsh) unset edit | |
2725 stty nl | |
2726 endif | |
2727 endif | |
2728 @end example | |
2729 | |
2730 Or put this in your @file{.emacs_tcsh} or @file{~/.emacs.d/init_tcsh.sh} file: | |
2731 | |
2732 @example | |
2733 unset edit | |
2734 stty nl | |
2735 @end example | |
2736 | |
2737 Alternatively, use @code{csh} in your shell buffers instead of | |
2738 @code{tcsh}. One way is: | |
2739 | |
2740 @lisp | |
2741 (setq explicit-shell-file-name "/bin/csh") | |
2742 @end lisp | |
2743 | |
2744 @noindent | |
2745 and another is to do this in your @file{.cshrc} (or @file{.tcshrc}) | |
2746 file: | |
2747 | |
2748 @example | |
2749 setenv ESHELL /bin/csh | |
2750 @end example | |
2751 | |
2752 @noindent | |
2753 (You must start Emacs over again with the environment variable properly | |
2754 set for this to take effect.) | |
2755 | |
2756 You can also set the @code{ESHELL} environment variable in Emacs Lisp | |
2757 with the following Lisp form, | |
2758 | |
2759 @lisp | |
2760 (setenv "ESHELL" "/bin/csh") | |
2761 @end lisp | |
2762 | |
2763 The above solutions try to prevent the shell from producing the | |
2764 @samp{^M} characters in the first place. If this is not possible | |
2765 (e.g., if you use a Windows shell), you can get Emacs to remove these | |
2766 characters from the buffer by adding this to your @file{.emacs} init | |
2767 file: | |
2768 | |
2769 @smalllisp | |
2770 (add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m) | |
2771 @end smalllisp | |
2772 | |
2773 On a related note: if your shell is echoing your input line in the shell | |
2774 buffer, you might want to customize the @code{comint-process-echoes} | |
2775 variable in your shell buffers, or try the following command in your | |
2776 shell start-up file: | |
2777 | |
2778 @example | |
2779 stty -icrnl -onlcr -echo susp ^Z | |
2780 @end example | |
2781 | |
2782 @node Shell process exits abnormally, Problems with Shell Mode on MS-Windows, ^M in the shell buffer, Bugs and problems | |
2783 @section Why do I get ``Process shell exited abnormally with code 1''? | |
2784 @cindex Abnormal exits from @code{shell-mode} | |
2785 @cindex @code{shell-mode} exits | |
2786 @cindex Process shell exited | |
2787 | |
2788 The most likely reason for this message is that the @samp{env} program | |
2789 is not properly installed. Compile this program for your architecture, | |
2790 and install it with @samp{a+x} permission in the architecture-dependent | |
2791 Emacs program directory. (You can find what this directory is at your | |
2792 site by inspecting the value of the variable @code{exec-directory} by | |
2793 typing @kbd{C-h v exec-directory @key{RET}}.) | |
2794 | |
2795 You should also check for other programs named @samp{env} in your path | |
2796 (e.g., SunOS has a program named @file{/usr/bin/env}). We don't | |
2797 understand why this can cause a failure and don't know a general | |
2798 solution for working around the problem in this case. | |
2799 | |
2800 The @samp{make clean} command will remove @samp{env} and other vital | |
2801 programs, so be careful when using it. | |
2802 | |
2803 It has been reported that this sometimes happened when Emacs was started | |
2804 as an X client from an xterm window (i.e., had a controlling tty) but the | |
2805 xterm was later terminated. | |
2806 | |
2807 See also @samp{PROBLEMS} (in the @file{etc} subdirectory of the | |
2808 top-level directory when you unpack the Emacs source) for other | |
2809 possible causes of this message. | |
2810 | |
2811 @node Problems with Shell Mode on MS-Windows, Termcap/Terminfo entries for Emacs, Shell process exits abnormally, Bugs and problems | |
2812 @section Why do I get an error message when I try to run @kbd{M-x shell}? | |
2813 | |
2814 @cindex Shell Mode, and MS-Windows | |
2815 @cindex @code{explicit-shell-file-name} | |
2816 On MS-Windows, this might happen because Emacs tries to look for the | |
2817 shell in a wrong place. The default file name @file{/bin/sh} is | |
2818 usually incorrect for non-Unix systems. If you know where your shell | |
2819 executable is, set the variable @code{explicit-shell-file-name} in | |
2820 your @file{.emacs} file to point to its full file name, like this: | |
2821 | |
2822 @lisp | |
2823 (setq explicit-shell-file-name "d:/shells/bash.exe") | |
2824 @end lisp | |
2825 | |
2826 If you don't know what shell does Emacs use, try the @kbd{M-!} | |
2827 command; if that works, put the following line into your | |
2828 @file{.emacs}: | |
2829 | |
2830 @lisp | |
2831 (setq explicit-shell-file-name shell-file-name) | |
2832 @end lisp | |
2833 | |
2834 @cindex Antivirus programs, and Shell Mode | |
2835 Some people have trouble with Shell Mode because of intrusive | |
2836 antivirus software; disabling the resident antivirus program solves | |
2837 the problems in those cases. | |
2838 | |
2839 @node Termcap/Terminfo entries for Emacs, Spontaneous entry into isearch-mode, Problems with Shell Mode on MS-Windows, Bugs and problems | |
2840 @section Where is the termcap/terminfo entry for terminal type @samp{emacs}? | |
2841 @cindex Termcap | |
2842 @cindex Terminfo | |
2843 @cindex Emacs entries for termcap/terminfo | |
2844 | |
2845 The termcap entry for terminal type @samp{emacs} is ordinarily put in | |
2846 the @samp{TERMCAP} environment variable of subshells. It may help in | |
2847 certain situations (e.g., using rlogin from shell buffer) to add an | |
2848 entry for @samp{emacs} to the system-wide termcap file. Here is a | |
2849 correct termcap entry for @samp{emacs}: | |
2850 | |
2851 @example | |
2852 emacs:tc=unknown: | |
2853 @end example | |
2854 | |
2855 To make a terminfo entry for @samp{emacs}, use @code{tic} or | |
2856 @code{captoinfo}. You need to generate | |
2857 @file{/usr/lib/terminfo/e/emacs}. It may work to simply copy | |
2858 @file{/usr/lib/terminfo/d/dumb} to @file{/usr/lib/terminfo/e/emacs}. | |
2859 | |
2860 Having a termcap/terminfo entry will not enable the use of full screen | |
2861 programs in shell buffers. Use @kbd{M-x terminal-emulator} for that | |
2862 instead. | |
2863 | |
2864 A workaround to the problem of missing termcap/terminfo entries is to | |
2865 change terminal type @samp{emacs} to type @samp{dumb} or @samp{unknown} | |
2866 in your shell start up file. @code{csh} users could put this in their | |
2867 @file{.cshrc} files: | |
2868 | |
2869 @example | |
2870 if ("$term" == emacs) set term=dumb | |
2871 @end example | |
2872 | |
2873 @node Spontaneous entry into isearch-mode, Problems talking to certain hosts, Termcap/Terminfo entries for Emacs, Bugs and problems | |
2874 @section Why does Emacs spontaneously start displaying @samp{I-search:} and beeping? | |
2875 @cindex Spontaneous entry into isearch-mode | |
2876 @cindex isearch-mode, spontaneous entry into | |
2877 @cindex Beeping without obvious reason | |
2878 | |
2879 Your terminal (or something between your terminal and the computer) is | |
2880 sending @kbd{C-s} and @kbd{C-q} for flow control, and Emacs is receiving | |
2881 these characters and interpreting them as commands. (The @kbd{C-s} | |
2882 character normally invokes the @code{isearch-forward} command.) For | |
2883 possible solutions, see @ref{Handling C-s and C-q with flow control}. | |
2884 | |
2885 @node Problems talking to certain hosts, Errors with init files, Spontaneous entry into isearch-mode, Bugs and problems | |
2886 @section Why can't Emacs talk to certain hosts (or certain hostnames)? | |
2887 @cindex Hosts, Emacs cannot talk to | |
2888 @cindex @code{gethostbyname}, problematic version | |
2889 | |
2890 The problem may be that Emacs is linked with a wimpier version of | |
2891 @code{gethostbyname} than the rest of the programs on the machine. This | |
2892 is often manifested as a message on startup of ``X server not responding. | |
2893 Check your @samp{DISPLAY} environment variable.'' or a message of | |
2894 ``Unknown host'' from @code{open-network-stream}. | |
2895 | |
2896 On a Sun, this may be because Emacs had to be linked with the static C | |
2897 library. The version of @code{gethostbyname} in the static C library | |
2898 may only look in @file{/etc/hosts} and the NIS (YP) maps, while the | |
2899 version in the dynamic C library may be smart enough to check DNS in | |
2900 addition to or instead of NIS. On a Motorola Delta running System V | |
2901 R3.6, the version of @code{gethostbyname} in the standard library works, | |
2902 but the one that works with NIS doesn't (the one you get with -linet). | |
2903 Other operating systems have similar problems. | |
2904 | |
2905 Try these options: | |
2906 | |
2907 @itemize @bullet | |
2908 | |
2909 @item | |
2910 Explicitly add the host you want to communicate with to @file{/etc/hosts}. | |
2911 | |
2912 @item | |
2913 Relink Emacs with this line in @file{src/config.h}: | |
2914 | |
2915 @example | |
2916 #define LIBS_SYSTEM -lresolv | |
2917 @end example | |
2918 | |
2919 @item | |
2920 Replace @code{gethostbyname} and friends in @file{libc.a} with more | |
2921 useful versions such as the ones in @file{libresolv.a}. Then relink | |
2922 Emacs. | |
2923 | |
2924 @item | |
2925 If you are actually running NIS, make sure that @code{ypbind} is | |
2926 properly told to do DNS lookups with the correct command line switch. | |
2927 | |
2928 @end itemize | |
2929 | |
2930 @node Errors with init files, Emacs ignores X resources, Problems talking to certain hosts, Bugs and problems | |
2931 @section Why does Emacs say @samp{Error in init file}? | |
2932 @cindex Error in @file{.emacs} | |
2933 @cindex Error in init file | |
2934 @cindex Init file, errors in | |
2935 @cindex @file{.emacs} file, errors in | |
2936 @cindex Debugging @file{.emacs} file | |
2937 | |
2938 An error occurred while loading either your @file{.emacs} file or the | |
2939 system-wide file @file{lisp/default.el}. Emacs 21.1 and later pops the | |
2940 @file{*Messages*} buffer, and puts there some additional information | |
2941 about the error, to provide some hints for debugging. | |
2942 | |
2943 For information on how to debug your @file{.emacs} file, see | |
2944 @ref{Debugging a customization file}. | |
2945 | |
2946 It may be the case that you need to load some package first, or use a | |
2947 hook that will be evaluated after the package is loaded. A common case | |
2948 of this is explained in @ref{Terminal setup code works after Emacs has | |
2949 begun}. | |
2950 | |
2951 @node Emacs ignores X resources, Emacs ignores frame parameters, Errors with init files, Bugs and problems | |
2952 @section Why does Emacs ignore my X resources (my .Xdefaults file)? | |
2953 @cindex X resources being ignored | |
2954 @cindex Ignored X resources | |
2955 @cindex @file{.Xdefaults} | |
2956 | |
2957 As of version 19, Emacs searches for X resources in the files specified | |
2958 by the following environment variables: | |
2959 | |
2960 @itemize @bullet | |
2961 | |
2962 @item @code{XFILESEARCHPATH} | |
2963 @item @code{XUSERFILESEARCHPATH} | |
2964 @item @code{XAPPLRESDIR} | |
2965 | |
2966 @end itemize | |
2967 | |
2968 This emulates the functionality provided by programs written using the | |
2969 Xt toolkit. | |
2970 | |
2971 @code{XFILESEARCHPATH} and @code{XUSERFILESEARCHPATH} should be a list | |
2972 of file names separated by colons. @code{XAPPLRESDIR} should be a list | |
2973 of directory names separated by colons. | |
2974 | |
2975 Emacs searches for X resources: | |
2976 | |
2977 @enumerate | |
2978 | |
2979 @item | |
2980 specified on the command line, with the @samp{-xrm RESOURCESTRING} option, | |
2981 | |
2982 @item | |
2983 then in the value of the @samp{XENVIRONMENT} environment variable, | |
2984 | |
2985 @itemize @minus | |
2986 | |
2987 @item | |
2988 or if that is unset, in the file named | |
2989 @file{~/.Xdefaults-@var{hostname}} if it exists (where @var{hostname} is | |
2990 the name of the machine Emacs is running on), | |
2991 | |
2992 @end itemize | |
2993 | |
2994 @item | |
2995 then in the screen-specific and server-wide resource properties provided | |
2996 by the server, | |
2997 | |
2998 @itemize @minus | |
2999 | |
3000 @item | |
3001 or if those properties are unset, in the file named @file{~/.Xdefaults} | |
3002 if it exists, | |
3003 | |
3004 @end itemize | |
3005 | |
3006 @item | |
3007 then in the files listed in @samp{XUSERFILESEARCHPATH}, | |
3008 | |
3009 @itemize @minus | |
3010 | |
3011 @item | |
3012 or in files named @file{@var{lang}/Emacs} in directories listed in | |
3013 @samp{XAPPLRESDIR} (where @var{lang} is the value of the @code{LANG} | |
3014 environment variable), if the @samp{LANG} environment variable is set, | |
3015 @item | |
3016 or in files named Emacs in the directories listed in @samp{XAPPLRESDIR} | |
3017 @item | |
3018 or in @file{~/@var{lang}/Emacs} (if the @code{LANG} environment variable | |
3019 is set), | |
3020 @item | |
3021 or in @file{~/Emacs}, | |
3022 | |
3023 @end itemize | |
3024 | |
3025 @item | |
3026 then in the files listed in @code{XFILESEARCHPATH}. | |
3027 | |
3028 @end enumerate | |
3029 | |
3030 @node Emacs ignores frame parameters, Emacs takes a long time to visit files, Emacs ignores X resources, Bugs and problems | |
3031 @section Why don't my customizations of the frame parameters work? | |
3032 @cindex Frame parameters | |
3033 | |
3034 This probably happens because you have set the frame parameters in the | |
3035 variable @code{initial-frame-alist}. That variable holds parameters | |
3036 used only for the first frame created when Emacs starts. To customize | |
3037 the parameters of all frames, change the variable | |
3038 @code{default-frame-alist} instead. | |
3039 | |
3040 These two variables exist because many users customize the initial frame | |
3041 in a special way. For example, you could determine the position and | |
3042 size of the initial frame, but would like to control the geometry of the | |
3043 other frames by individually positioning each one of them. | |
3044 | |
3045 | |
3046 @node Emacs takes a long time to visit files, Editing files with $ in the name, Emacs ignores frame parameters, Bugs and problems | |
3047 @section Why does Emacs take 20 seconds to visit a file? | |
3048 @cindex Visiting files takes a long time | |
3049 @cindex Delay when visiting files | |
3050 @cindex Files, take a long time to visit | |
3051 | |
3052 Old versions of Emacs (i.e., versions before Emacs 20.x) often | |
3053 encountered this when the master lock file, @file{!!!SuperLock!!!}, has | |
3054 been left in the lock directory somehow. Delete it. | |
3055 | |
3056 @email{meuer@@geom.umn.edu, Mark Meuer} says that NeXT NFS has a bug | |
3057 where an exclusive create succeeds but returns an error status. This | |
3058 can cause the same problem. Since Emacs's file locking doesn't work | |
3059 over NFS anyway, the best solution is to recompile Emacs with | |
3060 @code{CLASH_DETECTION} undefined. | |
3061 | |
3062 @node Editing files with $ in the name, Shell mode loses the current directory, Emacs takes a long time to visit files, Bugs and problems | |
3063 @section How do I edit a file with a @samp{$} in its name? | |
3064 @cindex Editing files with @samp{$} in the name | |
3065 @cindex @samp{$} in file names | |
3066 @cindex File names containing @samp{$}, editing | |
3067 | |
3068 When entering a file name in the minibuffer, Emacs will attempt to expand | |
3069 a @samp{$} followed by a word as an environment variable. To suppress | |
3070 this behavior, type @kbd{$$} instead. | |
3071 | |
3072 @node Shell mode loses the current directory, Security risks with Emacs, Editing files with $ in the name, Bugs and problems | |
3073 @section Why does shell mode lose track of the shell's current directory? | |
3074 @cindex Current directory and @code{shell-mode} | |
3075 @cindex @code{shell-mode} and current directory | |
3076 @cindex Directory, current in @code{shell-mode} | |
3077 | |
3078 Emacs has no way of knowing when the shell actually changes its | |
3079 directory. This is an intrinsic limitation of Unix. So it tries to | |
3080 guess by recognizing @samp{cd} commands. If you type @kbd{cd} followed | |
3081 by a directory name with a variable reference (@kbd{cd $HOME/bin}) or | |
3082 with a shell metacharacter (@kbd{cd ../lib*}), Emacs will fail to | |
3083 correctly guess the shell's new current directory. A huge variety of | |
3084 fixes and enhancements to shell mode for this problem have been written | |
3085 to handle this problem (@pxref{Finding a package with particular | |
3086 functionality}). | |
3087 | |
3088 You can tell Emacs the shell's current directory with the command | |
3089 @kbd{M-x dirs}. | |
3090 | |
3091 @node Security risks with Emacs, Dired claims that no file is on this line, Shell mode loses the current directory, Bugs and problems | |
3092 @section Are there any security risks in Emacs? | |
3093 @cindex Security with Emacs | |
3094 @cindex @samp{movemail} and security | |
3095 @cindex @code{file-local-variable} and security | |
3096 @cindex Synthetic X events and security | |
3097 @cindex X events and security | |
3098 | |
3099 @itemize @bullet | |
3100 | |
3101 @item | |
3102 The @file{movemail} incident. (No, this is not a risk.) | |
3103 | |
3104 In his book @cite{The Cuckoo's Egg}, Cliff Stoll describes this in | |
3105 chapter 4. The site at LBL had installed the @file{/etc/movemail} | |
3106 program setuid root. (As of version 19, @file{movemail} is in your | |
3107 architecture-specific directory; type @kbd{C-h v exec-directory | |
3108 @key{RET}} to see what it is.) Since @code{movemail} had not been | |
3109 designed for this situation, a security hole was created and users could | |
3110 get root privileges. | |
3111 | |
3112 @code{movemail} has since been changed so that this security hole will | |
3113 not exist, even if it is installed setuid root. However, | |
3114 @code{movemail} no longer needs to be installed setuid root, which | |
3115 should eliminate this particular risk. | |
3116 | |
3117 We have heard unverified reports that the 1988 Internet worm took | |
3118 advantage of this configuration problem. | |
3119 | |
3120 @item | |
3121 The @code{file-local-variable} feature. (Yes, a risk, but easy to | |
3122 change.) | |
3123 | |
3124 There is an Emacs feature that allows the setting of local values for | |
3125 variables when editing a file by including specially formatted text near | |
3126 the end of the file. This feature also includes the ability to have | |
3127 arbitrary Emacs Lisp code evaluated when the file is visited. | |
3128 Obviously, there is a potential for Trojan horses to exploit this | |
3129 feature. | |
3130 | |
3131 As of Emacs 22, Emacs has a list of local variables that are known to | |
3132 be safe to set. If a file tries to set any variable outside this | |
3133 list, it asks the user to confirm whether the variables should be set. | |
3134 You can also tell Emacs whether to allow the evaluation of Emacs Lisp | |
3135 code found at the bottom of files by setting the variable | |
3136 @code{enable-local-eval}. | |
3137 | |
3138 For more information, @inforef{File Variables, File Variables, emacs}. | |
3139 | |
3140 @item | |
3141 Synthetic X events. (Yes, a risk; use @samp{MIT-MAGIC-COOKIE-1} or | |
3142 better.) | |
3143 | |
3144 Emacs accepts synthetic X events generated by the @code{SendEvent} | |
3145 request as though they were regular events. As a result, if you are | |
3146 using the trivial host-based authentication, other users who can open X | |
3147 connections to your X workstation can make your Emacs process do | |
3148 anything, including run other processes with your privileges. | |
3149 | |
3150 The only fix for this is to prevent other users from being able to open | |
3151 X connections. The standard way to prevent this is to use a real | |
3152 authentication mechanism, such as @samp{MIT-MAGIC-COOKIE-1}. If using | |
3153 the @code{xauth} program has any effect, then you are probably using | |
3154 @samp{MIT-MAGIC-COOKIE-1}. Your site may be using a superior | |
3155 authentication method; ask your system administrator. | |
3156 | |
3157 If real authentication is not a possibility, you may be satisfied by | |
3158 just allowing hosts access for brief intervals while you start your X | |
3159 programs, then removing the access. This reduces the risk somewhat by | |
3160 narrowing the time window when hostile users would have access, but | |
3161 @emph{does not eliminate the risk}. | |
3162 | |
3163 On most computers running Unix and X, you enable and disable | |
3164 access using the @code{xhost} command. To allow all hosts access to | |
3165 your X server, use | |
3166 | |
3167 @example | |
3168 xhost + | |
3169 @end example | |
3170 | |
3171 @noindent | |
3172 at the shell prompt, which (on an HP machine, at least) produces the | |
3173 following message: | |
3174 | |
3175 @example | |
3176 access control disabled, clients can connect from any host | |
3177 @end example | |
3178 | |
3179 To deny all hosts access to your X server (except those explicitly | |
3180 allowed by name), use | |
3181 | |
3182 @example | |
3183 xhost - | |
3184 @end example | |
3185 | |
3186 On the test HP computer, this command generated the following message: | |
3187 | |
3188 @example | |
3189 access control enabled, only authorized clients can connect | |
3190 @end example | |
3191 | |
3192 @end itemize | |
3193 | |
3194 @node Dired claims that no file is on this line, , Security risks with Emacs, Bugs and problems | |
3195 @section Dired says, @samp{no file on this line} when I try to do something. | |
3196 @cindex Dired does not see a file | |
3197 | |
3198 @c FIXME: I think this is fixed in Emacs 21, but I didn't have time to | |
3199 @c check. | |
3200 Chances are you're using a localized version of Unix that doesn't use US | |
3201 date format in dired listings. You can check this by looking at dired | |
3202 listings or by typing @kbd{ls -l} to a shell and looking at the dates that | |
3203 come out. | |
3204 | |
3205 Dired uses a regular expression to find the beginning of a file name. | |
3206 In a long Unix-style directory listing (@samp{ls -l}), the file name | |
3207 starts after the date. The regexp has thus been written to look for the | |
3208 date, the format of which can vary on non-US systems. | |
3209 | |
3210 There are two approaches to solving this. The first one involves | |
3211 setting things up so that @samp{ls -l} outputs US date format. This can | |
3212 be done by setting the locale. See your OS manual for more information. | |
3213 | |
3214 The second approach involves changing the regular expression used by | |
3215 dired, @code{directory-listing-before-filename-regexp}. | |
3216 | |
3217 @c ------------------------------------------------------------ | |
3218 @node Compiling and installing Emacs, Finding Emacs and related packages, Bugs and problems, Top | |
3219 @chapter Compiling and installing Emacs | |
3220 @cindex Compiling and installing Emacs | |
3221 | |
3222 @menu | |
3223 * Installing Emacs:: | |
3224 * Updating Emacs:: | |
3225 * Problems building Emacs:: | |
3226 * Linking with -lX11 fails:: | |
3227 @end menu | |
3228 | |
3229 @node Installing Emacs, Updating Emacs, Compiling and installing Emacs, Compiling and installing Emacs | |
3230 @section How do I install Emacs? | |
3231 @cindex Installing Emacs | |
3232 @cindex Unix systems, installing Emacs on | |
3233 @cindex Downloading and installing Emacs | |
3234 @cindex Retrieving and installing Emacs | |
3235 @cindex Building Emacs from source | |
3236 @cindex Source code, building Emacs from | |
3237 @cindex Unpacking and installing Emacs | |
3238 | |
3239 This answer is meant for users of Unix and Unix-like systems. Users of | |
3240 other operating systems should see the series of questions beginning | |
3241 with @ref{Emacs for MS-DOS}, which describe where to get non-Unix source | |
3242 and binaries, and how to install Emacs on those systems. | |
3243 | |
3244 For Unix and Unix-like systems, the easiest way is often to compile it | |
3245 from scratch. You will need: | |
3246 | |
3247 @itemize @bullet | |
3248 | |
3249 @item | |
3250 Emacs sources. @xref{Current GNU distributions}, for a list of ftp sites | |
3251 that make them available. On @file{ftp.gnu.org}, the main GNU | |
3252 distribution site, sources are available as | |
3253 | |
3254 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-@value{VER}.tar.gz} | |
3255 | |
3256 The above will obviously change as new versions of Emacs come out. For | |
3257 instance, when Emacs 22.42 is released, it will most probably be | |
3258 available as | |
3259 | |
3260 @uref{ftp://ftp.gnu.org/pub/gnu/emacs/emacs-22.42.tar.gz} | |
3261 | |
3262 Again, you should use one of the GNU mirror sites (see @ref{Current GNU | |
3263 distributions}, and adjust the URL accordingly) so as to reduce load on | |
3264 @file{ftp.gnu.org}. | |
3265 | |
3266 @item | |
3267 @code{gzip}, the GNU compression utility. You can get @code{gzip} via | |
3268 anonymous ftp at mirrors of @file{ftp.gnu.org} sites; it should compile | |
3269 and install without much trouble on most systems. Once you have | |
3270 retrieved the Emacs sources, you will probably be able to uncompress | |
3271 them with the command | |
3272 | |
3273 @example | |
3274 gunzip --verbose emacs-@value{VER}.tar.gz | |
3275 @end example | |
3276 | |
3277 @noindent | |
3278 changing the Emacs version (@value{VER}), as necessary. Once | |
3279 @code{gunzip} has finished doing its job, a file by the name of | |
3280 @file{emacs-@value{VER}.tar} should be in your build directory. | |
3281 | |
3282 @item | |
3283 @code{tar}, the @dfn{tape archiving} program, which moves multiple files | |
3284 into and out of archive files, or @dfn{tarfiles}. All of the files | |
3285 comprising the Emacs source come in a single tarfile, and must be | |
3286 extracted using @code{tar} before you can build Emacs. Typically, the | |
3287 extraction command would look like | |
3288 | |
3289 @example | |
3290 tar -xvvf emacs-@value{VER}.tar | |
3291 @end example | |
3292 | |
3293 @noindent | |
3294 The @samp{x} indicates that we want to extract files from this tarfile, | |
3295 the two @samp{v}s force verbose output, and the @samp{f} tells | |
3296 @code{tar} to use a disk file, rather than one on the tape drive. | |
3297 | |
3298 If you're using GNU @code{tar} (available at mirrors of | |
3299 @file{ftp.gnu.org}), you can combine this step and the previous one by | |
3300 using the command | |
3301 | |
3302 @example | |
3303 tar -zxvvf emacs-@value{VER}.tar.gz | |
3304 @end example | |
3305 | |
3306 @noindent | |
3307 The additional @samp{z} at the beginning of the options list tells GNU | |
3308 @code{tar} to uncompress the file with @code{gunzip} before extracting | |
3309 the tarfile's components. | |
3310 | |
3311 @end itemize | |
3312 | |
3313 At this point, the Emacs sources (all 70+ megabytes of them) should be | |
3314 sitting in a directory called @file{emacs-@value{VER}}. On most common | |
3315 Unix and Unix-like systems, you should be able to compile Emacs (with X | |
3316 Window system support) with the following commands: | |
3317 | |
3318 @example | |
3319 cd emacs-@value{VER} # change directory to emacs-@value{VER} | |
3320 ./configure # configure Emacs for your particular system | |
3321 make # use Makefile to build components, then Emacs | |
3322 @end example | |
3323 | |
3324 If the @code{make} completes successfully, the odds are fairly good that | |
3325 the build has gone well. (@xref{Problems building Emacs}, if you weren't | |
3326 successful.) | |
3327 | |
3328 By default, Emacs is installed in the following directories: | |
3329 | |
3330 @table @file | |
3331 @item /usr/local/bin | |
3332 binaries. | |
3333 | |
3334 @item /usr/local/share/emacs/@value{VER} | |
3335 Lisp code and support files. | |
3336 | |
3337 @item /usr/local/info | |
3338 Info documentation. | |
3339 @end table | |
3340 | |
3341 To install files in those default directories, become the superuser and | |
3342 type | |
3343 | |
3344 @example | |
3345 make install | |
3346 @end example | |
3347 | |
3348 Note that @samp{make install} will overwrite @file{/usr/local/bin/emacs} | |
3349 and any Emacs Info files that might be in @file{/usr/local/info}. | |
3350 | |
3351 Much more verbose instructions (with many more hints and suggestions) | |
3352 come with the Emacs sources, in the file @file{INSTALL}. | |
3353 | |
3354 @node Updating Emacs, Problems building Emacs, Installing Emacs, Compiling and installing Emacs | |
3355 @section How do I update Emacs to the latest version? | |
3356 @cindex Updating Emacs | |
3357 | |
3358 @xref{Installing Emacs}, and follow the instructions there for | |
3359 installation. | |
3360 | |
3361 Most files are placed in version-specific directories. Emacs | |
3362 @value{VER}, for instance, places files in | |
3363 @file{/usr/local/share/emacs/@value{VER}}. | |
3364 | |
3365 Upgrading should overwrite only, @file{/usr/local/bin/emacs} (the Emacs | |
3366 binary) and documentation in @file{/usr/local/info}. Back up these | |
3367 files before you upgrade, and you shouldn't have too much trouble. | |
3368 | |
3369 @node Problems building Emacs, Linking with -lX11 fails, Updating Emacs, Compiling and installing Emacs | |
3370 @section What should I do if I have trouble building Emacs? | |
3371 @cindex Problems building Emacs | |
3372 @cindex Errors when building Emacs | |
3373 | |
3374 First look in the file @file{etc/PROBLEMS} (where you unpack the Emacs | |
3375 source) to see if there is already a solution for your problem. Next, | |
3376 look for other questions in this FAQ that have to do with Emacs | |
3377 installation and compilation problems. | |
3378 | |
3379 If you'd like to have someone look at your problem and help solve it, | |
3380 see @ref{Help installing Emacs}. | |
3381 | |
3382 If you cannot find a solution in the documentation, send a message to | |
3383 @email{bug-gnu-emacs@@gnu.org}. | |
3384 | |
3385 Please don't post it to @uref{news:gnu.emacs.help} or send e-mail to | |
3386 @email{help-gnu-emacs@@gnu.org}. For further guidelines, see | |
3387 @ref{Guidelines for newsgroup postings} and @ref{Reporting bugs}. | |
3388 | |
3389 @node Linking with -lX11 fails, , Problems building Emacs, Compiling and installing Emacs | |
3390 @section Why does linking Emacs with -lX11 fail? | |
3391 @cindex Linking with -lX11 fails | |
3392 @cindex lX11, linking fails with | |
3393 | |
3394 Emacs needs to be linked with the static version of the X11 library, | |
3395 @file{libX11.a}. This may be missing. | |
3396 | |
3397 On OpenWindows, you may need to use @code{add_services} to add the | |
3398 ``OpenWindows Programmers'' optional software category from the CD-ROM. | |
3399 | |
3400 On HP-UX 8.0, you may need to run @code{update} again to load the | |
3401 X11-PRG ``fileset.'' This may be missing even if you specified ``all | |
3402 filesets'' the first time. If @file{libcurses.a} is missing, you may | |
3403 need to load the ``Berkeley Development Option.'' | |
3404 | |
3405 @email{zoo@@armadillo.com, David Zuhn} says that MIT X builds shared | |
3406 libraries by default, and only shared libraries, on those platforms that | |
3407 support them. These shared libraries can't be used when undumping | |
3408 @code{temacs} (the last stage of the Emacs build process). To get | |
3409 regular libraries in addition to shared libraries, add this to | |
3410 @file{site.cf}: | |
3411 | |
3412 @example | |
3413 #define ForceNormalLib YES | |
3414 @end example | |
3415 | |
3416 Other systems may have similar problems. You can always define | |
3417 @code{CANNOT_DUMP} and link with the shared libraries instead. | |
3418 | |
3419 @cindex X Menus don't work | |
3420 To get the Xmenu stuff to work, you need to find a copy of MIT's | |
3421 @file{liboldX.a}. | |
3422 | |
3423 @c ------------------------------------------------------------ | |
3424 @node Finding Emacs and related packages, Major packages and programs, Compiling and installing Emacs, Top | |
3425 @chapter Finding Emacs and related packages | |
3426 @cindex Finding Emacs and related packages | |
3427 | |
3428 @menu | |
3429 * Finding Emacs on the Internet:: | |
3430 * Finding a package with particular functionality:: | |
3431 * Packages that do not come with Emacs:: | |
3432 * Current GNU distributions:: | |
3433 * Difference between Emacs and XEmacs:: | |
102261
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3434 * Emacs for minimalists:: |
84296 | 3435 * Emacs for MS-DOS:: |
3436 * Emacs for Windows:: | |
3437 * Emacs for OS/2:: | |
3438 * Emacs for Atari ST:: | |
3439 * Emacs for the Amiga :: | |
3440 * Emacs for NeXTSTEP:: | |
3441 * Emacs for Apple computers:: | |
3442 * Emacs for VMS and DECwindows:: | |
3443 * Modes for various languages:: | |
3444 @end menu | |
3445 | |
3446 @node Finding Emacs on the Internet, Finding a package with particular functionality, Finding Emacs and related packages, Finding Emacs and related packages | |
3447 @section Where can I get Emacs on the net (or by snail mail)? | |
3448 @cindex Finding Emacs on the Internet | |
3449 @cindex Snail mail, ordering Emacs via | |
3450 @cindex Postal service, ordering Emacs via | |
3451 @cindex Distribution, retrieving Emacs | |
3452 @cindex Internet, retrieving from | |
3453 | |
3454 Look in the files @file{etc/DISTRIB} and @file{etc/FTP} for | |
3455 information on nearby archive sites. If you don't already have Emacs, | |
3456 see @ref{Informational files for Emacs}, for how to get these files. | |
3457 | |
3458 @xref{Installing Emacs}, for information on how to obtain and build the latest | |
3459 version of Emacs, and see @ref{Current GNU distributions}, for a list of | |
3460 archive sites that make GNU software available. | |
3461 | |
3462 @node Finding a package with particular functionality, Packages that do not come with Emacs, Finding Emacs on the Internet, Finding Emacs and related packages | |
3463 @section How do I find a Emacs Lisp package that does XXX? | |
3464 @cindex Package, finding | |
3465 @cindex Finding an Emacs Lisp package | |
3466 @cindex Functionality, finding a particular package | |
3467 | |
3468 First of all, you should check to make sure that the package isn't | |
3469 already available. For example, typing @kbd{M-x apropos @key{RET} | |
3470 wordstar @key{RET}} lists all functions and variables containing the | |
3471 string @samp{wordstar}. | |
3472 | |
3473 It is also possible that the package is on your system, but has not been | |
3474 loaded. To see which packages are available for loading, look through | |
3475 your computer's lisp directory (@pxref{File-name conventions}). The Lisp | |
3476 source to most packages contains a short description of how they | |
3477 should be loaded, invoked, and configured---so before you use or | |
3478 modify a Lisp package, see if the author has provided any hints in the | |
3479 source code. | |
3480 | |
3481 The command @kbd{C-h p} (@code{finder-by-keyword}) allows you to browse | |
3482 the constituent Emacs packages. | |
3483 | |
3484 For advice on how to find extra packages that are not part of Emacs, | |
3485 see @ref{Packages that do not come with Emacs}. | |
3486 | |
3487 @node Packages that do not come with Emacs, Current GNU distributions, Finding a package with particular functionality, Finding Emacs and related packages | |
3488 @section Where can I get Emacs Lisp packages that don't come with Emacs? | |
3489 @cindex Unbundled packages | |
3490 @cindex Finding other packages | |
3491 @cindex Lisp packages that do not come with Emacs | |
3492 @cindex Packages, those that do not come with Emacs | |
3493 @cindex Emacs Lisp List | |
3494 @cindex Emacs Lisp Archive | |
3495 | |
3496 @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.html, The Emacs Lisp | |
3497 List (ELL)}, maintained by @email{stephen@@anc.ed.ac.uk, Stephen Eglen}, | |
3498 aims to provide one compact list with links to all of the current Emacs | |
3499 Lisp files on the Internet. The ELL can be browsed over the web, or | |
3500 from Emacs with @uref{http://www.anc.ed.ac.uk/~stephen/emacs/ell.el, | |
3501 the @file{ell} package}. | |
3502 | |
3503 Many authors post their packages to the @uref{news:gnu.emacs.sources, | |
3504 Emacs sources newsgroup}. You can search the archives of this | |
3505 group with @uref{http://groups.google.com/group/gnu.emacs.sources, Google}, | |
3506 or @uref{http://dir.gmane.org/gmane.emacs.sources, Gmane}, for example. | |
3507 | |
3508 Several packages are stored in | |
3509 @uref{http://emacswiki.org/elisp/, the Lisp area of the Emacs Wiki}. | |
3510 | |
3511 For a long time, the Emacs Lisp Archive provided a central repository | |
3512 for Emacs packages. Sadly, it has not been active for some time, | |
3513 although you can still access the old files at | |
3514 | |
3515 @uref{http://www.club.cc.cmu.edu/pub/gnu/elisp-archive/} | |
3516 | |
3517 Read the file @file{etc/MORE.STUFF} for more information about | |
3518 external packages. | |
3519 | |
3520 @node Current GNU distributions, Difference between Emacs and XEmacs, Packages that do not come with Emacs, Finding Emacs and related packages | |
3521 @section Where can I get other up-to-date GNU stuff? | |
3522 @cindex Current GNU distributions | |
3523 @cindex Sources for current GNU distributions | |
3524 @cindex Stuff, current GNU | |
3525 @cindex Up-to-date GNU stuff | |
3526 @cindex Finding current GNU software | |
3527 @cindex Official GNU software sites | |
3528 | |
3529 The most up-to-date official GNU software is normally kept at | |
3530 | |
3531 @uref{ftp://ftp.gnu.org/pub/gnu} | |
3532 | |
3533 Read the files @file{etc/DISTRIB} and @file{etc/FTP} for more | |
3534 information. | |
3535 | |
3536 A list of sites mirroring @samp{ftp.gnu.org} can be found at | |
3537 | |
3538 @uref{http://www.gnu.org/order/ftp.html} | |
3539 | |
102261
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3540 @node Difference between Emacs and XEmacs, Emacs for minimalists, Current GNU distributions, Finding Emacs and related packages |
84296 | 3541 @section What is the difference between Emacs and XEmacs (formerly Lucid Emacs)? |
3542 @cindex XEmacs | |
3543 @cindex Difference Emacs and XEmacs | |
3544 @cindex Lucid Emacs | |
3545 @cindex Epoch | |
3546 | |
3547 XEmacs is a branch version of Emacs. It was first called Lucid Emacs, | |
3548 and was initially derived from a prerelease version of Emacs 19. In | |
3549 this FAQ, we use the name ``Emacs'' only for the official version. | |
3550 | |
3551 Emacs and XEmacs each come with Lisp packages that are lacking in the | |
3552 other. The two versions have some significant differences at the Lisp | |
3553 programming level. Their current features are roughly comparable, | |
3554 though the support for some operating systems, character sets and | |
3555 specific packages might be quite different. | |
3556 | |
3557 Some XEmacs code has been contributed to Emacs, and we would like to | |
3558 use other parts, but the earlier XEmacs maintainers did not always | |
3559 keep track of the authors of contributed code, which makes it | |
3560 impossible for the FSF to get copyright papers signed for that code. | |
3561 (The FSF requires these papers for all the code included in the Emacs | |
3562 release, aside from generic C support packages that retain their | |
3563 separate identity and are not integrated into the code of Emacs | |
3564 proper.) | |
3565 | |
3566 If you want to talk about these two versions and distinguish them, | |
3567 please call them ``Emacs'' and ``XEmacs.'' To contrast ``XEmacs'' | |
3568 with ``GNU Emacs'' would be misleading, since XEmacs too has its | |
3569 origin in the work of the GNU Project. Terms such as ``Emacsen'' and | |
3570 ``(X)Emacs'' are not wrong, but they are not very clear, so it | |
3571 is better to write ``Emacs and XEmacs.'' | |
3572 | |
102261
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3573 @node Emacs for minimalists, Emacs for MS-DOS, Difference between Emacs and XEmacs, Finding Emacs and related packages |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3574 @section I don't have enough disk space to install Emacs |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3575 @cindex Zile |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3576 @cindex Not enough disk space to install Emacs |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3577 |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3578 GNU Zile is a lightweight Emacs clone. Zile is short for @samp{Zile Is |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3579 Lossy Emacs}. It has all of Emacs's basic editing features. The Zile |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3580 binary typically has a size of about 130 kbytes, so this can be useful |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3581 if you are in an extremely space-restricted environment. More |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3582 information is available from |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3583 |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3584 @uref{http://www.gnu.org/software/zile/} |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3585 |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3586 |
8931d7f39598
(Emacs for minimalists): New node. (Bug#2452)
Glenn Morris <rgm@gnu.org>
parents:
102059
diff
changeset
|
3587 @node Emacs for MS-DOS, Emacs for Windows, Emacs for minimalists, Finding Emacs and related packages |
84296 | 3588 @section Where can I get Emacs for my PC running MS-DOS? |
3589 @cindex MS-DOS, Emacs for | |
3590 @cindex DOS, Emacs for | |
3591 @cindex Compiling Emacs for DOS | |
3592 @cindex Emacs for MS-DOS | |
3593 @cindex Tools needed to compile Emacs under DOS | |
3594 | |
3595 A pre-built binary distribution of Emacs is available from the | |
3596 SimTel.NET archives. This version apparently works under MS-DOS and | |
3597 Windows (3.X, 9X, ME, NT, and 2000) and supports long file names under | |
3598 Windows 9X, Windows ME, and Windows 2000. More information is available | |
3599 from | |
3600 | |
3601 @uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/emacs.README} | |
3602 | |
3603 The binary itself is available in the files @file{em*.zip} in the | |
3604 directory | |
3605 | |
3606 @uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/} | |
3607 | |
3608 If you prefer to compile Emacs for yourself, you can do so with the | |
3609 current distribution directly. You will need a 386 (or | |
3610 better) processor, and to be running MS-DOS 3.0 or later. According to | |
3611 @email{eliz@@gnu.org, Eli Zaretskii} and | |
3612 @email{hankedr@@dms.auburn.edu, Darrel Hankerson}, you will need the | |
3613 following: | |
3614 | |
3615 @table @emph | |
3616 | |
3617 @item Compiler | |
3618 DJGPP version 1.12 maint 1 or later. Djgpp 2.0 or later is | |
3619 recommended, since 1.x is very old an unmaintained. Djgpp 2 supports | |
3620 long file names on Windows 9X/ME/2K. | |
3621 | |
3622 You can get the latest release of DJGPP by retrieving all of | |
3623 the files in | |
3624 | |
3625 @uref{ftp://ftp.delorie.com/pub/djgpp/current/v2*} | |
3626 | |
3627 @item Unpacking program | |
3628 The easiest way is to use @code{djtar} which comes with DJGPP v2.x, | |
3629 because it can open gzip'ed tarfiles (i.e., those ending with | |
3630 @file{.tar.gz}) in one step. @code{Djtar} comes in | |
3631 @file{djdev@var{nnn}.zip} archive (where @var{nnn} is the DJGPP version | |
3632 number), from the URL mentioned above. | |
3633 | |
3634 @strong{Warning!} Do @strong{not} use the popular WinZip program to | |
3635 unpack the Emacs distribution! WinZip is known to corrupt some of the | |
3636 files by converting them to the DOS CR-LF format, it doesn't always | |
3637 preserve the directory structure recorded in the compressed Emacs | |
3638 archive, and commits other atrocities. Some of these problems could | |
3639 actually prevent Emacs from building successfully! | |
3640 | |
3641 @item make, mv, sed, and rm | |
3642 All of these utilities are available at | |
3643 | |
3644 @uref{ftp://ftp.delorie.com/pub/djgpp/current/v2gnu} | |
3645 | |
3646 16-bit utilities can be found in GNUish, at | |
3647 | |
3648 @uref{http://www.simtel.net/pub/gnuish/} | |
3649 | |
3650 @noindent | |
3651 (@code{mv} and @code{rm} are in the Fileutils package, @code{sed} and | |
3652 @code{make} are each one in a separate package named after them.) | |
3653 | |
3654 @end table | |
3655 | |
3656 The files @file{INSTALL} (near its end) and @file{etc/PROBLEMS} in the | |
3657 directory of the Emacs sources contains some additional information | |
3658 regarding Emacs under MS-DOS. | |
3659 | |
3660 For a list of other MS-DOS implementations of Emacs (and Emacs | |
3661 look-alikes), consult the list of ``Emacs implementations and literature,'' | |
3662 available at | |
3663 | |
3664 @uref{ftp://rtfm.mit.edu/pub/usenet/comp.emacs/} | |
3665 | |
3666 Note that while many of these programs look similar to Emacs, they often | |
3667 lack certain features, such as the Emacs Lisp extension language. | |
3668 | |
3669 @node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages | |
3670 @section Where can I get Emacs for Microsoft Windows? | |
3671 @cindex FAQ for NT Emacs | |
3672 @cindex Emacs for MS-Windows | |
3673 @cindex Microsoft Windows, Emacs for | |
3674 @cindex Windows 9X, ME, NT, 2K, and CE, Emacs for | |
3675 | |
3676 For information on Emacs for Windows 95 and NT, read the FAQ produced by | |
3677 @email{voelker@@cs.washington.edu, Geoff Voelker} and currently maintained | |
3678 by @email{ramprasad@@gnu.org, Ramprasad B}, available at | |
3679 | |
3680 @uref{http://www.gnu.org/software/emacs/windows/ntemacs.html} | |
3681 | |
3682 @xref{Emacs for MS-DOS}, for Windows 3.1. | |
3683 | |
3684 A port of Emacs 20.7 for Windows CE, based on NTEmacs, is available at | |
3685 | |
3686 @uref{http://www.rainer-keuchel.de/software.html} | |
3687 | |
3688 @noindent | |
3689 This port was done by @email{coyxc@@rainer-keuchel.de, Rainer Keuchel}, | |
3690 and supports all Emacs features except async subprocesses and menus. | |
3691 You will need MSVC 6.0 and a Windows CE SDK to build this port. | |
3692 | |
3693 @node Emacs for OS/2, Emacs for Atari ST, Emacs for Windows, Finding Emacs and related packages | |
3694 @section Where can I get Emacs for my PC running OS/2? | |
3695 @cindex OS/2, Emacs for | |
3696 | |
3697 Emacs 20.6 is ported for emx on OS/2 2.0 or 2.1, and is available at | |
3698 | |
3699 @uref{ftp://hobbes.nmsu.edu/pub/os2/apps/editors/emacs/} | |
3700 | |
3701 @noindent | |
3702 and also at | |
3703 | |
3704 @uref{http://www.dotemacs.de/os2/emacs.html} | |
3705 | |
3706 Instructions for installation, basic setup, and other useful information | |
3707 for OS/2 users of Emacs can be found at | |
3708 | |
3709 @uref{http://home.snafu.de/ohei/emacs/emacs206-os2.html} | |
3710 | |
3711 @node Emacs for Atari ST, Emacs for the Amiga , Emacs for OS/2, Finding Emacs and related packages | |
3712 @section Where can I get Emacs for my Atari ST? | |
3713 @cindex Atari ST, Emacs for | |
3714 @cindex TOS, Emacs for | |
3715 | |
3716 Roland Sch@"auble reports that Emacs 18.58 running on plain TOS and MiNT | |
3717 is available at | |
3718 @uref{ftp://atari.archive.umich.edu/Editors/Emacs-18-58/1858b-d3.zoo}. | |
3719 | |
3720 @node Emacs for the Amiga , Emacs for NeXTSTEP, Emacs for Atari ST, Finding Emacs and related packages | |
3721 @section Where can I get Emacs for my Amiga? | |
3722 @cindex Amiga, Emacs for | |
3723 | |
3724 The files you need are available at | |
3725 | |
3726 @uref{ftp://ftp.wustl.edu/pub/aminet/util/gnu/} | |
3727 | |
3728 @email{dgilbert@@gamiga.guelphnet.dweomer.org, David Gilbert} has released a | |
3729 beta version of Emacs 19.25 for the Amiga. You can get the binary at | |
3730 | |
3731 @uref{ftp://ftp.wustl.edu/pub/aminet/util/gnu/a2.0bEmacs-bin.lha} | |
3732 | |
3733 @node Emacs for NeXTSTEP, Emacs for Apple computers, Emacs for the Amiga , Finding Emacs and related packages | |
3734 @section Where can I get Emacs for NeXTSTEP? | |
3735 @cindex NeXTSTEP, Emacs for | |
3736 | |
3737 Emacs.app is a NeXTSTEP version of Emacs 19.34 which supports colors, | |
3738 menus, and multiple frames. You can get it from | |
3739 | |
3740 @uref{ftp://next-ftp.peak.org/pub/next-ftp/next/apps/emacs/Emacs_for_NeXTstep.4.20a1.NIHS.b.tar.gz} | |
3741 | |
3742 @node Emacs for Apple computers, Emacs for VMS and DECwindows, Emacs for NeXTSTEP, Finding Emacs and related packages | |
3743 @section Where can I get Emacs for my Apple computer? | |
3744 @cindex Apple computers, Emacs for | |
3745 @cindex Macintosh, Emacs for | |
3746 | |
3747 Beginning with version 22.1, Emacs supports Mac OS X natively. | |
3748 | |
3749 @node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages | |
3750 @section Where do I get Emacs that runs on VMS under DECwindows? | |
3751 @cindex DECwindows, Emacs for | |
3752 @cindex VMS, Emacs for | |
3753 | |
3754 Up-to-date information about GNU software (including Emacs) for VMS is | |
3755 available at @uref{http://www.lp.se/gnu-vms/}. | |
3756 | |
3757 @node Modes for various languages, , Emacs for VMS and DECwindows, Finding Emacs and related packages | |
3758 @section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk? | |
3759 @cindex Awk, mode for | |
3760 @cindex @code{awk-mode} | |
3761 @cindex Bison, mode for | |
3762 @cindex Bourne Shell, mode for | |
3763 @cindex C@t{++}, mode for | |
3764 @cindex Java, mode for | |
3765 @cindex Lex mode | |
3766 @cindex Objective-C, mode for | |
3767 @cindex @code{pascal-mode} | |
3768 @cindex Shell mode | |
3769 @cindex Yacc mode | |
3770 @cindex @file{csh} mode | |
3771 @cindex @code{sh-mode} | |
3772 @cindex @code{cc-mode} | |
3773 | |
3774 Most of these modes are now available in standard Emacs distribution. | |
3775 To get additional modes, see @ref{Finding a package with particular | |
3776 functionality}. | |
3777 | |
3778 Barry Warsaw's @code{cc-mode} now works for C, C@t{++}, Objective-C, and | |
3779 Java code. It is distributed with Emacs, but has | |
3780 @uref{http://cc-mode.sourceforge.net/, its own homepage}. | |
3781 | |
3782 @c ------------------------------------------------------------ | |
3783 @node Major packages and programs, Key bindings, Finding Emacs and related packages, Top | |
3784 @chapter Major packages and programs | |
3785 @cindex Major packages and programs | |
3786 | |
3787 @menu | |
3788 * VM:: | |
3789 * AUCTeX:: | |
3790 * BBDB:: | |
3791 * Ispell:: | |
3792 * Emacs/W3:: | |
3793 * EDB:: | |
3794 * Mailcrypt:: | |
3795 * JDE:: | |
3796 * Patch:: | |
3797 @end menu | |
3798 | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3799 @node VM, AUCTeX, Major packages and programs, Major packages and programs |
84296 | 3800 @section VM (View Mail) --- another mail reader within Emacs, with MIME support |
3801 @cindex VM | |
3802 @cindex Alternative mail software | |
3803 @cindex View Mail | |
3804 @cindex E-mail reader, VM | |
3805 | |
3806 @table @b | |
3807 | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3808 @item Maintainer |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3809 @email{hack@@robf.de, Robert Widhopf-Fenk} |
84296 | 3810 |
3811 @item Latest version | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3812 8.0 |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3813 |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3814 @item Web site |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3815 @uref{http://www.nongnu.org/viewmail/} |
84296 | 3816 |
3817 @item Informational newsgroup | |
3818 @uref{news:gnu.emacs.vm.info}@* | |
3819 | |
3820 @item Bug reports newsgroup | |
3821 @uref{news:gnu.emacs.vm.bug}@* | |
3822 @end table | |
3823 | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3824 VM was originally written by @uref{http://www.wonderworks.com/vm/,Kyle Jones}. |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3825 @uref{ftp://ftp.wonderworks.com/pub/vm/,Older versions} of VM remain |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3826 available. |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3827 |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3828 |
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3829 @node AUCTeX, BBDB, VM, Major packages and programs |
84296 | 3830 @section AUC@TeX{} --- enhanced @TeX{} modes with debugging facilities |
3831 @cindex Mode for @TeX{} | |
3832 @cindex @TeX{} mode | |
3833 @cindex AUC@TeX{} mode for editing @TeX{} | |
3834 @cindex Writing and debugging @TeX{} | |
3835 | |
3836 AUC@TeX{} is a set of sophisticated major modes for @TeX{}, LaTeX, | |
3837 ConTeXt, and Texinfo offering context-sensitive syntax highlighting, | |
3838 indentation, formatting and folding, macro completion, @TeX{} shell | |
3839 functionality, and debugging. Be also sure to check out | |
3840 @ref{Introduction, RefTeX, Introduction, reftex, Ref@TeX{} User Manual}. | |
3841 Current versions of AUC@TeX{} include the | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3842 @uref{http://www.gnu.org/software/auctex/preview-latex.html,preview-latex} |
84296 | 3843 package for WYSIWYG previews of various LaTeX constructs in the Emacs |
3844 source buffer. | |
3845 | |
3846 @table @b | |
3847 | |
3848 @item Authors | |
3849 @email{krab@@iesd.auc.dk, Kresten Krab Thorup}, @* | |
3850 @email{abraham@@dina.kvl.dk, Per Abrahamsen}, @* and others. | |
3851 | |
3852 @item Maintainer | |
3853 @email{dak@@gnu.org, David Kastrup} | |
3854 | |
3855 @item Latest version | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3856 11.85 |
84296 | 3857 |
3858 @item Distribution | |
3859 @uref{ftp://ftp.gnu.org/pub/gnu/auctex/} | |
3860 | |
3861 @item Web site | |
3862 @uref{http://www.gnu.org/software/auctex/} | |
3863 | |
3864 @item Mailing list: | |
3865 Subscription requests to @email{auctex-request@@gnu.org}@* | |
3866 Submissions to @email{auctex@@gnu.org} | |
3867 | |
3868 @end table | |
3869 | |
3870 @node BBDB, Ispell, AUCTeX, Major packages and programs | |
3871 @section BBDB --- personal Info Rolodex integrated with mail/news readers | |
3872 @cindex BBDB | |
3873 @cindex Rolodex-like functionality | |
3874 @cindex Integrated contact database | |
3875 @cindex Contact database | |
3876 @cindex Big Brother Database | |
3877 @cindex Address book | |
3878 | |
3879 @table @b | |
3880 | |
3881 @item Maintainer | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3882 @email{hack@@robf.de, Robert Widhopf-Fenk} |
84296 | 3883 |
3884 @item Latest version | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
3885 2.35 |
84296 | 3886 |
3887 @item Distribution | |
3888 @uref{http://bbdb.sourceforge.net/} | |
3889 | |
3890 @item Mailing lists | |
3891 Subscription requests to @email{bbdb-info-request@@lists.sourceforge.net}@* | |
3892 Submissions to @email{bbdb-info@@lists.sourceforge.net}@* | |
3893 Release announcements: @email{bbdb-announce-request@@lists.sourceforge.net} | |
3894 | |
3895 @end table | |
3896 | |
3897 @node Ispell, Emacs/W3, BBDB, Major packages and programs | |
3898 @section Ispell --- spell checker in C with interface for Emacs | |
3899 @cindex Spell-checker | |
3900 @cindex Checking spelling | |
3901 @cindex Ispell | |
3902 | |
3903 @table @b | |
3904 | |
3905 @item Author | |
3906 @email{geoff@@cs.hmc.edu, Geoff Kuenning} | |
3907 | |
3908 @item Latest version | |
3909 3.3.02 | |
3910 | |
3911 @item Distribution | |
3912 @uref{http://fmg-www.cs.ucla.edu/geoff/tars/ispell-3.3.02.tar.gz}@* | |
3913 | |
3914 @item Web site | |
3915 @uref{http://fmg-www.cs.ucla.edu/geoff/ispell.html} | |
3916 | |
3917 @end table | |
3918 | |
3919 This Ispell program is distinct from GNU Ispell 4.0. GNU Ispell 4.0 is | |
3920 no longer a supported product. | |
3921 | |
3922 @node Emacs/W3, EDB, Ispell, Major packages and programs | |
3923 @section Emacs/W3 --- A World Wide Web browser inside of Emacs | |
3924 @cindex WWW browser | |
3925 @cindex Web browser | |
3926 @cindex HTML browser in Emacs | |
3927 @cindex @code{w3-mode} | |
3928 | |
3929 @table @b | |
3930 | |
3931 @item Author | |
3932 @email{wmperry@@gnu.org, Bill Perry} | |
3933 | |
3934 @item Maintainer | |
3935 Emacs/W3 needs a maintainer. It has lain dormant for several years. If | |
3936 you would like to take over the project, please contact | |
3937 @email{maintainers@@gnu.org}. | |
3938 | |
3939 @item Latest version | |
3940 4.0pre.47 | |
3941 | |
3942 @item Distribution | |
3943 @uref{http://savannah.gnu.org/projects/w3} | |
3944 | |
3945 @item Mailing lists | |
3946 Receive announcements from @email{w3-announce@@gnu.org}@* | |
3947 Help to develop Emacs/W3 at @email{w3-dev@@gnu.org} | |
3948 | |
3949 @end table | |
3950 | |
3951 @node EDB, Mailcrypt, Emacs/W3, Major packages and programs | |
3952 @section EDB --- Database program for Emacs; replaces forms editing modes | |
3953 @cindex EDB | |
3954 @cindex Database | |
3955 @cindex Forms mode | |
3956 | |
3957 @table @b | |
3958 @item Author | |
3959 @email{mernst@@theory.lcs.mit.edu, Michael Ernst} | |
3960 | |
3961 @item Latest version | |
3962 1.21 | |
3963 | |
3964 @item Distribution | |
3965 @uref{ftp://theory.lcs.mit.edu/pub/emacs/edb} | |
3966 | |
3967 @end table | |
3968 | |
3969 @node Mailcrypt, JDE, EDB, Major packages and programs | |
3970 @section Mailcrypt --- PGP interface within Emacs mail and news | |
3971 @cindex PGP | |
3972 @cindex GPG | |
3973 @cindex Interface to PGP from Emacs mail and news | |
3974 @cindex News, interface to PGP from | |
3975 @cindex Mail, interface to PGP from | |
3976 @cindex Encryption software, interface to | |
3977 | |
3978 @table @b | |
3979 | |
3980 @item Authors | |
3981 @email{patl@@lcs.mit.edu, Patrick J. LoPresti} and | |
3982 @email{jin@@atype.com, Jin S. Choi} | |
3983 | |
3984 @item Maintainer | |
3985 @email{warner-mailcrypt@@lothar.com, Brian Warner} | |
3986 | |
3987 @item Latest version | |
3988 3.5.8 | |
3989 | |
3990 @item Distribution | |
3991 @uref{http://dl.sourceforge.net/sourceforge/mailcrypt/mailcrypt-3.5.8.tar.gz} | |
3992 | |
3993 @item Web site | |
3994 @uref{http://mailcrypt.sourceforge.net/} | |
3995 | |
3996 @end table | |
3997 | |
3998 Note that a new package called PGG is bundled with Emacs starting with | |
3999 version 22.1. It is a modern interface to various PGP implementations, | |
4000 including @uref{http://www.gnupg.org/, The GNU Privacy Guard} and | |
4001 supports symmetric encryption. | |
4002 | |
4003 @node JDE, Patch, Mailcrypt, Major packages and programs | |
4004 @section JDE --- Integrated development environment for Java | |
4005 @cindex Java development environment | |
4006 @cindex Integrated Java development environment | |
4007 @cindex JDE | |
4008 | |
4009 @table @b | |
4010 | |
4011 @item Author | |
4012 @email{paulk@@mathworks.com, Paul Kinnucan} | |
4013 | |
4014 @item Latest version | |
4015 2.3.5 | |
4016 | |
4017 @item Web site | |
4018 @uref{http://jdee.sunsite.dk/} | |
4019 | |
4020 @item Mailing lists | |
4021 Subscription requests to @email{jde-subscribe@@sunsite.dk}@* | |
4022 Receive announcements from @email{jde-announce-subscribe@@sunsite.dk} | |
4023 | |
4024 @end table | |
4025 | |
4026 @node Patch, , JDE, Major packages and programs | |
4027 @section Patch --- program to apply ``diffs'' for updating files | |
4028 @cindex Updating files with diffs | |
4029 @cindex Patching source files with diffs | |
4030 @cindex Diffs and patching | |
4031 @cindex @file{patch} | |
4032 | |
4033 @table @b | |
4034 | |
4035 @item Author | |
4036 @email{lwall@@wall.org, Larry Wall} (with GNU modifications) | |
4037 | |
4038 @item Latest version | |
4039 2.5.4 | |
4040 | |
4041 @item Distribution | |
4042 @xref{Current GNU distributions}. | |
4043 | |
4044 @end table | |
4045 | |
4046 @c ------------------------------------------------------------ | |
4047 @node Key bindings, Alternate character sets, Major packages and programs, Top | |
4048 @chapter Key bindings | |
4049 @cindex Key bindings | |
4050 | |
4051 @menu | |
4052 * Binding keys to commands:: | |
4053 * Invalid prefix characters:: | |
4054 * Terminal setup code works after Emacs has begun:: | |
4055 * Using function keys under X:: | |
4056 * Working with function and arrow keys:: | |
4057 * X key translations for Emacs:: | |
4058 * Handling C-s and C-q with flow control:: | |
4059 * Binding C-s and C-q:: | |
4060 * Backspace invokes help:: | |
4061 * stty and Backspace key:: | |
4062 * Swapping keys:: | |
4063 * Producing C-XXX with the keyboard:: | |
4064 * No Meta key:: | |
4065 * No Escape key:: | |
4066 * Compose Character:: | |
4067 * Binding combinations of modifiers and function keys:: | |
4068 * Meta key does not work in xterm:: | |
4069 * ExtendChar key does not work as Meta:: | |
4070 * SPC no longer completes file names:: | |
4071 @end menu | |
4072 | |
4073 @node Binding keys to commands, Invalid prefix characters, Key bindings, Key bindings | |
4074 @section How do I bind keys (including function keys) to commands? | |
4075 @cindex Binding keys to commands | |
4076 @cindex Keys, binding to commands | |
4077 @cindex Commands, binding keys to | |
4078 | |
4079 Keys can be bound to commands either interactively or in your | |
4080 @file{.emacs} file. To interactively bind keys for all modes, type | |
4081 @kbd{M-x global-set-key @key{RET} @var{key} @var{cmd} @key{RET}}. | |
4082 | |
4083 To bind a key just in the current major mode, type @kbd{M-x | |
4084 local-set-key @key{RET} @var{key} @var{cmd} @key{RET}}. | |
4085 | |
4086 @inforef{Key Bindings, Key Bindings, emacs}, for further details. | |
4087 | |
4088 To make the process of binding keys interactively easier, use the | |
4089 following ``trick'': First bind the key interactively, then immediately | |
4090 type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed | |
4091 to bind the key is in the kill ring, and can be yanked into your | |
4092 @file{.emacs} file. If the key binding is global, no changes to the | |
4093 command are required. For example, | |
4094 | |
4095 @lisp | |
4096 (global-set-key (quote [f1]) (quote help-for-help)) | |
4097 @end lisp | |
4098 | |
4099 @noindent | |
4100 can be placed directly into the @file{.emacs} file. If the key binding is | |
4101 local, the command is used in conjunction with the @samp{add-hook} function. | |
4102 For example, in TeX mode, a local binding might be | |
4103 | |
4104 @lisp | |
4105 (add-hook 'tex-mode-hook | |
4106 (lambda () | |
4107 (local-set-key (quote [f1]) (quote help-for-help)))) | |
4108 @end lisp | |
4109 | |
4110 | |
4111 @itemize @bullet | |
4112 | |
4113 @item | |
4114 Control characters in key sequences, in the form yanked from the kill | |
4115 ring are given in their graphic form---i.e., @key{CTRL} is shown as | |
4116 @samp{^}, @key{TAB} as a set of spaces (usually 8), etc. You may want | |
4117 to convert these into their vector or string forms. | |
4118 | |
4119 @item | |
4120 If a prefix key of the character sequence to be bound is already | |
4121 bound as a complete key, then you must unbind it before the new | |
4122 binding. For example, if @kbd{ESC @{} is previously bound: | |
4123 | |
4124 @lisp | |
4125 (global-unset-key [?\e ?@{]) ;; or | |
4126 (local-unset-key [?\e ?@{]) | |
4127 @end lisp | |
4128 | |
4129 @item | |
4130 Aside from commands and ``lambda lists,'' a vector or string also | |
4131 can be bound to a key and thus treated as a macro. For example: | |
4132 | |
4133 @lisp | |
4134 (global-set-key [f10] [?\C-x?\e?\e?\C-a?\C-k?\C-g]) ;; or | |
4135 (global-set-key [f10] "\C-x\e\e\C-a\C-k\C-g") | |
4136 @end lisp | |
4137 | |
4138 @end itemize | |
4139 | |
4140 @node Invalid prefix characters, Terminal setup code works after Emacs has begun, Binding keys to commands, Key bindings | |
4141 @section Why does Emacs say @samp{Key sequence XXX uses invalid prefix characters}? | |
4142 @cindex Prefix characters, invalid | |
4143 @cindex Invalid prefix characters | |
4144 @cindex Misspecified key sequences | |
4145 | |
4146 Usually, one of two things has happened. In one case, the control | |
4147 character in the key sequence has been misspecified (e.g. @samp{C-f} | |
4148 used instead of @samp{\C-f} within a Lisp expression). In the other | |
4149 case, a @dfn{prefix key} in the keystroke sequence you were trying to bind | |
4150 was already bound as a @dfn{complete key}. Historically, the @samp{ESC [} | |
4151 prefix was usually the problem, in which case you should evaluate either | |
4152 of these forms before attempting to bind the key sequence: | |
4153 | |
4154 @lisp | |
4155 (global-unset-key [?\e ?[]) ;; or | |
4156 (global-unset-key "\e[") | |
4157 @end lisp | |
4158 | |
4159 @node Terminal setup code works after Emacs has begun, Using function keys under X, Invalid prefix characters, Key bindings | |
4160 @section Why doesn't this [terminal or window-system setup] code work in my @file{.emacs} file, but it works just fine after Emacs starts up? | |
4161 @cindex Terminal setup code in @file{.emacs} | |
4162 | |
4163 During startup, Emacs initializes itself according to a given code/file | |
4164 order. If some of the code executed in your @file{.emacs} file needs to | |
4165 be postponed until the initial terminal or window-system setup code has | |
4166 been executed but is not, then you will experience this problem (this | |
4167 code/file execution order is not enforced after startup). | |
4168 | |
4169 To postpone the execution of Emacs Lisp code until after terminal or | |
4170 window-system setup, treat the code as a @dfn{lambda list} and set the | |
4171 value of either the @code{term-setup-hook} or @code{window-setup-hook} | |
4172 variable to this lambda function. For example, | |
4173 | |
4174 @lisp | |
4175 (add-hook 'term-setup-hook | |
4176 (lambda () | |
4177 (when (string-match "\\`vt220" (or (getenv "TERM") "")) | |
4178 ;; Make vt220's "Do" key behave like M-x: | |
4179 (global-set-key [do] 'execute-extended-command)))) | |
4180 @end lisp | |
4181 | |
4182 For information on what Emacs does every time it is started, see the | |
4183 @file{lisp/startup.el} file. | |
4184 | |
4185 @node Using function keys under X, Working with function and arrow keys, Terminal setup code works after Emacs has begun, Key bindings | |
4186 @section How do I use function keys under X? | |
4187 @cindex Function keys | |
4188 @cindex X Window System and function keys | |
4189 @cindex Binding function keys | |
4190 | |
4191 With Emacs 19, functions keys under X are bound like any other key. @xref{Binding keys to commands}, for details. | |
4192 | |
4193 @node Working with function and arrow keys, X key translations for Emacs, Using function keys under X, Key bindings | |
4194 @section How do I tell what characters or symbols my function or arrow keys emit? | |
4195 @cindex Working with arrow keys | |
4196 @cindex Arrow keys, symbols generated by | |
4197 @cindex Working with function keys | |
4198 @cindex Function keys, symbols generated by | |
4199 @cindex Symbols generated by function keys | |
4200 | |
4201 Type @kbd{C-h c} then the function or arrow keys. The command will | |
4202 return either a function key symbol or character sequence (see the | |
4203 Emacs on-line documentation for an explanation). This works for other | |
4204 keys as well. | |
4205 | |
4206 @node X key translations for Emacs, Handling C-s and C-q with flow control, Working with function and arrow keys, Key bindings | |
4207 @section How do I set the X key ``translations'' for Emacs? | |
4208 @cindex X key translations | |
4209 @cindex Key translations under X | |
4210 @cindex Translations for keys under X | |
4211 | |
4212 Emacs is not written using the Xt library by default, so there are no | |
4213 ``translations'' to be set. (We aren't sure how to set such translations | |
4214 if you do build Emacs with Xt; please let us know if you've done this!) | |
4215 | |
4216 The only way to affect the behavior of keys within Emacs is through | |
4217 @code{xmodmap} (outside Emacs) or @code{define-key} (inside Emacs). The | |
4218 @code{define-key} command should be used in conjunction with the | |
4219 @code{function-key-map} map. For instance, | |
4220 | |
4221 @lisp | |
4222 (define-key function-key-map [M-@key{TAB}] [?\M-\t]) | |
4223 @end lisp | |
4224 | |
4225 @noindent | |
4226 defines the @kbd{M-@key{TAB}} key sequence. | |
4227 | |
4228 @node Handling C-s and C-q with flow control, Binding C-s and C-q, X key translations for Emacs, Key bindings | |
4229 @section How do I handle @kbd{C-s} and @kbd{C-q} being used for flow control? | |
4230 @cindex Flow control, @kbd{C-s} and @kbd{C-q} with | |
4231 @cindex @kbd{C-s} and @kbd{C-q} with flow control | |
4232 | |
4233 @kbd{C-s} and @kbd{C-q} are used in the XON/XOFF flow control protocol. | |
4234 This messes things up when you're using Emacs over a serial line, | |
4235 because Emacs binds these keys to commands by default. Because Emacs | |
4236 won't honor them as flow control characters, too many of these | |
4237 characters are not passed on and overwhelm output buffers. Sometimes, | |
4238 intermediate software using XON/XOFF flow control will prevent Emacs | |
4239 from ever seeing @kbd{C-s} and @kbd{C-q}. | |
4240 | |
4241 Possible solutions: | |
4242 | |
4243 @itemize @bullet | |
4244 | |
4245 @item | |
4246 Disable the use of @kbd{C-s} and @kbd{C-q} for flow control. | |
4247 | |
4248 You need to determine the cause of the flow control. | |
4249 | |
4250 @itemize @minus | |
4251 | |
4252 @item | |
4253 your terminal | |
4254 | |
4255 Your terminal may use XON/XOFF flow control to have time to display | |
4256 all the characters it receives. For example, VT series terminals do | |
4257 this. It may be possible to turn this off from a setup menu. For | |
4258 example, on a VT220 you may select ``No XOFF'' in the setup menu. This | |
4259 is also true for some terminal emulation programs on PCs. | |
4260 | |
4261 When you turn off flow control at the terminal, you will also need to | |
4262 turn it off at the other end, which might be at the computer you are | |
4263 logged in to or at some terminal server in between. | |
4264 | |
4265 If you turn off flow control, characters may be lost; using a printer | |
4266 connected to the terminal may fail. You may be able to get around | |
4267 this problem by modifying the @samp{termcap} entry for your terminal to | |
4268 include extra NUL padding characters. | |
4269 | |
4270 @item | |
4271 a modem | |
4272 | |
4273 If you are using a dialup connection, the modems may be using | |
4274 XON/XOFF flow control. It's not clear how to get around this. | |
4275 | |
4276 @item | |
4277 a router or terminal server | |
4278 | |
4279 Some network box between the terminal and your computer may be using | |
4280 XON/XOFF flow control. It may be possible to make it use some other | |
4281 kind of flow control. You will probably have to ask your local | |
4282 network experts for help with this. | |
4283 | |
4284 @item | |
4285 @code{tty} and/or @code{pty} devices | |
4286 | |
4287 If your connection to Emacs goes through multiple @code{tty} and/or | |
4288 @code{pty} devices, they may be using XON/XOFF flow control even when it | |
4289 is not necessary. | |
4290 | |
4291 @email{eirik@@theory.tn.cornell.edu, Eirik Fuller} writes: | |
4292 | |
4293 @quotation | |
4294 Some versions of @code{rlogin} (and possibly @code{telnet}) do not pass | |
4295 flow control characters to the remote system to which they connect. On | |
4296 such systems, Emacs on the remote system cannot disable flow control on | |
4297 the local system. Sometimes @samp{rlogin -8} will avoid this problem. | |
4298 | |
4299 One way to cure this is to disable flow control on the local host (the | |
4300 one running @code{rlogin}, not the one running @code{rlogind}) using the | |
4301 @code{stty} command, before starting the @code{rlogin} process. On many | |
4302 systems, @samp{stty start u stop u} will do this. | |
4303 | |
4304 Some versions of @samp{tcsh} will prevent even this from working. One | |
4305 way around this is to start another shell before starting rlogin, | |
4306 and issue the @samp{stty} command to disable flow control from that shell. | |
4307 @end quotation | |
4308 | |
4309 Use @samp{stty -ixon} instead of @samp{stty start u stop u} on some systems. | |
4310 | |
4311 @end itemize | |
4312 | |
4313 @item | |
4314 Make Emacs speak the XON/XOFF flow control protocol. | |
4315 | |
4316 You can make Emacs treat @kbd{C-s} and @kbd{C-q} as flow control characters by | |
4317 evaluating the form | |
4318 | |
4319 @lisp | |
4320 (enable-flow-control) | |
4321 @end lisp | |
4322 | |
4323 @noindent | |
4324 to unconditionally enable flow control or | |
4325 | |
4326 @lisp | |
4327 (enable-flow-control-on "vt100" "h19") | |
4328 @end lisp | |
4329 | |
4330 @noindent | |
4331 (using your terminal names instead of @samp{vt100} or @samp{h19}) to | |
4332 enable selectively. These commands will automatically swap @kbd{C-s} | |
4333 and @kbd{C-q} to @kbd{C-\} and @kbd{C-^}. Variables can be used to | |
4334 change the default swap keys (@code{flow-control-c-s-replacement} and | |
4335 @code{flow-control-c-q-replacement}). | |
4336 | |
4337 If you are fixing this for yourself, simply put the form in your | |
4338 @file{.emacs} file. If you are fixing this for your entire site, the | |
4339 best place to put it is in the @file{site-lisp/site-start.el} file. | |
4340 (Here @file{site-lisp} is actually a subdirectory of your Emacs | |
4341 installation directory, typically @file{/usr/local/share/emacs}.) | |
4342 Putting this form in @file{site-lisp/default.el} has the problem that | |
4343 if the user's @file{.emacs} file has an error, this will prevent | |
4344 @file{default.el} from being loaded and Emacs may be unusable for the | |
4345 user, even for correcting their @file{.emacs} file (unless they're | |
4346 smart enough to move it to another name). | |
4347 | |
4348 @code{enable-flow-control} can be invoked interactively as well: | |
4349 @kbd{M-x enable-flow-control @key{RET}}. | |
4350 | |
4351 @end itemize | |
4352 | |
4353 For further discussion of this issue, read the file @file{etc/PROBLEMS} | |
4354 (in the Emacs source directory when you unpack the Emacs distribution). | |
4355 | |
4356 @node Binding C-s and C-q, Backspace invokes help, Handling C-s and C-q with flow control, Key bindings | |
4357 @section How do I bind @kbd{C-s} and @kbd{C-q} (or any key) if these keys are filtered out? | |
4358 @cindex Binding @kbd{C-s} and @kbd{C-q} | |
4359 @cindex @kbd{C-s} and @kbd{C-q}, binding | |
4360 | |
4361 To bind @kbd{C-s} and @kbd{C-q}, use either @code{enable-flow-control} | |
4362 or @code{enable-flow-control-on}. @xref{Handling C-s and C-q with flow | |
4363 control}, for usage and implementation details. | |
4364 | |
4365 To bind other keys, use @code{keyboard-translate}. @xref{Swapping | |
4366 keys}, for usage details. To do this for an entire site, you should | |
4367 swap the keys in @file{site-lisp/site-start.el}. @xref{Handling C-s | |
4368 and C-q with flow control}, for an explanation of why | |
4369 @file{site-lisp/default.el} should not be used. | |
4370 | |
4371 @itemize @bullet | |
4372 | |
4373 @item | |
4374 If you do this for an entire site, the users will be confused by | |
4375 the disparity between what the documentation says and how Emacs | |
4376 actually behaves. | |
4377 | |
4378 @end itemize | |
4379 | |
4380 @node Backspace invokes help, stty and Backspace key, Binding C-s and C-q, Key bindings | |
4381 @section Why does the @key{Backspace} key invoke help? | |
4382 @cindex Backspace key invokes help | |
4383 @cindex Help invoked by Backspace | |
4384 @cindex DEL key does not delete | |
4385 | |
4386 The @key{Backspace} key (on most keyboards) generates @acronym{ASCII} code 8. | |
4387 @kbd{C-h} sends the same code. In Emacs by default @kbd{C-h} invokes | |
4388 help-command. This is intended to be easy to remember since the first | |
4389 letter of @samp{help} is @samp{h}. The easiest solution to this problem | |
4390 is to use @kbd{C-h} (and @key{Backspace}) for help and @key{DEL} (the | |
4391 @key{Delete} key) for deleting the previous character. | |
4392 | |
4393 For many people this solution may be problematic: | |
4394 | |
4395 @itemize @bullet | |
4396 | |
4397 @item | |
4398 They normally use @key{Backspace} outside of Emacs for deleting the | |
4399 previous character. This can be solved by making @key{DEL} the command | |
4400 for deleting the previous character outside of Emacs. On many Unix | |
4401 systems, this command will remap @key{DEL}: | |
4402 | |
4403 @example | |
4404 stty erase `^?' | |
4405 @end example | |
4406 | |
4407 @item | |
4408 The user may prefer the @key{Backspace} key for deleting the | |
4409 previous character because it is more conveniently located on their | |
4410 keyboard or because they don't even have a separate @key{Delete} key. | |
4411 In this case, the @key{Backspace} key should be made to behave like | |
4412 @key{Delete}. There are several methods. | |
4413 | |
4414 @itemize @minus | |
4415 @item | |
4416 Some terminals (e.g., VT3## terminals) and terminal emulators (e.g., | |
4417 TeraTerm) allow the character generated by the @key{Backspace} key to be | |
4418 changed from a setup menu. | |
4419 | |
4420 @item | |
4421 You may be able to get a keyboard that is completely programmable, or a | |
4422 terminal emulator that supports remapping of any key to any other key. | |
4423 | |
4424 @item | |
4425 With Emacs 21.1 and later, you can control the effect of the | |
4426 @key{Backspace} and @key{Delete} keys, on both dumb terminals and a | |
4427 windowed displays, by customizing the option | |
4428 @code{normal-erase-is-backspace-mode}, or by invoking @kbd{M-x | |
4429 normal-erase-is-backspace}. See the documentation of these symbols | |
4430 (@pxref{Emacs Lisp documentation}) for more info. | |
4431 | |
4432 @item | |
4433 It is possible to swap the @key{Backspace} and @key{DEL} keys inside | |
4434 Emacs: | |
4435 | |
4436 @lisp | |
4437 (keyboard-translate ?\C-h ?\C-?) | |
4438 @end lisp | |
4439 | |
4440 @noindent | |
4441 This is the recommended method of forcing @key{Backspace} to act as | |
4442 @key{DEL}, because it works even in modes which bind @key{DEL} to | |
4443 something other than @code{delete-backward-char}. | |
4444 | |
4445 Similarly, you could remap @key{DEL} to act as @kbd{C-d}, which by | |
4446 default deletes forward: | |
4447 | |
4448 @lisp | |
4449 (keyboard-translate ?\C-? ?\C-d) | |
4450 @end lisp | |
4451 | |
4452 @xref{Swapping keys}, for further details about @code{keyboard-translate}. | |
4453 | |
4454 @item | |
4455 Another approach is to switch key bindings and put help on @kbd{C-x h} | |
4456 instead: | |
4457 | |
4458 @lisp | |
4459 (global-set-key "\C-h" 'delete-backward-char) | |
4460 | |
4461 ;; overrides mark-whole-buffer | |
4462 (global-set-key "\C-xh" 'help-command) | |
4463 @end lisp | |
4464 | |
4465 @noindent | |
4466 This method is not recommended, though: it only solves the problem for | |
4467 those modes which bind @key{DEL} to @code{delete-backward-char}. Modes | |
4468 which bind @key{DEL} to something else, such as @code{view-mode}, will | |
4469 not work as you expect when you press the @key{Backspace} key. For this | |
4470 reason, we recommend the @code{keyboard-translate} method, shown | |
4471 above. | |
4472 | |
4473 Other popular key bindings for help are @kbd{M-?} and @kbd{C-x ?}. | |
4474 @end itemize | |
4475 | |
4476 Don't try to bind @key{DEL} to @code{help-command}, because there are | |
4477 many modes that have local bindings of @key{DEL} that will interfere. | |
4478 | |
4479 @end itemize | |
4480 | |
4481 When Emacs 21 or later runs on a windowed display, it binds the | |
4482 @key{Delete} key to a command which deletes the character at point, to | |
4483 make Emacs more consistent with keyboard operation on these systems. | |
4484 | |
4485 For more information about troubleshooting this problem, see @ref{DEL | |
4486 Does Not Delete, , If @key{DEL} Fails to Delete, emacs, The GNU Emacs | |
4487 Manual}. | |
4488 | |
4489 @node stty and Backspace key, Swapping keys, Backspace invokes help, Key bindings | |
4490 @section Why doesn't Emacs look at the @file{stty} settings for @key{Backspace} vs. @key{Delete}? | |
4491 @cindex @file{stty} and Emacs | |
4492 @cindex Backspace and @file{stty} | |
4493 @cindex Delete and @file{stty} | |
4494 | |
4495 Good question! | |
4496 | |
4497 @c FIXME: RMS explained the reasons for this on emacs-hackers. It's | |
4498 @c probably worth putting that explanation here. | |
4499 | |
4500 @node Swapping keys, Producing C-XXX with the keyboard, stty and Backspace key, Key bindings | |
4501 @section How do I swap two keys? | |
4502 @cindex Swapping keys | |
4503 @cindex Keys, swapping | |
4504 @cindex @code{keyboard-translate} | |
4505 | |
4506 You can swap two keys (or key sequences) by using the | |
4507 @code{keyboard-translate} function. For example, to turn @kbd{C-h} | |
4508 into @key{DEL} and @key{DEL} to @kbd{C-h}, use | |
4509 | |
4510 @lisp | |
4511 (keyboard-translate ?\C-h ?\C-?) ; translate `C-h' to DEL | |
4512 (keyboard-translate ?\C-? ?\C-h) ; translate DEL to `C-h'. | |
4513 @end lisp | |
4514 | |
4515 @noindent | |
4516 The first key sequence of the pair after the function identifies what is | |
4517 produced by the keyboard; the second, what is matched for in the | |
4518 keymaps. | |
4519 | |
4520 However, in the specific case of @kbd{C-h} and @key{DEL}, you should | |
4521 toggle @code{normal-erase-is-backspace-mode} instead of calling | |
4522 @code{keyboard-translate}. @inforef{DEL Does Not Delete, DEL Does Not Delete, | |
4523 emacs}. | |
4524 | |
4525 Keyboard translations are not the same as key bindings in keymaps. | |
4526 Emacs contains numerous keymaps that apply in different situations, but | |
4527 there is only one set of keyboard translations, and it applies to every | |
4528 character that Emacs reads from the terminal. Keyboard translations | |
4529 take place at the lowest level of input processing; the keys that are | |
4530 looked up in keymaps contain the characters that result from keyboard | |
4531 translation. | |
4532 | |
4533 @node Producing C-XXX with the keyboard, No Meta key, Swapping keys, Key bindings | |
4534 @section How do I produce C-XXX with my keyboard? | |
4535 @cindex Producing control characters | |
4536 @cindex Generating control characters | |
4537 @cindex Control characters, generating | |
4538 | |
4539 On terminals (but not under X), some common ``aliases'' are: | |
4540 | |
4541 @table @asis | |
4542 | |
4543 @item @kbd{C-2} or @kbd{C-@key{SPC}} | |
4544 @kbd{C-@@} | |
4545 | |
4546 @item @kbd{C-6} | |
4547 @kbd{C-^} | |
4548 | |
4549 @item @kbd{C-7} or @kbd{C-S--} | |
4550 @kbd{C-_} | |
4551 | |
4552 @item @kbd{C-4} | |
4553 @kbd{C-\} | |
4554 | |
4555 @item @kbd{C-5} | |
4556 @kbd{C-]} | |
4557 | |
4558 @item @kbd{C-/} | |
4559 @kbd{C-?} | |
4560 | |
4561 @end table | |
4562 | |
4563 Often other aliases exist; use the @kbd{C-h c} command and try | |
4564 @key{CTRL} with all of the digits on your keyboard to see what gets | |
4565 generated. You can also try the @kbd{C-h w} command if you know the | |
4566 name of the command. | |
4567 | |
4568 @node No Meta key, No Escape key, Producing C-XXX with the keyboard, Key bindings | |
4569 @section What if I don't have a @key{Meta} key? | |
4570 @cindex No @key{Meta} key | |
4571 @cindex @key{Meta} key, what to do if you lack it | |
4572 | |
4573 On many keyboards, the @key{Alt} key acts as @key{Meta}, so try it. | |
4574 | |
4575 Instead of typing @kbd{M-a}, you can type @kbd{@key{ESC} a}. In fact, | |
4576 Emacs converts @kbd{M-a} internally into @kbd{@key{ESC} a} anyway | |
4577 (depending on the value of @code{meta-prefix-char}). Note that you | |
4578 press @key{Meta} and @key{a} together, but with @key{ESC}, you press | |
4579 @key{ESC}, release it, and then press @key{a}. | |
4580 | |
4581 @node No Escape key, Compose Character, No Meta key, Key bindings | |
4582 @section What if I don't have an @key{Escape} key? | |
4583 @cindex No Escape key | |
4584 @cindex Lacking an Escape key | |
4585 @cindex Escape key, lacking | |
4586 | |
4587 Type @kbd{C-[} instead. This should send @acronym{ASCII} code 27 just like an | |
4588 Escape key would. @kbd{C-3} may also work on some terminal (but not | |
4589 under X). For many terminals (notably DEC terminals) @key{F11} | |
4590 generates @key{ESC}. If not, the following form can be used to bind it: | |
4591 | |
4592 @lisp | |
4593 ;; F11 is the documented ESC replacement on DEC terminals. | |
4594 (define-key function-key-map [f11] [?\e]) | |
4595 @end lisp | |
4596 | |
4597 @node Compose Character, Binding combinations of modifiers and function keys, No Escape key, Key bindings | |
4598 @section Can I make my @key{Compose Character} key behave like a @key{Meta} key? | |
4599 @cindex @key{Compose Character} key, using as @key{Meta} | |
4600 @cindex @key{Meta}, using @key{Compose Character} for | |
4601 | |
4602 On a dumb terminal such as a VT220, no. It is rumored that certain | |
4603 VT220 clones could have their @key{Compose} key configured this way. If | |
4604 you're using X, you might be able to do this with the @code{xmodmap} | |
4605 command. | |
4606 | |
4607 @node Binding combinations of modifiers and function keys, Meta key does not work in xterm, Compose Character, Key bindings | |
4608 @section How do I bind a combination of modifier key and function key? | |
4609 @cindex Modifiers and function keys | |
4610 @cindex Function keys and modifiers | |
4611 @cindex Binding modifiers and function keys | |
4612 | |
4613 With Emacs 19 and later, you can represent modified function keys in | |
4614 vector format by adding prefixes to the function key symbol. For | |
4615 example (from the on-line documentation): | |
4616 | |
4617 @lisp | |
4618 (global-set-key [?\C-x right] 'forward-page) | |
4619 @end lisp | |
4620 | |
4621 @noindent | |
4622 where @samp{?\C-x} is the Lisp character constant for the character @kbd{C-x}. | |
4623 | |
4624 You can use the modifier keys @key{Control}, @key{Meta}, @key{Hyper}, | |
4625 @key{Super}, @key{Alt}, and @key{Shift} with function keys. To | |
4626 represent these modifiers, prepend the strings @samp{C-}, @samp{M-}, | |
4627 @samp{H-}, @samp{s-}, @samp{A-}, and @samp{S-} to the symbol name. Here | |
4628 is how to make @kbd{H-M-RIGHT} move forward a word: | |
4629 | |
4630 @lisp | |
4631 (global-set-key [H-M-right] 'forward-word) | |
4632 @end lisp | |
4633 | |
4634 @itemize @bullet | |
4635 | |
4636 @item | |
4637 Not all modifiers are permitted in all situations. @key{Hyper}, | |
4638 @key{Super}, and @key{Alt} are not available on Unix character | |
4639 terminals. Non-@acronym{ASCII} keys and mouse events (e.g. @kbd{C-=} and | |
4640 @kbd{Mouse-1}) also fall under this category. | |
4641 | |
4642 @end itemize | |
4643 | |
4644 @xref{Binding keys to commands}, for general key binding instructions. | |
4645 | |
4646 @node Meta key does not work in xterm, ExtendChar key does not work as Meta, Binding combinations of modifiers and function keys, Key bindings | |
4647 @section Why doesn't my @key{Meta} key work in an @code{xterm} window? | |
4648 @cindex @key{Meta} key and @code{xterm} | |
4649 @cindex Xterm and @key{Meta} key | |
4650 | |
4651 @inforef{Unibyte Mode, Single-Byte Character Set Support, emacs}. | |
4652 | |
4653 If the advice in the Emacs manual fails, try all of these methods before | |
4654 asking for further help: | |
4655 | |
4656 @itemize @bullet | |
4657 | |
4658 @item | |
4659 You may have big problems using @code{mwm} as your window manager. | |
4660 (Does anyone know a good generic solution to allow the use of the | |
4661 @key{Meta} key in Emacs with @file{mwm}?) | |
4662 | |
4663 @item | |
4664 For X11: Make sure it really is a @key{Meta} key. Use @code{xev} to | |
4665 find out what keysym your @key{Meta} key generates. It should be either | |
4666 @code{Meta_L} or @code{Meta_R}. If it isn't, use @file{xmodmap} to fix | |
4667 the situation. If @key{Meta} does generate @code{Meta_L} or | |
4668 @code{Meta_R}, but @kbd{M-x} produces a non-@acronym{ASCII} character, put this in | |
4669 your @file{~/.Xdefaults} file: | |
4670 | |
4671 @example | |
4672 XTerm*eightBitInput: false | |
4673 XTerm*eightBitOutput: true | |
4674 @end example | |
4675 | |
4676 @item | |
4677 Make sure the @code{pty} the @code{xterm} is using is passing 8 bit | |
4678 characters. @samp{stty -a} (or @samp{stty everything}) should show | |
4679 @samp{cs8} somewhere. If it shows @samp{cs7} instead, use @samp{stty | |
4680 cs8 -istrip} (or @samp{stty pass8}) to fix it. | |
4681 | |
4682 @item | |
4683 If there is an @code{rlogin} connection between @code{xterm} and Emacs, the | |
4684 @samp{-8} argument may need to be given to rlogin to make it pass all 8 bits | |
4685 of every character. | |
4686 | |
4687 @item | |
4688 If Emacs is running on Ultrix, it is reported that evaluating | |
4689 @code{(set-input-mode t nil)} helps. | |
4690 | |
4691 @item | |
4692 If all else fails, you can make @code{xterm} generate @kbd{@key{ESC} W} when | |
4693 you type @kbd{M-W}, which is the same conversion Emacs would make if it | |
4694 got the @kbd{M-W} anyway. In X11R4, the following resource | |
4695 specification will do this: | |
4696 | |
4697 @example | |
4698 XTerm.VT100.EightBitInput: false | |
4699 @end example | |
4700 | |
4701 @noindent | |
4702 (This changes the behavior of the @code{insert-eight-bit} action.) | |
4703 | |
4704 With older @code{xterm}s, you can specify this behavior with a translation: | |
4705 | |
4706 @example | |
4707 XTerm.VT100.Translations: #override \ | |
4708 Meta<KeyPress>: string(0x1b) insert() | |
4709 @end example | |
4710 | |
4711 @noindent | |
4712 You might have to replace @samp{Meta} with @samp{Alt}. | |
4713 | |
4714 @end itemize | |
4715 | |
4716 @node ExtendChar key does not work as Meta, SPC no longer completes file names, Meta key does not work in xterm, Key bindings | |
4717 @section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x? | |
4718 @cindex @key{ExtendChar} key as @key{Meta} | |
4719 @cindex @key{Meta}, using @key{ExtendChar} for | |
4720 @cindex HP-UX, the @key{ExtendChar} key | |
4721 | |
4722 This is a result of an internationalization extension in X11R4 and the | |
4723 fact that HP is now using this extension. Emacs assumes that the | |
4724 @code{XLookupString} function returns the same result regardless of the | |
4725 @key{Meta} key state which is no longer necessarily true. Until Emacs | |
4726 is fixed, the temporary kludge is to run this command after each time | |
4727 the X server is started but preferably before any xterm clients are: | |
4728 | |
4729 @example | |
4730 xmodmap -e 'remove mod1 = Mode_switch' | |
4731 @end example | |
4732 | |
4733 @c FIXME: Emacs 21 supports I18N in X11; does that mean that this bug is | |
4734 @c solved? | |
4735 | |
4736 This will disable the use of the extra keysyms systemwide, which may be | |
4737 undesirable if you actually intend to use them. | |
4738 | |
4739 @node SPC no longer completes file names, , ExtendChar key does not work as Meta, Key bindings | |
4740 @section Why doesn't SPC complete file names anymore? | |
4741 @cindex @kbd{SPC} file name completion | |
4742 | |
4743 Starting with Emacs 22.1, @kbd{SPC} no longer completes file names in | |
4744 the minibuffer, so that file names with embedded spaces could be typed | |
4745 without the need to quote the spaces. | |
4746 | |
4747 You can get the old behavior by binding @kbd{SPC} to | |
4748 @code{minibuffer-complete-word} in the minibuffer, as follows: | |
4749 | |
4750 @lisp | |
4751 (define-key minibuffer-local-filename-completion-map (kbd "SPC") | |
4752 'minibuffer-complete-word) | |
4753 | |
4754 (define-key minibuffer-local-must-match-filename-map (kbd "SPC") | |
4755 'minibuffer-complete-word) | |
4756 @end lisp | |
4757 | |
4758 @c ------------------------------------------------------------ | |
4759 @node Alternate character sets, Mail and news, Key bindings, Top | |
4760 @chapter Alternate character sets | |
4761 @cindex Alternate character sets | |
4762 | |
4763 @menu | |
4764 * Emacs does not display 8-bit characters:: | |
4765 * Inputting eight-bit characters:: | |
4766 * Kanji and Chinese characters:: | |
4767 * Right-to-left alphabets:: | |
4768 * How to add fonts:: | |
4769 @end menu | |
4770 | |
4771 @node Emacs does not display 8-bit characters, Inputting eight-bit characters, Alternate character sets, Alternate character sets | |
4772 @section How do I make Emacs display 8-bit characters? | |
4773 @cindex Displaying eight-bit characters | |
4774 @cindex Eight-bit characters, displaying | |
4775 | |
4776 @inforef{Unibyte Mode, Single-byte Character Set | |
4777 Support, emacs}. On a Unix, when Emacs runs on a text-only terminal | |
4778 display or is invoked with @samp{emacs -nw}, you typically need to use | |
4779 @code{set-terminal-coding-system} to tell Emacs what the terminal can | |
4780 display, even after setting the language environment; otherwise | |
4781 non-@acronym{ASCII} characters will display as @samp{?}. On other operating | |
4782 systems, such as MS-DOS and MS-Windows, Emacs queries the OS about the | |
4783 character set supported by the display, and sets up the required | |
4784 terminal coding system automatically. | |
4785 | |
4786 @node Inputting eight-bit characters, Kanji and Chinese characters, Emacs does not display 8-bit characters, Alternate character sets | |
4787 @section How do I input eight-bit characters? | |
4788 @cindex Entering eight-bit characters | |
4789 @cindex Eight-bit characters, entering | |
4790 @cindex Input, 8-bit characters | |
4791 | |
4792 Various methods are available for input of eight-bit characters. See | |
4793 @inforef{Unibyte Mode, Single-byte Character Set | |
4794 Support, emacs}. For more sophisticated methods, @inforef{Input | |
4795 Methods, Input Methods, emacs}. | |
4796 | |
4797 @node Kanji and Chinese characters, Right-to-left alphabets, Inputting eight-bit characters, Alternate character sets | |
4798 @section Where can I get an Emacs that handles kanji, Chinese, or other Far-Eastern character sets? | |
4799 @cindex Kanji, handling with Emacs | |
4800 @cindex Chinese, handling with Emacs | |
4801 @cindex Japanese, handling with Emacs | |
4802 @cindex Korean, handling with Emacs | |
4803 | |
4804 Emacs 20 and later includes many of the features of MULE, the MULtilingual | |
4805 Enhancement to Emacs. @xref{Installing Emacs}, for information on where | |
4806 to find and download the latest version of Emacs. | |
4807 | |
4808 @node Right-to-left alphabets, How to add fonts, Kanji and Chinese characters, Alternate character sets | |
4809 @section Where is an Emacs that can handle Semitic (right-to-left) alphabets? | |
4810 @cindex Right-to-left alphabets | |
4811 @cindex Hebrew, handling with Emacs | |
4812 @cindex Semitic alphabets | |
4813 @cindex Arabic alphabets | |
4814 | |
4815 Emacs 20 and later supports Hebrew characters (ISO 8859-8), but does not | |
4816 yet support right-to-left character entry and display. | |
4817 | |
4818 @email{joel@@exc.com, Joel M. Hoffman} has written a Lisp package called | |
4819 @file{hebrew.el} that allows right-to-left editing of Hebrew. It | |
4820 reportedly works out of the box with Emacs 19, but requires patches for | |
4821 Emacs 18. Write to Joel if you want the patches or package. | |
4822 | |
4823 @c FIXME: Should we mention Ehud Karni's package? | |
4824 | |
4825 @file{hebrew.el} requires a Hebrew screen font, but no other hardware support. | |
4826 Joel has a screen font for PCs running MS-DOS or GNU/Linux. | |
4827 | |
4828 You might also try querying @code{archie} for files named with | |
4829 @file{hebrew}; several ftp sites in Israel may also have the necessary | |
4830 files. | |
4831 | |
4832 @node How to add fonts, , Right-to-left alphabets, Alternate character sets | |
4833 @section How do I add fonts for use with Emacs? | |
4834 @cindex add fonts for use with Emacs | |
4835 @cindex intlfonts | |
4836 | |
4837 First, download and install the BDF font files and any auxiliary | |
4838 packages they need. The GNU Intlfonts distribution can be found on | |
4839 @uref{http://directory.fsf.org/localization/intlfonts.html, the GNU | |
4840 Software Directory Web site}. | |
4841 | |
4842 Next, if you are on X Window system, issue the following two commands | |
4843 from the shell's prompt: | |
4844 | |
4845 @example | |
4846 xset +fp /usr/local/share/emacs/fonts | |
4847 xset fp rehash | |
4848 @end example | |
4849 | |
4850 @noindent | |
4851 (Modify the first command if you installed the fonts in a directory | |
4852 that is not @file{/usr/local/share/emacs/fonts}.) You also need to | |
4853 arrange for these two commands to run whenever you log in, e.g., by | |
4854 adding them to your window-system startup file, such as | |
4855 @file{~/.xsessionrc} or @file{~/.gnomerc}. | |
4856 | |
4857 Now, add the following line to your @file{~/.emacs} init file: | |
4858 | |
4859 @lisp | |
4860 (add-to-list 'bdf-directory-list "/usr/share/emacs/fonts/bdf") | |
4861 @end lisp | |
4862 | |
4863 @noindent | |
4864 (Again, modify the file name if you installed the fonts elsewhere.) | |
4865 | |
4866 Finally, if you wish to use the installed fonts with @code{ps-print}, | |
4867 add the following line to your @file{~/.emacs}: | |
4868 | |
4869 @lisp | |
4870 (setq ps-multibyte-buffer 'bdf-font-except-latin) | |
4871 @end lisp | |
4872 | |
4873 A few additional steps are necessary for MS-Windows; they are listed | |
4874 below. | |
4875 | |
4876 First, make sure @emph{all} the directories with BDF font files are | |
4877 mentioned in @code{bdf-directory-list}. On Unix and GNU/Linux | |
4878 systems, one normally runs @kbd{make install} to install the BDF fonts | |
4879 in the same directory. By contrast, Windows users typically don't run | |
4880 the Intlfonts installation command, but unpack the distribution in | |
4881 some directory, which leaves the BDF fonts in its subdirectories. For | |
4882 example, assume that you unpacked Intlfonts in @file{C:/Intlfonts}; | |
4883 then you should set @code{bdf-directory-list} as follows: | |
4884 | |
4885 @lisp | |
4886 (setq bdf-directory-list | |
4887 '("C:/Intlfonts/Asian" | |
4888 "C:/Intlfonts/Chinese" "C:/Intlfonts/Chinese.X" | |
4889 "C:/Intlfonts/Chinese.BIG" "C:/Intlfonts/Ethiopic" | |
4890 "C:/Intlfonts/European" "C:/Intlfonts/European.BIG" | |
4891 "C:/Intlfonts/Japanese" "C:/Intlfonts/Japanese.X" | |
4892 "C:/Intlfonts/Japanese.BIG" "C:/Intlfonts/Korean.X" | |
4893 "C:/Intlfonts/Misc")) | |
4894 @end lisp | |
4895 | |
4896 @cindex @code{w32-bdf-filename-alist} | |
4897 @cindex @code{w32-find-bdf-fonts} | |
4898 Next, you need to set up the variable @code{w32-bdf-filename-alist} to | |
4899 an alist of the BDF fonts and their corresponding file names. | |
4900 Assuming you have set @code{bdf-directory-list} to name all the | |
4901 directories with the BDF font files, the following Lisp snippet will | |
4902 set up @code{w32-bdf-filename-alist}: | |
4903 | |
4904 @lisp | |
4905 (setq w32-bdf-filename-alist | |
4906 (w32-find-bdf-fonts bdf-directory-list)) | |
4907 @end lisp | |
4908 | |
4909 Now, create fontsets for the BDF fonts: | |
4910 | |
4911 @lisp | |
4912 (create-fontset-from-fontset-spec | |
4913 "-*-fixed-medium-r-normal-*-16-*-*-*-c-*-fontset-bdf, | |
4914 japanese-jisx0208:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1983-*, | |
4915 katakana-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, | |
4916 latin-jisx0201:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0201*-*, | |
4917 japanese-jisx0208-1978:-*-*-medium-r-normal-*-16-*-*-*-c-*-jisx0208.1978-*, | |
4918 thai-tis620:-misc-fixed-medium-r-normal--16-160-72-72-m-80-tis620.2529-1, | |
4919 lao:-misc-fixed-medium-r-normal--16-160-72-72-m-80-MuleLao-1, | |
4920 tibetan-1-column:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-80-MuleTibetan-1, | |
4921 ethiopic:-Admas-Ethiomx16f-Medium-R-Normal--16-150-100-100-M-160-Ethiopic-Unicode, | |
4922 tibetan:-TibMdXA-fixed-medium-r-normal--16-160-72-72-m-160-MuleTibetan-0") | |
4923 @end lisp | |
4924 | |
4925 Many of the international bdf fonts from Intlfonts are type 0, and | |
4926 therefore need to be added to font-encoding-alist: | |
4927 | |
4928 @lisp | |
4929 (setq font-encoding-alist | |
4930 (append '(("MuleTibetan-0" (tibetan . 0)) | |
4931 ("GB2312" (chinese-gb2312 . 0)) | |
4932 ("JISX0208" (japanese-jisx0208 . 0)) | |
4933 ("JISX0212" (japanese-jisx0212 . 0)) | |
4934 ("VISCII" (vietnamese-viscii-lower . 0)) | |
4935 ("KSC5601" (korean-ksc5601 . 0)) | |
4936 ("MuleArabic-0" (arabic-digit . 0)) | |
4937 ("MuleArabic-1" (arabic-1-column . 0)) | |
4938 ("MuleArabic-2" (arabic-2-column . 0))) | |
4939 font-encoding-alist)) | |
4940 @end lisp | |
4941 | |
4942 You can now use the Emacs font menu to select the @samp{bdf: 16-dot medium} | |
4943 fontset, or you can select it by setting the default font in your | |
4944 @file{~/.emacs}: | |
4945 | |
4946 @lisp | |
4947 (set-default-font "fontset-bdf") | |
4948 @end lisp | |
4949 | |
4950 | |
4951 @c ------------------------------------------------------------ | |
4952 @node Mail and news, Concept index, Alternate character sets, Top | |
4953 @chapter Mail and news | |
4954 @cindex Mail and news | |
4955 | |
4956 @menu | |
4957 * Changing the included text prefix:: | |
4958 * Saving a copy of outgoing mail:: | |
4959 * Expanding aliases when sending mail:: | |
4960 * Sorting the messages in an Rmail folder:: | |
4961 * Rmail writes to /usr/spool/mail:: | |
4962 * Replying to the sender of a message:: | |
4963 * MIME with Emacs mail packages:: | |
4964 * Automatically starting a mail or news reader:: | |
4965 * Reading news with Emacs:: | |
4966 * Gnus does not work with NNTP:: | |
4967 * Viewing articles with embedded underlining:: | |
4968 * Saving a multi-part Gnus posting:: | |
4969 * Starting Gnus faster:: | |
4970 * Catching up in all newsgroups:: | |
4971 * Killing based on nonstandard headers:: | |
4972 * Removing flashing messages:: | |
4973 * Catch-up is slow in Gnus:: | |
4974 * Gnus hangs for a long time:: | |
4975 * Learning more about Gnus:: | |
4976 @end menu | |
4977 | |
4978 @node Changing the included text prefix, Saving a copy of outgoing mail, Mail and news, Mail and news | |
4979 @section How do I change the included text prefix in mail/news followups? | |
4980 @cindex Prefix in mail/news followups, changing | |
4981 @cindex Included text prefix, changing | |
4982 @cindex Setting the included text character | |
4983 @cindex Quoting in mail messages | |
4984 | |
4985 If you read mail with Rmail or news with Gnus, set the variable | |
4986 @code{mail-yank-prefix}. For VM, set @code{vm-included-text-prefix}. | |
4987 For mh-e, set @code{mh-ins-buf-prefix}. | |
4988 | |
95921
19f2346062f0
(Major packages and programs): Remove references to external
Glenn Morris <rgm@gnu.org>
parents:
87903
diff
changeset
|
4989 For fancier control of citations, use Supercite (part of Emacs). |
84296 | 4990 |
4991 To prevent Emacs from including various headers of the replied-to | |
4992 message, set the value of @code{mail-yank-ignored-headers} to an | |
4993 appropriate regexp. | |
4994 | |
4995 @node Saving a copy of outgoing mail, Expanding aliases when sending mail, Changing the included text prefix, Mail and news | |
4996 @section How do I save a copy of outgoing mail? | |
4997 @cindex Saving a copy of outgoing mail | |
4998 @cindex Copying outgoing mail to a file | |
4999 @cindex Filing outgoing mail | |
5000 @cindex Automatic filing of outgoing mail | |
5001 @cindex Mail, saving outgoing automatically | |
5002 | |
5003 You can either mail yourself a copy by including a @samp{BCC} header in the | |
5004 mail message, or store a copy of the message directly to a file by | |
5005 including an @samp{FCC} header. | |
5006 | |
5007 If you use standard mail, you can automatically create a @samp{BCC} to | |
5008 yourself by putting | |
5009 | |
5010 @lisp | |
5011 (setq mail-self-blind t) | |
5012 @end lisp | |
5013 | |
5014 @noindent | |
5015 in your @file{.emacs} file. You can automatically include an @samp{FCC} | |
5016 field by putting something like the following in your @file{.emacs} | |
5017 file: | |
5018 | |
5019 @lisp | |
5020 (setq mail-archive-file-name (expand-file-name "~/outgoing")) | |
5021 @end lisp | |
5022 | |
5023 The output file will be in Unix mail format, which can be read directly | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
5024 by VM or Rmail (since Emacs 23). |
84296 | 5025 |
5026 If you use @code{mh-e}, add an @samp{FCC} or @samp{BCC} field to your | |
5027 components file. | |
5028 | |
5029 It does not work to put @samp{set record filename} in the @file{.mailrc} | |
5030 file. | |
5031 | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
5032 @node Expanding aliases when sending mail, Sorting the messages in an Rmail folder, Saving a copy of outgoing mail, Mail and news |
84296 | 5033 @section Why doesn't Emacs expand my aliases when sending mail? |
5034 @cindex Expanding aliases when sending mail | |
5035 @cindex Mail alias expansion | |
5036 @cindex Sending mail with aliases | |
5037 | |
5038 @itemize @bullet | |
5039 | |
5040 @item | |
5041 You must separate multiple addresses in the headers of the mail buffer | |
5042 with commas. This is because Emacs supports RFC822 standard addresses | |
5043 like this one: | |
5044 | |
5045 @example | |
5046 To: Willy Smith <wks@@xpnsv.lwyrs.com> | |
5047 @end example | |
5048 | |
5049 However, you do not need to---and probably should not, unless your | |
5050 system's version of @file{/usr/ucb/mail} (a.k.a.@: @code{mailx}) | |
5051 supports RFC822---separate addresses with commas in your | |
5052 @file{~/.mailrc} file. | |
5053 | |
5054 @item | |
5055 Emacs normally only reads the @file{.mailrc} file once per session, | |
5056 when you start to compose your first mail message. If you edit | |
5057 @file{.mailrc}, you can type @kbd{M-x rebuild-mail-abbrevs @key{RET}} to | |
5058 make Emacs reread @file{~/.mailrc}. | |
5059 | |
5060 @item | |
5061 If you like, you can expand mail aliases as abbrevs, as soon as you | |
5062 type them in. To enable this feature, execute the following: | |
5063 | |
5064 @lisp | |
5065 (add-hook 'mail-mode-hook 'mail-abbrevs-setup) | |
5066 @end lisp | |
5067 | |
5068 Note that the aliases are expanded automatically only after you type | |
5069 @key{RET} or a punctuation character (e.g. @kbd{,}). You can force their | |
5070 expansion by moving point to the end of the alias and typing @kbd{C-x a e} | |
5071 (@kbd{M-x expand-abbrev}). | |
5072 @end itemize | |
5073 | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
5074 @node Sorting the messages in an Rmail folder, Rmail writes to /usr/spool/mail, Expanding aliases when sending mail, Mail and news |
84296 | 5075 @section How can I sort the messages in my Rmail folder? |
5076 @cindex Rmail, sorting messages in | |
5077 @cindex Folder, sorting messages in an Rmail | |
5078 @cindex Sorting messages in an Rmail folder | |
5079 | |
5080 In Rmail, type @kbd{C-c C-s C-h} to get a list of sorting functions | |
5081 and their key bindings. | |
5082 | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
5083 @node Rmail writes to /usr/spool/mail, Replying to the sender of a message, Sorting the messages in an Rmail folder, Mail and news |
84296 | 5084 @section Why does Rmail need to write to @file{/usr/spool/mail}? |
5085 @cindex Rmail and @file{/usr/spool/mail} | |
5086 @cindex @file{/usr/spool/mail} and Rmail | |
5087 | |
5088 This is the behavior of the @code{movemail} program which Rmail uses. | |
5089 This indicates that @code{movemail} is configured to use lock files. | |
5090 | |
5091 RMS writes: | |
5092 | |
5093 @quotation | |
5094 Certain systems require lock files to interlock access to mail files. | |
5095 On these systems, @code{movemail} must write lock files, or you risk losing | |
5096 mail. You simply must arrange to let @code{movemail} write them. | |
5097 | |
5098 Other systems use the @code{flock} system call to interlock access. On | |
5099 these systems, you should configure @code{movemail} to use @code{flock}. | |
5100 @end quotation | |
5101 | |
103383
288ef1280a95
(Common acronyms): Remove no-longer-existing OSF.
Glenn Morris <rgm@gnu.org>
parents:
103279
diff
changeset
|
5102 @node Replying to the sender of a message, MIME with Emacs mail packages, Rmail writes to /usr/spool/mail, Mail and news |
84296 | 5103 @section How can I force Rmail to reply to the sender of a message, but not the other recipients? |
5104 @cindex Replying only to the sender of a message | |
5105 @cindex Sender, replying only to | |
5106 @cindex Rmail, replying to the sender of a message in | |
5107 | |
5108 @email{isaacson@@seas.upenn.edu, Ron Isaacson} says: When you hit | |
5109 @key{r} to reply in Rmail, by default it CCs all of the original | |
5110 recipients (everyone on the original @samp{To} and @samp{CC} | |
5111 lists). With a prefix argument (i.e., typing @kbd{C-u} before @key{r}), | |
5112 it replies only to the sender. However, going through the whole | |
5113 @kbd{C-u} business every time you want to reply is a pain. This is the | |
5114 best fix I've been able to come up with: | |
5115 | |
5116 @lisp | |
5117 (defun rmail-reply-t () | |
5118 "Reply only to the sender of the current message. (See rmail-reply.)" | |
5119 (interactive) | |
5120 (rmail-reply t)) | |
5121 | |
5122 (add-hook 'rmail-mode-hook | |
5123 (lambda () | |
5124 (define-key rmail-mode-map "r" 'rmail-reply-t) | |
5125 (define-key rmail-mode-map "R" 'rmail-reply))) | |
5126 @end lisp | |
5127 | |
5128 @node MIME with Emacs mail packages, Automatically starting a mail or news reader, Replying to the sender of a message, Mail and news | |
5129 @section How can I get my favorite Emacs mail package to support MIME? | |
5130 @cindex MIME and Emacs mail packages | |
5131 @cindex Mail packages and MIME | |
5132 @cindex FAQ for MIME and Emacs | |
5133 | |
5134 Version 6.x of VM supports MIME. @xref{VM}. Gnus supports MIME in mail | |
5135 and news messages as of version 5.8.1 (Pterodactyl). Rmail has limited | |
5136 support for single-part MIME messages beginning with Emacs 20.3. | |
5137 | |
5138 @node Automatically starting a mail or news reader, Reading news with Emacs, MIME with Emacs mail packages, Mail and news | |
5139 @section How do I make Emacs automatically start my mail/news reader? | |
5140 @cindex Mail reader, starting automatically | |
5141 @cindex News reader, starting automatically | |
5142 @cindex Starting mail/news reader automatically | |
5143 | |
5144 To start Emacs in Gnus: | |
5145 | |
5146 @example | |
5147 emacs -f gnus | |
5148 @end example | |
5149 | |
5150 @noindent | |
5151 in Rmail: | |
5152 | |
5153 @example | |
5154 emacs -f rmail | |
5155 @end example | |
5156 | |
5157 A more convenient way to start with Gnus: | |
5158 | |
5159 @example | |
5160 alias gnus 'emacs -f gnus' | |
5161 gnus | |
5162 @end example | |
5163 | |
5164 It is probably unwise to automatically start your mail or news reader | |
5165 from your @file{.emacs} file. This would cause problems if you needed to run | |
5166 two copies of Emacs at the same time. Also, this would make it difficult for | |
5167 you to start Emacs quickly when you needed to. | |
5168 | |
5169 @node Reading news with Emacs, Gnus does not work with NNTP, Automatically starting a mail or news reader, Mail and news | |
5170 @section How do I read news under Emacs? | |
5171 @cindex Reading news under Emacs | |
5172 @cindex Usenet reader in Emacs | |
5173 @cindex Gnus newsreader | |
5174 | |
5175 Use @kbd{M-x gnus}. It is documented in Info (@pxref{Learning how to do | |
5176 something}). | |
5177 | |
5178 @node Gnus does not work with NNTP, Viewing articles with embedded underlining, Reading news with Emacs, Mail and news | |
5179 @section Why doesn't Gnus work via NNTP? | |
5180 @cindex Gnus and NNTP | |
5181 @cindex NNTP, Gnus fails to work with | |
5182 | |
5183 There is a bug in NNTP version 1.5.10, such that when multiple requests | |
5184 are sent to the NNTP server, the server only handles the first one | |
5185 before blocking waiting for more input which never comes. NNTP version | |
5186 1.5.11 claims to fix this. | |
5187 | |
5188 You can work around the bug inside Emacs like this: | |
5189 | |
5190 @lisp | |
5191 (setq nntp-maximum-request 1) | |
5192 @end lisp | |
5193 | |
5194 You can find out what version of NNTP your news server is running by | |
5195 telnetting to the NNTP port (usually 119) on the news server machine | |
5196 (i.e., @kbd{telnet server-machine 119}). The server should give its | |
5197 version number in the welcome message. Type @kbd{quit} to get out. | |
5198 | |
5199 @xref{Spontaneous entry into isearch-mode}, for some additional ideas. | |
5200 | |
5201 @node Viewing articles with embedded underlining, Saving a multi-part Gnus posting, Gnus does not work with NNTP, Mail and news | |
5202 @section How do I view news articles with embedded underlining (e.g., ClariNews)? | |
5203 @cindex Underlining, embedded in news articles | |
5204 @cindex News articles with embedded underlining | |
5205 @cindex Embedded underlining in news articles | |
5206 | |
5207 Underlining appears like this: | |
5208 | |
5209 @example | |
5210 _^Hu_^Hn_^Hd_^He_^Hr_^Hl_^Hi_^Hn_^Hi_^Hn_^Hg | |
5211 @end example | |
5212 | |
5213 @email{abraham@@dina.kvl.dk, Per Abrahamsen} suggests using the following | |
5214 code, which uses the underline face to turn such text into true | |
5215 underlining, inconjunction with Gnus: | |
5216 | |
5217 @lisp | |
5218 (defun gnus-article-prepare-overstrike () | |
5219 ;; Prepare article for overstrike commands. | |
5220 (save-excursion | |
5221 (set-buffer gnus-article-buffer) | |
5222 (let ((buffer-read-only nil)) | |
5223 (goto-char (point-min)) | |
5224 (while (search-forward "\b" nil t) | |
5225 (let ((next (following-char)) | |
5226 (previous (char-after (- (point) 2)))) | |
5227 (cond ((eq next previous) | |
5228 (delete-region (- (point) 2) (point)) | |
5229 (put-text-property (point) (1+ (point)) | |
5230 'face 'bold)) | |
5231 ((eq next ?_) | |
5232 (delete-region (1- (point)) (1+ (point))) | |
5233 (put-text-property (1- (point)) (point) | |
5234 'face 'underline)) | |
5235 ((eq previous ?_) | |
5236 (delete-region (- (point) 2) (point)) | |
5237 (put-text-property (point) (1+ (point)) | |
5238 'face 'underline)))))))) | |
5239 | |
5240 (add-hook 'gnus-article-prepare-hook 'gnus-article-prepare-overstrike) | |
5241 @end lisp | |
5242 | |
5243 Latest versions of Gnus do such a conversion automatically. | |
5244 | |
5245 If you prefer to do away with underlining altogether, you can | |
5246 destructively remove it with @kbd{M-x ununderline-region}; do this | |
5247 automatically via | |
5248 | |
5249 @lisp | |
5250 (add-hook 'gnus-article-prepare-hook | |
5251 (lambda () (ununderline-region (point-min) (point-max)))) | |
5252 @end lisp | |
5253 | |
5254 @node Saving a multi-part Gnus posting, Starting Gnus faster, Viewing articles with embedded underlining, Mail and news | |
5255 @section How do I save all the items of a multi-part posting in Gnus? | |
5256 @cindex Multi-part postings in Gnus, saving | |
5257 @cindex Saving multi-part postings in Gnus | |
5258 @cindex Gnus, saving multi-part postings in | |
5259 | |
5260 Use @code{gnus-uu}. Type @kbd{C-c C-v C-h} in the Gnus summary buffer | |
5261 to see a list of available commands. | |
5262 | |
5263 @node Starting Gnus faster, Catching up in all newsgroups, Saving a multi-part Gnus posting, Mail and news | |
5264 @section How do I make Gnus start up faster? | |
5265 @cindex Faster, starting Gnus | |
5266 @cindex Starting Gnus faster | |
5267 @cindex Gnus, starting faster | |
5268 | |
5269 From the Gnus FAQ (@pxref{Learning more about Gnus}): | |
5270 | |
5271 @quotation | |
5272 @email{pktiwari@@eos.ncsu.edu, Pranav Kumar Tiwari} writes: I posted | |
5273 the same query recently and I got an answer to it. I am going to | |
5274 repeat the answer. What you need is a newer version of gnus, version | |
5275 5.0.4+. I am using 5.0.12 and it works fine with me with the | |
5276 following settings: | |
5277 | |
5278 @lisp | |
5279 (setq gnus-check-new-newsgroups nil | |
5280 gnus-read-active-file 'some | |
5281 gnus-nov-is-evil nil | |
5282 gnus-select-method '(nntp gnus-nntp-server)) | |
5283 @end lisp | |
5284 @end quotation | |
5285 | |
5286 @node Catching up in all newsgroups, Killing based on nonstandard headers, Starting Gnus faster, Mail and news | |
5287 @section How do I catch up all newsgroups in Gnus? | |
5288 @cindex Catching up all newsgroups in Gnus | |
5289 @cindex Gnus, Catching up all newsgroups in | |
5290 | |
5291 In the @file{*Newsgroup*} buffer, type @kbd{M-< C-x ( c y C-x ) M-0 C-x e} | |
5292 | |
5293 Leave off the initial @kbd{M-<} if you only want to catch up from point | |
5294 to the end of the @file{*Newsgroup*} buffer. | |
5295 | |
5296 @node Killing based on nonstandard headers, Removing flashing messages, Catching up in all newsgroups, Mail and news | |
5297 @section Why can't I kill in Gnus based on the Newsgroups/Keywords/Control headers? | |
5298 @cindex Killing articles based on nonstandard headers | |
5299 @cindex Newsgroups header, killing articles based on | |
5300 @cindex Keywords header, killing articles based on | |
5301 @cindex Control header, killing articles based on | |
5302 | |
5303 Gnus will complain that the @samp{Newsgroups}, @samp{Keywords}, and | |
5304 @samp{Control} headers are ``Unknown header'' fields. | |
5305 | |
5306 For the @samp{Newsgroups} header, there is an easy workaround: kill on the | |
5307 @samp{Xref} header instead, which will be present on any cross-posted article | |
5308 (as long as your site carries the cross-post group). | |
5309 | |
5310 If you really want to kill on one of these headers, you can do it like | |
5311 this: | |
5312 | |
5313 @lisp | |
5314 (gnus-kill nil "^Newsgroups: .*\\(bad\\.group\\|worse\\.group\\)") | |
5315 @end lisp | |
5316 | |
5317 @node Removing flashing messages, Catch-up is slow in Gnus, Killing based on nonstandard headers, Mail and news | |
5318 @section How do I get rid of flashing messages in Gnus for slow connections? | |
5319 @cindex Flashing Gnus messages, removing | |
5320 @cindex Removing flashing Gnus messages | |
5321 @cindex Slow connections causing flashing messages in Gnus | |
5322 @cindex Gnus, flashing messages in | |
5323 | |
5324 Set @code{nntp-debug-read} to @code{nil}. | |
5325 | |
5326 @node Catch-up is slow in Gnus, Gnus hangs for a long time, Removing flashing messages, Mail and news | |
5327 @section Why is catch up slow in Gnus? | |
5328 @cindex Slow catch up in Gnus | |
5329 @cindex Gnus is slow when catching up | |
5330 @cindex Crosspostings make Gnus catching up slow | |
5331 | |
5332 Because Gnus is marking crosspostings read. You can control this with | |
5333 the variable @code{gnus-use-cross-reference}. | |
5334 | |
5335 @node Gnus hangs for a long time, Learning more about Gnus, Catch-up is slow in Gnus, Mail and news | |
5336 @section Why does Gnus hang for a long time when posting? | |
5337 @cindex Hangs in Gnus | |
5338 @cindex Gnus hangs while posting | |
5339 @cindex Posting, Gnus hangs wile | |
5340 | |
5341 @email{tale@@uunet.uu.net, David Lawrence} explains: | |
5342 | |
5343 @quotation | |
5344 The problem is almost always interaction between NNTP and C News. NNTP | |
5345 POST asks C News's @code{inews} to not background itself but rather hang | |
5346 around and give its exit status so it knows whether the post was successful. | |
5347 (That wait will on some systems not return the exit status of the | |
5348 waited for job is a different sort of problem.) It ends up taking a | |
5349 long time because @code{inews} is calling @code{relaynews}, which often | |
5350 waits for another @code{relaynews} to free the lock on the news system | |
5351 so it can file the article. | |
5352 | |
5353 My preferred solution is to change @code{inews} to not call | |
5354 @code{relaynews}, but rather use @code{newsspool}. This loses some | |
5355 error-catching functionality, but is for the most part safe as | |
5356 @code{inews} will detect a lot of the errors on its own. The C News | |
5357 folks have sped up @code{inews}, too, so speed should look better to | |
5358 most folks as that update propagates around. | |
5359 @end quotation | |
5360 | |
5361 @node Learning more about Gnus, , Gnus hangs for a long time, Mail and news | |
5362 @section Where can I find out more about Gnus? | |
5363 @cindex FAQ for Gnus | |
5364 @cindex Gnus FAQ | |
5365 @cindex Learning more about Gnus | |
5366 | |
5367 For more information on Gnus, consult the Gnus manual and FAQ, which are | |
5368 part of the Gnus distribution. | |
5369 | |
5370 @node Concept index, , Mail and news, Top | |
5371 @unnumbered Concept Index | |
5372 @printindex cp | |
5373 | |
5374 @bye | |
5375 | |
5376 @ignore | |
5377 arch-tag: fee0d62d-06cf-43d8-ac21-123408eaf10f | |
5378 @end ignore |