1 This is Info file ../../info/xemacs.info, produced by Makeinfo version
2 1.68 from the input file xemacs.texi.
4 INFO-DIR-SECTION XEmacs Editor
6 * XEmacs: (xemacs). XEmacs Editor.
9 This file documents the XEmacs editor.
11 Copyright (C) 1985, 1986, 1988 Richard M. Stallman. Copyright (C)
12 1991, 1992, 1993, 1994 Lucid, Inc. Copyright (C) 1993, 1994 Sun
13 Microsystems, Inc. Copyright (C) 1995 Amdahl Corporation.
15 Permission is granted to make and distribute verbatim copies of this
16 manual provided the copyright notice and this permission notice are
17 preserved on all copies.
19 Permission is granted to copy and distribute modified versions of
20 this manual under the conditions for verbatim copying, provided also
21 that the sections entitled "The GNU Manifesto", "Distribution" and "GNU
22 General Public License" are included exactly as in the original, and
23 provided that the entire resulting derived work is distributed under the
24 terms of a permission notice identical to this one.
26 Permission is granted to copy and distribute translations of this
27 manual into another language, under the above conditions for modified
28 versions, except that the sections entitled "The GNU Manifesto",
29 "Distribution" and "GNU General Public License" may be included in a
30 translation approved by the author instead of in the original English.
33 File: xemacs.info, Node: Loading, Next: Compiling Libraries, Prev: Lisp Libraries, Up: Lisp Libraries
39 Load the file FILE of Lisp code.
41 `M-x load-library LIBRARY'
42 Load the library named LIBRARY.
44 `M-x locate-library LIBRARY &optional NOSUFFIX'
45 Show the full path name of Emacs library LIBRARY.
47 To execute a file of Emacs Lisp, use `M-x load-file'. This command
48 reads the file name you provide in the minibuffer, then executes the
49 contents of that file as Lisp code. It is not necessary to visit the
50 file first; in fact, this command reads the file as found on disk, not
51 the text in an Emacs buffer.
53 Once a file of Lisp code is installed in the Emacs Lisp library
54 directories, users can load it using `M-x load-library'. Programs can
55 load it by calling `load-library', or with `load', a more primitive
56 function that is similar but accepts some additional arguments.
58 `M-x load-library' differs from `M-x load-file' in that it searches
59 a sequence of directories and tries three file names in each directory.
60 The three names are: first, the specified name with `.elc' appended;
61 second, the name with `.el' appended; third, the specified name alone.
62 A `.elc' file would be the result of compiling the Lisp file into byte
63 code; if possible, it is loaded in preference to the Lisp file itself
64 because the compiled file loads and runs faster.
66 Because the argument to `load-library' is usually not in itself a
67 valid file name, file name completion is not available. In fact, when
68 using this command, you usually do not know exactly what file name will
71 The sequence of directories searched by `M-x load-library' is
72 specified by the variable `load-path', a list of strings that are
73 directory names. The elements of this list may not begin with "`~'",
74 so you must call `expand-file-name' on them before adding them to the
75 list. The default value of the list contains the directory where the
76 Lisp code for Emacs itself is stored. If you have libraries of your
77 own, put them in a single directory and add that directory to
78 `load-path'. `nil' in this list stands for the current default
79 directory, but it is probably not a good idea to put `nil' in the list.
80 If you start wishing that `nil' were in the list, you should probably
81 use `M-x load-file' for this case.
83 The variable is initialized by the EMACSLOADPATH environment
84 variable. If no value is specified, the variable takes the default value
85 specified in the file `paths.h' when Emacs was built. If a path isn't
86 specified in `paths.h', a default value is obtained from the file
87 system, near the directory in which the Emacs executable resides.
89 Like `M-x load-library', `M-x locate-library' searches the
90 directories in `load-path' to find the file that `M-x load-library'
91 would load. If the optional second argument NOSUFFIX is non-`nil', the
92 suffixes `.elc' or `.el' are not added to the specified name LIBRARY
93 (like calling `load' instead of `load-library').
95 You often do not have to give any command to load a library, because
96 the commands defined in the library are set up to "autoload" that
97 library. Running any of those commands causes `load' to be called to
98 load the library; this replaces the autoload definitions with the real
99 ones from the library.
101 If autoloading a file does not finish, either because of an error or
102 because of a `C-g' quit, all function definitions made by the file are
103 undone automatically. So are any calls to `provide'. As a
104 consequence, the entire file is loaded a second time if you use one of
105 the autoloadable commands again. This prevents problems when the
106 command is no longer autoloading but is working incorrectly because the
107 file was only partially loaded. Function definitions are undone only
108 for autoloading; explicit calls to `load' do not undo anything if
109 loading is not completed.
111 The variable `after-load-alist' takes an alist of expressions to be
112 evaluated when particular files are loaded. Each element has the form
113 `(FILENAME forms...)'. When `load' is run and the filename argument is
114 FILENAME, the forms in the corresponding element are executed at the
117 FILENAME must match exactly. Normally FILENAME is the name of a
118 library, with no directory specified, since that is how load is
119 normally called. An error in `forms' does not undo the load, but it
120 does prevent execution of the rest of the `forms'.
123 File: xemacs.info, Node: Compiling Libraries, Next: Mocklisp, Prev: Loading, Up: Lisp Libraries
128 Emacs Lisp code can be compiled into byte-code which loads faster,
129 takes up less space when loaded, and executes faster.
131 `M-x batch-byte-compile'
132 Run byte-compile-file on the files remaining on the command line.
134 `M-x byte-compile-buffer &optional BUFFER'
135 Byte-compile and evaluate contents of BUFFER (default is current
138 `M-x byte-compile-file'
139 Compile a file of Lisp code named FILENAME into a file of byte
142 `M-x byte-compile-and-load-file FILENAME'
143 Compile a file of Lisp code named FILENAME into a file of byte
146 `M-x byte-recompile-directory DIRECTORY'
147 Recompile every `.el' file in DIRECTORY that needs recompilation.
150 Print disassembled code for OBJECT on (optional) STREAM.
152 `M-x make-obsolete FUNCTION NEW'
153 Make the byte-compiler warn that FUNCTION is obsolete and NEW
154 should be used instead.
156 `byte-compile-file' creates a byte-code compiled file from an
157 Emacs-Lisp source file. The default argument for this function is the
158 file visited in the current buffer. The function reads the specified
159 file, compiles it into byte code, and writes an output file whose name
160 is made by appending `c' to the input file name. Thus, the file
161 `rmail.el' would be compiled into `rmail.elc'. To compile a file of
162 Lisp code named FILENAME into a file of byte code and then load it, use
163 `byte-compile-and-load-file'. To compile and evaluate Lisp code in a
164 given buffer, use `byte-compile-buffer'.
166 To recompile all changed Lisp files in a directory, use `M-x
167 byte-recompile-directory'. Specify just the directory name as an
168 argument. Each `.el' file that has been byte-compiled before is
169 byte-compiled again if it has changed since the previous compilation.
170 A numeric argument to this command tells it to offer to compile each
171 `.el' file that has not been compiled yet. You must answer `y' or `n'
174 You can use the function `batch-byte-compile' to invoke Emacs
175 non-interactively from the shell to do byte compilation. When you use
176 this function, the files to be compiled are specified with command-line
177 arguments. Use a shell command of the form:
179 emacs -batch -f batch-byte-compile FILES...
181 Directory names may also be given as arguments; in that case,
182 `byte-recompile-directory' is invoked on each such directory.
183 `batch-byte-compile' uses all remaining command-line arguments as file
184 or directory names, then kills the Emacs process.
186 `M-x disassemble' explains the result of byte compilation. Its
187 argument is a function name. It displays the byte-compiled code in a
188 help window in symbolic form, one instruction per line. If the
189 instruction refers to a variable or constant, that is shown, too.
192 File: xemacs.info, Node: Mocklisp, Prev: Compiling Libraries, Up: Lisp Libraries
194 Converting Mocklisp to Lisp
195 ---------------------------
197 XEmacs can run Mocklisp files by converting them to Emacs Lisp first.
198 To convert a Mocklisp file, visit it and then type `M-x
199 convert-mocklisp-buffer'. Then save the resulting buffer of Lisp file
200 in a file whose name ends in `.el' and use the new file as a Lisp
203 You cannot currently byte-compile converted Mocklisp code. The
204 reason is that converted Mocklisp code uses some special Lisp features
205 to deal with Mocklisp's incompatible ideas of how arguments are
206 evaluated and which values signify "true" or "false".
209 File: xemacs.info, Node: Lisp Eval, Next: Lisp Debug, Prev: Lisp Libraries, Up: Running
211 Evaluating Emacs-Lisp Expressions
212 =================================
214 Lisp programs intended to be run in Emacs should be edited in
215 Emacs-Lisp mode; this will happen automatically for file names ending in
216 `.el'. By contrast, Lisp mode itself should be used for editing Lisp
217 programs intended for other Lisp systems. Emacs-Lisp mode can be
218 selected with the command `M-x emacs-lisp-mode'.
220 For testing of Lisp programs to run in Emacs, it is useful to be able
221 to evaluate part of the program as it is found in the Emacs buffer. For
222 example, if you change the text of a Lisp function definition and then
223 evaluate the definition, Emacs installs the change for future calls to
224 the function. Evaluation of Lisp expressions is also useful in any
225 kind of editing task for invoking non-interactive functions (functions
226 that are not commands).
229 Read a Lisp expression in the minibuffer, evaluate it, and print
230 the value in the minibuffer (`eval-expression').
233 Evaluate the Lisp expression before point, and print the value in
234 the minibuffer (`eval-last-sexp').
237 Evaluate the defun containing point or after point, and print the
238 value in the minibuffer (`eval-defun').
241 Evaluate all the Lisp expressions in the region.
243 `M-x eval-current-buffer'
244 Evaluate all the Lisp expressions in the buffer.
246 `M-<ESC>' (`eval-expression') is the most basic command for
247 evaluating a Lisp expression interactively. It reads the expression
248 using the minibuffer, so you can execute any expression on a buffer
249 regardless of what the buffer contains. When evaluation is complete,
250 the current buffer is once again the buffer that was current when
253 `M-<ESC>' can easily confuse users, especially on keyboards with
254 autorepeat, where it can result from holding down the <ESC> key for too
255 long. Therefore, `eval-expression' is normally a disabled command.
256 Attempting to use this command asks for confirmation and gives you the
257 option of enabling it; once you enable the command, you are no longer
258 required to confirm. *Note Disabling::.
260 In Emacs-Lisp mode, the key `C-M-x' is bound to the function
261 `eval-defun', which parses the defun containing point or following point
262 as a Lisp expression and evaluates it. The value is printed in the echo
263 area. This command is convenient for installing in the Lisp environment
264 changes that you have just made in the text of a function definition.
266 The command `C-x C-e' (`eval-last-sexp') performs a similar job but
267 is available in all major modes, not just Emacs-Lisp mode. It finds
268 the sexp before point, reads it as a Lisp expression, evaluates it, and
269 prints the value in the echo area. It is sometimes useful to type in an
270 expression and then, with point still after it, type `C-x C-e'.
272 If `C-M-x' or `C-x C-e' are given a numeric argument, they print the
273 value by inserting it into the current buffer at point, rather than in
274 the echo area. The argument value does not matter.
276 The most general command for evaluating Lisp expressions from a
277 buffer is `eval-region'. `M-x eval-region' parses the text of the
278 region as one or more Lisp expressions, evaluating them one by one.
279 `M-x eval-current-buffer' is similar, but it evaluates the entire
280 buffer. This is a reasonable way to install the contents of a file of
281 Lisp code that you are just ready to test. After finding and fixing a
282 bug, use `C-M-x' on each function that you change, to keep the Lisp
283 world in step with the source file.
286 File: xemacs.info, Node: Lisp Debug, Next: Lisp Interaction, Prev: Lisp Eval, Up: Running
288 The Emacs-Lisp Debugger
289 =======================
291 XEmacs contains a debugger for Lisp programs executing inside it.
292 This debugger is normally not used; many commands frequently get Lisp
293 errors when invoked in inappropriate contexts (such as `C-f' at the end
294 of the buffer) and it would be unpleasant to enter a special debugging
295 mode in this case. When you want to make Lisp errors invoke the
296 debugger, you must set the variable `debug-on-error' to non-`nil'.
297 Quitting with `C-g' is not considered an error, and `debug-on-error'
298 has no effect on the handling of `C-g'. However, if you set
299 `debug-on-quit' to be non-`nil', `C-g' will invoke the debugger. This
300 can be useful for debugging an infinite loop; type `C-g' once the loop
301 has had time to reach its steady state. `debug-on-quit' has no effect
304 You can make Emacs enter the debugger when a specified function is
305 called or at a particular place in Lisp code. Use `M-x debug-on-entry'
306 with argument FUN-NAME to have Emacs enter the debugger as soon as
307 FUN-NAME is called. Use `M-x cancel-debug-on-entry' to make the
308 function stop entering the debugger when called. (Redefining the
309 function also does this.) To enter the debugger from some other place
310 in Lisp code, you must insert the expression `(debug)' there and
311 install the changed code with `C-M-x'. *Note Lisp Eval::.
313 When the debugger is entered, it displays the previously selected
314 buffer in one window and a buffer named `*Backtrace*' in another
315 window. The backtrace buffer contains one line for each level of Lisp
316 function execution currently going on. At the beginning of the buffer
317 is a message describing the reason that the debugger was invoked, for
318 example, an error message if it was invoked due to an error.
320 The backtrace buffer is read-only and is in Backtrace mode, a special
321 major mode in which letters are defined as debugger commands. The
322 usual Emacs editing commands are available; you can switch windows to
323 examine the buffer that was being edited at the time of the error, and
324 you can switch buffers, visit files, and perform any other editing
325 operations. However, the debugger is a recursive editing level (*note
326 Recursive Edit::.); it is a good idea to return to the backtrace buffer
327 and explictly exit the debugger when you don't want to use it any more.
328 Exiting the debugger kills the backtrace buffer.
330 The contents of the backtrace buffer show you the functions that are
331 executing and the arguments that were given to them. It also allows you
332 to specify a stack frame by moving point to the line describing that
333 frame. The frame whose line point is on is considered the "current
334 frame". Some of the debugger commands operate on the current frame.
335 Debugger commands are mainly used for stepping through code one
336 expression at a time. Here is a list of them:
339 Exit the debugger and continue execution. In most cases,
340 execution of the program continues as if the debugger had never
341 been entered (aside from the effect of any variables or data
342 structures you may have changed while inside the debugger). This
343 includes entry to the debugger due to function entry or exit,
344 explicit invocation, and quitting or certain errors. Most errors
345 cannot be continued; trying to continue an error usually causes
346 the same error to occur again.
349 Continue execution, but enter the debugger the next time a Lisp
350 function is called. This allows you to step through the
351 subexpressions of an expression, and see what the subexpressions
352 do and what values they compute.
354 When you enter the debugger this way, Emacs flags the stack frame
355 for the function call from which you entered. The same function
356 is then called when you exit the frame. To cancel this flag, use
360 Set up to enter the debugger when the current frame is exited.
361 Frames that invoke the debugger on exit are flagged with stars.
364 Don't enter the debugger when the current frame is exited. This
365 cancels a `b' command on a frame.
368 Read a Lisp expression in the minibuffer, evaluate it, and print
369 the value in the echo area. This is equivalent to the command
370 `M-<ESC>', except that `e' is not normally disabled like `M-<ESC>'.
373 Terminate the program being debugged; return to top-level Emacs
376 If the debugger was entered due to a `C-g' but you really want to
377 quit, not to debug, use the `q' command.
380 Return a value from the debugger. The value is computed by
381 reading an expression with the minibuffer and evaluating it.
383 The value returned by the debugger makes a difference when the
384 debugger was invoked due to exit from a Lisp call frame (as
385 requested with `b'); then the value specified in the `r' command
386 is used as the value of that frame.
388 The debugger's return value also matters with many errors. For
389 example, `wrong-type-argument' errors will use the debugger's
390 return value instead of the invalid argument; `no-catch' errors
391 will use the debugger value as a throw tag instead of the tag that
392 was not found. If an error was signaled by calling the Lisp
393 function `signal', the debugger's return value is returned as the
397 File: xemacs.info, Node: Lisp Interaction, Next: External Lisp, Prev: Lisp Debug, Up: Running
399 Lisp Interaction Buffers
400 ========================
402 The buffer `*scratch*', which is selected when Emacs starts up, is
403 provided for evaluating Lisp expressions interactively inside Emacs.
404 Both the expressions you evaluate and their output goes in the buffer.
406 The `*scratch*' buffer's major mode is Lisp Interaction mode, which
407 is the same as Emacs-Lisp mode except for one command, <LFD>. In
408 Emacs-Lisp mode, <LFD> is an indentation command. In Lisp Interaction
409 mode, <LFD> is bound to `eval-print-last-sexp'. This function reads
410 the Lisp expression before point, evaluates it, and inserts the value
411 in printed representation before point.
413 The way to use the `*scratch*' buffer is to insert Lisp expressions
414 at the end, ending each one with <LFD> so that it will be evaluated.
415 The result is a complete typescript of the expressions you have
416 evaluated and their values.
418 The rationale for this feature is that Emacs must have a buffer when
419 it starts up, but that buffer is not useful for editing files since a
420 new buffer is made for every file that you visit. The Lisp interpreter
421 typescript is the most useful thing I can think of for the initial
422 buffer to do. `M-x lisp-interaction-mode' will put any buffer in Lisp
426 File: xemacs.info, Node: External Lisp, Prev: Lisp Interaction, Up: Running
428 Running an External Lisp
429 ========================
431 Emacs has facilities for running programs in other Lisp systems.
432 You can run a Lisp process as an inferior of Emacs, and pass
433 expressions to it to be evaluated. You can also pass changed function
434 definitions directly from the Emacs buffers in which you edit the Lisp
435 programs to the inferior Lisp process.
437 To run an inferior Lisp process, type `M-x run-lisp'. This runs the
438 program named `lisp', the same program you would run by typing `lisp'
439 as a shell command, with both input and output going through an Emacs
440 buffer named `*lisp*'. In other words, any "terminal output" from Lisp
441 will go into the buffer, advancing point, and any "terminal input" for
442 Lisp comes from text in the buffer. To give input to Lisp, go to the
443 end of the buffer and type the input, terminated by <RET>. The
444 `*lisp*' buffer is in Inferior Lisp mode, which has all the special
445 characteristics of Lisp mode and Shell mode (*note Shell Mode::.).
447 Use Lisp mode to run the source files of programs in external Lisps.
448 You can select this mode with `M-x lisp-mode'. It is used automatically
449 for files whose names end in `.l' or `.lisp', as most Lisp systems
452 When you edit a function in a Lisp program you are running, the
453 easiest way to send the changed definition to the inferior Lisp process
454 is the key `C-M-x'. In Lisp mode, this key runs the function
455 `lisp-send-defun', which finds the defun around or following point and
456 sends it as input to the Lisp process. (Emacs can send input to any
457 inferior process regardless of what buffer is current.)
459 Contrast the meanings of `C-M-x' in Lisp mode (for editing programs
460 to be run in another Lisp system) and Emacs-Lisp mode (for editing Lisp
461 programs to be run in Emacs): in both modes it has the effect of
462 installing the function definition that point is in, but the way of
463 doing so is different according to where the relevant Lisp environment
464 is found. *Note Lisp Modes::.
467 File: xemacs.info, Node: Packages, Next: Abbrevs, Prev: Running, Up: Top
472 The XEmacs 21 distribution comes only with a very basic set of
473 built-in modes and packages. Most of the packages that were part of
474 the distribution of earlier versions of XEmacs are now available
475 separately. The installer as well as the user can choose which
476 packages to install; the actual installation process is easy. This
477 gives an installer the ability to tailor an XEmacs installation for
478 local needs with safe removal of unnecessary code.
482 * Package Terminology:: Understanding different kinds of packages.
483 * Using Packages:: How to install and use packages.
484 * Building Packages:: Building packages from sources.
487 File: xemacs.info, Node: Package Terminology, Next: Using Packages, Up: Packages
492 There are two main flavors of packages.
494 * Regular Packages A regular package is one in which multiple files
495 are involved and one may not in general safely remove any of them.
497 * Single-File Packages A single-file package is an aggregate
498 collection of thematically related but otherwise independent lisp
499 files. These files are bundled together for download convenience
500 and individual files may be deleted at will without any loss of
503 Package Distributions
504 ---------------------
506 XEmacs Lisp packages are distributed in two ways, depending on the
507 intended use. Binary Packages are for installers and end-users and may
508 be installed directly into an XEmacs package directory. Source Packages
509 are for developers and include all files necessary for rebuilding
510 bytecompiled lisp and creating tarballs for distribution.
515 Binary packages may be installed directly into an XEmacs package
521 Source packages contain all of the Package author's (where
522 appropriate in regular packages) source code plus all of the files
523 necessary to build distribution tarballs (Unix Tar format files,
524 gzipped for space savings).
527 File: xemacs.info, Node: Using Packages, Next: Building Packages, Prev: Package Terminology, Up: Packages
532 When you first download XEmacs 21, you will usually first grab the
533 "core distribution", a file called `xemacs-21.0.tar.gz'. (Replace the
534 21.0 by the current version number.) The core distribution contains
535 the sources of XEmacs and a minimal set of Emacs Lisp files, which are
536 in the subdirectory named `lisp'. This subdirectory used to contain
537 all Emacs Lisp files distributed with XEmacs. Now, to conserve disk
538 space, most non-essential packages were made optional.
540 Choosing the Packages You Need
541 ------------------------------
543 The available packages can currently be found in the same ftp
544 directory where you grabbed the core distribution from, and are located
545 in the subdirectory `packages/binary-packages'. Package file names
546 follow the naming convention `<package-name>-<version>-pkg.tar.gz'.
548 If you have EFS *Note (EFS)::, packages can be installed over the
549 network. Alternatively, if you have copies of the packages locally,
550 you can install packages from a local disk or CDROM.
552 The file `etc/PACKAGES' in the core distribution contains a list of
553 the packages available at the time of the XEmacs release. Packages are
554 also listed on the `Options' menu under:
556 Options->Customize->Emacs->Packages
558 However, don't select any of these menu picks unless you actually
559 want to install the given package (and have properly configured your
562 You can also get a list of available packages, and whether or not
563 they are installed, using the visual package browser and installer.
564 You can access it via the menus:
566 Options->Manage Packages->List & Install
568 Or, you can get to it via the keyboard:
570 M-x pui-list-packages
572 Hint to system administrators of multi-user systems: it might be a
573 good idea to install all packages and not interfere with the wishes of
576 If you can't find which package provides the feature you require, try
577 using the `package-get-package-provider' function. Eg., if you know
578 that you need `thingatpt', type:
580 M-x package-get-package-provider RET thingatpt
582 which will return something like (fsf-compat "1.06"). You can the use
583 one of the methods above for installing the package you want.
585 XEmacs and Installing Packages
586 ------------------------------
588 Normally, packages are installed over the network, using EFS *Note
589 (EFS)::. However, you may not have network access, or you may already
590 have some or all of the packages on a local disk, such as a CDROM. If
591 you want to install from a local disk, you must first tell XEmacs where
592 to find the package binaries. This is done by adding a line like the
593 following to your `.emacs' file:
595 (setq package-get-remote (cons (list nil "/my/path/to/package/binaries")
598 Here, you'd change `/my/path/to/package/binaries' to be the path to
599 your local package binaries. Next, restart XEmacs, and you're ready to
600 go (advanced users can just re-evaluate the sexp).
602 If you are installing from a temporary, one-time directory, you can
603 also add these directory names to `package-get-remote' using:
605 M-x pui-add-install-directory
607 Note, however, that any directories added using this function are not
608 saved; this information will be lost when you quit XEmacs.
610 If you're going to install over the network, you only have to insure
611 that EFS *Note (EFS):: works, and that it can get outside a firewall, if
612 you happen to be behind one. You shouldn't have to do anything else;
613 XEmacs already knows where to go. However you can add your own mirrors
614 to this list. See `package-get-remote'.
616 The easiest way to install a package is to use the visual package
617 browser and installer, using the menu pick:
619 Options->Manage Packages->List & Install
621 Options->Manage Packages->Using Custom->Select-> ...
623 You can also access it using the keyboard:
625 M-x pui-list-packages
627 The visual package browser will then display a list of all packages.
628 Help information will be displayed at the very bottom of the buffer; you
629 may have to scroll down to see it. You can also press `?' to get the
630 same help. From this buffer, you can tell the package status by the
631 character in the first column:
634 The package has not been installed.
637 The package has been installed, but a newer version is available.
638 The current version is out-of-date.
641 The package has been marked for installation/update.
643 If there is no character in the first column, the package has been
644 installed and is up-to-date.
646 From here, you can select or unselect packages for installation using
647 the <RET> key, the `Mouse-2' button or selecting "Select" from the
648 (Popup) Menu. Once you've finished selecting the packages, you can
649 press the `x' key (or use the menu) to actually install the packages.
650 Note that you will have to restart XEmacs for XEmacs to recognize any
660 Toggle between selecting and unselecting a package for
664 Install selected packages.
667 View, in the minibuffer, additional information about the package,
668 such as the package date (not the build date) and the package
669 author. Moving the mouse over a package name will also do the
673 Toggle between verbose and non-verbose package display.
676 Refresh the package display.
679 Kill the package buffer.
681 Moving the mouse over a package will also cause additional
682 information about the package to be displayed in the minibuffer.
684 Other package installation interfaces
685 -------------------------------------
687 For an alternative package interface, you can select packages from
688 the customize menus, under:
690 Options->Customize->Emacs->Packages-> ...
692 Options->Manage Packages->Using Custom->Select-> ...
694 Set their state to on, and then do:
696 Options->Manage Packages->Using Custom->Update Packages
698 This will automatically retrieve the packages you have selected from
699 the XEmacs ftp site or your local disk, and install them into XEmacs.
700 Additionally it will update any packages you already have installed to
701 the newest version. Note that if a package is newly installed you will
702 have to restart XEmacs for the change to take effect.
704 You can also install packages using a semi-manual interface:
706 M-x package-get-all <return>
708 Enter the name of the package (e.g., `prog-modes'), and XEmacs will
709 search for the latest version (as listed in the lisp file
710 `lisp/package-get-base.el'), and install it and any packages that it
713 Manual Binary Package Installation
714 ----------------------------------
716 Pre-compiled, binary packages can be installed in either a system
717 package directory (this is determined when XEmacs is compiled), or in
718 one of the following subdirectories of your `$HOME' directory:
720 ~/.xemacs/mule-packages
721 ~/.xemacs/xemacs-packages
723 Packages in the former directory will only be found by a Mule-enabled
726 XEmacs does not have to be running to install binary packages,
727 although XEmacs will not know about any newly-installed packages until
728 you restart XEmacs. Note, however, that installing a newer version of a
729 package while XEmacs is running could cause strange errors in XEmacs;
730 it's best to exit XEmacs before upgrading an existing package.
732 To install binary packages manually:
734 1. Download the package(s) that you want to install. Each binary
735 package will typically be a gzip'd tarball.
737 2. Decide where to install the packages: in the system package
738 directory, or in `~/.xemacs/mule-packages' or
739 `~/.xemacs/xemacs-packages', respectively. If you want to install
740 the packages in the system package directory, make sure you can
741 write into that directory. If you want to install in your `$HOME'
742 directory, create the directory, `~/.xemacs/mule-packages' or
743 `~/.xemacs/xemacs-packages', respectively.
745 3. Next, `cd' to the directory under which you want to install the
748 4. From this directory, uncompress and extract each of the gzip'd
749 tarballs that you downloaded in step 1. Unix and Cygnus cygwin
750 users will typically do this using the commands:
752 gunzip < package.tar.gz | tar xvf -
754 Above, replace `package.tar.gz' with the filename of the package
755 that you downloaded in step 1.
757 Of course, if you use GNU `tar', you could also use:
759 tar xvzf package.tar.gz
761 5. That's it. Quit and restart XEmacs to get it to recognize any new
766 File: xemacs.info, Node: Building Packages, Prev: Using Packages, Up: Packages
768 Source packages are available from the `packages/source-packages'
769 subdirectory of your favorite XEmacs distribution site. Alternatively,
770 they are available via CVS from `cvs.xemacs.org'. Look at
771 `http://cvs.xemacs.org' for instructions.
773 Prerequisites for Building Source Packages
774 ------------------------------------------
776 You must have GNU `cp', GNU `install' (or a BSD compatible `install'
777 program) GNU `make' (3.75 or later preferred), `makeinfo' (1.68 from
778 `texinfo-3.11' or later required), GNU `tar' and XEmacs 21.0. The
779 source packages will untar into a correct directory structure. At the
780 top level you must have `XEmacs.rules' and `package-compile.el'. These
781 files are available from the XEmacs FTP site from the same place you
782 obtained your source package distributions.
784 What You Can Do With Source Packages
785 ------------------------------------
787 NB: A global build operation doesn't exist yet as of 13 January
790 Source packages are most useful for creating XEmacs package tarballs
791 for installation into your own XEmacs installations or for distributing
794 Supported operations from `make' are:
797 Remove all built files except `auto-autoloads.el' and
801 Remove XEmacs backups as well as the files deleted by `make clean'.
804 Bytecompile all files, build and bytecompile byproduct files like
805 `auto-autoloads.el' and `custom-load.el'. Create info version of
806 TeXinfo documentation if present.
809 Usually aliased to `make srckit-std'. This does a `make
810 distclean' and creates a package source tarball in the staging
811 directory. This is generally only of use for package maintainers.
814 May be aliased to `binkit-sourceonly', `binkit-sourceinfo',
815 `binkit-sourcedata', or `binkit-sourcedatainfo'. `sourceonly'
816 indicates there is nothing to install in a data directory or info
817 directory. `sourceinfo' indicates that source and info files are
818 to be installed. `sourcedata' indicates that source and etc
819 (data) files are to be installed. `sourcedatainfo' indicates
820 source, etc (data), and info files are to be installed. A few
821 packages have needs beyond the basic templates so this is not yet
825 Runs the rules `srckit' followed by `binkit'. This is primarily
826 of use by XEmacs maintainers producing files for distribution.
829 File: xemacs.info, Node: Abbrevs, Next: Picture, Prev: Packages, Up: Top
834 An "abbrev" is a word which "expands" into some different text.
835 Abbrevs are defined by the user to expand in specific ways. For
836 example, you might define `foo' as an abbrev expanding to `find outer
837 otter'. With this abbrev defined, you would be able to get `find outer
838 otter ' into the buffer by typing `f o o <SPC>'.
840 Abbrevs expand only when Abbrev mode (a minor mode) is enabled.
841 Disabling Abbrev mode does not cause abbrev definitions to be discarded,
842 but they do not expand until Abbrev mode is enabled again. The command
843 `M-x abbrev-mode' toggles Abbrev mode; with a numeric argument, it
844 turns Abbrev mode on if the argument is positive, off otherwise. *Note
845 Minor Modes::. `abbrev-mode' is also a variable; Abbrev mode is on
846 when the variable is non-`nil'. The variable `abbrev-mode'
847 automatically becomes local to the current buffer when it is set.
849 Abbrev definitions can be "mode-specific"--active only in one major
850 mode. Abbrevs can also have "global" definitions that are active in
851 all major modes. The same abbrev can have a global definition and
852 various mode-specific definitions for different major modes. A
853 mode-specific definition for the current major mode overrides a global
856 You can define Abbrevs interactively during an editing session. You
857 can also save lists of abbrev definitions in files and reload them in
858 later sessions. Some users keep extensive lists of abbrevs that they
859 load in every session.
861 A second kind of abbreviation facility is called the "dynamic
862 expansion". Dynamic abbrev expansion happens only when you give an
863 explicit command and the result of the expansion depends only on the
864 current contents of the buffer. *Note Dynamic Abbrevs::.
868 * Defining Abbrevs:: Defining an abbrev, so it will expand when typed.
869 * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
870 * Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs.
871 * Saving Abbrevs:: Saving the entire list of abbrevs for another session.
872 * Dynamic Abbrevs:: Abbreviations for words already in the buffer.
875 File: xemacs.info, Node: Defining Abbrevs, Next: Expanding Abbrevs, Prev: Abbrevs, Up: Abbrevs
881 Define an abbrev to expand into some text before point
882 (`add-global-abbrev').
885 Similar, but define an abbrev available only in the current major
886 mode (`add-mode-abbrev').
889 Define a word in the buffer as an abbrev
890 (`inverse-add-global-abbrev').
893 Define a word in the buffer as a mode-specific abbrev
894 (`inverse-add-mode-abbrev').
896 `M-x kill-all-abbrevs'
897 After this command, no abbrev definitions remain in effect.
899 The usual way to define an abbrev is to enter the text you want the
900 abbrev to expand to, position point after it, and type `C-x a g'
901 (`add-global-abbrev'). This reads the abbrev itself using the
902 minibuffer, and then defines it as an abbrev for one or more words
903 before point. Use a numeric argument to say how many words before point
904 should be taken as the expansion. For example, to define the abbrev
905 `foo' as in the example above, insert the text `find outer otter', then
907 `C-u 3 C-x a g f o o <RET>'.
909 An argument of zero to `C-x a g' means to use the contents of the
910 region as the expansion of the abbrev being defined.
912 The command `C-x a l' (`add-mode-abbrev') is similar, but defines a
913 mode-specific abbrev. Mode-specific abbrevs are active only in a
914 particular major mode. `C-x a l' defines an abbrev for the major mode
915 in effect at the time `C-x a l' is typed. The arguments work the same
916 way they do for `C-x a g'.
918 If the text of an abbrev you want is already in the buffer instead of
919 the expansion, use command `C-x a i g' (`inverse-add-global-abbrev')
920 instead of `C-x a g', or use `C-x a i l' (`inverse-add-mode-abbrev')
921 instead of `C-x a l'. These commands are called "inverse" because they
922 invert the meaning of the argument found in the buffer and the argument
923 read using the minibuffer.
925 To change the definition of an abbrev, just add the new definition.
926 You will be asked to confirm if the abbrev has a prior definition. To
927 remove an abbrev definition, give a negative argument to `C-x a g' or
928 `C-x a l'. You must choose the command to specify whether to kill a
929 global definition or a mode-specific definition for the current mode,
930 since those two definitions are independent for one abbrev.
932 `M-x kill-all-abbrevs' removes all existing abbrev definitions.
935 File: xemacs.info, Node: Expanding Abbrevs, Next: Editing Abbrevs, Prev: Defining Abbrevs, Up: Abbrevs
937 Controlling Abbrev Expansion
938 ============================
940 An abbrev expands whenever it is in a buffer just before point and
941 you type a self-inserting punctuation character (<SPC>, comma, etc.).
942 Most often an abbrev is used by inserting the abbrev followed by
945 Abbrev expansion preserves case; thus, `foo' expands into `find
946 outer otter', `Foo' into `Find outer otter', and `FOO' into `FIND OUTER
947 OTTER' or `Find Outer Otter' according to the variable
948 `abbrev-all-caps' (a non-`nil' value chooses the first of the two
951 Two commands are available to control abbrev expansion:
954 Separate a prefix from a following abbrev to be expanded
955 (`abbrev-prefix-mark').
958 Expand the abbrev before point (`expand-abbrev'). This is
959 effective even when Abbrev mode is not enabled.
961 `M-x unexpand-abbrev'
962 Undo last abbrev expansion.
964 `M-x expand-region-abbrevs'
965 Expand some or all abbrevs found in the region.
967 You may wish to expand an abbrev with a prefix attached. For
968 example, if `cnst' expands into `construction', you may want to use it
969 to enter `reconstruction'. It does not work to type `recnst', because
970 that is not necessarily a defined abbrev. Instead, you can use the
971 command `M-'' (`abbrev-prefix-mark') between the prefix `re' and the
972 abbrev `cnst'. First, insert `re'. Then type `M-''; this inserts a
973 minus sign in the buffer to indicate that it has done its work. Then
974 insert the abbrev `cnst'. The buffer now contains `re-cnst'. Now
975 insert a punctuation character to expand the abbrev `cnst' into
976 `construction'. The minus sign is deleted at this point by `M-''. The
977 resulting text is the desired `reconstruction'.
979 If you actually want the text of the abbrev in the buffer, rather
980 than its expansion, insert the following punctuation with `C-q'. Thus,
981 `foo C-q -' leaves `foo-' in the buffer.
983 If you expand an abbrev by mistake, you can undo the expansion
984 (replace the expansion by the original abbrev text) with `M-x
985 unexpand-abbrev'. You can also use `C-_' (`undo') to undo the
986 expansion; but that will first undo the insertion of the punctuation
989 `M-x expand-region-abbrevs' searches through the region for defined
990 abbrevs, and offers to replace each one it finds with its expansion.
991 This command is useful if you have typed text using abbrevs but forgot
992 to turn on Abbrev mode first. It may also be useful together with a
993 special set of abbrev definitions for making several global
994 replacements at once. The command is effective even if Abbrev mode is
998 File: xemacs.info, Node: Editing Abbrevs, Next: Saving Abbrevs, Prev: Expanding Abbrevs, Up: Abbrevs
1000 Examining and Editing Abbrevs
1001 =============================
1004 Print a list of all abbrev definitions.
1007 Edit a list of abbrevs; you can add, alter, or remove definitions.
1009 The output from `M-x list-abbrevs' looks like this:
1011 (lisp-mode-abbrev-table)
1013 (global-abbrev-table)
1014 "dfn" 0 "definition"
1016 (Some blank lines of no semantic significance, and some other abbrev
1017 tables, have been omitted.)
1019 A line containing a name in parentheses is the header for abbrevs in
1020 a particular abbrev table; `global-abbrev-table' contains all the global
1021 abbrevs, and the other abbrev tables that are named after major modes
1022 contain the mode-specific abbrevs.
1024 Within each abbrev table, each non-blank line defines one abbrev.
1025 The word at the beginning is the abbrev. The number that appears is
1026 the number of times the abbrev has been expanded. Emacs keeps track of
1027 this to help you see which abbrevs you actually use, in case you want
1028 to eliminate those that you don't use often. The string at the end of
1029 the line is the expansion.
1031 `M-x edit-abbrevs' allows you to add, change or kill abbrev
1032 definitions by editing a list of them in an Emacs buffer. The list has
1033 the format described above. The buffer of abbrevs is called
1034 `*Abbrevs*', and is in Edit-Abbrevs mode. This mode redefines the key
1035 `C-c C-c' to install the abbrev definitions as specified in the buffer.
1036 The `edit-abbrevs-redefine' command does this. Any abbrevs not
1037 described in the buffer are eliminated when this is done.
1039 `edit-abbrevs' is actually the same as `list-abbrevs', except that
1040 it selects the buffer `*Abbrevs*' whereas `list-abbrevs' merely
1041 displays it in another window.
1044 File: xemacs.info, Node: Saving Abbrevs, Next: Dynamic Abbrevs, Prev: Editing Abbrevs, Up: Abbrevs
1049 These commands allow you to keep abbrev definitions between editing
1052 `M-x write-abbrev-file'
1053 Write a file describing all defined abbrevs.
1055 `M-x read-abbrev-file'
1056 Read such an abbrev file and define abbrevs as specified there.
1058 `M-x quietly-read-abbrev-file'
1059 Similar, but do not display a message about what is going on.
1061 `M-x define-abbrevs'
1062 Define abbrevs from buffer.
1064 `M-x insert-abbrevs'
1065 Insert all abbrevs and their expansions into the buffer.
1067 Use `M-x write-abbrev-file' to save abbrev definitions for use in a
1068 later session. The command reads a file name using the minibuffer and
1069 writes a description of all current abbrev definitions into the
1070 specified file. The text stored in the file looks like the output of
1073 `M-x read-abbrev-file' prompts for a file name using the minibuffer
1074 and reads the specified file, defining abbrevs according to its
1075 contents. `M-x quietly-read-abbrev-file' is the same but does not
1076 display a message in the echo area; it is actually useful primarily in
1077 the `.emacs' file. If you give an empty argument to either of these
1078 functions, the file name Emacs uses is the value of the variable
1079 `abbrev-file-name', which is by default `"~/.abbrev_defs"'.
1081 Emacs offers to save abbrevs automatically if you have changed any of
1082 them, whenever it offers to save all files (for `C-x s' or `C-x C-c').
1083 Set the variable `save-abbrevs' to `nil' to inhibit this feature.
1085 The commands `M-x insert-abbrevs' and `M-x define-abbrevs' are
1086 similar to the previous commands but work on text in an Emacs buffer.
1087 `M-x insert-abbrevs' inserts text into the current buffer before point,
1088 describing all current abbrev definitions; `M-x define-abbrevs' parses
1089 the entire current buffer and defines abbrevs accordingly.
1092 File: xemacs.info, Node: Dynamic Abbrevs, Prev: Saving Abbrevs, Up: Abbrevs
1094 Dynamic Abbrev Expansion
1095 ========================
1097 The abbrev facility described above operates automatically as you
1098 insert text, but all abbrevs must be defined explicitly. By contrast,
1099 "dynamic abbrevs" allow the meanings of abbrevs to be determined
1100 automatically from the contents of the buffer, but dynamic abbrev
1101 expansion happens only when you request it explicitly.
1104 Expand the word in the buffer before point as a "dynamic abbrev",
1105 by searching in the buffer for words starting with that
1106 abbreviation (`dabbrev-expand').
1108 For example, if the buffer contains `does this follow ' and you type
1109 `f o M-/', the effect is to insert `follow' because that is the last
1110 word in the buffer that starts with `fo'. A numeric argument to `M-/'
1111 says to take the second, third, etc. distinct expansion found looking
1112 backward from point. Repeating `M-/' searches for an alternative
1113 expansion by looking farther back. After the entire buffer before
1114 point has been considered, the buffer after point is searched.
1116 Dynamic abbrev expansion is completely independent of Abbrev mode;
1117 the expansion of a word with `M-/' is completely independent of whether
1118 it has a definition as an ordinary abbrev.
1121 File: xemacs.info, Node: Picture, Next: Sending Mail, Prev: Abbrevs, Up: Top
1126 If you want to create a picture made out of text characters (for
1127 example, a picture of the division of a register into fields, as a
1128 comment in a program), use the command `edit-picture' to enter Picture
1131 In Picture mode, editing is based on the "quarter-plane" model of
1132 text. In this model, the text characters lie studded on an area that
1133 stretches infinitely far to the right and downward. The concept of the
1134 end of a line does not exist in this model; the most you can say is
1135 where the last non-blank character on the line is found.
1137 Of course, Emacs really always considers text as a sequence of
1138 characters, and lines really do have ends. But in Picture mode most
1139 frequently-used keys are rebound to commands that simulate the
1140 quarter-plane model of text. They do this by inserting spaces or by
1141 converting tabs to spaces.
1143 Most of the basic editing commands of Emacs are redefined by Picture
1144 mode to do essentially the same thing but in a quarter-plane way. In
1145 addition, Picture mode defines various keys starting with the `C-c'
1146 prefix to run special picture editing commands.
1148 One of these keys, `C-c C-c', is pretty important. Often a picture
1149 is part of a larger file that is usually edited in some other major
1150 mode. `M-x edit-picture' records the name of the previous major mode.
1151 You can then use the `C-c C-c' command (`picture-mode-exit') to restore
1152 that mode. `C-c C-c' also deletes spaces from the ends of lines,
1153 unless you give it a numeric argument.
1155 The commands used in Picture mode all work in other modes (provided
1156 the `picture' library is loaded), but are only bound to keys in
1157 Picture mode. Note that the descriptions below talk of moving "one
1158 column" and so on, but all the picture mode commands handle numeric
1159 arguments as their normal equivalents do.
1161 Turning on Picture mode calls the value of the variable
1162 `picture-mode-hook' as a function, with no arguments, if that value
1163 exists and is non-`nil'.
1167 * Basic Picture:: Basic concepts and simple commands of Picture Mode.
1168 * Insert in Picture:: Controlling direction of cursor motion
1169 after "self-inserting" characters.
1170 * Tabs in Picture:: Various features for tab stops and indentation.
1171 * Rectangles in Picture:: Clearing and superimposing rectangles.