1 This is ../info/xemacs.info, produced by makeinfo version 4.0 from
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: Using Packages, Next: Building Packages, Prev: Package Terminology, Up: Packages
38 When you first download XEmacs 21, you will usually first grab the
39 "core distribution", a file called `xemacs-21.0.tar.gz'. (Replace the
40 21.0 by the current version number.) The core distribution contains
41 the sources of XEmacs and a minimal set of Emacs Lisp files, which are
42 in the subdirectory named `lisp'. This subdirectory used to contain
43 all Emacs Lisp files distributed with XEmacs. Now, to conserve disk
44 space, most non-essential packages were made optional.
46 Choosing the Packages You Need
47 ------------------------------
49 The available packages can currently be found in the same ftp
50 directory where you grabbed the core distribution from, and are located
51 in the subdirectory `packages/binary-packages'. Package file names
52 follow the naming convention `<package-name>-<version>-pkg.tar.gz'.
54 If you have EFS *Note (EFS)::, packages can be installed over the
55 network. Alternatively, if you have copies of the packages locally,
56 you can install packages from a local disk or CDROM.
58 The file `etc/PACKAGES' in the core distribution contains a list of
59 the packages available at the time of the XEmacs release. Packages are
60 also listed on the `Options' menu under:
62 Options->Customize->Emacs->Packages
64 However, don't select any of these menu picks unless you actually
65 want to install the given package (and have properly configured your
68 You can also get a list of available packages, and whether or not
69 they are installed, using the visual package browser and installer.
70 You can access it via the menus:
72 Options->Manage Packages->List & Install
74 Or, you can get to it via the keyboard:
78 Hint to system administrators of multi-user systems: it might be a
79 good idea to install all packages and not interfere with the wishes of
82 If you can't find which package provides the feature you require, try
83 using the `package-get-package-provider' function. Eg., if you know
84 that you need `thingatpt', type:
86 M-x package-get-package-provider RET thingatpt
88 which will return something like (fsf-compat "1.06"). You can the use
89 one of the methods above for installing the package you want.
91 XEmacs and Installing Packages
92 ------------------------------
94 Normally, packages are installed over the network, using EFS *Note
95 (EFS)::. However, you may not have network access, or you may already
96 have some or all of the packages on a local disk, such as a CDROM. If
97 you want to install from a local disk, you must first tell XEmacs where
98 to find the package binaries. This is done by adding a line like the
99 following to your init file:
101 (setq package-get-remote (cons (list nil "/my/path/to/package/binaries")
106 Here, you'd change `/my/path/to/package/binaries' to be the path to
107 your local package binaries. Next, restart XEmacs, and you're ready to
108 go (advanced users can just re-evaluate the sexp).
110 If you are installing from a temporary, one-time directory, you can
111 also add these directory names to `package-get-remote' using:
113 M-x pui-add-install-directory
115 Note, however, that any directories added using this function are not
116 saved; this information will be lost when you quit XEmacs.
118 If you're going to install over the network, you only have to insure
119 that EFS *Note (EFS):: works, and that it can get outside a firewall, if
120 you happen to be behind one. You shouldn't have to do anything else;
121 XEmacs already knows where to go. However you can add your own mirrors
122 to this list. See `package-get-remote'.
124 The easiest way to install a package is to use the visual package
125 browser and installer, using the menu pick:
127 Options->Manage Packages->List & Install
129 Options->Manage Packages->Using Custom->Select-> ...
131 You can also access it using the keyboard:
133 M-x pui-list-packages
135 The visual package browser will then display a list of all packages.
136 Help information will be displayed at the very bottom of the buffer; you
137 may have to scroll down to see it. You can also press `?' to get the
138 same help. From this buffer, you can tell the package status by the
139 character in the first column:
142 The package has not been installed.
145 The package has been installed, but a newer version is available.
146 The current version is out-of-date.
149 The package has been marked for installation/update.
151 If there is no character in the first column, the package has been
152 installed and is up-to-date.
154 From here, you can select or unselect packages for installation using
155 the <RET> key, the `Mouse-2' button or selecting "Select" from the
156 (Popup) Menu. Once you've finished selecting the packages, you can
157 press the `x' key (or use the menu) to actually install the packages.
158 Note that you will have to restart XEmacs for XEmacs to recognize any
168 Toggle between selecting and unselecting a package for
172 Install selected packages.
175 View, in the minibuffer, additional information about the package,
176 such as the package date (not the build date) and the package
177 author. Moving the mouse over a package name will also do the
181 Toggle between verbose and non-verbose package display.
184 Refresh the package display.
187 Kill the package buffer.
189 Moving the mouse over a package will also cause additional
190 information about the package to be displayed in the minibuffer.
192 Other package installation interfaces
193 -------------------------------------
195 For an alternative package interface, you can select packages from
196 the customize menus, under:
198 Options->Customize->Emacs->Packages-> ...
200 Options->Manage Packages->Using Custom->Select-> ...
202 Set their state to on, and then do:
204 Options->Manage Packages->Using Custom->Update Packages
206 This will automatically retrieve the packages you have selected from
207 the XEmacs ftp site or your local disk, and install them into XEmacs.
208 Additionally it will update any packages you already have installed to
209 the newest version. Note that if a package is newly installed you will
210 have to restart XEmacs for the change to take effect.
212 You can also install packages using a semi-manual interface:
214 M-x package-get-all <return>
216 Enter the name of the package (e.g., `prog-modes'), and XEmacs will
217 search for the latest version (as listed in the lisp file
218 `lisp/package-get-base.el'), and install it and any packages that it
221 Manual Binary Package Installation
222 ----------------------------------
224 Pre-compiled, binary packages can be installed in either a system
225 package directory (this is determined when XEmacs is compiled), or in
226 one of the following subdirectories of your `$HOME' directory:
228 ~/.xemacs/mule-packages
229 ~/.xemacs/xemacs-packages
231 Packages in the former directory will only be found by a Mule-enabled
234 XEmacs does not have to be running to install binary packages,
235 although XEmacs will not know about any newly-installed packages until
236 you restart XEmacs. Note, however, that installing a newer version of a
237 package while XEmacs is running could cause strange errors in XEmacs;
238 it's best to exit XEmacs before upgrading an existing package.
240 To install binary packages manually:
242 1. Download the package(s) that you want to install. Each binary
243 package will typically be a gzip'd tarball.
245 2. Decide where to install the packages: in the system package
246 directory, or in `~/.xemacs/mule-packages' or
247 `~/.xemacs/xemacs-packages', respectively. If you want to install
248 the packages in the system package directory, make sure you can
249 write into that directory. If you want to install in your `$HOME'
250 directory, create the directory, `~/.xemacs/mule-packages' or
251 `~/.xemacs/xemacs-packages', respectively.
253 3. Next, `cd' to the directory under which you want to install the
256 4. From this directory, uncompress and extract each of the gzip'd
257 tarballs that you downloaded in step 1. Unix and Cygnus cygwin
258 users will typically do this using the commands:
260 gunzip < package.tar.gz | tar xvf -
262 Above, replace `package.tar.gz' with the filename of the package
263 that you downloaded in step 1.
265 Of course, if you use GNU `tar', you could also use:
267 tar xvzf package.tar.gz
269 5. That's it. Quit and restart XEmacs to get it to recognize any new
274 File: xemacs.info, Node: Building Packages, Next: Available Packages, Prev: Using Packages, Up: Packages
276 Source packages are available from the `packages/source-packages'
277 subdirectory of your favorite XEmacs distribution site. Alternatively,
278 they are available via CVS from `cvs.xemacs.org'. Look at
279 `http://cvs.xemacs.org' for instructions.
281 Prerequisites for Building Source Packages
282 ------------------------------------------
284 You must have GNU `cp', GNU `install' (or a BSD compatible `install'
285 program) GNU `make' (3.75 or later preferred), `makeinfo' (1.68 from
286 `texinfo-3.11' or later required), GNU `tar' and XEmacs 21.0. The
287 source packages will untar into a correct directory structure. At the
288 top level you must have `XEmacs.rules' and `package-compile.el'. These
289 files are available from the XEmacs FTP site from the same place you
290 obtained your source package distributions.
292 What You Can Do With Source Packages
293 ------------------------------------
295 NB: A global build operation doesn't exist yet as of 13 January
298 Source packages are most useful for creating XEmacs package tarballs
299 for installation into your own XEmacs installations or for distributing
302 Supported operations from `make' are:
305 Remove all built files except `auto-autoloads.el' and
309 Remove XEmacs backups as well as the files deleted by `make clean'.
312 Bytecompile all files, build and bytecompile byproduct files like
313 `auto-autoloads.el' and `custom-load.el'. Create info version of
314 TeXinfo documentation if present.
317 Usually aliased to `make srckit-std'. This does a `make
318 distclean' and creates a package source tarball in the staging
319 directory. This is generally only of use for package maintainers.
322 May be aliased to `binkit-sourceonly', `binkit-sourceinfo',
323 `binkit-sourcedata', or `binkit-sourcedatainfo'. `sourceonly'
324 indicates there is nothing to install in a data directory or info
325 directory. `sourceinfo' indicates that source and info files are
326 to be installed. `sourcedata' indicates that source and etc
327 (data) files are to be installed. `sourcedatainfo' indicates
328 source, etc (data), and info files are to be installed. A few
329 packages have needs beyond the basic templates so this is not yet
333 Runs the rules `srckit' followed by `binkit'. This is primarily
334 of use by XEmacs maintainers producing files for distribution.
337 File: xemacs.info, Node: Available Packages, Prev: Building Packages, Up: Packages
339 This section is surely out-of-date. If you're sure that XEmacs is
340 able to do something, but your installed XEmacs won't do it for you,
341 it's probably in a package. If you can't find it in this section,
342 that's a bug--please report it. It is very hard to keep this section
343 up-to-date; your reports, comments, and questions will help a lot.
345 This data is up-to-date as of 10 February 1999. (Ouch! I told you!)
347 Library Packages (libs)
348 -----------------------
350 These packages are required to build and support most of the rest of
351 XEmacs. By design, xemacs-base is a `regular' package. Use restraint
352 when adding new files there as it is required by almost everything.
355 Support for Sparcworks.
358 A Portable Emacs Library. Used by XEmacs MIME support.
364 The DIRectory EDitor is for manipulating, and running commands on
365 files in a directory.
368 Treat files on remote systems the same as local files.
371 Fundamental lisp files for providing email support.
374 Support for building with Tooltalk.
377 Fundamental XEmacs support. Install this unless you wish a totally
381 XEmacs Lisp developer support. This package contains utilities for
382 supporting Lisp development. It is a single-file package so it
385 Communications Packages (comm)
386 ------------------------------
388 These packages provide support for various communications, primarily
392 Footnoting in mail message editing modes.
398 The Gnus Newsreader and Mailreader.
401 Support for messaging encryption with PGP.
404 Front end support for MH.
407 Miscellaneous Networking Utilities. This is a single-file package
408 and files may be deleted at will.
411 Emacs implementation of the ph client to CCSO/qi directory servers.
414 An obsolete Emacs mailer. If you do not already use it don't
418 An Emacs citation tool. Useful with all Emacs Mailers and
430 Games and Amusements (games)
431 ----------------------------
434 Spook and Yow (Zippy quotes).
437 Tetris, Sokoban, and Snake.
443 Other amusements and diversions.
449 Wnn (4.2 and 6) support. SJ3 support. Must be installed prior to
453 Quail. Used for everything other than English and Japanese.
456 Used for localized menubars (French and Japanese) and localized
457 splash screens (Japanese).
460 Basic Mule support. Must be installed prior to building with Mule.
463 Another Japanese Language Input Method. Can be used without a
464 separate process running as a dictionary server.
466 Productivity Packages (oa)
467 --------------------------
470 Calendar and diary support.
473 Single file lisp packages for various XEmacs goodies. Load this
474 and weed out the junk you don't want.
477 Forms editing support (obsolete, use the builtin Widget instead).
480 Provide a WM icon based on major mode.
486 Spell-checking with ispell.
489 PC style interface emulation.
492 Validated HTML/SGML editing.
495 SGML/Linuxdoc-SGML editing.
504 Mouse enhancement utility.
507 Various single file lisp packages for editing text files.
510 Display time & date on the modeline.
512 Operating System Utilities (os)
513 -------------------------------
519 Enhanced front-end for Grep.
522 Front-end for Inferior Lisp.
525 Miscellaneous single-file O/S utilities, for printing, archiving,
526 compression, remote shells, etc.
529 A Unix process browsing tool.
531 Program Editing Support (prog)
532 ------------------------------
535 Ada language support.
538 Basic single-file add-ons for editing C code.
541 C, C++ and Java language support.
544 GUD, gdb, dbx debugging support.
547 Interface over patch.
550 Another interface over patch.
556 Miscellaneous single-file lisp files for various programming
560 Front-end support for Inferior Scheme.
563 Support for editing shell scripts.
566 Version Control for Free systems.
569 Version Control for ClearCase. This package must be installed
570 prior to building XEmacs [broken as of XEmacs 20.5-beta19].
579 Basic TeX/LaTeX support.
582 Crisp/Brief emulation.
585 DEC EDIT/EDT emulation.
588 XEmacs TeXinfo support.
591 Single-file TeX support.
594 DEC EDIT/TPU support.
597 VI emulation support.
600 File: xemacs.info, Node: Abbrevs, Next: Picture, Prev: Running, Up: Top
605 An "abbrev" is a word which "expands" into some different text.
606 Abbrevs are defined by the user to expand in specific ways. For
607 example, you might define `foo' as an abbrev expanding to `find outer
608 otter'. With this abbrev defined, you would be able to get `find outer
609 otter ' into the buffer by typing `f o o <SPC>'.
611 Abbrevs expand only when Abbrev mode (a minor mode) is enabled.
612 Disabling Abbrev mode does not cause abbrev definitions to be discarded,
613 but they do not expand until Abbrev mode is enabled again. The command
614 `M-x abbrev-mode' toggles Abbrev mode; with a numeric argument, it
615 turns Abbrev mode on if the argument is positive, off otherwise. *Note
616 Minor Modes::. `abbrev-mode' is also a variable; Abbrev mode is on
617 when the variable is non-`nil'. The variable `abbrev-mode'
618 automatically becomes local to the current buffer when it is set.
620 Abbrev definitions can be "mode-specific"--active only in one major
621 mode. Abbrevs can also have "global" definitions that are active in
622 all major modes. The same abbrev can have a global definition and
623 various mode-specific definitions for different major modes. A
624 mode-specific definition for the current major mode overrides a global
627 You can define Abbrevs interactively during an editing session. You
628 can also save lists of abbrev definitions in files and reload them in
629 later sessions. Some users keep extensive lists of abbrevs that they
630 load in every session.
632 A second kind of abbreviation facility is called the "dynamic
633 expansion". Dynamic abbrev expansion happens only when you give an
634 explicit command and the result of the expansion depends only on the
635 current contents of the buffer. *Note Dynamic Abbrevs::.
639 * Defining Abbrevs:: Defining an abbrev, so it will expand when typed.
640 * Expanding Abbrevs:: Controlling expansion: prefixes, canceling expansion.
641 * Editing Abbrevs:: Viewing or editing the entire list of defined abbrevs.
642 * Saving Abbrevs:: Saving the entire list of abbrevs for another session.
643 * Dynamic Abbrevs:: Abbreviations for words already in the buffer.
646 File: xemacs.info, Node: Defining Abbrevs, Next: Expanding Abbrevs, Prev: Abbrevs, Up: Abbrevs
652 Define an abbrev to expand into some text before point
653 (`add-global-abbrev').
656 Similar, but define an abbrev available only in the current major
657 mode (`add-mode-abbrev').
660 Define a word in the buffer as an abbrev
661 (`inverse-add-global-abbrev').
664 Define a word in the buffer as a mode-specific abbrev
665 (`inverse-add-mode-abbrev').
667 `M-x kill-all-abbrevs'
668 After this command, no abbrev definitions remain in effect.
670 The usual way to define an abbrev is to enter the text you want the
671 abbrev to expand to, position point after it, and type `C-x a g'
672 (`add-global-abbrev'). This reads the abbrev itself using the
673 minibuffer, and then defines it as an abbrev for one or more words
674 before point. Use a numeric argument to say how many words before point
675 should be taken as the expansion. For example, to define the abbrev
676 `foo' as in the example above, insert the text `find outer otter', then
678 `C-u 3 C-x a g f o o <RET>'.
680 An argument of zero to `C-x a g' means to use the contents of the
681 region as the expansion of the abbrev being defined.
683 The command `C-x a l' (`add-mode-abbrev') is similar, but defines a
684 mode-specific abbrev. Mode-specific abbrevs are active only in a
685 particular major mode. `C-x a l' defines an abbrev for the major mode
686 in effect at the time `C-x a l' is typed. The arguments work the same
687 way they do for `C-x a g'.
689 If the text of an abbrev you want is already in the buffer instead of
690 the expansion, use command `C-x a i g' (`inverse-add-global-abbrev')
691 instead of `C-x a g', or use `C-x a i l' (`inverse-add-mode-abbrev')
692 instead of `C-x a l'. These commands are called "inverse" because they
693 invert the meaning of the argument found in the buffer and the argument
694 read using the minibuffer.
696 To change the definition of an abbrev, just add the new definition.
697 You will be asked to confirm if the abbrev has a prior definition. To
698 remove an abbrev definition, give a negative argument to `C-x a g' or
699 `C-x a l'. You must choose the command to specify whether to kill a
700 global definition or a mode-specific definition for the current mode,
701 since those two definitions are independent for one abbrev.
703 `M-x kill-all-abbrevs' removes all existing abbrev definitions.
706 File: xemacs.info, Node: Expanding Abbrevs, Next: Editing Abbrevs, Prev: Defining Abbrevs, Up: Abbrevs
708 Controlling Abbrev Expansion
709 ============================
711 An abbrev expands whenever it is in a buffer just before point and
712 you type a self-inserting punctuation character (<SPC>, comma, etc.).
713 Most often an abbrev is used by inserting the abbrev followed by
716 Abbrev expansion preserves case; thus, `foo' expands into `find
717 outer otter', `Foo' into `Find outer otter', and `FOO' into `FIND OUTER
718 OTTER' or `Find Outer Otter' according to the variable
719 `abbrev-all-caps' (a non-`nil' value chooses the first of the two
722 Two commands are available to control abbrev expansion:
725 Separate a prefix from a following abbrev to be expanded
726 (`abbrev-prefix-mark').
729 Expand the abbrev before point (`expand-abbrev'). This is
730 effective even when Abbrev mode is not enabled.
732 `M-x unexpand-abbrev'
733 Undo last abbrev expansion.
735 `M-x expand-region-abbrevs'
736 Expand some or all abbrevs found in the region.
738 You may wish to expand an abbrev with a prefix attached. For
739 example, if `cnst' expands into `construction', you may want to use it
740 to enter `reconstruction'. It does not work to type `recnst', because
741 that is not necessarily a defined abbrev. Instead, you can use the
742 command `M-'' (`abbrev-prefix-mark') between the prefix `re' and the
743 abbrev `cnst'. First, insert `re'. Then type `M-''; this inserts a
744 minus sign in the buffer to indicate that it has done its work. Then
745 insert the abbrev `cnst'. The buffer now contains `re-cnst'. Now
746 insert a punctuation character to expand the abbrev `cnst' into
747 `construction'. The minus sign is deleted at this point by `M-''. The
748 resulting text is the desired `reconstruction'.
750 If you actually want the text of the abbrev in the buffer, rather
751 than its expansion, insert the following punctuation with `C-q'. Thus,
752 `foo C-q -' leaves `foo-' in the buffer.
754 If you expand an abbrev by mistake, you can undo the expansion
755 (replace the expansion by the original abbrev text) with `M-x
756 unexpand-abbrev'. You can also use `C-_' (`undo') to undo the
757 expansion; but that will first undo the insertion of the punctuation
760 `M-x expand-region-abbrevs' searches through the region for defined
761 abbrevs, and offers to replace each one it finds with its expansion.
762 This command is useful if you have typed text using abbrevs but forgot
763 to turn on Abbrev mode first. It may also be useful together with a
764 special set of abbrev definitions for making several global
765 replacements at once. The command is effective even if Abbrev mode is
769 File: xemacs.info, Node: Editing Abbrevs, Next: Saving Abbrevs, Prev: Expanding Abbrevs, Up: Abbrevs
771 Examining and Editing Abbrevs
772 =============================
775 Print a list of all abbrev definitions.
778 Edit a list of abbrevs; you can add, alter, or remove definitions.
780 The output from `M-x list-abbrevs' looks like this:
782 (lisp-mode-abbrev-table)
784 (global-abbrev-table)
787 (Some blank lines of no semantic significance, and some other abbrev
788 tables, have been omitted.)
790 A line containing a name in parentheses is the header for abbrevs in
791 a particular abbrev table; `global-abbrev-table' contains all the global
792 abbrevs, and the other abbrev tables that are named after major modes
793 contain the mode-specific abbrevs.
795 Within each abbrev table, each non-blank line defines one abbrev.
796 The word at the beginning is the abbrev. The number that appears is
797 the number of times the abbrev has been expanded. Emacs keeps track of
798 this to help you see which abbrevs you actually use, in case you want
799 to eliminate those that you don't use often. The string at the end of
800 the line is the expansion.
802 `M-x edit-abbrevs' allows you to add, change or kill abbrev
803 definitions by editing a list of them in an Emacs buffer. The list has
804 the format described above. The buffer of abbrevs is called
805 `*Abbrevs*', and is in Edit-Abbrevs mode. This mode redefines the key
806 `C-c C-c' to install the abbrev definitions as specified in the buffer.
807 The `edit-abbrevs-redefine' command does this. Any abbrevs not
808 described in the buffer are eliminated when this is done.
810 `edit-abbrevs' is actually the same as `list-abbrevs', except that
811 it selects the buffer `*Abbrevs*' whereas `list-abbrevs' merely
812 displays it in another window.
815 File: xemacs.info, Node: Saving Abbrevs, Next: Dynamic Abbrevs, Prev: Editing Abbrevs, Up: Abbrevs
820 These commands allow you to keep abbrev definitions between editing
823 `M-x write-abbrev-file'
824 Write a file describing all defined abbrevs.
826 `M-x read-abbrev-file'
827 Read such an abbrev file and define abbrevs as specified there.
829 `M-x quietly-read-abbrev-file'
830 Similar, but do not display a message about what is going on.
833 Define abbrevs from buffer.
836 Insert all abbrevs and their expansions into the buffer.
838 Use `M-x write-abbrev-file' to save abbrev definitions for use in a
839 later session. The command reads a file name using the minibuffer and
840 writes a description of all current abbrev definitions into the
841 specified file. The text stored in the file looks like the output of
844 `M-x read-abbrev-file' prompts for a file name using the minibuffer
845 and reads the specified file, defining abbrevs according to its
846 contents. `M-x quietly-read-abbrev-file' is the same but does not
847 display a message in the echo area; it is actually useful primarily in
848 the init file. *Note Init File::. If you give an empty argument to
849 either of these functions, the file name Emacs uses is the value of the
850 variable `abbrev-file-name', which is by default `"~/.abbrev_defs"'.
852 Emacs offers to save abbrevs automatically if you have changed any of
853 them, whenever it offers to save all files (for `C-x s' or `C-x C-c').
854 Set the variable `save-abbrevs' to `nil' to inhibit this feature.
856 The commands `M-x insert-abbrevs' and `M-x define-abbrevs' are
857 similar to the previous commands but work on text in an Emacs buffer.
858 `M-x insert-abbrevs' inserts text into the current buffer before point,
859 describing all current abbrev definitions; `M-x define-abbrevs' parses
860 the entire current buffer and defines abbrevs accordingly.
863 File: xemacs.info, Node: Dynamic Abbrevs, Prev: Saving Abbrevs, Up: Abbrevs
865 Dynamic Abbrev Expansion
866 ========================
868 The abbrev facility described above operates automatically as you
869 insert text, but all abbrevs must be defined explicitly. By contrast,
870 "dynamic abbrevs" allow the meanings of abbrevs to be determined
871 automatically from the contents of the buffer, but dynamic abbrev
872 expansion happens only when you request it explicitly.
875 Expand the word in the buffer before point as a "dynamic abbrev",
876 by searching in the buffer for words starting with that
877 abbreviation (`dabbrev-expand').
879 For example, if the buffer contains `does this follow ' and you type
880 `f o M-/', the effect is to insert `follow' because that is the last
881 word in the buffer that starts with `fo'. A numeric argument to `M-/'
882 says to take the second, third, etc. distinct expansion found looking
883 backward from point. Repeating `M-/' searches for an alternative
884 expansion by looking farther back. After the entire buffer before
885 point has been considered, the buffer after point is searched.
887 Dynamic abbrev expansion is completely independent of Abbrev mode;
888 the expansion of a word with `M-/' is completely independent of whether
889 it has a definition as an ordinary abbrev.
892 File: xemacs.info, Node: Picture, Next: Sending Mail, Prev: Abbrevs, Up: Top
897 If you want to create a picture made out of text characters (for
898 example, a picture of the division of a register into fields, as a
899 comment in a program), use the command `edit-picture' to enter Picture
902 In Picture mode, editing is based on the "quarter-plane" model of
903 text. In this model, the text characters lie studded on an area that
904 stretches infinitely far to the right and downward. The concept of the
905 end of a line does not exist in this model; the most you can say is
906 where the last non-blank character on the line is found.
908 Of course, Emacs really always considers text as a sequence of
909 characters, and lines really do have ends. But in Picture mode most
910 frequently-used keys are rebound to commands that simulate the
911 quarter-plane model of text. They do this by inserting spaces or by
912 converting tabs to spaces.
914 Most of the basic editing commands of Emacs are redefined by Picture
915 mode to do essentially the same thing but in a quarter-plane way. In
916 addition, Picture mode defines various keys starting with the `C-c'
917 prefix to run special picture editing commands.
919 One of these keys, `C-c C-c', is pretty important. Often a picture
920 is part of a larger file that is usually edited in some other major
921 mode. `M-x edit-picture' records the name of the previous major mode.
922 You can then use the `C-c C-c' command (`picture-mode-exit') to restore
923 that mode. `C-c C-c' also deletes spaces from the ends of lines,
924 unless you give it a numeric argument.
926 The commands used in Picture mode all work in other modes (provided
927 the `picture' library is loaded), but are only bound to keys in
928 Picture mode. Note that the descriptions below talk of moving "one
929 column" and so on, but all the picture mode commands handle numeric
930 arguments as their normal equivalents do.
932 Turning on Picture mode calls the value of the variable
933 `picture-mode-hook' as a function, with no arguments, if that value
934 exists and is non-`nil'.
938 * Basic Picture:: Basic concepts and simple commands of Picture Mode.
939 * Insert in Picture:: Controlling direction of cursor motion
940 after "self-inserting" characters.
941 * Tabs in Picture:: Various features for tab stops and indentation.
942 * Rectangles in Picture:: Clearing and superimposing rectangles.
945 File: xemacs.info, Node: Basic Picture, Next: Insert in Picture, Prev: Picture, Up: Picture
947 Basic Editing in Picture Mode
948 =============================
950 Most keys do the same thing in Picture mode that they usually do,
951 but do it in a quarter-plane style. For example, `C-f' is rebound to
952 run `picture-forward-column', which moves point one column to the
953 right, by inserting a space if necessary, so that the actual end of the
954 line makes no difference. `C-b' is rebound to run
955 `picture-backward-column', which always moves point left one column,
956 converting a tab to multiple spaces if necessary. `C-n' and `C-p' are
957 rebound to run `picture-move-down' and `picture-move-up', which can
958 either insert spaces or convert tabs as necessary to make sure that
959 point stays in exactly the same column. `C-e' runs
960 `picture-end-of-line', which moves to after the last non-blank
961 character on the line. There was no need to change `C-a', as the choice
962 of screen model does not affect beginnings of lines.
964 Insertion of text is adapted to the quarter-plane screen model
965 through the use of Overwrite mode (*note Minor Modes::).
966 Self-inserting characters replace existing text, column by column,
967 rather than pushing existing text to the right. <RET> runs
968 `picture-newline', which just moves to the beginning of the following
969 line so that new text will replace that line.
971 Text is erased instead of deleted and killed. <DEL>
972 (`picture-backward-clear-column') replaces the preceding character with
973 a space rather than removing it. `C-d' (`picture-clear-column') does
974 the same in a forward direction. `C-k' (`picture-clear-line') really
975 kills the contents of lines, but never removes the newlines from a
978 To do actual insertion, you must use special commands. `C-o'
979 (`picture-open-line') creates a blank line, but does so after the
980 current line; it never splits a line. `C-M-o', `split-line', makes
981 sense in Picture mode, so it remains unchanged. <LFD>
982 (`picture-duplicate-line') inserts another line with the same contents
983 below the current line.
985 To actually delete parts of the picture, use `C-w', or with `C-c
986 C-d' (which is defined as `delete-char', as `C-d' is in other modes),
987 or with one of the picture rectangle commands (*note Rectangles in
991 File: xemacs.info, Node: Insert in Picture, Next: Tabs in Picture, Prev: Basic Picture, Up: Picture
993 Controlling Motion After Insert
994 ===============================
996 Since "self-inserting" characters just overwrite and move point in
997 Picture mode, there is no essential restriction on how point should be
998 moved. Normally point moves right, but you can specify any of the eight
999 orthogonal or diagonal directions for motion after a "self-inserting"
1000 character. This is useful for drawing lines in the buffer.
1003 Move left after insertion (`picture-movement-left').
1006 Move right after insertion (`picture-movement-right').
1009 Move up after insertion (`picture-movement-up').
1012 Move down after insertion (`picture-movement-down').
1015 Move up and left ("northwest") after insertion
1016 (`picture-movement-nw').
1019 Move up and right ("northeast") after insertion
1020 (`picture-movement-ne').
1023 Move down and left ("southwest") after insertion
1024 (`picture-movement-sw').
1027 Move down and right ("southeast") after insertion
1028 (`picture-movement-se').
1030 Two motion commands move based on the current Picture insertion
1031 direction. The command `C-c C-f' (`picture-motion') moves in the same
1032 direction as motion after "insertion" currently does, while `C-c C-b'
1033 (`picture-motion-reverse') moves in the opposite direction.
1036 File: xemacs.info, Node: Tabs in Picture, Next: Rectangles in Picture, Prev: Insert in Picture, Up: Picture
1041 Two kinds of tab-like action are provided in Picture mode.
1042 Context-based tabbing is done with `M-<TAB>' (`picture-tab-search').
1043 With no argument, it moves to a point underneath the next "interesting"
1044 character that follows whitespace in the previous non-blank line.
1045 "Next" here means "appearing at a horizontal position greater than the
1046 one point starts out at". With an argument, as in `C-u M-<TAB>', the
1047 command moves to the next such interesting character in the current
1048 line. `M-<TAB>' does not change the text; it only moves point.
1049 "Interesting" characters are defined by the variable
1050 `picture-tab-chars', which contains a string of characters considered
1051 interesting. Its default value is `"!-~"'.
1053 <TAB> itself runs `picture-tab', which operates based on the current
1054 tab stop settings; it is the Picture mode equivalent of
1055 `tab-to-tab-stop'. Without arguments it just moves point, but with a
1056 numeric argument it clears the text that it moves over.
1058 The context-based and tab-stop-based forms of tabbing are brought
1059 together by the command `C-c <TAB>' (`picture-set-tab-stops'.) This
1060 command sets the tab stops to the positions which `M-<TAB>' would
1061 consider significant in the current line. If you use this command with
1062 <TAB>, you can get the effect of context-based tabbing. But `M-<TAB>'
1063 is more convenient in the cases where it is sufficient.
1066 File: xemacs.info, Node: Rectangles in Picture, Prev: Tabs in Picture, Up: Picture
1068 Picture Mode Rectangle Commands
1069 ===============================
1071 Picture mode defines commands for working on rectangular pieces of
1072 the text in ways that fit with the quarter-plane model. The standard
1073 rectangle commands may also be useful (*note Rectangles::).
1076 Clear out the region-rectangle (`picture-clear-rectangle'). With
1080 Similar but save rectangle contents in register R first
1081 (`picture-clear-rectangle-to-register').
1084 Copy last killed rectangle into the buffer by overwriting, with
1085 upper left corner at point (`picture-yank-rectangle'). With
1086 argument, insert instead.
1089 Similar, but use the rectangle in register R
1090 (`picture-yank-rectangle-from-register').
1092 The picture rectangle commands `C-c C-k' (`picture-clear-rectangle')
1093 and `C-c C-w' (`picture-clear-rectangle-to-register') differ from the
1094 standard rectangle commands in that they normally clear the rectangle
1095 instead of deleting it; this is analogous with the way `C-d' is changed
1098 However, deletion of rectangles can be useful in Picture mode, so
1099 these commands delete the rectangle if given a numeric argument.
1101 The Picture mode commands for yanking rectangles differ from the
1102 standard ones in overwriting instead of inserting. This is the same
1103 way that Picture mode insertion of other text is different from other
1104 modes. `C-c C-y' (`picture-yank-rectangle') inserts (by overwriting)
1105 the rectangle that was most recently killed, while `C-c C-x'
1106 (`picture-yank-rectangle-from-register') does for the rectangle found
1107 in a specified register.
1109 Since most region commands in Picture mode operate on rectangles,
1110 when you select a region of text with the mouse in Picture mode, it is
1111 highlighted as a rectangle.
1114 File: xemacs.info, Node: Sending Mail, Next: Reading Mail, Prev: Picture, Up: Top
1119 To send a message in Emacs, start by typing the command (`C-x m') to
1120 select and initialize the `*mail*' buffer. You can then edit the text
1121 and headers of the message in the mail buffer, and type the command
1122 (`C-c C-c') to send the message.
1125 Begin composing a message to send (`mail').
1128 Likewise, but display the message in another window
1129 (`mail-other-window').
1132 In Mail mode, send the message and switch to another buffer
1133 (`mail-send-and-exit').
1135 The command `C-x m' (`mail') selects a buffer named `*mail*' and
1136 initializes it with the skeleton of an outgoing message. `C-x 4 m'
1137 (`mail-other-window') selects the `*mail*' buffer in a different
1138 window, leaving the previous current buffer visible.
1140 Because the buffer for mail composition is an ordinary Emacs buffer,
1141 you can switch to other buffers while in the middle of composing mail,
1142 and switch back later (or never). If you use the `C-x m' command again
1143 when you have been composing another message but have not sent it, a
1144 new mail buffer will be created; in this way, you can compose multiple
1145 messages at once. You can switch back to and complete an unsent
1146 message by using the normal buffer selection mechanisms.
1148 `C-u C-x m' is another way to switch back to a message in progress:
1149 it will search for an existing, unsent mail message buffer and select
1154 * Format: Mail Format. Format of the mail being composed.
1155 * Headers: Mail Headers. Details of allowed mail header fields.
1156 * Mode: Mail Mode. Special commands for editing mail being composed.
1159 File: xemacs.info, Node: Mail Format, Next: Mail Headers, Prev: Sending Mail, Up: Sending Mail
1161 The Format of the Mail Buffer
1162 =============================
1164 In addition to the "text" or contents, a message has "header
1165 fields", which say who sent it, when, to whom, why, and so on. Some
1166 header fields, such as the date and sender, are created automatically
1167 after the message is sent. Others, such as the recipient names, must
1168 be specified by you in order to send the message properly.
1170 Mail mode provides a few commands to help you edit some header
1171 fields, and some are preinitialized in the buffer automatically at
1172 times. You can insert or edit any header fields using ordinary editing
1175 The line in the buffer that says:
1177 --text follows this line--
1179 is a special delimiter that separates the headers you have specified
1180 from the text. Whatever follows this line is the text of the message;
1181 the headers precede it. The delimiter line itself does not appear in
1182 the message actually sent. The text used for the delimiter line is
1183 controlled by the variable `mail-header-separator'.
1185 Here is an example of what the headers and text in the `*mail*'
1186 buffer might look like.
1190 Subject: The XEmacs User's Manual
1191 --Text follows this line--
1192 Please ignore this message.
1195 File: xemacs.info, Node: Mail Headers, Next: Mail Mode, Prev: Mail Format, Up: Sending Mail
1200 There are several header fields you can use in the `*mail*' buffer.
1201 Each header field starts with a field name at the beginning of a line,
1202 terminated by a colon. It does not matter whether you use upper or
1203 lower case in the field name. After the colon and optional whitespace
1204 comes the contents of the field.
1207 This field contains the mailing addresses of the message.
1210 The contents of the `Subject' field should be a piece of text that
1211 says what the message is about. Subject fields are useful because
1212 most mail-reading programs can provide a summary of messages,
1213 listing the subject of each message but not its text.
1216 This field contains additional mailing addresses to send the
1217 message to, but whose readers should not regard the message as
1221 This field contains additional mailing addresses to send the
1222 message to, but which should not appear in the header of the
1223 message actually sent.
1226 This field contains the name of one file (in Unix mail file
1227 format) to which a copy of the message should be appended when the
1231 Use the `From' field to say who you are, when the account you are
1232 using to send the mail is not your own. The contents of the
1233 `From' field should be a valid mailing address, since replies will
1237 Use the `Reply-To' field to direct replies to a different address,
1238 not your own. `From' and `Reply-To' have the same effect on where
1239 replies go, but they convey a different meaning to the person who
1243 This field contains a piece of text describing a message you are
1244 replying to. Some mail systems can use the information to
1245 correlate related pieces of mail. This field is normally filled
1246 in by your mail handling package when you are replying to a
1247 message and you never need to think about it.
1249 The `To', `CC', `BCC' and `FCC' fields can appear any number of times,
1250 to specify many places to send the message.
1252 The `To', `CC', and `BCC', fields can have continuation lines. All the
1253 lines starting with whitespace, following the line on which the field
1254 starts, are considered part of the field. For example,
1256 To: foo@here, this@there,
1257 me@gnu.cambridge.mass.usa.earth.spiral3281
1259 If you have a `~/.mailrc' file, Emacs scans it for mail aliases the
1260 first time you try to send mail in an Emacs session. Emacs expands
1261 aliases found in the `To', `CC', and `BCC' fields where appropriate.
1262 You can set the variable `mail-abbrev-mailrc-file' to the name of the
1263 file with mail aliases. If `nil', `~/.mailrc' is used.
1265 Your `.mailrc' file ensures that word-abbrevs are defined for each
1266 of your mail aliases when point is in a `To', `CC', `BCC', or `From'
1267 field. The aliases are defined in your `.mailrc' file or in a file
1268 specified by the MAILRC environment variable if it exists. Your mail
1269 aliases expand any time you type a word-delimiter at the end of an
1272 In this version of Emacs, what you see is what you get: in contrast
1273 to some other versions, no abbreviations are expanded after you have
1274 sent the mail. This means you don't suffer the annoyance of having the
1275 system do things behind your back--if the system rewrites an address
1276 you typed, you know it immediately, instead of after the mail has been
1277 sent and it's too late to do anything about it. For example, you will
1278 never again be in trouble because you forgot to delete an old alias
1279 from your `.mailrc' and a new local user is given a userid which
1280 conflicts with one of your aliases.
1282 Your mail alias abbrevs are in effect only when point is in an
1283 appropriate header field. The mail aliases will not expand in the body
1284 of the message, or in other header fields. The default mode-specific
1285 abbrev table `mail-mode-abbrev-table' is used instead if defined. That
1286 means if you have been using mail-mode specific abbrevs, this code will
1287 not adversely affect you. You can control which header fields the
1288 abbrevs are used in by changing the variable `mail-abbrev-mode-regexp'.
1290 If auto-fill mode is on, abbrevs wrap at commas instead of at word
1291 boundaries, and header continuation lines will be properly indented.
1293 You can also insert a mail alias with
1294 `mail-interactive-insert-alias'. This function, which is bound to `C-c
1295 C-a', prompts you for an alias (with completion) and inserts its
1298 In this version of Emacs, it is possible to have lines like the
1299 following in your `.mailrc' file:
1301 alias someone "John Doe <doe@quux.com>"
1303 That is, if you want an address to have embedded spaces, simply
1304 surround it with double-quotes. The quotes are necessary because the
1305 format of the `.mailrc' file uses spaces as address delimiters.
1307 Aliases in the `.mailrc' file may be nested. For example, assume you
1308 define aliases like:
1309 alias group1 fred ethel
1310 alias group2 larry curly moe
1311 alias everybody group1 group2
1313 When you now type `everybody' on the `To' line, it will expand to:
1314 fred, ethyl, larry, curly, moe
1316 Aliases may contain forward references; the alias of `everybody' in
1317 the example above can precede the aliases of `group1' and `group2'.
1319 In this version of Emacs, you can use the `source' `.mailrc' command
1320 for reading aliases from some other file as well.
1322 Aliases may contain hyphens, as in `"alias foo-bar foo@bar"', even
1323 though word-abbrevs normally cannot contain hyphens.
1325 To read in the contents of another `.mailrc'-type file from Emacs,
1326 use the command `M-x merge-mail-aliases'. The `rebuild-mail-aliases'
1327 command is similar, but deletes existing aliases first.
1329 If you want multiple addresses separated by a string other than `,'
1330 (a comma), then set the variable `mail-alias-separator-string' to it.
1331 This has to be a comma bracketed by whitespace if you want any kind of
1332 reasonable behavior.
1334 If the variable `mail-archive-file-name' is non-`nil', it should be
1335 a string naming a file. Each time you start to edit a message to send,
1336 an `FCC' field is entered for that file. Unless you remove the `FCC'
1337 field, every message is written into that file when it is sent.