aboutsummaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorStefan Monnier2010-03-30 22:37:57 -0400
committerStefan Monnier2010-03-30 22:37:57 -0400
commit857387516c3cea919953b39ab170b1ff40f77934 (patch)
tree33f6de32a3909240c7b1ab2d760891d62c3acaf5 /doc
parent75d1428c578eea9077c679c1e821af8d6643f1ed (diff)
parenta6d676d9f41be8ad0c436c6d04cfedc1ce68adc8 (diff)
downloademacs-857387516c3cea919953b39ab170b1ff40f77934.tar.gz
emacs-857387516c3cea919953b39ab170b1ff40f77934.zip
Merge from emacs-23 branch
Diffstat (limited to 'doc')
-rw-r--r--doc/emacs/ChangeLog59
-rw-r--r--doc/emacs/basic.texi4
-rw-r--r--doc/emacs/custom.texi5
-rw-r--r--doc/emacs/emacs.texi13
-rw-r--r--doc/emacs/maintaining.texi163
-rw-r--r--doc/emacs/major.texi2
-rw-r--r--doc/emacs/misc.texi42
-rw-r--r--doc/emacs/mule.texi24
-rw-r--r--doc/emacs/programs.texi5
-rw-r--r--doc/emacs/rmail.texi24
-rw-r--r--doc/emacs/sending.texi994
-rw-r--r--doc/emacs/text.texi66
-rw-r--r--doc/lispref/ChangeLog5
-rw-r--r--doc/lispref/loading.texi44
14 files changed, 743 insertions, 707 deletions
diff --git a/doc/emacs/ChangeLog b/doc/emacs/ChangeLog
index b13b3ac1eec..c0a0539a018 100644
--- a/doc/emacs/ChangeLog
+++ b/doc/emacs/ChangeLog
@@ -1,3 +1,62 @@
12010-03-30 Eli Zaretskii <eliz@gnu.org>
2
3 * mule.texi (Input Methods): Mention "C-x 8 RET" and add a
4 cross-reference to "Inserting Text".
5
6 * basic.texi (Inserting Text): Add an index entry for "C-x 8 RET".
7 Mention completion provided by `ucs-insert'.
8
92010-03-30 Chong Yidong <cyd@stupidchicken.com>
10
11 * sending.texi (Sending Mail): Note variables that may need
12 customizing.
13 (Mail Sending): Expand discussion of send-mail-function.
14
152010-03-30 Chong Yidong <cyd@stupidchicken.com>
16
17 Document Message mode as the default mail mode.
18
19 * sending.texi (Sending Mail): Copyedits.
20 (Mail Format, Mail Headers): Document mail-from-style changes.
21 (Mail Commands): Rename from Mail mode. Document Message mode.
22 (Mail Misc): Rename from Mail mode Misc.
23 (Mail Sending, Header Editing, Mail Misc): Switch to Message mode
24 command names and update keybindings.
25 (Header Editing): Document message-tab. De-document
26 mail-self-blind, mail-default-reply-to, and mail-archive-file-name in
27 favor of mail-default-headers. Ad index entries for user-full-name and
28 user-mail-address.
29 (Citing Mail): Update changes in Message mode behavior. Document
30 mail-yank-prefix.
31 (Mail Signature): New node, moved from Mail Misc.
32 (Mail Aliases): Mail abbrevs are the default with Message mode.
33 (Mail Methods): Note that Message mode is now the default.
34
35 * rmail.texi (Rmail Reply):
36 * text.texi (Text Mode):
37 * major.texi (Major Modes):
38 * mule.texi (Output Coding): Refer to Message mode.
39
40 * custom.texi (Init Examples): Add xref to Mail Header.
41
42 * emacs.texi (Top): Fix xrefs.
43
442010-03-30 Chong Yidong <cyd@stupidchicken.com>
45
46 * maintaining.texi (VC With A Merging VCS): C-x v v now creates a
47 repository if there is none.
48 (VC Change Log): Rename from VC Status. Document vc-log-show-limit and
49 vc-print-root-log.
50 (Old Revisions): Copyedits. Document vc-root-diff.
51
52 * programs.texi (Program Modes): Mention Javascript mode.
53
54 * text.texi (HTML Mode): Note that nXML is now the default XML mode.
55 * emacs.texi: Update node description.
56
57 * misc.texi (Navigation): Document doc-view-continuous.
58 (Shell Ring): Document new M-r binding. M-s is no longer bound.
59
12010-03-30 Juri Linkov <juri@jurta.org> 602010-03-30 Juri Linkov <juri@jurta.org>
2 61
3 * search.texi (Other Repeating Search): Remove line that `occur' 62 * search.texi (Other Repeating Search): Remove line that `occur'
diff --git a/doc/emacs/basic.texi b/doc/emacs/basic.texi
index 7a917e58a56..ae04ebf9c41 100644
--- a/doc/emacs/basic.texi
+++ b/doc/emacs/basic.texi
@@ -100,13 +100,15 @@ character code, just like digits.
100character to insert (@pxref{Arguments}). 100character to insert (@pxref{Arguments}).
101 101
102@findex ucs-insert 102@findex ucs-insert
103@kindex C-x 8 RET
103@cindex Unicode 104@cindex Unicode
104 Instead of @kbd{C-q}, you can use @kbd{C-x 8 @key{RET}} 105 Instead of @kbd{C-q}, you can use @kbd{C-x 8 @key{RET}}
105(@code{ucs-insert}) to insert a character based on its Unicode name or 106(@code{ucs-insert}) to insert a character based on its Unicode name or
106code-point. This commands prompts for a character to insert, using 107code-point. This commands prompts for a character to insert, using
107the minibuffer; you can specify the character using either (i) the 108the minibuffer; you can specify the character using either (i) the
108character's name in the Unicode standard, or (ii) the character's 109character's name in the Unicode standard, or (ii) the character's
109code-point in the Unicode standard. 110code-point in the Unicode standard. If you specify the character's
111name, the command provides completion.
110 112
111@node Moving Point 113@node Moving Point
112@section Changing the Location of Point 114@section Changing the Location of Point
diff --git a/doc/emacs/custom.texi b/doc/emacs/custom.texi
index 408de24ed6e..f0faec4d40c 100644
--- a/doc/emacs/custom.texi
+++ b/doc/emacs/custom.texi
@@ -2269,8 +2269,9 @@ Specify your own email address, if Emacs can't figure it out correctly.
2269(setq user-mail-address "cheney@@torture.gov") 2269(setq user-mail-address "cheney@@torture.gov")
2270@end example 2270@end example
2271 2271
2272Various Emacs packages that need your own email address use the value of 2272Various Emacs packages, such as Message mode, consult
2273@code{user-mail-address}. 2273@code{user-mail-address} when they need to know your email address.
2274@xref{Mail Headers}.
2274 2275
2275@item 2276@item
2276Make Text mode the default mode for new buffers. 2277Make Text mode the default mode for new buffers.
diff --git a/doc/emacs/emacs.texi b/doc/emacs/emacs.texi
index 0704b616543..6c7f611cf93 100644
--- a/doc/emacs/emacs.texi
+++ b/doc/emacs/emacs.texi
@@ -574,7 +574,7 @@ Commands for Human Languages
574* Text Mode:: The major modes for editing text files. 574* Text Mode:: The major modes for editing text files.
575* Outline Mode:: Editing outlines. 575* Outline Mode:: Editing outlines.
576* TeX Mode:: Editing input to the formatter TeX. 576* TeX Mode:: Editing input to the formatter TeX.
577* HTML Mode:: Editing HTML, SGML, and XML files. 577* HTML Mode:: Editing HTML and SGML files.
578* Nroff Mode:: Editing input to the formatter nroff. 578* Nroff Mode:: Editing input to the formatter nroff.
579* Formatted Text:: Editing formatted text directly in WYSIWYG fashion. 579* Formatted Text:: Editing formatted text directly in WYSIWYG fashion.
580* Text Based Tables:: Editing text-based tables in WYSIWYG fashion. 580* Text Based Tables:: Editing text-based tables in WYSIWYG fashion.
@@ -796,7 +796,7 @@ Basic Editing under Version Control
796The Secondary Commands of VC 796The Secondary Commands of VC
797 797
798* Registering:: Putting a file under version control. 798* Registering:: Putting a file under version control.
799* VC Status:: Viewing the VC status of files. 799* VC Change Log:: Viewing the VC Change Log.
800* VC Undo:: Canceling changes before or after check-in. 800* VC Undo:: Canceling changes before or after check-in.
801 801
802VC Directory Mode 802VC Directory Mode
@@ -888,16 +888,17 @@ Sending Mail
888* Mail Format:: Format of the mail being composed. 888* Mail Format:: Format of the mail being composed.
889* Mail Headers:: Details of some standard mail header fields. 889* Mail Headers:: Details of some standard mail header fields.
890* Mail Aliases:: Abbreviating and grouping mail addresses. 890* Mail Aliases:: Abbreviating and grouping mail addresses.
891* Mail Mode:: Special commands for editing mail being composed. 891* Mail Commands:: Special commands for editing mail being composed.
892* Mail Signature:: Adding a signature to every message.
892* Mail Amusements:: Distracting the NSA; adding fortune messages. 893* Mail Amusements:: Distracting the NSA; adding fortune messages.
893* Mail Methods:: Using alternative mail-composition methods. 894* Mail Methods:: Using alternative mail-composition methods.
894 895
895Mail Mode 896Mail Commands
896 897
897* Mail Sending:: Commands to send the message. 898* Mail Sending:: Commands to send the message.
898* Header Editing:: Commands to move to header fields and edit them. 899* Header Editing:: Commands to move to header fields and edit them.
899* Citing Mail:: Copying all or part of a message you are replying to. 900* Citing Mail:: Quoting a message you are replying to.
900* Mail Mode Misc:: Spell checking, signatures, etc. 901* Mail Misc:: Attachments, spell checking, etc.
901 902
902Reading Mail with Rmail 903Reading Mail with Rmail
903 904
diff --git a/doc/emacs/maintaining.texi b/doc/emacs/maintaining.texi
index 6e3fa959ca2..8cc5b97d919 100644
--- a/doc/emacs/maintaining.texi
+++ b/doc/emacs/maintaining.texi
@@ -224,7 +224,7 @@ the repository, along with a log entry for those changes.
224@cindex revision 224@cindex revision
225@cindex revision ID 225@cindex revision ID
226 A copy of a file stored in a repository is called a @dfn{revision}. 226 A copy of a file stored in a repository is called a @dfn{revision}.
227The history of a file is a sequence of revisions. Each revisions is 227The history of a file is a sequence of revisions. Each revision is
228named by a @dfn{revision ID}. The format of the revision ID depends 228named by a @dfn{revision ID}. The format of the revision ID depends
229on the version control system; in the simplest case, it is just an 229on the version control system; in the simplest case, it is just an
230integer. 230integer.
@@ -403,10 +403,10 @@ Directory buffer, and some files in it are marked, the VC fileset
403consists of the marked files (@pxref{VC Directory Mode}). 403consists of the marked files (@pxref{VC Directory Mode}).
404 404
405 The principal VC command is an all-purpose command, @kbd{C-x v v} 405 The principal VC command is an all-purpose command, @kbd{C-x v v}
406(@code{vc-next-action}), that performs either locking, merging or a 406(@code{vc-next-action}), that performs either registration, locking,
407check-in (depending on the situation) on the current VC fileset. You 407merging or a check-in (depending on the situation) on the current VC
408can use @kbd{C-x v v} in a file-visiting buffer or in a VC Directory 408fileset. You can use @kbd{C-x v v} in a file-visiting buffer or in a
409buffer. 409VC Directory buffer.
410 410
411@table @kbd 411@table @kbd
412@itemx C-x v v 412@itemx C-x v v
@@ -461,23 +461,31 @@ unmodified; it flips to @samp{:} as soon as you save any changes
461 461
462@itemize @bullet 462@itemize @bullet
463@item 463@item
464If the work file is the same as in the repository, it does nothing. 464If the work file is in a directory that is not controlled by any
465version control system, prompt for a repository type. Then, create a
466version control repository of that type and register the file with it.
467
468@item
469If the work file is in a directory that is controlled by a version
470control system but not registered with it, register the file.
471
472@item
473If the work file is the same as in the repository, do nothing.
465 474
466@item 475@item
467If you have not changed the work file, but some other user has checked 476If you have not changed the work file, but some other user has checked
468in changes to the repository, @kbd{C-x v v} merges those changes into 477in changes to the repository, merge those changes into the work file.
469the work file.
470 478
471@item 479@item
472If you have made modifications to the work file, @kbd{C-x v v} 480If you have made modifications to the work file, attempts to check in
473attempts to check in your changes. To do this, Emacs first reads the 481your changes. To do this, Emacs first reads the log entry for the new
474log entry for the new revision (@pxref{Log Buffer}). If some other 482revision (@pxref{Log Buffer}). If some other user has checked in
475user has checked in changes to the repository since you last checked 483changes to the repository since you last checked it out, the checkin
476it out, the checkin fails. In that case, type @kbd{C-x v v} again to 484fails. In that case, type @kbd{C-x v v} again to merge those changes
477merge those changes into your own work file; this puts the work file 485into your own work file; this puts the work file into a ``conflicted''
478into a ``conflicted'' state. Type @kbd{C-x v v} to clear the 486state. Type @kbd{C-x v v} to clear the ``conflicted'' state; VC then
479``conflicted'' state; VC then regards the file as up-to-date and 487regards the file as up-to-date and modified, and you can try to check
480modified, and you can try to check it in again. 488it in again.
481 489
482To pick up any recent changes from the repository @emph{without} 490To pick up any recent changes from the repository @emph{without}
483trying to commit your own changes, type @kbd{C-x v m @key{RET}}. 491trying to commit your own changes, type @kbd{C-x v m @key{RET}}.
@@ -485,15 +493,15 @@ trying to commit your own changes, type @kbd{C-x v m @key{RET}}.
485@end itemize 493@end itemize
486 494
487 These rules also apply when you use RCS in its ``non-locking'' mode, 495 These rules also apply when you use RCS in its ``non-locking'' mode,
488except that changes will not be automatically merged from the 496except that changes are not automatically merged from the repository.
489repository. Nothing informs you if another user has checked in 497Nothing informs you if another user has checked in changes in the same
490changes in the same file since you began editing it; when you check in 498file since you began editing it; when you check in your revision, his
491your revision, his changes are removed (however, they remain in the 499changes are removed (however, they remain in the repository and are
492repository and are thus not irrevocably lost). Therefore, you must 500thus not irrevocably lost). Therefore, you must verify that the
493verify that the current revision is unchanged before checking in your 501current revision is unchanged before checking in your changes. In
494changes. In addition, locking is possible with RCS even in this mode: 502addition, locking is possible with RCS even in this mode: @kbd{C-x v
495@kbd{C-x v v} with an unmodified file locks the file, just as it does 503v} with an unmodified file locks the file, just as it does with RCS in
496with RCS in its normal locking mode (@pxref{VC With A Locking VCS}). 504its normal locking mode (@pxref{VC With A Locking VCS}).
497 505
498@node VC With A Locking VCS 506@node VC With A Locking VCS
499@subsubsection Basic Version Control with Locking 507@subsubsection Basic Version Control with Locking
@@ -501,26 +509,25 @@ with RCS in its normal locking mode (@pxref{VC With A Locking VCS}).
501 Under a locking-based version control system (such as SCCS, and RCS 509 Under a locking-based version control system (such as SCCS, and RCS
502in its default mode), @kbd{C-x v v} does the following: 510in its default mode), @kbd{C-x v v} does the following:
503 511
504 @itemize @bullet 512@itemize @bullet
505@item 513@item
506If the file is not locked, @kbd{C-x v v} locks it, and makes it 514If the file is not locked, lock it and make it writable, so that you
507writable so that you can change it. 515can change it.
508 516
509@item 517@item
510If the file is locked by you, and contains changes, @kbd{C-x v v} 518If the file is locked by you, and contains changes, check in the
511checks in the changes. In order to do this, it first reads the log 519changes. In order to do this, Emacs first reads the log entry for the
512entry for the new revision. @xref{Log Buffer}. 520new revision. @xref{Log Buffer}.
513 521
514@item 522@item
515If the file is locked by you, but you have not changed it since you 523If the file is locked by you, but you have not changed it since you
516locked it, @kbd{C-x v v} releases the lock and makes the file 524locked it, release the lock and makes the file read-only again.
517read-only again.
518 525
519@item 526@item
520If the file is locked by some other user, @kbd{C-x v v} asks you whether 527If the file is locked by some other user, ask whether you want to
521you want to ``steal the lock'' from that user. If you say yes, the file 528``steal the lock'' from that user. If you say yes, the file becomes
522becomes locked by you, but a message is sent to the person who had 529locked by you, but a message is sent to the person who had formerly
523formerly locked the file, to inform him of what has happened. 530locked the file, to inform him of what has happened.
524@end itemize 531@end itemize
525 532
526 These rules also apply when you use CVS in locking mode, except 533 These rules also apply when you use CVS in locking mode, except
@@ -639,20 +646,23 @@ and @code{vc-log-mode-hook}. @xref{Hooks}.
639to examine any revision of a file, or compare two revisions. 646to examine any revision of a file, or compare two revisions.
640 647
641@table @kbd 648@table @kbd
642@item C-x v ~ @var{revision} @key{RET} 649@item C-x v ~
643Examine revision @var{revision} of the visited file, in a buffer of its 650Prompt for a revision of the current file, and visit it in a buffer of
644own. 651its own (@code{vc-revision-other-window}).
645 652
646@item C-x v = 653@item C-x v =
647Compare the buffer contents associated with the current 654Compare the files in the current fileset with the working revision(s)
648fileset with the working revision(s) from which you started editing. 655you started from (@code{vc-diff}). With a prefix argument, prompt for
656two revisions of the current fileset and compare them.
649 657
650@item C-u C-x v = @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET} 658@item C-x v D
651Compare the specified two repository revisions of the current fileset. 659Compare the entire tree corresponding to the current fileset with the
660tree you started from (@code{vc-root-diff}). With a prefix argument,
661prompt for two revisions and compare their trees.
652 662
653@item C-x v g 663@item C-x v g
654Display an annotated version of the file: for each line, show the 664Display an annotated version of the file: for each line, show the
655latest revision in which it was modified. 665latest revision in which it was modified (@code{vc-annotate}).
656@end table 666@end table
657 667
658@findex vc-revision-other-window 668@findex vc-revision-other-window
@@ -673,12 +683,11 @@ buffer in a separate window.
673 683
674@findex vc-diff 684@findex vc-diff
675@kindex C-x v = 685@kindex C-x v =
676 @kbd{C-x v =} (@code{vc-diff}) compares the current buffer contents 686 @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC
677of each file in the current VC fileset (saving them if necessary) with 687fileset (saving them if necessary) with the repository revision(s)
678the repository revision from which you started editing. Note that the 688from which you started editing. Note that the latter may or may not
679latter may or may not be the latest revision of the file(s). The diff 689be the latest revision of the file(s). The diff is displayed in a
680is displayed in a special buffer in another window. @xref{Comparing 690special buffer in another window. @xref{Comparing Files}.
681Files}.
682 691
683@findex vc-diff 692@findex vc-diff
684@kindex C-u C-x v = 693@kindex C-u C-x v =
@@ -700,6 +709,12 @@ revision ID for a multi-file fileset (as opposed to a symbolic tag
700name) is unlikely to return diffs that are connected in any meaningful 709name) is unlikely to return diffs that are connected in any meaningful
701way. 710way.
702 711
712 The command @kbd{C-x v D} (@code{vc-root-diff}) is similar to
713@kbd{C-x v =}, but it compares the entire tree associated with the
714current VC fileset with the tree you started with. This means all the
715files controlled by the current version control repository, even those
716that are not part of the current VC fileset.
717
703 If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that 718 If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that
704is neither visiting a version-controlled file nor a VC directory 719is neither visiting a version-controlled file nor a VC directory
705buffer, these commands generate a diff of all registered files in the 720buffer, these commands generate a diff of all registered files in the
@@ -801,7 +816,7 @@ the file contents without distraction from the annotations.
801 816
802@menu 817@menu
803* Registering:: Putting a file under version control. 818* Registering:: Putting a file under version control.
804* VC Status:: Viewing the VC status of files. 819* VC Change Log:: Viewing the VC Change Log.
805* VC Undo:: Canceling changes before or after check-in. 820* VC Undo:: Canceling changes before or after check-in.
806@end menu 821@end menu
807 822
@@ -857,22 +872,36 @@ particular file using the minibuffer.
857initial comment to describe the purpose of this source file. Reading 872initial comment to describe the purpose of this source file. Reading
858the initial comment works like reading a log entry (@pxref{Log Buffer}). 873the initial comment works like reading a log entry (@pxref{Log Buffer}).
859 874
860@node VC Status 875@node VC Change Log
861@subsubsection VC Status Commands 876@subsubsection VC Change Log
862 877
863@table @kbd 878@table @kbd
864@item C-x v l 879@item C-x v l
865Display revision control state and change history. 880Display revision control state and change history
881(@code{vc-print-log}).
882
883@item C-x v L
884Display the change history for the current repository
885(@code{vc-print-root-log}).
866@end table 886@end table
867 887
868@kindex C-x v l 888@kindex C-x v l
869@findex vc-print-log 889@findex vc-print-log
870 To view the detailed revision control status and history of a file, 890 The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer
871type @kbd{C-x v l} (@code{vc-print-log}). This pops up a special 891named @samp{*vc-change-log*} in a new window. This buffer lists the
872buffer named @samp{*vc-change-log*}, in a new window, that displays 892changes to the current file, including the associated log entries.
873the history of changes to the current file, including the text of the 893(These are the log entries associated with the version control system,
874log entries. The point is centered at the revision of the file that 894i.e. the ones you enter via the @samp{*VC-Log*} buffer. @xref{Log
875is currently being visited. 895Buffer}.) Point is centered at the revision of the file currently
896being visited. With a prefix argument, the command prompts for the
897revision to center on, and the maximum number of revisions to display.
898
899@findex vc-print-root-log
900 Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a
901@samp{*vc-change-log*} buffer showing the history of the
902version-controlled directory tree as a whole. With a prefix argument,
903the command prompts for the maximum number of revisions to display.
904RCS, SCCS, and CVS do not support this feature.
876 905
877 In the @samp{*vc-change-log*} buffer, you can use the following keys 906 In the @samp{*vc-change-log*} buffer, you can use the following keys
878to move between the logs of revisions and of files, to view past 907to move between the logs of revisions and of files, to view past
@@ -926,6 +955,16 @@ This is useful to see all the changes to all files that the revision
926indicated on the current line did when it was committed. 955indicated on the current line did when it was committed.
927@end table 956@end table
928 957
958@vindex vc-log-show-limit
959Because fetching many log entries can be slow, the
960@samp{*vc-change-log*} buffer displays no more than 2000 revisions by
961default. The variable @code{vc-log-show-limit} specifies this limit;
962if you set the value to zero, that removes the limit. You can also
963increase the number of revisions shown in an existing
964@samp{*vc-change-log*} buffer by clicking on the @samp{Show 2X
965entries} or @samp{Show unlimited entries} buttons at the end of the
966buffer. However, RCS, SCCS, and CVS do not support this feature.
967
929@node VC Undo 968@node VC Undo
930@subsubsection Undoing Version Control Actions 969@subsubsection Undoing Version Control Actions
931 970
diff --git a/doc/emacs/major.texi b/doc/emacs/major.texi
index 19ab86f91dd..d67bc4a13dd 100644
--- a/doc/emacs/major.texi
+++ b/doc/emacs/major.texi
@@ -41,7 +41,7 @@ languages. These include Lisp mode (which has several variants), C
41mode, Fortran mode, and others. The remaining major modes are not 41mode, Fortran mode, and others. The remaining major modes are not
42intended for use on users' files; they are used in buffers created for 42intended for use on users' files; they are used in buffers created for
43specific purposes by Emacs, such as Dired mode for buffers made by 43specific purposes by Emacs, such as Dired mode for buffers made by
44Dired (@pxref{Dired}), Mail mode for buffers made by @kbd{C-x m} 44Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m}
45(@pxref{Sending Mail}), and Shell mode for buffers used for 45(@pxref{Sending Mail}), and Shell mode for buffers used for
46communicating with an inferior shell process (@pxref{Interactive 46communicating with an inferior shell process (@pxref{Interactive
47Shell}). 47Shell}).
diff --git a/doc/emacs/misc.texi b/doc/emacs/misc.texi
index cdf46f0f151..808c3bfc3d3 100644
--- a/doc/emacs/misc.texi
+++ b/doc/emacs/misc.texi
@@ -84,11 +84,20 @@ When in DocView mode, you can scroll the current page using the usual
84Emacs movement keys: @kbd{C-p}, @kbd{C-n}, @kbd{C-b}, @kbd{C-f}, and 84Emacs movement keys: @kbd{C-p}, @kbd{C-n}, @kbd{C-b}, @kbd{C-f}, and
85the arrow keys. 85the arrow keys.
86 86
87@vindex doc-view-continuous
88 By default, the line-motion keys @kbd{C-p} and @kbd{C-n} stop
89scrolling at the beginning and end of the current page, respectively.
90However, if you change the variable @code{doc-view-continuous} to a
91non-@code{nil} value, then @kbd{C-p} displays the previous page if you
92are already at the beginning of the current page, and @kbd{C-n}
93displays the next page if you are at the end of the current page.
94
87@findex doc-view-next-page 95@findex doc-view-next-page
88@findex doc-view-previous-page 96@findex doc-view-previous-page
89 To display the next page, type @kbd{n}, @key{next} or @kbd{C-x ]} 97 You can also display the next page by typing @kbd{n}, @key{next} or
90(@code{doc-view-next-page}). To display the previous page, type 98@kbd{C-x ]} (@code{doc-view-next-page}). To display the previous
91@kbd{p}, @key{prior} or @kbd{C-x [} (@code{doc-view-previous-page}). 99page, type @kbd{p}, @key{prior} or @kbd{C-x [}
100(@code{doc-view-previous-page}).
92 101
93@findex doc-view-scroll-up-or-next-page 102@findex doc-view-scroll-up-or-next-page
94@findex doc-view-scroll-down-or-previous-page 103@findex doc-view-scroll-down-or-previous-page
@@ -957,12 +966,9 @@ Fetch the next earlier old shell command.
957Fetch the next later old shell command. 966Fetch the next later old shell command.
958 967
959@kindex M-r @r{(Shell mode)} 968@kindex M-r @r{(Shell mode)}
960@kindex M-s @r{(Shell mode)} 969@findex comint-history-isearch-backward-regexp
961@findex comint-previous-matching-input 970@item M-r
962@findex comint-next-matching-input 971Begin an incremental regexp search of old shell commands.
963@item M-r @var{regexp} @key{RET}
964@itemx M-s @var{regexp} @key{RET}
965Search backwards or forwards for old shell commands that match @var{regexp}.
966 972
967@item C-c C-x 973@item C-c C-x
968@kindex C-c C-x @r{(Shell mode)} 974@kindex C-c C-x @r{(Shell mode)}
@@ -995,15 +1001,15 @@ successively more recent shell commands from the buffer.
995@kbd{C-@key{UP}} works like @kbd{M-p}, and @kbd{C-@key{DOWN}} like 1001@kbd{C-@key{UP}} works like @kbd{M-p}, and @kbd{C-@key{DOWN}} like
996@kbd{M-n}. 1002@kbd{M-n}.
997 1003
998 The history search commands @kbd{M-r} and @kbd{M-s} read a regular 1004 The history search command @kbd{M-r} begins an incremental regular
999expression and search through the history for a matching command. Aside 1005expression search of previous shell commands. After typing @kbd{M-r},
1000from the choice of which command to fetch, they work just like @kbd{M-p} 1006start typing the desired string or regular expression; the last
1001and @kbd{M-n}. If you enter an empty regexp, these commands reuse the 1007matching shell command will be displayed in the current line.
1002same regexp used last time. 1008Incremental search commands have their usual effects---for instance,
1003 1009@kbd{C-s} and @kbd{C-r} search forward and backward for the next match
1004 When you find the previous input you want, you can resubmit it by 1010(@pxref{Incremental Search}). When you find the desired input, type
1005typing @key{RET}, or you can edit it first and then resubmit it if you 1011@key{RET} to terminate the search. This puts the input in the command
1006wish. Any partial input you were composing before navigating the 1012line. Any partial input you were composing before navigating the
1007history list is restored when you go to the beginning or end of the 1013history list is restored when you go to the beginning or end of the
1008history ring. 1014history ring.
1009 1015
diff --git a/doc/emacs/mule.texi b/doc/emacs/mule.texi
index 6420132e0ce..be639f45b0a 100644
--- a/doc/emacs/mule.texi
+++ b/doc/emacs/mule.texi
@@ -540,6 +540,11 @@ most input methods---some disable this feature). If
540possible characters to type next is displayed in the echo area (but 540possible characters to type next is displayed in the echo area (but
541not when you are in the minibuffer). 541not when you are in the minibuffer).
542 542
543 Another facility for typing characters not on your keyboard is by
544using the @kbd{C-x 8 @key{RET}} (@code{ucs-insert}) to insert a single
545character based on its Unicode name or code-point; see @ref{Inserting
546Text}.
547
543@node Select Input Method 548@node Select Input Method
544@section Selecting an Input Method 549@section Selecting an Input Method
545 550
@@ -968,15 +973,16 @@ still use an unsuitable coding system if you type its name in response
968to the question.) 973to the question.)
969 974
970@vindex sendmail-coding-system 975@vindex sendmail-coding-system
971 When you send a message with Mail mode (@pxref{Sending Mail}), Emacs has 976 When you send a message with Message mode (@pxref{Sending Mail}),
972four different ways to determine the coding system to use for encoding 977Emacs has four different ways to determine the coding system to use
973the message text. It tries the buffer's own value of 978for encoding the message text. It tries the buffer's own value of
974@code{buffer-file-coding-system}, if that is non-@code{nil}. Otherwise, 979@code{buffer-file-coding-system}, if that is non-@code{nil}.
975it uses the value of @code{sendmail-coding-system}, if that is 980Otherwise, it uses the value of @code{sendmail-coding-system}, if that
976non-@code{nil}. The third way is to use the default coding system for 981is non-@code{nil}. The third way is to use the default coding system
977new files, which is controlled by your choice of language environment, 982for new files, which is controlled by your choice of language
978if that is non-@code{nil}. If all of these three values are @code{nil}, 983environment, if that is non-@code{nil}. If all of these three values
979Emacs encodes outgoing mail using the Latin-1 coding system. 984are @code{nil}, Emacs encodes outgoing mail using the Latin-1 coding
985system.
980 986
981@node Text Coding 987@node Text Coding
982@section Specifying a Coding System for File Text 988@section Specifying a Coding System for File Text
diff --git a/doc/emacs/programs.texi b/doc/emacs/programs.texi
index 8ebbcf58ed4..dce6c38692e 100644
--- a/doc/emacs/programs.texi
+++ b/doc/emacs/programs.texi
@@ -88,11 +88,12 @@ and you can select it by typing @kbd{M-x @var{l}-mode @key{RET}}.
88@cindex PostScript mode 88@cindex PostScript mode
89@cindex Conf mode 89@cindex Conf mode
90@cindex DNS mode 90@cindex DNS mode
91@cindex Javascript mode
91 The existing programming language major modes include Lisp, Scheme 92 The existing programming language major modes include Lisp, Scheme
92(a variant of Lisp) and the Scheme-based DSSSL expression language, 93(a variant of Lisp) and the Scheme-based DSSSL expression language,
93Ada, ASM, AWK, C, C++, Delphi (Object Pascal), Fortran, Icon, IDL 94Ada, ASM, AWK, C, C++, Delphi (Object Pascal), Fortran, Icon, IDL
94(CORBA), IDLWAVE, Java, Metafont (@TeX{}'s companion for font 95(CORBA), IDLWAVE, Java, Javascript, Metafont (@TeX{}'s companion for
95creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike, 96font creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike,
96PostScript, Prolog, Python, Ruby, Simula, Tcl, and VHDL. An 97PostScript, Prolog, Python, Ruby, Simula, Tcl, and VHDL. An
97alternative mode for Perl is called CPerl mode. Modes are available 98alternative mode for Perl is called CPerl mode. Modes are available
98for the scripting languages of the common GNU and Unix shells, VMS 99for the scripting languages of the common GNU and Unix shells, VMS
diff --git a/doc/emacs/rmail.texi b/doc/emacs/rmail.texi
index d5ea368dd3b..8a4ce492ee1 100644
--- a/doc/emacs/rmail.texi
+++ b/doc/emacs/rmail.texi
@@ -683,12 +683,12 @@ standard meaning.
683@node Rmail Reply 683@node Rmail Reply
684@section Sending Replies 684@section Sending Replies
685 685
686 Rmail has several commands that use Mail mode to send outgoing mail. 686 Rmail has several commands to send outgoing mail. @xref{Sending
687@xref{Sending Mail}, for information on using Mail mode, including 687Mail}, for information on using Message mode, including certain
688certain features meant to work with Rmail. What this section documents 688features meant to work with Rmail. What this section documents are
689are the special commands of Rmail for entering Mail mode. Note that the 689the special commands of Rmail for entering the mail buffer. Note that
690usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and @kbd{C-x 5 690the usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and
691m}---also work normally in Rmail mode. 691@kbd{C-x 5 m}---also work normally in Rmail mode.
692 692
693@table @kbd 693@table @kbd
694@item m 694@item m
@@ -735,12 +735,12 @@ the reply command with a numeric argument: @kbd{C-u r} or @kbd{1 r}.
735This means to reply only to the sender of the original message. 735This means to reply only to the sender of the original message.
736 736
737 Once the @samp{*mail*} buffer has been initialized, editing and 737 Once the @samp{*mail*} buffer has been initialized, editing and
738sending the mail goes as usual (@pxref{Sending Mail}). You can edit the 738sending the mail goes as usual (@pxref{Sending Mail}). You can edit
739presupplied header fields if they are not what you want. You can also 739the presupplied header fields if they are not what you want. You can
740use the commands of Mail mode (@pxref{Mail Mode}), including @kbd{C-c 740also use commands such as @kbd{C-c C-y}, which yanks in the message
741C-y} which yanks in the message that you are replying to. You can 741that you are replying to (@pxref{Mail Commands}). You can also switch
742also switch to the Rmail buffer, select a different message there, switch 742to the Rmail buffer, select a different message there, switch back,
743back, and yank the new current message. 743and yank the new current message.
744 744
745@kindex M-m @r{(Rmail)} 745@kindex M-m @r{(Rmail)}
746@findex rmail-retry-failure 746@findex rmail-retry-failure
diff --git a/doc/emacs/sending.texi b/doc/emacs/sending.texi
index 717c89936fc..59f140e5f8a 100644
--- a/doc/emacs/sending.texi
+++ b/doc/emacs/sending.texi
@@ -6,120 +6,110 @@
6@chapter Sending Mail 6@chapter Sending Mail
7@cindex sending mail 7@cindex sending mail
8@cindex mail 8@cindex mail
9@cindex email
9@cindex message 10@cindex message
10 11
11 To send a message in Emacs, you start by typing a command (@kbd{C-x m}) 12@kindex C-x m
12to select and initialize the @samp{*mail*} buffer. Then you edit the text 13@findex compose-mail
13and headers of the message in this buffer, and type another command 14 To send an @dfn{e-mail} message in Emacs, type @kbd{C-x m}. This
14(@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message. 15selects and initializes a buffer named @samp{*mail*}, where you can
16edit the text and headers of the message. Finally, type @kbd{C-c C-s}
17or @kbd{C-c C-c} to send the message.
15 18
16@table @kbd 19@table @kbd
17@item C-x m 20@item C-x m
18Begin composing a message to send (@code{compose-mail}). 21Begin composing mail (@code{compose-mail}).
19@item C-x 4 m 22@item C-x 4 m
20Likewise, but display the message in another window 23Likewise, in another window (@code{compose-mail-other-window}).
21(@code{compose-mail-other-window}).
22@item C-x 5 m 24@item C-x 5 m
23Likewise, but make a new frame (@code{compose-mail-other-frame}). 25Likewise, but in a new frame (@code{compose-mail-other-frame}).
24@item C-c C-s 26@item C-c C-s
25In Mail mode, send the message (@code{mail-send}). 27In the mail buffer, send the message (@code{message-send}).
26@item C-c C-c 28@item C-c C-c
27Send the message and bury the mail buffer (@code{mail-send-and-exit}). 29In the mail buffer, send the message and bury the buffer
30(@code{message-send-and-exit}).
28@end table 31@end table
29 32
30@kindex C-x m
31@findex compose-mail
32@kindex C-x 4 m 33@kindex C-x 4 m
33@findex compose-mail-other-window 34@findex compose-mail-other-window
34@kindex C-x 5 m 35@kindex C-x 5 m
35@findex compose-mail-other-frame 36@findex compose-mail-other-frame
36 The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named 37@noindent
37@samp{*mail*} and initializes it with the skeleton of an outgoing 38The command @kbd{C-x 4 m} (@code{compose-mail-other-window}) does the
38message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the 39same as @kbd{C-x m}, except it displays the mail buffer in a different
39@samp{*mail*} buffer in a different window, leaving the previous current 40window. The command @kbd{C-x 5 m} (@code{compose-mail-other-frame})
40buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates 41creates a new frame for the mail buffer.
41a new frame to select the @samp{*mail*} buffer. 42
42 43 Because the mail buffer is an ordinary Emacs buffer, you can switch
43 Because the mail-composition buffer is an ordinary Emacs buffer, you can 44to other buffers while in the middle of composing mail, and switch
44switch to other buffers while in the middle of composing mail, and switch 45back later (or never). If you type @kbd{C-x m} again when you have
45back later (or never). If you use the @kbd{C-x m} command again when you 46been composing another message but have not sent it, Emacs asks for
46have been composing another message but have not sent it, you are asked to 47confirmation before erasing the old message. If you answer @kbd{n},
47confirm before the old message is erased. If you answer @kbd{n}, the 48Emacs selects the mail buffer with its old contents, so you can finish
48@samp{*mail*} buffer remains selected with its old contents, so you can 49the old message and send it. @kbd{C-u C-x m} is another way to do
49finish the old message and send it. @kbd{C-u C-x m} is another way to do 50this. Sending the message marks the mail buffer ``unmodified,'' which
50this. Sending the message marks the @samp{*mail*} buffer ``unmodified,'' 51avoids the need for confirmation when @kbd{C-x m} is next used.
51which avoids the need for confirmation when @kbd{C-x m} is next used. 52
52 53 If you want to send another message before finishing the current
53 If you are composing a message in the @samp{*mail*} buffer and want to 54message, use the command @kbd{M-x rename-uniquely} to rename the
54send another message before finishing the first, rename the 55current mail buffer (@pxref{Misc Buffer}). Then you can use @kbd{C-x
55@samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc 56m} to make a new mail buffer, and work with each mail buffer
56Buffer}). Then you can use @kbd{C-x m} or its variants described above 57independently.
57to make a new @samp{*mail*} buffer. Once you've done that, you can work 58
58with each mail buffer independently. 59 Before using Emacs to send mail, you may need to customize the
59 60variable @code{send-mail-function} if your system is not set up to
60@vindex mail-default-directory 61deliver mail directly via SMTP (@pxref{Mail Sending}). In addition,
61 The variable @code{mail-default-directory} controls the default 62you may need to customize @code{user-mail-address} if the system
62directory for mail buffers, and also says where to put their auto-save 63cannot receive mail via SMTP (@pxref{Mail Headers}).
63files.
64
65@c Not mentioned: mail-bury-selects-summary. Really an Rmail feature.
66
67@ignore
68@c Commented out because it is not user-oriented;
69@c it doesn't say how to do some job. -- rms.
70@cindex directory servers
71@cindex LDAP
72@cindex PH/QI
73@cindex names and addresses
74There is an interface to directory servers using various protocols such
75as LDAP or the CCSO white pages directory system (PH/QI), described in a
76separate manual. It may be useful for looking up names and addresses.
77@xref{Top,,EUDC, eudc, EUDC Manual}.
78@end ignore
79 64
80@menu 65@menu
81* Format: Mail Format. Format of the mail being composed. 66* Format: Mail Format. Format of a mail message.
82* Headers: Mail Headers. Details of some standard mail header fields. 67* Headers: Mail Headers. Details of some standard mail header fields.
83* Aliases: Mail Aliases. Abbreviating and grouping mail addresses. 68* Aliases: Mail Aliases. Abbreviating and grouping mail addresses.
84* Mode: Mail Mode. Special commands for editing mail being composed. 69* Commands: Mail Commands. Special commands for editing mail being composed.
85* Amuse: Mail Amusements. Distracting the NSA; adding fortune messages. 70* Signature: Mail Signature. Adding a signature to every message.
86* Methods: Mail Methods. Using alternative mail-composition methods. 71* Amuse: Mail Amusements. Distracting the NSA; adding fortune messages.
72* Methods: Mail Methods. Using alternative mail-composition methods.
87@end menu 73@end menu
88 74
89@node Mail Format 75@node Mail Format
90@section The Format of the Mail Buffer 76@section The Format of the Mail Buffer
91 77
92 In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header 78 An email message must contain certain pieces of information, called
93fields} which say who sent it, when, to whom, why, and so on. Some 79@dfn{headers}, which specify the message's sender, recipient(s), and
94header fields, such as @samp{Date} and @samp{Message-Id}, are created 80so on.
95automatically when you send the message. Others, such as the recipient 81
96names, must be specified by you in order to send the message properly. 82 At the top of the mail buffer is a set of @dfn{header fields}, where
83you can enter this information. You can insert and edit header fields
84using ordinary editing commands. @xref{Header Editing}, for commands
85specific to editing header fields.
97 86
98 In the mail buffer, you can insert and edit header fields using 87 Some header fields are automatically pre-initialized in the buffer,
99ordinary editing commands. Mail mode provides commands to help you 88when appropriate; other headers, such as @samp{Date} and
100edit some header fields, and some are automatically preinitialized in 89@samp{Message-Id}, are normally omitted from the mail buffer and
101the buffer, when appropriate. 90created automatically when the message is sent.
102 91
103@vindex mail-header-separator 92@vindex mail-header-separator
104 The line in the buffer that says 93 The line in the buffer that says
105 94
106@example 95@smallexample
107--text follows this line-- 96--text follows this line--
108@end example 97@end smallexample
109 98
110@noindent 99@noindent
111is a special delimiter that separates the headers you have specified from 100separates the header fields from the @dfn{body} (or @dfn{text}) of the
112the text. Whatever follows this line is the text of the message; the 101message. Everything above this line is treated as part of the
113headers precede it. The delimiter line itself does not appear in the 102headers; everything below it is treated as the body. The delimiter
114message actually sent. The text used for the delimiter line is controlled 103line itself does not appear in the message actually sent. The text
115by the variable @code{mail-header-separator}. 104used for the delimiter line is controlled by the variable
105@code{mail-header-separator}.
116 106
117 Here is an example of what the headers and text in the mail buffer 107 Here is an example of what the headers and text in the mail buffer
118might look like. 108might look like.
119 109
120@example 110@example
121To: gnu@@gnu.org 111To: gnu@@example.org
122CC: lungfish@@spam.org, byob@@spam.org 112CC: lungfish@@example.com, byob@@example.net
123Subject: The Emacs Manual 113Subject: The Emacs Manual
124--text follows this line-- 114--text follows this line--
125Please ignore this message. 115Please ignore this message.
@@ -134,85 +124,51 @@ beginning of a line, terminated by a colon. Upper and lower case are
134equivalent in field names (and in mailing addresses also). After the 124equivalent in field names (and in mailing addresses also). After the
135colon and optional whitespace comes the contents of the field. 125colon and optional whitespace comes the contents of the field.
136 126
137 You can use any name you like for a header field, but normally people 127 You can use any name you like for a header field, but normally
138use only standard field names with accepted meanings. Here is a table 128people use only standard field names with accepted meanings. Here is
139of fields commonly used in outgoing messages. Emacs preinitializes some 129a table of commonly-used fields. Emacs pre-initializes some of these,
140of these when you start to compose a mail, depending on various options 130depending on various options you can set. You can delete or alter any
141you can set. You can delete or alter any header field before you send 131header field before you send the message, if you wish.
142the message, if you wish.
143 132
144@table @samp 133@table @samp
134@item From
135@vindex user-mail-address
136The address of the sender (you). This should be a valid mailing
137address, as replies will normally go there. Emacs initializes this
138field using the variables @code{user-full-name} and
139@code{user-mail-address}; see below.
140
145@item To 141@item To
146This field contains the mailing addresses to which the message is 142The mailing address(es) to which the message is addressed. To list
147addressed. If you list more than one address, use commas, not spaces, 143more than one address, use commas (not spaces) to separate them.
148to separate them.
149 144
150@item Subject 145@item Subject
151The contents of the @samp{Subject} field should be a piece of text 146A piece of text saying what the message is about. Most mail-reading
152that says what the message is about. The reason @samp{Subject} fields 147programs can display a summary of messages, listing the subject of
153are useful is that most mail-reading programs can provide a summary of 148each message but not its text.
154messages, listing the subject of each message but not its text.
155 149
156@item CC 150@item CC
157This field contains additional mailing addresses to send the message to, 151Additional mailing address(es) to send the message to. This is like
158like @samp{To} except that these readers should not regard the message 152@samp{To}, except that these readers should not regard the message as
159as directed at them. 153directed at them.
160 154
161@item BCC 155@item BCC
162This field contains additional mailing addresses to send the message to, 156Additional mailing address(es) to send the message to, which should
163which should not appear in the header of the message actually sent. 157not appear in the header of the message actually sent. ``BCC'' stands
164Copies sent this way are called @dfn{blind carbon copies}. 158for @dfn{blind carbon copies}.
165
166@vindex mail-self-blind
167@cindex copy of every outgoing message
168To send a blind carbon copy of every outgoing message to yourself, set
169the variable @code{mail-self-blind} to @code{t}. To send a blind carbon
170copy of every message to some other @var{address}, set the variable
171@code{mail-default-headers} to @code{"Bcc: @var{address}\n"}.
172 159
173@item FCC 160@item FCC
174This field contains the name of one file and directs Emacs to append a 161The name of one file, to which a copy of the sent message should be
175copy of the message to that file when you send the message. Emacs 162appended. Emacs writes the message in mbox format, unless the file is
176writes the message in mbox format, unless the file is in Babyl format 163in Babyl format (used by Rmail before Emacs 23), in which case Emacs
177(used by Rmail before Emacs 23), in which case Emacs writes Babyl. If 164writes Babyl. If an Rmail buffer is visiting the file, Emacs updates
178an Rmail buffer is visiting the file, Emacs updates it accordingly. 165it accordingly. To specify more than one file, use several @samp{FCC}
179To specify more than one file, use several @samp{FCC} fields, with one 166fields, with one file name in each field.
180file name in each field.
181
182@vindex mail-archive-file-name
183To put a fixed file name in the @samp{FCC} field each time you start
184editing an outgoing message, set the variable
185@code{mail-archive-file-name} to that file name. Unless you remove the
186@samp{FCC} field before sending, the message will be written into that
187file when it is sent.
188
189@item From
190Use the @samp{From} field to say who you are. You might need to change
191this if the account you are using to send the mail is not your own. The
192contents of the @samp{From} field should be a valid mailing address,
193since replies will normally go there.
194
195@vindex mail-setup-with-from
196Emacs initializes this field (unless the variable
197@code{mail-setup-with-from} is @code{nil}) using
198@code{user-mail-address} as the default. If there is no @samp{From}
199field when you send a mail, Emacs adds one.
200 167
201@item Reply-to 168@item Reply-to
202Use this field to direct replies to a different address. Most 169An address to which replies should be sent, instead of @samp{From}.
203mail-reading programs (including Rmail) automatically send replies to 170You can use this header if, for some reason, your @samp{From} address
204the @samp{Reply-to} address in preference to the @samp{From} address. 171is unable to receive replies.
205By adding a @samp{Reply-to} field to your header, you can work around
206any problems your @samp{From} address may cause for replies.
207
208@cindex @env{REPLYTO} environment variable
209@vindex mail-default-reply-to
210To put a fixed @samp{Reply-to} address into every outgoing message, set
211the variable @code{mail-default-reply-to} to that address (as a string).
212Then Emacs initializes the message with a @samp{Reply-to} field as
213specified. When you first compose a mail, if
214@code{mail-default-reply-to} is @code{nil}, Emacs initializes it from the
215environment variable @env{REPLYTO}.
216 172
217@item Mail-reply-to 173@item Mail-reply-to
218 This field takes precedence over @samp{Reply-to}. It is used because 174 This field takes precedence over @samp{Reply-to}. It is used because
@@ -225,70 +181,88 @@ you reply to a message from a mailing list that you are subscribed to.
225It usually indicates that you want replies to go to the list, and that 181It usually indicates that you want replies to go to the list, and that
226you do not need an extra copy sent directly to you. 182you do not need an extra copy sent directly to you.
227 183
228@vindex mail-mailing-lists 184@c Message mode handles this differently...
229 The variable @code{mail-mailing-lists} holds a list of mailing list 185@c @vindex mail-mailing-lists
230addresses that you are subscribed to. If it is non-@code{nil}, Emacs 186@c The variable @code{mail-mailing-lists} holds a list of mailing list
231inserts an appropriate @samp{Mail-followup-to} header when sending mail 187@c addresses that you are subscribed to. If it is non-@code{nil}, Emacs
232to a mailing list. 188@c inserts an appropriate @samp{Mail-followup-to} header when sending mail
233 189@c to a mailing list.
234@c There is also "Sent-via", added by C-c C-v, but it does not seem
235@c particularly useful (?).
236 190
237@item In-reply-to 191@item In-reply-to
238This field contains a piece of text describing the message you are 192A piece of text describing the message you are replying to. Some mail
239replying to. Some mail systems can use this information to correlate 193systems can use this information to correlate related pieces of mail.
240related pieces of mail. Normally this field is filled in by Rmail 194Normally, you never need to think about this, because it is filled in
241when you reply to a message in Rmail, and you never need to 195automatically when you reply to a message in Rmail (or any other mail
242think about it (@pxref{Rmail}). 196program built into Emacs).
243 197
244@item References 198@item References
245This field lists the Message-Ids of related previous messages (a 199The Message-Ids of previous related messages (a Message-Id is a unique
246Message-Id is a unique identifier generated when a message is sent). 200identifier generated when a message is sent). Like
247Rmail sets up this field automatically when you reply to a message. 201@samp{In-reply-to}, this is normally set up automatically for you.
248@end table 202@end table
249 203
250 The @samp{To}, @samp{CC}, and @samp{BCC} header fields can appear 204@noindent
251any number of times, and each such header field can contain multiple 205The @samp{To}, @samp{CC}, and @samp{BCC} fields can appear any number
252addresses, separated by commas. This way, you can specify any number 206of times, and each such header field can contain multiple addresses,
253of places to send the message. These fields can also have 207separated by commas. This way, you can specify any number of places
254continuation lines: one or more lines starting with whitespace, 208to send the message. These fields can also have continuation lines:
255following the starting line of the field, are considered part of the 209one or more lines starting with whitespace, following the starting
256field. Here's an example of a @samp{To} field with a continuation 210line of the field, are considered part of the field. Here's an
257line: 211example of a @samp{To} field with a continuation line:
258 212
259@example 213@example
260@group 214@group
261To: foo@@here.net, this@@there.net, 215To: foo@@example.net, this@@example.net,
262 me@@gnu.cambridge.mass.usa.earth.spiral3281 216 bob@@example.com
263@end group 217@end group
264@end example 218@end example
265 219
266@vindex mail-from-style 220@vindex user-full-name
267 When you send the message, if you didn't write a @samp{From} field 221@vindex user-mail-address
268yourself, Emacs puts in one for you, using @code{user-mail-address}. 222 The default contents of the @samp{From} header field are computed
269The variable @code{mail-from-style} controls the format: 223from the variables @code{user-full-name} and @code{user-mail-address}.
224On some operating systems, Emacs initializes these two variables using
225environment variables (@pxref{General Variables}). If this
226information is unavailable or wrong, you can customize the variables
227yourself (@pxref{Easy Customization}).
270 228
271@table @code 229@vindex mail-from-style
272@item nil 230 The value of the variable @code{mail-from-style} specifies how to
273Use just the email address, as in @samp{king@@grassland.com}. 231format the address in the @samp{From} field:
274@item parens 232
275Use both email address and full name, as in:@* 233@table @asis
234@item @code{nil}
235Use just the address, as in @samp{king@@grassland.com}.
236@item @code{parens}
237Use both address and full name, as in:@*
276@samp{king@@grassland.com (Elvis Parsley)}. 238@samp{king@@grassland.com (Elvis Parsley)}.
277@item angles 239@item @code{angles}
278Use both email address and full name, as in:@* 240Use both address and full name, as in:@*
279@samp{Elvis Parsley <king@@grassland.com>}. 241@samp{Elvis Parsley <king@@grassland.com>}.
280@item system-default 242@item any other value
281Allow the system to insert the @samp{From} field. 243Use @code{angles} for most addresses. However, if the address must be
244``quoted'' to remain syntactically-valid under the @code{angles}
245format but not under the @code{parens} format, use @code{parens}
246instead. This is the default.
282@end table 247@end table
283 248
284@c There is also mail-specify-envelope-from and mail-envelope-from, but 249@c There is also mail-specify-envelope-from and mail-envelope-from, but
285@c these are probably not topics for the Emacs manual. 250@c these are probably not topics for the Emacs manual.
286 251
287@vindex mail-default-headers 252@vindex mail-default-headers
288 You can direct Emacs to insert certain default headers into the 253 You can direct Emacs to insert certain default headers into the mail
289outgoing message by setting the variable @code{mail-default-headers} 254buffer by setting the variable @code{mail-default-headers} to a
290to a string. Then @code{C-x m} inserts this string into the message 255string. Then @kbd{C-x m} inserts this string into the message
291headers. If the default header fields are not appropriate for a 256headers. For example, here is how to add a @samp{Reply-to} and
257@samp{FCC} header to each message:
258
259@smallexample
260(setq mail-default-headers
261 "Reply-to: foo@@example.com\nFCC: ~/Mail/sent")
262@end smallexample
263
264@noindent
265If the default header fields are not appropriate for a
292particular message, edit them as necessary before sending the message. 266particular message, edit them as necessary before sending the message.
293 267
294@node Mail Aliases 268@node Mail Aliases
@@ -296,29 +270,26 @@ particular message, edit them as necessary before sending the message.
296@cindex mail aliases 270@cindex mail aliases
297@cindex @file{.mailrc} file 271@cindex @file{.mailrc} file
298@cindex mailrc file 272@cindex mailrc file
273@vindex mail-personal-alias-file
299 274
300 You can define @dfn{mail aliases} in a file named @file{~/.mailrc}. 275 You can define @dfn{mail aliases}, which are short mnemonic names
301These are short mnemonic names which stand for mail addresses or groups of 276that stand for mail addresses or groups of mail addresses. By
302mail addresses. Like many other mail programs, Emacs expands aliases 277default, mail aliases are defined in the file @file{~/.mailrc}. You
303when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and 278can specify a different file name to use, by setting the variable
304@samp{Reply-to} fields, plus their @samp{Resent-} variants. 279@code{mail-personal-alias-file}.
305@c The list is defined by mail-address-field-regexp.
306 280
307 To define an alias in @file{~/.mailrc}, write a line in the following 281 To define an alias in @file{.mailrc}, write a line in the following
308format: 282format:
309 283
310@example 284@example
311alias @var{shortaddress} @var{fulladdresses} 285alias @var{nick} @var{fulladdresses}
312@end example 286@end example
313 287
314@noindent 288@noindent
315Here @var{fulladdresses} stands for one or more mail addresses for 289This means that @var{nick} should expand into @var{fulladdresses},
316@var{shortaddress} to expand into. Separate multiple addresses with 290where @var{fulladdresses} can be either a single address, or multiple
317spaces; if an address contains a space, quote the whole address with a 291addresses separated with spaces. For instance, to make @code{maingnu}
318pair of double quotes. 292stand for @code{gnu@@gnu.org} plus a local address of your own, put in
319
320For instance, to make @code{maingnu} stand for
321@code{gnu@@gnu.org} plus a local address of your own, put in
322this line:@refill 293this line:@refill
323 294
324@example 295@example
@@ -326,329 +297,248 @@ alias maingnu gnu@@gnu.org local-gnu
326@end example 297@end example
327 298
328@noindent 299@noindent
329Addresses specified in this way should use double quotes around an 300If an address contains a space, quote the whole address with a pair of
330entire address when the address contains spaces. But you need not 301double quotes, like this:
331include double quotes around parts of the address, such as the person's
332full name. Emacs puts them in if they are needed. For example,
333 302
334@example 303@example
335alias jsmith "John Q. Smith <none@@example.com>" 304alias jsmith "John Q. Smith <none@@example.com>"
336@end example 305@end example
337 306
338@noindent 307@noindent
339is correct in @samp{.mailrc}. Emacs will insert the address as 308Note that you need not include double quotes around individual parts
309of the address, such as the person's full name. Emacs puts them in if
310they are needed. For instance, it inserts the above address as
340@samp{"John Q. Smith" <none@@example.com>}. 311@samp{"John Q. Smith" <none@@example.com>}.
341 312
342 Emacs also recognizes ``include'' commands in @samp{.mailrc} files. 313 Emacs also recognizes ``include'' commands in @file{.mailrc}. They
343They look like this: 314look like this:
344 315
345@example 316@example
346source @var{filename} 317source @var{filename}
347@end example 318@end example
348 319
349@noindent 320@noindent
350The file @file{~/.mailrc} is used primarily by other mail-reading 321The @file{.mailrc} file is not unique to Emacs; many other
351programs; it can contain various other commands. Emacs ignores 322mail-reading programs use it for mail aliases, and it can contain
352everything in it except for alias definitions and include commands. 323various other commands. However, Emacs ignores everything except
353 324alias definitions and include commands.
354@findex define-mail-alias
355 Another way to define a mail alias, within Emacs alone, is with the
356@code{define-mail-alias} command. It prompts for the alias and then the
357full address. You can use it to define aliases in your @file{.emacs}
358file, like this:
359
360@example
361(define-mail-alias "maingnu" "gnu@@gnu.org")
362@end example
363
364@vindex mail-aliases
365 @code{define-mail-alias} records aliases by adding them to a
366variable named @code{mail-aliases}. If you are comfortable with
367manipulating Lisp lists, you can set @code{mail-aliases} directly. The
368initial value of @code{mail-aliases} is @code{t}, which means that
369Emacs should read @file{.mailrc} to get the proper value.
370
371@vindex mail-personal-alias-file
372 You can specify a different file name to use instead of
373@file{~/.mailrc} by setting the variable
374@code{mail-personal-alias-file}.
375
376@c There is also mail-alias-file for the system aliases.
377 325
378@findex expand-mail-aliases
379 Normally, Emacs expands aliases when you send the message. You do not
380need to expand mail aliases before sending the message, but you can
381expand them if you want to see where the mail will actually go. To do
382this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail
383aliases currently present in the mail headers that hold addresses.
384
385 If you like, you can have mail aliases expand as abbrevs, as soon as
386you type them in (@pxref{Abbrevs}). To enable this feature, execute the
387following:
388
389@example
390(add-hook 'mail-mode-hook 'mail-abbrevs-setup)
391@end example
392
393@noindent
394@findex define-mail-abbrev
395@vindex mail-abbrevs
396This can go in your @file{.emacs} file. @xref{Hooks}. If you use this
397feature, you must use @code{define-mail-abbrev} instead of
398@code{define-mail-alias}; the latter does not work with this package.
399Note that the mail abbreviation package uses the variable
400@code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias
401names are converted to lower case.
402
403@kindex C-c C-a @r{(Mail mode)}
404@findex mail-abbrev-insert-alias 326@findex mail-abbrev-insert-alias
405 The mail abbreviation package also provides the @kbd{C-c C-a} 327 Mail aliases expand as abbrevs---that is to say, as soon as you type
406(@code{mail-abbrev-insert-alias}) command, which reads an alias 328a word-separator character after an alias (@pxref{Abbrevs}). This
407name (with completion) and inserts its definition at point. This is 329expansion takes place only within the @samp{To}, @samp{From},
408useful when editing the message text itself or a header field such as 330@samp{CC}, @samp{BCC}, and @samp{Reply-to} header fields (plus their
409@samp{Subject} in which Emacs does not normally expand aliases. 331@samp{Resent-} variants); it does not take place in other header
410 332fields, such as @samp{Subject}.
411 Note that abbrevs expand only if you insert a word-separator character 333
412afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause 334 You can also insert an aliased address directly, using the command
413expansion as well. Here's how to do that: 335@kbd{M-x mail-abbrev-insert-alias}. This reads an alias name, with
414 336completion, and inserts its definition at point.
415@smallexample 337
416(add-hook 'mail-mode-hook 338@node Mail Commands
417 (lambda () 339@section Mail Commands
418 (define-key 340@cindex Message mode
419 mail-mode-map [remap next-line] 'mail-abbrev-next-line) 341@cindex mode, Message
420 (define-key 342
421 mail-mode-map [remap end-of-buffer] 'mail-abbrev-end-of-buffer))) 343 The default major mode for the @samp{*mail*} buffer is called
422@end smallexample 344Message mode. It behaves like Text mode in many ways, but provides
423 345several additional commands on the @kbd{C-c} prefix, which make
424@node Mail Mode 346editing a message more convenient.
425@section Mail Mode 347
426@cindex Mail mode 348 In this section, we will describe some of the most commonly-used
427@cindex mode, Mail 349commands available in Message mode.
428 350@ifnottex
429 The major mode used in the mail buffer is Mail mode, which is much 351Message mode also has its own manual, where its features are described
430like Text mode except that various special commands are provided on the 352in greater detail. @xref{Top,,Message, message, Message}.
431@kbd{C-c} prefix. These commands all have to do specifically with 353@end ifnottex
432editing or sending the message.
433
434 Mail mode is normally used in buffers set up automatically by the
435@code{mail} command and related commands. However, you can also switch
436to Mail mode in a file-visiting buffer. This is a useful thing to do if
437you have saved the text of a draft message in a file.
438 354
439@menu 355@menu
440* Mail Sending:: Commands to send the message. 356* Mail Sending:: Commands to send the message.
441* Header Editing:: Commands to move to header fields and edit them. 357* Header Editing:: Commands to move to header fields and edit them.
442* Citing Mail:: Copying all or part of a message you are replying to. 358* Citing Mail:: Quoting a message you are replying to.
443* Mail Mode Misc:: Spell checking, signatures, etc. 359* Mail Misc:: Attachments, spell checking, etc.
444@end menu 360@end menu
445 361
446@node Mail Sending 362@node Mail Sending
447@subsection Mail Sending 363@subsection Mail Sending
448 364
449 Mail mode has two commands for sending the message you have been 365 There are two commands to send a message you have been editing:
450editing:
451 366
452@table @kbd 367@table @kbd
453@item C-c C-s
454Send the message, and leave the mail buffer selected (@code{mail-send}).
455@item C-c C-c 368@item C-c C-c
456Send the message, and select some other buffer (@code{mail-send-and-exit}). 369Send the message, and deselect the mail buffer (@code{message-send-and-exit}).
370@item C-c C-s
371Send the message, and leave the mail buffer selected (@code{message-send}).
457@end table 372@end table
458 373
459@kindex C-c C-s @r{(Mail mode)} 374@kindex C-c C-s @r{(Message mode)}
460@kindex C-c C-c @r{(Mail mode)} 375@kindex C-c C-c @r{(Message mode)}
461@findex mail-send 376@findex message-send
462@findex mail-send-and-exit 377 If you want to send a message and be done with it, type @kbd{C-c
463@vindex mail-send-hook 378C-c} (@code{mail-send-and-exit}). This sends the message and then
464 @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail 379either deletes the window or switches to another buffer. It also
465buffer unmodified, but leaves that buffer selected so that you can 380``buries'' the mail buffer, putting it at the lowest priority for
466modify the message (perhaps with new recipients) and send it again. 381reselection. This is the usual command for sending a message.
467@kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the 382
468window or switches to another buffer. It puts the mail buffer at the 383@findex message-send-and-exit
469lowest priority for reselection by default, since you are finished with 384 The command @kbd{C-c C-s} (@code{message-send}) sends the message
470using it. This is the usual way to send the message. Sending a message 385and marks the mail buffer unmodified, but leaves the buffer selected.
471runs the hook @code{mail-send-hook}. 386Use this command if you want to modify the message (perhaps with new
472 387recipients) and send it again.
473@c Options not mentioned: mail-interactive, mail-use-dsn. 388
389@vindex message-send-hook
390 Sending a message runs the hook @code{message-send-hook}.
474 391
475 In a file-visiting buffer, sending the message does not clear the 392 In a file-visiting buffer, sending the message does not clear the
476modified flag, because only saving the file should do that. Also, you 393modified flag, because only saving the file should do that. Also, you
477don't get a warning if you try to send the same message twice. 394don't get a warning if you try to send the same message twice.
478 395
479@c This is indexed in mule.texi, node "Recognize Coding". 396@vindex sendmail-coding-system
480@c @vindex sendmail-coding-system 397 When you send a message containing non-@acronym{ASCII} characters,
481 When you send a message that contains non-@acronym{ASCII} characters, they need 398they need to be encoded with a coding system (@pxref{Coding Systems}).
482to be encoded with a coding system (@pxref{Coding Systems}). Usually 399Usually the coding system is specified automatically by your chosen
483the coding system is specified automatically by your chosen language 400language environment (@pxref{Language Environments}). You can
484environment (@pxref{Language Environments}). You can explicitly specify 401explicitly specify the coding system for outgoing mail by setting the
485the coding system for outgoing mail by setting the variable 402variable @code{sendmail-coding-system} (@pxref{Recognize Coding}). If
486@code{sendmail-coding-system} (@pxref{Recognize Coding}). 403the coding system thus determined does not handle the characters in a
487 404particular message, Emacs asks you to select the coding system to use,
488 If the coding system thus determined does not handle the characters in
489a particular message, Emacs asks you to select the coding system to use,
490showing a list of possible coding systems. 405showing a list of possible coding systems.
491 406
492@c Not mentioned: mail-send-nonascii.
493
494@cindex SMTP 407@cindex SMTP
495@cindex Feedmail 408@cindex Feedmail
496@cindex Sendmail 409@cindex Sendmail
497@cindex Mailclient 410@cindex Mailclient
498@vindex send-mail-function 411@vindex send-mail-function
499 The variable @code{send-mail-function} controls how the default mail 412 The variable @code{send-mail-function} controls how the default mail
500user agent sends mail. It should be set to a function. In most cases, 413user agent sends mail. Its value should be a function, which can be
501the default is @code{sendmail-send-it}, which delivers mail using the 414one of the following:
502Sendmail installation on the local host. On Mac OS X and MS-Windows, 415
503however, the default is normally @code{mailclient-send-it}, which 416@table @code
504passes the mail buffer on to the system's designated mail client (see 417@item sendmail-send-it
505@file{mailclient.el}). To send mail through an SMTP server, set 418Send mail using the system's default @command{sendmail} (or
506@code{send-mail-function} to @code{smtpmail-send-it} and set up the 419@command{sendmail}-compatible) program. This is the default on Unix
507Emacs SMTP library (@pxref{Top,,Emacs SMTP Library, smtpmail, Sending 420and GNU, and works provided the system is a valid @dfn{mail host}
508mail via SMTP}). Another option is @code{feedmail-send-it} (see the 421(that is, provided it can deliver mail via SMTP).
509commentary section of the @file{feedmail.el} package). 422
423@item mailclient-send-it
424Pass the mail buffer on to the system's designated mail client (see
425@file{mailclient.el}). This is the default on Mac OS X and
426MS-Windows.
427
428@item smtpmail-send-it
429Send mail through an external mail host (e.g., your Internet service
430provider's SMTP server). You will need to tell Emacs how to contact
431the SMTP server, by customizing the variables
432@code{smtpmail-smtp-server} and @code{smtpmail-auth-credentials}.
433@xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}.
434
435@item feedmail-send-it
436This is similar to @code{sendmail-send-it}, but allows you to queue
437messages for later sending. See the commentary section in the file
438@file{feedmail.el} for more information.
439@end table
510 440
511@node Header Editing 441@node Header Editing
512@subsection Mail Header Editing 442@subsection Mail Header Editing
513 443
514 Mail mode provides special commands to move to particular header 444 Message mode provides the following special commands to move to
515fields and to complete addresses in headers. 445particular header fields and to complete addresses in headers.
516 446
517@table @kbd 447@table @kbd
518@item C-c C-f C-t 448@item C-c C-f C-t
519Move to the @samp{To} header field, creating one if there is none 449Move to the @samp{To} header (@code{message-goto-to}).
520(@code{mail-to}).
521@item C-c C-f C-s 450@item C-c C-f C-s
522Move to the @samp{Subject} header field, creating one if there is 451Move to the @samp{Subject} header (@code{message-goto-subject}).
523none (@code{mail-subject}).
524@item C-c C-f C-c 452@item C-c C-f C-c
525Move to the @samp{CC} header field, creating one if there is none 453Move to the @samp{CC} header (@code{message-goto-cc}).
526(@code{mail-cc}).
527@item C-c C-f C-b 454@item C-c C-f C-b
528Move to the @samp{BCC} header field, creating one if there is none 455Move to the @samp{BCC} header (@code{message-goto-bcc}).
529(@code{mail-bcc}).
530@item C-c C-f C-r 456@item C-c C-f C-r
531Move to the @samp{Reply-To} header field, creating one if there is none 457Move to the @samp{Reply-To} header (@code{message-goto-reply-to}).
532(@code{mail-reply-to}).
533@item C-c C-f C-a
534Move to the @samp{Mail-Reply-To} header field, creating one if there is none
535(@code{mail-mail-reply-to}).
536@item C-c C-f C-l
537Move to the @samp{Mail-Followup-To} header field, creating one if there is none
538(@code{mail-mail-followup-to}).
539@item C-c C-f C-f 458@item C-c C-f C-f
459Move to the @samp{Mail-Followup-To} header field
460(@code{message-goto-followup-to}).
461@item C-c C-f C-w
540Add a new @samp{FCC} header field, with file-name completion 462Add a new @samp{FCC} header field, with file-name completion
541(@code{mail-fcc}). 463(@code{message-goto-fcc}).
542@c There is also C-c C-v, mail-sent-via, which adds one or more 464@item C-c C-b
543@c "Sent-via" headers, but I don't know what the point of that header is. 465Move to the start of the message body (@code{message-goto-body}).
544@item M-@key{TAB} 466@item @key{TAB}
545Complete a mailing address (@code{mail-complete}). 467Complete a mailing address (@code{message-tab}).
546@end table 468@end table
547 469
548@kindex C-c C-f C-t @r{(Mail mode)} 470@kindex C-c C-f C-t @r{(Message mode)}
549@findex mail-to 471@findex message-goto-to
550@kindex C-c C-f C-s @r{(Mail mode)} 472@kindex C-c C-f C-s @r{(Message mode)}
551@findex mail-subject 473@findex message-goto-subject
552@kindex C-c C-f C-c @r{(Mail mode)} 474@kindex C-c C-f C-c @r{(Message mode)}
553@findex mail-cc 475@findex message-goto-cc
554@kindex C-c C-f C-b @r{(Mail mode)} 476@kindex C-c C-f C-b @r{(Message mode)}
555@findex mail-bcc 477@findex message-goto-bcc
556@kindex C-c C-f C-r @r{(Mail mode)} 478@kindex C-c C-f C-r @r{(Message mode)}
557@findex mail-reply-to 479@findex goto-reply-to
558@kindex C-c C-f C-a @r{(Mail mode)} 480@kindex C-c C-f C-f @r{(Message mode)}
559@findex mail-mail-reply-to 481@findex goto-followup-to
560@kindex C-c C-f C-l @r{(Mail mode)} 482@kindex C-c C-f C-w @r{(Message mode)}
561@findex mail-mail-followup-to 483@findex message-goto-fcc
562@kindex C-c C-f C-f @r{(Mail mode)} 484 The commands to move point to particular header fields are all based
563@findex mail-fcc 485on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). If the
564 There are several commands to move point to particular header fields, 486field in question does not exist, the command creates one (the
565all based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). 487exception is @code{mail-fcc}, which creates a new field each time).
566They are listed in the table above. If the field in question does not 488
567exist, these commands create one (the exception is @code{mail-fcc}, 489@kindex C-c C-b @r{(Message mode)}
568which creates a new field each time). We provide special motion 490@findex mail-text
569commands for these particular fields because they are the fields users 491 The command @kbd{C-c C-b} (@code{message-goto-body}) moves point to
570most often want to edit. 492just after the header separator line---that is, to the beginning of
571 493the body.
572@findex mail-complete 494
573@kindex M-TAB @r{(Mail mode)} 495@findex message-tab
574@c `mail-complete-alist' specifies the headers. 496@kindex TAB @r{(Message mode)}
575 While editing a header field that contains mailing addresses, such 497 While editing a header field that contains addresses, such as
576as @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing 498@samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete an address by
577address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It 499typing @key{TAB} (@code{message-tab}). This attempts to insert the
578inserts the full name corresponding to the address, if it can 500full name corresponding to the address based on a couple of methods,
579determine the full name. The variable @code{mail-complete-style} 501including EUDC, a library that recognizes a number of directory server
580controls whether to insert the full name, and what style to use, as in 502protocols (@pxref{Top,,EUDC,eudc, The Emacs Unified Directory
581@code{mail-from-style} (@pxref{Mail Headers}). (If your window 503Client}). Failing that, it attempts to expand the address as a mail
582manager defines @kbd{M-@key{TAB}} to switch windows, you can type 504alias (@pxref{Mail Aliases}). If point is on a header field that does
583@kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) 505not take addresses, or if it is in the message body, then @key{TAB}
584 506just inserts a tab character.
585 For completion purposes, the valid mailing addresses are taken to be
586the local users' names plus your personal mail aliases (@pxref{Mail
587Aliases}). You can specify additional sources of valid addresses;
588browse the customization group @samp{mailalias} to see the variables for
589customizing this feature (@pxref{Customization Groups}).
590
591 If you type @kbd{M-@key{TAB}} in the body of the message, or on a
592unrecognized header, @code{mail-complete} invokes the function specified
593by @code{mail-complete-function}. By default, this is
594@code{ispell-complete-word}, as in Text mode.
595 507
596@node Citing Mail 508@node Citing Mail
597@subsection Citing Mail 509@subsection Citing Mail
598@cindex citing mail 510@cindex citing mail
599 511
600 Mail mode also has commands for yanking or @dfn{citing} all or part of
601a message that you are replying to. These commands are active only when
602you started sending a message using an Rmail command.
603
604@table @kbd 512@table @kbd
605@item C-c C-y 513@item C-c C-y
606Yank the selected message from Rmail (@code{mail-yank-original}). 514Yank the selected message from Rmail (@code{message-yank-original}).
607@item C-c C-r
608Yank the region from the Rmail buffer (@code{mail-yank-region}).
609@item C-c C-q 515@item C-c C-q
610Fill each paragraph cited from another message 516Fill each paragraph cited from another message
611(@code{mail-fill-yanked-message}). 517(@code{message-fill-yanked-message}).
612@c There is also mail-split-line, but it does not seem very useful.
613@end table 518@end table
614 519
615@kindex C-c C-y @r{(Mail mode)} 520@kindex C-c C-y @r{(Message mode)}
616@findex mail-yank-original 521@findex message-yank-original
617 When mail sending is invoked from the Rmail mail reader using an Rmail 522@findex message-yank-prefix
618command, @kbd{C-c C-y} can be used inside the mail buffer to insert the 523 You can use the command @kbd{C-c C-y} (@code{message-yank-original})
619text of the message you are replying to. Normally it indents each line 524to @dfn{cite} a message that you are replying to. This inserts the
620of that message three spaces and eliminates most header fields (as 525text of that message into the mail buffer. This command is active
621specified by the variable @code{mail-yank-ignored-headers}). A numeric 526only when the mail buffer is invoked from a mail program running in
622argument specifies the number of spaces to indent (the variable 527Emacs, such as Rmail.
623@code{mail-indentation-spaces} specifies the default number). An 528
624argument of just @kbd{C-u} says not to indent at all and not to 529 By default, Emacs inserts the string @samp{>} in front of each line
625eliminate anything. @kbd{C-c C-y} always uses the current message from 530of the cited text; this prefix string is specified by the variable
626the Rmail buffer, so you can insert several old messages by selecting 531@code{message-yank-prefix}. If you call @code{message-yank-original}
627one in Rmail, switching to @samp{*mail*} and yanking it, then switching 532with a prefix argument, the citation prefix is not inserted.
628back to Rmail to select another. 533
629 534@kindex C-c C-q @r{(Message mode)}
630@vindex mail-yank-prefix
631 You can specify the text for @kbd{C-c C-y} to insert at the beginning
632of each line: set @code{mail-yank-prefix} to the desired string. (A
633value of @code{nil} means to use indentation; this is the default.)
634However, @kbd{C-u C-c C-y} never adds anything at the beginning of the
635inserted lines, regardless of the value of @code{mail-yank-prefix}.
636
637@kindex C-c C-r @r{(Mail mode)}
638@findex mail-yank-region
639 To yank just a part of an incoming message, set the region in Rmail to
640the part you want; then go to the @samp{*Mail*} message and type
641@kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is
642indented or prefixed according to @code{mail-yank-prefix}.
643
644@kindex C-c C-q @r{(Mail mode)}
645@findex mail-fill-yanked-message 535@findex mail-fill-yanked-message
646 After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q} 536 After using @kbd{C-c C-y}, you can type @kbd{C-c C-q}
647(@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked 537(@code{message-fill-yanked-message}) to fill the paragraphs of the
648old message or messages. One use of @kbd{C-c C-q} fills all such 538cited message. One use of @kbd{C-c C-q} fills all such paragraphs,
649paragraphs, each one individually. To fill a single paragraph of the 539each one individually. To fill a single paragraph of the quoted
650quoted message, use @kbd{M-q}. If filling does not automatically 540message, use @kbd{M-q}. If filling does not automatically handle the
651handle the type of citation prefix you use, try setting the fill prefix 541type of citation prefix you use, try setting the fill prefix
652explicitly. @xref{Filling}. 542explicitly. @xref{Filling}.
653 543
654@vindex mail-citation-hook 544@vindex mail-citation-hook
@@ -657,91 +547,103 @@ explicitly. @xref{Filling}.
657package, which provides more flexible citation 547package, which provides more flexible citation
658(@pxref{Introduction,,,sc, Supercite}). 548(@pxref{Introduction,,,sc, Supercite}).
659 549
660@c No need to mention: mail-citation-prefix-regexp. 550@node Mail Misc
661 551@subsection Mail Miscellany
662@node Mail Mode Misc
663@subsection Mail Mode Miscellany
664 552
665@table @kbd 553@kindex C-c C-a @r{(Message mode)}
666@item C-c C-t 554@findex mail-attach-file
667Move to the beginning of the message body text (@code{mail-text}). 555@cindex MIME
668@item C-c C-w 556@cindex Multipurpose Internet Mail Extensions
669Insert a signature at the end of the message text (@code{mail-signature}). 557 You can @dfn{attach} a file to an outgoing message by typing
670@item C-c C-i @var{file} @key{RET} 558@kbd{C-c C-a} (@code{mml-attach-file}) in the mail buffer. Attaching
671Insert the contents of @var{file} at the end of the message text 559is done using the MIME (Multipurpose Internet Mail Extensions)
672(@code{mail-attach-file}). 560standard.
673@item M-x ispell-message 561
674Perform spelling correction on the message text, but not on citations from 562 The @code{mml-attach-file} command prompts for the name of the file,
675other messages, or the message headers. 563and for the attachment's @dfn{content type}, @dfn{description}, and
676@end table 564@dfn{disposition}. The content type is normally detected
565automatically; just type @key{RET} to accept the default. The
566description is a single line of text that the recipient will see next
567to the attachment; you may also choose to leave this empty. The
568disposition is either @samp{inline} (the default), which means the
569recipient will see a link to the attachment within the message body,
570or @samp{attachment}, which means the link will be separate from the
571body.
572
573 The actual contents of the attached file are not inserted into the
574mail buffer. Instead, some placeholder text is inserted into the mail
575buffer, like this:
677 576
678@kindex C-c C-t @r{(Mail mode)} 577@smallexample
679@findex mail-text 578<#part type="text/plain" filename="~/foo.txt" disposition=inline>
680 @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header 579<#/part>
681separator line---that is, to the beginning of the message body text. 580@end smallexample
682 581
683@kindex C-c C-w @r{(Mail mode)} 582@noindent
684@findex mail-signature 583When you type @kbd{C-c C-c} or @kbd{C-c C-s} to send the message, the
685@vindex mail-signature 584attached file will be delivered with it.
686 @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text
687(your @dfn{mail signature}) at the end of the message to say more about who
688you are. For example, it may contain telephone numbers, or your
689physical location. The text comes from the variable
690@code{mail-signature}. It can be a fixed string, or a Lisp expression
691that returns a string. If it is @code{t} or @code{nil}, the function
692inserts the contents of the file @code{mail-signature-file}. By
693default, this is the file @file{~/.signature} in your home directory.
694
695 If the variable @code{mail-signature} has a non-@code{nil} value,
696starting a mail automatically inserts your signature. Otherwise, you
697must explicitly use the command @code{mail-signature}. If you want to
698omit your signature from a particular message, just delete it from the
699buffer before you send the message.
700
701 Convention says that the start of your signature should be marked by a
702line whose contents are @samp{-- }. If your signature comes from a
703file, this prefix is added for you, but in all other cases you must add
704it yourself. The remainder of your signature should be no more than
705four lines.
706 585
707@findex ispell-message 586@findex ispell-message
708 You can do spelling correction on the message text you have written 587 While composing a message, you can do spelling correction on the
709with the command @kbd{M-x ispell-message}. If you have yanked an 588message text by typing @kbd{M-x ispell-message}. If you have yanked
710incoming message into the outgoing draft, this command skips what was 589an incoming message into the outgoing draft, this command skips what
711yanked, but it checks the text that you yourself inserted. (It looks 590was yanked, but it checks the text that you yourself inserted (it
712for indentation or @code{mail-yank-prefix} to distinguish the cited 591looks for indentation or @code{mail-yank-prefix} to distinguish the
713lines from your input.) @xref{Spelling}. 592cited lines from your input). @xref{Spelling}.
714
715@kindex C-c C-i @r{(Mail mode)}
716@findex mail-attach-file
717 To include a file in the outgoing message, you can use @kbd{C-x i},
718the usual command to insert a file in the current buffer. But it is
719often more convenient to use a special command, @kbd{C-c C-i}
720(@code{mail-attach-file}). This command inserts the file contents at
721the end of the buffer, after your signature (if any), with a delimiter
722line that includes the file name. Note that this is not a MIME
723attachment.
724 593
725@vindex mail-mode-hook 594@vindex mail-mode-hook
726@vindex mail-setup-hook 595@vindex mail-setup-hook
727 Turning on Mail mode (which @kbd{C-x m} does automatically) runs the 596 Turning on Message mode (which @kbd{C-x m} does automatically) runs
728normal hooks @code{text-mode-hook} and @code{mail-mode-hook}. 597the normal hooks @code{text-mode-hook} and @code{message-mode-hook}.
729Initializing a new outgoing message runs the normal hook 598Initializing a new outgoing message runs the normal hook
730@code{mail-setup-hook}; if you want to add special fields to your mail 599@code{message-setup-hook}; you can use this hook if you want to make
731header or make other changes to the appearance of the mail buffer, use 600changes to the appearance of the mail buffer. @xref{Hooks}.
732that hook. @xref{Hooks}.
733 601
734 The main difference between these hooks is just when they are 602 The main difference between these hooks is just when they are
735invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs 603invoked. Whenever you type @kbd{C-x m}, @code{message-mode-hook} runs
736as soon as the @samp{*mail*} buffer is created. Then the 604as soon as the mail buffer is created. Then the @code{message-setup}
737@code{mail-setup} function inserts the default contents of the buffer. 605function inserts the default contents of the buffer. After these
738After these default contents are inserted, @code{mail-setup-hook} runs. 606default contents are inserted, @code{message-setup-hook} runs.
739 607
740 If you use @kbd{M-x mail} to continue an existing composition, 608 If you use @kbd{C-x m} to continue an existing composition,
741@code{mail-mode-hook} runs immediately after switching to the 609@code{message-mode-hook} runs immediately after switching to the mail
742@samp{*mail*} buffer. If the buffer is unmodified, or if you decide to 610buffer. If the buffer is unmodified, or if you decide to erase it and
743erase it and start again, @code{mail-setup-hook} runs after the default 611start again, @code{message-setup-hook} runs after the default contents
744contents are inserted. 612are inserted.
613
614@node Mail Signature
615@section Mail Signature
616
617@cindex mail signature
618@vindex mail-signature-file
619@vindex mail-signature
620 You can add a standard piece of text---your @dfn{mail
621signature}---to the end of every message. This signature may contain
622information such as your telephone number or your physical location.
623The variable @code{mail-signature} determines how Emacs handles the
624mail signature.
625
626 The default value of @code{mail-signature} is @code{t}; this means
627to look for your mail signature in the file @file{~/.signature}. If
628this file exists, its contents are automatically inserted into the end
629of the mail buffer. You can change the signature file via the
630variable @code{mail-signature-file}.
631
632 If you change @code{mail-signature} to a string, that specifies the
633text of the signature directly.
634
635@kindex C-c C-w @r{(Message mode)}
636@findex message-insert-signature
637 If you change @code{mail-signature} to @code{nil}, Emacs will not
638insert your mail signature automatically. You can insert your mail
639signature by typing @kbd{C-c C-w} (@code{message-insert-signature}) in
640the mail buffer. Emacs will look for your signature in the signature
641file.
642
643 By convention, a mail signature should be marked by a line whose
644contents are @samp{-- }. If your signature lacks this prefix, it is
645added for you. The remainder of your signature should be no more than
646four lines.
745 647
746@node Mail Amusements 648@node Mail Amusements
747@section Mail Amusements 649@section Mail Amusements
@@ -778,28 +680,32 @@ using this.
778@node Mail Methods 680@node Mail Methods
779@section Mail-Composition Methods 681@section Mail-Composition Methods
780@cindex mail-composition methods 682@cindex mail-composition methods
683@cindex Mail mode
684@cindex mode, Mail
781 685
782@cindex MH mail interface 686@cindex MH mail interface
783@cindex Message mode for sending mail 687@cindex Message mode for sending mail
784 In this chapter we have described the usual Emacs mode for editing 688 In this chapter we have described the usual Emacs mode for editing
785and sending mail---Mail mode. Emacs has alternative facilities for 689and sending mail---Message mode. This is only one of several
786editing and sending mail, including 690available modes. Prior to Emacs 23.2, the default mode was Mail mode,
787MH-E and Message mode, not documented in this manual. 691which is similar to Message mode in many respects but lacks features
788@xref{Top,,MH-E,mh-e, The Emacs Interface to MH}. @xref{Top,,Message,message, 692such as MIME support. Another available mode is MH-E
789Message Manual}. You can choose any of them as your preferred method. 693(@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}).
790The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use
791whichever agent you have specified, as do various other Emacs commands
792and facilities that send mail.
793 694
794@vindex mail-user-agent 695@vindex mail-user-agent
795 To specify your mail-composition method, customize the variable 696 You can choose any of these @dfn{mail user agents} as your preferred
796@code{mail-user-agent}. Currently legitimate values include 697method for editing and sending mail. The commands @code{C-x m},
797@code{sendmail-user-agent} (Mail mode), @code{mh-e-user-agent}, 698@code{C-x 4 m} and @code{C-x 5 m} use whichever agent you have
798@code{message-user-agent} and @code{gnus-user-agent}. 699specified; so do various other parts of Emacs that send mail, such as
700the bug reporter (@pxref{Bugs}). To specify a mail user agent,
701customize the variable @code{mail-user-agent}. Currently, legitimate
702values include @code{message-user-agent} (Message mode)
703@code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and
704@code{mh-e-user-agent}.
799 705
800 If you select a different mail-composition method, the information 706 If you select a different mail-composition method, the information
801in this chapter about the @samp{*mail*} buffer and Mail mode does not 707in this chapter about the mail buffer and Message mode does not apply;
802apply; the other methods use a different format of text in a different 708the other methods use a different format of text in a different
803buffer, and their commands are different as well. 709buffer, and their commands are different as well.
804 710
805@vindex read-mail-command 711@vindex read-mail-command
diff --git a/doc/emacs/text.texi b/doc/emacs/text.texi
index 7b4baec1131..c00410e047a 100644
--- a/doc/emacs/text.texi
+++ b/doc/emacs/text.texi
@@ -26,11 +26,16 @@ structure.
26@xref{Outline Mode}. 26@xref{Outline Mode}.
27@end iftex 27@end iftex
28 28
29@cindex nXML mode
30@cindex mode, XML
31@cindex mode, nXML
32@findex nxml-mode
29 Emacs has other major modes for text which contains ``embedded'' 33 Emacs has other major modes for text which contains ``embedded''
30commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML, SGML, 34commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and
31and XML (@pxref{HTML Mode}); and Groff and Nroff (@pxref{Nroff Mode}). 35SGML (@pxref{HTML Mode}); XML (@pxref{Top, nXML Mode,,nxml-mode, nXML
32In addition, you can edit formatted text in WYSIWYG style (``what you 36Mode}); and Groff and Nroff (@pxref{Nroff Mode}). In addition, you
33see is what you get''), using Enriched mode (@pxref{Formatted Text}). 37can edit formatted text in WYSIWYG style (``what you see is what you
38get''), using Enriched mode (@pxref{Formatted Text}).
34 39
35@cindex ASCII art 40@cindex ASCII art
36 If you need to edit pictures made out of text characters (commonly 41 If you need to edit pictures made out of text characters (commonly
@@ -61,7 +66,7 @@ for editing such pictures.
61* Text Mode:: The major modes for editing text files. 66* Text Mode:: The major modes for editing text files.
62* Outline Mode:: Editing outlines. 67* Outline Mode:: Editing outlines.
63* TeX Mode:: Editing input to the formatter TeX. 68* TeX Mode:: Editing input to the formatter TeX.
64* HTML Mode:: Editing HTML, SGML, and XML files. 69* HTML Mode:: Editing HTML and SGML files.
65* Nroff Mode:: Editing input to the formatter nroff. 70* Nroff Mode:: Editing input to the formatter nroff.
66* Formatted Text:: Editing formatted text directly in WYSIWYG fashion. 71* Formatted Text:: Editing formatted text directly in WYSIWYG fashion.
67* Text Based Tables:: Editing text-based tables in WYSIWYG fashion. 72* Text Based Tables:: Editing text-based tables in WYSIWYG fashion.
@@ -923,10 +928,10 @@ type @kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.
923@vindex text-mode-hook 928@vindex text-mode-hook
924 Entering Text mode runs the hook @code{text-mode-hook}. Other major 929 Entering Text mode runs the hook @code{text-mode-hook}. Other major
925modes related to Text mode also run this hook, followed by hooks of 930modes related to Text mode also run this hook, followed by hooks of
926their own; this includes Paragraph-Indent Text mode, Nroff mode, @TeX{} 931their own; this includes Paragraph-Indent Text mode, Nroff mode,
927mode, Outline mode, and Mail mode. Hook functions on 932@TeX{} mode, Outline mode, and Message mode. Hook functions on
928@code{text-mode-hook} can look at the value of @code{major-mode} to see 933@code{text-mode-hook} can look at the value of @code{major-mode} to
929which of these modes is actually being entered. @xref{Hooks}. 934see which of these modes is actually being entered. @xref{Hooks}.
930 935
931@node Outline Mode 936@node Outline Mode
932@section Outline Mode 937@section Outline Mode
@@ -1743,29 +1748,17 @@ required. This is set up for Czech---customize the group
1743Ref@TeX{}. @inforef{Top,, reftex}. 1748Ref@TeX{}. @inforef{Top,, reftex}.
1744 1749
1745@node HTML Mode 1750@node HTML Mode
1746@section SGML, XML, and HTML Modes 1751@section SGML and HTML Modes
1747@cindex SGML mode 1752@cindex SGML mode
1748@cindex HTML mode 1753@cindex HTML mode
1749@cindex XML mode
1750@cindex mode, SGML 1754@cindex mode, SGML
1751@cindex mode, HTML 1755@cindex mode, HTML
1752@cindex mode, XML
1753@findex sgml-mode 1756@findex sgml-mode
1754@findex html-mode 1757@findex html-mode
1755@findex xml-mode
1756 1758
1757 The major modes for SGML, XML, and HTML provide indentation support 1759 The major modes for SGML and HTML provide indentation support and
1758and commands for operating on tags. XML mode is actually identical to 1760commands for operating on tags. HTML mode is a slightly customized
1759SGML mode (to be precise, @code{xml-mode} is an alias for 1761variant of SGML mode.
1760@code{sgml-mode}), because XML is a strict subset of SGML. HTML mode
1761is a slightly customized variant of SGML mode.
1762
1763@vindex sgml-xml-mode
1764 In XML, every opening tag must have an explicit closing tag. When
1765the variable @code{sgml-xml-mode} is non-@code{nil}, the tag insertion
1766commands described below always insert explicit closing tags as well.
1767When you visit a file, Emacs determines whether it is XML by examining
1768the file contents, and sets @code{sgml-xml-mode} accordingly.
1769 1762
1770@table @kbd 1763@table @kbd
1771@item C-c C-n 1764@item C-c C-n
@@ -1855,13 +1848,22 @@ used as a cheap preview.
1855@cindex mode, nXML 1848@cindex mode, nXML
1856@findex nxml-mode 1849@findex nxml-mode
1857@cindex XML schema 1850@cindex XML schema
1858 Emacs also provides a more advanced mode for editing XML 1851 The default mode for editing XML documents is called nXML mode
1859documents, called nXML mode (@code{nxml-mode}). nXML mode is aware of 1852(@code{xml-mode} or @code{nxml-mode}). This is a powerful major mode
1860many existing XML schema, and uses them to provide completion of XML 1853that can recognize many existing XML schema and use them to provide
1861elements via @kbd{C-@key{RET}} or @kbd{M-@key{TAB}}, as well as 1854completion of XML elements via @kbd{C-@key{RET}} or @kbd{M-@key{TAB}},
1862``on-the-fly'' validation of XML, with errors highlighted via Font 1855as well as ``on-the-fly'' XML validation with error highlighting. It
1863Lock (@pxref{Font Lock}). It is described in its own manual. 1856is described in its own manual. @xref{Top, nXML Mode,,nxml-mode, nXML
1864@xref{Top, nXML Mode,,nxml-mode, nXML Mode}. 1857Mode}.
1858
1859@vindex sgml-xml-mode
1860 However, you can also use SGML mode to edit XML, since XML is a
1861strict subset of SGML. In XML, every opening tag must have an
1862explicit closing tag. When the variable @code{sgml-xml-mode} is
1863non-@code{nil}, the tag insertion commands described above always
1864insert explicit closing tags as well. When you visit a file in SGML
1865mode, Emacs determines whether it is XML by examining the file
1866contents, and sets @code{sgml-xml-mode} accordingly.
1865 1867
1866@node Nroff Mode 1868@node Nroff Mode
1867@section Nroff Mode 1869@section Nroff Mode
diff --git a/doc/lispref/ChangeLog b/doc/lispref/ChangeLog
index 61e1b2fda5c..21f400948dc 100644
--- a/doc/lispref/ChangeLog
+++ b/doc/lispref/ChangeLog
@@ -1,3 +1,8 @@
12010-03-26 Chong Yidong <cyd@stupidchicken.com>
2
3 * loading.texi (Hooks for Loading): Document after-load-functions.
4 Copyedits.
5
12010-03-24 Arni Magnusson <arnima@hafro.is> (tiny change) 62010-03-24 Arni Magnusson <arnima@hafro.is> (tiny change)
2 7
3 * frames.texi (Cursor Parameters): Fix typo. (Bug#5760) 8 * frames.texi (Cursor Parameters): Fix typo. (Bug#5760)
diff --git a/doc/lispref/loading.texi b/doc/lispref/loading.texi
index 38bc9c4d0e8..ec10c51b236 100644
--- a/doc/lispref/loading.texi
+++ b/doc/lispref/loading.texi
@@ -920,8 +920,17 @@ library, to remove functions defined in the library.
920@cindex loading hooks 920@cindex loading hooks
921@cindex hooks for loading 921@cindex hooks for loading
922 922
923You can ask for code to be executed if and when a particular library is 923You can ask for code to be executed each time Emacs loads a library,
924loaded, by calling @code{eval-after-load}. 924by using the variable @code{after-load-functions}:
925
926@defvar after-load-functions
927This abnormal hook is run after loading a file. Each function in the
928hook is called with a single argument, the absolute filename of the
929file that was just loaded.
930@end defvar
931
932If you want code to be executed when a @emph{particular} library is
933loaded, use the function @code{eval-after-load}:
925 934
926@defun eval-after-load library form 935@defun eval-after-load library form
927This function arranges to evaluate @var{form} at the end of loading 936This function arranges to evaluate @var{form} at the end of loading
@@ -930,7 +939,7 @@ the file @var{library}, each time @var{library} is loaded. If
930Don't forget to quote @var{form}! 939Don't forget to quote @var{form}!
931 940
932You don't need to give a directory or extension in the file name 941You don't need to give a directory or extension in the file name
933@var{library}---normally you just give a bare file name, like this: 942@var{library}. Normally, you just give a bare file name, like this:
934 943
935@example 944@example
936(eval-after-load "edebug" '(def-edebug-spec c-point t)) 945(eval-after-load "edebug" '(def-edebug-spec c-point t))
@@ -955,31 +964,30 @@ An error in @var{form} does not undo the load, but does prevent
955execution of the rest of @var{form}. 964execution of the rest of @var{form}.
956@end defun 965@end defun
957 966
958In general, well-designed Lisp programs should not use this feature. 967Normally, well-designed Lisp programs should not use
959The clean and modular ways to interact with a Lisp library are (1) 968@code{eval-after-load}. If you need to examine and set the variables
960examine and set the library's variables (those which are meant for 969defined in another library (those meant for outside use), you can do
961outside use), and (2) call the library's functions. If you wish to 970it immediately---there is no need to wait until the library is loaded.
962do (1), you can do it immediately---there is no need to wait for when 971If you need to call functions defined by that library, you should load
963the library is loaded. To do (2), you must load the library (preferably 972the library, preferably with @code{require} (@pxref{Named Features}).
964with @code{require}).
965 973
966But it is OK to use @code{eval-after-load} in your personal 974But it is OK to use @code{eval-after-load} in your personal
967customizations if you don't feel they must meet the design standards for 975customizations if you don't feel that they must meet the design
968programs meant for wider use. 976standards for programs meant for wider use.
969 977
970@defvar after-load-alist 978@defvar after-load-alist
971This variable, an alist built by @code{eval-after-load}, holds the 979This variable stores an alist built by @code{eval-after-load},
972expressions to evaluate when particular libraries are loaded. Each 980containing the expressions to evaluate when certain libraries are
973element looks like this: 981loaded. Each element looks like this:
974 982
975@example 983@example
976(@var{regexp-or-feature} @var{forms}@dots{}) 984(@var{regexp-or-feature} @var{forms}@dots{})
977@end example 985@end example
978 986
979The key @var{regexp-or-feature} is either a regular expression or a 987The key @var{regexp-or-feature} is either a regular expression or a
980symbol, and the value is a list of forms. The forms are evaluated when 988symbol, and the value is a list of forms. The forms are evaluated
981the key matches the absolute true name of the file being 989when the key matches the absolute true name or feature name of the
982@code{load}ed or the symbol being @code{provide}d. 990library being loaded.
983@end defvar 991@end defvar
984 992
985@ignore 993@ignore