7 |
@setchapternewpage odd |
@setchapternewpage odd |
8 |
|
|
9 |
@c This is used in many places |
@c This is used in many places |
10 |
@set VER 21.3 |
@set VER 22.1 |
11 |
|
|
12 |
@copying |
@copying |
13 |
Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
Copyright (C) 2001, 2002, 2003, 2004, 2005 Free Software Foundation, Inc. |
30 |
the FAQ may not be embedded in a larger literary work unless that work |
the FAQ may not be embedded in a larger literary work unless that work |
31 |
itself allows free copying and redistribution. |
itself allows free copying and redistribution. |
32 |
|
|
33 |
[This version has been somewhat edited from the last-posted version |
[This version has been heavily edited since it was included in the Emacs |
34 |
(as of August 1999) for inclusion in the Emacs distribution.] |
distribution.] |
35 |
@end quotation |
@end quotation |
36 |
@end copying |
@end copying |
37 |
|
|
556 |
@cindex Self-paced tutorial, invoking the |
@cindex Self-paced tutorial, invoking the |
557 |
@cindex Help system, entering the |
@cindex Help system, entering the |
558 |
|
|
559 |
Type @kbd{C-h t} to invoke the self-paced tutorial. Just typing @kbd{C-h} |
Type @kbd{C-h t} to invoke the self-paced tutorial. Just typing |
560 |
enters the help system. |
@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 |
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 |
@key{DEL} to deal with local keyboards. You can use @kbd{M-x |
573 |
Emacs help works best if it is invoked by a single key whose value |
Emacs help works best if it is invoked by a single key whose value |
574 |
should be stored in the variable @code{help-char}. |
should be stored in the variable @code{help-char}. |
575 |
|
|
|
There is also a WWW-based tutorial for Emacs 18, much of which is also |
|
|
relevant for later versions of Emacs, available at |
|
|
|
|
|
@uref{http://kufacts.cc.ukans.edu/cwis/writeups/misc/emacsguide.html} |
|
|
|
|
576 |
@node Learning how to do something, Getting a printed manual, Basic editing, Getting help |
@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? |
@section How do I find out how to do something in Emacs? |
578 |
@cindex Help for Emacs |
@cindex Help for Emacs |
587 |
@cindex Reading the Emacs manual |
@cindex Reading the Emacs manual |
588 |
@item |
@item |
589 |
The complete text of the Emacs manual is available on-line via the Info |
The complete text of the Emacs manual is available on-line via the Info |
590 |
hypertext reader. Type @kbd{C-h i} to invoke Info. Typing @key{h} |
hypertext reader. Type @kbd{C-h r} to display the manual in Info mode. |
591 |
immediately after entering Info will provide a short tutorial on how to |
Typing @key{h} immediately after entering Info will provide a short |
592 |
use it. |
tutorial on how to use it. |
593 |
|
|
594 |
@cindex Lookup a subject in a manual |
@cindex Lookup a subject in a manual |
595 |
@cindex Index search in a manual |
@cindex Index search in a manual |
666 |
If you absolutely have to print your own copy, and you don't have @TeX{}, |
If you absolutely have to print your own copy, and you don't have @TeX{}, |
667 |
you can get a PostScript version from |
you can get a PostScript version from |
668 |
|
|
669 |
@uref{http://www.gnu.org/manual/emacs/ps/emacs.ps.gz} |
@uref{http://www.gnu.org/software/emacs/manual/emacs.ps.gz} |
670 |
|
|
671 |
@cindex HTML version of Emacs manual, obtaining |
@cindex HTML version of Emacs manual, obtaining |
672 |
An HTML version of the manual is at |
An HTML version of the manual is at |
673 |
|
|
674 |
@uref{www.gnu.org/manual/emacs/index.html} |
@uref{http://www.gnu.org/software/emacs/manual/emacs.html} |
675 |
|
|
676 |
@xref{Learning how to do something}, for how to view the manual on-line. |
@xref{Learning how to do something}, for how to view the manual on-line. |
677 |
|
|
686 |
Within Emacs, you can type @kbd{C-h f} to get the documentation for a |
Within Emacs, you can type @kbd{C-h f} to get the documentation for a |
687 |
function, @kbd{C-h v} for a variable. |
function, @kbd{C-h v} for a variable. |
688 |
|
|
689 |
For more information, obtain the Emacs Lisp Reference Manual. Details |
For more information, the Emacs Lisp Reference Manual is available |
690 |
on ordering it from FSF are on the |
on-line, in Info format. @xref{Top, Emacs Lisp,, elisp, The |
691 |
@uref{http://www.gnu.org/order/order.html, GNU Web site}. |
Emacs Lisp Reference Manual}. |
|
|
|
|
The Emacs Lisp Reference Manual is also available on-line, in Info |
|
|
format. Texinfo source for the manual (along with pregenerated Info |
|
|
files) is available at |
|
692 |
|
|
693 |
@uref{ftp://ftp.gnu.org/pub/gnu/emacs/elisp-manual-21-2.6.tar.gz} |
You can also order a hardcopy of the manual, details on ordering it from |
694 |
|
FSF are on the @uref{http://www.gnu.org/order/order.html, GNU Web site}. |
|
and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU |
|
|
distributions}). @xref{Installing Texinfo documentation}, if you want |
|
|
to install the Info files, or @ref{Printing a Texinfo file}, if you want |
|
|
to use the Texinfo source to print the manual yourself. |
|
695 |
|
|
696 |
An HTML version of the Emacs Lisp Reference Manual is available at |
An HTML version of the Emacs Lisp Reference Manual is available at |
697 |
|
|
698 |
@uref{http://www.gnu.org/manual/elisp-manual-21-2.6/elisp.html} |
@uref{http://www.gnu.org/software/emacs/elisp-manual/elisp.html} |
699 |
|
|
700 |
@node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help |
@node Installing Texinfo documentation, Printing a Texinfo file, Emacs Lisp documentation, Getting help |
701 |
@section How do I install a piece of Texinfo documentation? |
@section How do I install a piece of Texinfo documentation? |
709 |
using the stand-alone @file{makeinfo} program, available as part of the latest |
using the stand-alone @file{makeinfo} program, available as part of the latest |
710 |
Texinfo package at |
Texinfo package at |
711 |
|
|
712 |
@uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.0.tar.gz} |
@uref{ftp://ftp.gnu.org/pub/gnu/texinfo/texinfo-4.8.tar.gz} |
713 |
|
|
714 |
and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU |
and all mirrors of @samp{ftp.gnu.org} (for a list, @pxref{Current GNU |
715 |
distributions}). |
distributions}). |
893 |
@table @file |
@table @file |
894 |
|
|
895 |
@item COPYING |
@item COPYING |
896 |
Emacs General Public License |
GNU General Public License |
897 |
|
|
898 |
@item DISTRIB |
@item DISTRIB |
899 |
Emacs Availability Information, including the popular Free Software |
Emacs Availability Information, including the popular Free Software |
929 |
|
|
930 |
@end table |
@end table |
931 |
|
|
|
Latest versions of the above files also available at |
|
|
|
|
|
@uref{ftp://ftp.gnu.org/pub/gnu/GNUinfo/} |
|
|
|
|
932 |
More GNU information, including back issues of the @cite{GNU's |
More GNU information, including back issues of the @cite{GNU's |
933 |
Bulletin}, are at |
Bulletin}, are at |
934 |
|
|
1035 |
* Latest version of Emacs:: |
* Latest version of Emacs:: |
1036 |
* New in Emacs 20:: |
* New in Emacs 20:: |
1037 |
* New in Emacs 21:: |
* New in Emacs 21:: |
1038 |
|
* New in Emacs 22:: |
1039 |
@end menu |
@end menu |
1040 |
|
|
1041 |
@node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs |
@node Origin of the term Emacs, Latest version of Emacs, Status of Emacs, Status of Emacs |
1099 |
and are now included with the standard distribution. |
and are now included with the standard distribution. |
1100 |
|
|
1101 |
|
|
1102 |
@node New in Emacs 21, , New in Emacs 20, Status of Emacs |
@node New in Emacs 21, New in Emacs 22, New in Emacs 20, Status of Emacs |
1103 |
@section What is different about Emacs 21? |
@section What is different about Emacs 21? |
1104 |
@cindex Differences between Emacs 20 and Emacs 21 |
@cindex Differences between Emacs 20 and Emacs 21 |
1105 |
@cindex Emacs 21, new features in |
@cindex Emacs 21, new features in |
1121 |
that you can now have colors when you run Emacs on a GNU/Linux console |
that you can now have colors when you run Emacs on a GNU/Linux console |
1122 |
and on @code{xterm} with @kbd{emacs -nw}. |
and on @code{xterm} with @kbd{emacs -nw}. |
1123 |
|
|
1124 |
|
@node New in Emacs 22, , New in Emacs 21, Status of Emacs |
1125 |
|
@section What is different about Emacs 22? |
1126 |
|
@cindex Differences between Emacs 21 and Emacs 22 |
1127 |
|
@cindex Emacs 22, new features in |
1128 |
|
@cindex Recently introduced features |
1129 |
|
|
1130 |
|
@c FIXME: Improve this node before the 22.1 release. |
1131 |
|
@cindex Default features |
1132 |
|
Font-lock mode, auto-compression mode, and file name shadow mode are now |
1133 |
|
enabled by default. It is now possible to follow links with |
1134 |
|
@kbd{mouse-1}. |
1135 |
|
|
1136 |
|
@cindex Supported systems |
1137 |
|
Emacs 22 features support for GNU/Linux systems on S390 and X86-64 |
1138 |
|
machines, as well as support for the Mac OS X and Cygwin operating |
1139 |
|
systems. |
1140 |
|
|
1141 |
|
@cindex GTK+ Toolkit |
1142 |
|
@cindex Drag-and-drop |
1143 |
|
@cindex Mouse wheel |
1144 |
|
Emacs can now be built with GTK+ widgets, and supports drag-and-drop |
1145 |
|
operation on X. Mouse wheel support is now enabled by default. |
1146 |
|
|
1147 |
|
@cindex New modes |
1148 |
|
Many new modes and packages have been included in Emacs, such as Leim, |
1149 |
|
Calc, Tramp and URL, as well as IDO, CUA, rcirc, conf-mode, |
1150 |
|
python-mode, table, tumme, SES, ruler, Flymake, Org, etc. |
1151 |
|
|
1152 |
|
@cindex Documentation |
1153 |
|
@cindex Emacs Lisp Manual |
1154 |
|
In addition, Emacs 22 now includes the Emacs Lisp Reference Manual |
1155 |
|
(@pxref{Emacs Lisp documentation}) and the Emacs Lisp Intro. |
1156 |
|
|
1157 |
@c ------------------------------------------------------------ |
@c ------------------------------------------------------------ |
1158 |
@node Common requests, Bugs and problems, Status of Emacs, Top |
@node Common requests, Bugs and problems, Status of Emacs, Top |
1159 |
@chapter Common requests |
@chapter Common requests |
1225 |
@email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as |
@email{help-gnu-emacs@@gnu.org} asking why Emacs isn't behaving as |
1226 |
documented. |
documented. |
1227 |
|
|
1228 |
Beginning with version 20.1, Emacs includes the new Customize |
Beginning with version 20.1, Emacs includes the new Customize facility, |
1229 |
facility, which can be invoked using @kbd{M-x customize @key{RET}}. |
which can be invoked using @kbd{M-x customize @key{RET}}. This allows |
1230 |
This allows users who are unfamiliar with Emacs Lisp to modify their |
users who are unfamiliar with Emacs Lisp to modify their @file{.emacs} |
1231 |
@file{.emacs} files in a relatively straightforward way, using menus |
files in a relatively straightforward way, using menus rather than Lisp |
1232 |
rather than Lisp code. Not all packages support Customize as of this |
code. Most packages support Customize as of this writing. |
|
writing, but the number is growing fairly steadily. |
|
1233 |
|
|
1234 |
While Customize might indeed make it easier to configure Emacs, |
While Customize might indeed make it easier to configure Emacs, |
1235 |
consider taking a bit of time to learn Emacs Lisp and modifying your |
consider taking a bit of time to learn Emacs Lisp and modifying your |
1259 |
The command @kbd{M-x list-colors-display} pops up a window which |
The command @kbd{M-x list-colors-display} pops up a window which |
1260 |
exhibits all the colors Emacs knows about on the current display. |
exhibits all the colors Emacs knows about on the current display. |
1261 |
|
|
1262 |
Syntax highlighting is usually turned off by default; see @ref{Turning |
Syntax highlighting is on by default since version 22.1. |
|
on syntax highlighting}, for instructions how to turn it on. |
|
1263 |
|
|
1264 |
@node Debugging a customization file, Displaying the current line or column, Colors on a TTY, Common requests |
@node Debugging a customization file, Displaying the current line or column, Colors on a TTY, Common requests |
1265 |
@section How do I debug a @file{.emacs} file? |
@section How do I debug a @file{.emacs} file? |
1380 |
(setq abbrev-mode t))) |
(setq abbrev-mode t))) |
1381 |
@end lisp |
@end lisp |
1382 |
|
|
1383 |
|
Starting with Emacs 22, the standard abbrevs file is read automatically |
1384 |
|
at startup, so the first of these two forms becomes unnecessary. |
1385 |
|
|
1386 |
@node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests |
@node Turning on auto-fill by default, Associating modes with files, Turning on abbrevs by default, Common requests |
1387 |
@section How do I turn on @code{auto-fill-mode} by default? |
@section How do I turn on @code{auto-fill-mode} by default? |
1388 |
@cindex @code{auto-fill-mode}, activating automatically |
@cindex @code{auto-fill-mode}, activating automatically |
1531 |
Similarly, for replacing, the variable @code{case-replace} determines |
Similarly, for replacing, the variable @code{case-replace} determines |
1532 |
whether replacements preserve case. |
whether replacements preserve case. |
1533 |
|
|
1534 |
|
You can also toggle case sensitivity at will in isearch with @kbd{M-c}. |
1535 |
|
|
1536 |
To change the case sensitivity just for one major mode, use the major |
To change the case sensitivity just for one major mode, use the major |
1537 |
mode's hook. For example: |
mode's hook. For example: |
1538 |
|
|
1620 |
(if (@var{some conditions are met}) (server-start)) |
(if (@var{some conditions are met}) (server-start)) |
1621 |
@end lisp |
@end lisp |
1622 |
|
|
1623 |
When this is done, Emacs creates a Unix domain socket. |
When this is done, Emacs creates a Unix domain socket named |
1624 |
The socket is either named @file{.emacs_server}, in the user's home directory, |
@file{server} in @file{/tmp/emacs@var{userid}}. See |
1625 |
or @file{esrv-@var{userid}-@var{systemname}}, in the @file{/tmp} |
@code{server-socket-dir}. |
|
directory, depending on your system. See @code{server-socket-name}. |
|
1626 |
|
|
1627 |
To get your news reader, mail reader, etc., to invoke |
To get your news reader, mail reader, etc., to invoke |
1628 |
@samp{emacsclient}, try setting the environment variable @code{EDITOR} |
@samp{emacsclient}, try setting the environment variable @code{EDITOR} |
1644 |
@item |
@item |
1645 |
Normal use: |
Normal use: |
1646 |
|
|
1647 |
When @samp{emacsclient} is run, it connects to the @file{.emacs_server} |
When @samp{emacsclient} is run, it connects to the socket and passes its |
1648 |
socket and passes its command line options to @samp{server}. When |
command line options to Emacs, which at the next opportunity will visit |
1649 |
@samp{server} receives these requests, it sends this information to the |
the files specified. (Line numbers can be specified just like with |
1650 |
the Emacs process, which at the next opportunity will visit the files |
Emacs.) The user will have to switch to the Emacs window by hand. When |
1651 |
specified. (Line numbers can be specified just like with Emacs.) The |
the user is done editing a file, the user can type @kbd{C-x #} (or |
1652 |
user will have to switch to the Emacs window by hand. When the user is |
@kbd{M-x server-edit}) to indicate this. If there is another buffer |
1653 |
done editing a file, the user can type @kbd{C-x #} (or @kbd{M-x |
requested by @code{emacsclient}, Emacs will switch to it; otherwise |
|
server-edit}) to indicate this. If there is another buffer requested by |
|
|
@code{emacsclient}, Emacs will switch to it; otherwise |
|
1654 |
@code{emacsclient} will exit, signaling the calling program to continue. |
@code{emacsclient} will exit, signaling the calling program to continue. |
1655 |
|
|
|
@samp{emacsclient} and @samp{server} must be running on machines which |
|
|
share the same filesystem for this to work. The pathnames that |
|
|
@samp{emacsclient} specifies should be correct for the filesystem that |
|
|
the Emacs process sees. The Emacs process should not be suspended at |
|
|
the time @samp{emacsclient} is invoked. On Unix and GNU/Linux systems, |
|
|
@samp{emacsclient} should either be invoked from another X window, or |
|
|
from a shell window inside Emacs itself, or from another interactive |
|
|
session, e.g., by means of a @code{screen} program. |
|
|
|
|
1656 |
@cindex @code{gnuserv} |
@cindex @code{gnuserv} |
1657 |
There is an enhanced version of @samp{emacsclient}/server called |
There is an enhanced version of @samp{emacsclient} called |
1658 |
@samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman} |
@samp{gnuserv}, written by @email{ange@@hplb.hpl.hp.com, Andy Norman} |
1659 |
(@pxref{Packages that do not come with Emacs}). @samp{gnuserv} uses |
(@pxref{Packages that do not come with Emacs}). @samp{gnuserv} uses |
1660 |
Internet domain sockets, so it can work across most network connections. |
Internet domain sockets, so it can work across most network connections. |
|
It also supports the execution of arbitrary Emacs Lisp forms and does |
|
|
not require the client program to wait for completion. |
|
|
|
|
|
The alpha version of an enhanced @samp{gnuserv} is available at |
|
1661 |
|
|
1662 |
@uref{ftp://ftp.wellfleet.com/netman/psmith/emacs/gnuserv-2.1alpha.tar.gz} |
The most recent @samp{gnuserv} package is available at |
1663 |
|
|
1664 |
The version available from @uref{http://meltin.net/hacks/emacs/} is |
@uref{http://meltin.net/hacks/emacs/} |
|
more recent, and has been tested with Emacs 21.2. |
|
1665 |
|
|
1666 |
@end itemize |
@end itemize |
1667 |
|
|
1672 |
@cindex Regexps for recognizing compiler errors |
@cindex Regexps for recognizing compiler errors |
1673 |
@cindex Errors, recognizing compiler |
@cindex Errors, recognizing compiler |
1674 |
|
|
1675 |
The variable @code{compilation-error-regexp-alist} helps control how |
Customize the @code{compilation-error-regexp-alist} variable. |
|
Emacs parses your compiler output. It is a list of triplets of the form: |
|
|
@code{(@var{regexp} @var{file-idx} @var{line-idx})}, where @var{regexp}, |
|
|
@var{file-idx} and @var{line-idx} are strings. To help determine what |
|
|
the constituent elements should be, load @file{compile.el} and then type |
|
|
@kbd{C-h v compilation-error-regexp-alist @key{RET}} to see the current |
|
|
value. A good idea is to look at @file{compile.el} itself as the |
|
|
comments included for this variable are quite useful---the regular |
|
|
expressions required for your compiler's output may be very close to one |
|
|
already provided. Once you have determined the proper regexps, use the |
|
|
following to inform Emacs of your changes: |
|
|
|
|
|
@lisp |
|
|
(setq compilation-error-regexp-alist |
|
|
(cons '(@var{regexp} @var{file-idx} @var{line-idx}) |
|
|
compilation-error-regexp-alist)) |
|
|
@end lisp |
|
1676 |
|
|
1677 |
@node Indenting switch statements, Customizing C and C++ indentation, Compiler error messages, Common requests |
@node Indenting switch statements, Customizing C and C++ indentation, Compiler error messages, Common requests |
1678 |
@section How do I change the indentation for @code{switch}? |
@section How do I change the indentation for @code{switch}? |
1702 |
spacing of four instead of two. |
spacing of four instead of two. |
1703 |
|
|
1704 |
The @emph{real} solution is to use @code{cc-mode} (the default mode for |
The @emph{real} solution is to use @code{cc-mode} (the default mode for |
1705 |
C programming in Emacs 20 and later) and add the following line to yoyr |
C programming in Emacs 20 and later) and add the following line to your |
1706 |
@file{.emacs}: |
@file{.emacs}: |
1707 |
|
|
1708 |
@lisp |
@lisp |
1939 |
@cindex Pairs of parentheses, highlighting |
@cindex Pairs of parentheses, highlighting |
1940 |
@cindex Matching parentheses |
@cindex Matching parentheses |
1941 |
|
|
1942 |
As of version 19, Emacs comes with @file{paren.el}, which (when loaded) |
Call @code{show-paren-mode} in your @file{.emacs} file: |
|
will automatically highlight matching parentheses whenever point (i.e., |
|
|
the cursor) is located over one. To load @file{paren.el} automatically, |
|
|
include the line |
|
|
|
|
|
@lisp |
|
|
(require 'paren) |
|
|
@end lisp |
|
|
|
|
|
in your @file{.emacs} file. @email{shutkoa@@ugsolutions.com, Alan Shutko} |
|
|
reports that as of version 20.1, you must also call @code{show-paren-mode} in |
|
|
your @file{.emacs} file: |
|
1943 |
|
|
1944 |
@lisp |
@lisp |
1945 |
(show-paren-mode 1) |
(show-paren-mode 1) |
1946 |
@end lisp |
@end lisp |
1947 |
|
|
1948 |
Customize will let you turn on @code{show-paren-mode}. Use @kbd{M-x |
You can also enable this mode by selecting the @samp{Paren Match |
1949 |
customize-group @key{RET} paren-showing @key{RET}}. From within |
Highlighting} option from the @samp{Options} menu of the Emacs menu bar |
1950 |
Customize, you can also go directly to the ``paren-showing'' group. |
at the top of any Emacs frame. |
1951 |
|
|
1952 |
Alternatives to paren include: |
Alternatives to this mode include: |
1953 |
|
|
1954 |
@itemize @bullet |
@itemize @bullet |
1955 |
|
|
2139 |
Any messages your command prints in the echo area will be suppressed. |
Any messages your command prints in the echo area will be suppressed. |
2140 |
|
|
2141 |
If you need to repeat a command a small number of times, you can use |
If you need to repeat a command a small number of times, you can use |
2142 |
@kbd{C-x z}, see @ref{Repeating commands}. |
@kbd{C-x z} (@pxref{Repeating commands}) or @kbd{C-x e}. |
2143 |
|
|
2144 |
@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests |
@node Forcing the cursor to remain in the same column, Forcing Emacs to iconify itself, Repeating a command as many times as possible, Common requests |
2145 |
@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? |
@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? |
2294 |
error messages, inserts them into a special buffer called |
error messages, inserts them into a special buffer called |
2295 |
@code{*compilation*}, and lets you visit the locus of each message in |
@code{*compilation*}, and lets you visit the locus of each message in |
2296 |
the source. Type @kbd{C-x `} to step through the offending lines one by |
the source. Type @kbd{C-x `} to step through the offending lines one by |
2297 |
one. Click @kbd{Mouse-2} or press @key{RET} on a message text in the |
one (starting with Emacs 22, you can also use @kbd{M-g M-p} and |
2298 |
|
@kbd{M-g M-n} to go to the previous and next matches directly). Click |
2299 |
|
@kbd{Mouse-2} or press @key{RET} on a message text in the |
2300 |
@code{*compilation*} buffer to go to the line whose number is mentioned |
@code{*compilation*} buffer to go to the line whose number is mentioned |
2301 |
in that message. |
in that message. |
2302 |
|
|
2303 |
But if you indeed need to go to a certain text line, type @kbd{M-x |
But if you indeed need to go to a certain text line, type @kbd{M-g M-g} |
2304 |
goto-line @key{RET}}. Emacs will prompt you for the number of the line |
(which is the default binding of the @code{goto-line} function starting |
2305 |
and go to that line. |
with Emacs 22). Emacs will prompt you for the number of the line and go |
2306 |
|
to that line. |
2307 |
|
|
2308 |
You can do this faster by invoking @code{goto-line} with a numeric |
You can do this faster by invoking @code{goto-line} with a numeric |
2309 |
argument that is the line's number. For example, @kbd{C-u 286 M-x |
argument that is the line's number. For example, @kbd{C-u 286 M-g M-g} |
2310 |
goto-line @key{RET}} will jump to line number 286 in the current |
will jump to line number 286 in the current buffer. |
|
buffer. |
|
|
|
|
|
If you need to use this command frequently, you might consider binding |
|
|
it to a key. The following snippet, if added to your @file{~/.emacs} |
|
|
file, will bind the sequence @kbd{C-x g} to @code{goto-line}: |
|
|
|
|
|
@lisp |
|
|
(global-set-key "\C-xg" 'goto-line) |
|
|
@end lisp |
|
|
|
|
2311 |
|
|
2312 |
@node Modifying pull-down menus, Deleting menus and menu options, Going to a line by number, Common requests |
@node Modifying pull-down menus, Deleting menus and menu options, Going to a line by number, Common requests |
2313 |
@section How can I create or modify new pull-down menu options? |
@section How can I create or modify new pull-down menu options? |
2429 |
@cindex FAQ, @code{font-lock-mode} |
@cindex FAQ, @code{font-lock-mode} |
2430 |
|
|
2431 |
@code{font-lock-mode} is the standard way to have Emacs perform syntax |
@code{font-lock-mode} is the standard way to have Emacs perform syntax |
2432 |
highlighting in the current buffer. With @code{font-lock-mode} turned |
highlighting in the current buffer. It is enabled by default in Emacs |
2433 |
on, different types of text will appear in different colors. For |
22.1 and later. |
2434 |
instance, if you turn on @code{font-lock-mode} in a programming mode, |
|
2435 |
|
With @code{font-lock-mode} turned on, different types of text will |
2436 |
|
appear in different colors. For instance, in a programming mode, |
2437 |
variables will appear in one face, keywords in a second, and comments in |
variables will appear in one face, keywords in a second, and comments in |
2438 |
a third. |
a third. |
2439 |
|
|
2442 |
hilit19 is now considered non-standard, although @file{hilit19.el} comes |
hilit19 is now considered non-standard, although @file{hilit19.el} comes |
2443 |
with the stock Emacs distribution. It is no longer maintained. |
with the stock Emacs distribution. It is no longer maintained. |
2444 |
|
|
2445 |
To turn @code{font-lock-mode} on within an existing buffer, use @kbd{M-x |
To turn @code{font-lock-mode} off within an existing buffer, use |
2446 |
font-lock-mode @key{RET}}. |
@kbd{M-x font-lock-mode @key{RET}}. |
|
|
|
|
To automatically invoke @code{font-lock-mode} when a particular major |
|
|
mode is invoked, set the major mode's hook. For example, to fontify all |
|
|
@code{c-mode} buffers, add the following to your @file{.emacs} file: |
|
2447 |
|
|
2448 |
@lisp |
In Emacs 21 and earlier versions, you could use the following code in |
2449 |
(add-hook 'c-mode-hook 'turn-on-font-lock) |
your @file{.emacs} file to turn on @code{font-lock-mode} globally: |
|
@end lisp |
|
|
|
|
|
To automatically invoke @code{font-lock-mode} for all major modes, you |
|
|
can turn on @code{global-font-lock-mode} by including the following line |
|
|
in your @file{.emacs} file: |
|
2450 |
|
|
2451 |
@lisp |
@lisp |
2452 |
(global-font-lock-mode 1) |
(global-font-lock-mode 1) |
2453 |
@end lisp |
@end lisp |
2454 |
|
|
|
@noindent |
|
|
This instructs Emacs to turn on font-lock mode in those buffers for |
|
|
which a font-lock mode definition has been provided (in the variable |
|
|
@code{font-lock-global-modes}). If you edit a file in |
|
|
@code{pie-ala-mode}, and no font-lock definitions have been provided for |
|
|
@code{pie-ala} files, then the above setting will have no effect on that |
|
|
particular buffer. |
|
|
|
|
2455 |
Highlighting a buffer with @code{font-lock-mode} can take quite a while, |
Highlighting a buffer with @code{font-lock-mode} can take quite a while, |
2456 |
and cause an annoying delay in display, so several features exist to |
and cause an annoying delay in display, so several features exist to |
2457 |
work around this. |
work around this. |
2491 |
available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x |
available by typing @kbd{C-h f font-lock-mode} (@kbd{M-x |
2492 |
describe-function @key{RET} font-lock-mode @key{RET}}). |
describe-function @key{RET} font-lock-mode @key{RET}}). |
2493 |
|
|
|
For more information on font-lock mode, take a look at the |
|
|
@code{font-lock-mode} FAQ, maintained by |
|
|
@email{jari.aalto@@ntc.nokia.com, Jari Aalto} at |
|
|
|
|
|
@uref{ftp://cs.uta.fi/pub/ssjaaa/ema-font.gui} |
|
|
|
|
2494 |
To print buffers with the faces (i.e., colors and fonts) intact, use |
To print buffers with the faces (i.e., colors and fonts) intact, use |
2495 |
@kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x |
@kbd{M-x ps-print-buffer-with-faces} or @kbd{M-x |
2496 |
ps-print-region-with-faces}. You will need a way to send text to a |
ps-print-region-with-faces}. You will need a way to send text to a |
2521 |
placing the following Lisp form in your @file{.emacs} file: |
placing the following Lisp form in your @file{.emacs} file: |
2522 |
|
|
2523 |
@lisp |
@lisp |
2524 |
(delete-selection-mode t) |
(delete-selection-mode 1) |
2525 |
@end lisp |
@end lisp |
2526 |
|
|
2527 |
According to the documentation string for @code{delete-selection-mode} |
According to the documentation string for @code{delete-selection-mode} |
2637 |
@cindex Files, maximum size |
@cindex Files, maximum size |
2638 |
|
|
2639 |
Old versions (i.e., anything before 19.29) of Emacs had problems editing |
Old versions (i.e., anything before 19.29) of Emacs had problems editing |
2640 |
files larger than 8 megabytes. As of version 19.29, the maximum buffer |
files larger than 8 megabytes. In versions 19.29 and later, the maximum |
2641 |
size is at least 2^27-1, or 134,217,727 bytes, or 132 MBytes. Emacs 20 |
buffer size is at least 2^27-1, or 134,217,727 bytes, or 132 MBytes. |
2642 |
can be compiled on some 64-bit systems in a way that enlarges the buffer |
And in Emacs 22, the maximum buffer size has been increased to |
2643 |
size up to 576,460,752,303,423,487 bytes, or 549,755,813 GBytes. |
268,435,455 bytes (or 256 MBytes) on 32-bit machines. |
|
|
|
|
If you are using a version of Emacs older than 19.29 and cannot upgrade, |
|
|
you will have to recompile. @email{lnz@@lucid.com, Leonard N. Zubkoff} |
|
|
suggests putting the following two lines in @file{src/config.h} before |
|
|
compiling Emacs to allow for 26-bit integers and pointers (and thus file |
|
|
sizes of up to 33,554,431 bytes): |
|
|
|
|
|
@example |
|
|
#define VALBITS 26 |
|
|
#define GCTYPEBITS 5 |
|
|
@end example |
|
|
|
|
|
@noindent |
|
|
This method may result in ``ILLEGAL DATATYPE'' and other random errors on |
|
|
some machines. |
|
|
|
|
|
@email{daveg@@csvax.cs.caltech.edu, David Gillespie} explains how this |
|
|
problems crops up; while his numbers are true only for pre-19.29 |
|
|
versions of Emacs, the theory remains the same with current versions. |
|
|
|
|
|
@quotation |
|
|
Emacs is largely written in a dialect of Lisp; Lisp is a freely-typed |
|
|
language in the sense that you can put any value of any type into any |
|
|
variable, or return it from a function, and so on. So each value |
|
|
must carry a @dfn{tag} along with it identifying what kind of thing it |
|
|
is, e.g., integer, pointer to a list, pointer to an editing buffer, and |
|
|
so on. Emacs uses standard 32-bit integers for data objects, taking the |
|
|
top 8 bits for the tag and the bottom 24 bits for the value. So |
|
|
integers (and pointers) are somewhat restricted compared to true C |
|
|
integers and pointers. |
|
|
@end quotation |
|
2644 |
|
|
2645 |
@node ^M in the shell buffer, Shell process exits abnormally, Problems with very large files, Bugs and problems |
@node ^M in the shell buffer, Shell process exits abnormally, Problems with very large files, Bugs and problems |
2646 |
@section How do I get rid of @samp{^M} or echoed commands in my shell buffer? |
@section How do I get rid of @samp{^M} or echoed commands in my shell buffer? |
2705 |
(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m) |
(add-hook 'comint-output-filter-functions 'shell-strip-ctrl-m) |
2706 |
@end smalllisp |
@end smalllisp |
2707 |
|
|
2708 |
On a related note: If your shell is echoing your input line in the shell |
On a related note: if your shell is echoing your input line in the shell |
2709 |
buffer, you might want to try the following command in your shell |
buffer, you might want to customize the @code{comint-process-echoes} |
2710 |
start-up file: |
variable in your shell buffers, or try the following command in your |
2711 |
|
shell start-up file: |
2712 |
|
|
2713 |
@example |
@example |
2714 |
stty -icrnl -onlcr -echo susp ^Z |
stty -icrnl -onlcr -echo susp ^Z |
3377 |
* Emacs for Apple computers:: |
* Emacs for Apple computers:: |
3378 |
* Emacs for VMS and DECwindows:: |
* Emacs for VMS and DECwindows:: |
3379 |
* Modes for various languages:: |
* Modes for various languages:: |
|
* Translating names to IP addresses:: |
|
3380 |
@end menu |
@end menu |
3381 |
|
|
3382 |
@node Finding Emacs on the Internet, Finding a package with particular functionality, Finding Emacs and related packages, Finding Emacs and related packages |
@node Finding Emacs on the Internet, Finding a package with particular functionality, Finding Emacs and related packages, Finding Emacs and related packages |
3585 |
lack certain features, such as the Emacs Lisp extension language. |
lack certain features, such as the Emacs Lisp extension language. |
3586 |
|
|
3587 |
@node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages |
@node Emacs for Windows, Emacs for OS/2, Emacs for MS-DOS, Finding Emacs and related packages |
3588 |
@section Where can I get Emacs for Microsoft Windows |
@section Where can I get Emacs for Microsoft Windows? |
3589 |
@cindex FAQ for NT Emacs |
@cindex FAQ for NT Emacs |
3590 |
@cindex Emacs for MS-Windows |
@cindex Emacs for MS-Windows |
3591 |
@cindex Microsoft Windows, Emacs for |
@cindex Microsoft Windows, Emacs for |
3665 |
Emacs distribution; see the files @file{mac/README} and |
Emacs distribution; see the files @file{mac/README} and |
3666 |
@file{mac/INSTALL} in the Emacs distribution for build instructions. |
@file{mac/INSTALL} in the Emacs distribution for build instructions. |
3667 |
|
|
3668 |
Apple's ``OS X'' is based largely on NeXTSTEP and OpenStep. |
Beginning with version 22.1, Emacs supports Mac OS X natively. |
|
@xref{Emacs for NeXTSTEP}, for more details about that version. |
|
3669 |
|
|
3670 |
@node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages |
@node Emacs for VMS and DECwindows, Modes for various languages, Emacs for Apple computers, Finding Emacs and related packages |
3671 |
@section Where do I get Emacs that runs on VMS under DECwindows? |
@section Where do I get Emacs that runs on VMS under DECwindows? |
3675 |
Up-to-date information about GNU software (including Emacs) for VMS is |
Up-to-date information about GNU software (including Emacs) for VMS is |
3676 |
available at @uref{http://vms.gnu.org/}. |
available at @uref{http://vms.gnu.org/}. |
3677 |
|
|
3678 |
@node Modes for various languages, Translating names to IP addresses, Emacs for VMS and DECwindows, Finding Emacs and related packages |
@node Modes for various languages, , Emacs for VMS and DECwindows, Finding Emacs and related packages |
3679 |
@section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk? |
@section Where can I get modes for Lex, Yacc/Bison, Bourne shell, csh, C@t{++}, Objective-C, Pascal, Java, and Awk? |
3680 |
@cindex Awk, mode for |
@cindex Awk, mode for |
3681 |
@cindex @code{awk-mode} |
@cindex @code{awk-mode} |
3700 |
Java code. It is distributed with Emacs, but has |
Java code. It is distributed with Emacs, but has |
3701 |
@uref{http://cc-mode.sourceforge.net/, its own homepage}. |
@uref{http://cc-mode.sourceforge.net/, its own homepage}. |
3702 |
|
|
|
@node Translating names to IP addresses, , Modes for various languages, Finding Emacs and related packages |
|
|
@section What is the IP address of XXX.YYY.ZZZ? |
|
|
@cindex Translating names to IP addresses |
|
|
@cindex IP addresses from names |
|
|
@cindex Using BIND to translate addresses |
|
|
@cindex DNS and IP addresses |
|
|
|
|
|
If you are on a Unix machine, try using the @samp{nslookup} command, |
|
|
included in the Berkeley BIND package. For example, to find the IP |
|
|
address of @samp{ftp.gnu.org}, you would type @code{nslookup |
|
|
ftp.gnu.org}. |
|
|
|
|
|
Your computer should then provide the IP address of that machine. |
|
|
|
|
|
If your site's nameserver is deficient, you can use IP addresses to FTP |
|
|
files. You can get this information by e-mail: |
|
|
|
|
|
@example |
|
|
To: dns@@[134.214.84.25] (to grasp.insa-lyon.fr) |
|
|
Body: ip XXX.YYY.ZZZ (or "help" for more information |
|
|
and options - no quotes) |
|
|
@end example |
|
|
|
|
|
@noindent |
|
|
or: |
|
|
|
|
|
@example |
|
|
To: resolve@@[147.31.254.130] (to laverne.cs.widener.edu) |
|
|
Body: site XXX.YYY.ZZZ |
|
|
@end example |
|
|
|
|
3703 |
@c ------------------------------------------------------------ |
@c ------------------------------------------------------------ |
3704 |
@node Major packages and programs, Key bindings, Finding Emacs and related packages, Top |
@node Major packages and programs, Key bindings, Finding Emacs and related packages, Top |
3705 |
@chapter Major packages and programs |
@chapter Major packages and programs |
4071 |
* Binding combinations of modifiers and function keys:: |
* Binding combinations of modifiers and function keys:: |
4072 |
* Meta key does not work in xterm:: |
* Meta key does not work in xterm:: |
4073 |
* ExtendChar key does not work as Meta:: |
* ExtendChar key does not work as Meta:: |
4074 |
|
* SPC no longer completes file names:: |
4075 |
@end menu |
@end menu |
4076 |
|
|
4077 |
@node Binding keys to commands, Invalid prefix characters, Key bindings, Key bindings |
@node Binding keys to commands, Invalid prefix characters, Key bindings, Key bindings |
4089 |
|
|
4090 |
@inforef{Key Bindings, Key Bindings, emacs}, for further details. |
@inforef{Key Bindings, Key Bindings, emacs}, for further details. |
4091 |
|
|
4092 |
To make the process of binding keys interactively eaiser, use the |
To make the process of binding keys interactively easier, use the |
4093 |
following ``trick'': First bind the key interactively, then immediately |
following ``trick'': First bind the key interactively, then immediately |
4094 |
type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed |
type @kbd{C-x @key{ESC} @key{ESC} C-a C-k C-g}. Now, the command needed |
4095 |
to bind the key is in the kill ring, and can be yanked into your |
to bind the key is in the kill ring, and can be yanked into your |
4718 |
|
|
4719 |
@end itemize |
@end itemize |
4720 |
|
|
4721 |
@node ExtendChar key does not work as Meta, , Meta key does not work in xterm, Key bindings |
@node ExtendChar key does not work as Meta, SPC no longer completes file names, Meta key does not work in xterm, Key bindings |
4722 |
@section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x? |
@section Why doesn't my @key{ExtendChar} key work as a @key{Meta} key under HP-UX 8.0 and 9.x? |
4723 |
@cindex @key{ExtendChar} key as @key{Meta} |
@cindex @key{ExtendChar} key as @key{Meta} |
4724 |
@cindex @key{Meta}, using @key{ExtendChar} for |
@cindex @key{Meta}, using @key{ExtendChar} for |
4741 |
This will disable the use of the extra keysyms systemwide, which may be |
This will disable the use of the extra keysyms systemwide, which may be |
4742 |
undesirable if you actually intend to use them. |
undesirable if you actually intend to use them. |
4743 |
|
|
4744 |
|
@node SPC no longer completes file names, , ExtendChar key does not work as Meta, Key bindings |
4745 |
|
@section Why doesn't SPC complete file names anymore? |
4746 |
|
@cindex @kbd{SPC} file name completion |
4747 |
|
|
4748 |
|
Starting with Emacs 22.1, @kbd{SPC} no longer completes file names in |
4749 |
|
the minibuffer, so that file names with embedded spaces could be typed |
4750 |
|
without the need to quote the spaces. |
4751 |
|
|
4752 |
|
You can get the old behavior by binding @kbd{SPC} to |
4753 |
|
@code{minibuffer-complete-word} in the minibuffer, as follows: |
4754 |
|
|
4755 |
|
@lisp |
4756 |
|
(define-key minibuffer-local-filename-completion-map (kbd "SPC") |
4757 |
|
'minibuffer-complete-word) |
4758 |
|
|
4759 |
|
(define-key minibuffer-local-must-match-filename-map (kbd "SPC") |
4760 |
|
'minibuffer-complete-word) |
4761 |
|
@end lisp |
4762 |
|
|
4763 |
@c ------------------------------------------------------------ |
@c ------------------------------------------------------------ |
4764 |
@node Alternate character sets, Mail and news, Key bindings, Top |
@node Alternate character sets, Mail and news, Key bindings, Top |
4765 |
@chapter Alternate character sets |
@chapter Alternate character sets |
5062 |
@cindex Mail packages and MIME |
@cindex Mail packages and MIME |
5063 |
@cindex FAQ for MIME and Emacs |
@cindex FAQ for MIME and Emacs |
5064 |
|
|
|
Read the Emacs MIME FAQ, maintained by @email{trey@@cs.berkeley.edu, |
|
|
MacDonald Hall Jackson} at |
|
|
|
|
|
@uref{http://bmrc.berkeley.edu/~trey/emacs/mime.html} |
|
|
|
|
5065 |
Version 6.x of VM supports MIME. @xref{VM}. Gnus supports MIME in mail |
Version 6.x of VM supports MIME. @xref{VM}. Gnus supports MIME in mail |
5066 |
and news messages as of version 5.8.1 (Pterodactyl). Rmail has limited |
and news messages as of version 5.8.1 (Pterodactyl). Rmail has limited |
5067 |
support for single-part MIME messages beginning with Emacs 20.3. |
support for single-part MIME messages beginning with Emacs 20.3. |