In this appendix:
• Availability of Packages
• Unpacking, Building, and Installing Emacs
Availability of Packages
All the software packages described in this book, with the exception of TEX, are GNU
software from the Free Software Foundation. Their software and other packages can be retrieved via anonymous FTP from the Internet site ftp.gnu.ai.mit.edu in the directory /pub/gnu. There are numerous mirror sites, information about which is in GNUinfo/FTP.
If you cannot download the packages you want from the Internet, or if you wish an easier solution, you can order software distributions from the Free Software Foundation. They are available in diskette, tape, and CD-ROM form. You can also order printed, bound copies of many GNU manuals, including several about Emacs, plus the Texinfo manual mentioned in Appendix C, Sharing Your Code. For more information, including prices, contact the FSF:
Free Software Foundation, Inc.
59 Temple Place - Suite 330 Boston, MA 02111-1307 USA Telephone: +1-617-542-5942 Fax: +1-617-542-2652 Email: gnu@prep.ai.mit.edu
The packages mentioned in this book that are available from the FSF are:
Emacs
The editor itself, plus a huge number of Lisp extensions. Available in source form as file emacs-x.y.tar.gz, where x and y are the major and minor version numbers of the latest version (presently 19.34).
Page 204
Texinfo
The GNU documentation system, including makeinfo and a manual on writing Texinfo documents. Requires TEX to make printed manuals. Available as texinfo-x.y.gz. The present version is 3.7.
Emacs Lisp Reference Manual
The Texinfo document The Emacs Lisp Reference Manual is available in source form as elisp-manual-19-x.y.tar.gz. (The 19 refers to the major version of Emacs.) The present version of the manual is 2.4. An online copy of this manual, created from source with makeinfo, is indispensable for Emacs Lisp programmers.
Shar utilities
Includes shar and unshar, for creating and unpacking software distributions. Available as sharutils-x.y.gz. The present version is 4.2. Note that shar files can be unpacked without unshar; just feed them to the standard UNIX sh command.
Gzip Compression and decompression package
Available as gzip-x.y.shar. The present version is 1.2.4.
Tar—Another program for creating and unpacking software distributions Available as tar-x.y.shar.gz. The present version is 1.11.8. Note that GNU tar, unlike most other implementations, can intrinsically handle .tar.gz files without requiring the use of Gzip.
The Jargon File
The On-line HackerJargon File (which was cited in the Introduction) is also available from
the FSF as the file jargversion.txt.gz, where version is presently 400. There's also an Info format version, jargversion.info.gz. It's a treasure trove of hacker lore, and is periodically published in book form as The New Hacker's Dictionary.
You can obtain TEX from the TEX Users' Group:
TEX Users Group
1850 Union Street—Suite 1637 San Francisco, CA 94123 USA Home page: http://www.tug.org/
Email: tug@tug.org Fax: +1-415-982-8559
Page 205
Unpacking, Building, and Installing Emacs
Like most GNU software, Emacs is trivially easy to unpack, build, and install. In fact, the instructions that follow apply to nearly all GNU software packages, not merely Emacs.
Unpacking
If you have a compressed tar file (file name ending in .tar.gz, .tar.Z, or .tgz and you have GNU tar, run:
tar zxvf file
If you don't have GNU tar, use this:
zcat file I tar xvf
(You'll find zcat in the Gzip package.) If you use the tar that comes with SVR4derived variants of UNIX, you may need to use xvof in place of xvf. The o makes you the owner of the extracted files. (Otherwise, the owner is the tar file's originator—who probably isn't known on your computer.) If you have a shar file (file name ending in .sh or .shar), run
unshar file
or simply
sh file
If the shar file is compressed (.Z or .gz), uncompress it first with gzip -d.
Building and Installing
First, in the top-level directory of the software package being built, configure the software by running the configure script.
Different software packages have different configuration options. See what the options are for a package with ./configure --help. The options for Emacs are:
--with-gcc
Use the GNU C compiler to compile Emacs.
--with-pop
Compile in support for the Post Office Protocol (POP), sometimes used for retrieving email (for those who read email with Emacs).
--with-kerberos
Use the Kerberos authentication extension to POP.
Page 206
--with-hesiod
Use Hesiod for finding the POP server.
--with-x
Build in X Window support.
--with-x-toolkit
Fancier X Window support; uses toolkit widgets. The X Toolkit is used by default, but --with-x-toolkit=motifuses the Motif toolkit instead.
You may also want to watch what the configure script is doing while it runs—it can take a while—so you'll probably want to use the --verbose option, too. Here's how I always invoke configure:
./configure --verbose --with-x --with-x-toolkit
After configuring the package, run make. This will compile the program and can take a long time.
Next, run make check. This runs any self-tests that are included with the package.
Presuming that the software successfully compiled and passed its tests, install it with make install.
Page 207
Index
Symbols
* (asterisk), 48-50 in buffer names, 149 in regular expressions, 58
@ in interactive declaration, 154 ' (backquote), 114, 193
\ (backslash), 6, 58, 186
\< and \> metacharacters, 60
\b and \B metacharacters, 60
\[. . . ] construct, 49
\( \) metacharacters, 59 [] (brackets), 135, 189
in regular expressions, 58
^ (caret) in regular expressions, 58 ,@ (splicing operator), 115, 193
$ (dollar sign) in regular expressions, 59 - (hyphen) in regular expressions, 58 ( ) (parentheses), 3
in regular expressions, 59 . (period), 58
+ (plus sign) in regular expressions, 59
? (question mark), 186
in regular expressions, 59 ''(quotation mark), 7
' (single quote), 7, 193 / (slash) function, 143 A
activate (keyword), 31 active keymaps, 128 add-hook function, 25 advice tool, 30-32 after (keyword), 30
after-change-functions variable, 67, 99, 157 after-save-hook variable, 51
aliases, function, 22 alist-replace function, 91
alt key, 5
anonymous functions, 26 append function, 82, 114, 189 apropos command, 10
aref function, 135, 187, 190 arguments, optional, 17 around (keyword), 31
ASCII codes for characters, 186 aset function, 135, 187, 190 assoc functions, 88
association lists, 85, 89, 91 assq function, 89
asterisk (*), 48-50 in buffer names, 149 in regular expressions, 58
asynchronous process objects, 169-173 atoms, 85
auto-save-mode, 97 auto-fill-mode, 96 autoload function, 75 autoloading files, 75 B
b (debugging command), 196, 198 backquote ('), 114, 193
backslash (\), 6, 58, 186
Page 208
Backspace key, 1 Backtrace* buffer, 196
backward-page command, 126
backward-word function, 104 before (keyword), 30
beginning of line, matching, 59 binding (see keybindings) bobp function, 144
bounding searches (see limiting searches) brackets [ , 135, 189
in regular expressions, 58 breakpoints, 198
BS code, 1
buffer-file-name variable, 25
buffer-local variables (see local variables) buffer-modified-p variable, 66
buffer objects, 165 buffers
*Backtrace*, 196 local keymap, 128
matching beginning/end of, 59 narrowing, 130
position in (see navigation) read-only, 24, 50
restriction of, 53
*scratch*, 10, 195 switching, 30-32
unauthorized changes to, 157-161 building Emacs, 205
byte-compiling, 36, 71, 76
byte-recompile-directory function, 77 C
c (debugging command), 197 C-u prefix, 11
C-x commands, 127
call-process function, 166, 170 car function, 81, 189
caret (∧) in regular expressions, 58 cars, cell, 83-85
case sensitivity, 5, 63, 185 cdr function, 81, 189 char-equal function, 186 char-syntax function, 106 char-to-string function, 186 characters, 186
ASCII codes for, 186 range of, 58
special (metacharacters), 6, 58, 186 circular lists, 93
classes, syntax, 105
code, compiling (see byte-compiling) command-apropos command, 12 commands, 5
completion, 195 debugging, 196
finding with apropos, 10 interactive, 15, 145-148 keymaps, 127-129
last-command variable, 35 menu, 156-157
mouse-related, 153-155
this-command variable, 43 comments, 3, 96, 200
comparing lists, 88 strings, 186
compile (keyword), 31
compiling (see byte-compiling) completion, 195
compression package, 204 concat function, 60, 187 concatenating lists, 82 cond function, 142, 191 condition-case function, 160 conditional expressions, 191 conditional file loading, 74
configuration file (see .emacs file) configure script, 205
conflicting symbols, 117-119 cons cells, 83-85, 188 cons function, 82-84, 163 consp function, 85, 189 constants (see literal data) control key, 5
copy-keymap function, 131 copyright, 201
copy-sequence function, 190 copy-syntax-table function, 131 crossword mode example, 133-181 current-buffer function, 176
current-column variable, 107 current-prefix-arg function, 32-33 current-time function, 48
current-time-string function, 47
current-window-configuration function, 38
Page 209
cursor
characters preceding, 108 commands for, 23
preserving location of, 52 (see also point)
customizing Emacs, 1-12 D
d (debugging command), 196, 198 data types, 186-190
date (see time) debugging, 195-198
macro functions, 113 profiling programs, 198 declaring (see defining) decompression package, 204 defadvice function, 31 defalias function, 22 default variable values, 36
define-derived-mode function, 132 define-key function, 128, 153 defining
advice, 31 aliases, 22
functions, 14
interactive commands, 15 macro functions, 113, 194 minor modes, 97-99 pages, 126
paragraphs, 125 variables, 35
defmacro function, 113, 194 defsubst function, 136 defun function, 14, 194 defvar function, 35 DEL code, 1
delete-backward-char command, 8 delete-char function, 11
Delete key, 1
delete-region function, 54 derived (package), 132 derived modes, 131-132 describe-bindings command, 7 describe-copying function, 202 describe-key command, 13 detecting errors, 39
directories
byte-compiling, 77 in load path, 73
display-buffer function, 167 documentation, 201
docstrings, 14, 129, 193
dollar sign ($) in regular expressions, 59
dotted pair notation, 83
down-mouse symbols, 154-155 E
e code in interactive declaration, 154 e (debugging command), 196, 198 Edebug, 197-198
edebug-all-defs variable, 197 edebug-defun command, 197 edit-options, 49
efficiency, 46
byte-compiled files, 77 egrep utility, 169-172 .el file extension, 71 .elc file extension, 77 elp- commands, 198-199 ELP package, 198
else clause (see if function) Emacs
obtaining, 203
unpacking, building, installing, 205 versions of, xii
.emacs file, 2, 8, 71
empty list, 17, 81, 185, 189 empty string, 59
enable-local-eval function, 80 enable-local-variables function, 80 end of line, matching, 59
equal function, 88 equality (see comparing)