# HG changeset patch # User Kenichi Handa # Date 1269935286 -32400 # Node ID debd2dae3330224f922a0375f7489cc402c9fb2d # Parent 3e1f021606dbfebdf2d27a4897a5492d947c7a51# Parent 5860ffa0c5d9ef6b7fddd784d06f7c3555e02e0c merge trunk diff -r 3e1f021606db -r debd2dae3330 doc/emacs/ChangeLog --- a/doc/emacs/ChangeLog Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/ChangeLog Tue Mar 30 16:48:06 2010 +0900 @@ -1,3 +1,59 @@ +2010-03-28 Chong Yidong + + * sending.texi (Sending Mail): Note variables that may need + customizing. + (Mail Sending): Expand discussion of send-mail-function. + +2010-03-28 Chong Yidong + + Document Message mode as the default mail mode. + + * sending.texi (Sending Mail): Copyedits. + (Mail Format, Mail Headers): Document mail-from-style changes. + (Mail Commands): Rename from Mail mode. Document Message mode. + (Mail Misc): Rename from Mail mode Misc. + (Mail Sending, Header Editing, Mail Misc): Switch to Message mode + command names and update keybindings. + (Header Editing): Document message-tab. De-document + mail-self-blind, mail-default-reply-to, and mail-archive-file-name in + favor of mail-default-headers. Ad index entries for user-full-name and + user-mail-address. + (Citing Mail): Update changes in Message mode behavior. Document + mail-yank-prefix. + (Mail Signature): New node, moved from Mail Misc. + (Mail Aliases): Mail abbrevs are the default with Message mode. + (Mail Methods): Note that Message mode is now the default. + + * rmail.texi (Rmail Reply): + * text.texi (Text Mode): + * major.texi (Major Modes): + * mule.texi (Output Coding): Refer to Message mode. + + * custom.texi (Init Examples): Add xref to Mail Header. + + * emacs.texi (Top): Fix xrefs. + +2010-03-25 Chong Yidong + + * maintaining.texi (VC With A Merging VCS): C-x v v now creates a + repository if there is none. + (VC Change Log): Rename from VC Status. Document vc-log-show-limit and + vc-print-root-log. + (Old Revisions): Copyedits. Document vc-root-diff. + + * programs.texi (Program Modes): Mention Javascript mode. + + * text.texi (HTML Mode): Note that nXML is now the default XML mode. + * emacs.texi: Update node description. + + * misc.texi (Navigation): Document doc-view-continuous. + (Shell Ring): Document new M-r binding. M-s is no longer bound. + +2010-03-24 Glenn Morris + + * ack.texi (Acknowledgments): + * emacs.texi (Acknowledgments): Fix ispell attribution. (Bug#5759) + 2010-03-20 Jan Djärv * xresources.texi (Table of Resources): Clarify toolBar number @@ -25,7 +81,6 @@ * xresources.texi (Table of Resources): * mule.texi (Defining Fontsets, Charsets): Update xrefs. ->>>>>>> MERGE-SOURCE 2010-03-06 Chong Yidong * custom.texi (Init Examples): Add xref to Locals. diff -r 3e1f021606db -r debd2dae3330 doc/emacs/ack.texi --- a/doc/emacs/ack.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/ack.texi Tue Mar 30 16:48:06 2010 +0900 @@ -1,6 +1,7 @@ @c This is part of the Emacs manual. @c Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, -@c 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. +@c 2004, 2005, 2006, 2007, 2008, 2009, 2010 +@c Free Software Foundation, Inc. @c See file emacs.texi for copying conditions. @c @node Acknowledgments, Screen, Concept Index, Top @@ -600,8 +601,7 @@ program. @item -Geoff Kuenning and Ken Stevens wrote @file{ispell.el}, a spell-checker -interface. +Ken Stevens wrote @file{ispell.el}, a spell-checker interface. @item David K@ringaccent{a}gedal wrote @file{tempo.el}, providing support for diff -r 3e1f021606db -r debd2dae3330 doc/emacs/custom.texi --- a/doc/emacs/custom.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/custom.texi Tue Mar 30 16:48:06 2010 +0900 @@ -2269,8 +2269,9 @@ (setq user-mail-address "cheney@@torture.gov") @end example -Various Emacs packages that need your own email address use the value of -@code{user-mail-address}. +Various Emacs packages, such as Message mode, consult +@code{user-mail-address} when they need to know your email address. +@xref{Mail Headers}. @item Make Text mode the default mode for new buffers. diff -r 3e1f021606db -r debd2dae3330 doc/emacs/emacs.texi --- a/doc/emacs/emacs.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/emacs.texi Tue Mar 30 16:48:06 2010 +0900 @@ -12,8 +12,8 @@ updated for Emacs version @value{EMACSVER}. Copyright @copyright{} 1985, 1986, 1987, 1993, 1994, 1995, 1996, 1997, -1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 -Free Software Foundation, Inc. +1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, +2010 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -574,7 +574,7 @@ * Text Mode:: The major modes for editing text files. * Outline Mode:: Editing outlines. * TeX Mode:: Editing input to the formatter TeX. -* HTML Mode:: Editing HTML, SGML, and XML files. +* HTML Mode:: Editing HTML and SGML files. * Nroff Mode:: Editing input to the formatter nroff. * Formatted Text:: Editing formatted text directly in WYSIWYG fashion. * Text Based Tables:: Editing text-based tables in WYSIWYG fashion. @@ -794,7 +794,7 @@ The Secondary Commands of VC * Registering:: Putting a file under version control. -* VC Status:: Viewing the VC status of files. +* VC Change Log:: Viewing the VC Change Log. * VC Undo:: Canceling changes before or after check-in. VC Directory Mode @@ -886,16 +886,17 @@ * Mail Format:: Format of the mail being composed. * Mail Headers:: Details of some standard mail header fields. * Mail Aliases:: Abbreviating and grouping mail addresses. -* Mail Mode:: Special commands for editing mail being composed. +* Mail Commands:: Special commands for editing mail being composed. +* Mail Signature:: Adding a signature to every message. * Mail Amusements:: Distracting the NSA; adding fortune messages. * Mail Methods:: Using alternative mail-composition methods. -Mail Mode +Mail Commands * Mail Sending:: Commands to send the message. * Header Editing:: Commands to move to header fields and edit them. -* Citing Mail:: Copying all or part of a message you are replying to. -* Mail Mode Misc:: Spell checking, signatures, etc. +* Citing Mail:: Quoting a message you are replying to. +* Mail Misc:: Attachments, spell checking, etc. Reading Mail with Rmail @@ -1372,8 +1373,8 @@ Henry Kautz, Taichi Kawabata, Howard Kaye, Michael Kifer, Richard King, Peter Kleiweg, Shuhei Kobayashi, Pavel Kobiakov, Larry K.@: Kolodney, David M.@: Koppelman, Koseki Yoshinori, Robert Krawitz, Sebastian -Kremer, Ryszard Kubiak, Geoff Kuenning, David K@aa{}gedal, Daniel -LaLiberte, Karl Landstrom, Mario Lang, Aaron Larson, James R.@: Larus, +Kremer, Ryszard Kubiak, David K@aa{}gedal, Daniel LaLiberte, +Karl Landstrom, Mario Lang, Aaron Larson, James R.@: Larus, Vinicius Jose Latorre, Werner Lemberg, Frederic Lepied, Peter Liljenberg, Lars Lindberg, Chris Lindblad, Anders Lindgren, Thomas Link, Juri Linkov, Francis Litterio, Emilio C. Lopes, K@'{a}roly L@H{o}rentey, diff -r 3e1f021606db -r debd2dae3330 doc/emacs/maintaining.texi --- a/doc/emacs/maintaining.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/maintaining.texi Tue Mar 30 16:48:06 2010 +0900 @@ -224,7 +224,7 @@ @cindex revision @cindex revision ID A copy of a file stored in a repository is called a @dfn{revision}. -The history of a file is a sequence of revisions. Each revisions is +The history of a file is a sequence of revisions. Each revision is named by a @dfn{revision ID}. The format of the revision ID depends on the version control system; in the simplest case, it is just an integer. @@ -403,10 +403,10 @@ consists of the marked files (@pxref{VC Directory Mode}). The principal VC command is an all-purpose command, @kbd{C-x v v} -(@code{vc-next-action}), that performs either locking, merging or a -check-in (depending on the situation) on the current VC fileset. You -can use @kbd{C-x v v} in a file-visiting buffer or in a VC Directory -buffer. +(@code{vc-next-action}), that performs either registration, locking, +merging or a check-in (depending on the situation) on the current VC +fileset. You can use @kbd{C-x v v} in a file-visiting buffer or in a +VC Directory buffer. @table @kbd @itemx C-x v v @@ -461,23 +461,31 @@ @itemize @bullet @item -If the work file is the same as in the repository, it does nothing. +If the work file is in a directory that is not controlled by any +version control system, prompt for a repository type. Then, create a +version control repository of that type and register the file with it. + +@item +If the work file is in a directory that is controlled by a version +control system but not registered with it, register the file. + +@item +If the work file is the same as in the repository, do nothing. @item If you have not changed the work file, but some other user has checked -in changes to the repository, @kbd{C-x v v} merges those changes into -the work file. +in changes to the repository, merge those changes into the work file. @item -If you have made modifications to the work file, @kbd{C-x v v} -attempts to check in your changes. To do this, Emacs first reads the -log entry for the new revision (@pxref{Log Buffer}). If some other -user has checked in changes to the repository since you last checked -it out, the checkin fails. In that case, type @kbd{C-x v v} again to -merge those changes into your own work file; this puts the work file -into a ``conflicted'' state. Type @kbd{C-x v v} to clear the -``conflicted'' state; VC then regards the file as up-to-date and -modified, and you can try to check it in again. +If you have made modifications to the work file, attempts to check in +your changes. To do this, Emacs first reads the log entry for the new +revision (@pxref{Log Buffer}). If some other user has checked in +changes to the repository since you last checked it out, the checkin +fails. In that case, type @kbd{C-x v v} again to merge those changes +into your own work file; this puts the work file into a ``conflicted'' +state. Type @kbd{C-x v v} to clear the ``conflicted'' state; VC then +regards the file as up-to-date and modified, and you can try to check +it in again. To pick up any recent changes from the repository @emph{without} trying to commit your own changes, type @kbd{C-x v m @key{RET}}. @@ -485,15 +493,15 @@ @end itemize These rules also apply when you use RCS in its ``non-locking'' mode, -except that changes will not be automatically merged from the -repository. Nothing informs you if another user has checked in -changes in the same file since you began editing it; when you check in -your revision, his changes are removed (however, they remain in the -repository and are thus not irrevocably lost). Therefore, you must -verify that the current revision is unchanged before checking in your -changes. In addition, locking is possible with RCS even in this mode: -@kbd{C-x v v} with an unmodified file locks the file, just as it does -with RCS in its normal locking mode (@pxref{VC With A Locking VCS}). +except that changes are not automatically merged from the repository. +Nothing informs you if another user has checked in changes in the same +file since you began editing it; when you check in your revision, his +changes are removed (however, they remain in the repository and are +thus not irrevocably lost). Therefore, you must verify that the +current revision is unchanged before checking in your changes. In +addition, locking is possible with RCS even in this mode: @kbd{C-x v +v} with an unmodified file locks the file, just as it does with RCS in +its normal locking mode (@pxref{VC With A Locking VCS}). @node VC With A Locking VCS @subsubsection Basic Version Control with Locking @@ -501,26 +509,25 @@ Under a locking-based version control system (such as SCCS, and RCS in its default mode), @kbd{C-x v v} does the following: - @itemize @bullet +@itemize @bullet @item -If the file is not locked, @kbd{C-x v v} locks it, and makes it -writable so that you can change it. +If the file is not locked, lock it and make it writable, so that you +can change it. @item -If the file is locked by you, and contains changes, @kbd{C-x v v} -checks in the changes. In order to do this, it first reads the log -entry for the new revision. @xref{Log Buffer}. +If the file is locked by you, and contains changes, check in the +changes. In order to do this, Emacs first reads the log entry for the +new revision. @xref{Log Buffer}. @item If the file is locked by you, but you have not changed it since you -locked it, @kbd{C-x v v} releases the lock and makes the file -read-only again. +locked it, release the lock and makes the file read-only again. @item -If the file is locked by some other user, @kbd{C-x v v} asks you whether -you want to ``steal the lock'' from that user. If you say yes, the file -becomes locked by you, but a message is sent to the person who had -formerly locked the file, to inform him of what has happened. +If the file is locked by some other user, ask whether you want to +``steal the lock'' from that user. If you say yes, the file becomes +locked by you, but a message is sent to the person who had formerly +locked the file, to inform him of what has happened. @end itemize These rules also apply when you use CVS in locking mode, except @@ -639,20 +646,23 @@ to examine any revision of a file, or compare two revisions. @table @kbd -@item C-x v ~ @var{revision} @key{RET} -Examine revision @var{revision} of the visited file, in a buffer of its -own. +@item C-x v ~ +Prompt for a revision of the current file, and visit it in a buffer of +its own (@code{vc-revision-other-window}). @item C-x v = -Compare the buffer contents associated with the current -fileset with the working revision(s) from which you started editing. +Compare the files in the current fileset with the working revision(s) +you started from (@code{vc-diff}). With a prefix argument, prompt for +two revisions of the current fileset and compare them. -@item C-u C-x v = @key{RET} @var{oldvers} @key{RET} @var{newvers} @key{RET} -Compare the specified two repository revisions of the current fileset. +@item C-x v D +Compare the entire tree corresponding to the current fileset with the +tree you started from (@code{vc-root-diff}). With a prefix argument, +prompt for two revisions and compare their trees. @item C-x v g Display an annotated version of the file: for each line, show the -latest revision in which it was modified. +latest revision in which it was modified (@code{vc-annotate}). @end table @findex vc-revision-other-window @@ -673,12 +683,11 @@ @findex vc-diff @kindex C-x v = - @kbd{C-x v =} (@code{vc-diff}) compares the current buffer contents -of each file in the current VC fileset (saving them if necessary) with -the repository revision from which you started editing. Note that the -latter may or may not be the latest revision of the file(s). The diff -is displayed in a special buffer in another window. @xref{Comparing -Files}. + @kbd{C-x v =} (@code{vc-diff}) compares each file in the current VC +fileset (saving them if necessary) with the repository revision(s) +from which you started editing. Note that the latter may or may not +be the latest revision of the file(s). The diff is displayed in a +special buffer in another window. @xref{Comparing Files}. @findex vc-diff @kindex C-u C-x v = @@ -700,6 +709,12 @@ name) is unlikely to return diffs that are connected in any meaningful way. + The command @kbd{C-x v D} (@code{vc-root-diff}) is similar to +@kbd{C-x v =}, but it compares the entire tree associated with the +current VC fileset with the tree you started with. This means all the +files controlled by the current version control repository, even those +that are not part of the current VC fileset. + If you invoke @kbd{C-x v =} or @kbd{C-u C-x v =} from a buffer that is neither visiting a version-controlled file nor a VC directory buffer, these commands generate a diff of all registered files in the @@ -801,7 +816,7 @@ @menu * Registering:: Putting a file under version control. -* VC Status:: Viewing the VC status of files. +* VC Change Log:: Viewing the VC Change Log. * VC Undo:: Canceling changes before or after check-in. @end menu @@ -857,22 +872,36 @@ initial comment to describe the purpose of this source file. Reading the initial comment works like reading a log entry (@pxref{Log Buffer}). -@node VC Status -@subsubsection VC Status Commands +@node VC Change Log +@subsubsection VC Change Log @table @kbd @item C-x v l -Display revision control state and change history. +Display revision control state and change history +(@code{vc-print-log}). + +@item C-x v L +Display the change history for the current repository +(@code{vc-print-root-log}). @end table @kindex C-x v l @findex vc-print-log - To view the detailed revision control status and history of a file, -type @kbd{C-x v l} (@code{vc-print-log}). This pops up a special -buffer named @samp{*vc-change-log*}, in a new window, that displays -the history of changes to the current file, including the text of the -log entries. The point is centered at the revision of the file that -is currently being visited. + The command @kbd{C-x v l} (@code{vc-print-log}) displays a buffer +named @samp{*vc-change-log*} in a new window. This buffer lists the +changes to the current file, including the associated log entries. +(These are the log entries associated with the version control system, +i.e. the ones you enter via the @samp{*VC-Log*} buffer. @xref{Log +Buffer}.) Point is centered at the revision of the file currently +being visited. With a prefix argument, the command prompts for the +revision to center on, and the maximum number of revisions to display. + +@findex vc-print-root-log + Type @kbd{C-x v L} (@code{vc-print-root-log}) to display a +@samp{*vc-change-log*} buffer showing the history of the +version-controlled directory tree as a whole. With a prefix argument, +the command prompts for the maximum number of revisions to display. +RCS, SCCS, and CVS do not support this feature. In the @samp{*vc-change-log*} buffer, you can use the following keys to move between the logs of revisions and of files, to view past @@ -926,6 +955,16 @@ indicated on the current line did when it was committed. @end table +@vindex vc-log-show-limit +Because fetching many log entries can be slow, the +@samp{*vc-change-log*} buffer displays no more than 2000 revisions by +default. The variable @code{vc-log-show-limit} specifies this limit; +if you set the value to zero, that removes the limit. You can also +increase the number of revisions shown in an existing +@samp{*vc-change-log*} buffer by clicking on the @samp{Show 2X +entries} or @samp{Show unlimited entries} buttons at the end of the +buffer. However, RCS, SCCS, and CVS do not support this feature. + @node VC Undo @subsubsection Undoing Version Control Actions diff -r 3e1f021606db -r debd2dae3330 doc/emacs/major.texi --- a/doc/emacs/major.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/major.texi Tue Mar 30 16:48:06 2010 +0900 @@ -41,7 +41,7 @@ mode, Fortran mode, and others. The remaining major modes are not intended for use on users' files; they are used in buffers created for specific purposes by Emacs, such as Dired mode for buffers made by -Dired (@pxref{Dired}), Mail mode for buffers made by @kbd{C-x m} +Dired (@pxref{Dired}), Message mode for buffers made by @kbd{C-x m} (@pxref{Sending Mail}), and Shell mode for buffers used for communicating with an inferior shell process (@pxref{Interactive Shell}). diff -r 3e1f021606db -r debd2dae3330 doc/emacs/misc.texi --- a/doc/emacs/misc.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/misc.texi Tue Mar 30 16:48:06 2010 +0900 @@ -84,11 +84,20 @@ Emacs movement keys: @kbd{C-p}, @kbd{C-n}, @kbd{C-b}, @kbd{C-f}, and the arrow keys. +@vindex doc-view-continuous + By default, the line-motion keys @kbd{C-p} and @kbd{C-n} stop +scrolling at the beginning and end of the current page, respectively. +However, if you change the variable @code{doc-view-continuous} to a +non-@code{nil} value, then @kbd{C-p} displays the previous page if you +are already at the beginning of the current page, and @kbd{C-n} +displays the next page if you are at the end of the current page. + @findex doc-view-next-page @findex doc-view-previous-page - To display the next page, type @kbd{n}, @key{next} or @kbd{C-x ]} -(@code{doc-view-next-page}). To display the previous page, type -@kbd{p}, @key{prior} or @kbd{C-x [} (@code{doc-view-previous-page}). + You can also display the next page by typing @kbd{n}, @key{next} or +@kbd{C-x ]} (@code{doc-view-next-page}). To display the previous +page, type @kbd{p}, @key{prior} or @kbd{C-x [} +(@code{doc-view-previous-page}). @findex doc-view-scroll-up-or-next-page @findex doc-view-scroll-down-or-previous-page @@ -957,12 +966,9 @@ Fetch the next later old shell command. @kindex M-r @r{(Shell mode)} -@kindex M-s @r{(Shell mode)} -@findex comint-previous-matching-input -@findex comint-next-matching-input -@item M-r @var{regexp} @key{RET} -@itemx M-s @var{regexp} @key{RET} -Search backwards or forwards for old shell commands that match @var{regexp}. +@findex comint-history-isearch-backward-regexp +@item M-r +Begin an incremental regexp search of old shell commands. @item C-c C-x @kindex C-c C-x @r{(Shell mode)} @@ -995,15 +1001,15 @@ @kbd{C-@key{UP}} works like @kbd{M-p}, and @kbd{C-@key{DOWN}} like @kbd{M-n}. - The history search commands @kbd{M-r} and @kbd{M-s} read a regular -expression and search through the history for a matching command. Aside -from the choice of which command to fetch, they work just like @kbd{M-p} -and @kbd{M-n}. If you enter an empty regexp, these commands reuse the -same regexp used last time. - - When you find the previous input you want, you can resubmit it by -typing @key{RET}, or you can edit it first and then resubmit it if you -wish. Any partial input you were composing before navigating the + The history search command @kbd{M-r} begins an incremental regular +expression search of previous shell commands. After typing @kbd{M-r}, +start typing the desired string or regular expression; the last +matching shell command will be displayed in the current line. +Incremental search commands have their usual effects---for instance, +@kbd{C-s} and @kbd{C-r} search forward and backward for the next match +(@pxref{Incremental Search}). When you find the desired input, type +@key{RET} to terminate the search. This puts the input in the command +line. Any partial input you were composing before navigating the history list is restored when you go to the beginning or end of the history ring. diff -r 3e1f021606db -r debd2dae3330 doc/emacs/mule.texi --- a/doc/emacs/mule.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/mule.texi Tue Mar 30 16:48:06 2010 +0900 @@ -961,15 +961,16 @@ to the question.) @vindex sendmail-coding-system - When you send a message with Mail mode (@pxref{Sending Mail}), Emacs has -four different ways to determine the coding system to use for encoding -the message text. It tries the buffer's own value of -@code{buffer-file-coding-system}, if that is non-@code{nil}. Otherwise, -it uses the value of @code{sendmail-coding-system}, if that is -non-@code{nil}. The third way is to use the default coding system for -new files, which is controlled by your choice of language environment, -if that is non-@code{nil}. If all of these three values are @code{nil}, -Emacs encodes outgoing mail using the Latin-1 coding system. + When you send a message with Message mode (@pxref{Sending Mail}), +Emacs has four different ways to determine the coding system to use +for encoding the message text. It tries the buffer's own value of +@code{buffer-file-coding-system}, if that is non-@code{nil}. +Otherwise, it uses the value of @code{sendmail-coding-system}, if that +is non-@code{nil}. The third way is to use the default coding system +for new files, which is controlled by your choice of language +environment, if that is non-@code{nil}. If all of these three values +are @code{nil}, Emacs encodes outgoing mail using the Latin-1 coding +system. @node Text Coding @section Specifying a Coding System for File Text diff -r 3e1f021606db -r debd2dae3330 doc/emacs/programs.texi --- a/doc/emacs/programs.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/programs.texi Tue Mar 30 16:48:06 2010 +0900 @@ -88,11 +88,12 @@ @cindex PostScript mode @cindex Conf mode @cindex DNS mode +@cindex Javascript mode The existing programming language major modes include Lisp, Scheme (a variant of Lisp) and the Scheme-based DSSSL expression language, Ada, ASM, AWK, C, C++, Delphi (Object Pascal), Fortran, Icon, IDL -(CORBA), IDLWAVE, Java, Metafont (@TeX{}'s companion for font -creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike, +(CORBA), IDLWAVE, Java, Javascript, Metafont (@TeX{}'s companion for +font creation), Modula2, Objective-C, Octave, Pascal, Perl, Pike, PostScript, Prolog, Python, Ruby, Simula, Tcl, and VHDL. An alternative mode for Perl is called CPerl mode. Modes are available for the scripting languages of the common GNU and Unix shells, VMS diff -r 3e1f021606db -r debd2dae3330 doc/emacs/rmail.texi --- a/doc/emacs/rmail.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/rmail.texi Tue Mar 30 16:48:06 2010 +0900 @@ -683,12 +683,12 @@ @node Rmail Reply @section Sending Replies - Rmail has several commands that use Mail mode to send outgoing mail. -@xref{Sending Mail}, for information on using Mail mode, including -certain features meant to work with Rmail. What this section documents -are the special commands of Rmail for entering Mail mode. Note that the -usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and @kbd{C-x 5 -m}---also work normally in Rmail mode. + Rmail has several commands to send outgoing mail. @xref{Sending +Mail}, for information on using Message mode, including certain +features meant to work with Rmail. What this section documents are +the special commands of Rmail for entering the mail buffer. Note that +the usual keys for sending mail---@kbd{C-x m}, @kbd{C-x 4 m}, and +@kbd{C-x 5 m}---also work normally in Rmail mode. @table @kbd @item m @@ -735,12 +735,12 @@ This means to reply only to the sender of the original message. Once the @samp{*mail*} buffer has been initialized, editing and -sending the mail goes as usual (@pxref{Sending Mail}). You can edit the -presupplied header fields if they are not what you want. You can also -use the commands of Mail mode (@pxref{Mail Mode}), including @kbd{C-c -C-y} which yanks in the message that you are replying to. You can -also switch to the Rmail buffer, select a different message there, switch -back, and yank the new current message. +sending the mail goes as usual (@pxref{Sending Mail}). You can edit +the presupplied header fields if they are not what you want. You can +also use commands such as @kbd{C-c C-y}, which yanks in the message +that you are replying to (@pxref{Mail Commands}). You can also switch +to the Rmail buffer, select a different message there, switch back, +and yank the new current message. @kindex M-m @r{(Rmail)} @findex rmail-retry-failure diff -r 3e1f021606db -r debd2dae3330 doc/emacs/sending.texi --- a/doc/emacs/sending.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/sending.texi Tue Mar 30 16:48:06 2010 +0900 @@ -6,120 +6,110 @@ @chapter Sending Mail @cindex sending mail @cindex mail +@cindex email @cindex message - To send a message in Emacs, you start by typing a command (@kbd{C-x m}) -to select and initialize the @samp{*mail*} buffer. Then you edit the text -and headers of the message in this buffer, and type another command -(@kbd{C-c C-s} or @kbd{C-c C-c}) to send the message. +@kindex C-x m +@findex compose-mail + To send an @dfn{e-mail} message in Emacs, type @kbd{C-x m}. This +selects and initializes a buffer named @samp{*mail*}, where you can +edit the text and headers of the message. Finally, type @kbd{C-c C-s} +or @kbd{C-c C-c} to send the message. @table @kbd @item C-x m -Begin composing a message to send (@code{compose-mail}). +Begin composing mail (@code{compose-mail}). @item C-x 4 m -Likewise, but display the message in another window -(@code{compose-mail-other-window}). +Likewise, in another window (@code{compose-mail-other-window}). @item C-x 5 m -Likewise, but make a new frame (@code{compose-mail-other-frame}). +Likewise, but in a new frame (@code{compose-mail-other-frame}). @item C-c C-s -In Mail mode, send the message (@code{mail-send}). +In the mail buffer, send the message (@code{message-send}). @item C-c C-c -Send the message and bury the mail buffer (@code{mail-send-and-exit}). +In the mail buffer, send the message and bury the buffer +(@code{message-send-and-exit}). @end table -@kindex C-x m -@findex compose-mail @kindex C-x 4 m @findex compose-mail-other-window @kindex C-x 5 m @findex compose-mail-other-frame - The command @kbd{C-x m} (@code{compose-mail}) selects a buffer named -@samp{*mail*} and initializes it with the skeleton of an outgoing -message. @kbd{C-x 4 m} (@code{compose-mail-other-window}) selects the -@samp{*mail*} buffer in a different window, leaving the previous current -buffer visible. @kbd{C-x 5 m} (@code{compose-mail-other-frame}) creates -a new frame to select the @samp{*mail*} buffer. - - Because the mail-composition buffer is an ordinary Emacs buffer, you can -switch to other buffers while in the middle of composing mail, and switch -back later (or never). If you use the @kbd{C-x m} command again when you -have been composing another message but have not sent it, you are asked to -confirm before the old message is erased. If you answer @kbd{n}, the -@samp{*mail*} buffer remains selected with its old contents, so you can -finish the old message and send it. @kbd{C-u C-x m} is another way to do -this. Sending the message marks the @samp{*mail*} buffer ``unmodified,'' -which avoids the need for confirmation when @kbd{C-x m} is next used. +@noindent +The command @kbd{C-x 4 m} (@code{compose-mail-other-window}) does the +same as @kbd{C-x m}, except it displays the mail buffer in a different +window. The command @kbd{C-x 5 m} (@code{compose-mail-other-frame}) +creates a new frame for the mail buffer. - If you are composing a message in the @samp{*mail*} buffer and want to -send another message before finishing the first, rename the -@samp{*mail*} buffer using @kbd{M-x rename-uniquely} (@pxref{Misc -Buffer}). Then you can use @kbd{C-x m} or its variants described above -to make a new @samp{*mail*} buffer. Once you've done that, you can work -with each mail buffer independently. - -@vindex mail-default-directory - The variable @code{mail-default-directory} controls the default -directory for mail buffers, and also says where to put their auto-save -files. + Because the mail buffer is an ordinary Emacs buffer, you can switch +to other buffers while in the middle of composing mail, and switch +back later (or never). If you type @kbd{C-x m} again when you have +been composing another message but have not sent it, Emacs asks for +confirmation before erasing the old message. If you answer @kbd{n}, +Emacs selects the mail buffer with its old contents, so you can finish +the old message and send it. @kbd{C-u C-x m} is another way to do +this. Sending the message marks the mail buffer ``unmodified,'' which +avoids the need for confirmation when @kbd{C-x m} is next used. -@c Not mentioned: mail-bury-selects-summary. Really an Rmail feature. + If you want to send another message before finishing the current +message, use the command @kbd{M-x rename-uniquely} to rename the +current mail buffer (@pxref{Misc Buffer}). Then you can use @kbd{C-x +m} to make a new mail buffer, and work with each mail buffer +independently. -@ignore -@c Commented out because it is not user-oriented; -@c it doesn't say how to do some job. -- rms. -@cindex directory servers -@cindex LDAP -@cindex PH/QI -@cindex names and addresses -There is an interface to directory servers using various protocols such -as LDAP or the CCSO white pages directory system (PH/QI), described in a -separate manual. It may be useful for looking up names and addresses. -@xref{Top,,EUDC, eudc, EUDC Manual}. -@end ignore + Before using Emacs to send mail, you may need to customize the +variable @code{send-mail-function} if your system is not set up to +deliver mail directly via SMTP (@pxref{Mail Sending}). In addition, +you may need to customize @code{user-mail-address} if the system +cannot receive mail via SMTP (@pxref{Mail Headers}). @menu -* Format: Mail Format. Format of the mail being composed. -* Headers: Mail Headers. Details of some standard mail header fields. -* Aliases: Mail Aliases. Abbreviating and grouping mail addresses. -* Mode: Mail Mode. Special commands for editing mail being composed. -* Amuse: Mail Amusements. Distracting the NSA; adding fortune messages. -* Methods: Mail Methods. Using alternative mail-composition methods. +* Format: Mail Format. Format of a mail message. +* Headers: Mail Headers. Details of some standard mail header fields. +* Aliases: Mail Aliases. Abbreviating and grouping mail addresses. +* Commands: Mail Commands. Special commands for editing mail being composed. +* Signature: Mail Signature. Adding a signature to every message. +* Amuse: Mail Amusements. Distracting the NSA; adding fortune messages. +* Methods: Mail Methods. Using alternative mail-composition methods. @end menu @node Mail Format @section The Format of the Mail Buffer - In addition to the @dfn{text} or @dfn{body}, a message has @dfn{header -fields} which say who sent it, when, to whom, why, and so on. Some -header fields, such as @samp{Date} and @samp{Message-Id}, are created -automatically when you send the message. Others, such as the recipient -names, must be specified by you in order to send the message properly. + An email message must contain certain pieces of information, called +@dfn{headers}, which specify the message's sender, recipient(s), and +so on. - In the mail buffer, you can insert and edit header fields using -ordinary editing commands. Mail mode provides commands to help you -edit some header fields, and some are automatically preinitialized in -the buffer, when appropriate. + At the top of the mail buffer is a set of @dfn{header fields}, where +you can enter this information. You can insert and edit header fields +using ordinary editing commands. @xref{Header Editing}, for commands +specific to editing header fields. + + Some header fields are automatically pre-initialized in the buffer, +when appropriate; other headers, such as @samp{Date} and +@samp{Message-Id}, are normally omitted from the mail buffer and +created automatically when the message is sent. @vindex mail-header-separator The line in the buffer that says -@example +@smallexample --text follows this line-- -@end example +@end smallexample @noindent -is a special delimiter that separates the headers you have specified from -the text. Whatever follows this line is the text of the message; the -headers precede it. The delimiter line itself does not appear in the -message actually sent. The text used for the delimiter line is controlled -by the variable @code{mail-header-separator}. +separates the header fields from the @dfn{body} (or @dfn{text}) of the +message. Everything above this line is treated as part of the +headers; everything below it is treated as the body. The delimiter +line itself does not appear in the message actually sent. The text +used for the delimiter line is controlled by the variable +@code{mail-header-separator}. Here is an example of what the headers and text in the mail buffer might look like. @example -To: gnu@@gnu.org -CC: lungfish@@spam.org, byob@@spam.org +To: gnu@@example.org +CC: lungfish@@example.com, byob@@example.net Subject: The Emacs Manual --text follows this line-- Please ignore this message. @@ -134,85 +124,51 @@ equivalent in field names (and in mailing addresses also). After the colon and optional whitespace comes the contents of the field. - You can use any name you like for a header field, but normally people -use only standard field names with accepted meanings. Here is a table -of fields commonly used in outgoing messages. Emacs preinitializes some -of these when you start to compose a mail, depending on various options -you can set. You can delete or alter any header field before you send -the message, if you wish. + You can use any name you like for a header field, but normally +people use only standard field names with accepted meanings. Here is +a table of commonly-used fields. Emacs pre-initializes some of these, +depending on various options you can set. You can delete or alter any +header field before you send the message, if you wish. @table @samp +@item From +@vindex user-mail-address +The address of the sender (you). This should be a valid mailing +address, as replies will normally go there. Emacs initializes this +field using the variables @code{user-full-name} and +@code{user-mail-address}; see below. + @item To -This field contains the mailing addresses to which the message is -addressed. If you list more than one address, use commas, not spaces, -to separate them. +The mailing address(es) to which the message is addressed. To list +more than one address, use commas (not spaces) to separate them. @item Subject -The contents of the @samp{Subject} field should be a piece of text -that says what the message is about. The reason @samp{Subject} fields -are useful is that most mail-reading programs can provide a summary of -messages, listing the subject of each message but not its text. +A piece of text saying what the message is about. Most mail-reading +programs can display a summary of messages, listing the subject of +each message but not its text. @item CC -This field contains additional mailing addresses to send the message to, -like @samp{To} except that these readers should not regard the message -as directed at them. +Additional mailing address(es) to send the message to. This is like +@samp{To}, except that these readers should not regard the message as +directed at them. @item BCC -This field contains additional mailing addresses to send the message to, -which should not appear in the header of the message actually sent. -Copies sent this way are called @dfn{blind carbon copies}. - -@vindex mail-self-blind -@cindex copy of every outgoing message -To send a blind carbon copy of every outgoing message to yourself, set -the variable @code{mail-self-blind} to @code{t}. To send a blind carbon -copy of every message to some other @var{address}, set the variable -@code{mail-default-headers} to @code{"Bcc: @var{address}\n"}. +Additional mailing address(es) to send the message to, which should +not appear in the header of the message actually sent. ``BCC'' stands +for @dfn{blind carbon copies}. @item FCC -This field contains the name of one file and directs Emacs to append a -copy of the message to that file when you send the message. Emacs -writes the message in mbox format, unless the file is in Babyl format -(used by Rmail before Emacs 23), in which case Emacs writes Babyl. If -an Rmail buffer is visiting the file, Emacs updates it accordingly. -To specify more than one file, use several @samp{FCC} fields, with one -file name in each field. - -@vindex mail-archive-file-name -To put a fixed file name in the @samp{FCC} field each time you start -editing an outgoing message, set the variable -@code{mail-archive-file-name} to that file name. Unless you remove the -@samp{FCC} field before sending, the message will be written into that -file when it is sent. - -@item From -Use the @samp{From} field to say who you are. You might need to change -this if the account you are using to send the mail is not your own. The -contents of the @samp{From} field should be a valid mailing address, -since replies will normally go there. - -@vindex mail-setup-with-from -Emacs initializes this field (unless the variable -@code{mail-setup-with-from} is @code{nil}) using -@code{user-mail-address} as the default. If there is no @samp{From} -field when you send a mail, Emacs adds one. +The name of one file, to which a copy of the sent message should be +appended. Emacs writes the message in mbox format, unless the file is +in Babyl format (used by Rmail before Emacs 23), in which case Emacs +writes Babyl. If an Rmail buffer is visiting the file, Emacs updates +it accordingly. To specify more than one file, use several @samp{FCC} +fields, with one file name in each field. @item Reply-to -Use this field to direct replies to a different address. Most -mail-reading programs (including Rmail) automatically send replies to -the @samp{Reply-to} address in preference to the @samp{From} address. -By adding a @samp{Reply-to} field to your header, you can work around -any problems your @samp{From} address may cause for replies. - -@cindex @env{REPLYTO} environment variable -@vindex mail-default-reply-to -To put a fixed @samp{Reply-to} address into every outgoing message, set -the variable @code{mail-default-reply-to} to that address (as a string). -Then Emacs initializes the message with a @samp{Reply-to} field as -specified. When you first compose a mail, if -@code{mail-default-reply-to} is @code{nil}, Emacs initializes it from the -environment variable @env{REPLYTO}. +An address to which replies should be sent, instead of @samp{From}. +You can use this header if, for some reason, your @samp{From} address +is unable to receive replies. @item Mail-reply-to This field takes precedence over @samp{Reply-to}. It is used because @@ -225,70 +181,88 @@ It usually indicates that you want replies to go to the list, and that you do not need an extra copy sent directly to you. -@vindex mail-mailing-lists - The variable @code{mail-mailing-lists} holds a list of mailing list -addresses that you are subscribed to. If it is non-@code{nil}, Emacs -inserts an appropriate @samp{Mail-followup-to} header when sending mail -to a mailing list. - -@c There is also "Sent-via", added by C-c C-v, but it does not seem -@c particularly useful (?). +@c Message mode handles this differently... +@c @vindex mail-mailing-lists +@c The variable @code{mail-mailing-lists} holds a list of mailing list +@c addresses that you are subscribed to. If it is non-@code{nil}, Emacs +@c inserts an appropriate @samp{Mail-followup-to} header when sending mail +@c to a mailing list. @item In-reply-to -This field contains a piece of text describing the message you are -replying to. Some mail systems can use this information to correlate -related pieces of mail. Normally this field is filled in by Rmail -when you reply to a message in Rmail, and you never need to -think about it (@pxref{Rmail}). +A piece of text describing the message you are replying to. Some mail +systems can use this information to correlate related pieces of mail. +Normally, you never need to think about this, because it is filled in +automatically when you reply to a message in Rmail (or any other mail +program built into Emacs). @item References -This field lists the Message-Ids of related previous messages (a -Message-Id is a unique identifier generated when a message is sent). -Rmail sets up this field automatically when you reply to a message. +The Message-Ids of previous related messages (a Message-Id is a unique +identifier generated when a message is sent). Like +@samp{In-reply-to}, this is normally set up automatically for you. @end table - The @samp{To}, @samp{CC}, and @samp{BCC} header fields can appear -any number of times, and each such header field can contain multiple -addresses, separated by commas. This way, you can specify any number -of places to send the message. These fields can also have -continuation lines: one or more lines starting with whitespace, -following the starting line of the field, are considered part of the -field. Here's an example of a @samp{To} field with a continuation -line: +@noindent +The @samp{To}, @samp{CC}, and @samp{BCC} fields can appear any number +of times, and each such header field can contain multiple addresses, +separated by commas. This way, you can specify any number of places +to send the message. These fields can also have continuation lines: +one or more lines starting with whitespace, following the starting +line of the field, are considered part of the field. Here's an +example of a @samp{To} field with a continuation line: @example @group -To: foo@@here.net, this@@there.net, - me@@gnu.cambridge.mass.usa.earth.spiral3281 +To: foo@@example.net, this@@example.net, + bob@@example.com @end group @end example +@vindex user-full-name +@vindex user-mail-address + The default contents of the @samp{From} header field are computed +from the variables @code{user-full-name} and @code{user-mail-address}. +On some operating systems, Emacs initializes these two variables using +environment variables (@pxref{General Variables}). If this +information is unavailable or wrong, you can customize the variables +yourself (@pxref{Easy Customization}). + @vindex mail-from-style - When you send the message, if you didn't write a @samp{From} field -yourself, Emacs puts in one for you, using @code{user-mail-address}. -The variable @code{mail-from-style} controls the format: + The value of the variable @code{mail-from-style} specifies how to +format the address in the @samp{From} field: -@table @code -@item nil -Use just the email address, as in @samp{king@@grassland.com}. -@item parens -Use both email address and full name, as in:@* +@table @asis +@item @code{nil} +Use just the address, as in @samp{king@@grassland.com}. +@item @code{parens} +Use both address and full name, as in:@* @samp{king@@grassland.com (Elvis Parsley)}. -@item angles -Use both email address and full name, as in:@* +@item @code{angles} +Use both address and full name, as in:@* @samp{Elvis Parsley }. -@item system-default -Allow the system to insert the @samp{From} field. +@item any other value +Use @code{angles} for most addresses. However, if the address must be +``quoted'' to remain syntactically-valid under the @code{angles} +format but not under the @code{parens} format, use @code{parens} +instead. This is the default. @end table @c There is also mail-specify-envelope-from and mail-envelope-from, but @c these are probably not topics for the Emacs manual. @vindex mail-default-headers - You can direct Emacs to insert certain default headers into the -outgoing message by setting the variable @code{mail-default-headers} -to a string. Then @code{C-x m} inserts this string into the message -headers. If the default header fields are not appropriate for a + You can direct Emacs to insert certain default headers into the mail +buffer by setting the variable @code{mail-default-headers} to a +string. Then @kbd{C-x m} inserts this string into the message +headers. For example, here is how to add a @samp{Reply-to} and +@samp{FCC} header to each message: + +@smallexample +(setq mail-default-headers + "Reply-to: foo@@example.com\nFCC: ~/Mail/sent") +@end smallexample + +@noindent +If the default header fields are not appropriate for a particular message, edit them as necessary before sending the message. @node Mail Aliases @@ -296,29 +270,26 @@ @cindex mail aliases @cindex @file{.mailrc} file @cindex mailrc file +@vindex mail-personal-alias-file - You can define @dfn{mail aliases} in a file named @file{~/.mailrc}. -These are short mnemonic names which stand for mail addresses or groups of -mail addresses. Like many other mail programs, Emacs expands aliases -when they occur in the @samp{To}, @samp{From}, @samp{CC}, @samp{BCC}, and -@samp{Reply-to} fields, plus their @samp{Resent-} variants. -@c The list is defined by mail-address-field-regexp. + You can define @dfn{mail aliases}, which are short mnemonic names +that stand for mail addresses or groups of mail addresses. By +default, mail aliases are defined in the file @file{~/.mailrc}. You +can specify a different file name to use, by setting the variable +@code{mail-personal-alias-file}. - To define an alias in @file{~/.mailrc}, write a line in the following + To define an alias in @file{.mailrc}, write a line in the following format: @example -alias @var{shortaddress} @var{fulladdresses} +alias @var{nick} @var{fulladdresses} @end example @noindent -Here @var{fulladdresses} stands for one or more mail addresses for -@var{shortaddress} to expand into. Separate multiple addresses with -spaces; if an address contains a space, quote the whole address with a -pair of double quotes. - -For instance, to make @code{maingnu} stand for -@code{gnu@@gnu.org} plus a local address of your own, put in +This means that @var{nick} should expand into @var{fulladdresses}, +where @var{fulladdresses} can be either a single address, or multiple +addresses separated with spaces. For instance, to make @code{maingnu} +stand for @code{gnu@@gnu.org} plus a local address of your own, put in this line:@refill @example @@ -326,329 +297,248 @@ @end example @noindent -Addresses specified in this way should use double quotes around an -entire address when the address contains spaces. But you need not -include double quotes around parts of the address, such as the person's -full name. Emacs puts them in if they are needed. For example, +If an address contains a space, quote the whole address with a pair of +double quotes, like this: @example alias jsmith "John Q. Smith " @end example @noindent -is correct in @samp{.mailrc}. Emacs will insert the address as +Note that you need not include double quotes around individual parts +of the address, such as the person's full name. Emacs puts them in if +they are needed. For instance, it inserts the above address as @samp{"John Q. Smith" }. - Emacs also recognizes ``include'' commands in @samp{.mailrc} files. -They look like this: + Emacs also recognizes ``include'' commands in @file{.mailrc}. They +look like this: @example source @var{filename} @end example @noindent -The file @file{~/.mailrc} is used primarily by other mail-reading -programs; it can contain various other commands. Emacs ignores -everything in it except for alias definitions and include commands. - -@findex define-mail-alias - Another way to define a mail alias, within Emacs alone, is with the -@code{define-mail-alias} command. It prompts for the alias and then the -full address. You can use it to define aliases in your @file{.emacs} -file, like this: - -@example -(define-mail-alias "maingnu" "gnu@@gnu.org") -@end example - -@vindex mail-aliases - @code{define-mail-alias} records aliases by adding them to a -variable named @code{mail-aliases}. If you are comfortable with -manipulating Lisp lists, you can set @code{mail-aliases} directly. The -initial value of @code{mail-aliases} is @code{t}, which means that -Emacs should read @file{.mailrc} to get the proper value. +The @file{.mailrc} file is not unique to Emacs; many other +mail-reading programs use it for mail aliases, and it can contain +various other commands. However, Emacs ignores everything except +alias definitions and include commands. -@vindex mail-personal-alias-file - You can specify a different file name to use instead of -@file{~/.mailrc} by setting the variable -@code{mail-personal-alias-file}. - -@c There is also mail-alias-file for the system aliases. +@findex mail-abbrev-insert-alias + Mail aliases expand as abbrevs---that is to say, as soon as you type +a word-separator character after an alias (@pxref{Abbrevs}). This +expansion takes place only within the @samp{To}, @samp{From}, +@samp{CC}, @samp{BCC}, and @samp{Reply-to} header fields (plus their +@samp{Resent-} variants); it does not take place in other header +fields, such as @samp{Subject}. -@findex expand-mail-aliases - Normally, Emacs expands aliases when you send the message. You do not -need to expand mail aliases before sending the message, but you can -expand them if you want to see where the mail will actually go. To do -this, use the command @kbd{M-x expand-mail-aliases}; it expands all mail -aliases currently present in the mail headers that hold addresses. - - If you like, you can have mail aliases expand as abbrevs, as soon as -you type them in (@pxref{Abbrevs}). To enable this feature, execute the -following: - -@example -(add-hook 'mail-mode-hook 'mail-abbrevs-setup) -@end example + You can also insert an aliased address directly, using the command +@kbd{M-x mail-abbrev-insert-alias}. This reads an alias name, with +completion, and inserts its definition at point. -@noindent -@findex define-mail-abbrev -@vindex mail-abbrevs -This can go in your @file{.emacs} file. @xref{Hooks}. If you use this -feature, you must use @code{define-mail-abbrev} instead of -@code{define-mail-alias}; the latter does not work with this package. -Note that the mail abbreviation package uses the variable -@code{mail-abbrevs} instead of @code{mail-aliases}, and that all alias -names are converted to lower case. - -@kindex C-c C-a @r{(Mail mode)} -@findex mail-abbrev-insert-alias - The mail abbreviation package also provides the @kbd{C-c C-a} -(@code{mail-abbrev-insert-alias}) command, which reads an alias -name (with completion) and inserts its definition at point. This is -useful when editing the message text itself or a header field such as -@samp{Subject} in which Emacs does not normally expand aliases. - - Note that abbrevs expand only if you insert a word-separator character -afterward. However, you can rebind @kbd{C-n} and @kbd{M->} to cause -expansion as well. Here's how to do that: +@node Mail Commands +@section Mail Commands +@cindex Message mode +@cindex mode, Message -@smallexample -(add-hook 'mail-mode-hook - (lambda () - (define-key - mail-mode-map [remap next-line] 'mail-abbrev-next-line) - (define-key - mail-mode-map [remap end-of-buffer] 'mail-abbrev-end-of-buffer))) -@end smallexample + The default major mode for the @samp{*mail*} buffer is called +Message mode. It behaves like Text mode in many ways, but provides +several additional commands on the @kbd{C-c} prefix, which make +editing a message more convenient. -@node Mail Mode -@section Mail Mode -@cindex Mail mode -@cindex mode, Mail - - The major mode used in the mail buffer is Mail mode, which is much -like Text mode except that various special commands are provided on the -@kbd{C-c} prefix. These commands all have to do specifically with -editing or sending the message. - - Mail mode is normally used in buffers set up automatically by the -@code{mail} command and related commands. However, you can also switch -to Mail mode in a file-visiting buffer. This is a useful thing to do if -you have saved the text of a draft message in a file. + In this section, we will describe some of the most commonly-used +commands available in Message mode. +@ifnottex +Message mode also has its own manual, where its features are described +in greater detail. @xref{Top,,Message, message, Message}. +@end ifnottex @menu * Mail Sending:: Commands to send the message. * Header Editing:: Commands to move to header fields and edit them. -* Citing Mail:: Copying all or part of a message you are replying to. -* Mail Mode Misc:: Spell checking, signatures, etc. +* Citing Mail:: Quoting a message you are replying to. +* Mail Misc:: Attachments, spell checking, etc. @end menu @node Mail Sending @subsection Mail Sending - Mail mode has two commands for sending the message you have been -editing: + There are two commands to send a message you have been editing: @table @kbd +@item C-c C-c +Send the message, and deselect the mail buffer (@code{message-send-and-exit}). @item C-c C-s -Send the message, and leave the mail buffer selected (@code{mail-send}). -@item C-c C-c -Send the message, and select some other buffer (@code{mail-send-and-exit}). +Send the message, and leave the mail buffer selected (@code{message-send}). @end table -@kindex C-c C-s @r{(Mail mode)} -@kindex C-c C-c @r{(Mail mode)} -@findex mail-send -@findex mail-send-and-exit -@vindex mail-send-hook - @kbd{C-c C-s} (@code{mail-send}) sends the message and marks the mail -buffer unmodified, but leaves that buffer selected so that you can -modify the message (perhaps with new recipients) and send it again. -@kbd{C-c C-c} (@code{mail-send-and-exit}) sends and then deletes the -window or switches to another buffer. It puts the mail buffer at the -lowest priority for reselection by default, since you are finished with -using it. This is the usual way to send the message. Sending a message -runs the hook @code{mail-send-hook}. +@kindex C-c C-s @r{(Message mode)} +@kindex C-c C-c @r{(Message mode)} +@findex message-send + If you want to send a message and be done with it, type @kbd{C-c +C-c} (@code{mail-send-and-exit}). This sends the message and then +either deletes the window or switches to another buffer. It also +``buries'' the mail buffer, putting it at the lowest priority for +reselection. This is the usual command for sending a message. -@c Options not mentioned: mail-interactive, mail-use-dsn. +@findex message-send-and-exit + The command @kbd{C-c C-s} (@code{message-send}) sends the message +and marks the mail buffer unmodified, but leaves the buffer selected. +Use this command if you want to modify the message (perhaps with new +recipients) and send it again. + +@vindex message-send-hook + Sending a message runs the hook @code{message-send-hook}. In a file-visiting buffer, sending the message does not clear the modified flag, because only saving the file should do that. Also, you don't get a warning if you try to send the same message twice. -@c This is indexed in mule.texi, node "Recognize Coding". -@c @vindex sendmail-coding-system - When you send a message that contains non-@acronym{ASCII} characters, they need -to be encoded with a coding system (@pxref{Coding Systems}). Usually -the coding system is specified automatically by your chosen language -environment (@pxref{Language Environments}). You can explicitly specify -the coding system for outgoing mail by setting the variable -@code{sendmail-coding-system} (@pxref{Recognize Coding}). - - If the coding system thus determined does not handle the characters in -a particular message, Emacs asks you to select the coding system to use, +@vindex sendmail-coding-system + When you send a message containing non-@acronym{ASCII} characters, +they need to be encoded with a coding system (@pxref{Coding Systems}). +Usually the coding system is specified automatically by your chosen +language environment (@pxref{Language Environments}). You can +explicitly specify the coding system for outgoing mail by setting the +variable @code{sendmail-coding-system} (@pxref{Recognize Coding}). If +the coding system thus determined does not handle the characters in a +particular message, Emacs asks you to select the coding system to use, showing a list of possible coding systems. -@c Not mentioned: mail-send-nonascii. - @cindex SMTP @cindex Feedmail @cindex Sendmail @cindex Mailclient @vindex send-mail-function The variable @code{send-mail-function} controls how the default mail -user agent sends mail. It should be set to a function. In most cases, -the default is @code{sendmail-send-it}, which delivers mail using the -Sendmail installation on the local host. On Mac OS X and MS-Windows, -however, the default is normally @code{mailclient-send-it}, which -passes the mail buffer on to the system's designated mail client (see -@file{mailclient.el}). To send mail through an SMTP server, set -@code{send-mail-function} to @code{smtpmail-send-it} and set up the -Emacs SMTP library (@pxref{Top,,Emacs SMTP Library, smtpmail, Sending -mail via SMTP}). Another option is @code{feedmail-send-it} (see the -commentary section of the @file{feedmail.el} package). +user agent sends mail. Its value should be a function, which can be +one of the following: + +@table @code +@item sendmail-send-it +Send mail using the system's default @command{sendmail} (or +@command{sendmail}-compatible) program. This is the default on Unix +and GNU, and works provided the system is a valid @dfn{mail host} +(that is, provided it can deliver mail via SMTP). + +@item mailclient-send-it +Pass the mail buffer on to the system's designated mail client (see +@file{mailclient.el}). This is the default on Mac OS X and +MS-Windows. + +@item smtpmail-send-it +Send mail through an external mail host (e.g., your Internet service +provider's SMTP server). You will need to tell Emacs how to contact +the SMTP server, by customizing the variables +@code{smtpmail-smtp-server} and @code{smtpmail-auth-credentials}. +@xref{Top,,Emacs SMTP Library, smtpmail, Sending mail via SMTP}. + +@item feedmail-send-it +This is similar to @code{sendmail-send-it}, but allows you to queue +messages for later sending. See the commentary section in the file +@file{feedmail.el} for more information. +@end table @node Header Editing @subsection Mail Header Editing - Mail mode provides special commands to move to particular header -fields and to complete addresses in headers. + Message mode provides the following special commands to move to +particular header fields and to complete addresses in headers. @table @kbd @item C-c C-f C-t -Move to the @samp{To} header field, creating one if there is none -(@code{mail-to}). +Move to the @samp{To} header (@code{message-goto-to}). @item C-c C-f C-s -Move to the @samp{Subject} header field, creating one if there is -none (@code{mail-subject}). +Move to the @samp{Subject} header (@code{message-goto-subject}). @item C-c C-f C-c -Move to the @samp{CC} header field, creating one if there is none -(@code{mail-cc}). +Move to the @samp{CC} header (@code{message-goto-cc}). @item C-c C-f C-b -Move to the @samp{BCC} header field, creating one if there is none -(@code{mail-bcc}). +Move to the @samp{BCC} header (@code{message-goto-bcc}). @item C-c C-f C-r -Move to the @samp{Reply-To} header field, creating one if there is none -(@code{mail-reply-to}). -@item C-c C-f C-a -Move to the @samp{Mail-Reply-To} header field, creating one if there is none -(@code{mail-mail-reply-to}). -@item C-c C-f C-l -Move to the @samp{Mail-Followup-To} header field, creating one if there is none -(@code{mail-mail-followup-to}). +Move to the @samp{Reply-To} header (@code{message-goto-reply-to}). @item C-c C-f C-f +Move to the @samp{Mail-Followup-To} header field +(@code{message-goto-followup-to}). +@item C-c C-f C-w Add a new @samp{FCC} header field, with file-name completion -(@code{mail-fcc}). -@c There is also C-c C-v, mail-sent-via, which adds one or more -@c "Sent-via" headers, but I don't know what the point of that header is. -@item M-@key{TAB} -Complete a mailing address (@code{mail-complete}). +(@code{message-goto-fcc}). +@item C-c C-b +Move to the start of the message body (@code{message-goto-body}). +@item @key{TAB} +Complete a mailing address (@code{message-tab}). @end table -@kindex C-c C-f C-t @r{(Mail mode)} -@findex mail-to -@kindex C-c C-f C-s @r{(Mail mode)} -@findex mail-subject -@kindex C-c C-f C-c @r{(Mail mode)} -@findex mail-cc -@kindex C-c C-f C-b @r{(Mail mode)} -@findex mail-bcc -@kindex C-c C-f C-r @r{(Mail mode)} -@findex mail-reply-to -@kindex C-c C-f C-a @r{(Mail mode)} -@findex mail-mail-reply-to -@kindex C-c C-f C-l @r{(Mail mode)} -@findex mail-mail-followup-to -@kindex C-c C-f C-f @r{(Mail mode)} -@findex mail-fcc - There are several commands to move point to particular header fields, -all based on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). -They are listed in the table above. If the field in question does not -exist, these commands create one (the exception is @code{mail-fcc}, -which creates a new field each time). We provide special motion -commands for these particular fields because they are the fields users -most often want to edit. +@kindex C-c C-f C-t @r{(Message mode)} +@findex message-goto-to +@kindex C-c C-f C-s @r{(Message mode)} +@findex message-goto-subject +@kindex C-c C-f C-c @r{(Message mode)} +@findex message-goto-cc +@kindex C-c C-f C-b @r{(Message mode)} +@findex message-goto-bcc +@kindex C-c C-f C-r @r{(Message mode)} +@findex goto-reply-to +@kindex C-c C-f C-f @r{(Message mode)} +@findex goto-followup-to +@kindex C-c C-f C-w @r{(Message mode)} +@findex message-goto-fcc + The commands to move point to particular header fields are all based +on the prefix @kbd{C-c C-f} (@samp{C-f} is for ``field''). If the +field in question does not exist, the command creates one (the +exception is @code{mail-fcc}, which creates a new field each time). -@findex mail-complete -@kindex M-TAB @r{(Mail mode)} -@c `mail-complete-alist' specifies the headers. - While editing a header field that contains mailing addresses, such -as @samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete a mailing -address by typing @kbd{M-@key{TAB}} (@code{mail-complete}). It -inserts the full name corresponding to the address, if it can -determine the full name. The variable @code{mail-complete-style} -controls whether to insert the full name, and what style to use, as in -@code{mail-from-style} (@pxref{Mail Headers}). (If your window -manager defines @kbd{M-@key{TAB}} to switch windows, you can type -@kbd{@key{ESC} @key{TAB}} or @kbd{C-M-i}.) +@kindex C-c C-b @r{(Message mode)} +@findex mail-text + The command @kbd{C-c C-b} (@code{message-goto-body}) moves point to +just after the header separator line---that is, to the beginning of +the body. - For completion purposes, the valid mailing addresses are taken to be -the local users' names plus your personal mail aliases (@pxref{Mail -Aliases}). You can specify additional sources of valid addresses; -browse the customization group @samp{mailalias} to see the variables for -customizing this feature (@pxref{Customization Groups}). - - If you type @kbd{M-@key{TAB}} in the body of the message, or on a -unrecognized header, @code{mail-complete} invokes the function specified -by @code{mail-complete-function}. By default, this is -@code{ispell-complete-word}, as in Text mode. +@findex message-tab +@kindex TAB @r{(Message mode)} + While editing a header field that contains addresses, such as +@samp{To:}, @samp{CC:} and @samp{BCC:}, you can complete an address by +typing @key{TAB} (@code{message-tab}). This attempts to insert the +full name corresponding to the address based on a couple of methods, +including EUDC, a library that recognizes a number of directory server +protocols (@pxref{Top,,EUDC,eudc, The Emacs Unified Directory +Client}). Failing that, it attempts to expand the address as a mail +alias (@pxref{Mail Aliases}). If point is on a header field that does +not take addresses, or if it is in the message body, then @key{TAB} +just inserts a tab character. @node Citing Mail @subsection Citing Mail @cindex citing mail - Mail mode also has commands for yanking or @dfn{citing} all or part of -a message that you are replying to. These commands are active only when -you started sending a message using an Rmail command. - @table @kbd @item C-c C-y -Yank the selected message from Rmail (@code{mail-yank-original}). -@item C-c C-r -Yank the region from the Rmail buffer (@code{mail-yank-region}). +Yank the selected message from Rmail (@code{message-yank-original}). @item C-c C-q Fill each paragraph cited from another message -(@code{mail-fill-yanked-message}). -@c There is also mail-split-line, but it does not seem very useful. +(@code{message-fill-yanked-message}). @end table -@kindex C-c C-y @r{(Mail mode)} -@findex mail-yank-original - When mail sending is invoked from the Rmail mail reader using an Rmail -command, @kbd{C-c C-y} can be used inside the mail buffer to insert the -text of the message you are replying to. Normally it indents each line -of that message three spaces and eliminates most header fields (as -specified by the variable @code{mail-yank-ignored-headers}). A numeric -argument specifies the number of spaces to indent (the variable -@code{mail-indentation-spaces} specifies the default number). An -argument of just @kbd{C-u} says not to indent at all and not to -eliminate anything. @kbd{C-c C-y} always uses the current message from -the Rmail buffer, so you can insert several old messages by selecting -one in Rmail, switching to @samp{*mail*} and yanking it, then switching -back to Rmail to select another. +@kindex C-c C-y @r{(Message mode)} +@findex message-yank-original +@findex message-yank-prefix + You can use the command @kbd{C-c C-y} (@code{message-yank-original}) +to @dfn{cite} a message that you are replying to. This inserts the +text of that message into the mail buffer. This command is active +only when the mail buffer is invoked from a mail program running in +Emacs, such as Rmail. -@vindex mail-yank-prefix - You can specify the text for @kbd{C-c C-y} to insert at the beginning -of each line: set @code{mail-yank-prefix} to the desired string. (A -value of @code{nil} means to use indentation; this is the default.) -However, @kbd{C-u C-c C-y} never adds anything at the beginning of the -inserted lines, regardless of the value of @code{mail-yank-prefix}. + By default, Emacs inserts the string @samp{>} in front of each line +of the cited text; this prefix string is specified by the variable +@code{message-yank-prefix}. If you call @code{message-yank-original} +with a prefix argument, the citation prefix is not inserted. -@kindex C-c C-r @r{(Mail mode)} -@findex mail-yank-region - To yank just a part of an incoming message, set the region in Rmail to -the part you want; then go to the @samp{*Mail*} message and type -@kbd{C-c C-r} (@code{mail-yank-region}). Each line that is copied is -indented or prefixed according to @code{mail-yank-prefix}. - -@kindex C-c C-q @r{(Mail mode)} +@kindex C-c C-q @r{(Message mode)} @findex mail-fill-yanked-message - After using @kbd{C-c C-y} or @kbd{C-c C-r}, you can type @kbd{C-c C-q} -(@code{mail-fill-yanked-message}) to fill the paragraphs of the yanked -old message or messages. One use of @kbd{C-c C-q} fills all such -paragraphs, each one individually. To fill a single paragraph of the -quoted message, use @kbd{M-q}. If filling does not automatically -handle the type of citation prefix you use, try setting the fill prefix + After using @kbd{C-c C-y}, you can type @kbd{C-c C-q} +(@code{message-fill-yanked-message}) to fill the paragraphs of the +cited message. One use of @kbd{C-c C-q} fills all such paragraphs, +each one individually. To fill a single paragraph of the quoted +message, use @kbd{M-q}. If filling does not automatically handle the +type of citation prefix you use, try setting the fill prefix explicitly. @xref{Filling}. @vindex mail-citation-hook @@ -657,91 +547,103 @@ package, which provides more flexible citation (@pxref{Introduction,,,sc, Supercite}). -@c No need to mention: mail-citation-prefix-regexp. - -@node Mail Mode Misc -@subsection Mail Mode Miscellany +@node Mail Misc +@subsection Mail Miscellany -@table @kbd -@item C-c C-t -Move to the beginning of the message body text (@code{mail-text}). -@item C-c C-w -Insert a signature at the end of the message text (@code{mail-signature}). -@item C-c C-i @var{file} @key{RET} -Insert the contents of @var{file} at the end of the message text -(@code{mail-attach-file}). -@item M-x ispell-message -Perform spelling correction on the message text, but not on citations from -other messages, or the message headers. -@end table - -@kindex C-c C-t @r{(Mail mode)} -@findex mail-text - @kbd{C-c C-t} (@code{mail-text}) moves point to just after the header -separator line---that is, to the beginning of the message body text. +@kindex C-c C-a @r{(Message mode)} +@findex mail-attach-file +@cindex MIME +@cindex Multipurpose Internet Mail Extensions + You can @dfn{attach} a file to an outgoing message by typing +@kbd{C-c C-a} (@code{mml-attach-file}) in the mail buffer. Attaching +is done using the MIME (Multipurpose Internet Mail Extensions) +standard. -@kindex C-c C-w @r{(Mail mode)} -@findex mail-signature -@vindex mail-signature - @kbd{C-c C-w} (@code{mail-signature}) adds a standard piece of text -(your @dfn{mail signature}) at the end of the message to say more about who -you are. For example, it may contain telephone numbers, or your -physical location. The text comes from the variable -@code{mail-signature}. It can be a fixed string, or a Lisp expression -that returns a string. If it is @code{t} or @code{nil}, the function -inserts the contents of the file @code{mail-signature-file}. By -default, this is the file @file{~/.signature} in your home directory. + The @code{mml-attach-file} command prompts for the name of the file, +and for the attachment's @dfn{content type}, @dfn{description}, and +@dfn{disposition}. The content type is normally detected +automatically; just type @key{RET} to accept the default. The +description is a single line of text that the recipient will see next +to the attachment; you may also choose to leave this empty. The +disposition is either @samp{inline} (the default), which means the +recipient will see a link to the attachment within the message body, +or @samp{attachment}, which means the link will be separate from the +body. - If the variable @code{mail-signature} has a non-@code{nil} value, -starting a mail automatically inserts your signature. Otherwise, you -must explicitly use the command @code{mail-signature}. If you want to -omit your signature from a particular message, just delete it from the -buffer before you send the message. + The actual contents of the attached file are not inserted into the +mail buffer. Instead, some placeholder text is inserted into the mail +buffer, like this: - Convention says that the start of your signature should be marked by a -line whose contents are @samp{-- }. If your signature comes from a -file, this prefix is added for you, but in all other cases you must add -it yourself. The remainder of your signature should be no more than -four lines. +@smallexample +<#part type="text/plain" filename="~/foo.txt" disposition=inline> +<#/part> +@end smallexample + +@noindent +When you type @kbd{C-c C-c} or @kbd{C-c C-s} to send the message, the +attached file will be delivered with it. @findex ispell-message - You can do spelling correction on the message text you have written -with the command @kbd{M-x ispell-message}. If you have yanked an -incoming message into the outgoing draft, this command skips what was -yanked, but it checks the text that you yourself inserted. (It looks -for indentation or @code{mail-yank-prefix} to distinguish the cited -lines from your input.) @xref{Spelling}. - -@kindex C-c C-i @r{(Mail mode)} -@findex mail-attach-file - To include a file in the outgoing message, you can use @kbd{C-x i}, -the usual command to insert a file in the current buffer. But it is -often more convenient to use a special command, @kbd{C-c C-i} -(@code{mail-attach-file}). This command inserts the file contents at -the end of the buffer, after your signature (if any), with a delimiter -line that includes the file name. Note that this is not a MIME -attachment. + While composing a message, you can do spelling correction on the +message text by typing @kbd{M-x ispell-message}. If you have yanked +an incoming message into the outgoing draft, this command skips what +was yanked, but it checks the text that you yourself inserted (it +looks for indentation or @code{mail-yank-prefix} to distinguish the +cited lines from your input). @xref{Spelling}. @vindex mail-mode-hook @vindex mail-setup-hook - Turning on Mail mode (which @kbd{C-x m} does automatically) runs the -normal hooks @code{text-mode-hook} and @code{mail-mode-hook}. + Turning on Message mode (which @kbd{C-x m} does automatically) runs +the normal hooks @code{text-mode-hook} and @code{message-mode-hook}. Initializing a new outgoing message runs the normal hook -@code{mail-setup-hook}; if you want to add special fields to your mail -header or make other changes to the appearance of the mail buffer, use -that hook. @xref{Hooks}. +@code{message-setup-hook}; you can use this hook if you want to make +changes to the appearance of the mail buffer. @xref{Hooks}. The main difference between these hooks is just when they are -invoked. Whenever you type @kbd{M-x mail}, @code{mail-mode-hook} runs -as soon as the @samp{*mail*} buffer is created. Then the -@code{mail-setup} function inserts the default contents of the buffer. -After these default contents are inserted, @code{mail-setup-hook} runs. +invoked. Whenever you type @kbd{C-x m}, @code{message-mode-hook} runs +as soon as the mail buffer is created. Then the @code{message-setup} +function inserts the default contents of the buffer. After these +default contents are inserted, @code{message-setup-hook} runs. + + If you use @kbd{C-x m} to continue an existing composition, +@code{message-mode-hook} runs immediately after switching to the mail +buffer. If the buffer is unmodified, or if you decide to erase it and +start again, @code{message-setup-hook} runs after the default contents +are inserted. + +@node Mail Signature +@section Mail Signature - If you use @kbd{M-x mail} to continue an existing composition, -@code{mail-mode-hook} runs immediately after switching to the -@samp{*mail*} buffer. If the buffer is unmodified, or if you decide to -erase it and start again, @code{mail-setup-hook} runs after the default -contents are inserted. +@cindex mail signature +@vindex mail-signature-file +@vindex mail-signature + You can add a standard piece of text---your @dfn{mail +signature}---to the end of every message. This signature may contain +information such as your telephone number or your physical location. +The variable @code{mail-signature} determines how Emacs handles the +mail signature. + + The default value of @code{mail-signature} is @code{t}; this means +to look for your mail signature in the file @file{~/.signature}. If +this file exists, its contents are automatically inserted into the end +of the mail buffer. You can change the signature file via the +variable @code{mail-signature-file}. + + If you change @code{mail-signature} to a string, that specifies the +text of the signature directly. + +@kindex C-c C-w @r{(Message mode)} +@findex message-insert-signature + If you change @code{mail-signature} to @code{nil}, Emacs will not +insert your mail signature automatically. You can insert your mail +signature by typing @kbd{C-c C-w} (@code{message-insert-signature}) in +the mail buffer. Emacs will look for your signature in the signature +file. + + By convention, a mail signature should be marked by a line whose +contents are @samp{-- }. If your signature lacks this prefix, it is +added for you. The remainder of your signature should be no more than +four lines. @node Mail Amusements @section Mail Amusements @@ -778,28 +680,32 @@ @node Mail Methods @section Mail-Composition Methods @cindex mail-composition methods +@cindex Mail mode +@cindex mode, Mail @cindex MH mail interface @cindex Message mode for sending mail In this chapter we have described the usual Emacs mode for editing -and sending mail---Mail mode. Emacs has alternative facilities for -editing and sending mail, including -MH-E and Message mode, not documented in this manual. -@xref{Top,,MH-E,mh-e, The Emacs Interface to MH}. @xref{Top,,Message,message, -Message Manual}. You can choose any of them as your preferred method. -The commands @code{C-x m}, @code{C-x 4 m} and @code{C-x 5 m} use -whichever agent you have specified, as do various other Emacs commands -and facilities that send mail. +and sending mail---Message mode. This is only one of several +available modes. Prior to Emacs 23.2, the default mode was Mail mode, +which is similar to Message mode in many respects but lacks features +such as MIME support. Another available mode is MH-E +(@pxref{Top,,MH-E,mh-e, The Emacs Interface to MH}). @vindex mail-user-agent - To specify your mail-composition method, customize the variable -@code{mail-user-agent}. Currently legitimate values include -@code{sendmail-user-agent} (Mail mode), @code{mh-e-user-agent}, -@code{message-user-agent} and @code{gnus-user-agent}. + You can choose any of these @dfn{mail user agents} as your preferred +method for editing and sending mail. The commands @code{C-x m}, +@code{C-x 4 m} and @code{C-x 5 m} use whichever agent you have +specified; so do various other parts of Emacs that send mail, such as +the bug reporter (@pxref{Bugs}). To specify a mail user agent, +customize the variable @code{mail-user-agent}. Currently, legitimate +values include @code{message-user-agent} (Message mode) +@code{sendmail-user-agent} (Mail mode), @code{gnus-user-agent}, and +@code{mh-e-user-agent}. If you select a different mail-composition method, the information -in this chapter about the @samp{*mail*} buffer and Mail mode does not -apply; the other methods use a different format of text in a different +in this chapter about the mail buffer and Message mode does not apply; +the other methods use a different format of text in a different buffer, and their commands are different as well. @vindex read-mail-command diff -r 3e1f021606db -r debd2dae3330 doc/emacs/text.texi --- a/doc/emacs/text.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/emacs/text.texi Tue Mar 30 16:48:06 2010 +0900 @@ -26,11 +26,16 @@ @xref{Outline Mode}. @end iftex +@cindex nXML mode +@cindex mode, XML +@cindex mode, nXML +@findex nxml-mode Emacs has other major modes for text which contains ``embedded'' -commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML, SGML, -and XML (@pxref{HTML Mode}); and Groff and Nroff (@pxref{Nroff Mode}). -In addition, you can edit formatted text in WYSIWYG style (``what you -see is what you get''), using Enriched mode (@pxref{Formatted Text}). +commands, such as @TeX{} and La@TeX{} (@pxref{TeX Mode}); HTML and +SGML (@pxref{HTML Mode}); XML (@pxref{Top, nXML Mode,,nxml-mode, nXML +Mode}); and Groff and Nroff (@pxref{Nroff Mode}). In addition, you +can edit formatted text in WYSIWYG style (``what you see is what you +get''), using Enriched mode (@pxref{Formatted Text}). @cindex ASCII art If you need to edit pictures made out of text characters (commonly @@ -61,7 +66,7 @@ * Text Mode:: The major modes for editing text files. * Outline Mode:: Editing outlines. * TeX Mode:: Editing input to the formatter TeX. -* HTML Mode:: Editing HTML, SGML, and XML files. +* HTML Mode:: Editing HTML and SGML files. * Nroff Mode:: Editing input to the formatter nroff. * Formatted Text:: Editing formatted text directly in WYSIWYG fashion. * Text Based Tables:: Editing text-based tables in WYSIWYG fashion. @@ -923,10 +928,10 @@ @vindex text-mode-hook Entering Text mode runs the hook @code{text-mode-hook}. Other major modes related to Text mode also run this hook, followed by hooks of -their own; this includes Paragraph-Indent Text mode, Nroff mode, @TeX{} -mode, Outline mode, and Mail mode. Hook functions on -@code{text-mode-hook} can look at the value of @code{major-mode} to see -which of these modes is actually being entered. @xref{Hooks}. +their own; this includes Paragraph-Indent Text mode, Nroff mode, +@TeX{} mode, Outline mode, and Message mode. Hook functions on +@code{text-mode-hook} can look at the value of @code{major-mode} to +see which of these modes is actually being entered. @xref{Hooks}. @node Outline Mode @section Outline Mode @@ -1743,29 +1748,17 @@ Ref@TeX{}. @inforef{Top,, reftex}. @node HTML Mode -@section SGML, XML, and HTML Modes +@section SGML and HTML Modes @cindex SGML mode @cindex HTML mode -@cindex XML mode @cindex mode, SGML @cindex mode, HTML -@cindex mode, XML @findex sgml-mode @findex html-mode -@findex xml-mode - - The major modes for SGML, XML, and HTML provide indentation support -and commands for operating on tags. XML mode is actually identical to -SGML mode (to be precise, @code{xml-mode} is an alias for -@code{sgml-mode}), because XML is a strict subset of SGML. HTML mode -is a slightly customized variant of SGML mode. - -@vindex sgml-xml-mode - In XML, every opening tag must have an explicit closing tag. When -the variable @code{sgml-xml-mode} is non-@code{nil}, the tag insertion -commands described below always insert explicit closing tags as well. -When you visit a file, Emacs determines whether it is XML by examining -the file contents, and sets @code{sgml-xml-mode} accordingly. + + The major modes for SGML and HTML provide indentation support and +commands for operating on tags. HTML mode is a slightly customized +variant of SGML mode. @table @kbd @item C-c C-n @@ -1855,13 +1848,22 @@ @cindex mode, nXML @findex nxml-mode @cindex XML schema - Emacs also provides a more advanced mode for editing XML -documents, called nXML mode (@code{nxml-mode}). nXML mode is aware of -many existing XML schema, and uses them to provide completion of XML -elements via @kbd{C-@key{RET}} or @kbd{M-@key{TAB}}, as well as -``on-the-fly'' validation of XML, with errors highlighted via Font -Lock (@pxref{Font Lock}). It is described in its own manual. -@xref{Top, nXML Mode,,nxml-mode, nXML Mode}. + The default mode for editing XML documents is called nXML mode +(@code{xml-mode} or @code{nxml-mode}). This is a powerful major mode +that can recognize many existing XML schema and use them to provide +completion of XML elements via @kbd{C-@key{RET}} or @kbd{M-@key{TAB}}, +as well as ``on-the-fly'' XML validation with error highlighting. It +is described in its own manual. @xref{Top, nXML Mode,,nxml-mode, nXML +Mode}. + +@vindex sgml-xml-mode + However, you can also use SGML mode to edit XML, since XML is a +strict subset of SGML. In XML, every opening tag must have an +explicit closing tag. When the variable @code{sgml-xml-mode} is +non-@code{nil}, the tag insertion commands described above always +insert explicit closing tags as well. When you visit a file in SGML +mode, Emacs determines whether it is XML by examining the file +contents, and sets @code{sgml-xml-mode} accordingly. @node Nroff Mode @section Nroff Mode diff -r 3e1f021606db -r debd2dae3330 doc/lispref/ChangeLog --- a/doc/lispref/ChangeLog Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/lispref/ChangeLog Tue Mar 30 16:48:06 2010 +0900 @@ -1,3 +1,12 @@ +2010-03-26 Chong Yidong + + * loading.texi (Hooks for Loading): Document after-load-functions. + Copyedits. + +2010-03-24 Arni Magnusson (tiny change) + + * frames.texi (Cursor Parameters): Fix typo. (Bug#5760) + 2010-03-21 Chong Yidong * processes.texi (Network Processes): Document seqpacket type. diff -r 3e1f021606db -r debd2dae3330 doc/lispref/frames.texi --- a/doc/lispref/frames.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/lispref/frames.texi Tue Mar 30 16:48:06 2010 +0900 @@ -821,7 +821,7 @@ selected. It supports the same values as the @code{cursor-type} frame parameter; also, @code{nil} means don't display a cursor in nonselected windows, and @code{t} (the default) means use a standard -modificatoin of the usual cursor type (solid box becomes hollow box, +modification of the usual cursor type (solid box becomes hollow box, and bar becomes a narrower bar). @end defopt diff -r 3e1f021606db -r debd2dae3330 doc/lispref/loading.texi --- a/doc/lispref/loading.texi Tue Mar 23 10:03:53 2010 +0900 +++ b/doc/lispref/loading.texi Tue Mar 30 16:48:06 2010 +0900 @@ -920,8 +920,17 @@ @cindex loading hooks @cindex hooks for loading -You can ask for code to be executed if and when a particular library is -loaded, by calling @code{eval-after-load}. +You can ask for code to be executed each time Emacs loads a library, +by using the variable @code{after-load-functions}: + +@defvar after-load-functions +This abnormal hook is run after loading a file. Each function in the +hook is called with a single argument, the absolute filename of the +file that was just loaded. +@end defvar + +If you want code to be executed when a @emph{particular} library is +loaded, use the function @code{eval-after-load}: @defun eval-after-load library form This function arranges to evaluate @var{form} at the end of loading @@ -930,7 +939,7 @@ Don't forget to quote @var{form}! You don't need to give a directory or extension in the file name -@var{library}---normally you just give a bare file name, like this: +@var{library}. Normally, you just give a bare file name, like this: @example (eval-after-load "edebug" '(def-edebug-spec c-point t)) @@ -955,31 +964,30 @@ execution of the rest of @var{form}. @end defun -In general, well-designed Lisp programs should not use this feature. -The clean and modular ways to interact with a Lisp library are (1) -examine and set the library's variables (those which are meant for -outside use), and (2) call the library's functions. If you wish to -do (1), you can do it immediately---there is no need to wait for when -the library is loaded. To do (2), you must load the library (preferably -with @code{require}). +Normally, well-designed Lisp programs should not use +@code{eval-after-load}. If you need to examine and set the variables +defined in another library (those meant for outside use), you can do +it immediately---there is no need to wait until the library is loaded. +If you need to call functions defined by that library, you should load +the library, preferably with @code{require} (@pxref{Named Features}). But it is OK to use @code{eval-after-load} in your personal -customizations if you don't feel they must meet the design standards for -programs meant for wider use. +customizations if you don't feel that they must meet the design +standards for programs meant for wider use. @defvar after-load-alist -This variable, an alist built by @code{eval-after-load}, holds the -expressions to evaluate when particular libraries are loaded. Each -element looks like this: +This variable stores an alist built by @code{eval-after-load}, +containing the expressions to evaluate when certain libraries are +loaded. Each element looks like this: @example (@var{regexp-or-feature} @var{forms}@dots{}) @end example The key @var{regexp-or-feature} is either a regular expression or a -symbol, and the value is a list of forms. The forms are evaluated when -the key matches the absolute true name of the file being -@code{load}ed or the symbol being @code{provide}d. +symbol, and the value is a list of forms. The forms are evaluated +when the key matches the absolute true name or feature name of the +library being loaded. @end defvar @ignore diff -r 3e1f021606db -r debd2dae3330 etc/ChangeLog --- a/etc/ChangeLog Tue Mar 23 10:03:53 2010 +0900 +++ b/etc/ChangeLog Tue Mar 30 16:48:06 2010 +0900 @@ -1,3 +1,13 @@ +2010-03-28 Chong Yidong + + * images/icons/hicolor/scalable/apps/emacs.svg: Put preamble after + svg tag (Bug#5790). + +2010-03-27 Eli Zaretskii + + * PROBLEMS: Mention problems on MS-Windows with incompatible + regex.h headers. + 2010-03-15 Francesc Rocher * MORE.STUFF: Remove CEDET entry, now distributed as part of diff -r 3e1f021606db -r debd2dae3330 etc/NEWS --- a/etc/NEWS Tue Mar 23 10:03:53 2010 +0900 +++ b/etc/NEWS Tue Mar 30 16:48:06 2010 +0900 @@ -148,7 +148,7 @@ +++ *** The new completion-style `initials' is available. For instance, this can complete M-x lch to list-command-history. - +--- *** The new variable `completions-format' determines how completions are displayed in the *Completions* buffer. If you set it to `vertical', completions are sorted vertically in columns. @@ -227,7 +227,7 @@ Dired buffers to be reverted automatically on revisiting them. ** DocView - ++++ *** When `doc-view-continuous' is non-nil, scrolling a line on the page edge advances to the next/previous page. @@ -250,6 +250,7 @@ manual that generates an Info file which gives the same information through a menu structure. ++++ ** Message mode is now the default mode for composing mail. The default for `mail-user-agent' is now message-user-agent, so the @@ -259,6 +260,7 @@ for several years. It provides several features that are absent in Mail mode, such as MIME handling. +--- *** If the user has not customized mail-user-agent, `compose-mail' checks for Mail mode customizations, and issues a warning if these customizations are found. This alerts users who may otherwise be @@ -271,49 +273,59 @@ Emacs will wait for the process sending mail to return. If you experience delays when sending mail, you may wish to set this to nil. ++++ ** nXML mode is now the default for editing XML files. -** Shell +** Shell (and other comint modes) ++++ +*** M-s is no longer bound to `comint-next-matching-input'. +++ -*** ansi-color is now enabled by default. +*** M-r is now bound to `comint-history-isearch-backward-regexp'. +This starts an incremental search of the comint/shell input history. ++++ +*** ansi-color is now enabled by default in Shell mode. To disable it, set ansi-color-for-comint-mode to nil. +** Tramp +++ -** Tramp - *** New connection methods "rsyncc", "imap" and "imaps". On systems which support GVFS-Fuse, Tramp offers also the new connection methods "dav", "davs", "obex" and "synce". ** VC and related modes - ++++ *** When using C-x v v or C-x v i on a unregistered file that is in a directory not controlled by any VCS, ask the user what VC backend to use to create a repository, create a new repository and register the file. - -*** FIXME: add info about the new VC functions: vc-root-diff and -vc-root-print-log once they stabilize. - -*** The log functions (C-x v l and C-x v L) do not show the full log -by default anymore. The number of entries shown can be chosen -interactively with a prefix argument, by customizing -vc-log-show-limit. The log buffer display buttons that can be used -to change the number of entries shown. -RCS, SCCS, CVS do not support this feature. - ++++ +*** New command `vc-root-print-log', bound to `C-x v L'. +This displays a `*vc-change-log*' buffer showing the history of the +version-controlled directory tree as a whole. ++++ +*** New command `vc-root-diff', bound to `C-x v D'. +This is similar to `vc-diff', but compares the entire directory tree +of the current VC directory with its working revision. ++++ +*** `C-x v l' and `C-x v L' do not show the full log by default. +The number of entries shown can be chosen interactively with a prefix +argument, or by customizing vc-log-show-limit. The `*vc-change-log*' +buffer now contains buttons at the end of the buffer, which can be +used to increase the number of entries shown. RCS, SCCS, and CVS do +not support this feature. +--- *** vc-annotate supports annotations through file copies and renames, it displays the old names for the files and it can show logs/diffs for the corresponding lines. Currently only Git and Mercurial take advantage of this feature. - +--- *** The log command in vc-annotate can display a single log entry instead of redisplaying the full log. The RCS, CVS and SCCS VC backends do not support this. - +--- *** When a file is not found, VC will not try to check it out of RCS anymore. -*** Diff and log operations can be used from dired buffers. +*** Diff and log operations can be used from Dired buffers. *** vc-git changes @@ -330,7 +342,7 @@ *** vc-bzr supports operating with shelves: the shelve list is displayed in the *vc-dir* header, shelves can be created, removed and applied. - +--- *** log-edit-strip-single-file-name controls whether or not single filenames are stripped when copying text from the ChangeLog to the *VC-Log* buffer. @@ -355,11 +367,6 @@ the command asynchronously without the need to manually add ampersand to the end of the command. Its output appears in the buffer `*Async Shell Command*'. - -*** Isearch searches in the comint/shell input history when the new variable -`comint-history-isearch' is non-nil. New commands `comint-history-isearch-backward' -and `comint-history-isearch-backward-regexp' (bound to M-r) start Isearch -in the input history regardless of the value of `comint-history-isearch'. +++ *** Interactively `multi-isearch-buffers' and `multi-isearch-buffers-regexp' read buffer names to search, one by one, ended with RET. With a prefix @@ -414,6 +421,7 @@ ** htmlfontify.el turns a fontified Emacs buffer into an HTML page. ++++ ** js.el is a new major mode for JavaScript files. ** imap-hash.el is a new library to address IMAP mailboxes as hashtables. @@ -523,9 +531,9 @@ *** make-network-process can now also create `seqpacket' Unix sockets. ** Loading changes - +--- *** eval-next-after-load is obsolete. - ++++ *** New hook `after-load-functions' run after loading an Elisp file. ** Byte compilation changes diff -r 3e1f021606db -r debd2dae3330 etc/PROBLEMS --- a/etc/PROBLEMS Tue Mar 23 10:03:53 2010 +0900 +++ b/etc/PROBLEMS Tue Mar 30 16:48:06 2010 +0900 @@ -2478,6 +2478,26 @@ 4.1.1, and 4.1.2, are currently the _only_ versions known to succeed in building Emacs (as of v22.1). +*** Building the native MS-Windows port fails due to unresolved externals + +The linker error messages look like this: + + oo-spd/i386/ctags.o:ctags.c:(.text+0x156e): undefined reference to `_imp__re_set_syntax' + collect2: ld returned 1 exit status + +This happens because GCC finds an incompatible header regex.h +somewhere on the include path, before the version of regex.h supplied +with Emacs. One such incompatible version of regex.h is part of the +GnuWin32 Regex package. + +The solution is to remove the incompatible regex.h from the include +path, when compiling Emacs. Alternatively, re-run the configure.bat +script with the "-isystem C:/GnuWin32/include" switch (adapt for your +system's place where you keep the GnuWin32 include files) -- this will +cause the compiler to search headers in the directories specified by +the Emacs Makefile _before_ it looks in the GnuWin32 include +directories. + *** Building the native MS-Windows port with Cygwin GCC can fail. Emacs may not build using some Cygwin builds of GCC, such as Cygwin diff -r 3e1f021606db -r debd2dae3330 etc/images/icons/hicolor/scalable/apps/emacs.svg --- a/etc/images/icons/hicolor/scalable/apps/emacs.svg Tue Mar 23 10:03:53 2010 +0900 +++ b/etc/images/icons/hicolor/scalable/apps/emacs.svg Tue Mar 30 16:48:06 2010 +0900 @@ -1,8 +1,16 @@ + - + + Make tmm-menubar work for the Buffers menu again. + * tmm.el (tmm-prompt): Also handle keymap entries in the form of + vectors rather than cons cells, as used in menu-bar-update-buffers. + +2010-03-28 Chong Yidong + + * progmodes/js.el (js-auto-indent-flag, js-mode-map) + (js-insert-and-indent): Revert 2009-08-15 change, restoring + electric punctuation for "{}();,:" (Bug#5586). + + * mail/sendmail.el (mail-default-directory): Doc fix. + +2010-03-27 Chong Yidong + + * mail/sendmail.el (mail-default-directory): Doc fix. + +2010-03-27 Eli Zaretskii + + * subr.el (version-regexp-alist, version-to-list) + (version-list-<, version-list-=, version-list-<=) + (version-list-not-zero, version<, version<=, version=): Doc fix. + (Bug#5744). + +2010-03-26 YAMAMOTO Mitsuharu + Nick Roberts + + * progmodes/gdb-ui.el (gdb-apple-test): New function. + (gdb-init-1): Use it. + +2010-02-10 Dan Nicolaescu + + * vc.el (vc-root-diff): Doc fix. + +2010-03-25 Chong Yidong + + * vc.el (vc-print-log, vc-print-root-log): Doc fix. + + * simple.el (append-to-buffer): Fix last change. + +2010-03-24 Chong Yidong + + * simple.el (append-to-buffer): Ensure that point is preserved if + BUFFER is the current buffer. Suggested by YAMAMOTO Mitsuharu. + (Bug#5749) + +2010-03-24 Stefan Monnier + + * progmodes/make-mode.el (makefile-rule-action-regex): Backtrack less. + (makefile-make-font-lock-keywords): Adjust rule since submatch 1 may + not be present any more. + +2010-03-24 Juanma Barranquero + + * faces.el (set-face-attribute): Fix typo in docstring. + (face-valid-attribute-values): Reflow docstring. + + * cedet/srecode/table.el (srecode-template-table): Fix docstring typo. + +2010-03-23 Glenn Morris + + * textmodes/flyspell.el (sgml-lexical-context): Autoload it (Bug#5752). + 2010-03-21 Chong Yidong * indent.el (indent-for-tab-command): Doc fix. 2010-03-22 Alan Mackenzie - * progmodes/cc-engine.el (c-remove-stale-state-cache): Fix - off-by-one error. Fixes bug #5747. + * progmodes/cc-engine.el (c-remove-stale-state-cache): + Fix off-by-one error. Fixes bug #5747. 2010-03-22 Juanma Barranquero * image-dired.el (image-dired-display-thumbs): Fix typo in docstring. (image-dired-read-comment): Doc fix. - * json.el (json-object-type, json-array-type, json-key-type, json-false) - (json-null, json-read-number): + * json.el (json-object-type, json-array-type, json-key-type) + (json-false, json-null, json-read-number): * minibuffer.el (completion-in-region-functions): * calendar/cal-tex.el (cal-tex-daily-end, cal-tex-number-weeks) (cal-tex-cursor-week): @@ -59,8 +123,8 @@ 2010-03-13 Michael Albinus - * net/tramp.el (tramp-find-executable): Use - `tramp-get-connection-buffer'. Make the regexp for checking + * net/tramp.el (tramp-find-executable): + Use `tramp-get-connection-buffer'. Make the regexp for checking output of "wc -l" more robust. (tramp-find-shell): Use another shell but /bin/sh on OpenSolaris. (tramp-open-connection-setup-interactive-shell): Remove workaround diff -r 3e1f021606db -r debd2dae3330 lisp/cedet/srecode/table.el --- a/lisp/cedet/srecode/table.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/cedet/srecode/table.el Tue Mar 30 16:48:06 2010 +0900 @@ -66,7 +66,7 @@ If this is nil, then this template table belongs to a set of generic templates that can be used with no additional dictionary values. When it is non-nil, it is assumed the template macros need specialized -Emacs Lisp code to fill in the dictoinary.") +Emacs Lisp code to fill in the dictionary.") (priority :initarg :priority :type number :documentation diff -r 3e1f021606db -r debd2dae3330 lisp/faces.el --- a/lisp/faces.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/faces.el Tue Mar 30 16:48:06 2010 +0900 @@ -590,7 +590,7 @@ attribute is changed on all frames). ARGS must come in pairs ATTRIBUTE VALUE. ATTRIBUTE must be a valid -face attribute name. All attributes can be set to `unspecified'; +face attribute name. All attributes can be set to `unspecified'; this fact is not further mentioned below. The following attributes are recognized: @@ -988,9 +988,9 @@ (defun face-valid-attribute-values (attribute &optional frame) "Return valid values for face attribute ATTRIBUTE. The optional argument FRAME is used to determine available fonts -and colors. If it is nil or not specified, the selected frame is -used. Value is an alist of (NAME . VALUE) if ATTRIBUTE expects a value -out of a set of discrete values. Value is `integerp' if ATTRIBUTE expects +and colors. If it is nil or not specified, the selected frame is used. +Value is an alist of (NAME . VALUE) if ATTRIBUTE expects a value out +of a set of discrete values. Value is `integerp' if ATTRIBUTE expects an integer value." (let ((valid (case attribute diff -r 3e1f021606db -r debd2dae3330 lisp/gnus/ChangeLog --- a/lisp/gnus/ChangeLog Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/gnus/ChangeLog Tue Mar 30 16:48:06 2010 +0900 @@ -1,3 +1,13 @@ +2010-03-29 Katsumi Yamaoka + + * mm-decode.el (mm-add-meta-html-tag): Fix regexp matching meta tag. + +2010-03-27 Chong Yidong + + * message.el (message-default-mail-headers): + (message-default-headers): Carry the value mail-default-headers over + into message-default-mail-headers, rather than message-default-headers. + 2010-03-22 Juanma Barranquero * message.el (message-interactive): Doc fix. diff -r 3e1f021606db -r debd2dae3330 lisp/gnus/message.el --- a/lisp/gnus/message.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/gnus/message.el Tue Mar 30 16:48:06 2010 +0900 @@ -1170,11 +1170,7 @@ :valid-regexp "^\\'" :error "All header lines must be newline terminated") -(defcustom message-default-headers - ;; Default to the value of `mail-default-headers' if available. - ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is unavailable - ;; unless sendmail.el is loaded. - (if (boundp 'mail-default-headers) mail-default-headers "") +(defcustom message-default-headers "" "*A string containing header lines to be inserted in outgoing messages. It is inserted before you edit the message, so you can edit or delete these lines." @@ -1187,16 +1183,18 @@ ;; Ease the transition from mail-mode to message-mode. See bugs#4431, 5555. (concat (if (and (boundp 'mail-default-reply-to) (stringp mail-default-reply-to)) - (format "Reply-to: %s\n" mail-default-reply-to) - "") + (format "Reply-to: %s\n" mail-default-reply-to)) (if (and (boundp 'mail-self-blind) mail-self-blind) - (format "BCC: %s\n" user-mail-address) - "") + (format "BCC: %s\n" user-mail-address)) (if (and (boundp 'mail-archive-file-name) (stringp mail-archive-file-name)) - (format "FCC: %s\n" mail-archive-file-name) - "")) + (format "FCC: %s\n" mail-archive-file-name)) + ;; Use the value of `mail-default-headers' if available. + ;; Note: as for Emacs 21, XEmacs 21.4 and 21.5, it is + ;; unavailable unless sendmail.el is loaded. + (if (boundp 'mail-default-headers) + mail-default-headers)) "*A string of header lines to be inserted in outgoing mails." :version "23.2" :group 'message-headers diff -r 3e1f021606db -r debd2dae3330 lisp/gnus/mm-decode.el --- a/lisp/gnus/mm-decode.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/gnus/mm-decode.el Tue Mar 30 16:48:06 2010 +0900 @@ -1265,7 +1265,7 @@ (goto-char (point-min)) (if (re-search-forward "\ ]*>" nil t) +text/\\(\\sw+\\)\\(?:\;\\s-*charset=\\(.+\\)\\)?[\"'][^>]*>" nil t) (if (and (match-beginning 2) (string-match "\\`html\\'" (match-string 1))) ;; Don't modify existing meta tag. diff -r 3e1f021606db -r debd2dae3330 lisp/mail/sendmail.el --- a/lisp/mail/sendmail.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/mail/sendmail.el Tue Mar 30 16:48:06 2010 +0900 @@ -417,9 +417,11 @@ ;;;###autoload (defcustom mail-default-directory (purecopy "~/") - "Directory for mail buffers. -Value of `default-directory' for mail buffers. -This directory is used for auto-save files of mail buffers." + "Value of `default-directory' for Mail mode buffers. +This directory is used for auto-save files of Mail mode buffers. + +Note that Message mode does not use this variable; it auto-saves +in `message-auto-save-directory'." :type '(directory :tag "Directory") :group 'sendmail :version "22.1") diff -r 3e1f021606db -r debd2dae3330 lisp/progmodes/gdb-ui.el --- a/lisp/progmodes/gdb-ui.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/progmodes/gdb-ui.el Tue Mar 30 16:48:06 2010 +0900 @@ -705,6 +705,9 @@ (if gdb-use-separate-io-buffer (gdb-clear-inferior-io)) + (if (eq system-type 'darwin) + (gdb-enqueue-input (list "server show version\n" 'gdb-apple-test))) + ;; Hack to see test for GDB 6.4+ (-stack-info-frame was implemented in 6.4) (gdb-enqueue-input (list "server interpreter mi -stack-info-frame\n" 'gdb-get-version))) @@ -736,6 +739,18 @@ (gdb-enqueue-input (list "server list MAIN__\n" 'ignore)) (gdb-enqueue-input (list "server info source\n" 'gdb-source-info))) +;; Workaround for some Apple versions of GDB that add ^M at EOL +;; after the command "server interpreter mi -stack-info-frame". +(defun gdb-apple-test () + (goto-char (point-min)) + (if (re-search-forward "(Apple version " nil t) + (let* ((process (get-buffer-process gud-comint-buffer)) + (coding-systems (process-coding-system process))) + (set-process-coding-system process + (coding-system-change-eol-conversion + (car coding-systems) 'dos) + (cdr coding-systems))))) + (defun gdb-get-version () (goto-char (point-min)) (if (re-search-forward "Undefined\\( mi\\)* command:" nil t) diff -r 3e1f021606db -r debd2dae3330 lisp/progmodes/js.el --- a/lisp/progmodes/js.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/progmodes/js.el Tue Mar 30 16:48:06 2010 +0900 @@ -436,6 +436,13 @@ :type 'integer :group 'js) +(defcustom js-auto-indent-flag t + "Whether to automatically indent when typing punctuation characters. +If non-nil, the characters {}();,: also indent the current line +in Javascript mode." + :type 'boolean + :group 'js) + (defcustom js-flat-functions nil "Treat nested functions as top-level functions in `js-mode'. This applies to function movement, marking, and so on." @@ -483,6 +490,9 @@ (defvar js-mode-map (let ((keymap (make-sparse-keymap))) + (mapc (lambda (key) + (define-key keymap key #'js-insert-and-indent)) + '("{" "}" "(" ")" ":" ";" ",")) (define-key keymap [(control ?c) (meta ?:)] #'js-eval) (define-key keymap [(control ?c) (control ?j)] #'js-set-js-context) (define-key keymap [(control meta ?x)] #'js-eval-defun) @@ -498,6 +508,21 @@ keymap) "Keymap for `js-mode'.") +(defun js-insert-and-indent (key) + "Run the command bound to KEY, and indent if necessary. +Indentation does not take place if point is in a string or +comment." + (interactive (list (this-command-keys))) + (call-interactively (lookup-key (current-global-map) key)) + (let ((syntax (save-restriction (widen) (syntax-ppss)))) + (when (or (and (not (nth 8 syntax)) + js-auto-indent-flag) + (and (nth 4 syntax) + (eq (current-column) + (1+ (current-indentation))))) + (indent-according-to-mode)))) + + ;;; Syntax table and parsing (defvar js-mode-syntax-table diff -r 3e1f021606db -r debd2dae3330 lisp/progmodes/make-mode.el --- a/lisp/progmodes/make-mode.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/progmodes/make-mode.el Tue Mar 30 16:48:06 2010 +0900 @@ -272,7 +272,7 @@ "Characters to skip to find a line that might be a dependency.") (defvar makefile-rule-action-regex - "^\t[ \t]*\\([-@]*\\)[ \t]*\\(\\(?:.*\\\\\n\\)*.*\\)" + "^\t[ \t]*\\(?:\\([-@]+\\)[ \t]*\\)\\(.*\\(?:\\\\\n.*\\)*\\)" "Regex used to highlight rule action lines in font lock mode.") (defconst makefile-makepp-rule-action-regex @@ -355,8 +355,9 @@ (3 'font-lock-string-face prepend t)) ;; Rule actions. + ;; FIXME: When this spans multiple lines we need font-lock-multiline. (makefile-match-action - (1 font-lock-type-face) + (1 font-lock-type-face nil t) (2 'makefile-shell prepend) ;; Only makepp has builtin commands. (3 font-lock-builtin-face prepend t)) diff -r 3e1f021606db -r debd2dae3330 lisp/simple.el --- a/lisp/simple.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/simple.el Tue Mar 30 16:48:06 2010 +0900 @@ -3472,13 +3472,14 @@ (let* ((append-to (get-buffer-create buffer)) (windows (get-buffer-window-list append-to t t)) point) - (with-current-buffer append-to - (setq point (point)) - (barf-if-buffer-read-only) - (insert-buffer-substring oldbuf start end) - (dolist (window windows) - (when (= (window-point window) point) - (set-window-point window (point)))))))) + (save-excursion + (with-current-buffer append-to + (setq point (point)) + (barf-if-buffer-read-only) + (insert-buffer-substring oldbuf start end) + (dolist (window windows) + (when (= (window-point window) point) + (set-window-point window (point))))))))) (defun prepend-to-buffer (buffer start end) "Prepend to specified buffer the text of the region. diff -r 3e1f021606db -r debd2dae3330 lisp/subr.el --- a/lisp/subr.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/subr.el Tue Mar 30 16:48:06 2010 +0900 @@ -3573,11 +3573,11 @@ ("^[-_+ ]cvs$" . -3) ; treat "1.2.3-CVS" as alpha release ("^[-_+ ]?b\\(eta\\)?$" . -2) ("^[-_+ ]?\\(pre\\|rc\\)$" . -1)) - "*Specify association between non-numeric version part and a priority. + "*Specify association between non-numeric version and its priority. This association is used to handle version string like \"1.0pre2\", \"0.9alpha1\", etc. It's used by `version-to-list' (which see) to convert the -non-numeric part to an integer. For example: +non-numeric part of a version string to an integer. For example: String Version Integer List Version \"1.0pre2\" (1 0 -1 2) @@ -3595,15 +3595,15 @@ Where: REGEXP regexp used to match non-numeric part of a version string. - It should begin with a `^' anchor and end with a `$' to + It should begin with the `^' anchor and end with a `$' to prevent false hits. Letter-case is ignored while matching REGEXP. -PRIORITY negative integer which indicate the non-numeric priority.") +PRIORITY a negative integer specifying non-numeric priority of REGEXP.") (defun version-to-list (ver) - "Convert version string VER into an integer list. + "Convert version string VER into a list of integers. The version syntax is given by the following EBNF: @@ -3617,17 +3617,17 @@ The NUMBER part is optional if SEPARATOR is a match for an element in `version-regexp-alist'. -As an example of valid version syntax: +Examples of valid version syntax: 1.0pre2 1.0.7.5 22.8beta3 0.9alpha1 6.9.30Beta -As an example of invalid version syntax: +Examples of invalid version syntax: 1.0prepre2 1.0..7.5 22.8X3 alpha3.2 .5 -As an example of version convertion: - - String Version Integer List Version +Examples of version conversion: + + Version String Version as a List of Integers \"1.0.7.5\" (1 0 7 5) \"1.0pre2\" (1 0 -1 2) \"1.0PRE2\" (1 0 -1 2) @@ -3673,12 +3673,12 @@ (defun version-list-< (l1 l2) - "Return t if integer list L1 is lesser than L2. - -Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0), -etc. That is, the trailing zeroes are irrelevant. Also, integer -list (1) is greater than (1 -1) which is greater than (1 -2) -which is greater than (1 -3)." + "Return t if L1, a list specification of a version, is lower than L2. + +Note that a version specified by the list (1) is equal to (1 0), +\(1 0 0), (1 0 0 0), etc. That is, the trailing zeros are insignificant. +Also, a version given by the list (1) is higher than (1 -1), which in +turn is higher than (1 -2), which is higher than (1 -3)." (while (and l1 l2 (= (car l1) (car l2))) (setq l1 (cdr l1) l2 (cdr l2))) @@ -3694,12 +3694,12 @@ (defun version-list-= (l1 l2) - "Return t if integer list L1 is equal to L2. - -Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0), -etc. That is, the trailing zeroes are irrelevant. Also, integer -list (1) is greater than (1 -1) which is greater than (1 -2) -which is greater than (1 -3)." + "Return t if L1, a list specification of a version, is equal to L2. + +Note that a version specified by the list (1) is equal to (1 0), +\(1 0 0), (1 0 0 0), etc. That is, the trailing zeros are insignificant. +Also, a version given by the list (1) is higher than (1 -1), which in +turn is higher than (1 -2), which is higher than (1 -3)." (while (and l1 l2 (= (car l1) (car l2))) (setq l1 (cdr l1) l2 (cdr l2))) @@ -3715,7 +3715,7 @@ (defun version-list-<= (l1 l2) - "Return t if integer list L1 is lesser than or equal to L2. + "Return t if L1, a list specification of a version, is lower or equal to L2. Note that integer list (1) is equal to (1 0), (1 0 0), (1 0 0 0), etc. That is, the trailing zeroes are irrelevant. Also, integer @@ -3735,9 +3735,9 @@ (t (<= 0 (version-list-not-zero l2))))) (defun version-list-not-zero (lst) - "Return the first non-zero element of integer list LST. - -If all LST elements are zeroes or LST is nil, return zero." + "Return the first non-zero element of LST, which is a list of integers. + +If all LST elements are zeros or LST is nil, return zero." (while (and lst (zerop (car lst))) (setq lst (cdr lst))) (if lst @@ -3747,31 +3747,31 @@ (defun version< (v1 v2) - "Return t if version V1 is lesser than V2. + "Return t if version V1 is lower (older) than V2. Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", -etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\" -is greater than \"1pre\" which is greater than \"1beta\" which is greater than -\"1alpha\"." +etc. That is, the trailing \".0\"s are insignificant. Also, version +string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", +which is higher than \"1alpha\"." (version-list-< (version-to-list v1) (version-to-list v2))) (defun version<= (v1 v2) - "Return t if version V1 is lesser than or equal to V2. + "Return t if version V1 is lower (older) than or equal to V2. Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", -etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\" -is greater than \"1pre\" which is greater than \"1beta\" which is greater than -\"1alpha\"." +etc. That is, the trailing \".0\"s are insignificant.. Also, version +string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", +which is higher than \"1alpha\"." (version-list-<= (version-to-list v1) (version-to-list v2))) (defun version= (v1 v2) "Return t if version V1 is equal to V2. Note that version string \"1\" is equal to \"1.0\", \"1.0.0\", \"1.0.0.0\", -etc. That is, the trailing \".0\"s are irrelevant. Also, version string \"1\" -is greater than \"1pre\" which is greater than \"1beta\" which is greater than -\"1alpha\"." +etc. That is, the trailing \".0\"s are insignificant.. Also, version +string \"1\" is higher (newer) than \"1pre\", which is higher than \"1beta\", +which is higher than \"1alpha\"." (version-list-= (version-to-list v1) (version-to-list v2))) diff -r 3e1f021606db -r debd2dae3330 lisp/textmodes/flyspell.el --- a/lisp/textmodes/flyspell.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/textmodes/flyspell.el Tue Mar 30 16:48:06 2010 +0900 @@ -359,7 +359,7 @@ (put 'html-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify) (put 'nxml-mode 'flyspell-mode-predicate 'sgml-mode-flyspell-verify) -(declare-function sgml-lexical-context "sgml-mode" &optional limit) +(autoload 'sgml-lexical-context "sgml-mode") (defun sgml-mode-flyspell-verify () "Function used for `flyspell-generic-check-word-predicate' in SGML mode. diff -r 3e1f021606db -r debd2dae3330 lisp/tmm.el --- a/lisp/tmm.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/tmm.el Tue Mar 30 16:48:06 2010 +0900 @@ -170,7 +170,11 @@ (mapc (lambda (elt) (if (stringp elt) (setq gl-str elt) - (and (listp elt) (tmm-get-keymap elt not-menu)))) + (cond + ((listp elt) (tmm-get-keymap elt not-menu)) + ((vectorp elt) + (dotimes (i (length elt)) + (tmm-get-keymap (cons i (aref elt i)) not-menu)))))) menu) ;; Choose an element of tmm-km-list; put it in choice. (if (and not-menu (= 1 (length tmm-km-list))) diff -r 3e1f021606db -r debd2dae3330 lisp/vc.el --- a/lisp/vc.el Tue Mar 23 10:03:53 2010 +0900 +++ b/lisp/vc.el Tue Mar 30 16:48:06 2010 +0900 @@ -1609,9 +1609,10 @@ ;;;###autoload (defun vc-root-diff (historic &optional not-urgent) - "Display diffs between file revisions. -Normally this compares the currently selected fileset with their -working revisions. With a prefix argument HISTORIC, it reads two revision + "Display diffs between VC-controlled whole tree revisions. +Normally, this compares the tree corresponding to the current +fileset with the working revision. +With a prefix argument HISTORIC, prompt for two revision designators specifying which revisions to compare. The optional argument NOT-URGENT non-nil means it is ok to say no to @@ -1931,7 +1932,12 @@ ;;;###autoload (defun vc-print-log (&optional working-revision limit) "List the change log of the current fileset in a window. -If WORKING-REVISION is non-nil, leave the point at that revision." +If WORKING-REVISION is non-nil, leave point at that revision. +If LIMIT is non-nil, it should be a number specifying the maximum +number of revisions to show; the default is `vc-log-show-limit'. + +When called interactively with a prefix argument, prompt for +WORKING-REVISION and LIMIT." (interactive (cond (current-prefix-arg @@ -1955,7 +1961,10 @@ ;;;###autoload (defun vc-print-root-log (&optional limit) - "List the change log of for the current VC controlled tree in a window." + "List the change log for the current VC controlled tree in a window. +If LIMIT is non-nil, it should be a number specifying the maximum +number of revisions to show; the default is `vc-log-show-limit'. +When called interactively with a prefix argument, prompt for LIMIT." (interactive (cond (current-prefix-arg diff -r 3e1f021606db -r debd2dae3330 src/ChangeLog --- a/src/ChangeLog Tue Mar 23 10:03:53 2010 +0900 +++ b/src/ChangeLog Tue Mar 30 16:48:06 2010 +0900 @@ -1,3 +1,28 @@ +2010-03-29 Adrian Robert + + * xdisp.c (x_consider_frame_title, update_window_cursor): Remove + HAVE_NS conditionals. + (prepare_menu_bars)[HAVE_NS]: Call ns_set_doc_edited. + + * nsfns.m (x_implicitly_set_name): If frame-title-format is t, use + filename for the title. + (ns_set_doc_edited): Do nothing if the selected window is a + minibuffer window. + + * nsterm.h: Add prototypes for ns_set_name_as_filename and + ns_set_doc_edited. + + * nsterm.m: Remove unneeded prototype. + +2010-03-28 Glenn Morris + + * Makefile.in (SOME_MACHINE_OBJECTS): Ensure dbus stuff is always + in the DOC file. (Bug#5336) + +2010-03-24 Chong Yidong + + * xdisp.c (pos_visible_p): Revert 2008-01-25 change (Bug#5730). + 2010-03-20 Jan Djärv * frame.c (x_get_arg): Handle RES_TYPE_BOOLEAN_NUMBER (bug #5736). diff -r 3e1f021606db -r debd2dae3330 src/ChangeLog.7 --- a/src/ChangeLog.7 Tue Mar 23 10:03:53 2010 +0900 +++ b/src/ChangeLog.7 Tue Mar 30 16:48:06 2010 +0900 @@ -7154,9 +7154,9 @@ (ENCODE_ISO_CHARACTER): Bug of handling return value of unify_char fixed. (DECODE_SJIS_BIG5_CHARACTER): New macro. - (decode_coding_sjis_big5): Handle character unificatoin table. + (decode_coding_sjis_big5): Handle character unification table. Use macro DECODE_SJIS_BIG5_CHARACTER. - (encode_coding_sjis_big5): Handle character unificatoin table. + (encode_coding_sjis_big5): Handle character unification table. Use macro ENCODE_SJIS_BIG5_CHARACTER. (setup_coding_system): Handle members character_unification_table_for_decode and diff -r 3e1f021606db -r debd2dae3330 src/Makefile.in --- a/src/Makefile.in Tue Mar 23 10:03:53 2010 +0900 +++ b/src/Makefile.in Tue Mar 30 16:48:06 2010 +0900 @@ -579,7 +579,7 @@ in case they are needed there. */ SOME_MACHINE_OBJECTS = dosfns.o msdos.o \ xterm.o xfns.o xmenu.o xselect.o xrdb.o xsmfns.o fringe.o image.o \ - fontset.o \ + fontset.o dbusbind.o \ nsterm.o nsfns.o nsmenu.o nsselect.o nsimage.o nsfont.o \ w32.o w32console.o w32fns.o w32heap.o w32inevt.o \ w32menu.o w32proc.o w32reg.o w32select.o w32term.o w32xfns.o $(FONT_DRIVERS) diff -r 3e1f021606db -r debd2dae3330 src/nsfns.m --- a/src/nsfns.m Tue Mar 23 10:03:53 2010 +0900 +++ b/src/nsfns.m Tue Mar 30 16:48:06 2010 +0900 @@ -81,6 +81,7 @@ extern Lisp_Object Qheight, Qminibuffer, Qname, Qonly, Qwidth; extern Lisp_Object Qunsplittable, Qmenu_bar_lines, Qbuffer_predicate, Qtitle; extern Lisp_Object Qnone; +extern Lisp_Object Vframe_title_format; Lisp_Object Qbuffered; Lisp_Object Qfontsize; @@ -583,6 +584,8 @@ NSTRACE (x_implicitly_set_name); if (FRAME_ICONIFIED_P (f)) ns_set_name_iconic (f, arg, 0); + else if (FRAME_NS_P (f) && EQ (Vframe_title_format, Qt)) + ns_set_name_as_filename (f); else ns_set_name (f, arg, 0); } @@ -627,14 +630,14 @@ BLOCK_INPUT; pool = [[NSAutoreleasePool alloc] init]; - name =XBUFFER (buf)->filename; + name = XBUFFER (buf)->filename; if (NILP (name) || FRAME_ICONIFIED_P (f)) name =XBUFFER (buf)->name; if (FRAME_ICONIFIED_P (f) && !NILP (f->icon_name)) name = f->icon_name; if (NILP (name)) - name = build_string([ns_app_name UTF8String]); + name = build_string ([ns_app_name UTF8String]); else CHECK_STRING (name); @@ -687,11 +690,14 @@ { NSView *view = FRAME_NS_VIEW (f); NSAutoreleasePool *pool; - BLOCK_INPUT; - pool = [[NSAutoreleasePool alloc] init]; - [[view window] setDocumentEdited: !NILP (arg)]; - [pool release]; - UNBLOCK_INPUT; + if (!MINI_WINDOW_P (XWINDOW (f->selected_window))) + { + BLOCK_INPUT; + pool = [[NSAutoreleasePool alloc] init]; + [[view window] setDocumentEdited: !NILP (arg)]; + [pool release]; + UNBLOCK_INPUT; + } } diff -r 3e1f021606db -r debd2dae3330 src/nsterm.h --- a/src/nsterm.h Tue Mar 23 10:03:53 2010 +0900 +++ b/src/nsterm.h Tue Mar 30 16:48:06 2010 +0900 @@ -708,6 +708,8 @@ extern int ns_lisp_to_cursor_type (); extern Lisp_Object ns_cursor_type_to_lisp (int arg); extern Lisp_Object Qnone; +extern void ns_set_name_as_filename (struct frame *f); +extern void ns_set_doc_edited (struct frame *f, Lisp_Object arg); extern int ns_defined_color (struct frame *f, char *name, XColor *color_def, int alloc, diff -r 3e1f021606db -r debd2dae3330 src/nsterm.m --- a/src/nsterm.m Tue Mar 23 10:03:53 2010 +0900 +++ b/src/nsterm.m Tue Mar 30 16:48:06 2010 +0900 @@ -4173,8 +4173,6 @@ ns_send_appdefined (-2); } -extern void update_window_cursor (struct window *w, int on); - - (void)fd_handler: (NSTimer *) fdEntry /* -------------------------------------------------------------------------- Check data waiting on file descriptors and terminate if so diff -r 3e1f021606db -r debd2dae3330 src/xdisp.c --- a/src/xdisp.c Tue Mar 23 10:03:53 2010 +0900 +++ b/src/xdisp.c Tue Mar 30 16:48:06 2010 +0900 @@ -1375,33 +1375,7 @@ visible_p = 1; if (visible_p) { - if (it_method == GET_FROM_BUFFER) - { - Lisp_Object window, prop; - - XSETWINDOW (window, w); - prop = Fget_char_property (make_number (charpos), - Qinvisible, window); - - /* If charpos coincides with invisible text covered with an - ellipsis, use the first glyph of the ellipsis to compute - the pixel positions. */ - if (TEXT_PROP_MEANS_INVISIBLE (prop) == 2) - { - struct glyph_row *row = it.glyph_row; - struct glyph *glyph = row->glyphs[TEXT_AREA]; - struct glyph *end = glyph + row->used[TEXT_AREA]; - int x = row->x; - - for (; glyph < end - && (!BUFFERP (glyph->object) - || glyph->charpos < charpos); - glyph++) - x += glyph->pixel_width; - top_x = x; - } - } - else if (it_method == GET_FROM_DISPLAY_VECTOR) + if (it_method == GET_FROM_DISPLAY_VECTOR) { /* We stopped on the last glyph of a display vector. Try and recompute. Hack alert! */ @@ -9498,32 +9472,7 @@ if (! STRINGP (f->name) || SBYTES (f->name) != len || bcmp (title, SDATA (f->name), len) != 0) - { -#ifdef HAVE_NS - if (FRAME_NS_P (f)) - { - if (!MINI_WINDOW_P(XWINDOW(f->selected_window))) - { - if (EQ (fmt, Qt)) - ns_set_name_as_filename (f); - else - x_implicitly_set_name (f, make_string(title, len), - Qnil); - } - } - else -#endif - x_implicitly_set_name (f, make_string (title, len), Qnil); - } -#ifdef HAVE_NS - if (FRAME_NS_P (f)) - { - /* do this also for frames with explicit names */ - ns_implicitly_set_icon_type(f); - ns_set_doc_edited(f, Fbuffer_modified_p - (XWINDOW (f->selected_window)->buffer), Qnil); - } -#endif + x_implicitly_set_name (f, make_string (title, len), Qnil); } } @@ -9620,6 +9569,11 @@ #ifdef HAVE_WINDOW_SYSTEM update_tool_bar (f, 0); #endif +#ifdef HAVE_NS + if (windows_or_buffers_changed) + ns_set_doc_edited (f, Fbuffer_modified_p + (XWINDOW (f->selected_window)->buffer)); +#endif UNGCPRO; } @@ -22679,9 +22633,6 @@ /* Switch the display of W's cursor on or off, according to the value of ON. */ -#ifndef HAVE_NS -static -#endif void update_window_cursor (w, on) struct window *w; diff -r 3e1f021606db -r debd2dae3330 test/ChangeLog --- a/test/ChangeLog Tue Mar 23 10:03:53 2010 +0900 +++ b/test/ChangeLog Tue Mar 30 16:48:06 2010 +0900 @@ -1,3 +1,34 @@ +2010-03-29 Chong Yidong + + * cedet/semantic-ia-utest.el + (semantic-symref-test-count-hits-in-tag): Add function, from + semantic-test.el. + + * cedet/tests/test.cpp: + * cedet/tests/test.py: + * cedet/tests/teststruct.cpp: + * cedet/tests/testtemplates.cpp: + * cedet/tests/testusing.cpp: + * cedet/tests/scopetest.cpp: + * cedet/tests/scopetest.java: Files deleted. + + * cedet/tests/test.make: + * cedet/tests/test.c: + * cedet/tests/testjavacomp.java: + * cedet/tests/testspp.c: + * cedet/tests/testsppreplace.c: + * cedet/tests/testsppreplaced.c: + * cedet/tests/testsubclass.cpp: + * cedet/tests/testsubclass.hh: + * cedet/tests/testtypedefs.cpp: + * cedet/tests/testvarnames.c: + * cedet/tests/test.el: + * cedet/tests/testdoublens.cpp: + * cedet/tests/testdoublens.hpp: Add copyright header. + + * cedet/semantic-tests.el (semanticdb-test-gnu-global): Remove + reference to deleted files. + 2010-02-19 Ulf Jasper * icalendar-testsuite.el diff -r 3e1f021606db -r debd2dae3330 test/cedet/semantic-ia-utest.el --- a/test/cedet/semantic-ia-utest.el Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/semantic-ia-utest.el Tue Mar 30 16:48:06 2010 +0900 @@ -42,10 +42,7 @@ "tests/testdoublens.cpp" "tests/testsubclass.cpp" "tests/testtypedefs.cpp" - "tests/teststruct.cpp" - "tests/testtemplates.cpp" "tests/testfriends.cpp" - "tests/testusing.cpp" "tests/testnsp.cpp" "tests/testsppcomplete.c" "tests/testvarnames.c" @@ -419,6 +416,27 @@ )) +(defun semantic-symref-test-count-hits-in-tag () + "Lookup in the current tag the symbol under point. +Then count all the other references to the same symbol within the +tag that contains point, and return that." + (interactive) + (let* ((ctxt (semantic-analyze-current-context)) + (target (car (reverse (oref ctxt prefix)))) + (tag (semantic-current-tag)) + (start (current-time)) + (Lcount 0)) + (when (semantic-tag-p target) + (semantic-symref-hits-in-region + target (lambda (start end prefix) (setq Lcount (1+ Lcount))) + (semantic-tag-start tag) + (semantic-tag-end tag)) + (when (interactive-p) + (message "Found %d occurrences of %s in %.2f seconds" + Lcount (semantic-tag-name target) + (semantic-elapsed-time start (current-time)))) + Lcount))) + (defun semantic-src-utest-buffer-refs () "Run a sym-ref counting unit-test pass in the current buffer." diff -r 3e1f021606db -r debd2dae3330 test/cedet/semantic-tests.el --- a/test/cedet/semantic-tests.el Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/semantic-tests.el Tue Mar 30 16:48:06 2010 +0900 @@ -107,53 +107,6 @@ (data-debug-new-buffer "*SemanticDB Gnu Global Result*") (data-debug-insert-thing result "?" "")))) -;;; From semantic-find - -(require 'semantic/find) - -(defun semantic-find-benchmark () - "Run some simple benchmarks to see how we are doing. -Optional argument ARG is the number of iterations to run." - (interactive) - (require 'benchmark) - (let ((f-name nil) - (b-name nil) - (f-comp) - (b-comp) - (f-regex) - ) - (garbage-collect) - (setq f-name - (benchmark-run-compiled - 1000 (semantic-find-first-tag-by-name "class3" - "test/test.cpp"))) - (garbage-collect) - (setq b-name - (benchmark-run-compiled - 1000 (semantic-brute-find-first-tag-by-name "class3" - "test/test.cpp"))) - (garbage-collect) - (setq f-comp - (benchmark-run-compiled - 1000 (semantic-find-tags-for-completion "method" - "test/test.cpp"))) - (garbage-collect) - (setq b-comp - (benchmark-run-compiled - 1000 (semantic-brute-find-tag-by-name-regexp "^method" - "test/test.cpp"))) - (garbage-collect) - (setq f-regex - (benchmark-run-compiled - 1000 (semantic-find-tags-by-name-regexp "^method" - "test/test.cpp"))) - - (message "Name [new old] [ %.3f %.3f ] Complete [newc/new old] [ %.3f/%.3f %.3f ]" - (car f-name) (car b-name) - (car f-comp) (car f-regex) - (car b-comp)) - )) - ;;; From semantic-format (require 'semantic/format) diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/scopetest.cpp --- a/test/cedet/tests/scopetest.cpp Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,48 +0,0 @@ -/* Test scoping rules for c++ in the analyzer. */ - -namespace { - - class aclass2; // Forward reference. - - class aclass1 { - private: - int attrp1; - int amethodp1(int argp1); - aclass2 areference; - protected: - int attrpr1; - public: - int attr1; - int amethod1(int arg1); - }; -} - -namespace { - class aclass2 : public aclass1 - { - private: - int attrp2; - int amethodp2(int argp1); - public: - aclass2(int aninitvalue); - ~aclass2(); - int attr2; - int amethod2(int arg2); - }; -} - -aclass2::aclass2(init aninitvalue) -{ - /* This is a comment that talks about aclass1 */ - aclass1; -} - -int aclass2::amethod2(int arg2) -{ - int alocalvar; - float q; - - ac; -} - -// arch-tag: 9336063c-6b2e-4677-a390-d2dd091a2474 diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/scopetest.java --- a/test/cedet/tests/scopetest.java Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -class Foo { - - public void a1() {} - - class Bar { - - public int a2() {} - - public void b() { - a // -1- - } - - class Baz { - - public int a3() {} - - public Baz(int a4) { - a // -2- - } - - } - - } - -} \ No newline at end of file diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/templates.cpp --- a/test/cedet/tests/templates.cpp Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,130 +0,0 @@ -// C++ examples and requests from Klaus Berndl - -// template in a unnamed namespace -namespace -{ - template - Target lexical_cast(Source arg) - { - std::stringstream interpreter; - Target result; - - if(!(interpreter << arg) || !(interpreter >> result) || - !(interpreter >> std::ws).eof()) - throw bad_lexical_cast(); - - return result; - } -} - - -template class Vector -{ -private: - static T* v; - int sz; - -public: - T& elem(int i) {return v[i];} - virtual ~Vector (); - -protected: - Vector (); -}; - -template <> class Vector -{ -private: - void** v; - int sz; - -public: - Vector (); - virtual int func1(int i); - virtual int func2(int i) = 0; - static virtual int func3(int i) = 0; - void*& elem(int i) {return v[i];} - //... -}; - -// template contains namespace -typedef vector ActionList; - -// declaration of some template-types -map** map_var; - -map_with_size map_size_var; -typedef map_with_size SizedMap; - -map_with_10_size* pMap_size10_var; -typedef map_with_10_size Size10Map; - -// a function which such a template-argument -void* test_function(map* pMap); - - -template class Vector : private Vector -{ -public: - typedef Vector Base; - - Vector () : Base() {} - - T*& elem(int i) {return static_cast(Base::elem(i));} - //... -}; - -// outside method implementation of a template-class -template T& Vector::elem(int i) -{ - return C; -} - -// same but qualified with a namespace Testnamespace -template T& Testnamespace::Vector::elem(int i) -{ - return C; -} - -// function templates with keyword typename -template -Target lexical_cast(Source arg) -{ - std::stringstream interpreter; - Target result; - - if(!(interpreter << arg) || !(interpreter >> result) || - !(interpreter >> std::ws).eof()) - throw bad_lexical_cast(); - - return result; -} - -template -static -typename T::_ptr_type -getService(const std::string& pServiceName, const int pRetries=20) -{ - return T::_narrow(getServiceObject(pServiceName, pRetries)); -} - -// function template declaration -template void sort(vector&); -// complex function template definition -template volatile ***&i> -map -sort(const vector& v) -{ - return; -} - -// variable declarations of template-types -foo *bar1; -foo *bar2; -foo bar3; -foo<0> bar0; - -class SomeName; -class OtherName; - -// arch-tag: 55ff74de-74dc-44ad-8252-50dc5f3492c3 diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/test.c --- a/test/cedet/tests/test.c Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/test.c Tue Mar 30 16:48:06 2010 +0900 @@ -1,6 +1,29 @@ -/* Test file for C language. - * Attempt to include as many aspects of the C language as possible. +/* test.c --- Semantic unit test for C. + + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, + 2010 Free Software Foundation, Inc. + + Author: Eric M. Ludlam + + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see . +*/ + +/* Attempt to include as many aspects of the C language as possible. */ + /* types of include files */ #include "includeme1.h" #include diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/test.cpp --- a/test/cedet/tests/test.cpp Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,592 +0,0 @@ -/* Test file for C++ language. - * Attempt to include as many aspects of the C++ language as possible. - * Do not include things tested in test.c since that shares the - * same language. - */ - -/* An include test */ -#include - -#include - -#include "c++-test.hh" - -#include - -double var1 = 1.2; - -int simple1(int a) { - -} - -struct foo1 { - int test; -}; - -struct foo2 : public foo1 { - const int foo21(int a, int b); - const int foo22(int a, int b) { return 1 } -}; - -/* Classes */ -class class1 { -private: - int var11; - struct foo1 var12; -public: - int p_var11; - struct foo p_var12; -}; - -class i_class1 : public class1 { -private: - int var11; - struct foo var12; -public: - int p_var11; - struct foo p_var12; -}; - -class class2 { -private: - int var21; - struct foo var22; -public: - int p_var21; - struct foo p_var22; -}; - -class i_class2 : public class1, public class2 { -private: - int var21; - struct foo var22; -protected: - int pt_var21; -public: - int p_var21; - struct foo p_var22; -}; - -class class3 { - /* A class with strange things in it */ -public: - class3(); /* A constructor */ - enum embedded_foo_enum { - a, b, c - } embed1; - struct embedded_bar_struct { - int a; - int b; - } embed2; - class embedded_baz_class { - embedded_baz_class(); - ~embedded_baz_class(); - } embed3; - ~class3(); /* destructor */ - - /* Methods */ - int method_for_class3(int a, char b); - - int inline_method(int c) { return c; } - - /* Operators */ - class3& operator^= (const class3& something); - - /* Funny declmods */ - const class3 * const method_const_ptr_ptr(const int * const argconst) const = 0; -}; - -class3::class3() -{ - /* Constructor outside the definition. */ -} - -int class3::method_for_class3(int a, char b) -{ -} - -int class3::method1_for_class3( int a, int &b) -{ - int cvariablename; - class3 fooy[]; - class3 moose = new class3; - - // Complktion testing line should find external members. - a = fooy[1].me ; - b = cv ; - - if (fooy.emb) { - simple1(c); - } - - cos(10); - abs(10); - - return 1; -} - -char class3::method2_for_class3( int a, int b) throw ( exception1 ) -{ - return 'a'; -} - -void *class3::method3_for_class3( int a, int b) throw ( exception1, exception2 ) -{ - int q = a; - return "Moose"; -} - -void *class3::method31_for_class3( int a, int b) throw ( ) -{ - int q = a; - return "Moose"; -} - -void *class3::method4_for_class3( int a, int b) reentrant -{ - class3 ct; - - ct.method5_for_class3(1,a); - - pritf(); -} - -/* - * A method on class3. - */ -void *class3::method5_for_class3( int a, int b) const -{ -} - -/* - * Namespace parsing tests - */ -namespace NS { - class class_in_namespace { - int equiv(const NS::class_in_namespace *) const; - }; -} - -int NS::class_in_namespace::equiv(const NS::class_in_namespace *cin) const -{ - return 0; -} - -// Stuff Klaus found. -// Inheritance w/out a specifying for public. -class class4 : class1 { - // Pure virtual methods. - void virtual print () const = 0; - -public: - // The whacky constructor type - class4() - try : class1(args) - { - // constructor body - } - catch () - { - - } - - -}; - -class class5 : public virtual class4 { - // Virtual inheritance -}; - -class class6 : class1 { - // Mutable - mutable int i; -}; - -/* Namespaces */ -namespace namespace1 { - void ns_method1() { } - - class n_class1 { - public: - void method11(int a) { } - }; - - /* This shouldn't parse due to missing semicolon. */ - class _n_class2 : public n_class1 { - void n_c2_method1(int a, int b) { } - }; - - // Macros in the namespace -#define NSMACRO 1 - - // Template in the namespace - template T nsti1(const Foo& foo); - template<> int nsti1(const Foo& foo); - -} - -namespace namespace2 { - - using namespace1::n_class1; - -} - -/* Initializers */ -void tinitializers1(): inita1(False), - inita2(False) -{ - inita1= 1; -} - -/* How about Extern C type things. */ -int funny_prototype(int ,int b,float c) -{ - -} - -extern "C" -int extern_c_1(int a, int b) -{ - - funny_prototype(1,2,3.4); - - printf("Moose", ); - - return 1; -} - -extern "C" { - - int extern_c_2(int a, int b) - { - return 1; - } - -} - -// Some operator stuff -class Action -{ - // Problems!! operator() and operator[] can not be parsed with semantic - // 1.4.2 but with latest c.by - virtual void operator()(int i, char *p ) = 0; - virtual String& operator[]() = 0; - virtual void operator!() = 0; - virtual void operator->() = 0; - virtual T& operator+=(); - virtual T& operator*(); - virtual T& operator*=(); -}; - -// class with namespace qualified parents -class Multiinherit : public virtual POA::Parent, - public virtual POA::Parent1, - Parent -{ -private: - int i; - -public: - Multiinherit(); - ~Multiinherit(); - - // method with a list of qualified exceptions - void* throwtest() - throw(Exception0, - Testnamespace::Exception1, - Testnamespace::Excpetion2, - Testnamespace::testnamespace1::Exception3); - -}; - -void* -Multiinherit::throwtest() - throw (Exception0, - Testnamespace::Exception1, - Testnamespace::Excpetion2, - Testnamespace::testnamespace1::Exception3) -{ - return; -} - -// Jens Rock : Nested classes or structs defined -// outside of the containing class/struct. -class container -{ - public: - struct contained; - container(); - ~container(); -}; - -struct container::contained -{ - public: - contained(); - ~contained(); -}; - -/* - * Ok, how about some template stuff. - */ -template > -const CT& max (const CT& a, const CT& b) -{ - return a < b ? b : a; -} - -// Arne Schmitz found this one -std::vector &a, &b, &c; - -class TemplateUsingClass -{ - typedef TestClassMap::iterator iterator; - typedef map TestClassMap; - - // typedefs with const and volatile - typedef const map const_TestClassMap; - typedef TestClassMap::iterator volatile volatile_iterator; - - map mapclassvarthingy; -}; - -template T ti1(const Foo& foo); -template<> int ti1(const Foo& foo); - - -// ----------------------------------- -// Now some namespace and related stuff -// ----------------------------------- - -using CORBA::LEX::get_token; -using Namespace1; - -using namespace POA::std; -using namespace Test; - - - -namespace Parser -{ - namespace - { - using Lexer::get_test; - string str = ""; - } - - namespace XXX - { - - class Foobar : public virtual POA::Parent, - public virtual POA::Parent1, - private POA::list, - private map - { - ini i; - list >::const_iterator l; - public: - - Foobar(); - ~Foobar(); - }; - } - - - void test_function(int i); - -}; - -// unnamed namespaces - even nested -namespace -{ - namespace - { - using Lexer::get_test; - string str = ""; - } - - // some builtin types - long long ll = 0; - long double d = 0.0; - unsigned test; - unsigned long int **uli = 0; - signed si = 0; - signed short ss = 0; - short int i = 0; - long int li = 0; - - // expressions with namespace/class-qualifyiers - ORB_var cGlobalOrb = ORB::_nil(); - ORB_var1 cGlobalOrb1 = ORB::_test; - - class Testclass - { - #define TEST 0 - ini i; - - public: - - Testclass(); - ~Testclass(); - }; - - static void test_function(unsigned int i); - -}; - - -// outside method implementations which should be grouped to type Test -XXX& -Test::waiting() -{ - return; -} - -void -Test::print() -{ - return; -} - -// outside method implementations with namespaces which should be grouped to -// their complete (incl. namespace) types -void* -Parser::XXX::Foobar::wait(int i, const char const * const * p) -{ - return; -} - -void* -Namespace1::Test::wait1(int i) -{ - return; -} - -int -Namespace1::Test::waiting(int i) -{ - return; -} - -// a class with some outside implementations which should all be grouped to -// this class declaration -class ClassWithExternals -{ -private: - int i; - -public: - ClassWithExternals(); - ~ClassWithExternals(); - void non_nil(); -}; - - -// Foobar is not displayed; seems that semantic tries to add this to the class -// Foobar but can not find/display it, because contained in the namespace above. -void -Foobar::non_nil() -{ - return; -} - -// are correctly grouped to the ClassWithExternals class -void -ClassWithExternals::non_nil() -{ - String s = "lödfjg dlfgkdlfkgjdl"; - return; -} - -ClassWithExternals::ClassWithExternals() -{ - return; -} - -void -ClassWithExternals::~ClassWithExternals() -{ - return; -} - - -// ------------------------------- -// Now some macro and define stuff -// ------------------------------- - -#define TEST 0 -#define TEST1 "String" - -// The first backslash makes this macro unmatched syntax with semantic 1.4.2! -// With flexing \+newline as nothing all is working fine! -#define MZK_ENTER(METHOD) \ -{ \ - CzkMethodLog lMethodLog(METHOD,"Framework");\ -} - -#define ZK_ASSERTM(METHOD,ASSERTION,MESSAGE) \ - { if(!(ASSERTION))\ - {\ - std::ostringstream lMesgStream; \ - lMesgStream << "Assertion failed: " \ - << MESSAGE; \ - CzkLogManager::doLog(CzkLogManager::FATAL,"",METHOD, \ - "Assert",lMesgStream); \ - assert(ASSERTION);\ - }\ - } - -// Test if not newline-backslashes are handled correctly -string s = "My \"quoted\" string"; - -// parsed fine as macro -#define FOO (arg) method(arg, "foo"); - -// With semantic 1.4.2 this parsed as macro BAR *and* function method. -// With latest c.bnf at least one-liner macros can be parsed correctly. -#define BAR (arg) CzkMessageLog method(arg, "bar"); - -// some const and volatile stuff -char * p1 = "Hello"; // 1. variable Pointer, variable Data -const char * p2 = "Hello"; // 2. variable pointer, constant data -char * const p3 = "Hello"; // 3. constant pointer, variable data -const char * const p4 = "Hello"; // 4. constant pointer, constant data - -// Case 2 and 4 can exchange first "const" and "char" -char const * p21 = "Hello"; // variable pointer, constant data -char const * const p41 = "Hello"; // constant pointer, constant data - -char volatile a = 0; // a volatile char -void foo(bar const &arg); // a reference to a const bar -int foobar(bar const * const p); // a const pointer to a const bar -int foobar(bar const volatile * const p); // a const pointer to a const bar -int foobar3(char* p); // a const pointer to a const bar - -// Should not be parsed because this is invalid code -int const & const r3 = i; - -boolean i = 0; -boolean & r1 = i; -boolean const & r2 = i; - -// const * sequences can be very long in C++ ;-) -char const * const * const * const * ppp; - -// complex function declarationen with named pointer-arguments -const char** foobar1(volatile char const * const **p); -const char** foobar11(volatile Test::Namespace::Char const * const **p); - -// complex function declarationen with unnamed pointer-arguments -const char* foobar2(const char***); -const char* foobar21(const Test::Namespace::Char***); - -// string literal parsing even with wchar_t -char const *p = "string1"; -char const *q = "string1" "str\"ing2" "string3"; -wchar_t testc = L'a'; - -wchar_t const *wp = L"string with a \" in it"; -wchar_t const *wq = L"string \n\t\"test" L"string2"; -wchar_t const *wr = L"string L"; - -// arch-tag: 59828880-d72f-4059-922f-89579edf9e58 diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/test.el --- a/test/cedet/tests/test.el Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/test.el Tue Mar 30 16:48:06 2010 +0900 @@ -1,6 +1,24 @@ -;; Test file for Emacs Lisp. -;; Attempt to include as many aspects of Emacs Lisp as possible. -;; +;;; test.el --- Unit test file for Semantic Emacs Lisp support. + +;; Copyright (C) 2005, 2006, 2007, 2008, 2009, 2010 +;; Free Software Foundation, Inc. + +;; Author: Eric M. Ludlam + +;; This file is part of GNU Emacs. + +;; GNU Emacs is free software: you can redistribute it and/or modify +;; it under the terms of the GNU General Public License as published by +;; the Free Software Foundation, either version 3 of the License, or +;; (at your option) any later version. + +;; GNU Emacs is distributed in the hope that it will be useful, +;; but WITHOUT ANY WARRANTY; without even the implied warranty of +;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +;; GNU General Public License for more details. + +;; You should have received a copy of the GNU General Public License +;; along with GNU Emacs. If not, see . ;;; Require ;; @@ -88,7 +106,7 @@ (autoload (quote a-autoload) "somefile" "Non-interactive autoload." nil nil) -(autoload (quote a-autoload-interactive) "somefile" +(autoload (quote a-autoload-interactive) "somefile" "Interactive autoload." t nil) @@ -116,7 +134,7 @@ (slot-1 :equal 'eq) slot-2) -(defstruct test-struct-2 +(defstruct test-struct-2 slot-1 slot-2) diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/test.make --- a/test/cedet/tests/test.make Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/test.make Tue Mar 30 16:48:06 2010 +0900 @@ -1,4 +1,23 @@ -# Test makefile -*- makefile -*- +# test.make --- Semantic unit test for Make -*- makefile -*- + +# Copyright (C) 2001, 2002, 2010 Free Software Foundation, Inc. + +# Author: Eric M. Ludlam + +# This file is part of GNU Emacs. + +# GNU Emacs is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. + +# GNU Emacs is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. + +# You should have received a copy of the GNU General Public License +# along with GNU Emacs. If not, see . top= ede_FILES=Project.ede Makefile diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/test.py --- a/test/cedet/tests/test.py Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,580 +0,0 @@ -# Test file for Python language. -# - -# Simle class compount statement with blank lines sprinkled. -class Foo(Bar): - - x = 1 - - y = 2 - -# Simple def statement with no argument -def sss(): - i = 1 - -# Simple def statement with arguments -def ttt(x,y,z): - i = 1 - -import foo - -for x in y: - print x - -while y > 0: - y = y - 1 - -a=b=c=d=e=f=i=j=k=l=m=n=o=p=q=r=s=t=x=y=1 - -if x: - x = 2 - y = 3 - -x = 2 -y = 3 -s and t -q | r -o ^ p -m & n -k << l -z = 4 -i >> j -e / f -c * d -a + b -2 ** 5 -x -s = "a" "b" "c" -1 - -# implicit continuation lines, see -# http://docs.python.org/ref/implicit-joining.html - -a_list = [ 1, 2, 3, - 4, 5, - 6 ] - -a_tuple = (1, 2, 3, - - 4, 5, 6) - -a_hash = { 'a':1, "b":2, - 'c' : 3, - "d" : 4 } - - -def longarglist(a, - b, - c, - d): - a=1; - b=1; - c=1; - d=1; - -class longclasslist(xx.yyy, - zz.aa): - foo=1 - - -# wisent-python.wy chokes on this! -ryk 6/17/02 - -class HTTPServer(xxx.yyy): - allow_reuse_address = 1 # Seems to make sense in testing environment - def server_bind(self): - SocketServer.TCPServer.server_bind(self) - host, port = self.socket.getsockname() - self.server_name = socket.getfqdn(host) - self.server_port = port - - -######################################################################### -### /usr/lib/python2.2/BaseHTTPServer.py -######################################################################### - -"""HTTP server base class. - -Note: the class in this module doesn't implement any HTTP request; see -SimpleHTTPServer for simple implementations of GET, HEAD and POST -(including CGI scripts). - -Contents: - -- BaseHTTPRequestHandler: HTTP request handler base class -- test: test function - -XXX To do: - -- send server version -- log requests even later (to capture byte count) -- log user-agent header and other interesting goodies -- send error log to separate file -- are request names really case sensitive? - -""" - - -# See also: -# -# HTTP Working Group T. Berners-Lee -# INTERNET-DRAFT R. T. Fielding -# H. Frystyk Nielsen -# Expires September 8, 1995 March 8, 1995 -# -# URL: http://www.ics.uci.edu/pub/ietf/http/draft-ietf-http-v10-spec-00.txt - - -# Log files -# --------- -# -# Here's a quote from the NCSA httpd docs about log file format. -# -# | The logfile format is as follows. Each line consists of: -# | -# | host rfc931 authuser [DD/Mon/YYYY:hh:mm:ss] "request" ddd bbbb -# | -# | host: Either the DNS name or the IP number of the remote client -# | rfc931: Any information returned by identd for this person, -# | - otherwise. -# | authuser: If user sent a userid for authentication, the user name, -# | - otherwise. -# | DD: Day -# | Mon: Month (calendar name) -# | YYYY: Year -# | hh: hour (24-hour format, the machine's timezone) -# | mm: minutes -# | ss: seconds -# | request: The first line of the HTTP request as sent by the client. -# | ddd: the status code returned by the server, - if not available. -# | bbbb: the total number of bytes sent, -# | *not including the HTTP/1.0 header*, - if not available -# | -# | You can determine the name of the file accessed through request. -# -# (Actually, the latter is only true if you know the server configuration -# at the time the request was made!) - - -__version__ = "0.2" - -__all__ = ["HTTPServer", "BaseHTTPRequestHandler"] - -import sys -import time -import socket # For gethostbyaddr() -import mimetools -import SocketServer - -# Default error message -DEFAULT_ERROR_MESSAGE = """\ - -Error response - - -

Error response

-

Error code %(code)d. -

Message: %(message)s. -

Error code explanation: %(code)s = %(explain)s. - -""" - - -class HTTPServer(SocketServer.TCPServer): - - allow_reuse_address = 1 # Seems to make sense in testing environment - - def server_bind(self): - """Override server_bind to store the server name.""" - SocketServer.TCPServer.server_bind(self) - host, port = self.socket.getsockname() - self.server_name = socket.getfqdn(host) - self.server_port = port - - -class BaseHTTPRequestHandler(SocketServer.StreamRequestHandler): - - """HTTP request handler base class. - - The following explanation of HTTP serves to guide you through the - code as well as to expose any misunderstandings I may have about - HTTP (so you don't need to read the code to figure out I'm wrong - :-). - - HTTP (HyperText Transfer Protocol) is an extensible protocol on - top of a reliable stream transport (e.g. TCP/IP). The protocol - recognizes three parts to a request: - - 1. One line identifying the request type and path - 2. An optional set of RFC-822-style headers - 3. An optional data part - - The headers and data are separated by a blank line. - - The first line of the request has the form - - - - where is a (case-sensitive) keyword such as GET or POST, - is a string containing path information for the request, - and should be the string "HTTP/1.0". is encoded - using the URL encoding scheme (using %xx to signify the ASCII - character with hex code xx). - - The protocol is vague about whether lines are separated by LF - characters or by CRLF pairs -- for compatibility with the widest - range of clients, both should be accepted. Similarly, whitespace - in the request line should be treated sensibly (allowing multiple - spaces between components and allowing trailing whitespace). - - Similarly, for output, lines ought to be separated by CRLF pairs - but most clients grok LF characters just fine. - - If the first line of the request has the form - - - - (i.e. is left out) then this is assumed to be an HTTP - 0.9 request; this form has no optional headers and data part and - the reply consists of just the data. - - The reply form of the HTTP 1.0 protocol again has three parts: - - 1. One line giving the response code - 2. An optional set of RFC-822-style headers - 3. The data - - Again, the headers and data are separated by a blank line. - - The response code line has the form - - - - where is the protocol version (always "HTTP/1.0"), - is a 3-digit response code indicating success or - failure of the request, and is an optional - human-readable string explaining what the response code means. - - This server parses the request and the headers, and then calls a - function specific to the request type (). Specifically, - a request SPAM will be handled by a method do_SPAM(). If no - such method exists the server sends an error response to the - client. If it exists, it is called with no arguments: - - do_SPAM() - - Note that the request name is case sensitive (i.e. SPAM and spam - are different requests). - - The various request details are stored in instance variables: - - - client_address is the client IP address in the form (host, - port); - - - command, path and version are the broken-down request line; - - - headers is an instance of mimetools.Message (or a derived - class) containing the header information; - - - rfile is a file object open for reading positioned at the - start of the optional input data part; - - - wfile is a file object open for writing. - - IT IS IMPORTANT TO ADHERE TO THE PROTOCOL FOR WRITING! - - The first thing to be written must be the response line. Then - follow 0 or more header lines, then a blank line, and then the - actual data (if any). The meaning of the header lines depends on - the command executed by the server; in most cases, when data is - returned, there should be at least one header line of the form - - Content-type: / - - where and should be registered MIME types, - e.g. "text/html" or "text/plain". - - """ - - # The Python system version, truncated to its first component. - sys_version = "Python/" + sys.version.split()[0] - - # The server software version. You may want to override this. - # The format is multiple whitespace-separated strings, - # where each string is of the form name[/version]. - server_version = "BaseHTTP/" + __version__ - - def parse_request(self): - """Parse a request (internal). - - The request should be stored in self.raw_request; the results - are in self.command, self.path, self.request_version and - self.headers. - - Return value is 1 for success, 0 for failure; on failure, an - error is sent back. - - """ - self.request_version = version = "HTTP/0.9" # Default - requestline = self.raw_requestline - if requestline[-2:] == '\r\n': - requestline = requestline[:-2] - elif requestline[-1:] == '\n': - requestline = requestline[:-1] - self.requestline = requestline - words = requestline.split() - if len(words) == 3: - [command, path, version] = words - if version[:5] != 'HTTP/': - self.send_error(400, "Bad request version (%s)" % `version`) - return 0 - elif len(words) == 2: - [command, path] = words - if command != 'GET': - self.send_error(400, - "Bad HTTP/0.9 request type (%s)" % `command`) - return 0 - else: - self.send_error(400, "Bad request syntax (%s)" % `requestline`) - return 0 - self.command, self.path, self.request_version = command, path, version - self.headers = self.MessageClass(self.rfile, 0) - return 1 - - def handle(self): - """Handle a single HTTP request. - - You normally don't need to override this method; see the class - __doc__ string for information on how to handle specific HTTP - commands such as GET and POST. - - """ - - self.raw_requestline = self.rfile.readline() - if not self.parse_request(): # An error code has been sent, just exit - return - mname = 'do_' + self.command - if not hasattr(self, mname): - self.send_error(501, "Unsupported method (%s)" % `self.command`) - return - method = getattr(self, mname) - method() - - def send_error(self, code, message=None): - """Send and log an error reply. - - Arguments are the error code, and a detailed message. - The detailed message defaults to the short entry matching the - response code. - - This sends an error response (so it must be called before any - output has been generated), logs the error, and finally sends - a piece of HTML explaining the error to the user. - - """ - - try: - short, long = self.responses[code] - except KeyError: - short, long = '???', '???' - if not message: - message = short - explain = long - self.log_error("code %d, message %s", code, message) - self.send_response(code, message) - self.send_header("Content-Type", "text/html") - self.end_headers() - self.wfile.write(self.error_message_format % - {'code': code, - 'message': message, - 'explain': explain}) - - error_message_format = DEFAULT_ERROR_MESSAGE - - def send_response(self, code, message=None): - """Send the response header and log the response code. - - Also send two standard headers with the server software - version and the current date. - - """ - self.log_request(code) - if message is None: - if self.responses.has_key(code): - message = self.responses[code][0] - else: - message = '' - if self.request_version != 'HTTP/0.9': - self.wfile.write("%s %s %s\r\n" % - (self.protocol_version, str(code), message)) - self.send_header('Server', self.version_string()) - self.send_header('Date', self.date_time_string()) - - def send_header(self, keyword, value): - """Send a MIME header.""" - if self.request_version != 'HTTP/0.9': - self.wfile.write("%s: %s\r\n" % (keyword, value)) - - def end_headers(self): - """Send the blank line ending the MIME headers.""" - if self.request_version != 'HTTP/0.9': - self.wfile.write("\r\n") - - def log_request(self, code='-', size='-'): - """Log an accepted request. - - This is called by send_reponse(). - - """ - - self.log_message('"%s" %s %s', - self.requestline, str(code), str(size)) - - def log_error(self, *args): - """Log an error. - - This is called when a request cannot be fulfilled. By - default it passes the message on to log_message(). - - Arguments are the same as for log_message(). - - XXX This should go to the separate error log. - - """ - - apply(self.log_message, args) - - def log_message(self, format, *args): - """Log an arbitrary message. - - This is used by all other logging functions. Override - it if you have specific logging wishes. - - The first argument, FORMAT, is a format string for the - message to be logged. If the format string contains - any % escapes requiring parameters, they should be - specified as subsequent arguments (it's just like - printf!). - - The client host and current date/time are prefixed to - every message. - - """ - - sys.stderr.write("%s - - [%s] %s\n" % - (self.address_string(), - self.log_date_time_string(), - format%args)) - - def version_string(self): - """Return the server software version string.""" - return self.server_version + ' ' + self.sys_version - - def date_time_string(self): - """Return the current date and time formatted for a message header.""" - now = time.time() - year, month, day, hh, mm, ss, wd, y, z = time.gmtime(now) - s = "%s, %02d %3s %4d %02d:%02d:%02d GMT" % ( - self.weekdayname[wd], - day, self.monthname[month], year, - hh, mm, ss) - return s - - def log_date_time_string(self): - """Return the current time formatted for logging.""" - now = time.time() - year, month, day, hh, mm, ss, x, y, z = time.localtime(now) - s = "%02d/%3s/%04d %02d:%02d:%02d" % ( - day, self.monthname[month], year, hh, mm, ss) - return s - - weekdayname = ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] - - monthname = [None, - 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', - 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'] - - def address_string(self): - """Return the client address formatted for logging. - - This version looks up the full hostname using gethostbyaddr(), - and tries to find a name that contains at least one dot. - - """ - - host, port = self.client_address - return socket.getfqdn(host) - - # Essentially static class variables - - # The version of the HTTP protocol we support. - # Don't override unless you know what you're doing (hint: incoming - # requests are required to have exactly this version string). - protocol_version = "HTTP/1.0" - - # The Message-like class used to parse headers - MessageClass = mimetools.Message - - # Table mapping response codes to messages; entries have the - # form {code: (shortmessage, longmessage)}. - # See http://www.w3.org/hypertext/WWW/Protocols/HTTP/HTRESP.html - responses = { - 200: ('OK', 'Request fulfilled, document follows'), - 201: ('Created', 'Document created, URL follows'), - 202: ('Accepted', - 'Request accepted, processing continues off-line'), - 203: ('Partial information', 'Request fulfilled from cache'), - 204: ('No response', 'Request fulfilled, nothing follows'), - - 301: ('Moved', 'Object moved permanently -- see URI list'), - 302: ('Found', 'Object moved temporarily -- see URI list'), - 303: ('Method', 'Object moved -- see Method and URL list'), - 304: ('Not modified', - 'Document has not changed singe given time'), - - 400: ('Bad request', - 'Bad request syntax or unsupported method'), - 401: ('Unauthorized', - 'No permission -- see authorization schemes'), - 402: ('Payment required', - 'No payment -- see charging schemes'), - 403: ('Forbidden', - 'Request forbidden -- authorization will not help'), - 404: ('Not found', 'Nothing matches the given URI'), - - 500: ('Internal error', 'Server got itself in trouble'), - 501: ('Not implemented', - 'Server does not support this operation'), - 502: ('Service temporarily overloaded', - 'The server cannot process the request due to a high load'), - 503: ('Gateway timeout', - 'The gateway server did not receive a timely response'), - - } - - -def test(HandlerClass = BaseHTTPRequestHandler, - ServerClass = HTTPServer): - """Test the HTTP request handler class. - - This runs an HTTP server on port 8000 (or the first command line - argument). - - """ - - if sys.argv[1:]: - port = int(sys.argv[1]) - else: - port = 8000 - server_address = ('', port) - - httpd = ServerClass(server_address, HandlerClass) - - sa = httpd.socket.getsockname() - print "Serving HTTP on", sa[0], "port", sa[1], "..." - httpd.serve_forever() - - -if __name__ == '__main__': - test() - -# arch-tag: 567449b3-cc90-45b6-bbe3-1e113995bdae diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testdoublens.cpp --- a/test/cedet/tests/testdoublens.cpp Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testdoublens.cpp Tue Mar 30 16:48:06 2010 +0900 @@ -1,7 +1,24 @@ -// -// CPP file for semantic-ia-utest -// completion engine unit tests. -// +// testdoublens.cpp --- semantic-ia-utest completion engine unit tests + +// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + +// Author: Eric M. Ludlam + +// This file is part of GNU Emacs. + +// GNU Emacs is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// GNU Emacs is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with GNU Emacs. If not, see . + #include "testdoublens.hpp" namespace Name1 { @@ -29,7 +46,7 @@ void Foo::sendStuff(int /* a */, int /* b */) // ^3^ { } - + } // namespace Name2 } // namespace Name1 @@ -44,7 +61,7 @@ Name1::Name2::F//-4- // #4# ( "Foo" ) ; - + // @TODO - get this working... Name1::stage2_Foo::M//-5- /// #5# ( "Mumble" ) @@ -58,15 +75,15 @@ // Second test from Ravikiran Rajagopal -namespace A { +namespace A { class foo { public: void aa(); void bb(); }; } -namespace A { - class bar { +namespace A { + class bar { public: void xx(); public: @@ -96,7 +113,7 @@ int Bar::baz() { - return dum// -7- + return dum// -7- // #7# ( "dumdum" ) ; } diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testdoublens.hpp --- a/test/cedet/tests/testdoublens.hpp Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testdoublens.hpp Tue Mar 30 16:48:06 2010 +0900 @@ -1,6 +1,24 @@ -// -// Header file used in one of the ia-utest tests. -// +// testdoublens.hpp --- Header file used in one of the Semantic tests + +// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + +// Author: Eric M. Ludlam + +// This file is part of GNU Emacs. + +// GNU Emacs is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// GNU Emacs is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with GNU Emacs. If not, see . + namespace Name1 { namespace Name2 { diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testjavacomp.java --- a/test/cedet/tests/testjavacomp.java Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testjavacomp.java Tue Mar 30 16:48:06 2010 +0900 @@ -1,24 +1,23 @@ -/** testjavacomp.java --- - * - * Copyright (C) 2009, 2010 Free Software Foundation, Inc. - * - * Author: Eric M. Ludlam - * - * This file is part of GNU Emacs. - * - * GNU Emacs is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GNU Emacs is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GNU Emacs. If not, see . - */ +// testjavacomp.java --- Semantic unit test for Java + +// Copyright (C) 2009, 2010 Free Software Foundation, Inc. + +// Author: Eric M. Ludlam + +// This file is part of GNU Emacs. + +// GNU Emacs is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// GNU Emacs is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with GNU Emacs. If not, see . package tests.testjavacomp; diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testspp.c --- a/test/cedet/tests/testspp.c Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testspp.c Tue Mar 30 16:48:06 2010 +0900 @@ -1,6 +1,24 @@ -/* Attempt to test the C preprocessor - * - */ +/* testspp.cpp --- Semantic unit test for the C preprocessor + + Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + + Author: Eric M. Ludlam + + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see . +*/ int some_fcn (){} diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testsppreplace.c --- a/test/cedet/tests/testsppreplace.c Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testsppreplace.c Tue Mar 30 16:48:06 2010 +0900 @@ -1,5 +1,23 @@ -/* Test CPP/SPP Replacement - */ +/* testsppreplace.c --- unit test for CPP/SPP Replacement + Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + + Author: Eric M. Ludlam + + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see . +*/ /* TEST: The EMU keyword doesn't screw up the function defn. */ #define EMU diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testsppreplaced.c --- a/test/cedet/tests/testsppreplaced.c Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testsppreplaced.c Tue Mar 30 16:48:06 2010 +0900 @@ -1,5 +1,25 @@ -/* What the SPP replace file would looklike with MACROS replaced. - */ +/* testsppreplaced.c --- unit test for CPP/SPP Replacement + Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + + Author: Eric M. Ludlam + + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see . +*/ + +/* What the SPP replace file would looklike with MACROS replaced: */ /* TEST: The EMU keyword doesn't screw up the function defn. */ char parse_around_emu () diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/teststruct.cpp --- a/test/cedet/tests/teststruct.cpp Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,68 +0,0 @@ -// Combinations of templates and structure inheritance. -// -// Created by Alex Ott. - -template -struct grammar { -public: - typedef grammar self_t; - typedef DerivedT const& embed_t; - grammar() {} - ~grammar() { } - void use_parser() const { } - void test1() { } -}; - -struct PDFbool_parser : public grammar { - PDFbool_parser() {} - template struct definition { - typedef typename scannerT::iterator_t iterator_t; - int top; - definition(const PDFbool_parser& /*self*/) { - return ; - } - const int start() const { - return top; - } - }; -}; - -int main(void) { - PDFbool_parser PDFbool_p = PDFbool_parser(); - PDFbool_p.//-1- - ; - // #1# ("definition" "embed_t" "self_t" "test1" "use_parser") -} - -// ---------------------------------------------------------------------- - -template struct Base { -public: - void interface() - { - // ... - static_cast(this)->implementation(); - // ... - } - - static void static_func() - { - // ... - Derived::static_sub_func(); - // ... - } -}; - -struct Derived : Base { - void implementation() { } - static void static_sub_func() { } -}; - -int foo () { - Derived d; - d.//-2- - ; - // #2# ("implementation" "interface" "static_func" "static_sub_func") -} - -// arch-tag: d6e39f96-525e-44af-8cd1-d03e1829acd3 diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testsubclass.cpp --- a/test/cedet/tests/testsubclass.cpp Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testsubclass.cpp Tue Mar 30 16:48:06 2010 +0900 @@ -1,5 +1,23 @@ -/* Special test file for Semantic Analyzer and complex C++ inheritance. - */ +// testsubclass.cpp --- unit test for analyzer and complex C++ inheritance + +// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +// Author: Eric M. Ludlam + +// This file is part of GNU Emacs. + +// GNU Emacs is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// GNU Emacs is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with GNU Emacs. If not, see . //#include #include "testsubclass.hh" @@ -94,7 +112,7 @@ MooseVariableName = createMoose(); doLatinStuff(MooseVariableName); - + tmp = this.f// -1- // #1# ( "fAlcesBool" "fIsValid" "fLatin" ) ; @@ -125,7 +143,7 @@ int someFunction(int mPickle) { moose mMoose = deer::alces::createMoose(); - + if (mPickle == 1) { int mOption1 = 2; @@ -152,7 +170,7 @@ class A{ private: void private_a(){} - public: + public: void public_a(); }; diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testsubclass.hh --- a/test/cedet/tests/testsubclass.hh Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testsubclass.hh Tue Mar 30 16:48:06 2010 +0900 @@ -1,8 +1,23 @@ -/* Special test file for Semantic Analyzer and complex C++ inheritance. - * - * Header file for testsubclass.cpp with class defns but no - * implementations. - */ +// testsubclass.hh --- unit test for analyzer and complex C++ inheritance + +// Copyright (C) 2007, 2008, 2009, 2010 Free Software Foundation, Inc. + +// Author: Eric M. Ludlam + +// This file is part of GNU Emacs. + +// GNU Emacs is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// GNU Emacs is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with GNU Emacs. If not, see . //#include // #include diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testtemplates.cpp --- a/test/cedet/tests/testtemplates.cpp Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -// Templates Test file: -// Written by 'Raf' - -template -class read_ref { -public: - const T* read_ref_member_one( T); - const V* read_ref_member_two(); -}; - -namespace NS { - template - class ref { - public: - read_ref operator->() { - m_// -1- - ; - // #1# ( "m_datas" ) - } - - private: - T m_datas[U]; - }; - -} - -class FooOne { -public: - int fooOneMember(); -}; - -class FooTwo { -public: - int fooTwoMember(); -}; - -class FooThree { -public: - int fooThreeMember(); - - FooOne * operator->(); -}; - -typedef ref Test; - -using NS; - -void -main(void) { - ref v; - - v->read_ref_member_one()-> // -2- - ; - // #2# ( "fooOneMember" ) - - v->read_ref_member_two()-> // -3- - ; - // #3# ( "fooTwoMember" ) - - v-> // -4- - ; - // #4# ( "read_ref_member_one" "read_ref_member_two" ) - - Test t; - - t->read_ref_member_two()-> // -5- - ; - // #5# ( "fooTwoMember" ) - - ref v2; - - v2->read_ref_member_two()-> // -6- - ; - // #6# ( "fooOneMember" ) - - /* Try all these things by also specifying the namespace in the name. */ - NS::ref v3; - - v3->read_ref_member_one()-> // -7- - ; - // #7# ( "fooOneMember" ) - - v3->read_ref_member_two()-> // -8- - ; - // #8# ( "fooTwoMember" ) - - v3->read_ref_member_two// @1@ 5 - ; - -} - -// arch-tag: 03cbb8c3-3d01-42ab-b416-42a08ea7b896 diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testtypedefs.cpp --- a/test/cedet/tests/testtypedefs.cpp Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testtypedefs.cpp Tue Mar 30 16:48:06 2010 +0900 @@ -1,16 +1,31 @@ -// Sample with some fake bits out of std::string -// +// testtypedefs.cpp --- Sample with some fake bits out of std::string + +// Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + +// Author: Eric M. Ludlam + +// This file is part of GNU Emacs. + +// GNU Emacs is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// GNU Emacs is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with GNU Emacs. If not, see . + // Thanks Ming-Wei Chang for these examples. namespace std { - template class basic_string { - public: void resize(int); - }; - } typedef std::basic_string mstring; @@ -18,41 +33,34 @@ using namespace std; typedef basic_string bstring; - int main(){ mstring a; - a.// -1- ; // #1# ( "resize" ) - bstring b; // It doesn't work here. b.// -2- ; // #2# ( "resize" ) - return 0; } - // ------------------ -class Bar +class Bar { public: void someFunc() {} - }; typedef Bar new_Bar; template -class TBar +class TBar { public: void otherFunc() {} - }; typedef TBar new_TBar; @@ -65,11 +73,9 @@ nb.// -3- ; // #3# ("someFunc") - ntb.// -4- ; // #4# ("otherFunc") - return 0; } diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testusing.cpp --- a/test/cedet/tests/testusing.cpp Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,134 +0,0 @@ -// Test using statements in C++ - -#include - -#include - -namespace moose { - - class MyClass; - class Point; - - typedef MyClass snerk; -} - -namespace moose { - - class Point; - class MyClass; - -} - -namespace { - - int global_variable = 0; - -}; - -using moose::MyClass; - -void someFcn() { - - MyClass f; - - f.//-1- - ; //#1# ( "getVal" "setVal" ) - -} - -// Code from Zhiqiu Kong - -namespace panda { - - using namespace bread_name; - - int func() - { - bread test; - test.//-2- - ;// #2# ( "geta" ) - return 0; - } -} - -// Local using statements and aliased types -// Code from David Engster - -void func2() -{ - using namespace somestuff; - OneClass f; - f.//-3- - ; //#3# ( "aFunc" "anInt" ) -} - -void func3() -{ - using somestuff::OneClass; - OneClass f; - f.//-4- - ; //#4# ( "aFunc" "anInt" ) -} - -// Dereferencing alias types created through 'using' statements - -// Alias with fully qualified name -void func4() -{ - otherstuff::OneClass f; - f. //-5- - ; //#5# ( "aFunc" "anInt" ) -} - -// Alias through namespace directive -void func5() -{ - using namespace otherstuff; - OneClass f; - f. //-6- - ; //#6# ( "aFunc" "anInt" ) -} - -// Check name hiding -void func6() -{ - using namespace morestuff; - OneClass f; // Alias for somestuff::OneClass - f. //-7- - ; //#7# ( "aFunc" "anInt" ) - aStruct g; // This however is morestuff::aStruct ! - g. //-8- - ; //#8# ( "anotherBar" "anotherFoo" ) -} - -// Alias of an alias -// Currently doesn't work interactively for some reason. -void func6() -{ - using namespace evenmorestuff; - OneClass f; - f. //-7- - ; //#7# ( "aFunc" "anInt" ) -} - -// Alias for struct in nested namespace, fully qualified -void func7() -{ - outer::StructNested f; - f.//-8- - ; //#8# ( "one" "two" ) -} - -// Alias for nested namespace -void func8() -{ - using namespace outerinner; - StructNested f; - AnotherStruct g; - f.//-9- - ; //#9# ( "one" "two" ) - g.//-10- - ; //#10# ( "four" "three" ) -} - -// arch-tag: 8e68d5d1-4d48-47c6-a910-d8d6b66b2768 diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testusing.hh --- a/test/cedet/tests/testusing.hh Tue Mar 23 10:03:53 2010 +0900 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,127 +0,0 @@ -// test usings header file. - -namespace moose { - - class Point; - - class MyClass; - -} - - -namespace moose { - - class Point; - - class MyClass { - public: - MyClass() : fVal(0) { - } - - ~MyClass() {}; - - /** - * fVal Accessors - * @{ - */ - int getVal() const { - return fVal; - } - void setVal(int Val) const { - fVal = Val; - } - /** - * @} - */ - private: - int fVal; - }; - -} - -namespace deer { - - class Pickle; - -}; - -// Code from Zhiqiu Kong - -#ifndef BREAD_H -#define BREAD_H - -namespace bread_name { - class bread - { - public: - void geta(); - private: - int m_a; - int m_b; - }; -} - -#endif - -// Code from David Engster -// Creating alias types through 'using' trickery - -namespace somestuff { - class OneClass { - public: - void aFunc(); - int anInt; - }; - struct aStruct { - int foo; - int bar; - }; -} - -namespace otherstuff { - // make otherstuff::OneClass an alias for somestuff::OneClass - using somestuff::OneClass; -} - -namespace morestuff { - // make morestuff an alias namespace for somestuff - using namespace somestuff; - // but hide aStruct with own type - struct aStruct { - int anotherFoo; - int anotherBar; - }; -} - -// We can also create an alias for an alias -namespace evenmorestuff { - using otherstuff::OneClass; -} - -// Now with nested namespaces -namespace outer { - namespace inner { - struct StructNested { - int one; - int two; - }; - struct AnotherStruct { - int three; - int four; - }; - } -} - -// Elevate the first struct into 'outer' -// so that we can access it via 'outer::StructNested' -namespace outer { - using outer::inner::StructNested; -} - -// Create an alias for a nested namespace -namespace outerinner { - // equivalent to 'namespace outerinner = outer::inner;' - using namespace outer::inner; -} - -// arch-tag: f7e59fad-100b-47d3-ae8b-a8390a026ade diff -r 3e1f021606db -r debd2dae3330 test/cedet/tests/testvarnames.c --- a/test/cedet/tests/testvarnames.c Tue Mar 23 10:03:53 2010 +0900 +++ b/test/cedet/tests/testvarnames.c Tue Mar 30 16:48:06 2010 +0900 @@ -1,6 +1,25 @@ -/* - * Test variable and function names, lists of variables on one line, etc. - */ +/* testvarnames.cpp + Test variable and function names, lists of variables on one line, etc. + + Copyright (C) 2008, 2009, 2010 Free Software Foundation, Inc. + + Author: Eric M. Ludlam + + This file is part of GNU Emacs. + + GNU Emacs is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + GNU Emacs is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with GNU Emacs. If not, see . +*/ struct independent { int indep_1;