changeset 54:05472e90ae02 r19-16-pre2

Import from CVS: tag r19-16-pre2
author cvs
date Mon, 13 Aug 2007 08:57:55 +0200
parents 875393c1a535
children 9e8623109fad
files CHANGES-beta configure etc/vm/audio_stamp-colorful.xpm etc/vm/audio_stamp-simple.xpm etc/vm/audio_stamp.xpm etc/vm/document-colorful.xpm etc/vm/document-simple.xpm etc/vm/document.xpm etc/vm/film-colorful.xpm etc/vm/film-simple.xpm etc/vm/film.xpm etc/vm/gear-colorful.xpm etc/vm/gear-simple.xpm etc/vm/gear.xpm etc/vm/message-colorful.xpm etc/vm/message-simple.xpm etc/vm/message.xpm etc/vm/mona_stamp-colorful.xpm etc/vm/mona_stamp-simple.xpm etc/vm/mona_stamp.gif etc/vm/stuffed_box-colorful.xpm etc/vm/stuffed_box-simple.xpm etc/vm/stuffed_box.xpm info/dir lib-autoconf-1/acgeneral.m4 lib-src/Makefile.in.in lib-src/movemail.c lib-src/pop.c lib-src/pop.h lisp/modes/cc-mode.el lisp/packages/icomplete.el lisp/prim/auto-autoloads.el lisp/prim/custom-load.el lisp/version.el lisp/vm/Makefile lisp/vm/vm-autoload.el lisp/vm/vm-digest.el lisp/vm/vm-edit.el lisp/vm/vm-folder.el lisp/vm/vm-license.el lisp/vm/vm-mark.el lisp/vm/vm-menu.el lisp/vm/vm-mime.el lisp/vm/vm-minibuf.el lisp/vm/vm-misc.el lisp/vm/vm-mouse.el lisp/vm/vm-page.el lisp/vm/vm-pop.el lisp/vm/vm-reply.el lisp/vm/vm-save.el lisp/vm/vm-search19.el lisp/vm/vm-sort.el lisp/vm/vm-startup.el lisp/vm/vm-summary.el lisp/vm/vm-thread.el lisp/vm/vm-toolbar.el lisp/vm/vm-vars.el lisp/vm/vm-version.el lisp/vm/vm-virtual.el lisp/vm/vm-window.el man/internals/internals.texi man/lispref/annotations.texi man/lispref/buffers.texi man/lispref/building.texi man/lispref/commands.texi man/lispref/consoles-devices.texi man/lispref/debugging.texi man/lispref/files.texi man/lispref/frames.texi man/lispref/help.texi man/lispref/intro.texi man/lispref/lispref.texi man/lispref/loading.texi man/lispref/menus.texi man/lispref/minibuf.texi man/lispref/mule.texi man/lispref/numbers.texi man/lispref/sequences.texi man/lispref/streams.texi man/lispref/strings.texi man/lispref/windows.texi man/xemacs-faq.texi src/emacs.c src/puresize.h
diffstat 84 files changed, 6200 insertions(+), 2743 deletions(-) [+]
line wrap: on
line diff
--- a/CHANGES-beta	Mon Aug 13 08:57:25 2007 +0200
+++ b/CHANGES-beta	Mon Aug 13 08:57:55 2007 +0200
@@ -1,5 +1,14 @@
 							-*- indented-text -*-
+to 19.16 pre2 -- "Brooklyn"
+-- Patch for XEmacs not Dying on quit applied
+-- movemail synched with 20.3
+-- Lispref synched with 20.3
+-- XEmacs FAQ synched with 20.3
+-- Internals manual synched with 20.3
+-- VM-6.34 courtesy of Kyle Jones
+
 to 19.16 pre1 -- "Queens"
+-- Fix all lisp to refer to only keysyms with `-' instead of `_'.
 -- Hardcode the version number since this is dead code and the previous
    kludgy method doesn't work anymore.
 
--- a/configure	Mon Aug 13 08:57:25 2007 +0200
+++ b/configure	Mon Aug 13 08:57:55 2007 +0200
@@ -8262,8 +8262,11 @@
 # This directory was configured as follows,
 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 #
-# $0 $quoted_arguments
-
+EOF
+sed 's/^/# /' >> config.status <<EOF
+$0 $quoted_arguments
+EOF
+cat >> config.status <<EOF
 ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]"
 for ac_option
 do
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/audio_stamp-colorful.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,43 @@
+/* XPM */
+static char *audio_stamp[] = {
+/* width height num_colors chars_per_pixel */
+"    18    24       12            1",
+/* colors */
+". c #000000",
+"# c #00ffff",
+"a c #00ff00",
+"b c #bebebe s background",
+"c c #ff00ff",
+"d c #ff0000",
+"e c #6e6e6e",
+"f c #ffffff",
+"g c #ffff00",
+"h c #e7e7e7",
+"i c #bfbfbf",
+"j c #0000ff",
+/* pixels */
+"bbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbabbbbb",
+"bbbbbbbbbbbebbbbbb",
+"bbbbbbbeebbbbbebbb",
+"bbbbbbbe.bbbbjebbb",
+"bbbbbbeh.bbejijhbb",
+"bbbbbebh.bijhieiib",
+"bbbbiehh.bieiejibb",
+"b..e.hhh.biebjjiib",
+"b.hehhhh.bejibebci",
+"b.hhhhhh.ijjiibiib",
+"b.hhhhhh.ihiiieiii",
+"b.hhhhhh.ibiiieiii",
+"b.hhhhhh.bhfbbdhii",
+"b.hhhhhh.bbbbieiib",
+"b.hehhhh.bbbideiib",
+"b..e.hhh.bbbidebbb",
+"bbbbbehh.bbbiibbbb",
+"bbbbbebh.bbbbbbbgi",
+"bbbbiieh.bbbbbbbgg",
+"bbbbiibe.bb#bbbbib",
+"bbbbbbbeebbbh#bbgb",
+"bbbbbbbbbbbbbbbbii",
+"bbbbbbbbbbbbbbbbgb"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/audio_stamp-simple.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,43 @@
+/* XPM */
+static char *audio_stamp[] = {
+/* width height num_colors chars_per_pixel */
+"    18    24       12            1",
+/* colors */
+". c #000000",
+"# c #00ffff",
+"a c #00ff00",
+"b c #bebebe s background",
+"c c #ff00ff",
+"d c #ff0000",
+"e c #6e6e6e",
+"f c #ffffff",
+"g c #ffff00",
+"h c #e7e7e7",
+"i c #bfbfbf",
+"j c #0000ff",
+/* pixels */
+"bbbbbbbbbbbbbbbbbb",
+"bbbbbbbbbbbbabbbbb",
+"bbbbbbbbbbbebbbbbb",
+"bbbbbbbeebbbbbebbb",
+"bbbbbbbe.bbbbjebbb",
+"bbbbbbeh.bbejijhbb",
+"bbbbbebh.bijhieiib",
+"bbbbiehh.bieiejibb",
+"b..e.hhh.biebjjiib",
+"b.hehhhh.bejibebci",
+"b.hhhhhh.ijjiibiib",
+"b.hhhhhh.ihiiieiii",
+"b.hhhhhh.ibiiieiii",
+"b.hhhhhh.bhfbbdhii",
+"b.hhhhhh.bbbbieiib",
+"b.hehhhh.bbbideiib",
+"b..e.hhh.bbbidebbb",
+"bbbbbehh.bbbiibbbb",
+"bbbbbebh.bbbbbbbgi",
+"bbbbiieh.bbbbbbbgg",
+"bbbbiibe.bb#bbbbib",
+"bbbbbbbeebbbh#bbgb",
+"bbbbbbbbbbbbbbbbii",
+"bbbbbbbbbbbbbbbbgb"
+};
--- a/etc/vm/audio_stamp.xpm	Mon Aug 13 08:57:25 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,43 +0,0 @@
-/* XPM */
-static char *audio_stamp[] = {
-/* width height num_colors chars_per_pixel */
-"    18    24       12            1",
-/* colors */
-". c #000000",
-"# c #00ffff",
-"a c #00ff00",
-"b c #bebebe s background",
-"c c #ff00ff",
-"d c #ff0000",
-"e c #6e6e6e",
-"f c #ffffff",
-"g c #ffff00",
-"h c #e7e7e7",
-"i c #bfbfbf",
-"j c #0000ff",
-/* pixels */
-"bbbbbbbbbbbbbbbbbb",
-"bbbbbbbbbbbbabbbbb",
-"bbbbbbbbbbbebbbbbb",
-"bbbbbbbeebbbbbebbb",
-"bbbbbbbe.bbbbjebbb",
-"bbbbbbeh.bbejijhbb",
-"bbbbbebh.bijhieiib",
-"bbbbiehh.bieiejibb",
-"b..e.hhh.biebjjiib",
-"b.hehhhh.bejibebci",
-"b.hhhhhh.ijjiibiib",
-"b.hhhhhh.ihiiieiii",
-"b.hhhhhh.ibiiieiii",
-"b.hhhhhh.bhfbbdhii",
-"b.hhhhhh.bbbbieiib",
-"b.hehhhh.bbbideiib",
-"b..e.hhh.bbbidebbb",
-"bbbbbehh.bbbiibbbb",
-"bbbbbebh.bbbbbbbgi",
-"bbbbiieh.bbbbbbbgg",
-"bbbbiibe.bb#bbbbib",
-"bbbbbbbeebbbh#bbgb",
-"bbbbbbbbbbbbbbbbii",
-"bbbbbbbbbbbbbbbbgb"
-};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/document-colorful.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,69 @@
+/* XPM */
+static char *document2[] = {
+/* width height num_colors chars_per_pixel */
+"    24    30       32            1",
+/* colors */
+". c #000000",
+"# c #a4a5a4",
+"a c #9f9f9f",
+"b c #999999",
+"c c #919191",
+"d c #818181",
+"e c #6d6d6d",
+"f c #5d5d5d",
+"g c #494949",
+"h c #eaeaea",
+"i c #373737",
+"j c #e3e4e3",
+"k c #d4d4d4",
+"l c #c8c8c8",
+"m c #0d0d0d",
+"n c #b4b4b4",
+"o c #b0aeb0",
+"p c #aeaeae",
+"q c #aaaaaa s background",
+"r c #888888",
+"s c #767676",
+"t c #646464",
+"u c #545454",
+"v c #ffffff",
+"w c #f6f7f6",
+"x c #efefef",
+"y c #dfdfdf",
+"z c #dad9da",
+"A c #242424",
+"B c #cfcfcf",
+"C c #bfbfbf",
+"D c #b9b9b9",
+/* pixels */
+"qqqqqaetr#qqqqqqqqqqqqqq",
+"qqqq#errefd#qqqqqqqqqqqq",
+"qqq#rzklCqcdsdra#qqqqqqq",
+"qqqrkvvxzkkln#rtfdaqqqqq",
+"qq#dvvvvvvxxzklCqcrdsr#q",
+"qq#rresr#lxvvvvxhzl#tisq",
+"qqqqqdsefgieCxvvvvxiAiiq",
+"qqqqqrCttffuuuernkagtiiq",
+"qqqq#nxvxxcsuetsuigrsitq",
+"qqqqczhzxhzzlC#seffscifq",
+"qqqqrvlyxxzlCCzxxkCaCmrq",
+"qqqq#vvlzqhzvvvklalvciaq",
+"qqqckhlkzzhlCCkhhxvvguqq",
+"qqqrvvxvklalxxxlq#xvmd#q",
+"qqqcvxklkvxvxllkhxvlArqq",
+"qq#Cvvvvvvvvvvvvhxvtgqqq",
+"qqrxxvvvvvvvvvvvvvvAeqqq",
+"qqrvkzhzhxxvvvvvvvkmrqqq",
+"qqqlhvvlCrnkhvvvvvci#qqq",
+"qckxxxhxxkzzllllvvguqqqq",
+"qrvklklxxxhlnlzxvhmrqqqq",
+"qahzvvhCcCnxvxlhvqicqqqq",
+"clxkkqlzhkkklCzvvfg#qqqq",
+"txvvvvxlrzlzvvkvvAeqqqqq",
+"dtalvvvvvvxknzhvlArqqqqq",
+"rgimmgdqhvvvvvvvei#qqqqq",
+"qq#rtiA..i#xvvvvitqqqqqq",
+"qqqqqarsgimmis#Cmrqqqqqq",
+"qqqqqqqqq#ceiA..icqqqqqq",
+"qqqqqqqqqqqq#rdfeqqqqqqq"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/document-simple.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,45 @@
+/* XPM */
+static char *noname[] = {
+/* width height ncolors chars_per_pixel */
+"24 30 8 1",
+/* colors */
+"` c #000000",
+"a c #818181",
+"b c #EAEAEA",
+"c c #D4D4D4",
+"d c #AAAAAA s background",
+"e c #545454",
+"f c #FFFFFF",
+"g c #242424",
+/* pixels */
+"ddddddaeaddddddddddddddd",
+"dddddaaaaeaddddddddddddd",
+"ddddacccddaaaaaddddddddd",
+"dddacffbccccddaeeadddddd",
+"dddaffffffbbcccddaaaaadd",
+"dddaaaaadcbffffbbccdegad",
+"dddddaaaeegadbffffbggggd",
+"dddddadeeeeeeeaadcdeeggd",
+"ddddddbfbbaaeaeaegeaaged",
+"ddddacbcbbcccddaaeeaaged",
+"ddddafccbbccddcbbcddd`ad",
+"dddddffccdbcfffccdcfagdd",
+"dddacbccccbcddcbbbffeedd",
+"dddaffbfccdcbbbcddbf`add",
+"dddafbcccfbfbcccbbfcgadd",
+"ddddffffffffffffbbfeeddd",
+"ddabbffffffffffffffgaddd",
+"ddafccbcbbbfffffffc`addd",
+"dddcbffcdadcbfffffagdddd",
+"dacbbbbbbcccccccffeedddd",
+"dafccccbbbbcdccbfb`adddd",
+"ddbcffbdaddbfbcbfdgadddd",
+"acbccdccbccccdcffeeddddd",
+"ebffffbcacccffcffgaddddd",
+"aedcffffffbcdcbfcgaddddd",
+"aeg``eadbfffffffagdddddd",
+"dddaegg``gdbffffgedddddd",
+"ddddddaaeg``gadd`adddddd",
+"ddddddddddaagg``gadddddd",
+"dddddddddddddaaeaddddddd"
+};
--- a/etc/vm/document.xpm	Mon Aug 13 08:57:25 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/* XPM */
-static char *document2[] = {
-/* width height num_colors chars_per_pixel */
-"    24    30       32            1",
-/* colors */
-". c #000000",
-"# c #a4a5a4",
-"a c #9f9f9f",
-"b c #999999",
-"c c #919191",
-"d c #818181",
-"e c #6d6d6d",
-"f c #5d5d5d",
-"g c #494949",
-"h c #eaeaea",
-"i c #373737",
-"j c #e3e4e3",
-"k c #d4d4d4",
-"l c #c8c8c8",
-"m c #0d0d0d",
-"n c #b4b4b4",
-"o c #b0aeb0",
-"p c #aeaeae",
-"q c #aaaaaa s background",
-"r c #888888",
-"s c #767676",
-"t c #646464",
-"u c #545454",
-"v c #ffffff",
-"w c #f6f7f6",
-"x c #efefef",
-"y c #dfdfdf",
-"z c #dad9da",
-"A c #242424",
-"B c #cfcfcf",
-"C c #bfbfbf",
-"D c #b9b9b9",
-/* pixels */
-"qqqqqaetr#qqqqqqqqqqqqqq",
-"qqqq#errefd#qqqqqqqqqqqq",
-"qqq#rzklCqcdsdra#qqqqqqq",
-"qqqrkvvxzkkln#rtfdaqqqqq",
-"qq#dvvvvvvxxzklCqcrdsr#q",
-"qq#rresr#lxvvvvxhzl#tisq",
-"qqqqqdsefgieCxvvvvxiAiiq",
-"qqqqqrCttffuuuernkagtiiq",
-"qqqq#nxvxxcsuetsuigrsitq",
-"qqqqczhzxhzzlC#seffscifq",
-"qqqqrvlyxxzlCCzxxkCaCmrq",
-"qqqq#vvlzqhzvvvklalvciaq",
-"qqqckhlkzzhlCCkhhxvvguqq",
-"qqqrvvxvklalxxxlq#xvmd#q",
-"qqqcvxklkvxvxllkhxvlArqq",
-"qq#Cvvvvvvvvvvvvhxvtgqqq",
-"qqrxxvvvvvvvvvvvvvvAeqqq",
-"qqrvkzhzhxxvvvvvvvkmrqqq",
-"qqqlhvvlCrnkhvvvvvci#qqq",
-"qckxxxhxxkzzllllvvguqqqq",
-"qrvklklxxxhlnlzxvhmrqqqq",
-"qahzvvhCcCnxvxlhvqicqqqq",
-"clxkkqlzhkkklCzvvfg#qqqq",
-"txvvvvxlrzlzvvkvvAeqqqqq",
-"dtalvvvvvvxknzhvlArqqqqq",
-"rgimmgdqhvvvvvvvei#qqqqq",
-"qq#rtiA..i#xvvvvitqqqqqq",
-"qqqqqarsgimmis#Cmrqqqqqq",
-"qqqqqqqqq#ceiA..icqqqqqq",
-"qqqqqqqqqqqq#rdfeqqqqqqq"
-};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/film-colorful.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,69 @@
+/* XPM */
+static char *film[] = {
+/* width height num_colors chars_per_pixel */
+"    24    30       32            1",
+/* colors */
+". c #000000",
+"# c #799fa1",
+"a c #060919",
+"b c #411707",
+"c c #8fc7ff",
+"d c #3f4040",
+"e c #873d06",
+"f c #62b1e6",
+"g c #392e26",
+"h c #292a2a",
+"i c #9a9e9f",
+"j c #284367",
+"k c #646666",
+"l c #aacae6",
+"m c #238fc1",
+"n c #182a50",
+"o c #93673e",
+"p c #7f7f80",
+"q c #131516",
+"r c #aaaaaa s background",
+"s c #ddf2fd",
+"t c #6991ac",
+"u c #1c0804",
+"v c #494b4a",
+"w c #948b79",
+"x c #733006",
+"y c #151c34",
+"z c #592009",
+"A c #9f4c05",
+"B c #54585d",
+"C c #376389",
+"D c #231305",
+/* pixels */
+"rrrrrrrrwirrrrrrrrrrrrrr",
+"rrrrpddv..prrrrrrrrrrrrr",
+"rrrpjdkyajjprriiiwiiwirr",
+"rrrnf.pfu.tgri.q....agir",
+"rrktC.dlC.hCpiivqCCjjhBr",
+"rrdcv..lca.tjrrddoBoogdr",
+"rptcj.ulcj.djrrvdAAAAzBr",
+"rBtcj..lcCuapprvgxxxxbdr",
+"rvcfB.alkr..#BrBdDDDDuBr",
+"rdjkt.kB.#..#vrBgnnnhadr",
+"rjq.lCla.kq.BvrBgttmtjhr",
+"rn..llc..Bh.BvrkvAAAAbBr",
+"rh..rjl..Bh.kvrkgAAAAzdr",
+"rn..#tla.pa.pdrBgxxxxbdr",
+"rv..rccq.py.pBrvgzbzbqkr",
+"rjhhlniC.ra.rdrvha.auhBr",
+"rv#lt.Bctc..fBrdgCmCChkr",
+"rvcct.qlc#.utkrhztCtpnBr",
+"rBflC..lcC.nCiidxAAAxdkr",
+"rptcB..lcj.Cvrphbeeezhpr",
+"rrdcC.qlfuutkrkhDbzbqhrr",
+"rrktt.Bcv.Cnrrkq....ddrr",
+"rrihtnrtaaBkrrhnCCCnhBrr",
+"rrrdq#t..avrrpBepppDqwrr",
+"rrrp..BipwrrrvDeeexqdrrr",
+"rrrrh.krrrrrkqDbDbDhkrrr",
+"rrrrp.qrrrrphynnyaudrrrr",
+"rrrrrd.hkpBqhoBkjqdprrrr",
+"rrrrrrv......u.qhhprrrrr",
+"rrrrrrrpvqu..uadpirrrrrr"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/film-simple.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,45 @@
+/* XPM */
+static char *noname[] = {
+/* width height ncolors chars_per_pixel */
+"24 30 8 1",
+/* colors */
+"` c #000000",
+"a c #8FC7FF",
+"b c #284367",
+"c c #238FC1",
+"d c #7F7F80",
+"e c #AAAAAA s background",
+"f c #592009",
+"g c #9F4C05",
+/* pixels */
+"eeeeeeeedeeeeeeeeeeeeeee",
+"eeeedbbb``deeeeeeeeeeeee",
+"eeedbbd``bbdeeeeedeedeee",
+"eeeba`da``dfee```````fee",
+"eeddb`bab`fbdeeb`bbbbfbe",
+"eebab``aa``dbeebbgbggfbe",
+"eddab``aab`bbeebbggggfbe",
+"ebdab``aab``ddebffffffbe",
+"ebaab``ade``dbebb`````be",
+"ebbdd`db`d``dbebfbbbf`be",
+"eb``aba``d``bbebfddcdbfe",
+"eb``aaa``bf`bbedbggggfbe",
+"ef``eba``bf`dbedfggggfbe",
+"eb``dda``d``dbebffffffbe",
+"eb``eaa``d``dbebfffff`de",
+"ebffabeb`e``ebebf````fbe",
+"ebdad`bada``abebfbcbbfde",
+"ebaad``aad``ddeffdbddbbe",
+"ebaab``aab`bbeebfgggfbde",
+"eddab``aab`bbedffgggffde",
+"eebab``aa``ddedf`fff`fee",
+"eeddd`bab`bbeed`````bbee",
+"eeefdbed``bdeefbbbbbfbee",
+"eeeb`dd```beedbgddd``dee",
+"eeed``beddeeeb`gggf`beee",
+"eeeef`deeeeed``f`f`fdeee",
+"eeeed``eeeedf`bb```beeee",
+"eeeeeb`fddb`fgbdb`bdeeee",
+"eeeeeeb`````````ffdeeeee",
+"eeeeeeedb``````bdeeeeeee"
+};
--- a/etc/vm/film.xpm	Mon Aug 13 08:57:25 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/* XPM */
-static char *film[] = {
-/* width height num_colors chars_per_pixel */
-"    24    30       32            1",
-/* colors */
-". c #000000",
-"# c #799fa1",
-"a c #060919",
-"b c #411707",
-"c c #8fc7ff",
-"d c #3f4040",
-"e c #873d06",
-"f c #62b1e6",
-"g c #392e26",
-"h c #292a2a",
-"i c #9a9e9f",
-"j c #284367",
-"k c #646666",
-"l c #aacae6",
-"m c #238fc1",
-"n c #182a50",
-"o c #93673e",
-"p c #7f7f80",
-"q c #131516",
-"r c #aaaaaa s background",
-"s c #ddf2fd",
-"t c #6991ac",
-"u c #1c0804",
-"v c #494b4a",
-"w c #948b79",
-"x c #733006",
-"y c #151c34",
-"z c #592009",
-"A c #9f4c05",
-"B c #54585d",
-"C c #376389",
-"D c #231305",
-/* pixels */
-"rrrrrrrrwirrrrrrrrrrrrrr",
-"rrrrpddv..prrrrrrrrrrrrr",
-"rrrpjdkyajjprriiiwiiwirr",
-"rrrnf.pfu.tgri.q....agir",
-"rrktC.dlC.hCpiivqCCjjhBr",
-"rrdcv..lca.tjrrddoBoogdr",
-"rptcj.ulcj.djrrvdAAAAzBr",
-"rBtcj..lcCuapprvgxxxxbdr",
-"rvcfB.alkr..#BrBdDDDDuBr",
-"rdjkt.kB.#..#vrBgnnnhadr",
-"rjq.lCla.kq.BvrBgttmtjhr",
-"rn..llc..Bh.BvrkvAAAAbBr",
-"rh..rjl..Bh.kvrkgAAAAzdr",
-"rn..#tla.pa.pdrBgxxxxbdr",
-"rv..rccq.py.pBrvgzbzbqkr",
-"rjhhlniC.ra.rdrvha.auhBr",
-"rv#lt.Bctc..fBrdgCmCChkr",
-"rvcct.qlc#.utkrhztCtpnBr",
-"rBflC..lcC.nCiidxAAAxdkr",
-"rptcB..lcj.Cvrphbeeezhpr",
-"rrdcC.qlfuutkrkhDbzbqhrr",
-"rrktt.Bcv.Cnrrkq....ddrr",
-"rrihtnrtaaBkrrhnCCCnhBrr",
-"rrrdq#t..avrrpBepppDqwrr",
-"rrrp..BipwrrrvDeeexqdrrr",
-"rrrrh.krrrrrkqDbDbDhkrrr",
-"rrrrp.qrrrrphynnyaudrrrr",
-"rrrrrd.hkpBqhoBkjqdprrrr",
-"rrrrrrv......u.qhhprrrrr",
-"rrrrrrrpvqu..uadpirrrrrr"
-};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/gear-colorful.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,279 @@
+/* XPM */
+static char *gear[] = {
+/* width height num_colors chars_per_pixel */
+"    24    30      242            2",
+/* colors */
+".. c #aaaaaa s background",
+"zz c #aaaaaa",
+".# c #8e8e8e",
+".a c #4d4d4d",
+".b c #9f9f9f",
+".c c #888888",
+".d c #848484",
+".e c #838383",
+".f c #828282",
+".g c #484848",
+".h c #303030",
+".i c #131313",
+".j c #141414",
+".k c #707070",
+".l c #777777",
+".m c #2b2b2b",
+".n c #1d1d1d",
+".o c #121212",
+".p c #393939",
+".q c #727272",
+".r c #a0a0a0",
+".s c #8b8b8b",
+".t c #3e3e3e",
+".u c #878787",
+".v c #151515",
+".w c #2d2d2d",
+".x c #8a8a8a",
+".y c #171717",
+".z c #202020",
+".A c #0c0c0c",
+".B c #191919",
+".C c #222222",
+".D c #333333",
+".E c #2f2f2f",
+".F c #353535",
+".G c #cacaca",
+".H c #e9e9e9",
+".I c #5c5c5c",
+".J c #c5c5c5",
+".K c #323232",
+".L c #d9d9d9",
+".M c #f9f9f9",
+".N c #ffffff",
+".O c #fbfbfb",
+".P c #c7c7c7",
+".Q c #1e1e1e",
+".R c #6c6c6c",
+".S c #a7a7a7",
+".T c #242424",
+".U c #1a1a1a",
+".V c #6e6e6e",
+".W c #bababa",
+".X c #efefef",
+".Y c #fefefe",
+".Z c #f6f6f6",
+".0 c #eaeaea",
+".1 c #e8e8e8",
+".2 c #454545",
+".3 c #d3d3d3",
+".4 c #e0e0e0",
+".5 c #f7f7f7",
+".6 c #4f4f4f",
+".7 c #232323",
+".8 c #e4e4e4",
+".9 c #f0f0f0",
+"#. c #e7e7e7",
+"## c #e5e5e5",
+"#a c #bfbfbf",
+"#b c #fcfcfc",
+"#c c #d1d1d1",
+"#d c #d2d2d2",
+"#e c #ececec",
+"#f c #f5f5f5",
+"#g c #111111",
+"#h c #363636",
+"#i c #7f7f7f",
+"#j c #e6e6e6",
+"#k c #e2e2e2",
+"#l c #e1e1e1",
+"#m c #f4f4f4",
+"#n c #cfcfcf",
+"#o c #cdcdcd",
+"#p c #d5d5d5",
+"#q c #1c1c1c",
+"#r c #101010",
+"#s c #919191",
+"#t c #666666",
+"#u c #dfdfdf",
+"#v c #dddddd",
+"#w c #2e2e2e",
+"#x c #dbdbdb",
+"#y c #cecece",
+"#z c #cccccc",
+"#A c #c8c8c8",
+"#B c #c6c6c6",
+"#C c #c3c3c3",
+"#D c #a3a3a3",
+"#E c #1f1f1f",
+"#F c #212121",
+"#G c #a1a1a1",
+"#H c #272727",
+"#I c #565656",
+"#J c #4e4e4e",
+"#K c #b2b2b2",
+"#L c #dedede",
+"#M c #5d5d5d",
+"#N c #6a6a6a",
+"#O c #dadada",
+"#P c #d0d0d0",
+"#Q c #cbcbcb",
+"#R c #c9c9c9",
+"#S c #c4c4c4",
+"#T c #c2c2c2",
+"#U c #c1c1c1",
+"#V c #373737",
+"#W c #0f0f0f",
+"#X c #969696",
+"#Y c #d7d7d7",
+"#Z c #d8d8d8",
+"#0 c #d6d6d6",
+"#1 c #d4d4d4",
+"#2 c #bdbdbd",
+"#3 c #494949",
+"#4 c #181818",
+"#5 c #343434",
+"#6 c #dcdcdc",
+"#7 c #bebebe",
+"#8 c #bcbcbc",
+"#9 c #0e0e0e",
+"a. c #c0c0c0",
+"a# c #bbbbbb",
+"aa c #b8b8b8",
+"ab c #414141",
+"ac c #b6b6b6",
+"ad c #f8f8f8",
+"ae c #b9b9b9",
+"af c #b7b7b7",
+"ag c #b5b5b5",
+"ah c #3d3d3d",
+"ai c #404040",
+"aj c #7b7b7b",
+"ak c #b4b4b4",
+"al c #afafaf",
+"am c #444444",
+"an c #161616",
+"ao c #4b4b4b",
+"ap c #b3b3b3",
+"aq c #b1b1b1",
+"ar c #adadad",
+"as c #ababab",
+"at c #8f8f8f",
+"au c #b0b0b0",
+"av c #aeaeae",
+"aw c #acacac",
+"ax c #a9a9a9",
+"ay c #a6a6a6",
+"az c #a4a4a4",
+"aA c #9d9d9d",
+"aB c #9b9b9b",
+"aC c #a8a8a8",
+"aD c #a5a5a5",
+"aE c #9e9e9e",
+"aF c #9c9c9c",
+"aG c #9a9a9a",
+"aH c #989898",
+"aI c #383838",
+"aJ c #8c8c8c",
+"aK c #959595",
+"aL c #939393",
+"aM c #6d6d6d",
+"aN c #a2a2a2",
+"aO c #999999",
+"aP c #979797",
+"aQ c #949494",
+"aR c #929292",
+"aS c #909090",
+"aT c #8d8d8d",
+"aU c #292929",
+"aV c #858585",
+"aW c #3f3f3f",
+"aX c #474747",
+"aY c #868686",
+"aZ c #525252",
+"a0 c #2c2c2c",
+"a1 c #7a7a7a",
+"a2 c #4c4c4c",
+"a3 c #585858",
+"a4 c #686868",
+"a5 c #7e7e7e",
+"a6 c #898989",
+"a7 c #717171",
+"a8 c #3a3a3a",
+"a9 c #515151",
+"b. c #5a5a5a",
+"b# c #424242",
+"ba c #818181",
+"bb c #050505",
+"bc c #797979",
+"bd c #505050",
+"be c #747474",
+"bf c #808080",
+"bg c #7c7c7c",
+"bh c #2a2a2a",
+"bi c #4a4a4a",
+"bj c #fafafa",
+"bk c #1b1b1b",
+"bl c #767676",
+"bm c #737373",
+"bn c #262626",
+"bo c #f1f1f1",
+"bp c #0d0d0d",
+"bq c #0b0b0b",
+"br c #787878",
+"bs c #757575",
+"bt c #6f6f6f",
+"bu c #434343",
+"bv c #3b3b3b",
+"bw c #5e5e5e",
+"bx c #696969",
+"by c #252525",
+"bz c #5f5f5f",
+"bA c #575757",
+"bB c #282828",
+"bC c #010101",
+"bD c #6b6b6b",
+"bE c #676767",
+"bF c #646464",
+"bG c #636363",
+"bH c #616161",
+"bI c #000000",
+"bJ c #5b5b5b",
+"bK c #464646",
+"bL c #656565",
+"bM c #595959",
+"bN c #3c3c3c",
+"bO c #606060",
+"bP c #555555",
+"bQ c #545454",
+"bR c #626262",
+"bS c #535353",
+"bT c #7d7d7d",
+"bU c #313131",
+/* pixels */
+"................................................",
+"..................aB.I.l.#.a.a.IaB..............",
+".................l.n.i.m.n.i.i.i.i#t............",
+"...............p.i.i#N.i.i.i.i.n.n.a............",
+"...........H.0.z.iab.M.Gab.i.n.i.i#t............",
+".......W.M.0.H.l.i#N.H.3.0#N.i.i.i.m.r...r......",
+"......#K#X.H.4...p...3.G.J.I.i.i.i.i.6ab.z.r....",
+"......#N.m.4.3.3.G.G.J.J.W.z.i.i.i.n.i.i.i.I....",
+".....J.6.r.4.3.G.G.J.W.W#K#X.n.6#t.i.i.i.i.n.#..",
+"..#K.0.0.0.3.G.J.J.W.W#Kzzzz.#.H.#.n.i.i.i.i#t..",
+"...G.H.3.3.G.J.J.W.W#Kzzzz.r.raB#X.6.i.i.i.aaB..",
+"...4.3.G.G.J.J.W#K#Kzzzz.r.raB#X#X#i.n.i.n#i....",
+"..#X.r.G.J.J#K.W#K.raB.r.raB#X.#.#.c.a.n.i.6....",
+"..aB.p.r.J.W#K#KaB.p.m#NaB#X.#.#.c.l.z.i.i.m....",
+"....aBaB.W#K#Kzz#t.n.i.h.#.#.#.c#iab.i.i.i.i#g.I",
+"....#K#K#Kzzzz.r.a.z.a.i#X.c.c#i.l.a.i.i.i.i.i.6",
+"...W.Hzzzz.r.raB.a.I.m.i.l.##i.l.l.I.i.i.i.n.h#t",
+"...J.Gzz.r.raB#X#tab#t.i.Izz.l#N#N#N.a.p.n.h.6#t",
+".....3.r.raB#X#X#N.p.p#g.m#K.l#N#N#t.I.I.h.6ab.l",
+".....3aBaB#X#X.#.c.c.i.i#t.r#N#t#t.I.6.6ababab..",
+".....3.#.c.#.c.c.czz.l.p.J.l#t.I.I.I.6.6.pab....",
+"....#X.a.p#N.c#i#i#i#K.G.c#t.I.I.6.6abab.n.p....",
+"..........#t#i#i.l#N#N#t.I.I.I.6.6ab.m.z.i.naB..",
+"...........J.l#N#N#N#t.I.I.6.6.a.a.h.i.i.i#i....",
+"........#K.r.l#N#N#t.I.I.6.6.aabab.h.i.i.a......",
+"..........#N#t#t#t.I.I.6.6.aabab.p.p.z.p.r......",
+"...........rab.6.m.p.6.6.aab.p.p.h.h.p.r........",
+".............r.I.c.c.p.aab.h.n.n.h.h#X..........",
+"..................aB.mab.p.p.i.i.z.#............",
+"...................r.z.m.m.mab#N................"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/gear-simple.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,46 @@
+/* XPM */
+static char *noname[] = {
+/* width height ncolors chars_per_pixel */
+"24 30 9 1",
+/* colors */
+"` c #7F7F7F",
+"a c #393939",
+"b c #111111",
+"c c #AAAAAA s background",
+"C c #AAAAAA",
+"d c #969696",
+"e c #5C5C5C",
+"f c #F9F9F9",
+"g c #D3D3D3",
+/* pixels */
+"cccccccccccccccccccccccc",
+"cccccccccde`deeedccccccc",
+"cccccccc`bbabbbbbecccccc",
+"cccccccabbebbbbbbecccccc",
+"cccccffbbafgabbbbecccccc",
+"ccccfff`befgfebbbacccccc",
+"ccccdfgCaCgggebbbbeabccc",
+"ccceagggggggCbbbbbbbbecc",
+"ccgeCgggggCCCdbeebbbbbdc",
+"ccfffggggCCCCCdfdbbbbbec",
+"cgfgggggCCCCCCCddebbbedc",
+"cggggggCCCCCCCddd`bbb`cc",
+"cdCgggCCCCdCCdddd`ebbecc",
+"cdaCgCCCdaaedddd``bbbacc",
+"ccddCCCCebbaddd``abbbbbe",
+"ccCCCCCCebebd````ebbbbbe",
+"ccfCCCCdeeab`d```ebbbbae",
+"cggCCCddeaebec`eeeeabaee",
+"ccgCCdddeaabac`eeeeeaea`",
+"ccgddddd``bbeCeeeeeeaaac",
+"ccgd`d```C`ag`eeeeeeaacc",
+"ccdeae````Cg`eeeeeaabacc",
+"ccccce```eeeeeeeeaabbbdc",
+"cccccg`eeeeeeeeeeabbb`cc",
+"cccccc`eeeeeeeeaaabbeccc",
+"ccccceeeeeeeeeaaaabacccc",
+"ccccccaeaaeeeaaaaaaccccc",
+"ccccccce``aeaabbaadccccc",
+"cccccccccdaaaabbbdcccccc",
+"ccccccccccbaaaaecccccccc"
+};
--- a/etc/vm/gear.xpm	Mon Aug 13 08:57:25 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,279 +0,0 @@
-/* XPM */
-static char *gear[] = {
-/* width height num_colors chars_per_pixel */
-"    24    30      242            2",
-/* colors */
-".. c #aaaaaa s background",
-"zz c #aaaaaa",
-".# c #8e8e8e",
-".a c #4d4d4d",
-".b c #9f9f9f",
-".c c #888888",
-".d c #848484",
-".e c #838383",
-".f c #828282",
-".g c #484848",
-".h c #303030",
-".i c #131313",
-".j c #141414",
-".k c #707070",
-".l c #777777",
-".m c #2b2b2b",
-".n c #1d1d1d",
-".o c #121212",
-".p c #393939",
-".q c #727272",
-".r c #a0a0a0",
-".s c #8b8b8b",
-".t c #3e3e3e",
-".u c #878787",
-".v c #151515",
-".w c #2d2d2d",
-".x c #8a8a8a",
-".y c #171717",
-".z c #202020",
-".A c #0c0c0c",
-".B c #191919",
-".C c #222222",
-".D c #333333",
-".E c #2f2f2f",
-".F c #353535",
-".G c #cacaca",
-".H c #e9e9e9",
-".I c #5c5c5c",
-".J c #c5c5c5",
-".K c #323232",
-".L c #d9d9d9",
-".M c #f9f9f9",
-".N c #ffffff",
-".O c #fbfbfb",
-".P c #c7c7c7",
-".Q c #1e1e1e",
-".R c #6c6c6c",
-".S c #a7a7a7",
-".T c #242424",
-".U c #1a1a1a",
-".V c #6e6e6e",
-".W c #bababa",
-".X c #efefef",
-".Y c #fefefe",
-".Z c #f6f6f6",
-".0 c #eaeaea",
-".1 c #e8e8e8",
-".2 c #454545",
-".3 c #d3d3d3",
-".4 c #e0e0e0",
-".5 c #f7f7f7",
-".6 c #4f4f4f",
-".7 c #232323",
-".8 c #e4e4e4",
-".9 c #f0f0f0",
-"#. c #e7e7e7",
-"## c #e5e5e5",
-"#a c #bfbfbf",
-"#b c #fcfcfc",
-"#c c #d1d1d1",
-"#d c #d2d2d2",
-"#e c #ececec",
-"#f c #f5f5f5",
-"#g c #111111",
-"#h c #363636",
-"#i c #7f7f7f",
-"#j c #e6e6e6",
-"#k c #e2e2e2",
-"#l c #e1e1e1",
-"#m c #f4f4f4",
-"#n c #cfcfcf",
-"#o c #cdcdcd",
-"#p c #d5d5d5",
-"#q c #1c1c1c",
-"#r c #101010",
-"#s c #919191",
-"#t c #666666",
-"#u c #dfdfdf",
-"#v c #dddddd",
-"#w c #2e2e2e",
-"#x c #dbdbdb",
-"#y c #cecece",
-"#z c #cccccc",
-"#A c #c8c8c8",
-"#B c #c6c6c6",
-"#C c #c3c3c3",
-"#D c #a3a3a3",
-"#E c #1f1f1f",
-"#F c #212121",
-"#G c #a1a1a1",
-"#H c #272727",
-"#I c #565656",
-"#J c #4e4e4e",
-"#K c #b2b2b2",
-"#L c #dedede",
-"#M c #5d5d5d",
-"#N c #6a6a6a",
-"#O c #dadada",
-"#P c #d0d0d0",
-"#Q c #cbcbcb",
-"#R c #c9c9c9",
-"#S c #c4c4c4",
-"#T c #c2c2c2",
-"#U c #c1c1c1",
-"#V c #373737",
-"#W c #0f0f0f",
-"#X c #969696",
-"#Y c #d7d7d7",
-"#Z c #d8d8d8",
-"#0 c #d6d6d6",
-"#1 c #d4d4d4",
-"#2 c #bdbdbd",
-"#3 c #494949",
-"#4 c #181818",
-"#5 c #343434",
-"#6 c #dcdcdc",
-"#7 c #bebebe",
-"#8 c #bcbcbc",
-"#9 c #0e0e0e",
-"a. c #c0c0c0",
-"a# c #bbbbbb",
-"aa c #b8b8b8",
-"ab c #414141",
-"ac c #b6b6b6",
-"ad c #f8f8f8",
-"ae c #b9b9b9",
-"af c #b7b7b7",
-"ag c #b5b5b5",
-"ah c #3d3d3d",
-"ai c #404040",
-"aj c #7b7b7b",
-"ak c #b4b4b4",
-"al c #afafaf",
-"am c #444444",
-"an c #161616",
-"ao c #4b4b4b",
-"ap c #b3b3b3",
-"aq c #b1b1b1",
-"ar c #adadad",
-"as c #ababab",
-"at c #8f8f8f",
-"au c #b0b0b0",
-"av c #aeaeae",
-"aw c #acacac",
-"ax c #a9a9a9",
-"ay c #a6a6a6",
-"az c #a4a4a4",
-"aA c #9d9d9d",
-"aB c #9b9b9b",
-"aC c #a8a8a8",
-"aD c #a5a5a5",
-"aE c #9e9e9e",
-"aF c #9c9c9c",
-"aG c #9a9a9a",
-"aH c #989898",
-"aI c #383838",
-"aJ c #8c8c8c",
-"aK c #959595",
-"aL c #939393",
-"aM c #6d6d6d",
-"aN c #a2a2a2",
-"aO c #999999",
-"aP c #979797",
-"aQ c #949494",
-"aR c #929292",
-"aS c #909090",
-"aT c #8d8d8d",
-"aU c #292929",
-"aV c #858585",
-"aW c #3f3f3f",
-"aX c #474747",
-"aY c #868686",
-"aZ c #525252",
-"a0 c #2c2c2c",
-"a1 c #7a7a7a",
-"a2 c #4c4c4c",
-"a3 c #585858",
-"a4 c #686868",
-"a5 c #7e7e7e",
-"a6 c #898989",
-"a7 c #717171",
-"a8 c #3a3a3a",
-"a9 c #515151",
-"b. c #5a5a5a",
-"b# c #424242",
-"ba c #818181",
-"bb c #050505",
-"bc c #797979",
-"bd c #505050",
-"be c #747474",
-"bf c #808080",
-"bg c #7c7c7c",
-"bh c #2a2a2a",
-"bi c #4a4a4a",
-"bj c #fafafa",
-"bk c #1b1b1b",
-"bl c #767676",
-"bm c #737373",
-"bn c #262626",
-"bo c #f1f1f1",
-"bp c #0d0d0d",
-"bq c #0b0b0b",
-"br c #787878",
-"bs c #757575",
-"bt c #6f6f6f",
-"bu c #434343",
-"bv c #3b3b3b",
-"bw c #5e5e5e",
-"bx c #696969",
-"by c #252525",
-"bz c #5f5f5f",
-"bA c #575757",
-"bB c #282828",
-"bC c #010101",
-"bD c #6b6b6b",
-"bE c #676767",
-"bF c #646464",
-"bG c #636363",
-"bH c #616161",
-"bI c #000000",
-"bJ c #5b5b5b",
-"bK c #464646",
-"bL c #656565",
-"bM c #595959",
-"bN c #3c3c3c",
-"bO c #606060",
-"bP c #555555",
-"bQ c #545454",
-"bR c #626262",
-"bS c #535353",
-"bT c #7d7d7d",
-"bU c #313131",
-/* pixels */
-"................................................",
-"..................aB.I.l.#.a.a.IaB..............",
-".................l.n.i.m.n.i.i.i.i#t............",
-"...............p.i.i#N.i.i.i.i.n.n.a............",
-"...........H.0.z.iab.M.Gab.i.n.i.i#t............",
-".......W.M.0.H.l.i#N.H.3.0#N.i.i.i.m.r...r......",
-"......#K#X.H.4...p...3.G.J.I.i.i.i.i.6ab.z.r....",
-"......#N.m.4.3.3.G.G.J.J.W.z.i.i.i.n.i.i.i.I....",
-".....J.6.r.4.3.G.G.J.W.W#K#X.n.6#t.i.i.i.i.n.#..",
-"..#K.0.0.0.3.G.J.J.W.W#Kzzzz.#.H.#.n.i.i.i.i#t..",
-"...G.H.3.3.G.J.J.W.W#Kzzzz.r.raB#X.6.i.i.i.aaB..",
-"...4.3.G.G.J.J.W#K#Kzzzz.r.raB#X#X#i.n.i.n#i....",
-"..#X.r.G.J.J#K.W#K.raB.r.raB#X.#.#.c.a.n.i.6....",
-"..aB.p.r.J.W#K#KaB.p.m#NaB#X.#.#.c.l.z.i.i.m....",
-"....aBaB.W#K#Kzz#t.n.i.h.#.#.#.c#iab.i.i.i.i#g.I",
-"....#K#K#Kzzzz.r.a.z.a.i#X.c.c#i.l.a.i.i.i.i.i.6",
-"...W.Hzzzz.r.raB.a.I.m.i.l.##i.l.l.I.i.i.i.n.h#t",
-"...J.Gzz.r.raB#X#tab#t.i.Izz.l#N#N#N.a.p.n.h.6#t",
-".....3.r.raB#X#X#N.p.p#g.m#K.l#N#N#t.I.I.h.6ab.l",
-".....3aBaB#X#X.#.c.c.i.i#t.r#N#t#t.I.6.6ababab..",
-".....3.#.c.#.c.c.czz.l.p.J.l#t.I.I.I.6.6.pab....",
-"....#X.a.p#N.c#i#i#i#K.G.c#t.I.I.6.6abab.n.p....",
-"..........#t#i#i.l#N#N#t.I.I.I.6.6ab.m.z.i.naB..",
-"...........J.l#N#N#N#t.I.I.6.6.a.a.h.i.i.i#i....",
-"........#K.r.l#N#N#t.I.I.6.6.aabab.h.i.i.a......",
-"..........#N#t#t#t.I.I.6.6.aabab.p.p.z.p.r......",
-"...........rab.6.m.p.6.6.aab.p.p.h.h.p.r........",
-".............r.I.c.c.p.aab.h.n.n.h.h#X..........",
-"..................aB.mab.p.p.i.i.z.#............",
-"...................r.z.m.m.mab#N................"
-};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/message-colorful.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,62 @@
+/* XPM */
+static char *message[] = {
+/* width height num_colors chars_per_pixel */
+"    24    30       25            1",
+/* colors */
+". c #000000",
+"# c #a4a579",
+"a c #9f9c66",
+"b c #918e5d",
+"c c #817f53",
+"d c #6d6b46",
+"e c #5d5b3c",
+"f c #49482f",
+"g c #eae696",
+"h c #373623",
+"i c #d4d088",
+"j c #c8c480",
+"k c #0d0d08",
+"l c #b4b173",
+"m c #aaa76d s background",
+"n c #888657",
+"o c #76744c",
+"p c #646240",
+"q c #545236",
+"r c #fffaa3",
+"s c #efeb99",
+"t c #dfdb8f",
+"u c #bac384",
+"v c #242317",
+"w c #bfbc7a",
+/* pixels */
+"mmmmmadpn#mmmmmmmmmmmmmm",
+"mmmm#dnndec#mmmmmmmmmmmm",
+"mmm#nuijwmbcocna#mmmmmmm",
+"mmmnirrsuiijl#npecammmmm",
+"mm#crrrrrrssuijwmbncon#m",
+"mm#nndon#jsrrrrsguj#phom",
+"mmmmmcodefhdwsrrrrshvhhm",
+"mmmmmnwppeeqqqdnliafphhm",
+"mmmm#lsrssboqdpoqhfnohpm",
+"mmmmbugusguujw#odeeobhem",
+"mmmmnrjtssujwwussiwawknm",
+"mmmm#rrjumgurrrijajrbham",
+"mmmbigjiuugjwwiggsrrfqmm",
+"mmmnrrsrijajsssjm#srkc#m",
+"mmmbrsijirsrsjjigsrjvnmm",
+"mm#wrrrrrrrrrrrrgsrpfmmm",
+"mmnssrrrrrrrrrrrrrrvdmmm",
+"mmnriugugssrrrrrrriknmmm",
+"mmmjgrrjwnligrrrrrbh#mmm",
+"mbisssgssiuujjjjrrfqmmmm",
+"mnrijijsssgjljusrgknmmmm",
+"magurrgwbwlsrsjgrmhbmmmm",
+"bjsiimjugiiijwurref#mmmm",
+"psrrrrsjnujurrirrvdmmmmm",
+"cpajrrrrrrsilugrjvnmmmmm",
+"nfhkkfcmgrrrrrrrdh#mmmmm",
+"mm#nphv..h#srrrrhpmmmmmm",
+"mmmmmanofhkkho#wknmmmmmm",
+"mmmmmmmmm#bdhv..hbmmmmmm",
+"mmmmmmmmmmmm#ncedmmmmmmm"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/message-simple.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,45 @@
+/* XPM */
+static char *noname[] = {
+/* width height ncolors chars_per_pixel */
+"24 30 8 1",
+/* colors */
+"` c #000000",
+"a c #817F53",
+"b c #FFFAA3",
+"c c #545236",
+"d c #BFBC7A",
+"e c #AAA76D s background",
+"f c #242317",
+"g c #D4D088",
+/* pixels */
+"eeeeeeacaeeeeeeeeeeeeeee",
+"eeeeeaaaacaeeeeeeeeeeeee",
+"eeeeadgddeaaaaaeeeeeeeee",
+"eeeagbbbdggdeeaccaeeeeee",
+"eeeabbbbbbbbdgddeaaaaaee",
+"eeeaaaaaedbbbbbbbddecfae",
+"eeeeeaaaccfadbbbbbbffffe",
+"eeeeeadcccccccaaegeccffe",
+"eeeeeebbbbaacacacfcaafce",
+"eeeeadbdbbddddeaaccaafce",
+"eeeeabdgbbdddddbbgded`ae",
+"eeeeebbddebdbbbgdedbafee",
+"eeeagbdgddbdddgbbbbbccee",
+"eeeabbbbgdedbbbdeebb`aee",
+"eeeabbgdgbbbbddgbbbdfaee",
+"eeedbbbbbbbbbbbbbbbcceee",
+"eeabbbbbbbbbbbbbbbbfaeee",
+"eeabgdbdbbbbbbbbbbg`aeee",
+"eeedbbbddaegbbbbbbafeeee",
+"eagbbbbbbgddddddbbcceeee",
+"eabgdgdbbbbdeddbbb`aeeee",
+"eebdbbbdadebbbdbbefaeeee",
+"adbggeddbgggdddbbcceeeee",
+"cbbbbbbdadddbbgbbfaeeeee",
+"acedbbbbbbbgedbbdfaeeeee",
+"acf``caebbbbbbbbafeeeeee",
+"eeeacff``febbbbbfceeeeee",
+"eeeeeeaacf``faed`aeeeeee",
+"eeeeeeeeeeaaff``faeeeeee",
+"eeeeeeeeeeeeeaacaeeeeeee"
+};
--- a/etc/vm/message.xpm	Mon Aug 13 08:57:25 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,62 +0,0 @@
-/* XPM */
-static char *message[] = {
-/* width height num_colors chars_per_pixel */
-"    24    30       25            1",
-/* colors */
-". c #000000",
-"# c #a4a579",
-"a c #9f9c66",
-"b c #918e5d",
-"c c #817f53",
-"d c #6d6b46",
-"e c #5d5b3c",
-"f c #49482f",
-"g c #eae696",
-"h c #373623",
-"i c #d4d088",
-"j c #c8c480",
-"k c #0d0d08",
-"l c #b4b173",
-"m c #aaa76d s background",
-"n c #888657",
-"o c #76744c",
-"p c #646240",
-"q c #545236",
-"r c #fffaa3",
-"s c #efeb99",
-"t c #dfdb8f",
-"u c #bac384",
-"v c #242317",
-"w c #bfbc7a",
-/* pixels */
-"mmmmmadpn#mmmmmmmmmmmmmm",
-"mmmm#dnndec#mmmmmmmmmmmm",
-"mmm#nuijwmbcocna#mmmmmmm",
-"mmmnirrsuiijl#npecammmmm",
-"mm#crrrrrrssuijwmbncon#m",
-"mm#nndon#jsrrrrsguj#phom",
-"mmmmmcodefhdwsrrrrshvhhm",
-"mmmmmnwppeeqqqdnliafphhm",
-"mmmm#lsrssboqdpoqhfnohpm",
-"mmmmbugusguujw#odeeobhem",
-"mmmmnrjtssujwwussiwawknm",
-"mmmm#rrjumgurrrijajrbham",
-"mmmbigjiuugjwwiggsrrfqmm",
-"mmmnrrsrijajsssjm#srkc#m",
-"mmmbrsijirsrsjjigsrjvnmm",
-"mm#wrrrrrrrrrrrrgsrpfmmm",
-"mmnssrrrrrrrrrrrrrrvdmmm",
-"mmnriugugssrrrrrrriknmmm",
-"mmmjgrrjwnligrrrrrbh#mmm",
-"mbisssgssiuujjjjrrfqmmmm",
-"mnrijijsssgjljusrgknmmmm",
-"magurrgwbwlsrsjgrmhbmmmm",
-"bjsiimjugiiijwurref#mmmm",
-"psrrrrsjnujurrirrvdmmmmm",
-"cpajrrrrrrsilugrjvnmmmmm",
-"nfhkkfcmgrrrrrrrdh#mmmmm",
-"mm#nphv..h#srrrrhpmmmmmm",
-"mmmmmanofhkkho#wknmmmmmm",
-"mmmmmmmmm#bdhv..hbmmmmmm",
-"mmmmmmmmmmmm#ncedmmmmmmm"
-};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/mona_stamp-colorful.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,123 @@
+/* XPM */
+static char *noname[] = {
+/* width height ncolors chars_per_pixel */
+"24 30 86 2",
+/* colors */
+"`` c #B88D37",
+"`a c #200505",
+"`b c #F49B12",
+"`c c #704B25",
+"`d c #B65D0A",
+"`e c #4D2713",
+"`f c #FFAC19",
+"`g c #64300F",
+"`h c #321B0C",
+"`i c #582E03",
+"`j c #C07920",
+"`k c #874F09",
+"`l c #593514",
+"`m c #A07C21",
+"`n c #DE7F1C",
+"`o c #481103",
+"`p c #542D15",
+"`q c #58220F",
+"`r c #D1AC4A",
+"`s c #DFA644",
+"`t c #EC9708",
+"`u c #501A07",
+"`v c #3D1608",
+"`w c #90602B",
+"`x c #350000",
+"`y c #A77B13",
+"`z c #A04E13",
+"a` c #AC7E39",
+"aa c #997319",
+"ab c #DA9C1A",
+"ac c #8B6F1F",
+"ad c #280C0A",
+"ae c #98460B",
+"af c #AF5707",
+"ag c #631C0F",
+"ah c #764F35",
+"ai c #E6B339",
+"aj c #804500",
+"ak c #DEAB31",
+"al c #802B00",
+"am c #C06B21",
+"an c #91732E",
+"ao c #643C19",
+"ap c #A54F03",
+"aq c #A78A40",
+"ar c #7E5C25",
+"as c #793313",
+"at c #804F1D",
+"au c #AD913F",
+"av c #85681B",
+"aw c #CB6E00",
+"ax c #30120D",
+"ay c #B89846",
+"az c #8C3904",
+"b` c #B96219",
+"ba c #FABB1D",
+"bb c #A68527",
+"bc c #85652B",
+"bd c #F2B315",
+"be c #FFC125",
+"bf c #7D430C",
+"bg c #C86B0D",
+"bh c #EAAB0D",
+"bi c #420907",
+"bj c #9D5828",
+"bk c #D68000",
+"bl c #813A1D",
+"bm c #F7A413",
+"bn c #9C6E2A",
+"bo c #A1833C",
+"bp c #75551E",
+"bq c #BF6307",
+"br c #997B34",
+"bs c #D27213",
+"bt c #431F0E",
+"bu c #712A0D",
+"bv c #74411D",
+"bw c #CAA239",
+"bx c #C0982F",
+"by c #A7551A",
+"bz c #E98912",
+"c` c #E1810A",
+"ca c #501321",
+"cb c #DB7B04",
+"cc c #EF911E",
+"cd c #390C00",
+/* pixels */
+"acananacbcanbrananacbracbpararacanacananananbrbr",
+"avananacacacacanbnbp`pbtaxad`hbtaobcananbrbrbobr",
+"anbranaaanananar`vad`x`a`a`a`a`a`aad`eavbrbobobr",
+"br`mbbbbbbbrbpadadbibi`aad`a`a`a`a`a`aaxbcbobobo",
+"bbbbbbbbaqbnad`a`x`ucd`x`a`a`a`a`aadad`a`hanauaq",
+"bbbbaq``aq`v`uae`jc``nbsae`qad`a`a`aad`a`a`eaqaq",
+"bb``bxayat`vafab`fbabd`bbzapagbi`a`a`aad`a`aarau",
+"````ay``btbubzbdbebababa`bbsajcdad`a`a`a`a`a`hau",
+"ayayay`wadaeab`fbdbdbdbd`tawaeagbi`aad`a`a`a`aac",
+"bwbx```qbiae`tbmbh`fbh`fc`bs`dae`gbi`a`a`a`a`a`p",
+"`s`rbjbi`hbqc`bmbmbh`fbm`bc``nbqaecdadadad`a`a`h",
+"aiakbvadbibsbzc``tbm`tbqaf`dbqaebuadad`xadad`aax",
+"bw```qbibiasazasafc`azbiblal`obicd`x`aad`xadad`a",
+"a`br`uadbibtbl`uasbzagalafca`uas`z`uadadad`aadad",
+"bcbo`vbi`hbsbsbyawccalbybs`d`dbkbg`u`xadadadadad",
+"`ebv`vad`uc`bhbmc`bzafbsbhbabmcbap`uad`xadadadad",
+"`v`e`vbibibgbmbmbzbm`dbs`tbm`tbqbl`xad`xad`x`xbi",
+"`v`vbiadadaf`t`tc`bzaf`dcc`tbsae`q`xbiadbiadadad",
+"bi`h`x`vbibubsc`bq`z`vbu`tcbafbu`uadadbiadbiadbi",
+"`vbibiad`h`uapbqbzas`qaeafafaebu`ubiadadadbiadad",
+"`h`hbibibi`haeapbyae`q`uazbqapbu`vadadcdaxadbiax",
+"btbtad`hbiadagbqc`afbfbfapbybf`ucdad`xaxbiadadbi",
+"`ibtbibiadbiad`qbsbm`n`daeas`u`vcd`xadbiad`hbiad",
+"ao`e`hbiaxadadadasc`bk`z`q`u`vbibiaxadadbiadadbi",
+"ar`c`v`hbiadbi`aad`u`u`vcdbiadadbibiadbiadadbiad",
+"bparbt`x`hbiad`aadadbibiad`xbiadbi`h`xadadadadad",
+"bp`c`eaxbiadbi`aadadas`g`v`hbibt`v`q`v`xadadbiad",
+"ar`c`lbiaxbiadadad`abu`daj`q`u`ubuaj`qbiadadadad",
+"ahaobtax`hbiaxadadad`u`dae`kbfbfaeaebf`vbiad`vcd",
+"ax`h`hbiadadbiadbi`q`d`yb``d`d`ybgam`d`gbi`hcd`v"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/mona_stamp-simple.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,45 @@
+/* XPM */
+static char *noname[] = {
+/* width height ncolors chars_per_pixel */
+"24 30 8 1",
+/* colors */
+"` c #F49B12",
+"a c #64300F",
+"b c #280C0A",
+"c c #B89846",
+"d c #8C3904",
+"e c #FFC125",
+"f c #9D5828",
+"g c #D68000",
+/* pixels */
+"ffffffffffffffffffffffff",
+"ffffffffffabbbbbafffffcf",
+"ffffffffbbbbbbbbbbaffccf",
+"ffcccffbbbbbbbbbbbbbfccc",
+"cccccfbbbabbbbbbbbbbbfcc",
+"cccccbadggggdabbbbbbbacc",
+"ccccfbf``e```dabbbbbbbfc",
+"ccccba``eeee`gdbbbbbbbbc",
+"cccfbd```````gdabbbbbbbf",
+"cccabd``````ggfdabbbbbba",
+"ccfbbgg``````gggdbbbbbbb",
+"e`abbg`g```gffgdabbbbbbb",
+"ccabbadafgdbddbbbbbbbbbb",
+"cfabbbdaa`adfaaafabbbbbb",
+"fcbbbggfg`dfgffggabbbbbb",
+"aabbag``g`fg`e`gdabbbbbb",
+"babbbg````fg```gdbbbbbbb",
+"bbbbbf``g`ff``gdabbbbbbb",
+"bbbbbagggfba`gfaabbbbbbb",
+"bbbbbadg`aadffdaabbbbbbb",
+"bbbbbbddfdaadgdabbbbbbbb",
+"bbbbbbaggfdddfdabbbbbbbb",
+"abbbbbbag`gfdaabbbbbbbbb",
+"aabbbbbbaggfaabbbbbbbbbb",
+"fabbbbbbbaabbbbbbbbbbbbb",
+"ffbbbbbbbbbbbbbbbbbbbbbb",
+"faabbbbbbbaabbbbbabbbbbb",
+"faabbbbbbbafdaaaadabbbbb",
+"fabbbbbbbbafdddddddbbbbb",
+"bbbbbbbbbaffffffgffabbbb"
+};
Binary file etc/vm/mona_stamp.gif has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/stuffed_box-colorful.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,291 @@
+/* XPM */
+static char *stuffed_box[] = {
+/* width height num_colors chars_per_pixel */
+"    24    30      254            2",
+/* colors */
+".. c #000000",
+".# c #b1b1b1",
+".a c #242120",
+".b c #505955",
+".c c #491909",
+".d c #3e1608",
+".e c #a9a9a9 s background",
+".f c #eeeef0",
+".g c #a7a7a7",
+".h c #a3411c",
+".i c #663622",
+".j c #5c210b",
+".k c #a83e17",
+".l c #2f2824",
+".m c #9f7b71",
+".n c #d38141",
+".o c #a3a3a3",
+".p c #d27f40",
+".q c #a1a1a1",
+".r c #511c0a",
+".s c #ccc1be",
+".t c #9d9d9d",
+".u c #cd773b",
+".v c #903a13",
+".w c #592a15",
+".x c #1e1d1d",
+".y c #cdcccc",
+".z c #959595",
+".A c #939393",
+".B c #e8ac69",
+".C c #919191",
+".D c #8f8f8f",
+".E c #8d8d8d",
+".F c #240e05",
+".G c #652810",
+".H c #a55f3b",
+".I c #878787",
+".J c #f2f1f0",
+".K c #a0491f",
+".L c #8a4a27",
+".M c #0c0401",
+".N c #efbf80",
+".O c #7d7d7d",
+".P c #3d3531",
+".Q c #2a0b04",
+".R c #7b7b7b",
+".S c #81401e",
+".T c #797979",
+".U c #adacac",
+".V c #904d26",
+".W c #eab071",
+".X c #11132a",
+".Y c #737373",
+".Z c #999695",
+".0 c #ab4119",
+".1 c #d16d31",
+".2 c #b3b8b5",
+".3 c #030305",
+".4 c #212129",
+".5 c #b74c1e",
+".6 c #ca7b41",
+".7 c #696969",
+".8 c #404644",
+".9 c #2d1e17",
+"#. c #656565",
+"## c #8b3417",
+"#a c #dfae7d",
+"#b c #f5eeef",
+"#c c #5e260f",
+"#d c #d58445",
+"#e c #5f5f5f",
+"#f c #763416",
+"#g c #5a200b",
+"#h c #301006",
+"#i c #7a2f10",
+"#j c #edb87a",
+"#k c #4e1b09",
+"#l c #da8e4d",
+"#m c #8b8a8a",
+"#n c #d97435",
+"#o c #d58648",
+"#p c #32160b",
+"#q c #fefefe",
+"#r c #e8ad6b",
+"#s c #020000",
+"#t c #474747",
+"#u c #bfbfc0",
+"#v c #4f505c",
+"#w c #6b280e",
+"#x c #fcdf9c",
+"#y c #e39e5c",
+"#z c #160803",
+"#A c #3f3f3f",
+"#B c #61230e",
+"#C c #140601",
+"#D c #3c0e04",
+"#E c #7e3010",
+"#F c #eaeaea",
+"#G c #a4a3a2",
+"#H c #bb5121",
+"#I c #cd642c",
+"#J c #b94f1f",
+"#K c #cb622a",
+"#L c #333333",
+"#M c #d88747",
+"#N c #110601",
+"#O c #d58344",
+"#P c #070301",
+"#Q c #511e0b",
+"#R c #bf9f84",
+"#S c #d2d2d2",
+"#T c #6f290e",
+"#U c #eed6b2",
+"#V c #c55c27",
+"#W c #441708",
+"#X c #bab8b7",
+"#Y c #e9ae6b",
+"#Z c #823110",
+"#0 c #171717",
+"#1 c #eccba6",
+"#2 c #51200e",
+"#3 c #a33c16",
+"#4 c #983915",
+"#5 c #7f6352",
+"#6 c #eab26f",
+"#7 c #361207",
+"#8 c #bd5222",
+"#9 c #d0672e",
+"a. c #a35326",
+"a# c #da8f52",
+"aa c #aaaaaa",
+"ab c #a8a8a8",
+"ac c #a6a6a6",
+"ad c #a4a4a4",
+"ae c #d38041",
+"af c #303246",
+"ag c #a2a2a2",
+"ah c #b85020",
+"ai c #d17e3f",
+"aj c #521d0b",
+"ak c #a0a0a0",
+"al c #e6a764",
+"am c #d07c3e",
+"an c #cf7a3d",
+"ao c #9e9e9e",
+"ap c #9c9c9c",
+"aq c #c75d28",
+"ar c #1b0a03",
+"as c #d88a49",
+"at c #433f3e",
+"au c #989898",
+"av c #65250d",
+"aw c #969696",
+"ax c #0a0806",
+"ay c #949494",
+"az c #581e0a",
+"aA c #c6c5c5",
+"aB c #909090",
+"aC c #d67d3d",
+"aD c #9ea0a1",
+"aE c #121211",
+"aF c #db7838",
+"aG c #414249",
+"aH c #8a8a8a",
+"aI c #d88c4c",
+"aJ c #b0461b",
+"aK c #28322d",
+"aL c #4f5150",
+"aM c #833613",
+"aN c #848484",
+"aO c #361306",
+"aP c #808080",
+"aQ c #551e0a",
+"aR c #762d10",
+"aS c #837b79",
+"aT c #17110f",
+"aU c #cfcfd4",
+"aV c #943413",
+"aW c #767676",
+"aX c #98534f",
+"aY c #ad461b",
+"aZ c #727272",
+"a0 c #1c1917",
+"a1 c #c06a34",
+"a2 c #6c6c6c",
+"a3 c #722b0f",
+"a4 c #c96029",
+"a5 c #9a9999",
+"a6 c #60616a",
+"a7 c #67240e",
+"a8 c #764a37",
+"a9 c #3b1407",
+"b. c #504e4d",
+"b# c #100601",
+"ba c #e7aa67",
+"bb c #f4e0b9",
+"bc c #d4d6d5",
+"bd c #423028",
+"be c #545454",
+"bf c #d66f32",
+"bg c #c05623",
+"bh c #d36b2f",
+"bi c #d2692e",
+"bj c #4a4a4a",
+"bk c #762e0f",
+"bl c #461d0e",
+"bm c #56150a",
+"bn c #6c290f",
+"bo c #ecb472",
+"bp c #c58859",
+"bq c #404040",
+"br c #5f220c",
+"bs c #3a3a3a",
+"bt c #cd652c",
+"bu c #363636",
+"bv c #e7e7e7",
+"bw c #732c0f",
+"bx c #fee4a1",
+"by c #68270e",
+"bz c #dfdfdf",
+"bA c #7a3819",
+"bB c #2c2c2c",
+"bC c #dbdbdb",
+"bD c #f0ece9",
+"bE c #d48243",
+"bF c #282828",
+"bG c #4e4b4a",
+"bH c #5c5b5b",
+"bI c #988f8c",
+"bJ c #de7c39",
+"bK c #b54c1e",
+"bL c #b44a1d",
+"bM c #b3481c",
+"bN c #342f2d",
+"bO c #220701",
+"bP c #c45b26",
+"bQ c #190802",
+"bR c #c35925",
+"bS c #d56c30",
+"bT c #3f3d3b",
+"bU c #e0803e",
+"bV c #fbfafa",
+"bW c #dd9252",
+"bX c #afb0b6",
+"bY c #772b0f",
+"bZ c #f7f6f6",
+"b0 c #220b04",
+"b1 c #0e0e0e",
+"b2 c #cb763d",
+"b3 c #dd9b5f",
+"b4 c #ad4219",
+"b5 c #fadb99",
+"b6 c #67756f",
+"b7 c #e9e8e8",
+/* pixels */
+".e.e.e.e.e.e.e.e.e.e.e.e.o.e.e.e.e.e.e.e.e.e.e.e",
+".e.e.e.e.e.e.e.e.e.e.e.o.2.Z.m.o.e.e.e.e.o.o.e.e",
+".e.e.e.e.e.e.e.e.e.e.obcbZ.6bp.H.m.o.e.e.e.s.o.o",
+".e.e.e.e.e.e.e.e.e.e.fbZbZbbbc.Nbp.H.map.2.mbZbz",
+".e.e.e.e.e.e.e.e.e.e#RbIbc#b.qbp.W.Bbpa.a8.YaA.7",
+".e.e.e.e.e.e.e.ebIa8.y.sbD#S.Ibe.L.B#rbob3.Lbl.o",
+".e.e.e.e.e.e.o#5a1#abe.y.o.qb.#e.q#U.Nbobob5.w.e",
+".e.e.e.e.ebI.H.n#RbI.q#eaPbdb..o.I#X.N.W.N#lbl.e",
+".e.e.e.oaXa1.nai.Vblb.#..9.x.Rbc#S.i#a.N#daF.d.e",
+".e.e.e.ia1bU.uai.n.6bdbs.3#z.dbI#jal.N#n#n.SaLaA",
+".e.e.e#W#c.Hai.u.6a#.m.3a8aI.H.Hal.N#n.1.Sat#XbI",
+".e.e.e#W.v.j.V.uai.n#l.6bpas#lal#1#n#I.S.vbnaTaN",
+".e.e.e.Q.v.v#w.Ga1.u#d#das#lbW.N#I#I.S#Z.1#Ibl.e",
+".e.e.e.9bO#T.v#Z.j.H.u.n.na#.N.u#V.v.F#Ra#.1.9.U",
+".e.e.e.P#haE.G.v.v.jbA.ua#.N.ubg.haTb.#b#obfbl.e",
+".e.e.A.o#SbHbF#p#T.v#E.Gbpa4#HbnaTaLbIbp#Va.bT.U",
+".e.e.e.IbcaubH#7#7.j.v#i.v.5#E##bY.v.h#V#Hbdak.e",
+".e.e.eb.a8#S.9.G#ibl.d#T##.vaY#H.5.5bgbgblaN.q.e",
+".e.e.eb..Ga8.i#ZbYbY.j.Q.jaY.5.5#H#H.m.w.7.o.e.e",
+".e.e.ebGbYbn#w#i#T#T#T.j#ZaJ.5.5.5.S.y#u.A.o.e.e",
+".e.e.oaL.d#Tbn#T#T#T#w.G#ZaY.5.h.i.Dbz.fbV.y#u.o",
+".e.eapbHaxbObTa2#T#w.G.j#iaYaYb..2aua6.Obzbz#q.2",
+".e.e.o.RaL.a.q.Ube#w.j.jaR.k#4#h#A.o.Dbzau#qbcap",
+".e.eapaN#Aa2.ybv#Xa8#g#g#T.k#Z.PbG#L.o.2.2bZ.A.o",
+".o.I.Aak.fbZbXaZbz#.#gbl#T##bd.IaNbH#L.Obz.2.z.e",
+".Aa2.Rbz.eaAaDaNaU.lax.d.j.9aP.q.e.AbHbsa2aN.o.e",
+"ap.Y#AaA#S.o.DbZ.obebBb1aTaS.o.e.e.o.Ia2.Yap.e.e",
+".o.AbHbeaAaU.faA.I.I.7be.Rak.e.e.e.e.eap.o.e.e.e",
+".e.o.Ibe#A#u.e.R.o.oap.A.o.e.e.e.e.e.e.e.e.e.e.e",
+".e.e.oaNbHbe.R.o.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e"
+};
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/etc/vm/stuffed_box-simple.xpm	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,46 @@
+/* XPM */
+static char *noname[] = {
+/* width height ncolors chars_per_pixel */
+"24 30 9 1",
+/* colors */
+"` c #A9A9A9 s background",
+"- c #A9A9A9",
+"a c #A83E17",
+"b c #030305",
+"c c #DA8E4D",
+"d c #FEFEFE",
+"e c #60616A",
+"f c #423028",
+"g c #FADB99",
+/* pixels */
+"````````````````````````",
+"``````````````e`````````",
+"```````````ddccae```````",
+"``````````dddgdgcae``edd",
+"`````````---dd-ccccafe`e",
+"`````````f--dg-eaccccaf`",
+"```````ecce---ee-ggccgf`",
+"``````ac---eefe---gcgcf`",
+"````acccafeeffedgfcgccf`",
+"```fccccccffbbf-gcgccae`",
+"```ffaccccebfcaacgccaf-`",
+"```fafacccccccccgccaafbe",
+"```baaffcccccccgccaaccf`",
+"```fbfaafaccccgcaab-ccf`",
+"```fbbfaafaccgcaabedccf`",
+"```-gefffaafcaafbe-caaf`",
+"```-d-efffaaaaaaaaaaaf``",
+"```efgffafffaaaaaaaafe``",
+"```efffaaafbfaaaaaefe```",
+"```eaffaffffaaaaaa--````",
+"```effffffffaaaaf-ddd```",
+"```ebbfeffffaaae--eeddd`",
+"```eef--efffaaabf--d-dd`",
+"```efe-d-ffffaafef---d``",
+"```-dd-edefffaf`eefed```",
+"`eed---e-fbfffe```efee``",
+"`ef-g--d-efbbe`````ee```",
+"``ee--d---eee```````````",
+"```ef--e````````````````",
+"```eeee`````````````````"
+};
--- a/etc/vm/stuffed_box.xpm	Mon Aug 13 08:57:25 2007 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,291 +0,0 @@
-/* XPM */
-static char *stuffed_box[] = {
-/* width height num_colors chars_per_pixel */
-"    24    30      254            2",
-/* colors */
-".. c #000000",
-".# c #b1b1b1",
-".a c #242120",
-".b c #505955",
-".c c #491909",
-".d c #3e1608",
-".e c #a9a9a9 s background",
-".f c #eeeef0",
-".g c #a7a7a7",
-".h c #a3411c",
-".i c #663622",
-".j c #5c210b",
-".k c #a83e17",
-".l c #2f2824",
-".m c #9f7b71",
-".n c #d38141",
-".o c #a3a3a3",
-".p c #d27f40",
-".q c #a1a1a1",
-".r c #511c0a",
-".s c #ccc1be",
-".t c #9d9d9d",
-".u c #cd773b",
-".v c #903a13",
-".w c #592a15",
-".x c #1e1d1d",
-".y c #cdcccc",
-".z c #959595",
-".A c #939393",
-".B c #e8ac69",
-".C c #919191",
-".D c #8f8f8f",
-".E c #8d8d8d",
-".F c #240e05",
-".G c #652810",
-".H c #a55f3b",
-".I c #878787",
-".J c #f2f1f0",
-".K c #a0491f",
-".L c #8a4a27",
-".M c #0c0401",
-".N c #efbf80",
-".O c #7d7d7d",
-".P c #3d3531",
-".Q c #2a0b04",
-".R c #7b7b7b",
-".S c #81401e",
-".T c #797979",
-".U c #adacac",
-".V c #904d26",
-".W c #eab071",
-".X c #11132a",
-".Y c #737373",
-".Z c #999695",
-".0 c #ab4119",
-".1 c #d16d31",
-".2 c #b3b8b5",
-".3 c #030305",
-".4 c #212129",
-".5 c #b74c1e",
-".6 c #ca7b41",
-".7 c #696969",
-".8 c #404644",
-".9 c #2d1e17",
-"#. c #656565",
-"## c #8b3417",
-"#a c #dfae7d",
-"#b c #f5eeef",
-"#c c #5e260f",
-"#d c #d58445",
-"#e c #5f5f5f",
-"#f c #763416",
-"#g c #5a200b",
-"#h c #301006",
-"#i c #7a2f10",
-"#j c #edb87a",
-"#k c #4e1b09",
-"#l c #da8e4d",
-"#m c #8b8a8a",
-"#n c #d97435",
-"#o c #d58648",
-"#p c #32160b",
-"#q c #fefefe",
-"#r c #e8ad6b",
-"#s c #020000",
-"#t c #474747",
-"#u c #bfbfc0",
-"#v c #4f505c",
-"#w c #6b280e",
-"#x c #fcdf9c",
-"#y c #e39e5c",
-"#z c #160803",
-"#A c #3f3f3f",
-"#B c #61230e",
-"#C c #140601",
-"#D c #3c0e04",
-"#E c #7e3010",
-"#F c #eaeaea",
-"#G c #a4a3a2",
-"#H c #bb5121",
-"#I c #cd642c",
-"#J c #b94f1f",
-"#K c #cb622a",
-"#L c #333333",
-"#M c #d88747",
-"#N c #110601",
-"#O c #d58344",
-"#P c #070301",
-"#Q c #511e0b",
-"#R c #bf9f84",
-"#S c #d2d2d2",
-"#T c #6f290e",
-"#U c #eed6b2",
-"#V c #c55c27",
-"#W c #441708",
-"#X c #bab8b7",
-"#Y c #e9ae6b",
-"#Z c #823110",
-"#0 c #171717",
-"#1 c #eccba6",
-"#2 c #51200e",
-"#3 c #a33c16",
-"#4 c #983915",
-"#5 c #7f6352",
-"#6 c #eab26f",
-"#7 c #361207",
-"#8 c #bd5222",
-"#9 c #d0672e",
-"a. c #a35326",
-"a# c #da8f52",
-"aa c #aaaaaa",
-"ab c #a8a8a8",
-"ac c #a6a6a6",
-"ad c #a4a4a4",
-"ae c #d38041",
-"af c #303246",
-"ag c #a2a2a2",
-"ah c #b85020",
-"ai c #d17e3f",
-"aj c #521d0b",
-"ak c #a0a0a0",
-"al c #e6a764",
-"am c #d07c3e",
-"an c #cf7a3d",
-"ao c #9e9e9e",
-"ap c #9c9c9c",
-"aq c #c75d28",
-"ar c #1b0a03",
-"as c #d88a49",
-"at c #433f3e",
-"au c #989898",
-"av c #65250d",
-"aw c #969696",
-"ax c #0a0806",
-"ay c #949494",
-"az c #581e0a",
-"aA c #c6c5c5",
-"aB c #909090",
-"aC c #d67d3d",
-"aD c #9ea0a1",
-"aE c #121211",
-"aF c #db7838",
-"aG c #414249",
-"aH c #8a8a8a",
-"aI c #d88c4c",
-"aJ c #b0461b",
-"aK c #28322d",
-"aL c #4f5150",
-"aM c #833613",
-"aN c #848484",
-"aO c #361306",
-"aP c #808080",
-"aQ c #551e0a",
-"aR c #762d10",
-"aS c #837b79",
-"aT c #17110f",
-"aU c #cfcfd4",
-"aV c #943413",
-"aW c #767676",
-"aX c #98534f",
-"aY c #ad461b",
-"aZ c #727272",
-"a0 c #1c1917",
-"a1 c #c06a34",
-"a2 c #6c6c6c",
-"a3 c #722b0f",
-"a4 c #c96029",
-"a5 c #9a9999",
-"a6 c #60616a",
-"a7 c #67240e",
-"a8 c #764a37",
-"a9 c #3b1407",
-"b. c #504e4d",
-"b# c #100601",
-"ba c #e7aa67",
-"bb c #f4e0b9",
-"bc c #d4d6d5",
-"bd c #423028",
-"be c #545454",
-"bf c #d66f32",
-"bg c #c05623",
-"bh c #d36b2f",
-"bi c #d2692e",
-"bj c #4a4a4a",
-"bk c #762e0f",
-"bl c #461d0e",
-"bm c #56150a",
-"bn c #6c290f",
-"bo c #ecb472",
-"bp c #c58859",
-"bq c #404040",
-"br c #5f220c",
-"bs c #3a3a3a",
-"bt c #cd652c",
-"bu c #363636",
-"bv c #e7e7e7",
-"bw c #732c0f",
-"bx c #fee4a1",
-"by c #68270e",
-"bz c #dfdfdf",
-"bA c #7a3819",
-"bB c #2c2c2c",
-"bC c #dbdbdb",
-"bD c #f0ece9",
-"bE c #d48243",
-"bF c #282828",
-"bG c #4e4b4a",
-"bH c #5c5b5b",
-"bI c #988f8c",
-"bJ c #de7c39",
-"bK c #b54c1e",
-"bL c #b44a1d",
-"bM c #b3481c",
-"bN c #342f2d",
-"bO c #220701",
-"bP c #c45b26",
-"bQ c #190802",
-"bR c #c35925",
-"bS c #d56c30",
-"bT c #3f3d3b",
-"bU c #e0803e",
-"bV c #fbfafa",
-"bW c #dd9252",
-"bX c #afb0b6",
-"bY c #772b0f",
-"bZ c #f7f6f6",
-"b0 c #220b04",
-"b1 c #0e0e0e",
-"b2 c #cb763d",
-"b3 c #dd9b5f",
-"b4 c #ad4219",
-"b5 c #fadb99",
-"b6 c #67756f",
-"b7 c #e9e8e8",
-/* pixels */
-".e.e.e.e.e.e.e.e.e.e.e.e.o.e.e.e.e.e.e.e.e.e.e.e",
-".e.e.e.e.e.e.e.e.e.e.e.o.2.Z.m.o.e.e.e.e.o.o.e.e",
-".e.e.e.e.e.e.e.e.e.e.obcbZ.6bp.H.m.o.e.e.e.s.o.o",
-".e.e.e.e.e.e.e.e.e.e.fbZbZbbbc.Nbp.H.map.2.mbZbz",
-".e.e.e.e.e.e.e.e.e.e#RbIbc#b.qbp.W.Bbpa.a8.YaA.7",
-".e.e.e.e.e.e.e.ebIa8.y.sbD#S.Ibe.L.B#rbob3.Lbl.o",
-".e.e.e.e.e.e.o#5a1#abe.y.o.qb.#e.q#U.Nbobob5.w.e",
-".e.e.e.e.ebI.H.n#RbI.q#eaPbdb..o.I#X.N.W.N#lbl.e",
-".e.e.e.oaXa1.nai.Vblb.#..9.x.Rbc#S.i#a.N#daF.d.e",
-".e.e.e.ia1bU.uai.n.6bdbs.3#z.dbI#jal.N#n#n.SaLaA",
-".e.e.e#W#c.Hai.u.6a#.m.3a8aI.H.Hal.N#n.1.Sat#XbI",
-".e.e.e#W.v.j.V.uai.n#l.6bpas#lal#1#n#I.S.vbnaTaN",
-".e.e.e.Q.v.v#w.Ga1.u#d#das#lbW.N#I#I.S#Z.1#Ibl.e",
-".e.e.e.9bO#T.v#Z.j.H.u.n.na#.N.u#V.v.F#Ra#.1.9.U",
-".e.e.e.P#haE.G.v.v.jbA.ua#.N.ubg.haTb.#b#obfbl.e",
-".e.e.A.o#SbHbF#p#T.v#E.Gbpa4#HbnaTaLbIbp#Va.bT.U",
-".e.e.e.IbcaubH#7#7.j.v#i.v.5#E##bY.v.h#V#Hbdak.e",
-".e.e.eb.a8#S.9.G#ibl.d#T##.vaY#H.5.5bgbgblaN.q.e",
-".e.e.eb..Ga8.i#ZbYbY.j.Q.jaY.5.5#H#H.m.w.7.o.e.e",
-".e.e.ebGbYbn#w#i#T#T#T.j#ZaJ.5.5.5.S.y#u.A.o.e.e",
-".e.e.oaL.d#Tbn#T#T#T#w.G#ZaY.5.h.i.Dbz.fbV.y#u.o",
-".e.eapbHaxbObTa2#T#w.G.j#iaYaYb..2aua6.Obzbz#q.2",
-".e.e.o.RaL.a.q.Ube#w.j.jaR.k#4#h#A.o.Dbzau#qbcap",
-".e.eapaN#Aa2.ybv#Xa8#g#g#T.k#Z.PbG#L.o.2.2bZ.A.o",
-".o.I.Aak.fbZbXaZbz#.#gbl#T##bd.IaNbH#L.Obz.2.z.e",
-".Aa2.Rbz.eaAaDaNaU.lax.d.j.9aP.q.e.AbHbsa2aN.o.e",
-"ap.Y#AaA#S.o.DbZ.obebBb1aTaS.o.e.e.o.Ia2.Yap.e.e",
-".o.AbHbeaAaU.faA.I.I.7be.Rak.e.e.e.e.eap.o.e.e.e",
-".e.o.Ibe#A#u.e.R.o.oap.A.o.e.e.e.e.e.e.e.e.e.e.e",
-".e.e.oaNbHbe.R.o.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e.e"
-};
--- a/info/dir	Mon Aug 13 08:57:25 2007 +0200
+++ b/info/dir	Mon Aug 13 08:57:55 2007 +0200
@@ -38,7 +38,7 @@
 * XEmacs::	The extensible user-friendly self-documenting text editor.
 		This manual is for XEmacs 20.0.
 * Lispref::	XEmacs Lisp technical reference.
-		This manual is for XEmacs 20.0.
+		This manual is for XEmacs 20.3.
 * New-Users-Guide::
 	        XEmacs User's Guide for XEmacs 20.0.
 * XEmacs-FAQ::	XEmacs Frequently Asked Questions for 20.0.
--- a/lib-autoconf-1/acgeneral.m4	Mon Aug 13 08:57:25 2007 +0200
+++ b/lib-autoconf-1/acgeneral.m4	Mon Aug 13 08:57:55 2007 +0200
@@ -979,8 +979,11 @@
 dnl so uname gets run too.
 # on host `(hostname || uname -n) 2>/dev/null | sed 1q`:
 #
-[#] [$]0 [$]quoted_arguments
-
+EOF
+sed 's/^/[#] /' >> config.status <<EOF
+[$]0 [$]quoted_arguments
+EOF
+cat >> config.status <<EOF
 changequote(,)dnl
 ac_cs_usage="Usage: config.status [--recheck] [--version] [--help]"
 changequote([,])dnl
--- a/lib-src/Makefile.in.in	Mon Aug 13 08:57:25 2007 +0200
+++ b/lib-src/Makefile.in.in	Mon Aug 13 08:57:55 2007 +0200
@@ -118,6 +118,32 @@
 SOURCES = COPYING ChangeLog Makefile.in.in README aixcc.lex emacs.csh \
 	makedoc.com *.[chy] $(SCRIPTS)
 
+# Additional -D flags for movemail (add to MOVE_FLAGS if desired):
+# MAIL_USE_POP		Support mail retrieval from a POP mailbox.
+# MAIL_USE_MMDF		Support MMDF mailboxes.
+# MAIL_USE_FLOCK	Use flock for file locking (see the comments
+#			about locking in movemail.c)
+# MAIL_UNLINK_SPOOL	Unlink the user spool mailbox after reading
+#			it (instead of just emptying it).
+# KERBEROS		Support Kerberized POP.
+# KRB5			Support Kerberos Version 5 pop instead of
+#			Version 4 (define this in addition to
+#			KERBEROS).
+# HESIOD		Support Hesiod lookups of user mailboxes.
+# MAILHOST		A string, the host name of the default POP
+#			mail host for the sit
+
+MOVE_FLAGS=
+#
+# Additional libraries for movemail:
+# For KERBEROS
+# MOVE_LIBS= -lkrb -ldes -lcom_err
+# For KERBEROS + KRB5
+# MOVE_LIBS= -lkrb5 -lcrypto -lisode -lcom_err
+# Add "-lhesiod" if HESIOD is defined.
+
+MOVE_LIBS=
+
 /* ========================== start of cpp stuff ======================= */
 
 /* From here on, comments must be done in C syntax. (see comment above
@@ -418,8 +444,8 @@
 b2m: ${srcdir}/b2m.c ../src/config.h
 	$(CC) ${ALL_CFLAGS} ${srcdir}/b2m.c $(LOADLIBES) -o b2m 
 
-movemail: ${srcdir}/movemail.c ../src/config.h
-	$(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c $(LOADLIBES) -o movemail
+movemail: ${srcdir}/movemail.c ${srcdir}/pop.c ${srcdir}/pop.h ../src/config.h
+	$(CC) ${ALL_CFLAGS} ${srcdir}/movemail.c ${srcdir}/pop.c $(LOADLIBES) -o movemail
 
 cvtmail: ${srcdir}/cvtmail.c
 	$(CC) ${ALL_CFLAGS} ${srcdir}/cvtmail.c $(LOADLIBES) -o cvtmail
--- a/lib-src/movemail.c	Mon Aug 13 08:57:25 2007 +0200
+++ b/lib-src/movemail.c	Mon Aug 13 08:57:55 2007 +0200
@@ -61,13 +61,18 @@
 #include <sys/file.h>
 #include <stdio.h>
 #include <errno.h>
-#include <../src/syswait.h>
+#include "../src/syswait.h"
+#include "../src/systime.h"
 #include <stdlib.h>
 #include <string.h>
 #ifdef MAIL_USE_POP
 #include "pop.h"
 #endif
 
+#ifndef HAVE_STRERROR
+static char * strerror (int errnum);
+#endif /* HAVE_STRERROR */
+
 #ifdef MSDOS
 #undef access
 #endif /* MSDOS */
@@ -92,20 +97,19 @@
 #define DISABLE_DIRECT_ACCESS
 #endif /* WINDOWSNT */
 
-#ifdef USG
-#include <fcntl.h>
+#if defined (HAVE_UNISTD_H) || defined (USG)
 #include <unistd.h>
+#endif /* unistd.h */
 #ifndef F_OK
 #define F_OK 0
 #define X_OK 1
 #define W_OK 2
 #define R_OK 4
-#endif
-#endif /* USG */
+#endif /* No F_OK */
 
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
+#if defined (HAVE_FCNTL_H) || defined (USG)
+#include <fcntl.h>
+#endif /* fcntl.h */
 
 #if defined (XENIX) || defined (WINDOWSNT)
 #include <sys/locking.h>
@@ -129,35 +133,30 @@
 #undef write
 #undef close
 
-#ifndef errno
-extern int errno;
+static void fatal (char *, char*);
+static void error (char *, char *, char *);
+static void pfatal_with_name (char *);
+static void pfatal_and_delete (char *);
+static char *concat (char *, char *, char *);
+static long *xmalloc (unsigned int);
+static int popmail (char *, char *, char *);
+#ifdef MAIL_USE_POP
+static int pop_retr (popserver server, int msgno, int (*action)(), int arg);
 #endif
-char *strerror ();
-
-void fatal (char *, char*);
-void error ();
-void pfatal_with_name ();
-void pfatal_and_delete ();
-char *concat ();
-long *xmalloc ();
-int popmail ();
-int pop_retr ();
-int mbx_write ();
-int mbx_delimit_begin ();
-int mbx_delimit_end ();
+static int mbx_write (char *, FILE *);
+static int mbx_delimit_begin (FILE *);
+static int mbx_delimit_end (FILE *);
 
 /* Nonzero means this is name of a lock file to delete on fatal error.  */
 char *delete_lockname;
 
 int
-main (argc, argv)
-     int argc;
-     char **argv;
+main (int argc, char *argv[])
 {
   char *inname, *outname;
   int indesc, outdesc;
   int nread;
-  WAITTYPE status;
+  int status;
 
 #ifndef MAIL_USE_SYSTEM_LOCK
   struct stat st;
@@ -193,13 +192,13 @@
   /* Also check that outname's directory is writable to the real uid.  */
   {
     char *buf = (char *) xmalloc (strlen (outname) + 1);
-    char *p;
+    char *cp;
     strcpy (buf, outname);
-    p = buf + strlen (buf);
-    while (p > buf && !IS_DIRECTORY_SEP (p[-1]))
-      *--p = 0;
-    if (p == buf)
-      *p++ = '.';
+    cp = buf + strlen (buf);
+    while (cp > buf && !IS_DIRECTORY_SEP (cp[-1]))
+      *--cp = 0;
+    if (cp == buf)
+      *cp++ = '.';
     if (access (buf, W_OK) != 0)
       pfatal_with_name (buf);
     free (buf);
@@ -397,8 +396,8 @@
   wait (&status);
   if (!WIFEXITED (status))
     exit (1);
-  else if (WRETCODE (status) != 0)
-    exit (WRETCODE (status));
+  else if (WEXITSTATUS (status) != 0)
+    exit (WEXITSTATUS (status));
 
 #if !defined (MAIL_USE_MMDF) && !defined (MAIL_USE_SYSTEM_LOCK)
   unlink (lockname);
@@ -411,38 +410,34 @@
 
 /* Print error message and exit.  */
 
-void
-fatal (s1, s2)
-     char *s1, *s2;
+static void
+fatal (char *s1, char *s2)
 {
   if (delete_lockname)
     unlink (delete_lockname);
-  error (s1, s2);
+  error (s1, s2, NULL);
   exit (1);
 }
 
 /* Print error message.  `s1' is printf control string, `s2' is arg for it. */
 
-void
-error (s1, s2, s3)
-     char *s1, *s2, *s3;
+static void
+error (char *s1, char *s2, char *s3)
 {
   fprintf (stderr, "movemail: ");
   fprintf (stderr, s1, s2, s3);
   fprintf (stderr, "\n");
 }
 
-void
-pfatal_with_name (name)
-     char *name;
+static void
+pfatal_with_name (char *name)
 {
   char *s = concat ("", strerror (errno), " for %s");
   fatal (s, name);
 }
 
-void
-pfatal_and_delete (name)
-     char *name;
+static void
+pfatal_and_delete (char *name)
 {
   char *s = concat ("", strerror (errno), " for %s");
   unlink (name);
@@ -451,9 +446,8 @@
 
 /* Return a newly-allocated string whose contents concatenate those of s1, s2, s3.  */
 
-char *
-concat (s1, s2, s3)
-     char *s1, *s2, *s3;
+static char *
+concat (char *s1, char *s2, char *s3)
 {
   int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
   char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
@@ -468,9 +462,8 @@
 
 /* Like malloc but get fatal error if memory is exhausted.  */
 
-long *
-xmalloc (size)
-     unsigned size;
+static long *
+xmalloc (unsigned int size)
 {
   long *result = (long *) malloc (size);
   if (!result)
@@ -493,15 +486,6 @@
 #include <stdio.h>
 #include <pwd.h>
 
-#ifdef USG
-#include <fcntl.h>
-/* Cancel substitutions made by config.h for Emacs.  */
-#undef open
-#undef read
-#undef write
-#undef close
-#endif /* USG */
-
 #define NOTOK (-1)
 #define OK 0
 #define DONE 1
@@ -513,10 +497,8 @@
 char obuffer[BUFSIZ];
 char Errmsg[80];
 
-popmail (user, outfile, password)
-     char *user;
-     char *outfile;
-     char *password;
+static int
+popmail (char *user, char *outfile, char *password)
 {
   int nmsgs, nbytes;
   register int i;
@@ -530,13 +512,13 @@
   server = pop_open (0, user, password, POP_NO_GETPASS);
   if (! server)
     {
-      error (pop_error);
+      error (pop_error, NULL, NULL);
       return (1);
     }
 
   if (pop_stat (server, &nmsgs, &nbytes))
     {
-      error (pop_error);
+      error (pop_error, NULL, NULL);
       return (1);
     }
 
@@ -558,7 +540,7 @@
   if ((mbf = fdopen (mbfi, "wb")) == NULL)
     {
       pop_close (server);
-      error ("Error in fdopen: %s", strerror (errno));
+      error ("Error in fdopen: %s", strerror (errno), NULL);
       close (mbfi);
       unlink (outfile);
       return (1);
@@ -569,7 +551,7 @@
       mbx_delimit_begin (mbf);
       if (pop_retr (server, i, mbx_write, mbf) != OK)
 	{
-	  error (Errmsg);
+	  error (Errmsg, NULL, NULL);
 	  close (mbfi);
 	  return (1);
 	}
@@ -577,7 +559,7 @@
       fflush (mbf);
       if (ferror (mbf))
 	{
-	  error ("Error in fflush: %s", strerror (errno));
+	  error ("Error in fflush: %s", strerror (errno), NULL);
 	  pop_close (server);
 	  close (mbfi);
 	  return (1);
@@ -593,14 +575,14 @@
 #ifdef BSD
   if (fsync (mbfi) < 0)
     {
-      error ("Error in fsync: %s", strerror (errno));
+      error ("Error in fsync: %s", strerror (errno), NULL);
       return (1);
     }
 #endif
 
   if (close (mbfi) == -1)
     {
-      error ("Error in close: %s", strerror (errno));
+      error ("Error in close: %s", strerror (errno), NULL);
       return (1);
     }
 
@@ -608,7 +590,7 @@
     {
       if (pop_delete (server, i))
 	{
-	  error (pop_error);
+	  error (pop_error, NULL, NULL);
 	  pop_close (server);
 	  return (1);
 	}
@@ -616,18 +598,16 @@
 
   if (pop_quit (server))
     {
-      error (pop_error);
+      error (pop_error, NULL, NULL);
       return (1);
     }
     
   return (0);
 }
 
-pop_retr (server, msgno, action, arg)
-     popserver server;
-     int (*action)();
+static int
+pop_retr (popserver server, int msgno, int (*action)(), int arg)
 {
-  extern char *strerror ();
   char *line;
   int ret;
 
@@ -668,10 +648,8 @@
 			 && (a[3] == 'm') \
 			 && (a[4] == ' '))
 
-int
-mbx_write (line, mbf)
-     char *line;
-     FILE *mbf;
+static int
+mbx_write (char *line, FILE *mbf)
 {
   if (IS_FROM_LINE (line))
     {
@@ -685,17 +663,16 @@
   return (OK);
 }
 
-int
-mbx_delimit_begin (mbf)
-     FILE *mbf;
+static int
+mbx_delimit_begin (FILE *mbf)
 {
   if (fputs ("\f\n0, unseen,,\n", mbf) == EOF)
     return (NOTOK);
   return (OK);
 }
 
-mbx_delimit_end (mbf)
-     FILE *mbf;
+static int
+mbx_delimit_end (FILE *mbf)
 {
   if (putc ('\037', mbf) == EOF)
     return (NOTOK);
@@ -705,9 +682,8 @@
 #endif /* MAIL_USE_POP */
 
 #ifndef HAVE_STRERROR
-char *
-strerror (errnum)
-     int errnum;
+static char *
+strerror (int errnum)
 {
   extern char *sys_errlist[];
   extern int sys_nerr;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-src/pop.c	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,1547 @@
+/* pop.c: client routines for talking to a POP3-protocol post-office server
+   Copyright (c) 1991, 1993, 1996 Free Software Foundation, Inc.
+   Written by Jonathan Kamens, jik@security.ov.com.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#ifdef HAVE_CONFIG_H
+#define NO_SHORTNAMES	/* Tell config not to load remap.h */
+#include <../src/config.h>
+#else
+#define MAIL_USE_POP
+#endif
+
+#ifdef MAIL_USE_POP
+
+#ifdef HAVE_CONFIG_H
+/* Cancel these substitutions made in config.h */
+#undef open
+#undef read
+#undef write
+#undef close
+#endif
+
+#include <sys/types.h>
+#ifdef WINDOWSNT
+#include "ntlib.h"
+#include <winsock.h>
+#undef SOCKET_ERROR
+#define RECV(s,buf,len,flags) recv(s,buf,len,flags)
+#define SEND(s,buf,len,flags) send(s,buf,len,flags)
+#define CLOSESOCKET(s) closesocket(s)
+#else
+#include <netinet/in.h>
+#include <sys/socket.h>
+#define RECV(s,buf,len,flags) read(s,buf,len)
+#define SEND(s,buf,len,flags) write(s,buf,len)
+#define CLOSESOCKET(s) close(s)
+#endif
+#include "pop.h"
+
+#ifdef sun
+#include <malloc.h>
+#endif /* sun */
+
+#ifdef HESIOD
+#include <hesiod.h>
+/*
+ * It really shouldn't be necessary to put this declaration here, but
+ * the version of hesiod.h that Athena has installed in release 7.2
+ * doesn't declare this function; I don't know if the 7.3 version of
+ * hesiod.h does.
+ */
+extern struct servent *hes_getservbyname (/* char *, char * */);
+#endif
+
+#include <pwd.h>
+#include <netdb.h>
+#include <errno.h>
+#include <stdio.h>
+
+#ifdef KERBEROS
+#ifndef KRB5
+#include <des.h>
+#include <krb.h>
+#else /* KRB5 */
+#include <krb5/krb5.h>
+#include <krb5/ext-proto.h>
+#include <ctype.h>
+#endif /* KRB5 */
+#endif /* KERBEROS */
+
+extern char *getenv (/* char * */);
+extern char *getlogin (/* void */);
+extern char *getpass (/* char * */);
+extern char *strerror (/* int */);
+extern char *index ();
+
+#ifdef KERBEROS
+#ifndef KRB5
+extern int krb_sendauth (/* long, int, KTEXT, char *, char *, char *,
+			    u_long, MSG_DAT *, CREDENTIALS *, Key_schedule,
+			    struct sockaddr_in *, struct sockaddr_in *,
+			    char * */);
+extern char *krb_realmofhost (/* char * */);
+#endif /* ! KRB5 */
+#endif /* KERBEROS */
+
+#ifndef WINDOWSNT
+#if !defined(HAVE_H_ERRNO) || !defined(HAVE_CONFIG_H)
+extern int h_errno;
+#endif
+#endif
+
+static int socket_connection (/* char *, int */);
+static char *getline (/* popserver */);
+static int sendline (/* popserver, char * */);
+static int fullwrite (/* int, char *, int */);
+static int getok (/* popserver */);
+#if 0
+static int gettermination (/* popserver */);
+#endif
+static void pop_trash (/* popserver */);
+static char *find_crlf (/* char * */);
+
+#define ERROR_MAX 80		/* a pretty arbitrary size */
+#define POP_PORT 110
+#define KPOP_PORT 1109
+#ifdef WINDOWSNT
+#define POP_SERVICE "pop3"	/* we don't want the POP2 port! */
+#else
+#define POP_SERVICE "pop"
+#endif
+#ifdef KERBEROS
+#ifdef KRB5
+#define KPOP_SERVICE "k5pop";
+#else
+#define KPOP_SERVICE "kpop"
+#endif
+#endif
+
+char pop_error[ERROR_MAX];
+int pop_debug = 0;
+
+#ifndef min
+#define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+/*
+ * Function: pop_open (char *host, char *username, char *password,
+ * 		       int flags)
+ *
+ * Purpose: Establishes a connection with a post-office server, and
+ * 	completes the authorization portion of the session.
+ *
+ * Arguments:
+ * 	host	The server host with which the connection should be
+ * 		established.  Optional.  If omitted, internal
+ * 		heuristics will be used to determine the server host,
+ * 		if possible.
+ * 	username
+ * 		The username of the mail-drop to access.  Optional.
+ * 		If omitted, internal heuristics will be used to
+ * 		determine the username, if possible.
+ * 	password
+ * 		The password to use for authorization.  If omitted,
+ * 		internal heuristics will be used to determine the
+ * 		password, if possible.
+ * 	flags	A bit mask containing flags controlling certain
+ * 		functions of the routine.  Valid flags are defined in
+ * 		the file pop.h
+ *
+ * Return value: Upon successful establishment of a connection, a
+ * 	non-null popserver will be returned.  Otherwise, null will be
+ * 	returned, and the string variable pop_error will contain an
+ * 	explanation of the error.
+ */
+popserver
+pop_open (host, username, password, flags)
+     char *host;
+     char *username;
+     char *password;
+     int flags;
+{
+  int sock;
+  popserver server;
+
+  /* Determine the user name */
+  if (! username)
+    {
+      username = getenv ("USER");
+      if (! (username && *username))
+	{
+	  username = getlogin ();
+	  if (! (username && *username))
+	    {
+	      struct passwd *passwd;
+	      passwd = getpwuid (getuid ());
+	      if (passwd && passwd->pw_name && *passwd->pw_name)
+		{
+		  username = passwd->pw_name;
+		}
+	      else
+		{
+		  strcpy (pop_error, "Could not determine username");
+		  return (0);
+		}
+	    }
+	}
+    }
+
+  /*
+   *  Determine the mail host.
+   */
+
+  if (! host)
+    {
+      host = getenv ("MAILHOST");
+    }
+
+#ifdef HESIOD
+  if ((! host) && (! (flags & POP_NO_HESIOD)))
+    {
+      struct hes_postoffice *office;
+      office = hes_getmailhost (username);
+      if (office && office->po_type && (! strcmp (office->po_type, "POP"))
+	  && office->po_name && *office->po_name && office->po_host
+	  && *office->po_host)
+	{
+	  host = office->po_host;
+	  username = office->po_name;
+	}
+    }
+#endif
+
+#ifdef MAILHOST
+  if (! host)
+    {
+      host = MAILHOST;
+    }
+#endif
+
+  if (! host)
+    {
+      strcpy (pop_error, "Could not determine POP server");
+      return (0);
+    }
+
+  /* Determine the password */
+#ifdef KERBEROS
+#define DONT_NEED_PASSWORD (! (flags & POP_NO_KERBEROS))
+#else
+#define DONT_NEED_PASSWORD 0
+#endif
+ 
+  if ((! password) && (! DONT_NEED_PASSWORD))
+    {
+      if (! (flags & POP_NO_GETPASS))
+	{
+	  password = getpass ("Enter POP password:");
+	}
+      if (! password)
+	{
+	  strcpy (pop_error, "Could not determine POP password");
+	  return (0);
+	}
+    }
+  if (password)
+    flags |= POP_NO_KERBEROS;
+  else
+    password = username;
+
+  sock = socket_connection (host, flags);
+  if (sock == -1)
+    return (0);
+
+  server = (popserver) malloc (sizeof (struct _popserver));
+  if (! server)
+    {
+      strcpy (pop_error, "Out of memory in pop_open");
+      return (0);
+    }
+  server->buffer = (char *) malloc (GETLINE_MIN);
+  if (! server->buffer)
+    {
+      strcpy (pop_error, "Out of memory in pop_open");
+      free ((char *) server);
+      return (0);
+    }
+	  
+  server->file = sock;
+  server->data = 0;
+  server->buffer_index = 0;
+  server->buffer_size = GETLINE_MIN;
+  server->in_multi = 0;
+  server->trash_started = 0;
+
+  if (getok (server))
+    return (0);
+
+  /*
+   * I really shouldn't use the pop_error variable like this, but....
+   */
+  if (strlen (username) > ERROR_MAX - 6)
+    {
+      pop_close (server);
+      strcpy (pop_error,
+	      "Username too long; recompile pop.c with larger ERROR_MAX");
+      return (0);
+    }
+  sprintf (pop_error, "USER %s", username);
+
+  if (sendline (server, pop_error) || getok (server))
+    {
+      return (0);
+    }
+
+  if (strlen (password) > ERROR_MAX - 6)
+    {
+      pop_close (server);
+      strcpy (pop_error,
+	      "Password too long; recompile pop.c with larger ERROR_MAX");
+      return (0);
+    }
+  sprintf (pop_error, "PASS %s", password);
+
+  if (sendline (server, pop_error) || getok (server))
+    {
+      return (0);
+    }
+
+  return (server);
+}
+
+/*
+ * Function: pop_stat
+ *
+ * Purpose: Issue the STAT command to the server and return (in the
+ * 	value parameters) the number of messages in the maildrop and
+ * 	the total size of the maildrop.
+ *
+ * Return value: 0 on success, or non-zero with an error in pop_error
+ * 	in failure.
+ *
+ * Side effects: On failure, may make further operations on the
+ * 	connection impossible.
+ */
+int
+pop_stat (server, count, size)
+     popserver server;
+     int *count;
+     int *size;
+{
+  char *fromserver;
+
+  if (server->in_multi)
+    {
+      strcpy (pop_error, "In multi-line query in pop_stat");
+      return (-1);
+    }
+     
+  if (sendline (server, "STAT") || (! (fromserver = getline (server))))
+    return (-1);
+
+  if (strncmp (fromserver, "+OK ", 4))
+    {
+      if (0 == strncmp (fromserver, "-ERR", 4))
+	{
+	  strncpy (pop_error, fromserver, ERROR_MAX);
+	}
+      else
+	{
+	  strcpy (pop_error,
+		  "Unexpected response from POP server in pop_stat");
+	  pop_trash (server);
+	}
+      return (-1);
+    }
+
+  *count = atoi (&fromserver[4]);
+     
+  fromserver = index (&fromserver[4], ' ');
+  if (! fromserver)
+    {
+      strcpy (pop_error,
+	      "Badly formatted response from server in pop_stat");
+      pop_trash (server);
+      return (-1);
+    }
+
+  *size = atoi (fromserver + 1);
+
+  return (0);
+}
+
+/*
+ * Function: pop_list
+ *
+ * Purpose: Performs the POP "list" command and returns (in value
+ * 	parameters) two malloc'd zero-terminated arrays -- one of
+ * 	message IDs, and a parallel one of sizes.
+ *
+ * Arguments:
+ * 	server	The pop connection to talk to.
+ * 	message	The number of the one message about which to get
+ * 		information, or 0 to get information about all
+ * 		messages.
+ *
+ * Return value: 0 on success, non-zero with error in pop_error on
+ * 	failure.
+ *
+ * Side effects: On failure, may make further operations on the
+ * 	connection impossible.
+ */
+int
+pop_list (server, message, IDs, sizes)
+     popserver server;
+     int message;
+     int **IDs;
+     int **sizes;
+{
+  int how_many, i;
+  char *fromserver;
+
+  if (server->in_multi)
+    {
+      strcpy (pop_error, "In multi-line query in pop_list");
+      return (-1);
+    }
+
+  if (message)
+    how_many = 1;
+  else
+    {
+      int count, size;
+      if (pop_stat (server, &count, &size))
+	return (-1);
+      how_many = count;
+    }
+
+  *IDs = (int *) malloc ((how_many + 1) * sizeof (int));
+  *sizes = (int *) malloc ((how_many + 1) * sizeof (int));
+  if (! (*IDs && *sizes))
+    {
+      strcpy (pop_error, "Out of memory in pop_list");
+      return (-1);
+    }
+
+  if (message)
+    {
+      sprintf (pop_error, "LIST %d", message);
+      if (sendline (server, pop_error))
+	{
+	  free ((char *) *IDs);
+	  free ((char *) *sizes);
+	  return (-1);
+	}
+      if (! (fromserver = getline (server)))
+	{
+	  free ((char *) *IDs);
+	  free ((char *) *sizes);
+	  return (-1);
+	}
+      if (strncmp (fromserver, "+OK ", 4))
+	{
+	  if (! strncmp (fromserver, "-ERR", 4))
+	    strncpy (pop_error, fromserver, ERROR_MAX);
+	  else
+	    {
+	      strcpy (pop_error,
+		      "Unexpected response from server in pop_list");
+	      pop_trash (server);
+	    }
+	  free ((char *) *IDs);
+	  free ((char *) *sizes);
+	  return (-1);
+	}
+      (*IDs)[0] = atoi (&fromserver[4]);
+      fromserver = index (&fromserver[4], ' ');
+      if (! fromserver)
+	{
+	  strcpy (pop_error,
+		  "Badly formatted response from server in pop_list");
+	  pop_trash (server);
+	  free ((char *) *IDs);
+	  free ((char *) *sizes);
+	  return (-1);
+	}
+      (*sizes)[0] = atoi (fromserver);
+      (*IDs)[1] = (*sizes)[1] = 0;
+      return (0);
+    }
+  else
+    {
+      if (pop_multi_first (server, "LIST", &fromserver))
+	{
+	  free ((char *) *IDs);
+	  free ((char *) *sizes);
+	  return (-1);
+	}
+      for (i = 0; i < how_many; i++)
+	{
+	  if (pop_multi_next (server, &fromserver))
+	    {
+	      free ((char *) *IDs);
+	      free ((char *) *sizes);
+	      return (-1);
+	    }
+	  (*IDs)[i] = atoi (fromserver);
+	  fromserver = index (fromserver, ' ');
+	  if (! fromserver)
+	    {
+	      strcpy (pop_error,
+		      "Badly formatted response from server in pop_list");
+	      free ((char *) *IDs);
+	      free ((char *) *sizes);
+	      pop_trash (server);
+	      return (-1);
+	    }
+	  (*sizes)[i] = atoi (fromserver);
+	}
+      if (pop_multi_next (server, &fromserver))
+	{
+	  free ((char *) *IDs);
+	  free ((char *) *sizes);
+	  return (-1);
+	}
+      else if (fromserver)
+	{
+	  strcpy (pop_error,
+		  "Too many response lines from server in pop_list");
+	  free ((char *) *IDs);
+	  free ((char *) *sizes);
+	  return (-1);
+	}
+      (*IDs)[i] = (*sizes)[i] = 0;
+      return (0);
+    }
+}
+
+/*
+ * Function: pop_retrieve
+ *
+ * Purpose: Retrieve a specified message from the maildrop.
+ *
+ * Arguments:
+ * 	server	The server to retrieve from.
+ * 	message	The message number to retrieve.
+ *	markfrom
+ * 		If true, then mark the string "From " at the beginning
+ * 		of lines with '>'.
+ * 
+ * Return value: A string pointing to the message, if successful, or
+ * 	null with pop_error set if not.
+ *
+ * Side effects: May kill connection on error.
+ */
+char *
+pop_retrieve (server, message, markfrom)
+     popserver server;
+     int message;
+     int markfrom;
+{
+  int *IDs, *sizes, bufsize, fromcount = 0, cp = 0;
+  char *ptr, *fromserver;
+  int ret;
+
+  if (server->in_multi)
+    {
+      strcpy (pop_error, "In multi-line query in pop_retrieve");
+      return (0);
+    }
+
+  if (pop_list (server, message, &IDs, &sizes))
+    return (0);
+
+  if (pop_retrieve_first (server, message, &fromserver))
+    {
+      return (0);
+    }
+
+  /*
+   * The "5" below is an arbitrary constant -- I assume that if
+   * there are "From" lines in the text to be marked, there
+   * probably won't be more than 5 of them.  If there are, I
+   * allocate more space for them below.
+   */
+  bufsize = sizes[0] + (markfrom ? 5 : 0);
+  ptr = (char *)malloc (bufsize);
+  free ((char *) IDs);
+  free ((char *) sizes);
+
+  if (! ptr)
+    {
+      strcpy (pop_error, "Out of memory in pop_retrieve");
+      pop_retrieve_flush (server);
+      return (0);
+    }
+
+  while (! (ret = pop_retrieve_next (server, &fromserver)))
+    {
+      int linesize;
+
+      if (! fromserver)
+	{
+	  ptr[cp] = '\0';
+	  return (ptr);
+	}
+      if (markfrom && fromserver[0] == 'F' && fromserver[1] == 'r' &&
+	  fromserver[2] == 'o' && fromserver[3] == 'm' &&
+	  fromserver[4] == ' ')
+	{
+	  if (++fromcount == 5)
+	    {
+	      bufsize += 5;
+	      ptr = (char *)realloc (ptr, bufsize);
+	      if (! ptr)
+		{
+		  strcpy (pop_error, "Out of memory in pop_retrieve");
+		  pop_retrieve_flush (server);
+		  return (0);
+		}
+	      fromcount = 0;
+	    }
+	  ptr[cp++] = '>';
+	}
+      linesize = strlen (fromserver);
+      bcopy (fromserver, &ptr[cp], linesize);
+      cp += linesize;
+      ptr[cp++] = '\n';
+    }
+
+  if (ret)
+    {
+      free (ptr);
+      return (0);
+    }
+}     
+
+int
+pop_retrieve_first (server, message, response)
+     popserver server;
+     int message;
+     char **response;
+{
+  sprintf (pop_error, "RETR %d", message);
+  return (pop_multi_first (server, pop_error, response));
+}
+
+int
+pop_retrieve_next (server, line)
+     popserver server;
+     char **line;
+{
+  return (pop_multi_next (server, line));
+}
+
+int
+pop_retrieve_flush (server)
+     popserver server;
+{
+  return (pop_multi_flush (server));
+}
+
+int
+pop_top_first (server, message, lines, response)
+     popserver server;
+     int message, lines;
+     char **response;
+{
+  sprintf (pop_error, "TOP %d %d", message, lines);
+  return (pop_multi_first (server, pop_error, response));
+}
+
+int
+pop_top_next (server, line)
+     popserver server;
+     char **line;
+{
+  return (pop_multi_next (server, line));
+}
+
+int
+pop_top_flush (server)
+     popserver server;
+{
+  return (pop_multi_flush (server));
+}
+
+int
+pop_multi_first (server, command, response)
+     popserver server;
+     char *command;
+     char **response;
+{
+  if (server->in_multi)
+    {
+      strcpy (pop_error,
+	      "Already in multi-line query in pop_multi_first");
+      return (-1);
+    }
+
+  if (sendline (server, command) || (! (*response = getline (server))))
+    {
+      return (-1);
+    }
+
+  if (0 == strncmp (*response, "-ERR", 4))
+    {
+      strncpy (pop_error, *response, ERROR_MAX);
+      return (-1);
+    }
+  else if (0 == strncmp (*response, "+OK", 3))
+    {
+      for (*response += 3; **response == ' '; (*response)++) /* empty */;
+      server->in_multi = 1;
+      return (0);
+    }
+  else
+    {
+      strcpy (pop_error,
+	      "Unexpected response from server in pop_multi_first");
+      return (-1);
+    }
+}
+
+int
+pop_multi_next (server, line)
+     popserver server;
+     char **line;
+{
+  char *fromserver;
+
+  if (! server->in_multi)
+    {
+      strcpy (pop_error, "Not in multi-line query in pop_multi_next");
+      return (-1);
+    }
+
+  fromserver = getline (server);
+  if (! fromserver)
+    {
+      return (-1);
+    }
+
+  if (fromserver[0] == '.')
+    {
+      if (! fromserver[1])
+	{
+	  *line = 0;
+	  server->in_multi = 0;
+	  return (0);
+	}
+      else
+	{
+	  *line = fromserver + 1;
+	  return (0);
+	}
+    }
+  else
+    {
+      *line = fromserver;
+      return (0);
+    }
+}
+
+int
+pop_multi_flush (server)
+     popserver server;
+{
+  char *line;
+
+  if (! server->in_multi)
+    {
+      return (0);
+    }
+
+  while (! pop_multi_next (server, &line))
+    {
+      if (! line)
+	{
+	  return (0);
+	}
+    }
+
+  return (-1);
+}
+
+/* Function: pop_delete
+ *
+ * Purpose: Delete a specified message.
+ *
+ * Arguments:
+ * 	server	Server from which to delete the message.
+ * 	message	Message to delete.
+ *
+ * Return value: 0 on success, non-zero with error in pop_error
+ * 	otherwise.
+ */
+int
+pop_delete (server, message)
+     popserver server;
+     int message;
+{
+  if (server->in_multi)
+    {
+      strcpy (pop_error, "In multi-line query in pop_delete");
+      return (-1);
+    }
+
+  sprintf (pop_error, "DELE %d", message);
+
+  if (sendline (server, pop_error) || getok (server))
+    return (-1);
+
+  return (0);
+}
+
+/*
+ * Function: pop_noop
+ *
+ * Purpose: Send a noop command to the server.
+ *
+ * Argument:
+ * 	server	The server to send to.
+ *
+ * Return value: 0 on success, non-zero with error in pop_error
+ * 	otherwise.
+ *
+ * Side effects: Closes connection on error.
+ */
+int
+pop_noop (server)
+     popserver server;
+{
+  if (server->in_multi)
+    {
+      strcpy (pop_error, "In multi-line query in pop_noop");
+      return (-1);
+    }
+
+  if (sendline (server, "NOOP") || getok (server))
+    return (-1);
+
+  return (0);
+}
+
+/*
+ * Function: pop_last
+ *
+ * Purpose: Find out the highest seen message from the server.
+ *
+ * Arguments:
+ * 	server	The server.
+ *
+ * Return value: If successful, the highest seen message, which is
+ * 	greater than or equal to 0.  Otherwise, a negative number with
+ * 	the error explained in pop_error.
+ *
+ * Side effects: Closes the connection on error.
+ */
+int
+pop_last (server)
+     popserver server;
+{
+  char *fromserver;
+     
+  if (server->in_multi)
+    {
+      strcpy (pop_error, "In multi-line query in pop_last");
+      return (-1);
+    }
+
+  if (sendline (server, "LAST"))
+    return (-1);
+
+  if (! (fromserver = getline (server)))
+    return (-1);
+
+  if (! strncmp (fromserver, "-ERR", 4))
+    {
+      strncpy (pop_error, fromserver, ERROR_MAX);
+      return (-1);
+    }
+  else if (strncmp (fromserver, "+OK ", 4))
+    {
+      strcpy (pop_error, "Unexpected response from server in pop_last");
+      pop_trash (server);
+      return (-1);
+    }
+  else
+    {
+      return (atoi (&fromserver[4]));
+    }
+}
+
+/*
+ * Function: pop_reset
+ *
+ * Purpose: Reset the server to its initial connect state
+ *
+ * Arguments:
+ * 	server	The server.
+ *
+ * Return value: 0 for success, non-0 with error in pop_error
+ * 	otherwise.
+ *
+ * Side effects: Closes the connection on error.
+ */
+int
+pop_reset (server)
+     popserver server;
+{
+  if (pop_retrieve_flush (server))
+    {
+      return (-1);
+    }
+
+  if (sendline (server, "RSET") || getok (server))
+    return (-1);
+
+  return (0);
+}
+
+/*
+ * Function: pop_quit
+ *
+ * Purpose: Quit the connection to the server,
+ *
+ * Arguments:
+ * 	server	The server to quit.
+ *
+ * Return value: 0 for success, non-zero otherwise with error in
+ * 	pop_error.
+ *
+ * Side Effects: The popserver passed in is unusable after this
+ * 	function is called, even if an error occurs.
+ */
+int
+pop_quit (server)
+     popserver server;
+{
+  int ret = 0;
+
+  if (server->file >= 0)
+    {
+      if (pop_retrieve_flush (server))
+	{
+	  ret = -1;
+	}
+
+      if (sendline (server, "QUIT") || getok (server))
+	{
+	  ret = -1;
+	}
+
+      close (server->file);
+    }
+
+  if (server->buffer)
+    free (server->buffer);
+  free ((char *) server);
+
+  return (ret);
+}
+
+#ifdef WINDOWSNT
+static int have_winsock = 0;
+#endif
+
+/*
+ * Function: socket_connection
+ *
+ * Purpose: Opens the network connection with the mail host, without
+ * 	doing any sort of I/O with it or anything.
+ *
+ * Arguments:
+ * 	host	The host to which to connect.
+ *	flags	Option flags.
+ * 	
+ * Return value: A file descriptor indicating the connection, or -1
+ * 	indicating failure, in which case an error has been copied
+ * 	into pop_error.
+ */
+static int
+socket_connection (host, flags)
+     char *host;
+     int flags;
+{
+  struct hostent *hostent;
+  struct servent *servent;
+  struct sockaddr_in addr;
+  char found_port = 0;
+  char *service;
+  int sock;
+#ifdef KERBEROS
+#ifdef KRB5
+  krb5_error_code rem;
+  krb5_ccache ccdef;
+  krb5_principal client, server;
+  krb5_error *err_ret;
+  register char *cp;
+#else
+  KTEXT ticket;
+  MSG_DAT msg_data;
+  CREDENTIALS cred;
+  Key_schedule schedule;
+  int rem;
+#endif /* KRB5 */
+#endif /* KERBEROS */
+
+  int try_count = 0;
+
+#ifdef WINDOWSNT
+  {
+    WSADATA winsockData;
+    if (WSAStartup (0x101, &winsockData) == 0)
+      have_winsock = 1;
+  }
+#endif
+
+  do
+    {
+      hostent = gethostbyname (host);
+      try_count++;
+      if ((! hostent) && ((h_errno != TRY_AGAIN) || (try_count == 5)))
+	{
+	  strcpy (pop_error, "Could not determine POP server's address");
+	  return (-1);
+	}
+    } while (! hostent);
+
+  bzero ((char *) &addr, sizeof (addr));
+  addr.sin_family = AF_INET;
+
+#ifdef KERBEROS
+  service = (flags & POP_NO_KERBEROS) ? POP_SERVICE : KPOP_SERVICE;
+#else
+  service = POP_SERVICE;
+#endif
+
+#ifdef HESIOD
+  if (! (flags & POP_NO_HESIOD))
+    {
+      servent = hes_getservbyname (service, "tcp");
+      if (servent)
+	{
+	  addr.sin_port = servent->s_port;
+	  found_port = 1;
+	}
+    }
+#endif
+  if (! found_port)
+    {
+      servent = getservbyname (service, "tcp");
+      if (servent)
+	{
+	  addr.sin_port = servent->s_port;
+	}
+      else
+	{
+#ifdef KERBEROS
+	  addr.sin_port = htons ((flags & POP_NO_KERBEROS) ?
+				POP_PORT : KPOP_PORT);
+#else
+	  addr.sin_port = htons (POP_PORT);
+#endif
+	}
+    }
+
+#define SOCKET_ERROR "Could not create socket for POP connection: "
+
+  sock = socket (PF_INET, SOCK_STREAM, 0);
+  if (sock < 0)
+    {
+      strcpy (pop_error, SOCKET_ERROR);
+      strncat (pop_error, strerror (errno),
+	       ERROR_MAX - sizeof (SOCKET_ERROR));
+      return (-1);
+	  
+    }
+
+  while (*hostent->h_addr_list)
+    {
+      bcopy (*hostent->h_addr_list, (char *) &addr.sin_addr,
+	     hostent->h_length);
+      if (! connect (sock, (struct sockaddr *) &addr, sizeof (addr)))
+	break;
+      hostent->h_addr_list++;
+    }
+
+#define CONNECT_ERROR "Could not connect to POP server: "
+     
+  if (! *hostent->h_addr_list)
+    {
+      CLOSESOCKET (sock);
+      strcpy (pop_error, CONNECT_ERROR);
+      strncat (pop_error, strerror (errno),
+	       ERROR_MAX - sizeof (CONNECT_ERROR));
+      return (-1);
+	  
+    }
+
+#ifdef KERBEROS
+#define KRB_ERROR "Kerberos error connecting to POP server: "
+  if (! (flags & POP_NO_KERBEROS))
+    {
+#ifdef KRB5
+      krb5_init_ets ();
+
+      if (rem = krb5_cc_default (&ccdef))
+	{
+	krb5error:
+	  strcpy (pop_error, KRB_ERROR);
+	  strncat (pop_error, error_message (rem),
+		   ERROR_MAX - sizeof(KRB_ERROR));
+	  CLOSESOCKET (sock);
+	  return (-1);
+	}
+
+      if (rem = krb5_cc_get_principal (ccdef, &client))
+	{
+	  goto krb5error;
+	}
+
+      for (cp = hostent->h_name; *cp; cp++)
+	{
+	  if (isupper (*cp))
+	    {
+	      *cp = tolower (*cp);
+	    }
+	}
+
+      if (rem = krb5_sname_to_principal (hostent->h_name, POP_SERVICE,
+					 FALSE, &server))
+	{
+	  goto krb5error;
+	}
+
+      rem = krb5_sendauth ((krb5_pointer) &sock, "KPOPV1.0", client, server,
+			  AP_OPTS_MUTUAL_REQUIRED,
+			  0,	/* no checksum */
+			  0,	/* no creds, use ccache instead */
+			  ccdef,
+			  0,	/* don't need seq # */
+			  0,	/* don't need subsession key */
+			  &err_ret,
+			  0);	/* don't need reply */
+      krb5_free_principal (server);
+      if (rem)
+	{
+	  if (err_ret && err_ret->text.length)
+	    {
+	      strcpy (pop_error, KRB_ERROR);
+	      strncat (pop_error, error_message (rem),
+		       ERROR_MAX - sizeof (KRB_ERROR));
+	      strncat (pop_error, " [server says '",
+		       ERROR_MAX - strlen (pop_error) - 1);
+	      strncat (pop_error, err_ret->text.data,
+		       min (ERROR_MAX - strlen (pop_error) - 1,
+			    err_ret->text.length));
+	      strncat (pop_error, "']",
+		       ERROR_MAX - strlen (pop_error) - 1);
+	    }
+	  else
+	    {
+	      strcpy (pop_error, KRB_ERROR);
+	      strncat (pop_error, error_message (rem),
+		       ERROR_MAX - sizeof (KRB_ERROR));
+	    }
+	  if (err_ret)
+	    krb5_free_error (err_ret);
+
+	  CLOSESOCKET (sock);
+	  return (-1);
+	}
+#else  /* ! KRB5 */	  
+      ticket = (KTEXT) malloc (sizeof (KTEXT_ST));
+      rem = krb_sendauth (0L, sock, ticket, "pop", hostent->h_name,
+			  (char *) krb_realmofhost (hostent->h_name),
+			  (unsigned long) 0, &msg_data, &cred, schedule,
+			  (struct sockaddr_in *) 0,
+			  (struct sockaddr_in *) 0,
+			  "KPOPV0.1");
+      free ((char *) ticket);
+      if (rem != KSUCCESS)
+	{
+	  strcpy (pop_error, KRB_ERROR);
+	  strncat (pop_error, krb_err_txt[rem],
+		   ERROR_MAX - sizeof (KRB_ERROR));
+	  CLOSESOCKET (sock);
+	  return (-1);
+	}
+#endif /* KRB5 */
+    }
+#endif /* KERBEROS */
+
+  return (sock);
+} /* socket_connection */
+
+/*
+ * Function: getline
+ *
+ * Purpose: Get a line of text from the connection and return a
+ * 	pointer to it.  The carriage return and linefeed at the end of
+ * 	the line are stripped, but periods at the beginnings of lines
+ * 	are NOT dealt with in any special way.
+ *
+ * Arguments:
+ * 	server	The server from which to get the line of text.
+ *
+ * Returns: A non-null pointer if successful, or a null pointer on any
+ * 	error, with an error message copied into pop_error.
+ *
+ * Notes: The line returned is overwritten with each call to getline.
+ *
+ * Side effects: Closes the connection on error.
+ */
+static char *
+getline (server)
+     popserver server;
+{
+#define GETLINE_ERROR "Error reading from server: "
+
+  int ret;
+  int search_offset = 0;
+
+  if (server->data)
+    {
+      char *cp = find_crlf (server->buffer + server->buffer_index);
+      if (cp)
+	{
+	  int found;
+	  int data_used;
+
+	  found = server->buffer_index;
+	  data_used = (cp + 2) - server->buffer - found;
+	       
+	  *cp = '\0';		/* terminate the string to be returned */
+	  server->data -= data_used;
+	  server->buffer_index += data_used;
+
+	  if (pop_debug)
+	    fprintf (stderr, "<<< %s\n", server->buffer + found);
+	  return (server->buffer + found);
+	}
+      else
+	{
+	  bcopy (server->buffer + server->buffer_index,
+		 server->buffer, server->data);
+	  /* Record the fact that we've searched the data already in
+             the buffer for a CRLF, so that when we search below, we
+             don't have to search the same data twice.  There's a "-
+             1" here to account for the fact that the last character
+             of the data we have may be the CR of a CRLF pair, of
+             which we haven't read the second half yet, so we may have
+             to search it again when we read more data. */
+	  search_offset = server->data - 1;
+	  server->buffer_index = 0;
+	}
+    }
+  else
+    {
+      server->buffer_index = 0;
+    }
+
+  while (1)
+    {
+      /* There's a "- 1" here to leave room for the null that we put
+         at the end of the read data below.  We put the null there so
+         that find_crlf knows where to stop when we call it. */
+      if (server->data == server->buffer_size - 1)
+	{
+	  server->buffer_size += GETLINE_INCR;
+	  server->buffer = (char *)realloc (server->buffer, server->buffer_size);
+	  if (! server->buffer)
+	    {
+	      strcpy (pop_error, "Out of memory in getline");
+	      pop_trash (server);
+	      return (0);
+	    }
+	}
+      ret = RECV (server->file, server->buffer + server->data,
+		  server->buffer_size - server->data - 1, 0);
+      if (ret < 0)
+	{
+	  strcpy (pop_error, GETLINE_ERROR);
+	  strncat (pop_error, strerror (errno),
+		   ERROR_MAX - sizeof (GETLINE_ERROR));
+	  pop_trash (server);
+	  return (0);
+	}
+      else if (ret == 0)
+	{
+	  strcpy (pop_error, "Unexpected EOF from server in getline");
+	  pop_trash (server);
+	  return (0);
+	}
+      else
+	{
+	  char *cp;
+	  server->data += ret;
+	  server->buffer[server->data] = '\0';
+	       
+	  cp = find_crlf (server->buffer + search_offset);
+	  if (cp)
+	    {
+	      int data_used = (cp + 2) - server->buffer;
+	      *cp = '\0';
+	      server->data -= data_used;
+	      server->buffer_index = data_used;
+
+	      if (pop_debug)
+		fprintf (stderr, "<<< %s\n", server->buffer);
+	      return (server->buffer);
+	    }
+	  search_offset += ret;
+	}
+    }
+
+  /* NOTREACHED */
+}
+
+/*
+ * Function: sendline
+ *
+ * Purpose: Sends a line of text to the POP server.  The line of text
+ * 	passed into this function should NOT have the carriage return
+ * 	and linefeed on the end of it.  Periods at beginnings of lines
+ * 	will NOT be treated specially by this function.
+ *
+ * Arguments:
+ * 	server	The server to which to send the text.
+ * 	line	The line of text to send.
+ *
+ * Return value: Upon successful completion, a value of 0 will be
+ * 	returned.  Otherwise, a non-zero value will be returned, and
+ * 	an error will be copied into pop_error.
+ *
+ * Side effects: Closes the connection on error.
+ */
+static int
+sendline (server, line)
+     popserver server;
+     char *line;
+{
+#define SENDLINE_ERROR "Error writing to POP server: "
+  int ret;
+
+  ret = fullwrite (server->file, line, strlen (line));
+  if (ret >= 0)
+    {				/* 0 indicates that a blank line was written */
+      ret = fullwrite (server->file, "\r\n", 2);
+    }
+
+  if (ret < 0)
+    {
+      pop_trash (server);
+      strcpy (pop_error, SENDLINE_ERROR);
+      strncat (pop_error, strerror (errno),
+	       ERROR_MAX - sizeof (SENDLINE_ERROR));
+      return (ret);
+    }
+
+  if (pop_debug)
+    fprintf (stderr, ">>> %s\n", line);
+
+  return (0);
+}
+
+/*
+ * Procedure: fullwrite
+ *
+ * Purpose: Just like write, but keeps trying until the entire string
+ * 	has been written.
+ *
+ * Return value: Same as write.  Pop_error is not set.
+ */
+static int
+fullwrite (fd, buf, nbytes)
+     int fd;
+     char *buf;
+     int nbytes;
+{
+  char *cp;
+  int ret;
+
+  cp = buf;
+  while ((ret = SEND (fd, cp, nbytes, 0)) > 0)
+    {
+      cp += ret;
+      nbytes -= ret;
+    }
+
+  return (ret);
+}
+
+/*
+ * Procedure getok
+ *
+ * Purpose: Reads a line from the server.  If the return indicator is
+ * 	positive, return with a zero exit status.  If not, return with
+ * 	a negative exit status.
+ *
+ * Arguments:
+ * 	server	The server to read from.
+ * 
+ * Returns: 0 for success, else for failure and puts error in pop_error.
+ *
+ * Side effects: On failure, may make the connection unusable.
+ */
+static int
+getok (server)
+     popserver server;
+{
+  char *fromline;
+
+  if (! (fromline = getline (server)))
+    {
+      return (-1);
+    }
+
+  if (! strncmp (fromline, "+OK", 3))
+    return (0);
+  else if (! strncmp (fromline, "-ERR", 4))
+    {
+      strncpy (pop_error, fromline, ERROR_MAX);
+      pop_error[ERROR_MAX-1] = '\0';
+      return (-1);
+    }
+  else
+    {
+      strcpy (pop_error,
+	      "Unexpected response from server; expecting +OK or -ERR");
+      pop_trash (server);
+      return (-1);
+    }
+}	  
+
+#if 0
+/*
+ * Function: gettermination
+ *
+ * Purpose: Gets the next line and verifies that it is a termination
+ * 	line (nothing but a dot).
+ *
+ * Return value: 0 on success, non-zero with pop_error set on error.
+ *
+ * Side effects: Closes the connection on error.
+ */
+static int
+gettermination (server)
+     popserver server;
+{
+  char *fromserver;
+
+  fromserver = getline (server);
+  if (! fromserver)
+    return (-1);
+
+  if (strcmp (fromserver, "."))
+    {
+      strcpy (pop_error,
+	      "Unexpected response from server in gettermination");
+      pop_trash (server);
+      return (-1);
+    }
+
+  return (0);
+}
+#endif
+
+/*
+ * Function pop_close
+ *
+ * Purpose: Close a pop connection, sending a "RSET" command to try to
+ * 	preserve any changes that were made and a "QUIT" command to
+ * 	try to get the server to quit, but ignoring any responses that
+ * 	are received.
+ *
+ * Side effects: The server is unusable after this function returns.
+ * 	Changes made to the maildrop since the session was started (or
+ * 	since the last pop_reset) may be lost.
+ */
+void 
+pop_close (server)
+     popserver server;
+{
+  pop_trash (server);
+  free ((char *) server);
+
+  return;
+}
+
+/*
+ * Function: pop_trash
+ *
+ * Purpose: Like pop_close or pop_quit, but doesn't deallocate the
+ * 	memory associated with the server.  It is legal to call
+ * 	pop_close or pop_quit after this function has been called.
+ */
+static void
+pop_trash (server)
+     popserver server;
+{
+  if (server->file >= 0)
+    {
+      /* avoid recursion; sendline can call pop_trash */
+      if (server->trash_started)
+	return;
+      server->trash_started = 1;
+
+      sendline (server, "RSET");
+      sendline (server, "QUIT");
+
+      CLOSESOCKET (server->file);
+      server->file = -1;
+      if (server->buffer)
+	{
+	  free (server->buffer);
+	  server->buffer = 0;
+	}
+    }
+
+#ifdef WINDOWSNT
+  if (have_winsock)
+    WSACleanup ();
+#endif
+}
+
+/* Return a pointer to the first CRLF in IN_STRING,
+   or 0 if it does not contain one.  */
+
+static char *
+find_crlf (in_string)
+     char *in_string;
+{
+  while (1)
+    {
+      if (! *in_string)
+	return (0);
+      else if (*in_string == '\r')
+	{
+	  if (*++in_string == '\n')
+	    return (in_string - 1);
+	}
+      else
+	in_string++;
+    }
+  /* NOTREACHED */
+}
+
+#endif /* MAIL_USE_POP */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/lib-src/pop.h	Mon Aug 13 08:57:55 2007 +0200
@@ -0,0 +1,82 @@
+/* pop.h: Header file for the "pop.c" client POP3 protocol.
+   Copyright (c) 1991,1993 Free Software Foundation, Inc.
+   Written by Jonathan Kamens, jik@security.ov.com.
+
+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 2, 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; see the file COPYING.  If not, write to
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA.  */
+
+#include <stdio.h>
+
+#define GETLINE_MIN 1024	/* the getline buffer starts out this */
+				/* size */
+#define GETLINE_INCR 1024	/* the getline buffer is grown by this */
+				/* size when it needs to grow */
+
+extern char pop_error[];
+extern int pop_debug;
+
+struct _popserver
+{
+  int file, data;
+  char *buffer;
+  int buffer_size, buffer_index;
+  int in_multi;
+  int trash_started;
+};
+
+typedef struct _popserver *popserver;
+
+/*
+ * Valid flags for the pop_open function.
+ */
+
+#define POP_NO_KERBEROS	(1<<0)
+#define POP_NO_HESIOD	(1<<1)
+#define POP_NO_GETPASS 	(1<<2)
+
+#ifdef __STDC__
+#define _ARGS(a) a
+#else
+#define _ARGS(a) ()
+#endif
+
+extern popserver pop_open _ARGS((char *host, char *username, char *password,
+				 int flags));
+extern int pop_stat _ARGS((popserver server, int *count, int *size));
+extern int pop_list _ARGS((popserver server, int message, int **IDs,
+			   int **size));
+extern char *pop_retrieve _ARGS((popserver server, int message, int markfrom));
+extern int pop_retrieve_first _ARGS((popserver server, int message,
+				     char **response));
+extern int pop_retrieve_next _ARGS((popserver server, char **line));
+extern int pop_retrieve_flush _ARGS((popserver server));
+extern int pop_top_first _ARGS((popserver server, int message, int lines,
+				char **response));
+extern int pop_top_next _ARGS((popserver server, char **line));
+extern int pop_top_flush _ARGS((popserver server));
+extern int pop_multi_first _ARGS((popserver server, char *command,
+				  char **response));
+extern int pop_multi_next _ARGS((popserver server, char **line));
+extern int pop_multi_flush _ARGS((popserver server));
+extern int pop_delete _ARGS((popserver server, int message));
+extern int pop_noop _ARGS((popserver server));
+extern int pop_last _ARGS((popserver server));
+extern int pop_reset _ARGS((popserver server));
+extern int pop_quit _ARGS((popserver server));
+extern void pop_close _ARGS((popserver));
+
+#undef _ARGS
--- a/lisp/modes/cc-mode.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/modes/cc-mode.el	Mon Aug 13 08:57:55 2007 +0200
@@ -6,8 +6,8 @@
 ;;          1987 Dave Detlefs and Stewart Clamen
 ;;          1985 Richard M. Stallman
 ;; Created: a long, long, time ago. adapted from the original c-mode.el
-;; Version:         4.388
-;; Last Modified:   1997/03/25 03:19:17
+;; Version:         4.389
+;; Last Modified:   1997/03/28 16:48:31
 ;; Keywords: c languages oop
 
 ;; NOTE: Read the commentary below for the right way to submit bug reports!
@@ -4141,8 +4141,10 @@
 				  (setq done t))
 				 )
 			   (setq cont t)))
-		       injava-inher))
-		)
+		       injava-inher)
+		     (not (c-crosses-statement-barrier-p (cdr injava-inher)
+							 (point)))
+		     ))
 	    (cond
 	     ;; CASE 5C.1: non-hanging colon on an inher intro
 	     ((= char-after-ip ?:)
@@ -5203,7 +5205,7 @@
 
 ;; defuns for submitting bug reports
 
-(defconst c-version "4.388"
+(defconst c-version "4.389"
   "CC Mode version number.")
 (defconst c-mode-help-address
   "bug-gnu-emacs@prep.ai.mit.edu, cc-mode-help@python.org"
--- a/lisp/packages/icomplete.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/packages/icomplete.el	Mon Aug 13 08:57:55 2007 +0200
@@ -1,33 +1,33 @@
-;;; icomplete.el --- minibuffer completion with incremental feedback
+;;;_. icomplete.el - minibuffer completion incremental feedback
 
-;;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
+;; Copyright (C) 1992, 1993, 1994 Free Software Foundation, Inc.
 
-;;; Author: Ken Manheimer <klm@nist.gov>
-;;; Maintainer: Ken Manheimer <klm@nist.gov>
-;;; Version: $Id: icomplete.el,v 1.3 1997/09/13 00:24:38 steve Exp $
-;;; Created: Mar 1993 klm@nist.gov - first release to usenet
-;;; Keywords: help, abbrev
+;; Author: Ken Manheimer <klm@python.org>
+;; Maintainer: Ken Manheimer <klm@python.org>
+;; Version: $Id: icomplete.el,v 1.4 1997/09/17 01:51:04 steve Exp $
+;; Created: Mar 1993 klm@nist.gov - first release to usenet
+;; Keywords: help, abbrev
 
-;;; Hacked for XEmacs: David Hughes 7th September 1995
+;; This file is part of GNU Emacs.
 
-;; This file is part of XEmacs.
-
-;; XEmacs is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
+;; 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 2, or (at your option)
 ;; any later version.
 
-;; XEmacs 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.
+;; 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 XEmacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
-;; 02111-1307, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
-;;; Synched up with: FSF 19.34.
+;; This file is also part of XEmacs.
+;; Hacked for XEmacs: David Hughes 7th September 1995
+;; With some integration and refinement by Ken Manheimer, May 1997
 
 ;;; Commentary:
 
@@ -72,6 +72,13 @@
 (provide 'icomplete)
 
 ;;;_* User Customization variables
+(defvar icomplete-compute-delay .3
+  "*Completions-computation stall, used only with large-number
+completions - see `icomplete-delay-completions-threshold'.")
+(defvar icomplete-delay-completions-threshold 400
+  "*Pending-completions number over which to apply icomplete-compute-delay.")
+(defvar icomplete-max-delay-chars 3
+  "*Maximum number of initial chars to apply icomplete compute delay.")
 
 ;;;_* Initialization
 ;;;_  = icomplete-minibuffer-setup-hook
@@ -121,27 +128,30 @@
 (add-hook 'icomplete-post-command-hook 'icomplete-exhibit)
 
 ;; XEmacs addition
-(defvar icomplete-show-key-bindings t
+(defvar icomplete-show-key-bindings (string-match "XEmacs\\|Lucid"
+						  emacs-version)
   "When non-nil show key bindings as well as completion when matching
-a command.")
+a command.  Currently working only for XEmacs - see `icomplete-get-keys'.")
 
-;; XEmacs addition
 (defun icomplete-get-keys (func-name)
-  "Return the keys `func-name' is bound to as a string."
+  "Return the keys `func-name' is bound to as a string, or nil if none.
+NOTE that this depends on `owindow' minbuf setting and `current-local-map'
+taking arg, both present in XEmacs but not present in mainline GNU Emacs
+19.34."
   (when (commandp func-name)
     (save-excursion
+      ;; Depends on dynamic scope from read-from-minibuffer :-(
       (let* ((sym (intern func-name))
 	     (buf (set-buffer (window-buffer owindow)))
 	     (keys (where-is-internal sym (current-local-map buf))))
-	(concat "<"
-		(if keys
+	(if keys
+	    (concat "<"
 		    (mapconcat 'key-description
-			       (sort '([next] [kp-next] [(control v)])
+			       (sort keys
 				     #'(lambda (x y)
 					 (< (length x) (length y))))
 			       ", ")
-		  "Unbound")
-		">")))))
+		">"))))))
 
 ;;;_ > icomplete-mode (&optional prefix)
 ;;;###autoload
@@ -215,6 +225,7 @@
 ;;;_ > icomplete-exhibit ()
 (defun icomplete-exhibit ()
   "Insert icomplete completions display.
+
 Should be run via minibuffer `post-command-hook'.  See `icomplete-mode'
 and `minibuffer-setup-hook'."
   (if (icomplete-simple-completing-p)
@@ -230,7 +241,22 @@
 	      (make-local-variable 'icomplete-eoinput))
 	  (setq icomplete-eoinput (point))
                                         ; Insert the match-status information:
-	  (if (> (point-max) 1)
+	  (if (and (> (point-max) 1)
+		   (or
+		    ;; Don't bother with delay after certain number of chars:
+		    (> (point-max) icomplete-max-delay-chars)
+		    ;; Don't delay if alternatives number is small enough:
+		    (if minibuffer-completion-table
+			(cond ((numberp minibuffer-completion-table)
+			       (< minibuffer-completion-table
+				  icomplete-delay-completions-threshold))
+			      ((sequencep minibuffer-completion-table)
+			       (< (length minibuffer-completion-table)
+				  icomplete-delay-completions-threshold))
+			      ))
+		    ;; Delay - give some grace time for next keystroke, before
+		    ;; embarking on computing completions:
+		    (sit-for icomplete-compute-delay)))
 	      (insert-string
 	       (icomplete-completions contents
 				      minibuffer-completion-table
@@ -255,7 +281,13 @@
 
 The displays for unambiguous matches have ` [Matched]' appended
 \(whether complete or not), or ` \[No matches]', if no eligible
-matches exist."
+matches exist.  \(In XEmacs, keybindings for matched commands, if any,
+are exhibited within the square braces.)"
+
+  ;; 'all-completions' doesn't like empty
+  ;; minibuffer-completion-table's (ie: (nil))
+  (if (and (listp candidates) (null (car candidates)))
+      (setq candidates nil))
 
   (let ((comps (all-completions name candidates predicate))
                                         ; "-determined" - only one candidate
@@ -265,53 +297,71 @@
         (open-bracket-prospects "{")
         (close-bracket-prospects "}")
         )
-    (cond ((null comps) (format " %sNo matches%s"
-				open-bracket-determined
-				close-bracket-determined))
-	  ((null (cdr comps))           ;one match
-	   (concat (if (and (> (length (car comps))
-			       (length name)))
-		       (concat open-bracket-determined
-			       (substring (car comps) (length name))
-			       close-bracket-determined)
-		     "")
-		   " [Matched]"
-	   ;; XEmacs
-		   (if (and icomplete-show-key-bindings
-			    (commandp (intern-soft (car comps))))
-		       (icomplete-get-keys (car comps))
-		     "")
-		   ))
-	  (t                            ;multiple matches
-	   (let* ((most (try-completion name candidates predicate))
-		  (most-len (length most))
-		  most-is-exact
-		  (alternatives
-		   (apply
-		    (function concat)
-		    (cdr (apply
-			  (function nconc)
-			  (mapcar '(lambda (com)
-				     (if (= (length com) most-len)
-					 ;; Most is one exact match,
-					 ;; note that and leave out
-					 ;; for later indication:
-					 (progn
-					   (setq most-is-exact t)
-					   ())
-				       (list ","
-					     (substring com
-							most-len))))
-				  comps))))))
-	     (concat (and (> most-len (length name))
-			  (concat open-bracket-determined
-				  (substring most (length name))
+    (catch 'input
+      (cond ((null comps) (format " %sNo matches%s"
+				  open-bracket-determined
 				  close-bracket-determined))
-		     open-bracket-prospects
-		     (if most-is-exact
-			 (concat "," alternatives)
-		       alternatives)
-		     close-bracket-prospects))))))
+	    ((null (cdr comps))		;one match
+	     (concat (if (and (> (length (car comps))
+				 (length name)))
+			 (concat open-bracket-determined
+				 (substring (car comps) (length name))
+				 close-bracket-determined)
+		       "")
+		     " [Matched"
+		     (let ((keys (and icomplete-show-key-bindings
+				      (commandp (intern-soft (car comps)))
+				      (icomplete-get-keys (car comps)))))
+		       (if keys
+			   (concat "; " keys)
+			 ""))
+		     "]"))
+	    (t				;multiple matches
+	     (let* ((most
+		     (try-completion name candidates
+				     (and predicate
+					  ;; Wrap predicate in impatience - ie,
+					  ;; `throw' up when pending input is
+					  ;; noticed.  Adds some overhead to
+					  ;; predicate, but should be worth it.
+					  (function
+					   (lambda (item)
+					     (if (input-pending-p)
+						 (throw 'input "")
+					       (apply predicate
+						      item nil)))))))
+		    (most-len (length most))
+		    most-is-exact
+		    (alternatives
+		     (substring 
+		      (apply (function concat)
+			     (mapcar (function
+				      (lambda (com)
+					(if (input-pending-p)
+					    (throw 'input ""))
+					(if (= (length com) most-len)
+					    ;; Most is one exact match,
+					    ;; note that and leave out
+					    ;; for later indication:
+					    (progn
+					      (setq most-is-exact t)
+					      ())
+					  (concat ","
+						  (substring com
+							     most-len)))))
+				     comps))
+		      1)))
+	       (concat (and (> most-len (length name))
+			    (concat open-bracket-determined
+				    (substring most (length name))
+				    close-bracket-determined))
+		       open-bracket-prospects
+		       (if most-is-exact
+			   ;; Add a ',' at the front to indicate "complete but
+			   ;; not unique":
+			   (concat "," alternatives)
+			 alternatives)
+		       close-bracket-prospects)))))))
 
 ;;;_ + Initialization
 ;;; If user hasn't setq-default icomplete-mode to nil, then setup for
--- a/lisp/prim/auto-autoloads.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/prim/auto-autoloads.el	Mon Aug 13 08:57:55 2007 +0200
@@ -1223,7 +1223,7 @@
 *Switches passed to ls for dired. MUST contain the `l' option.
 Can contain even `F', `b', `i' and `s'.")
 
-(defvar dired-chown-program (if (memq system-type '(hpux dgux usg-unix-v)) "chown" "/etc/chown") "\
+(defvar dired-chown-program (if (memq system-type '(hpux dgux usg-unix-v linux)) "chown" "/etc/chown") "\
 *Name of chown command (usually `chown' or `/etc/chown').")
 
 (defvar dired-gnutar-program nil "\
@@ -1314,6 +1314,9 @@
 *Mail reader used by dired for dired-read-mail (\\[dired-read-mail]).
 The symbols 'rmail and 'vm are the only two allowed values.")
 
+(defvar dired-refresh-automatically t "\
+*If non-nil, refresh dired buffers automatically after file operations.")
+
 (define-key ctl-x-map "d" 'dired)
 
 (autoload 'dired "dired" "\
@@ -1378,10 +1381,6 @@
 
 ;;;### (autoloads (remote-path-file-handler-function) "efs-dump" "efs/efs-dump.el")
 
-(defvar allow-remote-paths t "\
-*Set this to nil if you don't want remote paths to access
-remote files.")
-
 (or (assoc efs-path-root-regexp file-name-handler-alist) (setq file-name-handler-alist (cons (cons efs-path-root-regexp 'remote-path-file-handler-function) file-name-handler-alist)))
 
 (autoload 'remote-path-file-handler-function "efs-dump" "\
@@ -1389,6 +1388,14 @@
 
 ;;;***
 
+;;;### (autoloads nil "efs-fnh" "efs/efs-fnh.el")
+
+(defvar allow-remote-paths t "\
+*Set this to nil if you don't want remote paths to access
+remote files.")
+
+;;;***
+
 ;;;### (autoloads (efs-root-file-name-completion efs-root-file-name-all-completions efs-set-passwd) "efs-netrc" "efs/efs-netrc.el")
 
 (autoload 'efs-set-passwd "efs-netrc" "\
@@ -1889,12 +1896,10 @@
 Start a Gomoku game between you and Emacs.
 If a game is in progress, this command allow you to resume it.
 If optional arguments N and M are given, an N by M board is used.
-If prefix arg is given for N, M is prompted for.
-
-You and Emacs play in turn by marking a free square.  You mark it with X
+
+You and Emacs play in turn by marking a free square. You mark it with X
 and Emacs marks it with O. The winner is the first to get five contiguous
 marks horizontally, vertically or in diagonal.
-
 You play by moving the cursor over the square you choose and hitting
 \\<gomoku-mode-map>\\[gomoku-human-plays].
 Use \\[describe-mode] for more info." t nil)
@@ -3576,8 +3581,6 @@
 
 ;;;### (autoloads (hide-ifdef-mode) "hideif" "modes/hideif.el")
 
-(add-minor-mode 'hide-ifdef-mode " Ifdef")
-
 (autoload 'hide-ifdef-mode "hideif" "\
 Toggle Hide-Ifdef mode.  This is a minor mode, albeit a large one.
 With ARG, turn Hide-Ifdef mode on if arg is positive, off otherwise.
@@ -3736,7 +3739,7 @@
 ;;;### (autoloads (ksh-mode) "ksh-mode" "modes/ksh-mode.el")
 
 (autoload 'ksh-mode "ksh-mode" "\
-ksh-mode $Revision: 1.19 $ - Major mode for editing (Bourne, Korn or Bourne again)
+ksh-mode $Revision: 1.20 $ - Major mode for editing (Bourne, Korn or Bourne again)
 shell scripts.
 Special key bindings and commands:
 \\{ksh-mode-map}
@@ -5011,7 +5014,7 @@
 
 (autoload 'vhdl-mode "vhdl-mode" "\
 Major mode for editing VHDL code.
-vhdl-mode $Revision: 1.19 $
+vhdl-mode $Revision: 1.20 $
 To submit a problem report, enter `\\[vhdl-submit-bug-report]' from a
 vhdl-mode buffer.  This automatically sets up a mail buffer with version
 information already added.  You just need to add a description of the
@@ -5319,7 +5322,8 @@
 Second arg is file name of change log.  If nil, uses `change-log-default-name'.
 Third arg OTHER-WINDOW non-nil means visit in other window.
 Fourth arg NEW-ENTRY non-nil means always create a new entry at the front;
-never append to an existing entry." t nil)
+never append to an existing entry.  Today's date is calculated according to
+`change-log-time-zone-rule' if non-nil, otherwise in local time." t nil)
 
 (autoload 'add-change-log-entry-other-window "add-log" "\
 Find change log file in other window and add an entry for today.
@@ -5335,6 +5339,15 @@
 Each entry behaves as a paragraph, and the entries for one day as a page.
 Runs `change-log-mode-hook'." t nil)
 
+(defvar add-log-lisp-like-modes '(emacs-lisp-mode lisp-mode scheme-mode lisp-interaction-mode) "\
+*Modes that look like Lisp to `add-log-current-defun'.")
+
+(defvar add-log-c-like-modes '(c-mode c++-mode c++-c-mode objc-mode) "\
+*Modes that look like C to `add-log-current-defun'.")
+
+(defvar add-log-tex-like-modes '(TeX-mode plain-TeX-mode LaTeX-mode plain-tex-mode latex-mode) "\
+*Modes that look like TeX to `add-log-current-defun'.")
+
 (autoload 'add-log-current-defun "add-log" "\
 Return name of function definition point is in, or nil.
 
--- a/lisp/prim/custom-load.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/prim/custom-load.el	Mon Aug 13 08:57:55 2007 +0200
@@ -7,8 +7,9 @@
 (put 'gnus-summary-sort 'custom-loads '("gnus-sum"))
 (put 'nnmail-procmail 'custom-loads '("nnmail"))
 (put 'ssl 'custom-loads '("ssl"))
+(put 'telnet 'custom-loads '("telnet"))
 (put 'widgets 'custom-loads '("wid-browse" "wid-edit"))
-(put 'environment 'custom-loads '("cus-edit"))
+(put 'environment 'custom-loads '("cus-edit" "dired-faces"))
 (put 'gnus-article-buttons 'custom-loads '("gnus-art"))
 (put 'gnus-extract-archive 'custom-loads '("gnus-uu"))
 (put 'gnus-article-headers 'custom-loads '("gnus-art" "gnus-sum"))
@@ -23,7 +24,7 @@
 (put 'gnus-summary-exit 'custom-loads '("gnus-sum"))
 (put 'gnus-article-saving 'custom-loads '("gnus-art"))
 (put 'gnus-extract-view 'custom-loads '("gnus-sum" "gnus-uu"))
-(put 'comint 'custom-loads '("comint-xemacs"))
+(put 'comint 'custom-loads '("comint-xemacs" "telnet"))
 (put 'gnus-group-listing 'custom-loads '("gnus-group"))
 (put 'gnus-summary 'custom-loads '("gnus-sum" "gnus"))
 (put 'message-headers 'custom-loads '("message"))
@@ -90,7 +91,7 @@
 (put 'faces 'custom-loads '("cus-edit" "wid-edit" "gnus" "message"))
 (put 'gnus-various 'custom-loads '("gnus-sum"))
 (put 'gnus-article-highlight 'custom-loads '("gnus-art"))
-(put 'emacs 'custom-loads '("cus-edit" "dired-faces" "ssl"))
+(put 'emacs 'custom-loads '("cus-edit" "ssl"))
 (put 'processes 'custom-loads '("comint-xemacs"))
 (put 'news 'custom-loads '("gnus" "message"))
 (put 'w3-hooks 'custom-loads '("w3-cus"))
--- a/lisp/version.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/version.el	Mon Aug 13 08:57:55 2007 +0200
@@ -55,7 +55,7 @@
   "Non-nil when this is a test (beta) version of XEmacs.
 Warning, this variable did not exist in XEmacs versions prior to 20.3")
 
-(defconst xemacs-codename "Queens"
+(defconst xemacs-codename "Brooklyn"
   "Symbolic name of XEmacs build.
 Warning, this variable did not exist in XEmacs versions prior to 19.16
 and 20.3")
--- a/lisp/vm/Makefile	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/Makefile	Mon Aug 13 08:57:55 2007 +0200
@@ -2,17 +2,9 @@
 # Allowed values are 18 and 19.
 # Version 18 of Emacs is UNSUPPORTED.
 # In fact all versions of Emacs prior to 19.34 for Emacs and
-# prior to 19.14 for XEmacs are unsupported.
+# prior to 19.14 for XEmacs are unsupported.  For v20 XEmacs
+# EMACS_VERSION should remain 19.
 #
-# Currently only vm-isearch-forward depends on the EMACS_VERSION
-# setting being correct.  You can use the same VM .elc files
-# under v18 and v19 Emacs if you don't care about
-# vm-isearch-forward.
-#
-# Note that .elc files compiled with the v19 byte compiler won't
-# work under v18 Emacs, but v18 .elcs will work under v19.  So
-# point this at your v18 Emacs binary if you want compatible .elc
-# files.
 EMACS_VERSION = 19
 
 # what emacs is called on your system
@@ -26,6 +18,7 @@
 
 # where the toolbar pixmaps should go.
 # vm-toolbar-pixmap-directory must point to the same place.
+# vm-image-directory must point to the same place.
 PIXMAPDIR = /usr/local/lib/emacs/etc/vm
 
 ############## no user servicable parts beyond this point ###################
@@ -72,7 +65,7 @@
 
 vm:	vm.elc
 
-vm.elc:	noautoload
+vm.elc:	autoload
 
 noautoload:	$(OBJECTS) tapestry.elc
 	@echo "building vm.elc (with all modules included)..."
--- a/lisp/vm/vm-autoload.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-autoload.el	Mon Aug 13 08:57:55 2007 +0200
@@ -74,13 +74,21 @@
 to be forwarded.  See the docs for vm-reorder-message-headers
 to find out how KEEP-LIST and DISCARD-REGEXP are used.
 
-Returns the multipart boundary parameter (string) that should be used
-in the Content-Type header." nil nil)
+If ALWAYS-USE-DIGEST is non-nil, always encapsulate for a multipart/digest.
+Otherwise if there are fewer than two messages to be encapsulated
+leave off the multipart boundary strings.  The caller is assumed to
+be using message/rfc822 or message/news encoding instead.
+
+If multipart/digest encapsulation is done, the function returns
+the multipart boundary parameter (string) that should be used in
+the Content-Type header.  Otherwise nil is returned." nil nil)
 
 (autoload (quote vm-mime-burst-message) "vm-digest" "Burst messages from the digest message M.
 M should be a message struct for a real message.
-MIME encoding is expected.  The message content type
-must be either message/* or multipart/digest." nil nil)
+MIME encoding is expected.  Somewhere within the MIME layout
+there must be at least one part of type message/news, message/rfc822 or
+multipart/digest.  If there are multiple parts matching those types,
+all of them will be burst." nil nil)
 
 (autoload (quote vm-mime-burst-layout) "vm-digest" nil nil nil)
 
@@ -597,6 +605,8 @@
 
 (autoload (quote vm-start-itimers-if-needed) "vm-folder" nil nil nil)
 
+(autoload (quote vm-timer-using) "vm-folder" nil nil nil)
+
 (autoload (quote vm-check-mail-itimer-function) "vm-folder" nil nil nil)
 
 (autoload (quote vm-get-mail-itimer-function) "vm-folder" nil nil nil)
@@ -803,6 +813,8 @@
 
 (autoload (quote vm-menu-popup-url-browser-menu) "vm-menu" nil t nil)
 
+(autoload (quote vm-menu-popup-mailto-url-browser-menu) "vm-menu" nil t nil)
+
 (autoload (quote vm-menu-popup-mime-dispose-menu) "vm-menu" nil t nil)
 
 (autoload (quote vm-menu-popup-content-disposition-menu) "vm-menu" nil t nil)
@@ -1139,10 +1151,14 @@
 
 (autoload (quote vm-mm-layout-cache) "vm-mime" nil nil nil)
 
+(autoload (quote vm-mm-layout-display-error) "vm-mime" nil nil nil)
+
 (autoload (quote vm-set-mm-layout-type) "vm-mime" nil nil nil)
 
 (autoload (quote vm-set-mm-layout-cache) "vm-mime" nil nil nil)
 
+(autoload (quote vm-set-mm-layout-display-error) "vm-mime" nil nil nil)
+
 (autoload (quote vm-mm-layout) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mm-encoded-header) "vm-mime" nil nil nil)
@@ -1179,8 +1195,6 @@
 
 (autoload (quote vm-reencode-mime-encoded-words-in-string) "vm-mime" nil nil nil)
 
-(autoload (quote vm-mime-parse-content-header) "vm-mime" nil nil nil)
-
 (autoload (quote vm-mime-get-header-contents) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mime-parse-entity) "vm-mime" nil nil nil)
@@ -1247,6 +1261,8 @@
 
 (autoload (quote vm-mime-display-button-text) "vm-mime" nil nil nil)
 
+(autoload (quote vm-mime-display-internal-text/html) "vm-mime" nil nil nil)
+
 (autoload (quote vm-mime-display-internal-text/plain) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mime-display-internal-text/enriched) "vm-mime" nil nil nil)
@@ -1255,6 +1271,8 @@
 
 (autoload (quote vm-mime-display-internal-application/octet-stream) "vm-mime" nil nil nil)
 
+(autoload (quote vm-mime-display-button-application) "vm-mime" nil nil nil)
+
 (autoload (quote vm-mime-display-button-image) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mime-display-button-audio) "vm-mime" nil nil nil)
@@ -1273,6 +1291,8 @@
 
 (autoload (quote vm-mime-display-internal-multipart/digest) "vm-mime" nil nil nil)
 
+(autoload (quote vm-mime-display-button-message/rfc822) "vm-mime" nil nil nil)
+
 (autoload (quote vm-mime-display-internal-message/rfc822) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mime-display-internal-message/partial) "vm-mime" nil nil nil)
@@ -1293,7 +1313,7 @@
 
 (autoload (quote vm-mime-run-display-function-at-point) "vm-mime" nil t nil)
 
-(autoload (quote vm-mime-set-extent-glyph-for-layout) "vm-mime" nil nil nil)
+(autoload (quote vm-mime-set-extent-glyph-for-type) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mime-insert-button) "vm-mime" nil nil nil)
 
@@ -1319,6 +1339,8 @@
 
 (autoload (quote vm-mime-layout-contains-type) "vm-mime" nil nil nil)
 
+(autoload (quote vm-mime-find-digests-in-layout) "vm-mime" nil nil nil)
+
 (autoload (quote vm-mime-plain-message-p) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mime-text-type-p) "vm-mime" nil nil nil)
@@ -1394,10 +1416,14 @@
 
 (autoload (quote vm-mime-transfer-encode-layout) "vm-mime" nil nil nil)
 
-(autoload (quote vm-mime-encode-composition) "vm-mime" "MIME encode the current buffer.
+(autoload (quote vm-mime-encode-composition) "vm-mime" "MIME encode the current mail composition buffer.
 Attachment tags added to the buffer with vm-mime-attach-file are expanded
 and the approriate content-type and boundary markup information is added." t nil)
 
+(autoload (quote vm-mime-xemacs-encode-composition) "vm-mime" nil nil nil)
+
+(autoload (quote vm-mime-fsfemacs-encode-composition) "vm-mime" nil nil nil)
+
 (autoload (quote vm-mime-fragment-composition) "vm-mime" nil nil nil)
 
 (autoload (quote vm-mime-preview-composition) "vm-mime" "Show how the current composition buffer might be displayed
@@ -1408,8 +1434,6 @@
 
 (autoload (quote vm-mime-composite-type-p) "vm-mime" nil nil nil)
 
-(autoload (quote vm-mime-map-atomic-layouts) "vm-mime" nil nil nil)
-
 (autoload (quote vm-minibuffer-complete-word) "vm-minibuf" nil t nil)
 
 (autoload (quote vm-minibuffer-complete-word-and-exit) "vm-minibuf" nil t nil)
@@ -1473,6 +1497,8 @@
 
 (autoload (quote vm-parse-addresses) "vm-misc" nil nil nil)
 
+(autoload (quote vm-parse-structured-header) "vm-misc" nil nil nil)
+
 (autoload (quote vm-write-string) "vm-misc" nil nil nil)
 
 (autoload (quote vm-marker) "vm-misc" nil nil (quote macro))
@@ -1538,16 +1564,12 @@
 
 (autoload (quote vm-copy) "vm-misc" nil nil nil)
 
-(autoload (quote vm-xemacs-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-xemacs-mule-p) "vm-misc" nil nil nil)
-
-(autoload (quote vm-fsfemacs-19-p) "vm-misc" nil nil nil)
-
 (autoload (quote vm-multiple-frames-possible-p) "vm-misc" nil nil nil)
 
 (autoload (quote vm-mouse-support-possible-p) "vm-misc" nil nil nil)
 
+(autoload (quote vm-mouse-support-possible-here-p) "vm-misc" nil nil nil)
+
 (autoload (quote vm-menu-support-possible-p) "vm-misc" nil nil nil)
 
 (autoload (quote vm-toolbar-support-possible-p) "vm-misc" nil nil nil)
@@ -1624,8 +1646,12 @@
 
 (autoload (quote vm-mouse-send-url-to-netscape) "vm-mouse" nil nil nil)
 
+(autoload (quote vm-mouse-send-url-to-netscape-new-window) "vm-mouse" nil nil nil)
+
 (autoload (quote vm-mouse-send-url-to-mosaic) "vm-mouse" nil nil nil)
 
+(autoload (quote vm-mouse-send-url-to-mosaic-new-window) "vm-mouse" nil nil nil)
+
 (autoload (quote vm-mouse-install-mouse) "vm-mouse" nil nil nil)
 
 (autoload (quote vm-run-background-command) "vm-mouse" nil nil nil)
@@ -1929,10 +1955,10 @@
 The current message will be copied to a Mail mode buffer and you
 can edit the message and send it as usual.
 
-NOTE: since you are doing a resend, a Resent-To header is
-provided for you to fill in.  If you don't fill it in, when you
-send the message it will go to the original recipients listed in
-the To and Cc headers.  You may also create a Resent-Cc header." t nil)
+NOTE: since you are doing a resend, a Resent-To header is provided
+for you to fill in the new recipient list.  If you don't fill in
+this header, what happens when you send the message is undefined.
+You may also create a Resent-Cc header." t nil)
 
 (autoload (quote vm-send-digest) "vm-reply" "Send a digest of all messages in the current folder to recipients.
 The type of the digest is specified by the variable vm-digest-send-type.
@@ -2030,8 +2056,9 @@
 This command should NOT be used to save message to mail folders; use
 vm-save-message instead (normally bound to `s')." t nil)
 
-(autoload (quote vm-pipe-message-to-command) "vm-save" "Run shell command with the some or all of the current message as input.
-By default the entire message is used.
+(autoload (quote vm-pipe-message-to-command) "vm-save" "Runs a shell command with some or all of the contents of the
+current message as input.
+By default, the entire message is used.
 With one \\[universal-argument] the text portion of the message is used.
 With two \\[universal-argument]'s the header portion of the message is used.
 With three \\[universal-argument]'s the visible header portion of the message
@@ -2172,7 +2199,7 @@
 
 Prefix arg or optional second arg READ-ONLY non-nil indicates
 that the folder should be considered read only.  No attribute
-changes, messages additions or deletions will be allowed in the
+changes, message additions or deletions will be allowed in the
 visited folder.
 
 Visiting the primary inbox causes any contents of the system mailbox to
@@ -2192,7 +2219,7 @@
 
 (autoload (quote vm-mode) "vm-startup" "Major mode for reading mail.
 
-This is VM 6.22.
+This is VM 6.34.
 
 Commands:
    h - summarize folder contents
@@ -2357,6 +2384,7 @@
    vm-frame-per-composition
    vm-frame-per-edit
    vm-frame-per-folder
+   vm-frame-per-help
    vm-frame-per-summary
    vm-highlighted-header-face
    vm-highlighted-header-regexp
@@ -2455,6 +2483,7 @@
    vm-summary-thread-indent-level
    vm-tale-is-an-idiot
    vm-temp-file-directory
+   vm-toolbar-pixmap-directory
    vm-trust-From_-with-Content-Length
    vm-undisplay-buffer-hook
    vm-unforwarded-header-regexp
@@ -2503,11 +2532,17 @@
 
 (autoload (quote vm-visit-virtual-folder-other-window) "vm-startup" "Like vm-visit-virtual-folder, but run in a different window." t nil)
 
-(autoload (quote vm-mail) "vm-startup" "Send a mail message from within VM, or from without." t nil)
-
-(autoload (quote vm-mail-other-frame) "vm-startup" "Like vm-mail, but run in a newly created frame." t nil)
-
-(autoload (quote vm-mail-other-window) "vm-startup" "Like vm-mail, but run in a different window." t nil)
+(autoload (quote vm-mail) "vm-startup" "Send a mail message from within VM, or from without.
+Optional argument TO is a string that should contain a comma separated
+recipient list." t nil)
+
+(autoload (quote vm-mail-other-frame) "vm-startup" "Like vm-mail, but run in a newly created frame.
+Optional argument TO is a string that should contain a comma separated
+recipient list." t nil)
+
+(autoload (quote vm-mail-other-window) "vm-startup" "Like vm-mail, but run in a different window.
+Optional argument TO is a string that should contain a comma separated
+recipient list." t nil)
 
 (autoload (quote vm-submit-bug-report) "vm-startup" "Submit a bug report, with pertinent information to the VM bug list." t nil)
 
@@ -2795,6 +2830,14 @@
 
 (autoload (quote vm-spool-files) "vm-vars" nil nil nil)
 
+(autoload (quote vm-xemacs-p) "vm-vars" nil nil nil)
+
+(autoload (quote vm-xemacs-mule-p) "vm-vars" nil nil nil)
+
+(autoload (quote vm-fsfemacs-19-p) "vm-vars" nil nil nil)
+
+(autoload (quote vm-note-emacs-version) "vm-vars" nil nil nil)
+
 (autoload (quote vm-version) "vm-version" "Returns the value of the variable vm-version." nil nil)
 
 (autoload (quote vm-build-virtual-message-list) "vm-virtual" nil nil nil)
@@ -2888,8 +2931,6 @@
 
 (autoload (quote vm-set-window-configuration) "vm-window" nil nil nil)
 
-(autoload (quote vm-record-current-window-configuration) "vm-window" nil nil nil)
-
 (autoload (quote vm-save-window-configuration) "vm-window" "Name and save the current window configuration.
 With this command you associate the current window setup with an
 action.  Each time you perform this action VM will duplicate this
@@ -2906,11 +2947,7 @@
 configuration found is the one that is applied.
 
 The value of vm-mutable-windows must be non-nil for VM to use
-window configurations.
-
-If vm-mutable-frames is non-nil and Emacs is running under X
-windows, then VM will use all existing frames.  Otherwise VM will
-restrict its changes to the frame in which it was started." t nil)
+window configurations." t nil)
 
 (autoload (quote vm-buffer-to-label) "vm-window" nil nil nil)
 
@@ -2931,7 +2968,7 @@
 
 (autoload (quote vm-frame-loop) "vm-window" nil nil nil)
 
-(autoload (quote vm-delete-windows-or-frames-on) "vm-window" nil nil nil)
+(autoload (quote vm-maybe-delete-windows-or-frames-on) "vm-window" nil nil nil)
 
 (autoload (quote vm-replace-buffer-in-windows) "vm-window" nil nil nil)
 
--- a/lisp/vm/vm-digest.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-digest.el	Mon Aug 13 08:57:55 2007 +0200
@@ -54,7 +54,8 @@
       (goto-char (point-max))
       (insert "------- end of forwarded message -------\n"))))
 
-(defun vm-mime-encapsulate-messages (message-list keep-list discard-regexp)
+(defun vm-mime-encapsulate-messages (message-list keep-list discard-regexp
+				     always-use-digest)
   "Encapsulate the messages in MESSAGE-LIST as per the MIME spec.
 The resulting digest is inserted at point in the current buffer.
 Point is not moved.
@@ -67,14 +68,21 @@
 to be forwarded.  See the docs for vm-reorder-message-headers
 to find out how KEEP-LIST and DISCARD-REGEXP are used.
 
-Returns the multipart boundary parameter (string) that should be used
-in the Content-Type header."
+If ALWAYS-USE-DIGEST is non-nil, always encapsulate for a multipart/digest.
+Otherwise if there are fewer than two messages to be encapsulated
+leave off the multipart boundary strings.  The caller is assumed to
+be using message/rfc822 or message/news encoding instead.
+
+If multipart/digest encapsulation is done, the function returns
+the multipart boundary parameter (string) that should be used in
+the Content-Type header.  Otherwise nil is returned."
   (if message-list
       (let ((target-buffer (current-buffer))
 	    (boundary-positions nil)
 	    (mlist message-list)
 	    (mime-keep-list (append keep-list vm-mime-header-list))
-	    boundary source-buffer m start n beg)
+	    (boundary nil)
+	    source-buffer m start n beg)
 	(save-restriction
 	  ;; narrow to a zero length region to avoid interacting
 	  ;; with anything that might have already been inserted
@@ -97,42 +105,47 @@
 	     discard-regexp)
 	    (goto-char (point-max))
 	    (setq mlist (cdr mlist)))
-	  (goto-char start)
-	  (setq boundary (vm-mime-make-multipart-boundary))
-	  (while (re-search-forward (concat "^--"
-					    (regexp-quote boundary)
-					    "\\(--\\)?$")
-				    nil t)
+	  (if (and (< (length message-list) 2) (not always-use-digest))
+	      nil
+	    (goto-char start)
 	    (setq boundary (vm-mime-make-multipart-boundary))
-	    (goto-char start))
-	  (goto-char (point-max))
-	  (insert "\n--" boundary "--\n")
-	  (while boundary-positions
-	    (goto-char (car boundary-positions))
-	    (insert "\n--" boundary "\n\n")
-	    (setq boundary-positions (cdr boundary-positions)))
-	  (goto-char start)
-	  (setq n (length message-list))
-	  (insert (format "This is a %s%sMIME encapsulation.\n"
-			  (if (cdr message-list)
-			      "digest, "
-			    "forwarded message, ")
-			  (if (cdr message-list)
-			      (format "%d messages, " n)
-			    "")))
+	    (while (re-search-forward (concat "^--"
+					      (regexp-quote boundary)
+					      "\\(--\\)?$")
+				      nil t)
+	      (setq boundary (vm-mime-make-multipart-boundary))
+	      (goto-char start))
+	    (goto-char (point-max))
+	    (insert "\n--" boundary "--\n")
+	    (while boundary-positions
+	      (goto-char (car boundary-positions))
+	      (insert "\n--" boundary "\n\n")
+	      (setq boundary-positions (cdr boundary-positions)))
+	    (goto-char start)
+	    (setq n (length message-list))
+	    (insert
+	     (format "This is a digest, %d messages, MIME encapsulation.\n"
+		     n)))
 	  (goto-char start))
 	boundary )))
 
 (defun vm-mime-burst-message (m)
   "Burst messages from the digest message M.
 M should be a message struct for a real message.
-MIME encoding is expected.  The message content type
-must be either message/* or multipart/digest."
+MIME encoding is expected.  Somewhere within the MIME layout
+there must be at least one part of type message/news, message/rfc822 or
+multipart/digest.  If there are multiple parts matching those types,
+all of them will be burst."
   (let ((ident-header nil)
-	(layout (vm-mm-layout m)))
+	(did-burst nil)
+	(list (vm-mime-find-digests-in-layout (vm-mm-layout m))))
     (if vm-digest-identifier-header-format
 	(setq ident-header (vm-sprintf 'vm-digest-identifier-header-format m)))
-    (vm-mime-burst-layout layout ident-header)))
+    (while list
+      (setq did-burst (or did-burst
+			  (vm-mime-burst-layout (car list) ident-header)))
+      (setq list (cdr list)))
+    did-burst))
 
 (defun vm-mime-burst-layout (layout ident-header)
   (let ((work-buffer nil)
@@ -411,12 +424,7 @@
 			     folder-type
 			     after-prev-sep
 			     (match-beginning 0))
-			  (store-match-data md)))
-		      ;; eat preceding newlines
-		      (while (= (preceding-char) ?\n)
-			(delete-char -1))
-		      ;; put one back
-		      (insert ?\n)))
+			  (store-match-data md)))))
 	       ;; there should be at least one valid header at
 	       ;; the beginning of an encapsulated message.  If
 	       ;; there isn't a valid header, then assume that
@@ -432,14 +440,22 @@
 						    nil t))))))
 		   (setq prev-sep (point)
 			 after-prev-sep (point))
-		 ;; insert a trailing message separator
-		 ;; delete the digest separator
-		 ;; insert the leading separator
+		 ;; if this isn't the first message, delete the
+		 ;; digest separator goop and insert a trailing message
+		 ;; separator of the proper type.
 		 (if prev-sep
 		     (progn
-		       (delete-region (match-beginning 0) (match-end 0))
+		       ;; eat preceding newlines
+		       (while (= (preceding-char) ?\n)
+			 (delete-char -1))
+		       ;; put one back
+		       (insert ?\n)
+		       ;; delete the digest separator
+		       (delete-region (match-beginning 0) (point))
+		       ;; insert a trailing message separator
 		       (insert (vm-trailing-message-separator folder-type))))
 		 (setq prev-sep (point))
+		 ;; insert the leading separator
 		 (insert (vm-leading-message-separator folder-type))
 		 (setq after-prev-sep (point))
 		 ;; eat trailing newlines
@@ -599,12 +615,15 @@
       (set-buffer (vm-buffer-of m))
       (let ((layout (vm-mm-layout m)))
 	(if (and (vectorp layout)
-		 (or (vm-mime-types-match "multipart/digest"
-					  (car (vm-mm-layout-type layout)))
-		     (vm-mime-types-match "message/rfc822"
-					  (car (vm-mm-layout-type layout)))
-		     (vm-mime-types-match "message/news"
-					  (car (vm-mm-layout-type layout)))))
+		 (or (vm-mime-layout-contains-type
+		      layout
+		      "multipart/digest")
+		     (vm-mime-layout-contains-type
+		      layout
+		      "message/rfc822")
+		     (vm-mime-layout-contains-type
+		      layout
+		      "message/news")))
 	    (throw 'return-value "mime"))))
     (save-excursion
       (save-restriction
--- a/lisp/vm/vm-edit.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-edit.el	Mon Aug 13 08:57:55 2007 +0200
@@ -83,7 +83,8 @@
 	     (substitute-command-keys
 	      "Type \\[vm-edit-message-end] to end edit, \\[vm-edit-message-abort] to abort with no change.")))
 	(set-buffer edit-buf))
-      (if (and vm-frame-per-edit (vm-multiple-frames-possible-p))
+      (if (and vm-mutable-frames vm-frame-per-edit
+	       (vm-multiple-frames-possible-p))
 	  (let ((w (vm-get-buffer-window edit-buf)))
 	    (if (null w)
 		(progn
--- a/lisp/vm/vm-folder.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-folder.el	Mon Aug 13 08:57:55 2007 +0200
@@ -508,7 +508,7 @@
 		  (set-buffer temp-buffer)
 		  (if (file-readable-p file)
 		      (condition-case nil
-			  (let ((overriding-file-coding-system 'binary))
+			  (let ((coding-system-for-read 'binary))
 			    (insert-file-contents file nil 0 4096))
 			(wrong-number-of-arguments
 			 (call-process "sed" file temp-buffer nil
@@ -1166,7 +1166,7 @@
 	  (vm-total-count 0)
 	  (modulus (+ (% (vm-abs (random)) 11) 25))
 	  (case-fold-search t)
-	  data)
+	  oldpoint data)
       (while mp
 	(vm-increment vm-total-count)
 	(if (vm-attributes-of (car mp))
@@ -1182,17 +1182,28 @@
 			       (vm-text-of (car mp)) t)
 	    (goto-char (match-beginning 2))
 	    (condition-case ()
-		(setq data (read (current-buffer)))
-	      (error (setq data
-			   (list
-			    (make-vector vm-attributes-vector-length nil)
-			    (make-vector vm-cache-vector-length nil)
-			    nil))
-		     ;; In lieu of a valid attributes header
-		     ;; assume the message is new.  avoid
-		     ;; vm-set-new-flag because it asks for a
-		     ;; summary update.
-		     (vm-set-new-flag-in-vector (car data) t)))
+		(progn
+		  (setq oldpoint (point)
+			data (read (current-buffer)))
+		  (if (and (or (not (listp data)) (not (= 3 (length data))))
+			   (not (vectorp data)))
+		      (progn
+			(error "Bad x-vm-v5-data at %d in buffer %s"
+			       oldpoint (buffer-name))))
+		  data )
+	      (error 
+	       (message "Bad x-vm-v5-data header at %d in buffer %s, ignoring"
+			oldpoint (buffer-name))
+	       (setq data
+		     (list
+		      (make-vector vm-attributes-vector-length nil)
+		      (make-vector vm-cache-vector-length nil)
+		      nil))
+	       ;; In lieu of a valid attributes header
+	       ;; assume the message is new.  avoid
+	       ;; vm-set-new-flag because it asks for a
+	       ;; summary update.
+	       (vm-set-new-flag-in-vector (car data) t)))
 	    ;; support version 4 format
 	    (cond ((vectorp data)
 		   (setq data (vm-convert-v4-attributes data))
@@ -1406,8 +1417,19 @@
 	 (vm-skip-past-folder-header)
 	 (vm-skip-past-leading-message-separator)
 	 (if (re-search-forward vm-labels-header-regexp lim t)
-	     (let (list)
-	       (setq list (read (current-buffer)))
+	     (let ((oldpoint (point))
+		   list)
+	       (condition-case ()
+		   (progn
+		     (setq list (read (current-buffer)))
+		     (if (not (listp list))
+			 (error "Bad global label list at %d in buffer %s"
+				oldpoint (buffer-name)))
+		     list )
+		 (error
+		  (message "Bad global label list at %d in buffer %s, ignoring"
+			   oldpoint (buffer-name))
+		  (setq list nil) ))
 	       (mapcar (function
 			(lambda (s)
 			  (intern s vm-label-obarray)))
@@ -1418,7 +1440,8 @@
 ;; Returns non-nil if successful, nil otherwise.
 (defun vm-gobble-bookmark ()
   (let ((case-fold-search t)
-	n lim)
+	(n nil)
+	lim oldpoint)
     (save-excursion
       (vm-save-restriction
        (widen)
@@ -1431,7 +1454,18 @@
        (vm-skip-past-folder-header)
        (vm-skip-past-leading-message-separator)
        (if (re-search-forward vm-bookmark-header-regexp lim t)
-	   (setq n (read (current-buffer))))))
+	   (condition-case ()
+	       (progn
+		 (setq oldpoint (point)
+		       n (read (current-buffer)))
+		 (if (not (natnump n))
+		     (error "Bad bookmark at %d in buffer %s"
+			    oldpoint (buffer-name)))
+		 n )
+	     (error
+	      (message "Bad bookmark at %d in buffer %s, ignoring"
+		       oldpoint (buffer-name))
+	      (setq n 1))))))
     (if n
 	(vm-record-and-change-message-pointer
 	 vm-message-pointer
@@ -1490,13 +1524,25 @@
 	(vm-skip-past-folder-header)
 	(vm-skip-past-leading-message-separator)
 	(if (re-search-forward vm-message-order-header-regexp lim t)
-	    (progn
+	    (let ((oldpoint (point)))
 	      (message "Reordering messages...")
-	      (setq order (read (current-buffer))
-		    list-length (length vm-message-list)
+	      (condition-case nil
+		  (progn
+		    (setq order (read (current-buffer)))
+		    (if (not (listp order))
+			(error "Bad order header at %d in buffer %s"
+			       oldpoint (buffer-name)))
+		    order )
+		(error
+		 (message "Bad order header at %d in buffer %s, ignoring"
+			  oldpoint (buffer-name))
+		 (setq order nil)))
+	      (setq list-length (length vm-message-list)
 		    v (make-vector (max list-length (length order)) nil))
 	      (while (and order mp)
-		(aset v (1- (car order)) (car mp))
+		(condition-case nil
+		    (aset v (1- (car order)) (car mp))
+		  (args-out-of-range nil))
 		(setq order (cdr order) mp (cdr mp)))
 	      ;; lock out interrupts while the message list is in
 	      ;; an inconsistent state.
@@ -1529,8 +1575,13 @@
        (vm-skip-past-folder-header)
        (vm-skip-past-leading-message-separator)
        (if (re-search-forward vm-summary-header-regexp lim t)
-	   (progn
-	     (setq summary (read (current-buffer)))
+	   (let ((oldpoint (point)))
+	     (condition-case ()
+		 (setq summary (read (current-buffer)))
+	       (error
+		(message "Bad summary header at %d in buffer %s, ignoring"
+			 oldpoint (buffer-name))
+		(setq summary "")))
 	     (if (not (equal summary vm-summary-format))
 		 (while mp
 		   (vm-set-summary-of (car mp) nil)
@@ -2173,17 +2224,20 @@
 	   (error nil))
 	 (let (timer)
 	   (and (natnump vm-flush-interval) 
+		(not (vm-timer-using 'vm-flush-itimer-function))
 		(setq timer (run-at-time vm-flush-interval vm-flush-interval
 					 'vm-flush-itimer-function nil))
 		(timer-set-function timer 'vm-flush-itimer-function
 				    (list timer)))
 	   (and (natnump vm-mail-check-interval) 
+		(not (vm-timer-using 'vm-check-mail-itimer-function))
 		(setq timer (run-at-time vm-mail-check-interval
 					 vm-mail-check-interval
 					 'vm-check-mail-itimer-function nil))
 		(timer-set-function timer 'vm-check-mail-itimer-function
 				    (list timer)))
 	   (and (natnump vm-auto-get-new-mail)
+		(not (vm-timer-using 'vm-get-mail-itimer-function))
 		(setq timer (run-at-time vm-auto-get-new-mail
 					 vm-auto-get-new-mail
 					 'vm-get-mail-itimer-function nil))
@@ -2193,6 +2247,15 @@
 	 (setq vm-flush-interval t
 	       vm-auto-get-new-mail t))))
 
+(defun vm-timer-using (fun)
+  (let ((p timer-list)
+	(done nil))
+    (while (and p (not done))
+      (if (eq (aref (car p) 5) fun)
+	  (setq done t)
+	(setq p (cdr p))))
+    p ))
+
 ;; support for vm-mail-check-interval
 ;; if timer argument is present, this means we're using the Emacs
 ;; 'timer package rather than the 'itimer package.
@@ -2484,7 +2547,7 @@
   (if (eq major-mode 'vm-summary-mode)
       (vm-select-folder-buffer))
   (let ((pop-up-windows (and pop-up-windows (eq vm-mutable-windows t)))
-	(pop-up-frames vm-mutable-frames))
+	(pop-up-frames (and vm-mutable-frames vm-frame-per-help)))
     (cond
      ((eq last-command 'vm-help)
       (describe-function major-mode))
@@ -2499,7 +2562,7 @@
      ((eq major-mode 'mail-mode)
       (message
        (substitute-command-keys
-	"Type \\[vm-mail-send-and-exit] to send message, \\[kill-buffer] to discard this message")))
+	"Type \\[vm-mail-send-and-exit] to send message, \\[kill-buffer] to discard this composition")))
      (t (describe-mode)))))
 
 (defun vm-spool-move-mail (source destination)
@@ -2555,7 +2618,7 @@
 	     ;; enable-local-variables == nil disables them for newer Emacses
 	     (let ((inhibit-local-variables t)
 		   (enable-local-variables nil)
-		   (overriding-file-coding-system 'no-conversion))
+		   (coding-system-for-read 'no-conversion))
 	       (find-file-noselect crash-box)))
        (save-excursion
 	 (set-buffer crash-buf)
@@ -2886,7 +2949,7 @@
 	     (vm-save-restriction
 	      (widen)
 	      (goto-char (point-max))
-	      (let ((overriding-file-coding-system 'binary))
+	      (let ((coding-system-for-read 'binary))
 		(insert-file-contents folder))))
 	   (setq mcount (length vm-message-list))
 	   (if (vm-assimilate-new-messages)
--- a/lisp/vm/vm-license.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-license.el	Mon Aug 13 08:57:55 2007 +0200
@@ -21,7 +21,7 @@
   (interactive)
   (require 'info)
   (let ((pop-up-windows (eq vm-mutable-windows t))
-	(pop-up-frames vm-mutable-frames))
+	(pop-up-frames (and vm-mutable-frames vm-frame-per-help)))
     (or 
      (condition-case ()
 	 (progn (Info-goto-node "(vm)License") t)
--- a/lisp/vm/vm-mark.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-mark.el	Mon Aug 13 08:57:55 2007 +0200
@@ -23,6 +23,7 @@
   (vm-select-folder-buffer)
   (vm-check-for-killed-summary)
   (vm-error-if-folder-empty)
+  (message "Clearing all marks...")
   (let ((mp vm-message-list))
     (while mp
       (if (vm-mark-of (car mp))
@@ -32,7 +33,8 @@
       (setq mp (cdr mp))))
   (vm-display nil nil '(vm-clear-all-marks)
 	      '(vm-clear-all-marks marking-message))
-  (vm-update-summary-and-mode-line))
+  (vm-update-summary-and-mode-line)
+  (message "Clearing all marks... done"))
 
 (defun vm-mark-all-messages ()
   "Mark all messages in the current folder."
@@ -40,6 +42,7 @@
   (vm-select-folder-buffer)
   (vm-check-for-killed-summary)
   (vm-error-if-folder-empty)
+  (message "Marking all messages...")
   (let ((mp vm-message-list))
     (while mp
       (vm-set-mark-of (car mp) t)
@@ -47,7 +50,8 @@
       (setq mp (cdr mp))))
   (vm-display nil nil '(vm-mark-all-messages)
 	      '(vm-mark-all-messages marking-message))
-  (vm-update-summary-and-mode-line))
+  (vm-update-summary-and-mode-line)
+  (message "Marking all messages... done"))
 
 (defun vm-mark-message (count)
   "Mark the current message.
--- a/lisp/vm/vm-menu.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-menu.el	Mon Aug 13 08:57:55 2007 +0200
@@ -44,17 +44,29 @@
 
 (provide 'vm-menu)
 
+;; copied from vm-vars.el because vm-xemacs-p, vm-xemacs-mule-p
+;; and vm-fsfemacs-19-p are needed below at load time and
+;; vm-note-emacs-version may not be autoloadable.
+(or (fboundp 'vm-note-emacs-version)
+    (defun vm-note-emacs-version ()
+      (setq vm-xemacs-p (string-match "XEmacs" emacs-version)
+	    vm-xemacs-mule-p (and vm-xemacs-p (featurep 'mule)
+				  ;; paranoia
+				  (fboundp 'set-file-coding-system))
+	    vm-fsfemacs-19-p (not vm-xemacs-p))))
+
+;; make sure the emacs/xemacs version variables are set, as they
+;; are needed below at load time.
+(vm-note-emacs-version)
+
 (defun vm-menu-fsfemacs-menus-p ()
-  (and (vm-fsfemacs-19-p)
+  (and vm-fsfemacs-19-p
        (fboundp 'menu-bar-mode)))
 
 (defun vm-menu-xemacs-menus-p ()
-  (and (vm-xemacs-p)
+  (and vm-xemacs-p
        (fboundp 'set-buffer-menubar)))
 
-;; defined again in vm-misc.el but we need it here for some
-;; initializations.  The "noautoload" vm.elc won't work without
-;; this.
 (defun vm-fsfemacs-19-p ()
   (and (string-match "^19" emacs-version)
        (not (string-match "XEmacs\\|Lucid" emacs-version))))
@@ -67,7 +79,7 @@
 (defconst vm-menu-folder-menu
   (list
    "Folder"
-   (if (vm-fsfemacs-19-p)
+   (if vm-fsfemacs-19-p
        ["Manipulate Folders" ignore (ignore)]
      vm-menu-folders-menu)
    "---"
@@ -368,7 +380,8 @@
 	      :selected (eq vm-mime-8bit-text-transfer-encoding 'base64)]))
 	   "----"
 	   ["Attach File..."	vm-mime-attach-file vm-send-using-mime]
-	   ["Attach MIME File..." vm-mime-attach-mime-file vm-send-using-mime]
+;;	   ["Attach MIME Message..." vm-mime-attach-mime-file
+;;	    vm-send-using-mime]
 	   ["Encode MIME, But Don't Send" vm-mime-encode-composition
 	    (and vm-send-using-mime
 		 (null (vm-mail-mode-get-header-contents "MIME-Version:")))]
@@ -431,6 +444,17 @@
 					   'vm-mouse-send-url-to-netscape)
 	    t]))))
 
+(defconst vm-menu-mailto-url-browser-menu
+  (let ((title (if (vm-menu-fsfemacs-menus-p)
+		   (list "Send Mail using ..."
+			 "Send Mail using ..."
+			 "---"
+			 "---")
+		 (list "Send Mail using ..."))))
+    (append
+     title
+     (list ["VM" (vm-mouse-send-url-at-position (point) 'ignore) t]))))
+
 (defconst vm-menu-subject-menu
   (let ((title (if (vm-menu-fsfemacs-menus-p)
 		   (list "Take Action on Subject..."
@@ -532,50 +556,56 @@
   (apply command args))
 
 (defun vm-menu-can-revert-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (and (buffer-modified-p) buffer-file-name)))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(and (buffer-modified-p) buffer-file-name))
+    (error nil)))
 
 (defun vm-menu-can-recover-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (and buffer-file-name
-	 buffer-auto-save-file-name
-	 (file-newer-than-file-p
-	  buffer-auto-save-file-name
-	  buffer-file-name))))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(and buffer-file-name
+	     buffer-auto-save-file-name
+	     (file-newer-than-file-p
+	      buffer-auto-save-file-name
+	      buffer-file-name)))
+    (error nil)))
 
 (defun vm-menu-can-save-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (or (eq major-mode 'vm-virtual-mode)
-	(buffer-modified-p))))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(or (eq major-mode 'vm-virtual-mode)
+	    (buffer-modified-p)))
+    (error nil)))
 
 (defun vm-menu-can-get-new-mail-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (or (eq major-mode 'vm-virtual-mode)
-	(and (not vm-block-new-mail) (not vm-folder-read-only)))))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(or (eq major-mode 'vm-virtual-mode)
+	    (and (not vm-block-new-mail) (not vm-folder-read-only))))
+    (error nil)))
 
 (defun vm-menu-can-undo-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    vm-undo-record-list))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	vm-undo-record-list)
+    (error nil)))
 
 (defun vm-menu-can-decode-mime-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (and vm-display-using-mime
-	 vm-message-pointer
-	 vm-presentation-buffer
-	 (not vm-mime-decoded)
-	 (not (vm-mime-plain-message-p (car vm-message-pointer))))))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(and vm-display-using-mime
+	     vm-message-pointer
+	     vm-presentation-buffer
+	     (not vm-mime-decoded)
+	     (not (vm-mime-plain-message-p (car vm-message-pointer)))))
+    (error nil)))
 
 (defun vm-menu-yank-original ()
   (interactive)
@@ -665,6 +695,10 @@
 	;; url browser menu
 	(vm-easy-menu-define vm-menu-fsfemacs-url-browser-menu (list dummy) nil
 			     vm-menu-url-browser-menu)
+	;; mailto url browser menu
+	(vm-easy-menu-define vm-menu-fsfemacs-mailto-url-browser-menu
+			     (list dummy) nil
+			     vm-menu-url-browser-menu)
 	;; mime dispose menu
 	(vm-easy-menu-define vm-menu-fsfemacs-mime-dispose-menu
 			     (list dummy) nil
@@ -802,6 +836,7 @@
 
 ;; to quiet the byte-compiler
 (defvar vm-menu-fsfemacs-url-browser-menu)
+(defvar vm-menu-fsfemacs-mailto-url-browser-menu)
 (defvar vm-menu-fsfemacs-mime-dispose-menu)
 
 (defun vm-menu-goto-event (event)
@@ -811,7 +846,8 @@
 	 ;; selection.  This will cause the command loop to
 	 ;; resume which might undo what set-buffer does.
 	 (select-window (event-window event))
-	 (and (event-point event) (goto-char (event-point event))))
+	 (and (event-closest-point event)
+	      (goto-char (event-closest-point event))))
 	((vm-menu-fsfemacs-menus-p)
 	 (set-buffer (window-buffer (posn-window (event-start event))))
 	 (goto-char (posn-point (event-start event))))))
@@ -825,6 +861,15 @@
 	 (vm-menu-popup-fsfemacs-menu
 	  event vm-menu-fsfemacs-url-browser-menu))))
 
+(defun vm-menu-popup-mailto-url-browser-menu (event)
+  (interactive "e")
+  (vm-menu-goto-event event)
+  (cond ((and (vm-menu-xemacs-menus-p) vm-use-menus)
+	 (popup-menu vm-menu-mailto-url-browser-menu))
+	((and (vm-menu-fsfemacs-menus-p) vm-use-menus)
+	 (vm-menu-popup-fsfemacs-menu
+	  event vm-menu-fsfemacs-mailto-url-browser-menu))))
+
 (defun vm-menu-popup-mime-dispose-menu (event)
   (interactive "e")
   (vm-menu-goto-event event)
--- a/lisp/vm/vm-mime.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-mime.el	Mon Aug 13 08:57:55 2007 +0200
@@ -38,9 +38,12 @@
 (defun vm-mm-layout-body-end (e) (aref e 9))
 (defun vm-mm-layout-parts (e) (aref e 10))
 (defun vm-mm-layout-cache (e) (aref e 11))
+;; if display of MIME part fails, error string will be here.
+(defun vm-mm-layout-display-error (e) (aref e 12))
 
 (defun vm-set-mm-layout-type (e type) (aset e 0 type))
 (defun vm-set-mm-layout-cache (e c) (aset e 11 c))
+(defun vm-set-mm-layout-display-error (e c) (aset e 12 c))
 
 (defun vm-mm-layout (m)
   (or (vm-mime-layout-of m)
@@ -104,7 +107,7 @@
       
 (defun vm-mime-charset-decode-region (charset start end)
   (or (markerp end) (setq end (vm-marker end)))
-  (cond ((vm-xemacs-mule-p)
+  (cond (vm-xemacs-mule-p
 	 (if (eq (device-type) 'x)
 	     (let ((buffer-read-only nil)
 		   (cell (cdr (vm-string-assoc
@@ -344,7 +347,7 @@
 			 ((looking-at "\n") ; soft line break
 			  (forward-char))
 			 ((looking-at "\r")
-			  ;; assume the user's goatfucking
+			  ;; assume the user's goatloving
 			  ;; delivery software didn't convert
 			  ;; from Internet's CRLF newline
 			  ;; convention to the local LF
@@ -391,7 +394,9 @@
 		   (vm-increment cols))
 		  ((or (< char 33) (> char 126) (= char 61)
 		       (and quote-from (= cols 0) (let ((case-fold-search nil))
-						    (looking-at "From "))))
+						    (looking-at "From ")))
+		       (and (= cols 0) (= char ?.)
+			    (looking-at "\\.\\(\n\\|\\'\\)")))
 		   (vm-insert-char ?= 1 nil work-buffer)
 		   (vm-insert-char (car (rassq (lsh char -4) hex-digit-alist))
 				   1 nil work-buffer)
@@ -526,85 +531,7 @@
       (vm-with-string-as-temp-buffer string 'vm-reencode-mime-encoded-words)
     string ))
 
-(defun vm-mime-parse-content-header (string &optional sepchar keep-quotes)
-  (if (null string)
-      ()
-    (let ((work-buffer nil))
-      (save-excursion
-       (unwind-protect
-	   (let ((list nil)
-		 (nonspecials "^\"\\( \t\n\r\f")
-		 start s char sp+sepchar)
-	     (if sepchar
-		 (setq nonspecials (concat nonspecials (list sepchar))
-		       sp+sepchar (concat "\t\f\n\r " (list sepchar))))
-	     (setq work-buffer (generate-new-buffer "*vm-work*"))
-	     (buffer-disable-undo work-buffer)
-	     (set-buffer work-buffer)
-	     (insert string)
-	     (goto-char (point-min))
-	     (skip-chars-forward "\t\f\n\r ")
-	     (setq start (point))
-	     (while (not (eobp))
-	       (skip-chars-forward nonspecials)
-	       (setq char (following-char))
-	       (cond ((looking-at "[ \t\n\r\f]")
-		      (delete-char 1))
-		     ((= char ?\\)
-		      (forward-char 1)
-		      (if (not (eobp))
-			  (forward-char 1)))
-		     ((and sepchar (= char sepchar))
-		      (setq s (buffer-substring start (point)))
-		      (if (or (null (string-match "^[\t\f\n\r ]+$" s))
-			      (not (string= s "")))
-			  (setq list (cons s list)))
-		      (skip-chars-forward sp+sepchar)
-		      (setq start (point)))
-		     ((looking-at " \t\n\r\f")
-		      (skip-chars-forward " \t\n\r\f"))
-		     ((= char ?\")
-		      (let ((done nil))
-			(if keep-quotes
-			    (forward-char 1)
-			  (delete-char 1))
-			(while (not done)
-			  (if (null (re-search-forward "[\\\"]" nil t))
-			      (setq done t)
-			    (setq char (char-after (1- (point))))
-			    (cond ((char-equal char ?\\)
-				   (delete-char -1)
-				   (if (eobp)
-				       (setq done t)
-				     (forward-char 1)))
-				  (t (if (not keep-quotes)
-					 (delete-char -1))
-				     (setq done t)))))))
-		     ((= char ?\()
-		      (let ((done nil)
-			    (pos (point))
-			    (parens 1))
-			(forward-char 1)
-			(while (not done)
-			  (if (null (re-search-forward "[\\()]" nil t))
-			      (setq done t)
-			    (setq char (char-after (1- (point))))
-			    (cond ((char-equal char ?\\)
-				   (if (eobp)
-				       (setq done t)
-				     (forward-char 1)))
-				  ((char-equal char ?\()
-				   (setq parens (1+ parens)))
-				  (t
-				   (setq parens (1- parens)
-					 done (zerop parens))))))
-			(delete-region pos (point))))))
-	     (setq s (buffer-substring start (point)))
-	     (if (and (null (string-match "^[\t\f\n\r ]+$" s))
-		      (not (string= s "")))
-		 (setq list (cons s list)))
-	     (nreverse list))
-	(and work-buffer (kill-buffer work-buffer)))))))
+(fset 'vm-mime-parse-content-header 'vm-parse-structured-header)
 
 (defun vm-mime-get-header-contents (header-name-regexp)
   (let ((contents nil)
@@ -641,7 +568,9 @@
 			encoding (or (vm-get-header-contents
 				      m "Content-Transfer-Encoding:")
 				     "7bit")
-			encoding (car (vm-mime-parse-content-header encoding))
+			encoding (or (car
+				      (vm-mime-parse-content-header encoding))
+				     "7bit")
 			id (vm-get-header-contents m "Content-ID:")
 			id (car (vm-mime-parse-content-header id))
 			description (vm-get-header-contents
@@ -670,7 +599,8 @@
 		    encoding (or (vm-mime-get-header-contents
 				  "Content-Transfer-Encoding:")
 				 default-encoding)
-		    encoding (car (vm-mime-parse-content-header encoding))
+		    encoding (or (car (vm-mime-parse-content-header encoding))
+				 default-encoding)
 		    id (vm-mime-get-header-contents "Content-ID:")
 		    id (car (vm-mime-parse-content-header id))
 		    description (vm-mime-get-header-contents
@@ -745,7 +675,7 @@
 				     (narrow-to-region (point) (point-max))
 				     (vm-mime-parse-entity-safe nil c-t
 								c-t-e)))
-				  nil )))
+				  nil nil )))
 		  (t
 		   (goto-char (point-min))
 		   (or (re-search-forward "^\n\\|\n\\'" nil t)
@@ -756,7 +686,7 @@
 				  (vm-marker (point-min))
 				  (vm-marker (point))
 				  (vm-marker (point-max))
-				  nil nil ))))
+				  nil nil nil ))))
 	    (setq p (cdr type)
 		  boundary nil)
 	    (while p
@@ -803,7 +733,7 @@
 		    (vm-marker (point))
 		    (vm-marker (point-max))
 		    (nreverse multipart-list)
-		    nil )))))))
+		    nil nil )))))))
 
 (defun vm-mime-parse-entity-safe (&optional m c-t c-t-e)
   (or c-t (setq c-t '("text/plain" "charset=us-ascii")))
@@ -834,7 +764,8 @@
 	     '("attachment") '("attachment")
 	     header
 	     text
-	     text-end)))))
+	     text-end
+	     nil nil nil)))))
 
 (defun vm-mime-get-xxx-parameter (layout name param-list)
   (let ((match-end (1+ (length name)))
@@ -900,9 +831,9 @@
 	     (defvar scroll-in-place)
 	     (make-local-variable 'scroll-in-place)
 	     (setq scroll-in-place nil)
-	     (and (vm-xemacs-mule-p)
-		  (set-file-coding-system 'binary t))
-	     (cond ((vm-fsfemacs-19-p)
+	     (and vm-xemacs-mule-p
+		  (set-buffer-file-coding-system 'binary t))
+	     (cond (vm-fsfemacs-19-p
 		    ;; need to do this outside the let because
 		    ;; loading disp-table initializes
 		    ;; standard-display-table.
@@ -911,7 +842,8 @@
 			    (copy-sequence standard-display-table)))
 		      (standard-display-european t)
 		      (setq buffer-display-table standard-display-table))))
-	     (if (and vm-frame-per-folder (vm-multiple-frames-possible-p))
+	     (if (and vm-mutable-frames vm-frame-per-folder
+		      (vm-multiple-frames-possible-p))
 		 (vm-set-hooks-for-frame-deletion))
 	     (use-local-map vm-mode-map)
 	     (and (vm-toolbar-support-possible-p) vm-use-toolbar
@@ -935,6 +867,8 @@
 	(set-buffer b)
 	(widen)
 	(let ((buffer-read-only nil)
+	      ;; disable read-only text properties
+	      (inhibit-read-only t)
 	      (modified (buffer-modified-p)))
 	  (unwind-protect
 	      (progn
@@ -966,7 +900,7 @@
 (fset 'vm-presentation-mode 'vm-mode)
 (put 'vm-presentation-mode 'mode-class 'special)
 
-(defvar file-coding-system)
+(defvar buffer-file-coding-system)
 
 (defun vm-determine-proper-charset (beg end)
   (save-excursion
@@ -974,14 +908,15 @@
       (narrow-to-region beg end)
       (catch 'done
 	(goto-char (point-min))
-	(if (vm-xemacs-mule-p)
+	(if vm-xemacs-mule-p
 	    (let ((charsets (delq 'ascii (charsets-in-region beg end))))
 	      (cond ((null charsets)
 		     "us-ascii")
 		    ((cdr charsets)
 		     (or (car (cdr
-			       (assoc (coding-system-name file-coding-system)
-				      vm-mime-mule-coding-to-charset-alist)))
+			       (assq (coding-system-name
+				      buffer-file-coding-system)
+				     vm-mime-mule-coding-to-charset-alist)))
 			 "iso-2022-jp"))
 		    (t
 		     (or (car (cdr
@@ -1037,23 +972,23 @@
 (defun vm-mime-can-display-internal (layout)
   (let ((type (car (vm-mm-layout-type layout))))
     (cond ((vm-mime-types-match "image/jpeg" type)
-	   (and (vm-xemacs-p)
+	   (and vm-xemacs-p
 		(featurep 'jpeg)
 		(eq (device-type) 'x)))
 	  ((vm-mime-types-match "image/gif" type)
-	   (and (vm-xemacs-p)
+	   (and vm-xemacs-p
 		(featurep 'gif)
 		(eq (device-type) 'x)))
 	  ((vm-mime-types-match "image/png" type)
-	   (and (vm-xemacs-p)
+	   (and vm-xemacs-p
 		(featurep 'png)
 		(eq (device-type) 'x)))
 	  ((vm-mime-types-match "image/tiff" type)
-	   (and (vm-xemacs-p)
+	   (and vm-xemacs-p
 		(featurep 'tiff)
 		(eq (device-type) 'x)))
 	  ((vm-mime-types-match "audio/basic" type)
-	   (and (vm-xemacs-p)
+	   (and vm-xemacs-p
 		(or (featurep 'native-sound)
 		    (featurep 'nas-sound))
 		(or (device-sound-enabled-p)
@@ -1068,13 +1003,11 @@
 	   (let ((charset (or (vm-mime-get-parameter layout "charset")
 			      "us-ascii")))
 	     (vm-mime-charset-internally-displayable-p charset)))
-;; commented out until w3-region behavior gets worked out
-;;
-;;	  ((vm-mime-types-match "text/html" type)
-;;	   (condition-case ()
-;;	       (progn (require 'w3)
-;;		      (fboundp 'w3-region))
-;;	     (error nil)))
+	  ((vm-mime-types-match "text/html" type)
+	   (condition-case ()
+	       (progn (require 'w3)
+		      (fboundp 'w3-region))
+	     (error nil)))
 	  (t nil))))
 
 (defun vm-mime-can-convert (type)
@@ -1126,7 +1059,8 @@
 	      (vm-marker (point))
 	      (vm-marker (point-max))
 	      nil
-	      nil ))))
+	      nil
+	      nil))))
 
 (defun vm-mime-should-display-button (layout dont-honor-content-disposition)
   (if (and vm-honor-mime-content-disposition
@@ -1327,7 +1261,9 @@
 		      ;; text/plain.
 		      (vm-mime-display-internal-text/plain layout)))
 		(t (and extent (vm-mime-rewrite-failed-button
-				extent (vm-mm-layout-cache layout)))
+				extent
+				(or (vm-mm-layout-display-error layout)
+				    "no external viewer defined for type")))
 		   (vm-mime-display-internal-application/octet-stream
 		    (or extent layout))))
 	  (and extent (vm-mime-delete-button-maybe extent)))
@@ -1337,28 +1273,29 @@
 (defun vm-mime-display-button-text (layout)
   (vm-mime-display-button-xxxx layout t))
 
-;; commented out until w3-region behavior is worked out
-;;
-;;(defun vm-mime-display-internal-text/html (layout)
-;;  (let ((buffer-read-only nil)
-;;	(work-buffer nil))
-;;    (message "Inlining text/html, be patient...")
-;;    ;; w3-region is not as tame as we would like.
-;;    ;; make sure the yoke is firmly attached.
-;;    (unwind-protect
-;;	(progn
-;;	  (save-excursion
-;;	    (set-buffer (setq work-buffer
-;;			      (generate-new-buffer " *workbuf*")))
-;;	    (vm-mime-insert-mime-body layout)
-;;	    (vm-mime-transfer-decode-region layout (point-min) (point-max))
-;;	    (save-excursion
-;;	      (save-window-excursion
-;;		(w3-region (point-min) (point-max)))))
-;;	  (insert-buffer-substring work-buffer))
-;;      (and work-buffer (kill-buffer work-buffer)))
-;;    (message "Inlining text/html... done")
-;;    t ))
+(defun vm-mime-display-internal-text/html (layout)
+  (if (fboundp 'w3-region)
+      (let ((buffer-read-only nil)
+	    (work-buffer nil))
+	(message "Inlining text/html, be patient...")
+	;; w3-region is not as tame as we would like.
+	;; make sure the yoke is firmly attached.
+	(unwind-protect
+	    (progn
+	      (save-excursion
+		(set-buffer (setq work-buffer
+				  (generate-new-buffer " *workbuf*")))
+		(vm-mime-insert-mime-body layout)
+		(vm-mime-transfer-decode-region layout (point-min) (point-max))
+		(save-excursion
+		  (save-window-excursion
+		    (w3-region (point-min) (point-max)))))
+	      (insert-buffer-substring work-buffer))
+	  (and work-buffer (kill-buffer work-buffer)))
+	(message "Inlining text/html... done")
+	t )
+    (vm-set-mm-layout-display-error layout "Need W3 to inline HTML")
+    nil ))
 
 (defun vm-mime-display-internal-text/plain (layout &optional no-highlighting)
   (let ((start (point)) end old-size
@@ -1366,7 +1303,7 @@
 	(charset (or (vm-mime-get-parameter layout "charset") "us-ascii")))
     (if (not (vm-mime-charset-internally-displayable-p charset))
 	(progn
-	  (vm-set-mm-layout-cache
+	  (vm-set-mm-layout-display-error
 	   layout (concat "Undisplayable charset: " charset))
 	  nil)
       (vm-mime-insert-mime-body layout)
@@ -1403,11 +1340,13 @@
 (defun vm-mime-display-external-generic (layout)
   (let ((program-list (vm-mime-find-external-viewer
 		       (car (vm-mm-layout-type layout))))
-	(process (nth 0 (vm-mm-layout-cache layout)))
-	(tempfile (nth 1 (vm-mm-layout-cache layout)))
 	(buffer-read-only nil)
 	(start (point))
-	end)
+	process	tempfile cache end)
+    (setq cache (cdr (assq 'vm-mime-display-external-generic
+			   (vm-mm-layout-cache layout)))
+	  process (nth 0 cache)
+	  tempfile (nth 1 cache))
     (if (and (processp process) (eq (process-status process) 'run))
 	t
       (cond ((or (null tempfile) (null (file-exists-p tempfile)))
@@ -1416,15 +1355,20 @@
 	     (vm-mime-transfer-decode-region layout start end)
 	     (setq tempfile (vm-make-tempfile-name))
 	     (let ((buffer-file-type buffer-file-type)
-		   file-coding-system)
+		   buffer-file-coding-system)
 	       ;; Tell DOS/Windows NT whether the file is binary
 	       (setq buffer-file-type (not (vm-mime-text-type-p layout)))
 	       ;; Tell XEmacs/MULE not to mess with the bits unless
 	       ;; this is a text type.
-	       (if (vm-xemacs-mule-p)
+	       (if vm-xemacs-mule-p
 		   (if (vm-mime-text-type-p layout)
-		       (set-file-coding-system 'no-conversion nil)
-		     (set-file-coding-system 'binary t)))
+		       (set-buffer-file-coding-system 'no-conversion nil)
+		     (set-buffer-file-coding-system 'binary t)))
+               ;; Write an empty tempfile out to disk and set its
+               ;; permissions to 0600, then write the actual buffer
+               ;; contents to tempfile.
+               (write-region start start tempfile nil 0)
+               (set-file-modes tempfile 384)
 	       (write-region start end tempfile nil 0))
 	     (delete-region start end)
 	     (save-excursion
@@ -1446,7 +1390,11 @@
 	(setq vm-message-garbage-alist
 	      (cons (cons process 'delete-process)
 		    vm-message-garbage-alist)))
-      (vm-set-mm-layout-cache layout (list process tempfile))))
+      (vm-set-mm-layout-cache
+       layout
+       (nconc (vm-mm-layout-cache layout)
+	      (list (cons 'vm-mime-display-external-generic
+			  (list process tempfile)))))))
   t )
 
 (defun vm-mime-display-internal-application/octet-stream (layout)
@@ -1456,7 +1404,7 @@
 	(vm-mime-insert-button
 	 (format "%-35.35s [%s to save to a file]"
 		 (vm-mime-layout-description layout)
-		 (if (vm-mouse-support-possible-p)
+		 (if (vm-mouse-support-possible-here-p)
 		     "Click mouse-2"
 		   "Press RETURN"))
 	 (function
@@ -1475,9 +1423,12 @@
 	      (vm-mime-get-parameter layout "name"))))
       (vm-mime-send-body-to-file layout default-filename)))
   t )
-(fset 'vm-mime-display-button-application
+(fset 'vm-mime-display-button-application/octet-stream
       'vm-mime-display-internal-application/octet-stream)
 
+(defun vm-mime-display-button-application (layout)
+  (vm-mime-display-button-xxxx layout nil))
+
 (defun vm-mime-display-button-image (layout)
   (vm-mime-display-button-xxxx layout t))
 
@@ -1540,7 +1491,7 @@
   (vm-mime-insert-button
    (format "%-35.35s [%s to display in parallel]"
 	   (vm-mime-layout-description layout)
-	   (if (vm-mouse-support-possible-p)
+	   (if (vm-mouse-support-possible-here-p)
 	       "Click mouse-2"
 	     "Press RETURN"))
    (function
@@ -1559,7 +1510,7 @@
 	(vm-mime-insert-button
 	 (format "%-35.35s [%s to display]"
 		 (vm-mime-layout-description layout)
-		 (if (vm-mouse-support-possible-p)
+		 (if (vm-mouse-support-possible-here-p)
 		     "Click mouse-2"
 		   "Press RETURN"))
 	 (function
@@ -1586,20 +1537,36 @@
 (fset 'vm-mime-display-button-multipart/digest
       'vm-mime-display-internal-multipart/digest)
 
+(defun vm-mime-display-button-message/rfc822 (layout)
+  (let ((buffer-read-only nil))
+    (vm-mime-insert-button
+     (format "%-35.35s [%s to display]"
+	     (vm-mime-layout-description layout)
+	     (if (vm-mouse-support-possible-here-p)
+		 "Click mouse-2"
+	       "Press RETURN"))
+     (function
+      (lambda (layout)
+	(save-excursion
+	  (vm-mime-display-internal-message/rfc822 layout))))
+     layout nil)))
+(fset 'vm-mime-display-button-message/news
+      'vm-mime-display-button-message/rfc822)
+
 (defun vm-mime-display-internal-message/rfc822 (layout)
   (if (vectorp layout)
-      (let ((buffer-read-only nil))
-	(vm-mime-insert-button
-	 (format "%-35.35s [%s to display]"
-		 (vm-mime-layout-description layout)
-		 (if (vm-mouse-support-possible-p)
-		     "Click mouse-2"
-		   "Press RETURN"))
-	 (function
-	  (lambda (layout)
-	    (save-excursion
-	      (vm-mime-display-internal-message/rfc822 layout))))
-	 layout nil))
+      (let ((start (point))
+	    (buffer-read-only nil))
+	(vm-mime-insert-mime-headers (car (vm-mm-layout-parts layout)))
+	(insert ?\n)
+	(save-excursion
+	  (goto-char start)
+	  (vm-reorder-message-headers nil vm-visible-headers
+				      vm-invisible-header-regexp))
+	(save-restriction
+	  (narrow-to-region start (point))
+	  (vm-decode-mime-encoded-words))
+	(vm-mime-display-internal-multipart/mixed layout))
     (goto-char (vm-extent-start-position layout))
     (setq layout (vm-extent-property layout 'vm-mime-layout))
     (set-buffer (generate-new-buffer
@@ -1618,8 +1585,6 @@
     (vm-display (or vm-presentation-buffer (current-buffer)) t
 		(list this-command) '(vm-mode startup)))
   t )
-(fset 'vm-mime-display-button-message/rfc822
-      'vm-mime-display-internal-message/rfc822)
 (fset 'vm-mime-display-internal-message/news
       'vm-mime-display-internal-message/rfc822)
 
@@ -1633,7 +1598,7 @@
 		 (concat (vm-mime-layout-description layout)
 			 (and number (concat ", part " number))
 			 (and number total (concat " of " total)))
-		 (if (vm-mouse-support-possible-p)
+		 (if (vm-mouse-support-possible-here-p)
 		     "Click mouse-2"
 		   "Press RETURN"))
 	 (function
@@ -1758,28 +1723,45 @@
       'vm-mime-display-internal-message/partial)
 
 (defun vm-mime-display-internal-image-xxxx (layout feature name)
-  (if (and (vm-xemacs-p)
+  (if (and vm-xemacs-p
 	   (featurep feature)
 	   (eq (device-type) 'x))
       (let ((start (point)) end tempfile g e
 	    (buffer-read-only nil))
-	(if (vm-mm-layout-cache layout)
-	    (setq g (vm-mm-layout-cache layout))
+	(if (setq g (cdr (assq 'vm-mime-display-internal-image-xxxx
+			       (vm-mm-layout-cache layout))))
+	    nil
 	  (vm-mime-insert-mime-body layout)
 	  (setq end (point-marker))
 	  (vm-mime-transfer-decode-region layout start end)
 	  (setq tempfile (vm-make-tempfile-name))
-	  ;; coding system for presentation buffer is binary
+	  ;; Write an empty tempfile out to disk and set its
+	  ;; permissions to 0600, then write the actual buffer
+	  ;; contents to tempfile.
+	  (write-region start start tempfile nil 0)
+	  (set-file-modes tempfile 384)
+	  ;; coding system for presentation buffer is binary so
+	  ;; we don't need to set it here.
 	  (write-region start end tempfile nil 0)
 	  (message "Creating %s glyph..." name)
 	  (setq g (make-glyph
-		   (list (vector feature ':file tempfile)
-			 (vector 'string
-				 ':data
-				 (format "[Unknown %s image encoding]\n"
-					 name)))))
+		   (list
+		    (cons (list 'win)
+			  (vector feature ':file tempfile))
+		    (cons (list 'win)
+			  (vector 'string
+				  ':data
+				  (format "[Unknown/Bad %s image encoding]\n"
+					  name)))
+		    (cons nil
+			  (vector 'string
+				  ':data
+				  (format "[%s image]\n" name))))))
 	  (message "")
-	  (vm-set-mm-layout-cache layout g)
+	  (vm-set-mm-layout-cache
+	   layout
+	   (nconc (vm-mm-layout-cache layout)
+		  (list (cons 'vm-mime-display-internal-image-xxxx g))))
 	  (save-excursion
 	    (vm-select-folder-buffer)
 	    (setq vm-folder-garbage-alist
@@ -1806,7 +1788,7 @@
   (vm-mime-display-internal-image-xxxx layout 'tiff "TIFF"))
 
 (defun vm-mime-display-internal-audio/basic (layout)
-  (if (and (vm-xemacs-p)
+  (if (and vm-xemacs-p
 	   (or (featurep 'native-sound)
 	       (featurep 'nas-sound))
 	   (or (device-sound-enabled-p)
@@ -1815,15 +1797,26 @@
 		    (eq (device-type) 'x))))
       (let ((start (point)) end tempfile
 	    (buffer-read-only nil))
-	(if (vm-mm-layout-cache layout)
-	    (setq tempfile (vm-mm-layout-cache layout))
+	(if (setq tempfile (cdr (assq 'vm-mime-display-internal-audio/basic
+				      (vm-mm-layout-cache layout))))
+	    nil
 	  (vm-mime-insert-mime-body layout)
 	  (setq end (point-marker))
 	  (vm-mime-transfer-decode-region layout start end)
 	  (setq tempfile (vm-make-tempfile-name))
-	  ;; coding system for presentation buffer is binary
+	  ;; Write an empty tempfile out to disk and set its
+	  ;; permissions to 0600, then write the actual buffer
+	  ;; contents to tempfile.
+	  (write-region start start tempfile nil 0)
+	  (set-file-modes tempfile 384)
+	  ;; coding system for presentation buffer is binary, so
+	  ;; we don't need to set it here.
 	  (write-region start end tempfile nil 0)
-	  (vm-set-mm-layout-cache layout tempfile)
+	  (vm-set-mm-layout-cache
+	   layout
+	   (nconc (vm-mm-layout-cache layout)
+		  (list (cons 'vm-mime-display-internal-audio/basic
+			      tempfile))))
 	  (save-excursion
 	    (vm-select-folder-buffer)
 	    (setq vm-folder-garbage-alist
@@ -1839,9 +1832,11 @@
 (defun vm-mime-display-button-xxxx (layout disposable)
   (let ((description (vm-mime-layout-description layout)))
     (vm-mime-insert-button
-     (format "%-35.35s [%s to display]"
+     (format "%-35.35s [%s to attempt display]"
 	     description
-	     (if (vm-mouse-support-possible-p) "Click mouse-2" "Press RETURN"))
+	     (if (vm-mouse-support-possible-here-p)
+		 "Click mouse-2"
+	       "Press RETURN"))
      (function
       (lambda (layout)
 	(save-excursion
@@ -1856,7 +1851,7 @@
   ;; drag window point along, to a place arbitrarily far from
   ;; where it was when the user triggered the button.
   (save-excursion
-    (cond ((vm-fsfemacs-19-p)
+    (cond (vm-fsfemacs-19-p
 	   (let (o-list o (found nil))
 	     (setq o-list (overlays-at (point)))
 	     (while (and o-list (not found))
@@ -1866,7 +1861,7 @@
 							 'vm-mime-function))
 			       (car o-list))))
 	       (setq o-list (cdr o-list)))))
-	  ((vm-xemacs-p)
+	  (vm-xemacs-p
 	   (let ((e (extent-at (point) nil 'vm-mime-layout)))
 	     (funcall (or function (extent-property e 'vm-mime-function))
 		      e))))))
@@ -1874,42 +1869,40 @@
 ;; for the karking compiler
 (defvar vm-menu-mime-dispose-menu)
 
-(defun vm-mime-set-extent-glyph-for-layout (e layout)
-  (if (and (vm-xemacs-p) (fboundp 'make-glyph)
-	   (eq (device-type) 'x) (> (device-bitplanes) 15))
-      (let ((type (car (vm-mm-layout-type layout)))
-	    (dir vm-image-directory)
-	    glyph)
-	(setq glyph
-	      (cond ((vm-mime-types-match "text" type)
-		     (make-glyph (vector
-				  'xpm ':file
-				  (expand-file-name "document.xpm" dir))))
-		    ((vm-mime-types-match "image" type)
-		     (make-glyph (vector
-				  'gif ':file
-				  (expand-file-name "mona_stamp.gif" dir))))
-		    ((vm-mime-types-match "audio" type)
-		     (make-glyph (vector
-				  'xpm ':file
-				  (expand-file-name "audio_stamp.xpm" dir))))
-		    ((vm-mime-types-match "video" type)
-		     (make-glyph (vector
-				  'xpm ':file
-				  (expand-file-name "film.xpm" dir))))
-		    ((vm-mime-types-match "message" type)
-		     (make-glyph (vector
-				  'xpm ':file
-				  (expand-file-name "message.xpm" dir))))
-		    ((vm-mime-types-match "application" type)
-		     (make-glyph (vector
-				  'xpm ':file
-				  (expand-file-name "gear.xpm" dir))))
-		    ((vm-mime-types-match "multipart" type)
-		     (make-glyph (vector
-				  'xpm ':file
-				  (expand-file-name "stuffed_box.xpm" dir))))
-		    (t nil)))
+(defun vm-mime-set-extent-glyph-for-type (e type)
+  (if (and vm-xemacs-p
+	   (featurep 'xpm)
+	   (eq (device-type) 'x)
+	   (> (device-bitplanes) 7))
+      (let ((dir vm-image-directory)
+	    (colorful (> (device-bitplanes) 15))
+	    (tuples
+	     '(("text" "document-simple.xpm" "document-colorful.xpm")
+	       ("image" "mona_stamp-simple.xpm" "mona_stamp-colorful.xpm")
+	       ("audio" "audio_stamp-simple.xpm" "audio_stamp-colorful.xpm")
+	       ("video" "film-simple.xpm" "film-colorful.xpm")
+	       ("message" "message-simple.xpm" "message-colorful.xpm")
+	       ("application" "gear-simple.xpm" "gear-colorful.xpm")
+	       ("multipart" "stuffed_box-simple.xpm"
+		"stuffed_box-colorful.xpm")))
+	    glyph file sym p)
+	(setq file (catch 'done
+		     (while tuples
+		       (if (vm-mime-types-match (car (car tuples)) type)
+			   (throw 'done (car tuples))
+			 (setq tuples (cdr tuples))))
+		     nil)
+	      file (and file (if colorful (nth 2 file) (nth 1 file)))
+	      sym (and file (intern file vm-image-obarray))
+	      glyph (and sym (boundp sym) (symbol-value sym))
+	      glyph (or glyph
+			(and file
+			     (make-glyph
+			      (list
+			       (vector 'xpm ':file
+				       (expand-file-name file dir))
+			       [nothing])))))
+	(and sym (not (boundp sym)) (set sym glyph))
 	(and glyph (set-extent-begin-glyph e glyph)))))
 
 (defun vm-mime-insert-button (caption action layout disposable)
@@ -1926,16 +1919,18 @@
     (if (not (bolp))
 	(insert "\n"))
     (insert caption "\n")
-    ;; we MUST have the five arg make-overlay.  overlays must
-    ;; advance when text is inserted at their start position or
-    ;; inline text and graphics will seep into the button
-    ;; overlay and then be removed when the button is removed.
-    (if (fboundp 'make-overlay)
+    ;; we must use the same interface that the vm-extent functions
+    ;; use.  if they use overlays, then we call make-overlay.
+    (if (eq (symbol-function 'vm-make-extent) 'make-overlay)
+	;; we MUST have the five arg make-overlay.  overlays must
+	;; advance when text is inserted at their start position or
+	;; inline text and graphics will seep into the button
+	;; overlay and then be removed when the button is removed.
 	(setq e (make-overlay start (point) nil t nil))
       (setq e (make-extent start (point)))
       (set-extent-property e 'start-open t)
       (set-extent-property e 'end-open t))
-    (vm-mime-set-extent-glyph-for-layout e layout)
+    (vm-mime-set-extent-glyph-for-type e (car (vm-mm-layout-type layout)))
     ;; for emacs
     (vm-set-extent-property e 'mouse-face 'highlight)
     (vm-set-extent-property e 'local-map keymap)
@@ -1953,7 +1948,7 @@
   (let* ((buffer-read-only nil)
 	 (start (point)))
     (goto-char (vm-extent-start-position button))
-    (insert (format "DISPLAY FAILED -- %s" error-string))
+    (insert (format "DISPLAY FAILED -- %s\n" error-string))
     (vm-set-extent-endpoints button start (vm-extent-end-position button))
     (delete-region (point) (vm-extent-end-position button))))
 
@@ -2000,10 +1995,10 @@
 	    (setq buffer-file-type (not (vm-mime-text-type-p layout)))
 	    ;; Tell XEmacs/MULE not to mess with the bits unless
 	    ;; this is a text type.
-	    (if (vm-xemacs-mule-p)
+	    (if vm-xemacs-mule-p
 		(if (vm-mime-text-type-p layout)
-		    (set-file-coding-system 'no-conversion nil)
-		  (set-file-coding-system 'binary t)))
+		    (set-buffer-file-coding-system 'no-conversion nil)
+		  (set-buffer-file-coding-system 'binary t)))
 	    (vm-mime-insert-mime-body layout)
 	    (vm-mime-transfer-decode-region layout (point-min) (point-max))
 	    (or (not (file-exists-p file))
@@ -2144,6 +2139,24 @@
 	    (setq done t)
 	  (setq p (cdr p))))
       result )))
+
+;; breadth first traversal
+(defun vm-mime-find-digests-in-layout (layout)
+  (let ((layout-list (list layout))
+	layout-type
+	(result nil))
+    (while layout-list
+      (setq layout-type (car (vm-mm-layout-type (car layout-list))))
+      (cond ((string-match "^multipart/digest\\|message/\\(rfc822\\|news\\)"
+			   layout-type)
+	     (setq result (nconc result (list (car layout-list)))))
+	    ((vm-mime-composite-type-p layout-type)
+	     (setq layout-list (nconc layout-list
+				      (copy-sequence
+				       (vm-mm-layout-parts
+					(car layout-list)))))))
+      (setq layout-list (cdr layout-list)))
+    result ))
   
 (defun vm-mime-plain-message-p (m)
   (save-match-data
@@ -2164,7 +2177,7 @@
       (vm-mime-types-match "message" (car (vm-mm-layout-type layout)))))
 
 (defun vm-mime-charset-internally-displayable-p (name)
-  (cond ((and (vm-xemacs-mule-p) (eq (device-type) 'x))
+  (cond ((and vm-xemacs-mule-p (eq (device-type) 'x))
 	 (vm-string-assoc name vm-mime-mule-charset-to-coding-alist))
 	((vm-multiple-fonts-possible-p)
 	 (or (vm-string-member name vm-mime-default-face-charsets)
@@ -2199,7 +2212,7 @@
     (car mp)))
 
 (defun vm-mime-make-multipart-boundary ()
-  (let ((boundary (make-string 40 ?a))
+  (let ((boundary (make-string 10 ?a))
 	(i 0))
     (random t)
     (while (< i (length boundary))
@@ -2330,7 +2343,7 @@
 					    (file-name-nondirectory object)
 					    "\"")))))
       (setq disposition (list "unspecified")))
-    (cond ((vm-fsfemacs-19-p)
+    (cond (vm-fsfemacs-19-p
 	   (put-text-property start end 'front-sticky nil)
 	   (put-text-property start end 'rear-nonsticky t)
 ;; can't be intangible because menu clicking at a position needs
@@ -2345,38 +2358,39 @@
 	   (put-text-property start end 'vm-mime-disposition disposition)
 	   (put-text-property start end 'vm-mime-encoded mimed)
 	   (put-text-property start end 'vm-mime-object object))
-	  ((fboundp 'make-extent)
+	  (vm-xemacs-p
 	   (setq e (make-extent start end))
+	   (vm-mime-set-extent-glyph-for-type e (or type "text/plain"))
 	   (set-extent-property e 'start-open t)
 	   (set-extent-property e 'face vm-mime-button-face)
-	   (vm-set-extent-property e 'duplicable t)
+	   (set-extent-property e 'duplicable t)
 	   (let ((keymap (make-sparse-keymap)))
 	     (if vm-popup-menu-on-mouse-3
 		 (define-key keymap 'button3
 		   'vm-menu-popup-content-disposition-menu))
-	     (vm-set-extent-property e 'keymap keymap)
+	     (set-extent-property e 'keymap keymap)
 	     (set-extent-property e 'balloon-help 'vm-mouse-3-help))
-	   (vm-set-extent-property e 'vm-mime-type type)
-	   (vm-set-extent-property e 'vm-mime-object object)
-	   (vm-set-extent-property e 'vm-mime-parameters params)
-	   (vm-set-extent-property e 'vm-mime-description description)
-	   (vm-set-extent-property e 'vm-mime-disposition disposition)
-	   (vm-set-extent-property e 'vm-mime-encoded mimed)))))
+	   (set-extent-property e 'vm-mime-type type)
+	   (set-extent-property e 'vm-mime-object object)
+	   (set-extent-property e 'vm-mime-parameters params)
+	   (set-extent-property e 'vm-mime-description description)
+	   (set-extent-property e 'vm-mime-disposition disposition)
+	   (set-extent-property e 'vm-mime-encoded mimed)))))
 
 (defun vm-mime-attachment-disposition-at-point ()
-  (cond ((vm-fsfemacs-19-p)
+  (cond (vm-fsfemacs-19-p
 	 (let ((disp (get-text-property (point) 'vm-mime-disposition)))
 	   (intern (car disp))))
-	((vm-xemacs-p)
+	(vm-xemacs-p
 	 (let* ((e (extent-at (point) nil 'vm-mime-disposition))
 		(disp (extent-property e 'vm-mime-disposition)))
 	   (intern (car disp))))))
 
 (defun vm-mime-set-attachment-disposition-at-point (sym)
-  (cond ((vm-fsfemacs-19-p)
+  (cond (vm-fsfemacs-19-p
 	 (let ((disp (get-text-property (point) 'vm-mime-disposition)))
 	   (setcar disp (symbol-name sym))))
-	((vm-xemacs-p)
+	(vm-xemacs-p
 	 (let* ((e (extent-at (point) nil 'vm-mime-disposition))
 		(disp (extent-property e 'vm-mime-disposition)))
 	   (setcar disp (symbol-name sym))))))
@@ -2447,11 +2461,16 @@
 			 (let ((case-fold-search nil))
 			   (save-excursion
 			     (goto-char beg)
-			     (re-search-forward "^From " nil t))))))
+			     (re-search-forward "^From " nil t)))))
+	(armor-dot (let ((case-fold-search nil))
+		     (save-excursion
+		       (goto-char beg)
+		       (re-search-forward "^\\.\\n" nil t)))))
     (cond ((string-match "^binary$" encoding)
 	   (vm-mime-base64-encode-region beg end crlf)
 	   (setq encoding "base64"))
-	  ((and (not armor-from) (string-match "^7bit$" encoding)) t)
+	  ((and (not armor-from) (not armor-dot)
+		(string-match "^7bit$" encoding)) t)
 	  ((string-match "^base64$" encoding) t)
 	  ((string-match "^quoted-printable$" encoding) t)
 	  ((eq vm-mime-8bit-text-transfer-encoding 'quoted-printable)
@@ -2465,21 +2484,72 @@
     encoding ))
 
 (defun vm-mime-transfer-encode-layout (layout)
-  (if (vm-mime-text-type-p layout)
-      (vm-mime-transfer-encode-region (vm-mm-layout-encoding layout)
-				      (vm-mm-layout-body-start layout)
-				      (vm-mm-layout-body-end layout)
-				      t)
-    (vm-mime-transfer-encode-region (vm-mm-layout-encoding layout)
-				    (vm-mm-layout-body-start layout)
-				    (vm-mm-layout-body-end layout)
-				    nil)))
+  (let ((list (vm-mm-layout-parts layout))
+	(type (car (vm-mm-layout-type layout)))
+	(encoding "7bit")
+	(vm-mime-8bit-text-transfer-encoding
+	 vm-mime-8bit-text-transfer-encoding))
+  (cond ((vm-mime-composite-type-p type)
+	 ;; MIME messages of type "message" and
+	 ;; "multipart" are required to have a non-opaque
+	 ;; content transfer encoding.  This means that
+	 ;; if the user only wants to send out 7bit data,
+	 ;; then any subpart that contains 8bit data must
+	 ;; have an opaque (qp or base64) 8->7bit
+	 ;; conversion performed on it so that the
+	 ;; enclosing entity can use a non-opaque
+	 ;; encoding.
+	 ;;
+	 ;; message/partial requires a "7bit" encoding so
+	 ;; force 8->7 conversion in that case.
+	 (cond ((memq vm-mime-8bit-text-transfer-encoding
+		      '(quoted-printable base64))
+		t)
+	       ((vm-mime-types-match "message/partial" type)
+		(setq vm-mime-8bit-text-transfer-encoding
+		      'quoted-printable)))
+	 (while list
+	   (if (equal (vm-mime-transfer-encode-layout (car list)) "8bit")
+	       (setq encoding "8bit"))
+	   (setq list (cdr list))))
+	(t
+	 (if (and (vm-mime-types-match "message/partial" type)
+		  (not (memq vm-mime-8bit-text-transfer-encoding
+			     '(quoted-printable base64))))
+		(setq vm-mime-8bit-text-transfer-encoding
+		      'quoted-printable))
+	 (setq encoding
+	       (vm-mime-transfer-encode-region (vm-mm-layout-encoding layout)
+					       (vm-mm-layout-body-start layout)
+					       (vm-mm-layout-body-end layout)
+					       (vm-mime-text-type-p layout)))))
+  (save-excursion
+    (save-restriction
+      (goto-char (vm-mm-layout-header-start layout))
+      (narrow-to-region (point) (vm-mm-layout-body-start layout))
+      (vm-reorder-message-headers nil nil "Content-Transfer-Encoding:")
+      (if (not (equal encoding "7bit"))
+	  (insert "CONTENT-TRANSFER-ENCODING: " encoding "\n"))
+      encoding ))))
 
 (defun vm-mime-encode-composition ()
- "MIME encode the current buffer.
+ "MIME encode the current mail composition buffer.
 Attachment tags added to the buffer with vm-mime-attach-file are expanded
 and the approriate content-type and boundary markup information is added."
   (interactive)
+  (cond (vm-xemacs-mule-p
+	 (vm-mime-xemacs-encode-composition))
+	(vm-xemacs-p
+	 (vm-mime-xemacs-encode-composition))
+	(vm-fsfemacs-19-p
+	 (vm-mime-fsfemacs-encode-composition))
+	(t
+	 (error "don't know how to MIME encode composition for %s"
+		(emacs-version)))))
+
+(defvar enriched-mode)
+
+(defun vm-mime-xemacs-encode-composition ()
   (save-restriction
     (widen)
     (if (not (eq major-mode 'mail-mode))
@@ -2489,21 +2559,20 @@
     (let ((8bit nil)
 	  (just-one nil)
 	  (boundary-positions nil)
+	  (enriched (and (boundp 'enriched-mode) enriched-mode))
 	  already-mimed layout e e-list boundary
 	  type encoding charset params description disposition object
 	  opoint-min)
       (mail-text)
-      (setq e-list (if (fboundp 'extent-list)
-		       (extent-list nil (point) (point-max))
-		     (vm-mime-fake-attachment-overlays (point) (point-max)))
+      (setq e-list (extent-list nil (point) (point-max))
 	    e-list (vm-delete (function
 			       (lambda (e)
-				 (vm-extent-property e 'vm-mime-object)))
+				 (extent-property e 'vm-mime-object)))
 			      e-list t)
 	    e-list (sort e-list (function
 				 (lambda (e1 e2)
-				   (< (vm-extent-end-position e1)
-				      (vm-extent-end-position e2))))))
+				   (< (extent-end-position e1)
+				      (extent-end-position e2))))))
       ;; If there's just one attachment and no other readable
       ;; text in the buffer then make the message type just be
       ;; the attachment type rather than sending a multipart
@@ -2511,18 +2580,22 @@
       (setq just-one (and (= (length e-list) 1)
 			  (looking-at "[ \t\n]*")
 			  (= (match-end 0)
-			     (vm-extent-start-position (car e-list)))
+			     (extent-start-position (car e-list)))
 			  (save-excursion
-			    (goto-char (vm-extent-end-position (car e-list)))
+			    (goto-char (extent-end-position (car e-list)))
 			    (looking-at "[ \t\n]*\\'"))))
       (if (null e-list)
 	  (progn
 	    (narrow-to-region (point) (point-max))
+	    ;; support enriched-mode for text/enriched composition
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (enriched-encode (point-min) (point-max))))
 	    (setq charset (vm-determine-proper-charset (point-min)
 						       (point-max)))
-	    (if (vm-xemacs-mule-p)
+	    (if vm-xemacs-mule-p
 		(encode-coding-region (point-min) (point-max)
-				      file-coding-system))
+				      buffer-file-coding-system))
 	    (setq encoding (vm-determine-proper-content-transfer-encoding
 			    (point-min)
 			    (point-max))
@@ -2536,16 +2609,24 @@
 	    (vm-reorder-message-headers
 	     nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)")
 	    (insert "MIME-Version: 1.0\n")
-	    (insert "Content-Type: text/plain; charset=" charset "\n")
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
 	    (insert "Content-Transfer-Encoding: " encoding "\n")
 	    (vm-add-mail-mode-header-separator))
 	(while e-list
 	  (setq e (car e-list))
-	  (if (or just-one (= (point) (vm-extent-start-position e)))
+	  (if (or just-one (= (point) (extent-start-position e)))
 	      nil
-	    (narrow-to-region (point) (vm-extent-start-position e))
+	    (narrow-to-region (point) (extent-start-position e))
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (enriched-encode (point-min) (point-max))))
 	    (setq charset (vm-determine-proper-charset (point-min)
 						       (point-max)))
+	    (if vm-xemacs-mule-p
+		(encode-coding-region (point-min) (point-max)
+				      buffer-file-coding-system))
 	    (setq encoding (vm-determine-proper-content-transfer-encoding
 			    (point-min)
 			    (point-max))
@@ -2554,61 +2635,49 @@
 							   (point-max)
 							   t))
 	    (setq boundary-positions (cons (point-marker) boundary-positions))
-	    (insert "Content-Type: text/plain; charset=" charset "\n")
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
 	    (insert "Content-Transfer-Encoding: " encoding "\n\n")
 	    (widen))
-	  (goto-char (vm-extent-start-position e))
+	  (goto-char (extent-start-position e))
 	  (narrow-to-region (point) (point))
-	  (setq object (vm-extent-property e 'vm-mime-object))
+	  (setq object (extent-property e 'vm-mime-object))
 	  ;; insert the object
 	  (cond ((bufferp object)
-		 (if (vm-xemacs-p)
-		     (insert-buffer-substring object)
-		   ;; as of FSF Emacs 19.34, even with the hooks
-		   ;; we've attached to the attachment overlays,
-		   ;; text STILL can be inserted into them when
-		   ;; font-lock is enabled.  Explaining why is
-		   ;; beyond the scope of this comment and I
-		   ;; don't know the answer anyway.  This works
-		   ;; to prevent it.
-		   (insert-before-markers " ")
-		   (forward-char -1)
-		   (insert-buffer-substring object)
-		   (delete-char 1)))
+		 (insert-buffer-substring object))
 		((stringp object)
-		 (let ((overridding-file-coding-system 'no-conversion))
-		   (if (vm-xemacs-p)
-		       (insert-file-contents-literally object)
-		     (insert-before-markers " ")
-		     (forward-char -1)
-		     (insert-file-contents-literally object)
-		     (goto-char (point-max))
-		     (delete-char -1)))))
+		 (let ((coding-system-for-read 'no-conversion)
+		       ;; don't let buffer-file-coding-system be changed
+		       ;; by insert-file-contents-literally.  The
+		       ;; value we bind to it to here isn't important.
+		       (buffer-file-coding-system 'no-conversion))
+		   (insert-file-contents-literally object))))
 	  ;; gather information about the object from the extent.
-	  (if (setq already-mimed (vm-extent-property e 'vm-mime-encoded))
+	  (if (setq already-mimed (extent-property e 'vm-mime-encoded))
 	      (setq layout (vm-mime-parse-entity
 			    nil (list "text/plain" "charset=us-ascii")
 			    "7bit")
-		    type (or (vm-extent-property e 'vm-mime-type)
+		    type (or (extent-property e 'vm-mime-type)
 			     (car (vm-mm-layout-type layout)))
-		    params (or (vm-extent-property e 'vm-mime-parameters)
+		    params (or (extent-property e 'vm-mime-parameters)
 			       (cdr (vm-mm-layout-qtype layout)))
-		    description (vm-extent-property e 'vm-mime-description)
+		    description (extent-property e 'vm-mime-description)
 		    disposition
 		      (if (not
 			   (equal
-			    (car (vm-extent-property e 'vm-mime-disposition))
+			    (car (extent-property e 'vm-mime-disposition))
 			    "unspecified"))
-			  (vm-extent-property e 'vm-mime-disposition)
+			  (extent-property e 'vm-mime-disposition)
 			(vm-mm-layout-qdisposition layout)))
-	    (setq type (vm-extent-property e 'vm-mime-type)
-		  params (vm-extent-property e 'vm-mime-parameters)
-		  description (vm-extent-property e 'vm-mime-description)
+	    (setq type (extent-property e 'vm-mime-type)
+		  params (extent-property e 'vm-mime-parameters)
+		  description (extent-property e 'vm-mime-description)
 		  disposition
 		    (if (not (equal
-			      (car (vm-extent-property e 'vm-mime-disposition))
+			      (car (extent-property e 'vm-mime-disposition))
 			      "unspecified"))
-			(vm-extent-property e 'vm-mime-disposition)
+			(extent-property e 'vm-mime-disposition)
 		      nil)))
 	  (cond ((vm-mime-types-match "text" type)
 		 (setq encoding
@@ -2625,41 +2694,13 @@
 				 (point-max)
 				 t))
 		 (setq 8bit (or 8bit (equal encoding "8bit"))))
-		((or (vm-mime-types-match "message/rfc822" type)
-		     (vm-mime-types-match "message/news" type)
-		     (vm-mime-types-match "multipart" type))
+		((vm-mime-composite-type-p type)
 		 (setq opoint-min (point-min))
 		 (if (not already-mimed)
 		     (setq layout (vm-mime-parse-entity
 				   nil (list "text/plain" "charset=us-ascii")
 				   "7bit")))
-		 ;; MIME messages of type "message" and
-		 ;; "multipart" are required to have a non-opaque
-		 ;; content transfer encoding.  This means that
-		 ;; if the user only wants to send out 7bit data,
-		 ;; then any subpart that contains 8bit data must
-		 ;; have an opaque (qp or base64) 8->7bit
-		 ;; conversion performed on it so that the
-		 ;; enclosing entity can use an non-opqaue
-		 ;; encoding.
-		 ;;
-		 ;; message/partial requires a "7bit" encoding so
-		 ;; force 8->7 conversion in that case.
-		 (let ((vm-mime-8bit-text-transfer-encoding
-			(if (vm-mime-types-match "message/partial" type)
-			    'quoted-printable
-			  vm-mime-8bit-text-transfer-encoding)))
-		   (vm-mime-map-atomic-layouts 'vm-mime-transfer-encode-layout
-					       (vm-mm-layout-parts layout)))
-		 ;; now figure out a proper content trasnfer
-		 ;; encoding value for the enclosing entity.
-		 (re-search-forward "^\n" nil t)
-		 (save-restriction
-		   (narrow-to-region (point) (point-max))
-		   (setq encoding
-			 (vm-determine-proper-content-transfer-encoding
-			  (point-min)
-			  (point-max))))
+		 (setq encoding (vm-mime-transfer-encode-layout layout))
 		 (setq 8bit (or 8bit (equal encoding "8bit")))
 		 (goto-char (point-max))
 		 (widen)
@@ -2708,11 +2749,11 @@
 	  (goto-char (point-max))
 	  (widen)
 	  (save-excursion
-	    (goto-char (vm-extent-start-position e))
+	    (goto-char (extent-start-position e))
 	    (vm-assert (looking-at "\\[ATTACHMENT")))
-	  (delete-region (vm-extent-start-position e)
-			 (vm-extent-end-position e))
-	  (vm-detach-extent e)
+	  (delete-region (extent-start-position e)
+			 (extent-end-position e))
+	  (detach-extent e)
 	  (if (looking-at "\n")
 	      (delete-char 1))
 	  (setq e-list (cdr e-list)))
@@ -2720,11 +2761,14 @@
 	;; extent, if any.
 	(if (or just-one (= (point) (point-max)))
 	    nil
+	  (if enriched
+	      (let ((enriched-initial-annotation ""))
+		(enriched-encode (point) (point-max))))
 	  (setq charset (vm-determine-proper-charset (point)
 						     (point-max)))
-	  (if (vm-xemacs-mule-p)
-	      (encode-coding-region (point-min) (point-max)
-				    file-coding-system))
+	  (if vm-xemacs-mule-p
+	      (encode-coding-region (point) (point-max)
+				    buffer-file-coding-system))
 	  (setq encoding (vm-determine-proper-content-transfer-encoding
 			  (point)
 			  (point-max))
@@ -2734,7 +2778,9 @@
 							 t))
 	  (setq 8bit (or 8bit (equal encoding "8bit")))
 	  (setq boundary-positions (cons (point-marker) boundary-positions))
-	  (insert "Content-Type: text/plain; charset=" charset "\n")
+	  (if enriched
+	      (insert "Content-Type: text/enriched; charset=" charset "\n")
+	    (insert "Content-Type: text/plain; charset=" charset "\n"))
 	  (insert "Content-Transfer-Encoding: " encoding "\n\n")
 	  (goto-char (point-max)))
 	(setq boundary (vm-mime-make-multipart-boundary))
@@ -2782,8 +2828,8 @@
 	  (if params
 	      (if vm-mime-avoid-folding-content-type
 		  (insert "; " (mapconcat 'identity params "; ") "\n")
-		(insert ";\n\t" (mapconcat 'identity params ";\n\t"))))
-	  (insert "\n"))
+		(insert ";\n\t" (mapconcat 'identity params ";\n\t") "\n"))
+	    (insert "\n")))
 	(if just-one
 	    (and description
 		 (insert "Content-Description: " description "\n")))
@@ -2791,10 +2837,325 @@
 	    (progn
 	      (insert "Content-Disposition: " (car disposition))
 	      (if (cdr disposition)
-		  (insert ";\n\t" (mapconcat 'identity
-					     (cdr disposition)
-					     ";\n\t")))
-	      (insert "\n")))
+		  (if vm-mime-avoid-folding-content-type
+		      (insert "; " (mapconcat 'identity (cdr disposition) "; ")
+			      "\n")
+		    (insert ";\n\t" (mapconcat 'identity (cdr disposition)
+					       ";\n\t")))
+		(insert "\n"))))
+	(if just-one
+	    (insert "Content-Transfer-Encoding: " encoding "\n")
+	  (if 8bit
+	      (insert "Content-Transfer-Encoding: 8bit\n")
+	    (insert "Content-Transfer-Encoding: 7bit\n")))))))
+
+(defun vm-mime-fsfemacs-encode-composition ()
+  (save-restriction
+    (widen)
+    (if (not (eq major-mode 'mail-mode))
+	(error "Command must be used in a VM Mail mode buffer."))
+    (or (null (vm-mail-mode-get-header-contents "MIME-Version:"))
+	(error "Message is already MIME encoded."))
+    (let ((8bit nil)
+	  (just-one nil)
+	  (boundary-positions nil)
+	  (enriched (and (boundp 'enriched-mode) enriched-mode))
+	  already-mimed layout o o-list boundary
+	  type encoding charset params description disposition object
+	  opoint-min)
+      (mail-text)
+      (setq o-list (vm-mime-fake-attachment-overlays (point) (point-max))
+	    o-list (vm-delete (function
+			       (lambda (o)
+				 (overlay-get o 'vm-mime-object)))
+			      o-list t)
+	    o-list (sort o-list (function
+				 (lambda (e1 e2)
+				   (< (overlay-end e1)
+				      (overlay-end e2))))))
+      ;; If there's just one attachment and no other readable
+      ;; text in the buffer then make the message type just be
+      ;; the attachment type rather than sending a multipart
+      ;; message with one attachment
+      (setq just-one (and (= (length o-list) 1)
+			  (looking-at "[ \t\n]*")
+			  (= (match-end 0)
+			     (overlay-start (car o-list)))
+			  (save-excursion
+			    (goto-char (overlay-end (car o-list)))
+			    (looking-at "[ \t\n]*\\'"))))
+      (if (null o-list)
+	  (progn
+	    (narrow-to-region (point) (point-max))
+	    ;; support enriched-mode for text/enriched composition
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (enriched-encode (point-min) (point-max))))
+	    (setq charset (vm-determine-proper-charset (point-min)
+						       (point-max)))
+	    (setq encoding (vm-determine-proper-content-transfer-encoding
+			    (point-min)
+			    (point-max))
+		  encoding (vm-mime-transfer-encode-region encoding
+							   (point-min)
+							   (point-max)
+							   t))
+	    (widen)
+	    (vm-remove-mail-mode-header-separator)
+	    (goto-char (point-min))
+	    (vm-reorder-message-headers
+	     nil nil "\\(Content-Type:\\|Content-Transfer-Encoding\\|MIME-Version:\\)")
+	    (insert "MIME-Version: 1.0\n")
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
+	    (insert "Content-Transfer-Encoding: " encoding "\n")
+	    (vm-add-mail-mode-header-separator))
+	(while o-list
+	  (setq o (car o-list))
+	  (if (or just-one (= (point) (overlay-start o)))
+	      nil
+	    (narrow-to-region (point) (overlay-start o))
+	    ;; support enriched-mode for text/enriched composition
+	    (if enriched
+		(let ((enriched-initial-annotation ""))
+		  (save-excursion
+		    ;; insert/delete trick needed to avoid
+		    ;; enriched-mode tags from seeping into the
+		    ;; attachment overlays.  I really wish
+		    ;; front-advance / rear-advance overlay
+		    ;; endpoint properties actually worked.
+		    (goto-char (point-max))
+		    (insert-before-markers "\n")
+		    (enriched-encode (point-min) (1- (point)))
+		    (goto-char (point-max))
+		    (delete-char -1)
+		    '(goto-char (point-min)))))
+	    (setq charset (vm-determine-proper-charset (point-min)
+						       (point-max)))
+	    (setq encoding (vm-determine-proper-content-transfer-encoding
+			    (point-min)
+			    (point-max))
+		  encoding (vm-mime-transfer-encode-region encoding
+							   (point-min)
+							   (point-max)
+							   t))
+	    (setq boundary-positions (cons (point-marker) boundary-positions))
+	    (if enriched
+		(insert "Content-Type: text/enriched; charset=" charset "\n")
+	      (insert "Content-Type: text/plain; charset=" charset "\n"))
+	    (insert "Content-Transfer-Encoding: " encoding "\n\n")
+	    (widen))
+	  (goto-char (overlay-start o))
+	  (narrow-to-region (point) (point))
+	  (setq object (overlay-get o 'vm-mime-object))
+	  ;; insert the object
+	  (cond ((bufferp object)
+		 ;; as of FSF Emacs 19.34, even with the hooks
+		 ;; we've attached to the attachment overlays,
+		 ;; text STILL can be inserted into them when
+		 ;; font-lock is enabled.  Explaining why is
+		 ;; beyond the scope of this comment and I
+		 ;; don't know the answer anyway.  This works
+		 ;; to prevent it.
+		 (insert-before-markers " ")
+		 (forward-char -1)
+		 (insert-buffer-substring object)
+		 (delete-char 1))
+		((stringp object)
+		 (insert-before-markers " ")
+		 (forward-char -1)
+		 (insert-file-contents object)
+		 (goto-char (point-max))
+		 (delete-char -1)))
+	  ;; gather information about the object from the extent.
+	  (if (setq already-mimed (overlay-get o 'vm-mime-encoded))
+	      (setq layout (vm-mime-parse-entity
+			    nil (list "text/plain" "charset=us-ascii")
+			    "7bit")
+		    type (or (overlay-get o 'vm-mime-type)
+			     (car (vm-mm-layout-type layout)))
+		    params (or (overlay-get o 'vm-mime-parameters)
+			       (cdr (vm-mm-layout-qtype layout)))
+		    description (overlay-get o 'vm-mime-description)
+		    disposition
+		      (if (not
+			   (equal
+			    (car (overlay-get o 'vm-mime-disposition))
+			    "unspecified"))
+			  (overlay-get o 'vm-mime-disposition)
+			(vm-mm-layout-qdisposition layout)))
+	    (setq type (overlay-get o 'vm-mime-type)
+		  params (overlay-get o 'vm-mime-parameters)
+		  description (overlay-get o 'vm-mime-description)
+		  disposition
+		    (if (not (equal
+			      (car (overlay-get o 'vm-mime-disposition))
+			      "unspecified"))
+			(overlay-get o 'vm-mime-disposition)
+		      nil)))
+	  (cond ((vm-mime-types-match "text" type)
+		 (setq encoding
+		       (vm-determine-proper-content-transfer-encoding
+			(if already-mimed
+			    (vm-mm-layout-body-start layout)
+			  (point-min))
+			(point-max))
+		       encoding (vm-mime-transfer-encode-region
+				 encoding
+				 (if already-mimed
+				     (vm-mm-layout-body-start layout)
+				   (point-min))
+				 (point-max)
+				 t))
+		 (setq 8bit (or 8bit (equal encoding "8bit"))))
+		((vm-mime-composite-type-p type)
+		 (setq opoint-min (point-min))
+		 (if (not already-mimed)
+		     (setq layout (vm-mime-parse-entity
+				   nil (list "text/plain" "charset=us-ascii")
+				   "7bit")))
+		 (setq encoding (vm-mime-transfer-encode-layout layout))
+		 (setq 8bit (or 8bit (equal encoding "8bit")))
+		 (goto-char (point-max))
+		 (widen)
+		 (narrow-to-region opoint-min (point)))
+		(t
+		 (vm-mime-base64-encode-region
+		  (if already-mimed
+		      (vm-mm-layout-body-start layout)
+		    (point-min))
+		  (point-max))
+		 (setq encoding "base64")))
+	  (if just-one
+	      nil
+	    (goto-char (point-min))
+	    (setq boundary-positions (cons (point-marker) boundary-positions))
+	    (if (not already-mimed)
+		nil
+	      ;; trim headers
+	      (vm-reorder-message-headers
+	       nil (nconc (list "Content-Disposition:" "Content-ID:")
+			  (if description
+			      (list "Content-Description:")
+			    nil))
+	       nil)
+	      ;; remove header/text separator
+	      (goto-char (1- (vm-mm-layout-body-start layout)))
+	      (if (looking-at "\n")
+		  (delete-char 1)))
+	    (insert "Content-Type: " type)
+	    (if params
+		(if vm-mime-avoid-folding-content-type
+		    (insert "; " (mapconcat 'identity params "; ") "\n")
+		  (insert ";\n\t" (mapconcat 'identity params ";\n\t") "\n"))
+	      (insert "\n"))
+	    (and description
+		 (insert "Content-Description: " description "\n"))
+	    (if disposition
+		(progn
+		  (insert "Content-Disposition: " (car disposition))
+		  (if (cdr disposition)
+		      (insert ";\n\t" (mapconcat 'identity
+						 (cdr disposition)
+						 ";\n\t")))
+		  (insert "\n")))
+	    (insert "Content-Transfer-Encoding: " encoding "\n\n"))
+	  (goto-char (point-max))
+	  (widen)
+	  (save-excursion
+	    (goto-char (overlay-start o))
+	    (vm-assert (looking-at "\\[ATTACHMENT")))
+	  (delete-region (overlay-start o)
+			 (overlay-end o))
+	  (delete-overlay o)
+	  (if (looking-at "\n")
+	      (delete-char 1))
+	  (setq o-list (cdr o-list)))
+	;; handle the remaining chunk of text after the last
+	;; extent, if any.
+	(if (or just-one (= (point) (point-max)))
+	    nil
+	  ;; support enriched-mode for text/enriched composition
+	  (if enriched
+	      (let ((enriched-initial-annotation ""))
+		(enriched-encode (point) (point-max))))
+	  (setq charset (vm-determine-proper-charset (point)
+						     (point-max)))
+	  (setq encoding (vm-determine-proper-content-transfer-encoding
+			  (point)
+			  (point-max))
+		encoding (vm-mime-transfer-encode-region encoding
+							 (point)
+							 (point-max)
+							 t))
+	  (setq 8bit (or 8bit (equal encoding "8bit")))
+	  (setq boundary-positions (cons (point-marker) boundary-positions))
+	  (if enriched
+	      (insert "Content-Type: text/enriched; charset=" charset "\n")
+	    (insert "Content-Type: text/plain; charset=" charset "\n"))
+	  (insert "Content-Transfer-Encoding: " encoding "\n\n")
+	  (goto-char (point-max)))
+	(setq boundary (vm-mime-make-multipart-boundary))
+	(mail-text)
+	(while (re-search-forward (concat "^--"
+					  (regexp-quote boundary)
+					  "\\(--\\)?$")
+				  nil t)
+	  (setq boundary (vm-mime-make-multipart-boundary))
+	  (mail-text))
+	(goto-char (point-max))
+	(or just-one (insert "\n--" boundary "--\n"))
+	(while boundary-positions
+	  (goto-char (car boundary-positions))
+	  (insert "\n--" boundary "\n")
+	  (setq boundary-positions (cdr boundary-positions)))
+	(if (and just-one already-mimed)
+	    (progn
+	      (goto-char (vm-mm-layout-header-start layout))
+	      ;; trim headers
+	      (vm-reorder-message-headers
+	       nil '("Content-Description:" "Content-ID:") nil)
+	      ;; remove header/text separator
+	      (goto-char (1- (vm-mm-layout-body-start layout)))
+	      (if (looking-at "\n")
+		  (delete-char 1))
+	      ;; copy remainder to enclosing entity's header section
+	      (insert-buffer-substring (current-buffer)
+				       (vm-mm-layout-header-start layout)
+				       (vm-mm-layout-body-start layout))
+	      (delete-region (vm-mm-layout-header-start layout)
+			     (vm-mm-layout-body-start layout))))
+	(goto-char (point-min))
+	(vm-remove-mail-mode-header-separator)
+	(vm-reorder-message-headers
+	 nil nil "\\(Content-Type:\\|MIME-Version:\\|Content-Transfer-Encoding\\)")
+	(vm-add-mail-mode-header-separator)
+	(insert "MIME-Version: 1.0\n")
+	(if (not just-one)
+	    (insert (if vm-mime-avoid-folding-content-type
+			"Content-Type: multipart/mixed; boundary=\""
+		      "Content-Type: multipart/mixed;\n\tboundary=\"")
+		    boundary "\"\n")
+	  (insert "Content-Type: " type)
+	  (if params
+	      (if vm-mime-avoid-folding-content-type
+		  (insert "; " (mapconcat 'identity params "; ") "\n")
+		(insert ";\n\t" (mapconcat 'identity params ";\n\t") "\n"))
+	    (insert "\n")))
+	(if just-one
+	    (and description
+		 (insert "Content-Description: " description "\n")))
+	(if (and just-one disposition)
+	    (progn
+	      (insert "Content-Disposition: " (car disposition))
+	      (if (cdr disposition)
+		  (if vm-mime-avoid-folding-content-type
+		      (insert "; " (mapconcat 'identity (cdr disposition) "; ")
+			      "\n")
+		    (insert ";\n\t" (mapconcat 'identity (cdr disposition)
+					       ";\n\t")))
+		(insert "\n"))))
 	(if just-one
 	    (insert "Content-Transfer-Encoding: " encoding "\n")
 	  (if 8bit
@@ -2812,16 +3173,15 @@
 	  b header-start header-end master-buffer start end)
       (vm-remove-mail-mode-header-separator)
       ;; message/partial must have "7bit" content transfer
-      ;; encoding, so verify that everything has been encoded for
+      ;; encoding, so force everything to be encoded for
       ;; 7bit transmission.
       (let ((vm-mime-8bit-text-transfer-encoding
-	     (if (eq vm-mime-8bit-text-transfer-encoding 'send)
+	     (if (eq vm-mime-8bit-text-transfer-encoding '8bit)
 		 'quoted-printable
 	       vm-mime-8bit-text-transfer-encoding)))
-	(vm-mime-map-atomic-layouts
-	 'vm-mime-transfer-encode-layout
-	 (list (vm-mime-parse-entity nil (list "text/plain" "charset=us-ascii")
-				     "7bit"))))
+	(vm-mime-transfer-encode-layout
+	 (vm-mime-parse-entity nil (list "text/plain" "charset=us-ascii")
+			       "7bit")))
       (goto-char (point-min))
       (setq header-start (point))
       (search-forward "\n\n")
@@ -2864,6 +3224,7 @@
 	(vm-increment n)
 	(set-buffer master-buffer)
 	(setq start (point)))
+      (vm-add-mail-mode-header-separator)
       (message "Fragmenting message... done")
       (nreverse buffers))))
 
@@ -2878,13 +3239,15 @@
       (error "Command must be used in a VM Mail mode buffer."))
   (let ((temp-buffer nil)
 	(mail-buffer (current-buffer))
+	(enriched (and (boundp 'enriched-mode) enriched-mode))
 	e-list)
     (unwind-protect
 	(progn
 	  (setq temp-buffer (generate-new-buffer "composition preview"))
 	  (set-buffer temp-buffer)
-	  ;; so vm-mime-encode-composition won't complain
+	  ;; so vm-mime-xxxx-encode-composition won't complain
 	  (setq major-mode 'mail-mode)
+	  (set (make-local-variable 'enriched-mode) enriched)
 	  (vm-insert-region-from-buffer mail-buffer)
 	  (goto-char (point-min))
 	  (or (vm-mail-mode-get-header-contents "From")
@@ -2899,6 +3262,7 @@
 	  (and vm-send-using-mime
 	       (null (vm-mail-mode-get-header-contents "MIME-Version:"))
 	       (vm-mime-encode-composition))
+	  (vm-remove-mail-mode-header-separator)
 	  (goto-char (point-min))
 	  (insert (vm-leading-message-separator 'From_))
 	  (goto-char (point-max))
@@ -2921,12 +3285,16 @@
       (and temp-buffer (kill-buffer temp-buffer)))))
 
 (defun vm-mime-composite-type-p (type)
-  (or (vm-mime-types-match "message" type)
+  (or (and (vm-mime-types-match "message" type)
+	   (not (vm-mime-types-match "message/partial" type))
+	   (not (vm-mime-types-match "message/external-body" type)))
       (vm-mime-types-match "multipart" type)))
 
-(defun vm-mime-map-atomic-layouts (function list)
-  (while list
-    (if (vm-mime-composite-type-p (car (vm-mm-layout-type (car list))))
-	(vm-mime-map-atomic-layouts function (vm-mm-layout-parts (car list)))
-      (funcall function (car list)))
-    (setq list (cdr list))))
+;; Unused currrently.
+;;
+;;(defun vm-mime-map-atomic-layouts (function list)
+;;  (while list
+;;    (if (vm-mime-composite-type-p (car (vm-mm-layout-type (car list))))
+;;	(vm-mime-map-atomic-layouts function (vm-mm-layout-parts (car list)))
+;;      (funcall function (car list)))
+;;    (setq list (cdr list))))
--- a/lisp/vm/vm-minibuf.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-minibuf.el	Mon Aug 13 08:57:55 2007 +0200
@@ -181,10 +181,8 @@
 	     (while keymaps
 	       (setq keymap (car keymaps))
 	       (cond ((vm-mouse-xemacs-mouse-p)
-		      (define-key keymap 'button1 'ignore)
-		      (define-key keymap 'button2 'ignore)
-		      (define-key keymap 'button1up command)
-		      (define-key keymap 'button2up command))
+		      (define-key keymap 'button1 command)
+		      (define-key keymap 'button2 command))
 		     ((vm-mouse-fsfemacs-mouse-p)
 		      (define-key keymap [down-mouse-1] 'ignore)
 		      (define-key keymap [drag-mouse-1] 'ignore)
@@ -274,7 +272,7 @@
   ;; handle alist
   (if (consp (car completion-list))
       (setq completion-list (nreverse (mapcar 'car completion-list))))
-  (if (and completion-list (vm-mouse-support-possible-p))
+  (if (and completion-list (vm-mouse-support-possible-here-p))
       (cond ((and (vm-mouse-xemacs-mouse-p)
 		  (or (button-press-event-p last-command-event)
 		      (button-release-event-p last-command-event)
@@ -382,7 +380,7 @@
 				 must-match initial history)
   "Like read-file-name, except a mouse interface is used if a mouse
 click mouse triggered the current command."
-  (if (vm-mouse-support-possible-p)
+  (if (vm-mouse-support-possible-here-p)
       (cond ((and (vm-mouse-xemacs-mouse-p)
 		  (or (button-press-event-p last-command-event)
 		      (button-release-event-p last-command-event)
--- a/lisp/vm/vm-misc.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-misc.el	Mon Aug 13 08:57:55 2007 +0200
@@ -92,6 +92,86 @@
 	     (nreverse list)) ; jwz: fixed order
 	(and work-buffer (kill-buffer work-buffer)))))))
 
+(defun vm-parse-structured-header (string &optional sepchar keep-quotes)
+  (if (null string)
+      ()
+    (let ((work-buffer nil))
+      (save-excursion
+       (unwind-protect
+	   (let ((list nil)
+		 (nonspecials "^\"\\( \t\n\r\f")
+		 start s char sp+sepchar)
+	     (if sepchar
+		 (setq nonspecials (concat nonspecials (list sepchar))
+		       sp+sepchar (concat "\t\f\n\r " (list sepchar))))
+	     (setq work-buffer (generate-new-buffer "*vm-work*"))
+	     (buffer-disable-undo work-buffer)
+	     (set-buffer work-buffer)
+	     (insert string)
+	     (goto-char (point-min))
+	     (skip-chars-forward "\t\f\n\r ")
+	     (setq start (point))
+	     (while (not (eobp))
+	       (skip-chars-forward nonspecials)
+	       (setq char (following-char))
+	       (cond ((looking-at "[ \t\n\r\f]")
+		      (delete-char 1))
+		     ((= char ?\\)
+		      (forward-char 1)
+		      (if (not (eobp))
+			  (forward-char 1)))
+		     ((and sepchar (= char sepchar))
+		      (setq s (buffer-substring start (point)))
+		      (if (or (null (string-match "^[\t\f\n\r ]+$" s))
+			      (not (string= s "")))
+			  (setq list (cons s list)))
+		      (skip-chars-forward sp+sepchar)
+		      (setq start (point)))
+		     ((looking-at " \t\n\r\f")
+		      (skip-chars-forward " \t\n\r\f"))
+		     ((= char ?\")
+		      (let ((done nil))
+			(if keep-quotes
+			    (forward-char 1)
+			  (delete-char 1))
+			(while (not done)
+			  (if (null (re-search-forward "[\\\"]" nil t))
+			      (setq done t)
+			    (setq char (char-after (1- (point))))
+			    (cond ((char-equal char ?\\)
+				   (delete-char -1)
+				   (if (eobp)
+				       (setq done t)
+				     (forward-char 1)))
+				  (t (if (not keep-quotes)
+					 (delete-char -1))
+				     (setq done t)))))))
+		     ((= char ?\()
+		      (let ((done nil)
+			    (pos (point))
+			    (parens 1))
+			(forward-char 1)
+			(while (not done)
+			  (if (null (re-search-forward "[\\()]" nil t))
+			      (setq done t)
+			    (setq char (char-after (1- (point))))
+			    (cond ((char-equal char ?\\)
+				   (if (eobp)
+				       (setq done t)
+				     (forward-char 1)))
+				  ((char-equal char ?\()
+				   (setq parens (1+ parens)))
+				  (t
+				   (setq parens (1- parens)
+					 done (zerop parens))))))
+			(delete-region pos (point))))))
+	     (setq s (buffer-substring start (point)))
+	     (if (and (null (string-match "^[\t\f\n\r ]+$" s))
+		      (not (string= s "")))
+		 (setq list (cons s list)))
+	     (nreverse list))
+	(and work-buffer (kill-buffer work-buffer)))))))
+
 (defun vm-write-string (where string)
   (if (bufferp where)
       (vm-save-buffer-excursion
@@ -108,7 +188,7 @@
 	    ;; writing out message separators
 	    (setq buffer-file-type nil)
 	    ;; Tell XEmacs/MULE to pick the correct newline conversion.
-	    (and (vm-xemacs-mule-p)
+	    (and vm-xemacs-mule-p
 		 (set-file-coding-system 'no-conversion nil))
 	    (write-region (point-min) (point-max) where t 'quiet))
 	(and temp-buffer (kill-buffer temp-buffer))))))
@@ -343,52 +423,40 @@
 	((markerp object) (copy-marker object))
 	(t object)))
 
-(defun vm-xemacs-p ()
-  (let ((case-fold-search nil))
-    (string-match "XEmacs" emacs-version)))
-
-(defun vm-xemacs-mule-p ()
-  (and (vm-xemacs-p)
-       (featurep 'mule)
-       (fboundp 'set-file-coding-system)
-       (fboundp 'get-coding-system)))
-
-(defun vm-fsfemacs-19-p ()
-  (and (string-match "^19" emacs-version)
-       (not (string-match "XEmacs\\|Lucid" emacs-version))))
-
-;; make-frame might be defined and still not work.  This would
-;; be true since the user could be running on a tty and using
-;; XEmacs 19.12, or using FSF Emacs 19.28 (or prior FSF Emacs versions).
-;;
-;; make-frame works on ttys in FSF Emacs 19.29, but other than
-;; looking at the version number I don't know a sane way to
-;; test for it without just running make-frame.  I'll just
-;; let it not work for now... someone will complain eventually
-;; and I'll think of something.
-(defun vm-multiple-frames-possible-p ()
-  (or (and (boundp 'window-system) (not (eq window-system nil)))
-      (and (fboundp 'device-type) (eq (device-type) 'x))))
-
-(defun vm-mouse-support-possible-p ()
-  (vm-multiple-frames-possible-p))
+(defun vm-multiple-frames-possible-p () 
+  (cond (vm-xemacs-p 
+	 (or (memq 'win (device-matching-specifier-tag-list))
+	     (featurep 'tty-frames)))
+        (vm-fsfemacs-19-p 
+         (fboundp 'make-frame))))
+ 
+(defun vm-mouse-support-possible-p () 
+  (cond (vm-xemacs-p 
+         (featurep 'window-system)) 
+        (vm-fsfemacs-19-p 
+         (fboundp 'track-mouse))))
+ 
+(defun vm-mouse-support-possible-here-p ()
+  (cond (vm-xemacs-p
+	 (memq 'win (device-matching-specifier-tag-list)))
+	(vm-fsfemacs-19-p
+	 (eq window-system 'x))))
 
 (defun vm-menu-support-possible-p ()
-  (or (and (boundp 'window-system)
-	   (or (eq window-system 'x)
-	       (eq window-system 'ns)      ;; NextStep
-	       (eq window-system 'win32)))
-      (and (fboundp 'device-type) (eq (device-type) 'x))))
-
+  (cond (vm-xemacs-p
+	 (featurep 'menubar))
+	(vm-fsfemacs-19-p
+	 (fboundp 'menu-bar-mode))))
+ 
 (defun vm-toolbar-support-possible-p ()
-  (and (vm-xemacs-p)
-       (vm-multiple-frames-possible-p)
-       (featurep 'toolbar)))
+  (and vm-xemacs-p (featurep 'toolbar)))
 
 (defun vm-multiple-fonts-possible-p ()
-  (or (eq window-system 'x)
-      (and (fboundp 'device-type)
-	   (eq (device-type) 'x))))
+  (cond (vm-xemacs-p
+	 (eq (device-type) 'x))
+	(vm-fsfemacs-19-p
+	 (or (eq window-system 'x)
+	     (eq window-system 'win32)))))
 
 (defun vm-run-message-hook (message &optional hook-variable)
   (save-excursion
@@ -435,13 +503,15 @@
 	;; save this work so we won't have to do it again
 	(setq vm-sortable-date-alist
 	      (cons (cons string
-			  (timezone-make-date-sortable
-			   (format "%s %s %s %s %s"
-				   (aref vect 1)
-				   (aref vect 2)
-				   (aref vect 3)
-				   (aref vect 4)
-				   (aref vect 5))))
+			  (condition-case nil
+			      (timezone-make-date-sortable
+			       (format "%s %s %s %s %s"
+				       (aref vect 1)
+				       (aref vect 2)
+				       (aref vect 3)
+				       (aref vect 4)
+				       (aref vect 5)))
+			    (error "1970010100:00:00")))
 		    vm-sortable-date-alist))
 	;; return result
 	(cdr (car vm-sortable-date-alist)))))
@@ -497,12 +567,8 @@
 	   (get-file-buffer (file-truename file)))))
 
 (defun vm-set-region-face (start end face)
-  (cond ((fboundp 'make-overlay)
-	 (let ((o (make-overlay start end)))
-	   (overlay-put o 'face face)))
-	((fboundp 'make-extent)
-	 (let ((o (make-extent start end)))
-	   (set-extent-property o 'face face)))))
+  (let ((e (vm-make-extent start end)))
+    (vm-set-extent-property e 'face face)))
 
 (defun vm-default-buffer-substring-no-properties (beg end &optional buffer)
   (let ((s (if buffer
@@ -516,7 +582,7 @@
 (fset 'vm-buffer-substring-no-properties
   (cond ((fboundp 'buffer-substring-no-properties)
 	 (function buffer-substring-no-properties))
-	((vm-xemacs-p)
+	(vm-xemacs-p
 	 (function buffer-substring))
 	(t (function vm-default-buffer-substring-no-properties))))
 
@@ -535,37 +601,45 @@
       (set-buffer buffer))
     (set-buffer target-buffer)))
 
-(if (fboundp 'overlay-get)
-    (fset 'vm-extent-property 'overlay-get)
-  (fset 'vm-extent-property 'extent-property))
+(if (not (fboundp 'vm-extent-property))
+    (if (fboundp 'overlay-get)
+	(fset 'vm-extent-property 'overlay-get)
+      (fset 'vm-extent-property 'extent-property)))
 
-(if (fboundp 'overlay-put)
-    (fset 'vm-set-extent-property 'overlay-put)
-  (fset 'vm-set-extent-property 'set-extent-property))
+(if (not (fboundp 'vm-set-extent-property))
+    (if (fboundp 'overlay-put)
+	(fset 'vm-set-extent-property 'overlay-put)
+      (fset 'vm-set-extent-property 'set-extent-property)))
 
-(if (fboundp 'move-overlay)
-    (fset 'vm-set-extent-endpoints 'move-overlay)
-  (fset 'vm-set-extent-endpoints 'set-extent-endpoints))
+(if (not (fboundp 'vm-set-extent-endpoints))
+    (if (fboundp 'move-overlay)
+	(fset 'vm-set-extent-endpoints 'move-overlay)
+      (fset 'vm-set-extent-endpoints 'set-extent-endpoints)))
 
-(if (fboundp 'make-overlay)
-    (fset 'vm-make-extent 'make-overlay)
-  (fset 'vm-make-extent 'make-extent))
+(if (not (fboundp 'vm-make-extent))
+    (if (fboundp 'make-overlay)
+	(fset 'vm-make-extent 'make-overlay)
+      (fset 'vm-make-extent 'make-extent)))
 
-(if (fboundp 'overlay-end)
-    (fset 'vm-extent-end-position 'overlay-end)
-  (fset 'vm-extent-end-position 'extent-end-position))
+(if (not (fboundp 'vm-extent-end-position))
+    (if (fboundp 'overlay-end)
+	(fset 'vm-extent-end-position 'overlay-end)
+      (fset 'vm-extent-end-position 'extent-end-position)))
 
-(if (fboundp 'overlay-start)
-    (fset 'vm-extent-start-position 'overlay-start)
-  (fset 'vm-extent-start-position 'extent-start-position))
+(if (not (fboundp 'vm-extent-start-position))
+    (if (fboundp 'overlay-start)
+	(fset 'vm-extent-start-position 'overlay-start)
+      (fset 'vm-extent-start-position 'extent-start-position)))
 
-(if (fboundp 'delete-overlay)
-    (fset 'vm-detach-extent 'delete-overlay)
-  (fset 'vm-detach-extent 'detach-extent))
+(if (not (fboundp 'vm-detach-extent))
+    (if (fboundp 'delete-overlay)
+	(fset 'vm-detach-extent 'delete-overlay)
+      (fset 'vm-detach-extent 'detach-extent)))
 
-(if (fboundp 'overlay-properties)
-    (fset 'vm-extent-properties 'overlay-properties)
-  (fset 'vm-extent-properties 'extent-properties))
+(if (not (fboundp 'vm-extent-properties))
+    (if (fboundp 'overlay-properties)
+	(fset 'vm-extent-properties 'overlay-properties)
+      (fset 'vm-extent-properties 'extent-properties)))
 
 (defun vm-copy-extent (e)
   (let ((props (vm-extent-properties e))
--- a/lisp/vm/vm-mouse.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-mouse.el	Mon Aug 13 08:57:55 2007 +0200
@@ -18,18 +18,18 @@
 (provide 'vm-mouse)
 
 (defun vm-mouse-fsfemacs-mouse-p ()
-  (and (vm-fsfemacs-19-p)
+  (and vm-fsfemacs-19-p
        (fboundp 'set-mouse-position)))
 
 (defun vm-mouse-xemacs-mouse-p ()
-  (and (vm-xemacs-p)
+  (and vm-xemacs-p
        (fboundp 'set-mouse-position)))
 
 (defun vm-mouse-set-mouse-track-highlight (start end)
-  (cond ((fboundp 'make-overlay)
+  (cond (vm-fsfemacs-19-p
 	 (let ((o (make-overlay start end)))
 	   (overlay-put o 'mouse-face 'highlight)))
-	((fboundp 'make-extent)
+	(vm-xemacs-p
 	 (let ((o (make-extent start end)))
 	   (set-extent-property o 'highlight t)))))
 
@@ -90,7 +90,7 @@
 	  ((vm-mouse-fsfemacs-mouse-p)
 	   (set-buffer (window-buffer (posn-window (event-start event))))
 	   (goto-char (posn-point (event-start event)))))
-    (cond ((fboundp 'overlays-at)
+    (cond (vm-fsfemacs-19-p
 	   (let ((o-list (overlays-at (point)))
 		 (string nil))
 	     (while o-list
@@ -101,7 +101,7 @@
 			 o-list nil)
 		 (setq o-list (cdr o-list))))
 	     string ))
-	  ((fboundp 'extent-at)
+	  (vm-xemacs-p
 	   (let ((e (extent-at (point) nil 'highlight)))
 	     (if e
 		 (buffer-substring (extent-start-position e)
@@ -201,6 +201,9 @@
 	(vm-mouse-send-url-to-netscape url t new-window)))
   (message "Sending URL to Netscape... done"))
 
+(defun vm-mouse-send-url-to-netscape-new-window (url)
+  (vm-mouse-send-url-to-netscape url nil t))
+
 (defun vm-mouse-send-url-to-mosaic (url &optional new-mosaic new-window)
   (message "Sending URL to Mosaic...")
   (if (null new-mosaic)
@@ -218,8 +221,8 @@
 	       ;; newline convention used should be the local
 	       ;; one, whatever that is.
 	       (setq buffer-file-type nil)
-	       (and (vm-xemacs-mule-p)
-		    (set-file-coding-system 'no-conversion nil))
+	       (and vm-xemacs-mule-p
+		    (set-buffer-file-coding-system 'no-conversion nil))
 	       (write-region (point-min) (point-max)
 			     (concat "/tmp/Mosaic." pid)
 			     nil 0)
@@ -233,6 +236,9 @@
 	    (append vm-mosaic-program-switches (list url))))
   (message "Sending URL to Mosaic... done"))
 
+(defun vm-mouse-send-url-to-mosaic-new-window (url)
+  (vm-mouse-send-url-to-mosaic url nil t))
+
 (defun vm-mouse-install-mouse ()
   (cond ((vm-mouse-xemacs-mouse-p)
 	 (if (null (lookup-key vm-mode-map 'button2))
@@ -318,7 +324,8 @@
     (setq vm-mouse-read-file-name-history history)
     (setq vm-mouse-read-file-name-prompt prompt)
     (setq vm-mouse-read-file-name-return-value nil)
-    (if (and vm-frame-per-completion (vm-multiple-frames-possible-p))
+    (if (and vm-mutable-frames vm-frame-per-completion
+	     (vm-multiple-frames-possible-p))
 	(save-excursion
 	  (vm-goto-new-frame 'completion)))
     (switch-to-buffer (current-buffer))
@@ -339,9 +346,6 @@
 	(cond ((equal string key-doc)
 	       (condition-case nil
 		   (save-excursion
-		     (save-excursion
-		       (let ((vm-mutable-frames t))
-			 (vm-delete-windows-or-frames-on (current-buffer))))
 		     (setq vm-mouse-read-file-name-return-value
 			   (save-excursion
 			     (vm-keyboard-read-file-name
@@ -383,11 +387,10 @@
 
 (defun vm-mouse-read-file-name-quit-handler (&optional normal-exit)
   (interactive)
-  (let ((vm-mutable-frames t))
-    (vm-delete-windows-or-frames-on (current-buffer))
-    (if normal-exit
-	(throw 'exit nil)
-      (throw 'exit t))))
+  (vm-maybe-delete-windows-or-frames-on (current-buffer))
+  (if normal-exit
+      (throw 'exit nil)
+    (throw 'exit t)))
 
 (defvar vm-mouse-read-string-prompt)
 (defvar vm-mouse-read-string-completion-list)
@@ -407,7 +410,8 @@
     (setq vm-mouse-read-string-completion-list completion-list)
     (setq vm-mouse-read-string-multi-word multi-word)
     (setq vm-mouse-read-string-return-value nil)
-    (if (and vm-frame-per-completion (vm-multiple-frames-possible-p))
+    (if (and vm-mutable-frames vm-frame-per-completion
+	     (vm-multiple-frames-possible-p))
 	(save-excursion
 	  (vm-goto-new-frame 'completion)))
     (switch-to-buffer (current-buffer))
@@ -432,9 +436,6 @@
 	(cond ((equal string key-doc)
 	       (condition-case nil
 		   (save-excursion
-		     (save-excursion
-		       (let ((vm-mutable-frames t))
-			 (vm-delete-windows-or-frames-on (current-buffer))))
 		     (setq vm-mouse-read-string-return-value
 			   (vm-keyboard-read-string
 			    vm-mouse-read-string-prompt
@@ -485,8 +486,7 @@
 
 (defun vm-mouse-read-string-quit-handler (&optional normal-exit)
   (interactive)
-  (let ((vm-mutable-frames t))
-    (vm-delete-windows-or-frames-on (current-buffer))
-    (if normal-exit
-	(throw 'exit nil)
-      (throw 'exit t))))
+  (vm-maybe-delete-windows-or-frames-on (current-buffer))
+  (if normal-exit
+      (throw 'exit nil)
+    (throw 'exit t)))
--- a/lisp/vm/vm-page.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-page.el	Mon Aug 13 08:57:55 2007 +0200
@@ -25,11 +25,18 @@
 Prefix argument N means scroll forward N lines."
   (interactive "P")
   (let ((mp-changed (vm-follow-summary-cursor))
+	needs-decoding 
 	(was-invisible nil))
     (vm-select-folder-buffer)
     (vm-check-for-killed-summary)
     (vm-check-for-killed-presentation)
     (vm-error-if-folder-empty)
+    (setq needs-decoding (and vm-display-using-mime
+			      (not vm-mime-decoded)
+			      (not (vm-mime-plain-message-p
+				    (car vm-message-pointer)))
+			      vm-auto-decode-mime-messages
+			      (eq vm-system-state 'previewing)))
     (and vm-presentation-buffer
 	 (set-buffer vm-presentation-buffer))
     (let ((point (point))
@@ -46,7 +53,7 @@
 	    (if (= (window-start w) (point-max))
 		(set-window-start w (point-min)))
 	    (setq was-invisible t))))
-    (if (or mp-changed was-invisible
+    (if (or mp-changed was-invisible needs-decoding
 	    (and (eq vm-system-state 'previewing)
 		 (pos-visible-in-window-p
 		  (point-max)
@@ -193,7 +200,7 @@
     (message "End of message %s"
 			(vm-number-of (car vm-message-pointer)))))
 
-(defun vm-scroll-backward (arg)
+(defun vm-scroll-backward (&optional arg)
   "Scroll backward a screenful of text.
 Prefix N scrolls backward N lines."
   (interactive "P")
@@ -205,14 +212,14 @@
 
 (defun vm-highlight-headers ()
   (cond
-   ((and (vm-xemacs-p) vm-use-lucid-highlighting)
+   ((and vm-xemacs-p vm-use-lucid-highlighting)
     (require 'highlight-headers)
     ;; disable the url marking stuff, since VM has its own interface.
     (let ((highlight-headers-mark-urls nil)
 	  (highlight-headers-regexp (or vm-highlighted-header-regexp
 					highlight-headers-regexp)))
       (highlight-headers (point-min) (point-max) t)))
-   ((vm-xemacs-p)
+   (vm-xemacs-p
     (let (e)
       (map-extents (function
 		    (lambda (e ignore)
@@ -263,7 +270,7 @@
 				       (point-max))))
       (setq search-pairs (list (cons (point-min) (point-max)))))
     (cond
-     ((vm-xemacs-p)
+     (vm-xemacs-p
       (let (e)
 	(map-extents (function
 		      (lambda (e ignore)
@@ -282,10 +289,16 @@
 	    (if vm-highlight-url-face
 		(set-extent-property e 'face vm-highlight-url-face))
 	    (if vm-url-browser
-		(let ((keymap (make-sparse-keymap)))
+		(let ((keymap (make-sparse-keymap))
+		      (popup-function
+		       (if (save-excursion
+			     (goto-char (match-beginning n))
+			     (looking-at "mailto:"))
+			   'vm-menu-popup-mailto-url-browser-menu
+			 'vm-menu-popup-url-browser-menu)))
 		  (define-key keymap 'button2 'vm-mouse-send-url-at-event)
 		  (if vm-popup-menu-on-mouse-3
-		      (define-key keymap 'button3 'vm-menu-popup-url-browser-menu))
+		      (define-key keymap 'button3 popup-function))
 		  (define-key keymap "\r"
 		    (function (lambda () (interactive)
 				(vm-mouse-send-url-at-position (point)))))
@@ -293,7 +306,7 @@
 		  (set-extent-property e 'balloon-help 'vm-url-help)
 		  (set-extent-property e 'highlight t))))
 	  (setq search-pairs (cdr search-pairs)))))
-     ((and (vm-fsfemacs-19-p)
+     ((and vm-fsfemacs-19-p
 	   (fboundp 'overlay-put))
       (let (o-lists o p)
 	(setq o-lists (overlay-lists)
@@ -318,9 +331,17 @@
 	    (if vm-highlight-url-face
 		(overlay-put o 'face vm-highlight-url-face))
 	    (if vm-url-browser
-		(let ((keymap (make-sparse-keymap)))
+		(let ((keymap (make-sparse-keymap))
+		      (popup-function
+		       (if (save-excursion
+			     (goto-char (match-beginning n))
+			     (looking-at "mailto:"))
+			   'vm-menu-popup-mailto-url-browser-menu
+			 'vm-menu-popup-url-browser-menu)))
 		  (overlay-put o 'mouse-face 'highlight)
 		  (setq keymap (nconc keymap (current-local-map)))
+		  (if vm-popup-menu-on-mouse-3
+		      (define-key keymap [mouse-3] popup-function))
 		  (define-key keymap "\r"
 		    (function (lambda () (interactive)
 				(vm-mouse-send-url-at-position (point)))))
@@ -329,7 +350,7 @@
 
 (defun vm-energize-headers ()
   (cond
-   ((vm-xemacs-p)
+   (vm-xemacs-p
     (let ((search-tuples '(("^From:" vm-menu-author-menu)
 			   ("^Subject:" vm-menu-subject-menu)))
 	  regexp menu keymap e)
@@ -363,7 +384,7 @@
 	  (set-extent-property e 'balloon-help 'vm-mouse-3-help)
 	  (set-extent-property e 'highlight t))
 	(setq search-tuples (cdr search-tuples)))))
-   ((and (vm-fsfemacs-19-p)
+   ((and vm-fsfemacs-19-p
 	 (fboundp 'overlay-put))
     (let ((search-tuples '(("^From:" vm-menu-fsfemacs-author-menu)
 			   ("^Subject:" vm-menu-fsfemacs-subject-menu)))
@@ -416,7 +437,10 @@
 	    (setq g (intern h vm-xface-cache))
 	    (if (boundp g)
 		(setq g (symbol-value g))
-	      (set g (make-glyph h))
+	      (set g (make-glyph
+		      (list
+		       (list 'global (cons '(tty) [nothing]))
+		       (list 'global (cons '(win) (vector 'xface ':data h))))))
 	      (setq g (symbol-value g))
 	      ;; XXX broken.  Gives extra pixel lines at the
 	      ;; bottom of the glyph in 19.12
@@ -456,7 +480,7 @@
 (defun vm-highlight-headers-maybe ()
   ;; highlight the headers
   (if (or vm-highlighted-header-regexp
-	  (and (vm-xemacs-p) vm-use-lucid-highlighting))
+	  (and vm-xemacs-p vm-use-lucid-highlighting))
       (save-restriction
 	(widen)
 	(narrow-to-region (vm-headers-of (car vm-message-pointer))
@@ -473,8 +497,7 @@
 	(vm-energize-headers)))
   ;; display xfaces, if we can
   (if (and vm-display-xfaces
-	   (vm-xemacs-p)
-	   (vm-multiple-frames-possible-p)
+	   vm-xemacs-p
 	   (featurep 'xface))
       (save-restriction
 	(widen)
--- a/lisp/vm/vm-pop.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-pop.el	Mon Aug 13 08:57:55 2007 +0200
@@ -191,11 +191,12 @@
 	  (setq process-buffer
 		(get-buffer-create (format "trace of POP session to %s" host)))
 	  ;; Tell XEmacs/MULE not to mess with the text.
-	  (and (vm-xemacs-mule-p)
-	       (set-file-coding-system 'binary t))
+	  (and vm-xemacs-mule-p
+	       (set-buffer-file-coding-system 'binary t))
 	  ;; clear the trace buffer of old output
 	  (save-excursion
 	    (set-buffer process-buffer)
+	    (buffer-disable-undo)
 	    (erase-buffer))
 	  ;; open the connection to the server
 	  (setq process (open-network-stream "POP" process-buffer host port))
--- a/lisp/vm/vm-reply.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-reply.el	Mon Aug 13 08:57:55 2007 +0200
@@ -297,7 +297,18 @@
 		    (t (setq parts (list o))))
 	      (while parts
 		(cond ((vm-mime-text-type-p (car parts))
-		       (if (vm-mime-display-internal-text/plain (car parts) t)
+		       (if (cond ((vm-mime-types-match
+				   "text/html"
+				   (car (vm-mm-layout-type (car parts))))
+				  (vm-mime-display-internal-text/html
+				   (car parts)))
+				 ((vm-mime-types-match
+				   "text/enriched"
+				   (car (vm-mm-layout-type (car parts))))
+				  (vm-mime-display-internal-text/enriched
+				   (car parts)))
+				 ((vm-mime-display-internal-text/plain
+				   (car parts) t)))
 			   nil
 			 ;; charset problems probably
 			 ;; just dump the raw bits
@@ -333,6 +344,10 @@
   (let ((b (current-buffer)))
     (vm-mail-send)
     (cond ((null (buffer-name b)) ;; dead buffer
+	   ;; This improves window configuration behavior in
+	   ;; XEmacs.  It avoids taking the folder buffer from
+	   ;; one frame and attaching it to the selected frame.
+	   (set-buffer (window-buffer (selected-window)))
 	   (vm-display nil nil '(vm-mail-send-and-exit)
 		       '(vm-mail-send-and-exit
 			 reading-message
@@ -355,7 +370,9 @@
 				vm-kept-mail-buffers)))
 	(mapcar (function
 		 (lambda (b)
-		   (and (buffer-name b) (kill-buffer b))))
+		   (and (buffer-name b)
+			(not (buffer-modified-p b))
+			(kill-buffer b))))
 		extras)
 	(and vm-kept-mail-buffers extras
 	     (setcdr (memq (car extras) vm-kept-mail-buffers) nil)))))
@@ -421,16 +438,16 @@
       (let ((this-command this-command))
 	(save-excursion
 	  (mail-send))))
-    (cond ((eq vm-system-state 'replying)
-	   (vm-mail-mark-replied))
-	  ((eq vm-system-state 'forwarding)
-	   (vm-mail-mark-forwarded))
-	  ((eq vm-system-state 'redistributing)
-	   (vm-mail-mark-redistributed)))
     ;; be careful, something could have killed the composition
     ;; buffer inside mail-send.
     (if (eq (current-buffer) composition-buffer)
 	(progn
+	  (cond ((eq vm-system-state 'replying)
+		 (vm-mail-mark-replied))
+		((eq vm-system-state 'forwarding)
+		 (vm-mail-mark-forwarded))
+		((eq vm-system-state 'redistributing)
+		 (vm-mail-mark-redistributed)))
 	  (vm-rename-current-mail-buffer)
 	  (vm-keep-mail-buffer (current-buffer))))
     (vm-display nil nil '(vm-mail-send) '(vm-mail-send))))
@@ -599,7 +616,8 @@
   (vm-select-folder-buffer)
   (vm-check-for-killed-summary)
   (vm-error-if-folder-empty)
-  (if (eq last-command 'vm-next-command-uses-marks)
+  (if (and (eq last-command 'vm-next-command-uses-marks)
+	   (cdr (vm-select-marked-or-prefixed-messages 0)))
       (let ((vm-digest-send-type vm-forwarding-digest-type))
 	(setq this-command 'vm-next-command-uses-marks)
 	(command-execute 'vm-send-digest))
@@ -607,8 +625,8 @@
 	  (miming (and vm-send-using-mime
 		       (equal vm-forwarding-digest-type "mime")))
 	  mail-buffer
-	  header-end boundary
-	  (mp vm-message-pointer))
+	  header-end
+	  (mp (vm-select-marked-or-prefixed-messages 1)))
       (save-restriction
 	(widen)
 	(vm-mail-internal
@@ -635,15 +653,13 @@
 	  (goto-char (match-end 0))
 	  (setq header-end (match-beginning 0)))
 	(cond ((equal vm-forwarding-digest-type "mime")
-	       (setq boundary (vm-mime-encapsulate-messages
-			       (list (car mp)) vm-forwarded-headers
-			       vm-unforwarded-header-regexp))
+	       (vm-mime-encapsulate-messages (list (car mp))
+					     vm-forwarded-headers
+					     vm-unforwarded-header-regexp
+					     nil)
 	       (goto-char header-end)
 	       (insert "MIME-Version: 1.0\n")
-	       (insert (if vm-mime-avoid-folding-content-type
-			   "Content-Type: multipart/digest; boundary=\""
-			 "Content-Type: multipart/digest;\n\tboundary=\"")
-		       boundary "\"\n")
+	       (insert "Content-Type: message/rfc822\n")
 	       (insert "Content-Transfer-Encoding: "
 		       (vm-determine-proper-content-transfer-encoding
 			(point)
@@ -665,9 +681,7 @@
 	  (let ((b (current-buffer)))
 	    (set-buffer mail-buffer)
 	    (mail-text)
-	    (vm-mime-attach-object b "multipart/digest"
-				   (list (concat "boundary=\""
-						 boundary "\"")) nil t)
+	    (vm-mime-attach-object b "message/rfc822" nil nil t)
 	    (add-hook 'kill-buffer-hook
 		      (list 'lambda ()
 			    (list 'if (list 'eq mail-buffer '(current-buffer))
@@ -742,10 +756,10 @@
 The current message will be copied to a Mail mode buffer and you
 can edit the message and send it as usual.
 
-NOTE: since you are doing a resend, a Resent-To header is
-provided for you to fill in.  If you don't fill it in, when you
-send the message it will go to the original recipients listed in
-the To and Cc headers.  You may also create a Resent-Cc header."
+NOTE: since you are doing a resend, a Resent-To header is provided
+for you to fill in the new recipient list.  If you don't fill in
+this header, what happens when you send the message is undefined.
+You may also create a Resent-Cc header."
   (interactive)
   (vm-follow-summary-cursor)
   (vm-select-folder-buffer)
@@ -842,7 +856,8 @@
       (cond ((equal vm-digest-send-type "mime")
 	     (setq boundary (vm-mime-encapsulate-messages
 			     mlist vm-mime-digest-headers
-			     vm-mime-digest-discard-header-regexp))
+			     vm-mime-digest-discard-header-regexp
+			     t))
 	     (goto-char header-end)
 	     (insert "MIME-Version: 1.0\n")
 	     (insert (if vm-mime-avoid-folding-content-type
@@ -864,18 +879,6 @@
 	      vm-rfc1153-digest-discard-header-regexp)))
       (goto-char start)
       (setq mp mlist)
-      (if prefix
-	  (progn
-	    (message "Building digest preamble...")
-	    (while mp
-	      (let ((vm-summary-uninteresting-senders nil))
-		(insert (vm-sprintf 'vm-digest-preamble-format (car mp)) "\n"))
-	      (if vm-digest-center-preamble
-		  (progn
-		    (forward-char -1)
-		    (center-line)
-		    (forward-char 1)))
-	      (setq mp (cdr mp)))))
       (if miming
 	  (let ((b (current-buffer)))
 	    (set-buffer mail-buffer)
@@ -887,6 +890,22 @@
 		      (list 'lambda ()
 			    (list 'if (list 'eq mail-buffer '(current-buffer))
 				  (list 'kill-buffer b))))))
+      (if prefix
+	  (save-excursion
+	    (message "Building digest preamble...")
+	    (if miming
+		(progn
+		  (set-buffer mail-buffer)
+		  (mail-text)))
+	    (while mp
+	      (let ((vm-summary-uninteresting-senders nil))
+		(insert (vm-sprintf 'vm-digest-preamble-format (car mp)) "\n"))
+	      (if vm-digest-center-preamble
+		  (progn
+		    (forward-char -1)
+		    (center-line)
+		    (forward-char 1)))
+	      (setq mp (cdr mp)))))
       (mail-position-on-field "To")
       (message "Building %s digest... done" vm-digest-send-type)))
   (run-hooks 'vm-send-digest-hook)
@@ -927,7 +946,8 @@
 	  ;; different composition buffer.
 	  (vm-unbury-buffer b)
 	  (set-buffer b)
-	  (if (and vm-frame-per-composition (vm-multiple-frames-possible-p)
+	  (if (and vm-mutable-frames vm-frame-per-composition
+		   (vm-multiple-frames-possible-p)
 		   ;; only pop up a frame if there's an undisplay
 		   ;; hook in place to make the frame go away.
 		   vm-undisplay-buffer-hook)
@@ -991,7 +1011,7 @@
       (if (eq mail-aliases t)
 	  (progn
 	    (setq mail-aliases nil)
-	    (if (file-exists-p "~/.mailrc")
+	    (if (file-exists-p (or mail-personal-alias-file "~/.mailrc"))
 		(build-mail-aliases)))))
     (if (stringp vm-mail-header-from)
 	(insert "From: " vm-mail-header-from "\n"))
@@ -1002,10 +1022,12 @@
     (and in-reply-to (insert "In-Reply-To: " in-reply-to "\n"))
     (and references (insert "References: " references "\n"))
     (insert "X-Mailer: VM " vm-version " under "
-	    (if (vm-fsfemacs-19-p) "Emacs " "")
+	    (if vm-fsfemacs-19-p "Emacs " "")
 	    emacs-version "\n")
-    ;; REPLYTO support for FSF Emacs v19.29
-    (and (eq mail-default-reply-to t)
+    ;; REPLYTO environmental variable support
+    ;; note that in FSF Emacs v19.29 we would initialize if the
+    ;; value was t.  nil is the treigger value used now.
+    (and (eq mail-default-reply-to nil)
 	 (setq mail-default-reply-to (getenv "REPLYTO")))
     (if mail-default-reply-to
 	(insert "Reply-To: " mail-default-reply-to "\n"))
@@ -1032,7 +1054,8 @@
     ;; config stuff will select it as the composition buffer.
     (vm-unbury-buffer (current-buffer))
     ;; make a new frame if the user wants it.
-    (if (and vm-frame-per-composition (vm-multiple-frames-possible-p))
+    (if (and vm-mutable-frames vm-frame-per-composition
+	     (vm-multiple-frames-possible-p))
 	(progn
 	  (vm-goto-new-frame 'composition)
 	  (vm-set-hooks-for-frame-deletion)))
--- a/lisp/vm/vm-save.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-save.el	Mon Aug 13 08:57:55 2007 +0200
@@ -132,11 +132,9 @@
 			      (vm-number-of (car vm-message-pointer))
 			      auto-folder)))
 		 (let ((vm-delete-after-saving vm-delete-after-archiving))
-		   (if (not (string-equal auto-folder "/dev/null"))
-		       (vm-save-message auto-folder))
+		   (vm-save-message auto-folder)
 		   (vm-increment archived)
-		   (message "%d archived, still working..."
-				       archived)))
+		   (message "%d archived, still working..." archived)))
 	    (setq done (eq vm-message-pointer stop-point)
 		  vm-message-pointer (cdr vm-message-pointer))))
       ;; fix mode line
@@ -434,8 +432,9 @@
     (setq vm-last-written-file file)))
 
 (defun vm-pipe-message-to-command (command prefix-arg)
-  "Run shell command with the some or all of the current message as input.
-By default the entire message is used.
+  "Runs a shell command with some or all of the contents of the
+current message as input.
+By default, the entire message is used.
 With one \\[universal-argument] the text portion of the message is used.
 With two \\[universal-argument]'s the header portion of the message is used.
 With three \\[universal-argument]'s the visible header portion of the message
@@ -496,7 +495,7 @@
        (vm-display nil nil '(vm-pipe-message-to-command)
 		   '(vm-pipe-message-to-command)))))
 
-(defun vm-print-message (count)
+(defun vm-print-message (&optional count)
   "Print the current message
 Prefix arg N means print the current message and the next N - 1 messages.
 Prefix arg -N means print the current message and the previous N - 1 messages.
@@ -514,6 +513,7 @@
   (vm-select-folder-buffer)
   (vm-check-for-killed-summary)
   (vm-error-if-folder-empty)
+  (or count (setq count 1))
   (let ((buffer (get-buffer-create "*Shell Command Output*"))
 	(command (mapconcat (function identity)
 			    (nconc (list vm-print-command)
--- a/lisp/vm/vm-search19.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-search19.el	Mon Aug 13 08:57:55 2007 +0200
@@ -79,6 +79,7 @@
 			  (vm-start-of (car vm-message-pointer))
 			(vm-vheaders-of (car vm-message-pointer)))
 		      (vm-text-end-of (car vm-message-pointer)))
+		     (save-excursion (vm-energize-urls))
 		     (vm-display nil nil
 				 '(vm-isearch-forward vm-isearch-backward)
 				 '(reading-message))
--- a/lisp/vm/vm-sort.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-sort.el	Mon Aug 13 08:57:55 2007 +0200
@@ -212,11 +212,13 @@
       (progn
 	(vm-set-sortable-datestring-of
 	 m
-	 (timezone-make-date-sortable
-	  (or (vm-get-header-contents m "Date:")
-	      (vm-grok-From_-date m)
-	      "Thu, 1 Jan 1970 00:00:00 GMT")
-	  "GMT" "GMT"))
+	 (condition-case nil
+	     (timezone-make-date-sortable
+	      (or (vm-get-header-contents m "Date:")
+		  (vm-grok-From_-date m)
+		  "Thu, 1 Jan 1970 00:00:00 GMT")
+	      "GMT" "GMT")
+	   (error "1970010100:00:00")))
 	(vm-sortable-datestring-of m))))
 
 (defun vm-so-sortable-subject (m)
--- a/lisp/vm/vm-startup.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-startup.el	Mon Aug 13 08:57:55 2007 +0200
@@ -25,7 +25,7 @@
 
 Prefix arg or optional second arg READ-ONLY non-nil indicates
 that the folder should be considered read only.  No attribute
-changes, messages additions or deletions will be allowed in the
+changes, message additions or deletions will be allowed in the
 visited folder.
 
 Visiting the primary inbox causes any contents of the system mailbox to
@@ -63,7 +63,7 @@
 			    (inhibit-local-variables t)
 			    (enable-local-variables nil)
 			    ;; for XEmacs/Mule
-			    (overriding-file-coding-system 'no-conversion))
+			    (coding-system-for-read 'no-conversion))
 			(message "Reading %s..." file)
 			(prog1 (find-file-noselect file)
 			  ;; update folder history
@@ -80,25 +80,25 @@
       ;; the file coding system and decoding it.
       ;; This is only possible if a file is visited and then vm-mode
       ;; is run on it afterwards.
-      (defvar file-coding-system)
-      (if (and (vm-xemacs-mule-p)
-	       (not (eq (get-coding-system file-coding-system)
+      (defvar buffer-file-coding-system)
+      (if (and vm-xemacs-mule-p
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'no-conversion-unix)))
-	       (not (eq (get-coding-system file-coding-system)
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'no-conversion-dos)))
-	       (not (eq (get-coding-system file-coding-system)
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'no-conversion-mac)))
-	       (not (eq (get-coding-system file-coding-system)
+	       (not (eq (get-coding-system buffer-file-coding-system)
 			(get-coding-system 'binary))))
 	  (let ((buffer-read-only nil)
 		(omodified (buffer-modified-p)))
 	    (unwind-protect
 		(progn
 		  (encode-coding-region (point-min) (point-max)
-					file-coding-system)
-		  (set-file-coding-system 'no-conversion nil)
+					buffer-file-coding-system)
+		  (set-buffer-file-coding-system 'no-conversion nil)
 		  (decode-coding-region (point-min) (point-max)
-					file-coding-system))
+					buffer-file-coding-system))
 	      (set-buffer-modified-p omodified))))
       (vm-check-for-killed-summary)
       (vm-check-for-killed-presentation)
@@ -158,11 +158,14 @@
       ;; raise frame if requested and apply startup window
       ;; configuration.
       (if full-startup
-	  (progn
+	  (let ((buffer-to-display (or vm-summary-buffer
+				       vm-presentation-buffer
+				       (current-buffer))))
+	    (vm-display buffer-to-display buffer-to-display
+			(list this-command)
+			(list (or this-command 'vm) 'startup))
 	    (if vm-raise-frame-at-startup
-		(vm-raise-frame))
-	    (vm-display nil nil (list this-command)
-			(list (or this-command 'vm) 'startup))))
+		(vm-raise-frame))))
 
       ;; say this NOW, before the non-previewers read a message,
       ;; alter the new message count and confuse themselves.
@@ -171,9 +174,7 @@
 	  (setq totals-blurb (vm-emit-totals-blurb)))
 
       (vm-thoughtfully-select-message)
-      (if vm-message-list
-	  (vm-preview-current-message)
-	(vm-update-summary-and-mode-line))
+      (vm-update-summary-and-mode-line)
       ;; need to do this after any frame creation because the
       ;; toolbar sets frame-specific height and width specifiers.
       (and (vm-toolbar-support-possible-p) vm-use-toolbar
@@ -195,6 +196,7 @@
 	    ;; raise the summary frame if the user wants frames
 	    ;; raised and if there is a summary frame.
 	    (if (and vm-summary-buffer
+		     vm-mutable-frames
 		     vm-frame-per-summary
 		     vm-raise-frame-at-startup)
 		(vm-raise-frame))
@@ -209,6 +211,9 @@
 				      vm-presentation-buffer
 				      (current-buffer)))))))
 
+      (if vm-message-list
+	  (vm-preview-current-message))
+
       (run-hooks 'vm-visit-folder-hook)
 
       (if full-startup
@@ -275,7 +280,7 @@
 (defun vm-mode (&optional read-only)
   "Major mode for reading mail.
 
-This is VM 6.22.
+This is VM 6.34.
 
 Commands:
    h - summarize folder contents
@@ -440,6 +445,7 @@
    vm-frame-per-composition
    vm-frame-per-edit
    vm-frame-per-folder
+   vm-frame-per-help
    vm-frame-per-summary
    vm-highlighted-header-face
    vm-highlighted-header-regexp
@@ -538,6 +544,7 @@
    vm-summary-thread-indent-level
    vm-tale-is-an-idiot
    vm-temp-file-directory
+   vm-toolbar-pixmap-directory
    vm-trust-From_-with-Content-Length
    vm-undisplay-buffer-hook
    vm-unforwarded-header-regexp
@@ -739,6 +746,7 @@
 	  ;; raise the summary frame if the user wants frames
 	  ;; raised and if there is a summary frame.
 	  (if (and vm-summary-buffer
+		   vm-mutable-frames
 		   vm-frame-per-summary
 		   vm-raise-frame-at-startup)
 	      (vm-raise-frame))
@@ -797,30 +805,36 @@
 	(vm-search-other-frames nil))
     (vm-visit-virtual-folder folder-name read-only)))
 
-(defun vm-mail ()
-  "Send a mail message from within VM, or from without."
+(defun vm-mail (&optional to)
+  "Send a mail message from within VM, or from without.
+Optional argument TO is a string that should contain a comma separated
+recipient list."
   (interactive)
   (vm-session-initialization)
   (vm-select-folder-buffer)
   (vm-check-for-killed-summary)
-  (vm-mail-internal)
+  (vm-mail-internal nil to)
   (run-hooks 'vm-mail-hook)
   (run-hooks 'vm-mail-mode-hook))
 
-(defun vm-mail-other-frame ()
-  "Like vm-mail, but run in a newly created frame."
+(defun vm-mail-other-frame (&optional to)
+  "Like vm-mail, but run in a newly created frame.
+Optional argument TO is a string that should contain a comma separated
+recipient list."
   (interactive)
   (vm-session-initialization)
   (if (vm-multiple-frames-possible-p)
       (vm-goto-new-frame 'composition))
   (let ((vm-frame-per-composition nil)
 	(vm-search-other-frames nil))
-    (vm-mail))
+    (vm-mail to))
   (if (vm-multiple-frames-possible-p)
       (vm-set-hooks-for-frame-deletion)))
 
-(defun vm-mail-other-window ()
-  "Like vm-mail, but run in a different window."
+(defun vm-mail-other-window (&optional to)
+  "Like vm-mail, but run in a different window.
+Optional argument TO is a string that should contain a comma separated
+recipient list."
   (interactive)
   (vm-session-initialization)
   (if (one-window-p t)
@@ -828,7 +842,7 @@
   (other-window 1)
   (let ((vm-frame-per-composition nil)
 	(vm-search-other-frames nil))
-    (vm-mail)))
+    (vm-mail to)))
 
 (defun vm-submit-bug-report ()
   "Submit a bug report, with pertinent information to the VM bug list."
@@ -886,6 +900,7 @@
       'vm-frame-per-composition
       'vm-frame-per-edit
       'vm-frame-per-folder
+      'vm-frame-per-help
       'vm-frame-per-summary
       'vm-highlight-url-face
       'vm-highlighted-header-regexp
@@ -990,6 +1005,7 @@
       'vm-summary-uninteresting-senders
       'vm-summary-uninteresting-senders-arrow
       'vm-tale-is-an-idiot
+      'vm-toolbar-pixmap-directory
       'vm-temp-file-directory
       'vm-trust-From_-with-Content-Length
       'vm-undisplay-buffer-hook
@@ -1010,7 +1026,7 @@
       )
      nil
      nil
-     "Please change the Subject header to a concise bug description.\nRemember to cover the basics, that is, what you expected to\nhappen and what in fact did happen.  Please remove these instructions from your message.")
+     "Please change the Subject header to a concise bug description.\nRemember to cover the basics, that is, what you expected to\nhappen and what in fact did happen.  Please remove these\ninstructions from your message.")
     (save-excursion
       (goto-char (point-min))
       (mail-position-on-field "Subject")
@@ -1026,13 +1042,13 @@
   (vm-display nil nil '(vm-load-init-file) '(vm-load-init-file)))
 
 (defun vm-check-emacs-version ()
-  (cond ((and (vm-xemacs-p)
+  (cond ((and vm-xemacs-p
 	      (or (< emacs-major-version 19)
 		  (and (= emacs-major-version 19)
 		       (< emacs-minor-version 14))))
 	 (error "VM %s must be run on XEmacs 19.14 or a later version."
 		vm-version))
-	((and (vm-fsfemacs-19-p)
+	((and vm-fsfemacs-19-p
 	      (or (< emacs-major-version 19)
 		  (and (= emacs-major-version 19)
 		       (< emacs-minor-version 34))))
@@ -1052,8 +1068,9 @@
 	     ))))
 
 (defun vm-session-initialization ()
+  (vm-note-emacs-version)
   (vm-check-emacs-version)
-  (vm-set-debug-flags)
+;;  (vm-set-debug-flags)
   ;; If this is the first time VM has been run in this Emacs session,
   ;; do some necessary preparations.
   (if (or (not (boundp 'vm-session-beginning))
--- a/lisp/vm/vm-summary.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-summary.el	Mon Aug 13 08:57:55 2007 +0200
@@ -32,8 +32,7 @@
 	truncate-lines t)
   ;; horizontal scrollbar off by default
   ;; user can turn it on in summary hook if desired.
-  (and (fboundp 'set-specifier)
-       scrollbar-height
+  (and vm-xemacs-p (featurep 'scrollbar)
        (set-specifier scrollbar-height (cons (current-buffer) 0)))
   (use-local-map vm-summary-mode-map)
   (and (vm-menu-support-possible-p)
@@ -42,7 +41,7 @@
        (vm-mouse-support-possible-p)
        (vm-mouse-xemacs-mouse-p)
        (add-hook 'mode-motion-hook 'mode-motion-highlight-line))
-  (if (or vm-frame-per-folder vm-frame-per-summary)
+  (if (and vm-mutable-frames (or vm-frame-per-folder vm-frame-per-summary))
       (vm-set-hooks-for-frame-deletion))
   (run-hooks 'vm-summary-mode-hook)
   ;; Lucid Emacs apparently used this name
@@ -284,13 +283,13 @@
 	    (and old-window (select-window old-window)))))))
 
 (defun vm-summary-highlight-region (start end face)
-  (cond ((fboundp 'make-overlay)
+  (cond (vm-fsfemacs-19-p
 	 (if (and vm-summary-overlay (overlay-buffer vm-summary-overlay))
 	     (move-overlay vm-summary-overlay start end)
 	   (setq vm-summary-overlay (make-overlay start end))
 	   (overlay-put vm-summary-overlay 'evaporate nil)
 	   (overlay-put vm-summary-overlay 'face face)))
-	((fboundp 'make-extent)
+	(vm-xemacs-p
 	 (if (and vm-summary-overlay (extent-end-position vm-summary-overlay))
 	     (set-extent-endpoints vm-summary-overlay start end)
 	   (setq vm-summary-overlay (make-extent start end))
@@ -930,7 +929,8 @@
   (or (vm-message-id-of m)
       (vm-set-message-id-of
        m
-       (or (vm-get-header-contents m "Message-Id:")
+       (or (let ((id (vm-get-header-contents m "Message-Id:")))
+	     (and id (car (vm-parse id "[^<]*\\(<[^>]+>\\)"))))
 	   ;; try running md5 on the message body to produce an ID
 	   ;; better than nothing.
 	   (save-excursion
--- a/lisp/vm/vm-thread.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-thread.el	Mon Aug 13 08:57:55 2007 +0200
@@ -42,13 +42,14 @@
 	;; no need to schedule reindents of reparented messages
 	;; unless there were already messages present.
 	(schedule-reindents message-list)
-	parent parent-sym id id-sym date refs old-parent-sym)
+	m parent parent-sym id id-sym date refs old-parent-sym)
     (while mp
-      (setq parent (vm-th-parent (car mp))
-	    id (vm-su-message-id (car mp))
+      (setq m (car mp)
+	    parent (vm-th-parent m)
+	    id (vm-su-message-id m)
 	    id-sym (intern id vm-thread-obarray)
-	    date (vm-so-sortable-datestring (car mp)))
-      (put id-sym 'messages (cons (car mp) (get id-sym 'messages)))
+	    date (vm-so-sortable-datestring m))
+      (put id-sym 'messages (cons m (get id-sym 'messages)))
       (if (and (null (cdr (get id-sym 'messages)))
 	       schedule-reindents)
 	  (vm-thread-mark-for-summary-update (get id-sym 'children)))
@@ -65,7 +66,7 @@
 			(let ((kids (get old-parent-sym 'children))
 			      (msgs (get id-sym 'messages)))
 			  (while msgs
-			    (setq kids (delq (car msgs) kids)
+			    (setq kids (delq m kids)
 				  msgs (cdr msgs)))
 			  kids ))
 		   (set id-sym parent-sym)
@@ -73,13 +74,13 @@
 		       (vm-thread-mark-for-summary-update
 			(get id-sym 'messages)))))
 	    (put parent-sym 'children
-		 (cons (car mp) (get parent-sym 'children))))
+		 (cons m (get parent-sym 'children))))
 	(if (not (boundp id-sym))
 	    (set id-sym nil)))
       ;; use the references header to set parenting information
       ;; for ancestors of this message.  This does not override
       ;; a parent pointer for a message if it already exists.
-      (if (cdr (setq refs (vm-th-references (car mp))))
+      (if (cdr (setq refs (vm-th-references m)))
 	  (let (parent-sym id-sym msgs)
 	    (setq parent-sym (intern (car refs) vm-thread-obarray)
 		  refs (cdr refs))
@@ -99,17 +100,17 @@
 	  ;; inhibit-quit because we need to make sure the asets
 	  ;; below are an atomic group.
 	  (let* ((inhibit-quit t)
-		 (subject (vm-so-sortable-subject (car mp)))
+		 (subject (vm-so-sortable-subject m))
 		 (subject-sym (intern subject vm-thread-subject-obarray)))
 	    ;; if this subject never seen before create the
 	    ;; information vector.
 	    (if (not (boundp subject-sym))
 		(set subject-sym
-		     (vector id-sym (vm-so-sortable-datestring (car mp))
-			     nil (list (car mp))))
+		     (vector id-sym (vm-so-sortable-datestring m)
+			     nil (list m)))
 	      ;; this subject seen before 
 	      (aset (symbol-value subject-sym) 3
-		    (cons (car mp) (aref (symbol-value subject-sym) 3)))
+		    (cons m (aref (symbol-value subject-sym) 3)))
 	      (if (string< date (aref (symbol-value subject-sym) 1))
 		  (let* ((vect (symbol-value subject-sym))
 			 (i-sym (aref vect 0)))
@@ -139,8 +140,7 @@
 		;; using the parent information.
 		(if (null parent)
 		    (aset (symbol-value subject-sym) 2
-			  (cons (car mp)
-				(aref (symbol-value subject-sym) 2))))))))
+			  (cons m (aref (symbol-value subject-sym) 2))))))))
       (setq mp (cdr mp) n (1+ n))
       (if (zerop (% n modulus))
 	  (message "Building threads... %d" n)))
@@ -148,15 +148,20 @@
 	(message "Building threads... done"))))
 
 (defun vm-thread-mark-for-summary-update (message-list)
-  (while message-list
-    (vm-mark-for-summary-update (car message-list) t)
-    (vm-set-thread-list-of (car message-list) nil)
-    (vm-set-thread-indentation-of (car message-list) nil)
-    (vm-thread-mark-for-summary-update
-     (get (intern (vm-su-message-id (car message-list))
-		  vm-thread-obarray)
-	  'children))
-    (setq message-list (cdr message-list))))
+  (let (m)
+    (while message-list
+      (setq m (car message-list))
+      ;; if thread-list is null then we've already marked this
+      ;; message, or it doesn't need marking.
+      (if (null (vm-thread-list-of m))
+	  nil
+	(vm-mark-for-summary-update m t)
+	(vm-set-thread-list-of m nil)
+	(vm-set-thread-indentation-of m nil)
+	(vm-thread-mark-for-summary-update
+	 (get (intern (vm-su-message-id m) vm-thread-obarray)
+	      'children)))
+      (setq message-list (cdr message-list)))))
 
 (defun vm-thread-list (message)
   (let ((done nil)
@@ -207,27 +212,28 @@
 (defun vm-unthread-message (message &optional message-changing)
   (save-excursion
     (let ((mp (cons message (vm-virtual-messages-of message)))
-	  id-sym subject-sym vect p-sym)
+	  m id-sym subject-sym vect p-sym)
       (while mp
+	(setq m (car mp))
 	(let ((inhibit-quit t))
-	  (vm-set-thread-list-of (car mp) nil)
-	  (vm-set-thread-indentation-of (car mp) nil)
-	  (set-buffer (vm-buffer-of (car mp)))
-	  (setq id-sym (intern (vm-su-message-id (car mp)) vm-thread-obarray)
-		subject-sym (intern (vm-so-sortable-subject (car mp))
+	  (vm-set-thread-list-of m nil)
+	  (vm-set-thread-indentation-of m nil)
+	  (set-buffer (vm-buffer-of m))
+	  (setq id-sym (intern (vm-su-message-id m) vm-thread-obarray)
+		subject-sym (intern (vm-so-sortable-subject m)
 				    vm-thread-subject-obarray))
 	  (if (boundp id-sym)
 	      (progn
-		(put id-sym 'messages (delq (car mp) (get id-sym 'messages)))
+		(put id-sym 'messages (delq m (get id-sym 'messages)))
 		(vm-thread-mark-for-summary-update (get id-sym 'children))
 		(setq p-sym (symbol-value id-sym))
 		(and p-sym (put p-sym 'children
-				(delq (car mp) (get p-sym 'children))))
+				(delq m (get p-sym 'children))))
 		(if message-changing
 		    (set id-sym nil))))
 	  (if (and (boundp subject-sym) (setq vect (symbol-value subject-sym)))
 	      (if (not (eq id-sym (aref vect 0)))
-		  (aset vect 2 (delq (car mp) (aref vect 2)))
+		  (aset vect 2 (delq m (aref vect 2)))
 		(if message-changing
 		    (if (null (cdr (aref vect 3)))
 			(makunbound subject-sym)
@@ -239,7 +245,7 @@
 			(while p
 			  (if (and (string-lessp (vm-so-sortable-datestring (car p))
 						 oldest-date)
-				   (not (eq (car mp) (car p))))
+				   (not (eq m (car p))))
 			      (setq oldest-msg (car p)
 				    oldest-date (vm-so-sortable-datestring (car p))))
 			  (setq p (cdr p)))
@@ -248,7 +254,7 @@
 			(aset vect 1 oldest-date)
 			(setq children (delq oldest-msg (aref vect 2)))
 			(aset vect 2 children)
-			(aset vect 3 (delq (car mp) (aref vect 3)))
+			(aset vect 3 (delq m (aref vect 3)))
 			;; I'm not sure there aren't situations
 			;; where this might loop forever.
 			(let ((inhibit-quit nil))
--- a/lisp/vm/vm-toolbar.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-toolbar.el	Mon Aug 13 08:57:55 2007 +0200
@@ -25,7 +25,7 @@
    (vm-toolbar-any-messages-p)
    "Go to the next message.\n
 The command `vm-toolbar-next-command' is run, which is normally
-bound to `vm-next-message'.
+fbound to `vm-next-message'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-next-command 'some-other-command)"])
@@ -39,7 +39,7 @@
    (vm-toolbar-any-messages-p)
    "Go to the previous message.\n
 The command `vm-toolbar-previous-command' is run, which is normally
-bound to `vm-previous-message'.
+fbound to `vm-previous-message'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-previous-command 'some-other-command)"])
@@ -58,7 +58,7 @@
   [vm-toolbar-file-icon vm-toolbar-file-command (vm-toolbar-any-messages-p)
    "Save the current message to a folder.\n
 The command `vm-toolbar-file-command' is run, which is normally
-bound to `vm-save-message'.
+fbound to `vm-save-message'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-file-command 'some-other-command)"])
@@ -71,7 +71,7 @@
    (vm-toolbar-mail-waiting-p)
    "Retrieve spooled mail for the current folder.\n
 The command `vm-toolbar-getmail-command' is run, which is normally
-bound to `vm-get-new-mail'.
+fbound to `vm-get-new-mail'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-getmail-command 'some-other-command)"])
@@ -85,7 +85,7 @@
    (vm-toolbar-any-messages-p)
    "Print the current message.\n
 The command `vm-toolbar-print-command' is run, which is normally
-bound to `vm-print-message'.
+fbound to `vm-print-message'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-print-command 'some-other-command)"])
@@ -97,7 +97,7 @@
   [vm-toolbar-visit-icon vm-toolbar-visit-command t
    "Visit a different folder.\n
 The command `vm-toolbar-visit-command' is run, which is normally
-bound to `vm-visit-folder'.
+fbound to `vm-visit-folder'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-visit-command 'some-other-command)"])
@@ -111,7 +111,7 @@
    (vm-toolbar-any-messages-p)
    "Reply to the current message.\n
 The command `vm-toolbar-reply-command' is run, which is normally
-bound to `vm-followup-include-text'.
+fbound to `vm-followup-include-text'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-reply-command 'some-other-command)"])
@@ -123,7 +123,7 @@
   [vm-toolbar-compose-icon vm-toolbar-compose-command t
    "Compose a new message.\n
 The command `vm-toolbar-compose-command' is run, which is normally
-bound to `vm-mail'.
+fbound to `vm-mail'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-compose-command 'some-other-command)"])
@@ -141,7 +141,7 @@
 and vm-mime-external-content-types-alist to see how to control
 whether you see buttons or objects.\n
 The command `vm-toolbar-decode-mime-command' is run, which is normally
-bound to `vm-decode-mime-messages'.
+fbound to `vm-decode-mime-messages'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-decode-mime-command 'some-other-command)"])
@@ -190,7 +190,7 @@
    (vm-toolbar-can-quit-p)
    "Quit visiting this folder.\n
 The command `vm-toolbar-quit-command' is run, which is normally
-bound to `vm-quit'.
+fbound to `vm-quit'.
 You can make this button run some other command by using a Lisp
 s-expression like this one in your .vm file:
    (fset 'vm-toolbar-quit-command 'some-other-command)"])
@@ -199,10 +199,12 @@
     (fset 'vm-toolbar-quit-command 'vm-quit))
 
 (defun vm-toolbar-any-messages-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    vm-message-list))
+  (condition-case nil
+      (save-excursion
+	(vm-check-for-killed-folder)
+	(vm-select-folder-buffer)
+	vm-message-list)
+    (error nil)))
 
 (defun vm-toolbar-delete/undelete-message (&optional prefix-arg)
   (interactive "P")
@@ -218,11 +220,13 @@
 
 (defun vm-toolbar-can-autofile-p ()
   (interactive)
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (and vm-message-pointer
-	 (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist))))
+  (condition-case nil
+      (save-excursion
+	(vm-check-for-killed-folder)
+	(vm-select-folder-buffer)
+	(and vm-message-pointer
+	     (vm-auto-select-folder vm-message-pointer vm-auto-folder-alist)))
+    (error nil)))
 
 (defun vm-toolbar-autofile-message ()
   (interactive)
@@ -239,39 +243,43 @@
       (error "No match for message in vm-auto-folder-alist."))))
 
 (defun vm-toolbar-can-recover-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (and vm-folder-read-only
-	 buffer-file-name
-	 buffer-auto-save-file-name
-	 (null (buffer-modified-p))
-	 (file-newer-than-file-p
-	  buffer-auto-save-file-name
-	  buffer-file-name))))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(and vm-folder-read-only
+	     buffer-file-name
+	     buffer-auto-save-file-name
+	     (null (buffer-modified-p))
+	     (file-newer-than-file-p
+	      buffer-auto-save-file-name
+	      buffer-file-name)))
+    (error nil)))
 
 (defun vm-toolbar-can-decode-mime-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (and
-     vm-display-using-mime
-     vm-message-pointer
-     vm-presentation-buffer
-     (not vm-mime-decoded)
-     (not (vm-mime-plain-message-p (car vm-message-pointer))))))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(and
+	 vm-display-using-mime
+	 vm-message-pointer
+	 vm-presentation-buffer
+	 (not vm-mime-decoded)
+	 (not (vm-mime-plain-message-p (car vm-message-pointer)))))
+    (error nil)))
 
 (defun vm-toolbar-can-quit-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    (memq major-mode '(vm-mode vm-virtual-mode))))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	(memq major-mode '(vm-mode vm-virtual-mode)))
+    (error nil)))
 
 (defun vm-toolbar-mail-waiting-p ()
-  (save-excursion
-    (vm-check-for-killed-folder)
-    (vm-select-folder-buffer)
-    vm-spooled-mail-waiting))
+  (condition-case nil
+      (save-excursion
+	(vm-select-folder-buffer)
+	vm-spooled-mail-waiting)
+    (error nil)))
 
 (fset 'vm-toolbar-can-help-p 'vm-toolbar-can-quit-p)
 
@@ -311,6 +319,9 @@
   (vm-toolbar-initialize)
   (let ((height (+ 4 (glyph-height (car vm-toolbar-help-icon))))
 	(width (+ 4 (glyph-width (car vm-toolbar-help-icon))))
+	(frame (selected-frame))
+	(buffer (current-buffer))
+	(tag-set '(win))
 	(myframe (vm-created-this-frame-p))
 	toolbar )
     ;; glyph-width and glyph-height return 0 at startup sometimes
@@ -328,31 +339,27 @@
     (cond ((eq vm-toolbar-orientation 'right)
 	   (setq vm-toolbar-specifier right-toolbar)
 	   (if myframe
-	       (set-specifier right-toolbar (cons (selected-frame) toolbar)))
-	   (set-specifier right-toolbar (cons (current-buffer) toolbar))
-	   (set-specifier right-toolbar-width
-			  (cons (selected-frame) width)))
+	       (set-specifier right-toolbar toolbar frame tag-set))
+	   (set-specifier right-toolbar toolbar buffer)
+	   (set-specifier right-toolbar-width width frame tag-set))
 	  ((eq vm-toolbar-orientation 'left)
 	   (setq vm-toolbar-specifier left-toolbar)
 	   (if myframe
-	       (set-specifier left-toolbar (cons (selected-frame) toolbar)))
-	   (set-specifier left-toolbar (cons (current-buffer) toolbar))
-	   (set-specifier left-toolbar-width
-			  (cons (selected-frame) width)))
+	       (set-specifier left-toolbar toolbar frame tag-set))
+	   (set-specifier left-toolbar toolbar buffer)
+	   (set-specifier left-toolbar-width width frame tag-set))
 	  ((eq vm-toolbar-orientation 'bottom)
 	   (setq vm-toolbar-specifier bottom-toolbar)
 	   (if myframe
-	       (set-specifier bottom-toolbar (cons (selected-frame) toolbar)))
-	   (set-specifier bottom-toolbar (cons (current-buffer) toolbar))
-	   (set-specifier bottom-toolbar-height
-			  (cons (selected-frame) height)))
+	       (set-specifier bottom-toolbar toolbar frame tag-set))
+	   (set-specifier bottom-toolbar toolbar buffer)
+	   (set-specifier bottom-toolbar-height height frame tag-set))
 	  (t
 	   (setq vm-toolbar-specifier top-toolbar)
 	   (if myframe
-	       (set-specifier top-toolbar (cons (selected-frame) toolbar)))
-	   (set-specifier top-toolbar (cons (current-buffer) toolbar))
-	   (set-specifier top-toolbar-height
-			  (cons (selected-frame) height))))))
+	       (set-specifier top-toolbar toolbar frame tag-set))
+	   (set-specifier top-toolbar toolbar buffer)
+	   (set-specifier top-toolbar-height height frame tag-set)))))
 
 (defun vm-toolbar-make-toolbar-spec ()
   (let ((button-alist '(
@@ -360,6 +367,7 @@
 			(compose . vm-toolbar-compose-button)
 			(delete/undelete . vm-toolbar-delete/undelete-button)
 			(file . vm-toolbar-file-button)
+			(getmail . vm-toolbar-getmail-button)
 			(help . vm-toolbar-help-button)
 			(mime . vm-toolbar-decode-mime-button)
 			(next . vm-toolbar-next-button)
@@ -393,7 +401,8 @@
     (let ((tuples
 	   (if (featurep 'xpm)
 	       (list
-		(if (>= (device-bitplanes) 16)
+		(if (and (device-on-window-system-p)
+			 (>= (device-bitplanes) 16))
       '(vm-toolbar-decode-mime-icon "mime-colorful-up.xpm"
 				    "mime-colorful-dn.xpm"
 				    "mime-colorful-xx.xpm")
--- a/lisp/vm/vm-vars.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-vars.el	Mon Aug 13 08:57:55 2007 +0200
@@ -221,8 +221,14 @@
 (defvar vm-mail-check-interval 300
   "*Numeric value specifies the number of seconds between checks
 for new mail.  The maildrops for all visited folders are checked.
-The buffer local variable vm-spooled-mail-waiting is set non-nil
-in the buffers of those folders that have mail waiting.")
+
+A nil value means don't check for new mail.
+
+Note that mail if new mail is found, it is not retrieved.  The
+buffer local variable vm-spooled-mail-waiting is set non-nil in
+the buffers of those folders that have mail waiting.  VM uses
+the displays \"Mail\" in the mode line of folders that have mail
+waiting.")
 
 (defvar vm-spooled-mail-waiting nil
   "Value is non-nil if there is mail waiting for the current folder.
@@ -271,9 +277,10 @@
 
 A nil value means don't do the checks.
 
-Depending on the value of vm-convert-folder-types VM will either
-convert the messages to the appropriate type before saving or
-incorporating them, or it will signal an error.")
+If non-nil, VM will either convert the messages to the appropriate
+type before saving or incorporating them, or it will signal an
+error.  The value of vm-convert-folder-types determines which
+action VM will take.")
 
 (defvar vm-convert-folder-types t
   "*Non-nil value means that when VM checks folder types and finds
@@ -353,7 +360,7 @@
 
 (defvar vm-highlighted-header-face 'bold
   "*Face to be used to highlight headers.
-The header to highlight are sepcified by the vm-highlighted-header-regexp
+The headers to highlight are specified by the vm-highlighted-header-regexp
 variable.
 
 This variable is ignored under XEmacs if vm-use-lucid-highlighting is
@@ -390,7 +397,10 @@
 A nil value means VM will not display MIME messages any
 differently than any other message.")
 
-(defvar vm-mime-ignore-mime-version nil
+;; this is t because at this time (11 April 1997) Solaris is
+;; generated too many mangled MIME version headers.  For the same
+;; reason vm-mime-avoid-folding-content-type is also set to t.
+(defvar vm-mime-ignore-mime-version t
   "*Non-nil value means ignore the version number in the MIME-Version
 header.  VM only knows how to decode and display MIME version 1.0
 messages.  Some systems scramble the MIME-Version header, causing
@@ -450,11 +460,11 @@
 Note that some types are processed specially, and this variable does not
 apply to them.
 
-   Multipart/Digest and Message/RFC822 messages are always
-   displayed as a button to avoid visiting a new folder while the
-   user is moving around in the current folder.
-
-   Message/Partial messages are always displayed as a button,
+   multipart/digest messages are always displayed as a button to
+   avoid automatically visiting a new folder while you are moving
+   around in the current folder.
+
+   message/partial messages are always displayed as a button,
    because there always needs to be a way to trigger the assembly
    of the parts into a full message.
 
@@ -594,7 +604,7 @@
 e.g. X windows.  So this variable will have no effect if you're
 running Emacs on a tty.
 
-Note that under FSF Emacs any fonts you use must be the same size
+Note that under FSF Emacs any fonts you use must be the same height
 as your default font.  XEmacs does not have this limitation.")
 
 (defvar vm-mime-button-face 'gui-button-face
@@ -610,7 +620,7 @@
 This variable is unused in XEmacs/MULE.  Since multiple character
 sets can be displayed in a single buffer under MULE, VM will map
 the file coding system of the buffer to a single MIME character
-that can display all the buffer's characters.")
+set that can display all the buffer's characters.")
 
 (defvar vm-mime-8bit-text-transfer-encoding 'quoted-printable
   "*Symbol specifying what kind of transfer encoding to use on 8bit
@@ -683,8 +693,8 @@
 When VM prompts you for a target file name when saving a MIME body,
 any relative pathnames will be relative to this directory.")
 
-(defvar vm-mime-avoid-folding-content-type nil
-  "*Non-nil means don't send folded Content-Type headers in MIME messages.
+(defvar vm-mime-avoid-folding-content-type t
+  "*Non-nil means don't send folded Content- headers in MIME messages.
 `Folded' headers are headers broken into multiple lines as specified
 in RFC822 for readability and to avoid excessive line lengths.  At
 least one major UNIX vendor ships a version of sendmail that believes
@@ -1632,32 +1642,22 @@
 it was invoked.  VM will not create, delete, or use any other windows,
 nor will it resize its own window.")
 
-(defvar vm-mutable-frames nil
+(defvar vm-mutable-frames t
   "*Non-nil value means VM is allowed to create and destroy frames
-to display and undisplay buffers.
+to display and undisplay buffers.  Whether VM actually does
+so depends on the value of the variables with names prefixed by
+`vm-frame-per-'.
 
 VM can create a frame to display a buffer, and delete frame to
 undisplay a buffer.  A nil value means VM should not create or
 delete frames.
 
-This variable is _not_ an analogue of vm-mutable-windows.  VM
-still might create frames if this variable is nil.  If you set
-the vm-frame-per-* variables VM will still create frames.  Using
-the vm-frame-per-* variables you have more control over when it
-happens.
-
-Users should consider setting vm-frame-per-folder and
-vm-frame-per-composition and/or using the -other-frame commands
-instead of setting this variable.  If vm-mutable-frames is set to t,
-then vm-mutable-windows should probably be set to nil so that you
-avoid splitting frames.
+This variable used to have a different meaning but it was changed
+to better reflect what users expected.  This variable is now a
+frame analogue of vm-mutable-windows.
 
 This variable does not apply to the VM commands whose
-names end in -other-frame, which always create a new frame.
-
-This variable has no meaning if you're not running Emacs native
-under X Windows or some other window system that allows multiple
-Emacs frames.")
+names end in -other-frame, which always create a new frame.")
 
 (defvar vm-raise-frame-at-startup t
   "*Specifies whether VM should raise its frame at startup.
@@ -1671,9 +1671,10 @@
 does not apply to the VM commands whose names end in
 -other-frame, which always create a new frame.
 
-This variable has no meaning if you're not running Emacs native
-under X Windows or some other window system that allows multiple
-Emacs frames.")
+This variable has no meaning if you're not running under an Emacs
+capable of displaying multiple real or virtual frames.  Note that
+Emacs supports multiple virtual frames on dumb terminals, and
+VM will use them.")
 
 (defvar vm-frame-per-summary nil
   "*Non-nil value causes VM to display the folder summary in its own frame.
@@ -1681,9 +1682,10 @@
 This variable does not apply to vm-summarize-other-frame, which
 always create a new frame.
 
-This variable has no meaning if you're not running Emacs native
-under X Windows or some other window system that allows multiple
-Emacs frames.")
+This variable has no meaning if you're not running under an Emacs
+capable of displaying multiple real or virtual frames.  Note that
+Emacs supports multiple virtual frames on dumb terminals, and
+VM will use them.")
 
 (defvar vm-frame-per-composition t
   "*Non-nil value causes the mail composition commands to open a new frame.
@@ -1691,9 +1693,10 @@
 does not apply to the VM commands whose names end in
 -other-frame, which always create a new frame.
 
-This variable has no meaning if you're not running Emacs native
-under X Windows or some other window system that allows multiple
-Emacs frames.")
+This variable has no meaning if you're not running under an Emacs
+capable of displaying multiple real or virtual frames.  Note that
+Emacs supports multiple virtual frames on dumb terminals, and
+VM will use them.")
 
 (defvar vm-frame-per-edit t
   "*Non-nil value causes vm-edit-message to open a new frame.
@@ -1701,9 +1704,19 @@
 variable does not apply to vm-edit-message-other-frame, which
 always create a new frame.
 
-This variable has no meaning if you're not running Emacs native
-under X Windows or some other window system that allows multiple
-Emacs frames.")
+This variable has no meaning if you're not running under an Emacs
+capable of displaying multiple real or virtual frames.  Note that
+Emacs support multiple virtual frames on dumb terminals, and
+VM will use them.")
+
+(defvar vm-frame-per-help nil
+  "*Non-nil value causes VM to open a new frame to display help buffers.
+Nil means the VM will use the current frame.
+
+This variable has no meaning if you're not running under an Emacs
+capable of displaying multiple real or virtual frames.  Note that
+Emacs supports multiple virtual frames on dumb terminals, and
+VM will use them.")
 
 (defvar vm-frame-per-completion t
   "*Non-nil value causes VM to open a new frame on mouse
@@ -1721,7 +1734,8 @@
 
 This variable has no meaning if you're not running Emacs native
 under X Windows or some other window system that allows multiple
-Emacs frames.")
+real Emacs frames.  Note that Emacs supports virtual frames under
+ttys but VM will not use these to display completion information.")
 
 (defvar vm-frame-parameter-alist nil
   "*Non-nil value is an alist of types and lists of frame parameters.
@@ -1750,10 +1764,7 @@
    (e.g. created by vm-summarize-other-frame)
 
 PARAMLIST is a list of pairs as described in the documentation for
-the function `make-frame'.
-
-This variable has no effect on frames created as a result of
-having vm-mutable-frames set to non-nil.")
+the function `make-frame'.")
 
 (defvar vm-search-other-frames t
   "*Non-nil means VM should search frames other than the selected frame
@@ -2307,7 +2318,10 @@
 (defvar vm-mosaic-program-switches nil
   "*List of command line switches to pass to Mosaic.")
 
-(defvar vm-temp-file-directory "/tmp"
+(defvar vm-temp-file-directory
+  (or (and (file-directory-p "/tmp") "/tmp")
+      (and (file-directory-p "C:\\") "C:\\")
+      "/tmp")
   "*Name of a directory where VM can put temporary files.
 This name must not end with a slash.")
 
@@ -2339,7 +2353,8 @@
     (define-key map "t" 'vm-expose-hidden-headers)
     (define-key map " " 'vm-scroll-forward)
     (define-key map "b" 'vm-scroll-backward)
-    (define-key map "\C-?" 'vm-scroll-backward)
+    (define-key map 'delete 'vm-scroll-backward)
+    (define-key map 'backspace 'vm-scroll-backward)
     (define-key map "D" 'vm-decode-mime-message)
     (define-key map "d" 'vm-delete-message)
     (define-key map "\C-d" 'vm-delete-message-backward)
@@ -2433,6 +2448,17 @@
     (define-key map "8" 'digit-argument)
     (define-key map "9" 'digit-argument)
     (define-key map "-" 'negative-argument)
+    (cond ((fboundp 'set-keymap-name)
+	   (set-keymap-name map 'vm-mode-map)
+	   (set-keymap-name (lookup-key map "l")
+			    "VM mode message labels map")
+	   (set-keymap-name (lookup-key map "V")
+			    "VM mode virtual folders map")
+	   (set-keymap-name (lookup-key map "M")
+			    "VM mode message marks map")
+	   (set-keymap-name (lookup-key map "W")
+			    "VM mode window configuration map")))
+
     map )
   "Keymap for VM mode.")
 
@@ -2445,12 +2471,15 @@
     (define-key map "\C-c\C-p" 'vm-mime-preview-composition)
     (define-key map "\C-c\C-e" 'vm-mime-encode-composition)
     (define-key map "\C-c\C-a" 'vm-mime-attach-file)
-    (define-key map "\C-c\C-m" 'vm-mime-attach-mime-file)
+;;    (define-key map "\C-c\C-m" 'vm-mime-attach-mime-file)
     (define-key map "\C-c\C-y" 'vm-yank-message)
     (define-key map "\C-c\C-s" 'vm-mail-send)
     (define-key map "\C-c\C-c" 'vm-mail-send-and-exit)
+    (cond ((fboundp 'set-keymap-name)
+	   (set-keymap-name map 'vm-mail-mode-map)))
     map )
-  "Keymap for VM Mail mode buffers.")
+  "Keymap for VM Mail mode buffers.
+Its parent keymap is mail-mode-map.")
 
 (defvar vm-edit-message-map
   (let ((map (make-sparse-keymap)))
@@ -2458,6 +2487,8 @@
     (define-key map "\C-c\e" 'vm-edit-message-end)
     (define-key map "\C-c\C-c" 'vm-edit-message-end)
     (define-key map "\C-c\C-]" 'vm-edit-message-abort)
+    (cond ((fboundp 'set-keymap-name)
+	   (set-keymap-name map 'vm-edit-message-map)))
     map )
   "Keymap for the buffers created by VM's vm-edit-message command.")
 
@@ -2882,7 +2913,7 @@
 ;; is loaded before highlight-headers.el
 (defvar highlight-headers-regexp "Subject[ \t]*:")
 (defvar vm-url-regexp
-  "<URL:\\([^>]+\\)>\\|\\(\\(file\\|ftp\\|gopher\\|http\\|https\\|news\\|wais\\|www\\)://[^ \t\n\f\r\"<>|()]*[^ \t\n\f\r\"<>|.!?(){}]\\)\\|\\(mailto:[^ \t\n\f\r\"<>|()]*[^ \t\n\f\r\"<>|.!?(){}]\\)"
+  "<URL:\\([^>\n]+\\)>\\|\\(\\(file\\|ftp\\|gopher\\|http\\|https\\|news\\|wais\\|www\\)://[^ \t\n\f\r\"<>|()]*[^ \t\n\f\r\"<>|.!?(){}]\\)\\|\\(mailto:[^ \t\n\f\r\"<>|()]*[^ \t\n\f\r\"<>|.!?(){}]\\)"
   "Regular expression that matches an absolute URL.
 The URL itself must be matched by a \\(..\\) grouping.
 VM will extract the URL by copying the lowest number grouping
@@ -2913,6 +2944,7 @@
 (make-variable-buffer-local 'vm-summary-overlay)
 (defvar vm-thread-loop-obarray (make-vector 29 0))
 (defvar vm-delete-duplicates-obarray (make-vector 29 0))
+(defvar vm-image-obarray (make-vector 29 0))
 (defvar vm-mail-mode-map-parented nil)
 (defvar vm-xface-cache (make-vector 29 0))
 (defconst vm-mime-base64-alphabet
@@ -3052,3 +3084,17 @@
 (defvar vm-frame-list nil)
 (if (not (boundp 'shell-command-switch))
     (defvar shell-command-switch "-c"))
+
+(defconst vm-xemacs-p nil)
+(defconst vm-xemacs-mule-p nil)
+(defconst vm-fsfemacs-19-p nil)
+(defun vm-xemacs-p () vm-xemacs-p)
+(defun vm-xemacs-mule-p () vm-xemacs-mule-p)
+(defun vm-fsfemacs-19-p () vm-fsfemacs-19-p)
+(defun vm-note-emacs-version ()
+  (setq vm-xemacs-p (string-match "XEmacs" emacs-version)
+	vm-xemacs-mule-p (and vm-xemacs-p (featurep 'mule)
+			      ;; paranoia
+			      (fboundp 'set-file-coding-system))
+	vm-fsfemacs-19-p (not vm-xemacs-p)))
+(vm-note-emacs-version)
--- a/lisp/vm/vm-version.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-version.el	Mon Aug 13 08:57:55 2007 +0200
@@ -2,7 +2,7 @@
 
 (provide 'vm-version)
 
-(defconst vm-version "6.22"
+(defconst vm-version "6.34"
   "Version number of VM.")
 
 (defun vm-version ()
--- a/lisp/vm/vm-virtual.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-virtual.el	Mon Aug 13 08:57:55 2007 +0200
@@ -248,7 +248,13 @@
 	   (list name
 		 (list (list (list 'get-buffer (buffer-name)))
 		       (if arg (list selector arg) (list selector))))))
-    (vm-visit-virtual-folder name read-only)))
+    (vm-visit-virtual-folder name read-only))
+  ;; have to do this again here because the known virtual
+  ;; folder menu is now hosed because we installed it while
+  ;; vm-virtual-folder-alist was bound to the temp value above
+  (if vm-use-menus
+      (vm-menu-install-known-virtual-folders-menu)))
+
 
 (defun vm-apply-virtual-folder (name &optional read-only)
   "Apply the selectors of a named virtual folder to the current folder
@@ -275,7 +281,12 @@
       (setq clauses (cdr clauses)))
     (setcar vfolder (format "%s/%s" (buffer-name) (car vfolder)))
     (setq vm-virtual-folder-alist (list vfolder))
-    (vm-visit-virtual-folder (car vfolder) read-only)))
+    (vm-visit-virtual-folder (car vfolder) read-only))
+  ;; have to do this again here because the known virtual
+  ;; folder menu is now hosed because we installed it while
+  ;; vm-virtual-folder-alist was bound to the temp value above
+  (if vm-use-menus
+      (vm-menu-install-known-virtual-folders-menu)))
 
 (defun vm-toggle-virtual-mirror ()
   (interactive)
--- a/lisp/vm/vm-window.el	Mon Aug 13 08:57:25 2007 +0200
+++ b/lisp/vm/vm-window.el	Mon Aug 13 08:57:55 2007 +0200
@@ -74,8 +74,7 @@
 	    (if (and vm-display-buffer-hook
 		     (null (vm-get-visible-buffer-window buffer)))
 		(progn (run-hooks 'vm-display-buffer-hook)
-		       (switch-to-buffer buffer)
-		       (vm-record-current-window-configuration nil))
+		       (switch-to-buffer buffer))
 	      (if (not (and (memq this-command commands)
 			    (apply 'vm-set-window-configuration configs)
 			    (vm-get-visible-buffer-window buffer)))
@@ -84,8 +83,7 @@
 	    (if (and vm-undisplay-buffer-hook
 		     (vm-get-visible-buffer-window buffer))
 		(progn (set-buffer buffer)
-		       (run-hooks 'vm-undisplay-buffer-hook)
-		       (vm-record-current-window-configuration nil))
+		       (run-hooks 'vm-undisplay-buffer-hook))
 	      (if (not (and (memq this-command commands)
 			    (apply 'vm-set-window-configuration configs)))
 		  (vm-undisplay-buffer buffer))))
@@ -94,8 +92,7 @@
 
 (defun vm-display-buffer (buffer)
   (let ((pop-up-windows (eq vm-mutable-windows t))
-	(pop-up-frames vm-mutable-frames))
-    (vm-record-current-window-configuration nil)
+	(pop-up-frames (and pop-up-frames vm-mutable-frames)))
     (if (or pop-up-frames
 	    (and (eq vm-mutable-windows t)
 		 (symbolp
@@ -107,9 +104,11 @@
 
 (defun vm-undisplay-buffer (buffer)
   (vm-save-buffer-excursion
-    (vm-delete-windows-or-frames-on buffer)
-    (let ((w (vm-get-buffer-window buffer)))
-      (and w (set-window-buffer w (other-buffer))))))
+   (let ((vm-mutable-frames (and vm-mutable-frames pop-up-frames)))
+     (vm-maybe-delete-windows-or-frames-on buffer))
+   (let (w)
+     (while (setq w (vm-get-buffer-window buffer))
+       (set-window-buffer w (other-buffer buffer))))))
 
 (defun vm-load-window-configurations (file)
   (save-excursion
@@ -133,8 +132,8 @@
 	  (progn
 	    (set-buffer (setq work-buffer (get-buffer-create "*vm-wconfig*")))
 	    ;; for XEmacs/MULE
-	    (and (vm-xemacs-mule-p)
-		 (set-file-coding-system 'no-conversion))
+	    (and vm-xemacs-mule-p
+		 (set-buffer-file-coding-system 'no-conversion))
 	    (erase-buffer)
 	    (print vm-window-configurations (current-buffer))
 	    (write-region (point-min) (point-max) file nil 0))
@@ -183,14 +182,6 @@
       (vm-check-for-killed-presentation)
       (if vm-presentation-buffer
 	  (setq message vm-presentation-buffer))
-      ;; if this configuration is already the current one, don't
-      ;; set it up again.
-      (if (or (and vm-mutable-frames (eq (car config) vm-window-configuration))
-	      (and (not vm-mutable-frames)
-		   (listp vm-window-configuration)
-		   (eq (car config)
-		       (cdr (assq selected-frame vm-window-configuration)))))
-	  (throw 'done nil))
       (vm-check-for-killed-summary)
       (or summary (setq summary (or vm-summary-buffer nonexistent-summary)))
       (or composition (setq composition nonexistent))
@@ -203,7 +194,7 @@
 					      x ))))
       (set-tapestry (nth 1 config) 1)
       (and (get-buffer nonexistent)
-	   (vm-delete-windows-or-frames-on nonexistent))
+	   (vm-maybe-delete-windows-or-frames-on nonexistent))
       (if (and (vm-get-buffer-window nonexistent-summary)
 	       (not (vm-get-buffer-window message)))
 	  ;; user asked for summary to be displayed but doesn't
@@ -211,31 +202,9 @@
 	  ;; the user not to lose here.
 	  (vm-replace-buffer-in-windows nonexistent-summary message)
 	(and (get-buffer nonexistent-summary)
-	     (vm-delete-windows-or-frames-on nonexistent-summary)))
-      (vm-record-current-window-configuration config)
+	     (vm-maybe-delete-windows-or-frames-on nonexistent-summary)))
       config )))
 
-(defun vm-record-current-window-configuration (config)
-  ;; this function continues to be a no-op.
-  ;;
-  ;; the idea behind this function is that VM can remember what
-  ;; the current window configuration is and not rebuild the
-  ;; configuration for the next command if it matches what we
-  ;; have recorded.
-  ;;
-  ;; the problem with this idea is that the user can do things
-  ;; like C-x 0 and VM has no way of knowing.  So VM thinks the
-  ;; right configuration is displayed when in fact it is not,
-  ;; which can cause incorrect displays.
-  '(let (cell)
-    (if (and (listp vm-window-configuration)
-	     (setq cell (assq (vm-selected-frame) vm-window-configuration)))
-	(setcdr cell (car config))
-      (setq vm-window-configuration
-	    (cons
-	     (cons (vm-selected-frame) (car config))
-	     vm-window-configuration)))))
-
 (defun vm-save-window-configuration (tag)
   "Name and save the current window configuration.
 With this command you associate the current window setup with an
@@ -253,11 +222,7 @@
 configuration found is the one that is applied.
 
 The value of vm-mutable-windows must be non-nil for VM to use
-window configurations.
-
-If vm-mutable-frames is non-nil and Emacs is running under X
-windows, then VM will use all existing frames.  Otherwise VM will
-restrict its changes to the frame in which it was started."
+window configurations."
   (interactive
    (let ((last-command last-command)
 	 (this-command this-command))
@@ -366,7 +331,7 @@
 (defun vm-window-loop (action obj-1 &optional obj-2)
   (let ((delete-me nil)
 	(done nil)
-	(all-frames (if vm-mutable-frames t nil))
+	(all-frames (if vm-search-other-frames t nil))
 	start w)
     (setq start (next-window (selected-window) 'nomini all-frames)
 	  w start)
@@ -440,7 +405,7 @@
 	      (vm-error-free-call 'vm-delete-frame delete-me)
 	      (setq delete-me nil))))))
 
-(defun vm-delete-windows-or-frames-on (buffer)
+(defun vm-maybe-delete-windows-or-frames-on (buffer)
   (and (eq vm-mutable-windows t) (vm-window-loop 'delete buffer))
   (and vm-mutable-frames (vm-frame-loop 'delete buffer)))
 
@@ -449,7 +414,7 @@
 
 (defun vm-bury-buffer (&optional buffer)
   (or buffer (setq buffer (current-buffer)))
-  (if (vm-xemacs-p)
+  (if vm-xemacs-p
       (if (vm-multiple-frames-possible-p)
 	  (vm-frame-loop 'bury buffer)
 	(bury-buffer buffer))
@@ -509,7 +474,7 @@
 	  (and w (eq (vm-selected-frame) wf) (vm-created-this-frame-p wf)
 	       (vm-error-free-call 'vm-delete-frame wf))
 	  (and w (let ((vm-mutable-frames t))
-		   (vm-delete-windows-or-frames-on b)))))))
+		   (vm-maybe-delete-windows-or-frames-on b)))))))
 
 (defun vm-register-frame (frame)
   (setq vm-frame-list (cons frame vm-frame-list)))
@@ -533,7 +498,8 @@
 	 (vm-warp-mouse-to-frame-maybe (vm-selected-frame)))))
 
 (defun vm-goto-new-summary-frame-maybe ()
-  (if (and vm-frame-per-summary (vm-multiple-frames-possible-p))
+  (if (and vm-mutable-frames vm-frame-per-summary
+	   (vm-multiple-frames-possible-p))
       (let ((w (vm-get-buffer-window vm-summary-buffer)))
 	(if (null w)
 	    (progn
@@ -545,7 +511,8 @@
 		 (vm-warp-mouse-to-frame-maybe (vm-window-frame w))))))))
 
 (defun vm-goto-new-folder-frame-maybe (&rest types)
-  (if (and vm-frame-per-folder (vm-multiple-frames-possible-p))
+  (if (and vm-mutable-frames vm-frame-per-folder
+	   (vm-multiple-frames-possible-p))
       (let ((w (or (vm-get-buffer-window (current-buffer))
 		   ;; summary == folder for the purpose
 		   ;; of frame reuse.
@@ -566,7 +533,7 @@
 
 (defun vm-warp-mouse-to-frame-maybe (&optional frame)
   (or frame (setq frame (vm-selected-frame)))
-  (if (vm-mouse-support-possible-p)
+  (if (vm-mouse-support-possible-here-p)
       (cond ((vm-mouse-xemacs-mouse-p)
 	     (cond ((fboundp 'mouse-position);; XEmacs 19.12
 		    (let ((mp (mouse-position)))
@@ -644,12 +611,15 @@
 ;; absent under Emacs 19.34.  So vm-frame-per-summary won't work
 ;; quite right under these Emacs versions.  XEmacs 19.15 should
 ;; have a working version of this function.
-(if (and (fboundp 'frame-totally-visible-p)
-	 (vm-xemacs-p)
-	 (or (>= emacs-major-version 20)
-	     (>= emacs-minor-version 15)))
-    (fset 'vm-frame-totally-visible-p 'frame-totally-visible-p)
-  (fset 'vm-frame-totally-visible-p 'vm-frame-visible-p))
+;; 2 April 1997, frame-totally-visible-p apparently still broken
+;; under 19.15.  I give up for now.
+;;(if (and (fboundp 'frame-totally-visible-p)
+;;	 vm-xemacs-p
+;;	 (or (>= emacs-major-version 20)
+;;	     (>= emacs-minor-version 15)))
+;;    (fset 'vm-frame-totally-visible-p 'frame-totally-visible-p)
+;;  (fset 'vm-frame-totally-visible-p 'vm-frame-visible-p))
+(fset 'vm-frame-totally-visible-p 'vm-frame-visible-p)
 
 (fset 'vm-window-frame
       (symbol-function
--- a/man/internals/internals.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/internals/internals.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -209,7 +209,7 @@
 Buffers and Textual Representation
 
 * Introduction to Buffers::     A buffer holds a block of text such as a file.
-* A Buffer's Text::            Representation of the text in a buffer.
+* A Buffer's Text::             Representation of the text in a buffer.
 * Buffer Lists::                Keeping track of all buffers.
 * Markers and Extents::         Tagging locations within a buffer.
 * Bufbytes and Emchars::        Representation of individual characters.
@@ -491,6 +491,12 @@
 version 19.14 released June 23, 1996.
 @item
 version 20.0 released February 9, 1997.
+@item
+version 19.15 released March 28, 1997.
+@item
+version 20.1 (not released to the net) April 15, 1997.
+@item
+version 20.2 released May 16, 1997.
 @end itemize
 
 @node GNU Emacs 19
@@ -579,6 +585,8 @@
 @cindex Illinois, University of
 @cindex SPARCWorks
 @cindex Andreessen, Marc
+@cindex Baur, Steve
+@cindex Buchholz, Martin
 @cindex Kaplan, Simon
 @cindex Wing, Ben
 @cindex Thompson, Chuck
@@ -608,11 +616,23 @@
 Communications Corp. (co-founded by the same Marc Andreessen, who had
 quit his Epoch job to work on a graphical browser for the World Wide
 Web).  Chuck then become the primary maintainer of XEmacs, and put out
-versions 19.11, 19.12, and 19.13 in conjunction with Ben.  For 19.12 and
+versions 19.11 through 19.14 in conjunction with Ben.  For 19.12 and
 19.13, Chuck added the new redisplay and many other display improvements
 and Ben added MULE support (support for Asian and other languages) and
 redesigned most of the internal Lisp subsystems to better support the
-MULE work and the various other features being added to XEmacs.
+MULE work and the various other features being added to XEmacs.  After
+19.14 Chuck retired as primary maintainer and Steve Baur stepped in.
+
+@cindex MULE merged XEmacs appears
+  Soon after 19.13 was released, work began in earnest on the MULE
+internationalization code and the source tree was divided into two
+development paths.  The MULE version was initially called 19.20, but was
+soon renamed to 20.0.  In 1996 Martin Buchholz of Sun Microsystems took
+over the care and feeding of it and worked on it in parallel with the
+19.14 development that was occurring at the same time.  After much work
+by Martin, it was decided to release 20.0 ahead of 19.15 in February
+1997.  The source tree remained divided until 20.1 when the version 19
+source was finally retired.
 
 @cindex merging attempts
   Many attempts have been made to merge XEmacs and GNU Emacs, but they
@@ -1799,9 +1819,12 @@
 to the Lisp primitive as displayed in its documentation, modulo the same
 concerns described above for @code{F...} names (in particular,
 underscores in the C arguments become dashes in the Lisp arguments).
-There is one additional kludge: A C argument called @code{defalt}
-becomes the Lisp argument @code{default}.  This deliberate misspelling
-is done because @code{default} is a reserved word in the C language.
+
+There is one additional kludge: A trailing `_' on the C argument is
+discarded when forming the Lisp argument.  This allows C language
+reserved words (like @code{default}) or global symbols (like
+@code{dirname}) to be used as argument names without compiler warnings
+or errors.
 
 A Lisp function with @w{@var{max} = @code{UNEVALLED}} is a
 @w{@dfn{special form}}; its arguments are not evaluated.  Instead it
@@ -5322,7 +5345,7 @@
 
 @menu
 * Introduction to Buffers::     A buffer holds a block of text such as a file.
-* A Buffer's Text::            Representation of the text in a buffer.
+* A Buffer's Text::             Representation of the text in a buffer.
 * Buffer Lists::                Keeping track of all buffers.
 * Markers and Extents::         Tagging locations within a buffer.
 * Bufbytes and Emchars::        Representation of individual characters.
--- a/man/lispref/annotations.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/annotations.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -142,7 +142,7 @@
 
 @defun delete-annotation annotation
 This function removes @var{annotation} from its buffer.  This does not
-modify the buffer text.  The annotation deleted is returned.
+modify the buffer text.
 @end defun
 
 @defun annotationp annotation
--- a/man/lispref/buffers.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/buffers.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -682,10 +682,10 @@
 that is not visible in any window in a visible frame.
 
 If the selected frame has a non-@code{nil} @code{buffer-predicate}
-parameter, then @code{other-buffer} uses that predicate to decide which
+property, then @code{other-buffer} uses that predicate to decide which
 buffers to consider.  It calls the predicate once for each buffer, and
 if the value is @code{nil}, that buffer is ignored.  @xref{X Frame
-Parameters}.
+Properties}.
 
 @c Emacs 19 feature
 If @var{visible-ok} is @code{nil}, @code{other-buffer} avoids returning
--- a/man/lispref/building.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/building.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -134,8 +134,8 @@
 @example
 @group
 (emacs-version)
-  @result{} "XEmacs 20.0 [Lucid] (i586-unknown-linux2.0.18)
-                 of Wed Feb  6 1997 on nene"
+  @result{} "XEmacs 20.1 [Lucid] (i586-unknown-linux2.0.29)
+                 of Mon Apr  7 1997 on altair.xemacs.org"
 @end group
 @end example
 
@@ -149,15 +149,15 @@
 
 @example
 @group
-emacs-build-time
-     @result{} "Wed Mar  6 14:55:57 1996"
+emacs-build-time "Mon Apr  7 20:28:52 1997"
+     @result{} 
 @end group
 @end example
 @end defvar
 
 @defvar emacs-version
 The value of this variable is the version of Emacs being run.  It is a
-string, e.g. @code{"20.0 XEmacs Lucid"}.
+string, e.g. @code{"20.1 XEmacs Lucid"}.
 @end defvar
 
   The following two variables did not exist before FSF GNU Emacs version
@@ -166,12 +166,12 @@
 
 @defvar emacs-major-version
 The major version number of Emacs, as an integer.  For XEmacs version
-20.0, the value is 20.
+20.1, the value is 20.
 @end defvar
 
 @defvar emacs-minor-version
 The minor version number of Emacs, as an integer.  For XEmacs version
-20.0, the value is 0.
+20.1, the value is 1.
 @end defvar
 
 @node Pure Storage
--- a/man/lispref/commands.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/commands.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -723,27 +723,29 @@
 @end defvar
 
 @defvar last-command-char
+
 If the value of @code{last-command-event} is a keyboard event, then this
-is the nearest @sc{ASCII} equivalent to it.  This is the value that
-@code{self-insert-command} will put in the buffer.  Remember that there
-is @emph{not} a 1:1 mapping between keyboard events and @sc{ASCII}
-characters: the set of keyboard events is much larger, so writing code
-that examines this variable to determine what key has been typed is bad
-practice, unless you are certain that it will be one of a small set of
-characters.
+is the nearest character equivalent to it (or @code{nil} if there is no
+character equivalent).  @code{last-command-char} is the character that
+@code{self-insert-command} will insert in the buffer.  Remember that
+there is @emph{not} a one-to-one mapping between keyboard events and
+XEmacs characters: many keyboard events have no corresponding character,
+and when the Mule feature is available, most characters can not be input
+on standard keyboards, except possibly with help from an input method.
+So writing code that examines this variable to determine what key has
+been typed is bad practice, unless you are certain that it will be one
+of a small set of characters.
 
-This function exists for compatibility with Emacs version 18.
+This variable exists for compatibility with Emacs version 18.
 
 @example
 @group
-last-command-char 
+last-command-char
 ;; @r{Now use @kbd{C-u C-x C-e} to evaluate that.}
-     @result{} 5
+     @result{} ?\^E
 @end group
 @end example
 
-@noindent
-The value is 5 because that is the @sc{ASCII} code for @kbd{C-e}.
 @end defvar
 
 @defvar current-mouse-event
@@ -820,7 +822,7 @@
 or released, button events specify the modifier keys that were held down
 at the time and the position of the pointer at the time.
 
-@item pointer-motion event
+@item motion event
   The pointer was moved.  Along with the position of the pointer, these events
 also specify the modifier keys that were held down at the time.
 
@@ -954,38 +956,72 @@
 @end table
 @end table
 
+@defun event-type event
+Return the type of @var{event}.
+
+This will be a symbol; one of
+
+@table @code
+@item key-press
+A key was pressed.
+@item button-press
+A mouse button was pressed.
+@item button-release
+A mouse button was released.
+@item motion
+The mouse moved.
+@item misc-user
+Some other user action happened; typically, this is
+a menu selection or scrollbar action.
+@item process
+Input is available from a subprocess.
+@item timeout
+A timeout has expired.
+@item eval
+This causes a specified action to occur when dispatched.
+@item magic
+Some window-system-specific event has occurred.
+@end table
+@end defun
+
 @node Event Predicates
 @subsection Event Predicates
 
-The following predicates return whether an object is an event of a particular
-type.
-
-@defun button-event-p object object
-This is true if @var{object} is a button-press or button-release event.
-@end defun
-
-@defun button-press-event-p object
-This is true if @var{object} is a mouse-button-press event.
-@end defun
-
-@defun button-release-event-p object
-This is true if @var{object} is a mouse-button-release event.
-@end defun
-
-@defun eval-event-p object
-This is true if @var{object} is an eval or misc-user event.
-@end defun
+The following predicates return whether an object is an event of a
+particular type.
 
 @defun key-press-event-p object
 This is true if @var{object} is a key-press event.
 @end defun
 
-@defun misc-user-event-p object
-This is true if @var{object} is a misc-user event.
+@defun button-event-p object object
+This is true if @var{object} is a mouse button-press or button-release
+event.
+@end defun
+
+@defun button-press-event-p object
+This is true if @var{object} is a mouse button-press event.
+@end defun
+
+@defun button-release-event-p object
+This is true if @var{object} is a mouse button-release event.
 @end defun
 
 @defun motion-event-p object
-This is true if @var{object} is a mouse-motion event.
+This is true if @var{object} is a mouse motion event.
+@end defun
+
+@defun mouse-event-p object
+This is true if @var{object} is a mouse button-press, button-release
+or motion event.
+@end defun
+
+@defun eval-event-p object
+This is true if @var{object} is an eval event.
+@end defun
+
+@defun misc-user-event-p object
+This is true if @var{object} is a misc-user event.
 @end defun
 
 @defun process-event-p object
@@ -1003,7 +1039,7 @@
 @node Accessing Mouse Event Positions
 @subsection Accessing the Position of a Mouse Event
 
-Unlike other events, mouse events (i.e. mouse-motion, button-press, and
+Unlike other events, mouse events (i.e. motion, button-press, and
 button-release events) occur in a particular location on the screen.
 Many primitives are provided for determining exactly where the event
 occurred and what is under that location.
@@ -1032,15 +1068,13 @@
 @defun event-x-pixel event
 This function returns the X position in pixels of the given mouse event.
 The value returned is relative to the frame the event occurred in.
-This will signal an error if the event is not a mouse-motion, button-press,
-or button-release event.
+This will signal an error if the event is not a mouse event.
 @end defun
 
 @defun event-y-pixel event
 This function returns the Y position in pixels of the given mouse event.
 The value returned is relative to the frame the event occurred in.
-This will signal an error if the event is not a mouse-motion, button-press,
-or button-release event.
+This will signal an error if the event is not a mouse event.
 @end defun
 
 @node Window-Level Event Position Info
@@ -1053,16 +1087,16 @@
 Given a mouse motion, button press, or button release event, compute and
 return the window on which that event occurred.  This may be @code{nil}
 if the event occurred in the border or over a toolbar.  The modeline is
-considered to be in the window it represents.
+considered to be within the window it describes.
 @end defun
 
 @defun event-buffer event
 Given a mouse motion, button press, or button release event, compute and
 return the buffer of the window on which that event occurred.  This may
 be @code{nil} if the event occurred in the border or over a toolbar.
-The modeline is considered to be in the window it represents.  This is
+The modeline is considered to be within the window it describes.  This is
 equivalent to calling @code{event-window} and then calling
-@code{event-buffer} on the result if it is a window.
+@code{window-buffer} on the result if it is a window.
 @end defun
 
 @defun event-window-x-pixel event
@@ -1206,8 +1240,8 @@
 @end defun
 
 @defun event-button event
-This function returns the button-number of the given mouse-button-press
-event.
+This function returns the button-number of the given button-press or
+button-release event.
 @end defun
 
 @defun event-modifiers event
--- a/man/lispref/consoles-devices.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/consoles-devices.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -27,13 +27,12 @@
 displayed at various locations within the display, be resized, etc.  For
 TTY, only one frame can be displayed at a time, and it occupies the
 entire TTY display area.
-@ignore @c Not yet implemented
-However, you can still define multiple frames
-and switch between them.  Their contents are entirely separate from each
-other.  These sorts of frames resemble the ``virtual console''
-capability provided under Linux or the multiple screens provided by the
-multiplexing program @samp{screen} under Unix.
-@end ignore
+
+However, you can still define multiple frames and switch between them.
+Their contents are entirely separate from each other.  These sorts of
+frames resemble the ``virtual console'' capability provided under Linux
+or the multiple screens provided by the multiplexing program
+@samp{screen} under Unix.
 
   When you start up XEmacs, an initial console and device are created to
 receive input and display frames on.  This will either be an X display
--- a/man/lispref/debugging.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/debugging.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -95,6 +95,18 @@
 errors also can invoke the debugger.  @xref{Processes}.
 @end defopt
 
+@defopt debug-ignored-errors
+This variable specifies certain kinds of errors that should not enter
+the debugger.  Its value is a list of error condition symbols and/or
+regular expressions.  If the error has any of those condition symbols,
+or if the error message matches any of the regular expressions, then
+that error does not enter the debugger, regardless of the value of
+@code{debug-on-error}.
+
+The normal value of this variable lists several errors that happen often
+during editing but rarely result from bugs in Lisp programs.
+@end defopt
+
   To debug an error that happens during loading of the @file{.emacs}
 file, use the option @samp{-debug-init}, which binds
 @code{debug-on-error} to @code{t} while @file{.emacs} is loaded and
--- a/man/lispref/files.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/files.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -455,8 +455,8 @@
 @deffn Command append-to-file start end filename
 This function appends the contents of the region delimited by
 @var{start} and @var{end} in the current buffer to the end of file
-@var{filename}.  If that file does not exist, it is created.  This
-function returns @code{nil}.
+@var{filename}.  If that file does not exist, it is created.  If that
+file exists it is overwritten.  This function returns @code{nil}.
 
 An error is signaled if @var{filename} specifies a nonwritable file,
 or a nonexistent file in a directory where files cannot be created.
@@ -1001,8 +1001,8 @@
 is in the group with @sc{gid} 75.
 
 @item (8489 20284)
-was last accessed on Aug 19 00:09.  Unfortunately, you cannot convert
-this number into a time string in XEmacs.
+was last accessed on Aug 19 00:09. Use @code{format-time-string} to
+! convert this number into a time string.  @xref{Time Conversion}.
 
 @item (8489 20284)
 was last modified on Aug 19 00:09.
@@ -1567,8 +1567,7 @@
 @defun file-relative-name filename &optional directory
 This function does the inverse of expansion---it tries to return a
 relative name that is equivalent to @var{filename} when interpreted
-relative to @var{directory}.  (If such a relative name would be longer
-than the absolute name, it returns the absolute name instead.)
+relative to @var{directory}.
 
 @c XEmacs feature?
 If @var{directory} is @code{nil} or omitted, the value of
@@ -1578,7 +1577,7 @@
 (file-relative-name "/foo/bar" "/foo/")
      @result{} "bar")
 (file-relative-name "/foo/bar" "/hack/")
-     @result{} "/foo/bar")
+     @result{} "../foo/bar")
 @end example
 @end defun
 
--- a/man/lispref/frames.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/frames.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -9,7 +9,7 @@
 @cindex frame
 
   A @var{frame} is a rectangle on the screen that contains one or more
-Emacs windows.  A frame initially contains a single main window (plus
+XEmacs windows.  A frame initially contains a single main window (plus
 perhaps a minibuffer window), which you can subdivide vertically or
 horizontally into smaller windows.
 
@@ -31,7 +31,7 @@
 
 @menu
 * Creating Frames::		Creating additional frames.
-* Frame Parameters::		Controlling frame size, position, font, etc.
+* Frame Properties::		Controlling frame size, position, font, etc.
 * Frame Titles::                Automatic updating of frame titles.
 * Deleting Frames::		Frames last until explicitly deleted.
 * Finding All Frames::		How to examine all existing frames.
@@ -53,81 +53,86 @@
 
 To create a new frame, call the function @code{make-frame}.
 
-@defun make-frame &optional alist device
+@defun make-frame &optional props device
 This function creates a new frame on @var{device}, if @var{device}
 permits creation of frames.  (An X server does; an ordinary terminal
-does not.)  @var{device} defaults to the selected device if omitted.
+does not (yet).)  @var{device} defaults to the selected device if omitted.
 @xref{Consoles and Devices}.
 
-The argument is an alist specifying frame parameters.  Any parameters
-not mentioned in @var{alist} default according to the value of the
-variable @code{default-frame-alist}.  For X devices, parameters not
-specified in @code{default-frame-alist} default in turn from
-@code{default-x-frame-alist} and, if not specified there, from the X
-resources.  For TTY devices, @code{default-tty-frame-alist} is
-consulted as well as @code{default-frame-alist}.
+The argument @var{props} is a property list (a list of alternating
+keyword-value specifications) of properties for the new frame. (An alist
+is accepted for backward compatibility but should not be passed in.) Any
+properties not mentioned in @var{props} default according to the value
+of the variable @code{default-frame-plist}.  For X devices, properties
+not specified in @code{default-frame-plist} default in turn from
+@code{default-x-frame-plist} and, if not specified there, from the X
+resources.  For TTY devices, @code{default-tty-frame-plist} is consulted
+as well as @code{default-frame-plist}.
 
-The set of possible parameters depends in principle on what kind of
+The set of possible properties depends in principle on what kind of
 window system XEmacs uses to display its frames.  @xref{X Frame
-Parameters}, for documentation of individual parameters you can specify
+Properties}, for documentation of individual properties you can specify
 when creating an X window frame.
 @end defun
 
-@node Frame Parameters
-@section Frame Parameters
+@node Frame Properties
+@section Frame Properties
 
-A frame has many parameters that control its appearance and behavior.
-Just what parameters a frame has depends on what display mechanism it
+A frame has many properties that control its appearance and behavior.
+Just what properties a frame has depends on which display mechanism it
 uses.
 
-Frame parameters exist for the sake of window systems.  A terminal frame
-has a few parameters, mostly for compatibility's sake; only the height,
-width and @code{buffer-predicate} parameters really do something.
+Frame properties exist for the sake of window systems.  A terminal frame
+has few properties, mostly for compatibility's sake; only the height,
+width and @code{buffer-predicate} properties really do something.
 
 @menu
-* Parameter Access::       How to change a frame's parameters.
-* Initial Parameters::	   Specifying frame parameters when you make a frame.
-* X Frame Parameters::     List of frame parameters.
-* Size and Position::      Changing the size and position of a frame.
-* Frame Name::             The name of a frame (as opposed to its title).
+* Property Access::	How to change a frame's properties.
+* Initial Properties::	Specifying frame properties when you make a frame.
+* X Frame Properties::	List of frame properties.
+* Size and Position::	Changing the size and position of a frame.
+* Frame Name::		The name of a frame (as opposed to its title).
 @end menu
 
-@node Parameter Access
-@subsection Access to Frame Parameters
+@node Property Access
+@subsection Access to Frame Properties
+
+These functions let you read and change the properties of a frame.
 
-These functions let you read and change the parameter values of a
-frame.
+@defun frame-properties &optional frame
+This function returns a plist listing all the properties of @var{frame}
+and their values.
+@end defun
 
-@defun frame-parameters frame
-The function @code{frame-parameters} returns an alist listing all the
-parameters of @var{frame} and their values.
+@defun frame-property frame property &optional default
+This function returns @var{frame}'s value for the property
+@var{property}.
 @end defun
 
-@defun modify-frame-parameters frame alist
-This function alters the parameters of frame @var{frame} based on the
-elements of @var{alist}.  Each element of @var{alist} has the form
-@code{(@var{parm} . @var{value})}, where @var{parm} is a symbol naming a
-parameter.  If you don't mention a parameter in @var{alist}, its value
-doesn't change.
+@defun set-frame-properties frame plist
+This function alters the properties of frame @var{frame} based on the
+elements of property list @var{plist}.  If you don't mention a property
+in @var{plist}, its value doesn't change.
+@end defun
+
+@defun set-frame-property frame prop val
+This function sets the property @var{prop} of frame @var{frame} to the
+value @var{val}.
 @end defun
 
-@node Initial Parameters
-@subsection Initial Frame Parameters
+@node Initial Properties
+@subsection Initial Frame Properties
 
-You can specify the parameters for the initial startup frame
-by setting @code{initial-frame-alist} in your @file{.emacs} file.
+You can specify the properties for the initial startup frame by setting
+@code{initial-frame-plist} in your @file{.emacs} file.
 
-@defvar initial-frame-alist
-This variable's value is an alist of parameter values used when creating
-the initial X window frame.  Each element has the form:
+@defvar initial-frame-plist
+This variable's value is a plist of alternating property-value pairs
+used when creating the initial X window frame.
 
-@example
-(@var{parameter} . @var{value})
-@end example
-
-Emacs creates the initial frame before it reads your @file{~/.emacs}
-file.  After reading that file, Emacs checks @code{initial-frame-alist},
-and applies the parameter settings in the altered value to the already
+XEmacs creates the initial frame before it reads your @file{~/.emacs}
+file.  After reading that file, XEmacs checks @code{initial-frame-plist},
+and applies the property settings in the altered value to the already
 created initial frame.
 
 If these settings affect the frame geometry and appearance, you'll see
@@ -139,40 +144,40 @@
 X resource settings typically apply to all frames.  If you want to
 specify some X resources solely for the sake of the initial frame, and
 you don't want them to apply to subsequent frames, here's how to achieve
-this.  Specify parameters in @code{default-frame-alist} to override the
-X resources for subsequent frames; then, to prevent these from affecting
-the initial frame, specify the same parameters in
-@code{initial-frame-alist} with values that match the X resources.
+this: specify properties in @code{default-frame-plist} to override the X
+resources for subsequent frames; then, to prevent these from affecting
+the initial frame, specify the same properties in
+@code{initial-frame-plist} with values that match the X resources.
 @end defvar
 
-If these parameters specify a separate minibuffer-only frame with
-@code{(minibuffer . nil)}, and you have not created one, Emacs creates
-one for you.
+If these properties specify a separate minibuffer-only frame via a
+@code{minibuffer} property of @code{nil}, and you have not yet created
+one, XEmacs creates one for you.
 
-@defvar minibuffer-frame-alist
-This variable's value is an alist of parameter values used when creating
-an initial minibuffer-only frame---if such a frame is needed, according
-to the parameters for the main initial frame.
+@defvar minibuffer-frame-plist
+This variable's value is a plist of properties used when creating an
+initial minibuffer-only frame---if such a frame is needed, according to
+the properties for the main initial frame.
 @end defvar
 
-@defvar default-frame-alist
-This is an alist specifying default values of frame parameters for
-subsequent Emacs frames (not the initial ones).
+@defvar default-frame-plist
+This is a plist specifying default values of frame properties for
+subsequent XEmacs frames (not the initial ones).
 @end defvar
 
-See also @code{special-display-frame-alist}, in @ref{Choosing Window}.
+See also @code{special-display-frame-plist}, in @ref{Choosing Window}.
 
-If you use options that specify window appearance when you invoke Emacs,
-they take effect by adding elements to @code{default-frame-alist}.  One
+If you use options that specify window appearance when you invoke XEmacs,
+they take effect by adding elements to @code{default-frame-plist}.  One
 exception is @samp{-geometry}, which adds the specified position to
-@code{initial-frame-alist} instead.  @xref{Command Arguments,,, emacs,
+@code{initial-frame-plist} instead.  @xref{Command Arguments,,, emacs,
 The XEmacs User's Manual}.
 
-@node X Frame Parameters
-@subsection X Window Frame Parameters
+@node X Frame Properties
+@subsection X Window Frame Properties
 
-Just what parameters a frame has depends on what display mechanism it
-uses.  Here is a table of the parameters of an X window frame; of these,
+Just what properties a frame has depends on what display mechanism it
+uses.  Here is a table of the properties of an X window frame; of these,
 @code{name}, @code{height}, @code{width}, and @code{buffer-predicate}
 provide meaningful information in non-X frames.
 
@@ -180,11 +185,11 @@
 @item name
 The name of the frame.  Most window managers display the frame's name in
 the frame's border, at the top of the frame.  If you don't specify a
-name, and you have more than one frame, Emacs sets the frame name based
+name, and you have more than one frame, XEmacs sets the frame name based
 on the buffer displayed in the frame's selected window.
 
 If you specify the frame name explicitly when you create the frame, the
-name is also used (instead of the name of the Emacs executable) when
+name is also used (instead of the name of the XEmacs executable) when
 looking up X resources for the frame.
 
 @item display
@@ -201,7 +206,7 @@
 A negative number @minus{}@var{pos}, or a list of the form @code{(-
 @var{pos})}, actually specifies the position of the right edge of the
 window with respect to the right edge of the screen.  A positive value
-of @var{pos} counts toward the left.  If the parameter is a negative
+of @var{pos} counts toward the left.  If the property is a negative
 integer @minus{}@var{pos} then @var{pos} is positive!
 
 @item top
@@ -213,7 +218,7 @@
 A negative number @minus{}@var{pos}, or a list of the form @code{(-
 @var{pos})}, actually specifies the position of the bottom edge of the
 window with respect to the bottom edge of the screen.  A positive value
-of @var{pos} counts toward the top.  If the parameter is a negative
+of @var{pos} counts toward the top.  If the property is a negative
 integer @minus{}@var{pos} then @var{pos} is positive!
 
 @item icon-left
@@ -229,9 +234,9 @@
 @item user-position
 Non-@code{nil} if the screen position of the frame was explicitly
 requested by the user (for example, with the @samp{-geometry} option).
-Nothing automatically makes this parameter non-@code{nil}; it is up to
-Lisp programs that call @code{make-frame} to specify this parameter as
-well as specifying the @code{left} and @code{top} parameters.
+Nothing automatically makes this property non-@code{nil}; it is up to
+Lisp programs that call @code{make-frame} to specify this property as
+well as specifying the @code{left} and @code{top} properties.
 
 @item height
 The height of the frame contents, in characters.  (To get the height in
@@ -318,8 +323,8 @@
 @cindex position of frame
 
   You can read or change the size and position of a frame using the
-frame parameters @code{left}, @code{top}, @code{height}, and
-@code{width}.  Whatever geometry parameters you don't specify are chosen
+frame properties @code{left}, @code{top}, @code{height}, and
+@code{width}.  Whatever geometry properties you don't specify are chosen
 by the window manager in its usual fashion.
 
   Here are some special features for working with sizes and positions:
@@ -327,7 +332,7 @@
 @defun set-frame-position frame left top
 This function sets the position of the top left corner of @var{frame} to
 @var{left} and @var{top}.  These arguments are measured in pixels, and
-count from the top left corner of the screen.  Negative parameter values
+count from the top left corner of the screen.  Negative property values
 count up or rightward from the top left corner of the screen.
 @end defun
 
@@ -364,19 +369,19 @@
 @defun x-parse-geometry geom
 @cindex geometry specification
 The function @code{x-parse-geometry} converts a standard X windows
-geometry string to an alist that you can use as part of the argument to
+geometry string to a plist that you can use as part of the argument to
 @code{make-frame}.
 
-The alist describes which parameters were specified in @var{geom}, and
+The plist describes which properties were specified in @var{geom}, and
 gives the values specified for them.  Each element looks like
-@code{(@var{parameter} . @var{value})}.  The possible @var{parameter}
+@code{(@var{property} . @var{value})}.  The possible @var{property}
 values are @code{left}, @code{top}, @code{width}, and @code{height}.
 
-For the size parameters, the value must be an integer.  The position
-parameter names @code{left} and @code{top} are not totally accurate,
+For the size properties, the value must be an integer.  The position
+property names @code{left} and @code{top} are not totally accurate,
 because some values indicate the position of the right or bottom edges
 instead.  These are the @var{value} possibilities for the position
-parameters:
+properties:
 
 @table @asis
 @item an integer
@@ -421,7 +426,7 @@
 @defun frame-name &optional frame
 This function returns the name of @var{frame}, which defaults to the
 selected frame if not specified.  The name of a frame can also be
-obtained from the frame's parameters.  @xref{Frame Parameters}.
+obtained from the frame's properties.  @xref{Frame Properties}.
 @end defun
 
 @defvar default-frame-name
@@ -436,9 +441,9 @@
 Every frame has a title; most window managers display the frame title at
 the top of the frame.  You can specify an explicit title with the
 @code{name} frame property.  But normally you don't specify this
-explicitly, and Emacs computes the title automatically.
+explicitly, and XEmacs computes the title automatically.
 
-Emacs computes the frame title based on a template stored in the
+XEmacs computes the frame title based on a template stored in the
 variable @code{frame-title-format}.
 
 @defvar frame-title-format
@@ -496,7 +501,7 @@
 @ignore Not in XEmacs currently
   Some window managers provide a command to delete a window.  These work
 by sending a special message to the program that operates the window.
-When Emacs gets one of these commands, it generates a
+When XEmacs gets one of these commands, it generates a
 @code{delete-frame} event, whose normal definition is a command that
 calls the function @code{delete-frame}.  @xref{Misc Events}.
 @end ignore
@@ -658,7 +663,7 @@
 Only the selected terminal frame is actually displayed on the terminal.
 Each terminal screen except for the initial one has a number, and the
 number of the selected frame appears in the mode line after the word
-@samp{Emacs} (@pxref{Modeline Variables}).
+@samp{XEmacs} (@pxref{Modeline Variables}).
 
 @defun select-frame frame
 This function selects frame @var{frame}, temporarily disregarding the
@@ -673,7 +678,7 @@
 waiting for an event.
 
 @ignore (FSF Emacs)
-Emacs cooperates with the X server and the window managers by arranging
+XEmacs cooperates with the X server and the window managers by arranging
 to select frames according to what the server and window manager ask
 for.  It does so by generating a special kind of input event, called a
 @dfn{focus} event.  The command loop handles a focus event by calling
@@ -774,13 +779,13 @@
 
 @ignore  @c Not in XEmacs.
   The visibility status of a frame is also available as a frame
-parameter.  You can read or change it as such.  @xref{X Frame
-Parameters}.
+property.  You can read or change it as such.  @xref{X Frame
+Properties}.
 
-  The user can iconify and deiconify frames with the window manager.
-This happens below the level at which Emacs can exert any control, but
-Emacs does provide events that you can use to keep track of such
-changes.  @xref{Misc Events}.
+The user can iconify and deiconify frames with the window manager.  This
+happens below the level at which XEmacs can exert any control, but XEmacs
+does provide events that you can use to keep track of such changes.
+@xref{Misc Events}.
 @end ignore
 
 @node Raising and Lowering
@@ -818,7 +823,7 @@
 this for you, but the following variables are provided in case you're
 using a broken WM.  (Under FSF Emacs, the same functionality is
 provided through the @code{auto-raise} and @code{auto-lower}
-frame parameters.)
+frame properties.)
 
 @defvar auto-raise-frame
 This variable's value is @code{t} if frames will be raised to the top
--- a/man/lispref/help.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/help.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -77,14 +77,12 @@
 @end itemize
 
 @cindex @file{DOC} (documentation) file
-@cindex @file{emacs/etc/DOC-@var{version}}
-@cindex @file{etc/DOC-@var{version}}
 To save space, the documentation for preloaded functions and variables
 (including primitive functions and autoloaded functions) is stored in
-the @dfn{internal doc file} @file{emacs/etc/DOC-@var{version}}.  The
-documentation for functions and variables loaded during the XEmacs
-session from byte-compiled files is stored in those very same
-byte-compiled files (@pxref{Docs and Compilation}).
+the @dfn{internal doc file} @file{DOC}.  The documentation for functions
+and variables loaded during the XEmacs session from byte-compiled files
+is stored in those very same byte-compiled files (@pxref{Docs and
+Compilation}).
 
 XEmacs does not keep documentation strings in memory unless necessary.
 Instead, XEmacs maintains, for preloaded symbols, an integer offset into
@@ -250,18 +248,17 @@
 them in the in-core function definitions and variable property lists in
 place of the actual strings.  @xref{Building XEmacs}.
 
-  XEmacs finds the file @var{filename} in the @file{xemacs/lib-src}
-directory.  When the dumped XEmacs is later executed, the same file is
-found in the directory @code{doc-directory}.  Usually @var{filename} is
-@file{"DOC-@var{version}"}, but this can be changed by modifying the
-variable @code{internal-doc-file-name}.
+  XEmacs finds the file @var{filename} in the @file{lib-src} directory.
+When the dumped XEmacs is later executed, the same file is found in the
+directory @code{doc-directory}.  The usual value for @var{filename} is
+@file{DOC}, but this can be changed by modifying the variable
+@code{internal-doc-file-name}.
 @end defun
 
 @defvar internal-doc-file-name
 This variable holds the name of the file containing documentation
-strings of built-in symbols, usually @file{"DOC-@var{version}"}.  The
-full pathname of the internal doc file is @samp{(concat doc-directory
-internal-doc-file-name)}.
+strings of built-in symbols, usually @file{DOC}.  The full pathname of
+the internal doc file is @samp{(concat doc-directory internal-doc-file-name)}.
 @end defvar
 
 @defvar doc-directory
@@ -420,8 +417,8 @@
      @result{} "C-x SPC M-y SPC LFD SPC TAB SPC RET SPC C-l 1 2 3"
 @end group
 @group
-(single-key-description 'kp-next)
-     @result{} "kp-next"
+(single-key-description 'kp_next)
+     @result{} "kp_next"
 @end group
 @group
 (single-key-description '(shift button1))
--- a/man/lispref/intro.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/intro.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -424,7 +424,7 @@
 programming languages, and later chapters describe features that are
 peculiar to XEmacs Lisp or relate specifically to editing.
 
-  This is edition 3.0.
+  This is edition 3.2.
 
 @menu
 * Caveats::             Flaws and a request for help.
@@ -472,8 +472,9 @@
 
 This manual was originally written for FSF Emacs 19 and was updated by
 Ben Wing (wing@@666.com) for Lucid Emacs 19.10 and later for XEmacs
-19.12, 19.13, and 19.14.  Please send comments and corrections
-relating to XEmacs-specific portions of this manual to
+19.12, 19.13, 19.14, and 20.0.  It was further updated by the XEmacs
+Development Team for 19.15 and 20.1.  Please send comments and
+corrections relating to XEmacs-specific portions of this manual to
 @example
 xemacs@@xemacs.org
 @end example
@@ -852,13 +853,14 @@
 Research Projects Agency, ARPA Order 6082, arranged by Warren A. Hunt,
 Jr. of Computational Logic, Inc.
 
-  Ben Wing adapted this manual for XEmacs 19.14, and earlier
+  Ben Wing adapted this manual for XEmacs 19.14 and 20.0, and earlier
 for Lucid Emacs 19.10, XEmacs 19.12, and XEmacs 19.13.  He is the sole
 author of many of the manual sections, in particular the XEmacs-specific
 sections: events, faces, extents, glyphs, specifiers, toolbar, menubars,
 scrollbars, dialog boxes, devices, consoles, hash tables, range tables,
 char tables, databases, and others.  The section on annotations was
-originally written by Chuck Thompson.
+originally written by Chuck Thompson.  Corrections to v3.1 were done by
+Martin Buchholz, Steve Baur, and Hrvoje Niksic.
 
   Corrections to the original GNU Emacs Lisp Reference Manual were
 supplied by Karl Berry, Jim Blandy, Bard Bloom, Stephane Boucher, David
--- a/man/lispref/lispref.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/lispref.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -14,7 +14,8 @@
 XEmacs Lisp Programmer's Manual (for 19.12) Second Edition, April 1995
 GNU Emacs Lisp Reference Manual v2.4, June 1995
 XEmacs Lisp Programmer's Manual (for 19.13) Third Edition, July 1995
-XEmacs Lisp Programmer's Manual (for 19.14) v3.1, March 1996
+XEmacs Lisp Reference Manual (for 19.14 and 20.0) v3.1, March 1996
+XEmacs Lisp Reference Manual (for 19.15 and 20.1, 20.2) v3.2, April, May 1997
 @c Please REMEMBER to update edition number in *four* places in this file
 @c                 and also in *one* place in intro.texi
 
@@ -72,9 +73,9 @@
 @title XEmacs Lisp Reference Manual
 @c The edition number appears in several places in this file
 @c and also in the file intro.texi.
-@c This manual documents XEmacs 19.14 and was based on the
+@c This manual documents XEmacs 19.14 and 20.0 and was based on the
 @c documentation for FSF Emacs 19.29 (v2.4).
-@subtitle Version 3.1 (for XEmacs 19.14), March 1996
+@subtitle Version 3.2 (for XEmacs 19.15 and 20.1, 20.2), April, May 1997
 
 @author by Ben Wing
 @author
@@ -87,9 +88,9 @@
 Copyright @copyright{} 1994, 1995 Sun Microsystems, Inc.
 Copyright @copyright{} 1995, 1996 Ben Wing.
 @sp 2
-Version 3.1 @*
-Revised for XEmacs Version 19.14,@*
-March, 1996.@*
+Version 3.2 @*
+Revised for XEmacs Versions 19.15 and 20.1, 20.2,@*
+April, May 1997.@*
 
 Permission is granted to make and distribute verbatim copies of this
 manual provided the copyright notice and this permission notice are
@@ -116,7 +117,7 @@
 
 @ifinfo
 This Info file contains the third edition of the XEmacs Lisp
-Reference Manual, corresponding to XEmacs version 19.14.
+Reference Manual, corresponding to XEmacs versions 19.15 and 20.1.
 @end ifinfo
 
 @menu
@@ -740,7 +741,7 @@
 Frames
 
 * Creating Frames::	    Creating additional frames.
-* Frame Parameters::	    Controlling frame size, position, font, etc.
+* Frame Properties::	    Controlling frame size, position, font, etc.
 * Frame Titles::            Automatic updating of frame titles.
 * Deleting Frames::	    Frames last until explicitly deleted.
 * Finding All Frames::	    How to examine all existing frames.
--- a/man/lispref/loading.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/loading.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -346,7 +346,7 @@
 
 @noindent
 In this case, @code{"prolog"} is the name of the file to load, 169681
-refers to the documentation string in the @file{emacs/etc/DOC} file
+refers to the documentation string in the @file{DOC} file
 (@pxref{Documentation Basics}), @code{t} means the function is
 interactive, and @code{nil} that it is not a macro or a keymap.
 @end defun
@@ -415,7 +415,7 @@
 The backslash and newline immediately following the double-quote are a
 convention used only in the preloaded Lisp files such as
 @file{loaddefs.el}; they tell @code{make-docfile} to put the
-documentation string in the @file{etc/DOC} file.  @xref{Building XEmacs}.
+documentation string in the @file{DOC} file.  @xref{Building XEmacs}.
 
 @node Repeated Loading
 @section Repeated Loading
--- a/man/lispref/menus.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/menus.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the XEmacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993 Free Software Foundation, Inc. 
+@c Copyright (C) 1990, 1991, 1992, 1993, 1997 Free Software Foundation, Inc. 
 @c Copyright (C) 1995 Sun Microsystems.
 @c See the file lispref.texi for copying conditions.
 @setfilename ../../info/menu.info
@@ -15,6 +15,7 @@
 * Modifying Menus::	Modifying a menu description.
 * Pop-Up Menus::	Functions for specifying pop-up menus.
 * Menu Filters::	Filter functions for the default menubar.
+* Menu Accelerators::	Using and controlling menu accelerator keys
 * Buffers Menu::	The menu that displays the list of buffers.
 @end menu
 
@@ -38,7 +39,7 @@
 menu if @code{popup-menu-titles} is non-@code{nil}.
 
 Immediately following the first element there may optionally be up
-to three keyword-value pairs, as follows:
+to four keyword-value pairs, as follows:
 
 @table @code
 @item :included @var{form}
@@ -59,6 +60,11 @@
 menu filter function changes the current buffer, window, or frame.  It
 also should not raise, lower, or iconify any frames.  Basically, the
 filter function should have no side-effects.
+
+@item :accelerator @var{key}
+A menu accelerator is a keystroke which can be pressed while the menu is
+visible which will immediately activate the item.  @var{key} must be a char
+or the symbol name of a key.  @xref{Menu Accelerators}.
 @end table
 
 The rest of the menu consists of elements as follows:
@@ -216,6 +222,11 @@
 @item :config @var{symbol}
 This is an efficient shorthand for @code{:included (memq @var{symbol}
 menubar-configuration)}.  See the variable @code{menubar-configuration}.
+
+@item :accelerator @var{key}
+A menu accelerator is a keystroke which can be pressed while the menu is
+visible which will immediately activate the item.  @var{key} must be a char
+or the symbol name of a key.  @xref{Menu Accelerators}.
 @end table
 
 @defvar menubar-configuration
@@ -576,6 +587,136 @@
 This function pops up a copy of menu that also appears in the menubar.
 @end defun
 
+@node Menu Accelerators
+@section Menu Accelerators
+@cindex menu accelerators
+@cindex keyboard menu accelerators
+
+Menu accelerators are keyboard shortcuts for accessing the menubar.
+Accelerator keys can be specified for menus as well as for menu items.  An
+accelerator key for a menu is used to activate that menu when it appears as a
+submenu of another menu.  An accelerator key for a menu item is used to
+activate that item.
+
+@menu
+* Creating Menu Accelerators::	How to add accelerator keys to a menu.
+* Keyboard Menu Traversal::	How to use and modify the keys which are used
+				to traverse the menu structure.
+* Menu Accelerator Functions::	Functions for working with menu accelerators.
+@end menu
+
+@node Creating Menu Accelerators
+@subsection Creating Menu Accelerators
+
+Menu accelerators are specified as part of the menubar format using the
+:accelerator tag to specify a key or by placing "%_" in the menu or menu item
+name prior to the letter which is to be used as the accelerator key.  The
+advantage of the second method is that the menu rendering code then knows to
+draw an underline under that character, which is the canonical way of
+indicating an accelerator key to a user.
+
+For example, the command
+
+@example
+(add-submenu nil '("%_Test"
+		   ["One" (insert "1") :accelerator ?1 :active t]
+		   ["%_Two" (insert "2") t]
+		   ["%_3" (insert "3") t]))
+@end example
+
+will add a new menu to the top level menubar.  The new menu can be reached
+by pressing "t" while the top level menubar is active.  When the menu is
+active, pressing "1" will activate the first item and insert the character
+"1" into the buffer.  Pressing "2" will activate the second item and insert
+the character "2" into the buffer.  Pressing "3" will activate the third item
+and insert the character "3" into the buffer.
+
+It is possible to activate the top level menubar itself using accelerator keys.
+@xref{Menu Accelerator Functions}.
+
+@node Keyboard Menu Traversal
+@subsection Keyboard Menu Traversal
+
+In addition to immediately activating a menu or menu item, the keyboard can
+be used to traverse the menus without activating items.  The keyboard arrow
+keys, the return key and the escape key are defined to traverse the menus in a
+way that should be familiar to users of any of a certain family of popular PC
+operating systems.
+
+This behaviour can be changed by modifying the bindings in
+menu-accelerator-map.  At this point, the online help is your best bet
+for more information about how to modify the menu traversal keys.
+
+@node Menu Accelerator Functions
+@subsection Menu Accelerator Functions
+
+@defun accelerate-menu
+Make the menubar immediately active and place the cursor on the left most entry
+in the top level menu.  Menu items can be selected as usual.
+@end defun
+
+@defvar menu-accelerator-enabled
+Whether menu accelerator keys can cause the menubar to become active.
+
+If @code{menu-force} or @code{menu-fallback}, then menu accelerator keys can
+be used to activate the top level menu.  Once the menubar becomes active, the
+accelerator keys can be used regardless of the value of this variable.
+
+@code{menu-force} is used to indicate that the menu accelerator key takes
+precedence over bindings in the current keymap(s).  @code{menu-fallback} means
+that bindings in the current keymap take precedence over menu accelerator keys.
+Thus a top level menu with an accelerator of "T" would be activated on a
+keypress of Meta-t if @var{menu-accelerator-enabled} is @code{menu-force}.
+However, if @var{menu-accelerator-enabled} is @code{menu-fallback}, then
+Meta-t will not activate the menubar and will instead run the function
+transpose-words, to which it is normally bound.
+
+The default value is @code{nil}.
+
+See also @var{menu-accelerator-modifiers} and @var{menu-accelerator-prefix}.
+@end defvar
+
+@defvar menu-accelerator-map
+Keymap consulted to determine the commands to run in response to keypresses
+occurring while the menubar is active.  @xref{Keyboard Menu Traversal}.
+@end defvar
+
+@defvar menu-accelerator-modifiers
+A list of modifier keys which must be pressed in addition to a valid menu
+accelerator in order for the top level menu to be activated in response to
+a keystroke.  The default value of @code{(meta)} mirrors the useage of the alt key
+as a menu accelerator in popular PC operating systems.
+
+The modifier keys in @var{menu-accelerator-modifiers} must match exactly the
+modifiers present in the keypress.  The only exception is that the shift
+modifier is accepted in conjunction with alphabetic keys even if it is not
+a menu accelerator modifier.
+
+See also @var{menu-accelerator-enabled} and @var{menu-accelerator-prefix}.
+@end defvar
+
+@defvar menu-accelerator-prefix
+Prefix key(s) that must be typed before menu accelerators will be activated.
+Must be a valid key descriptor.
+
+The default value is @code{nil}.
+@end defvar
+
+@example
+(setq menu-accelerator-prefix ?\C-x)
+(setq menu-accelerator-modifiers '(meta control))
+(setq menu-accelerator-enabled 'menu-force)
+(add-submenu nil '("%_Test"
+		   ["One" (insert "1") :accelerator ?1 :active t]
+		   ["%_Two" (insert "2") t]
+		   ["%_3" (insert "3") t]))
+@end example
+
+will add the menu "Test" to the top level menubar.  Pressing C-x followed by
+C-M-T will activate the menubar and display the "Test" menu.  Pressing
+C-M-T by itself will not activate the menubar.  Neither will pressing C-x
+followed by anything else.
+
 @node Buffers Menu
 @section Buffers Menu
 @cindex buffers menu
--- a/man/lispref/minibuf.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/minibuf.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -1,6 +1,6 @@
 @c -*-texinfo-*-
 @c This is part of the XEmacs Lisp Reference Manual.
-@c Copyright (C) 1990, 1991, 1992, 1993, 1994 Free Software Foundation, Inc. 
+@c Copyright (C) 1990, 1991, 1992, 1993, 1994, 1997 Free Software Foundation, Inc. 
 @c See the file lispref.texi for copying conditions.
 @setfilename ../../info/minibuf.info
 @node Minibuffers, Command Loop, Read and Print, Top
@@ -319,7 +319,7 @@
 @noindent
 Typing @key{RET} right away would exit the minibuffer and evaluate the
 expression, thus moving point forward one word.
-@code{edit-and-eval-command} returns @code{nil} in this example.
+@code{edit-and-eval-command} returns @code{t} in this example.
 @end defun
 
 @node Minibuffer History
@@ -395,6 +395,18 @@
 A history list for arguments that are Lisp expressions to evaluate.
 @end defvar
 
+@defvar Info-minibuffer-history
+A history list for Info mode's minibuffer.
+@end defvar
+
+@defvar Manual-page-minibuffer-history
+A history list for @code{manual-entry}.
+@end defvar
+
+  There are many other minibuffer history lists, defined by various
+libraries.  An @kbd{M-x apropos} search for @samp{history} should prove
+fruitful in discovering them.
+
 @node Completion
 @section Completion
 @cindex completion
--- a/man/lispref/mule.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/mule.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -203,11 +203,11 @@
 A documentation string describing the charset.
 @item registry
 A regular expression matching the font registry field for this character
-set.  For example, both the @code{ascii} and @code{latin-1} charsets
-use the registry @code{"ISO8859-1"}.  This field is used to choose
-an appropriate font when the user gives a general font specification
-such as @samp{-*-courier-medium-r-*-140-*}, i.e. a 14-point upright
-medium-weight Courier font.
+set.  For example, both the @code{ascii} and @code{latin-iso8859-1}
+charsets use the registry @code{"ISO8859-1"}.  This field is used to
+choose an appropriate font when the user gives a general font
+specification such as @samp{-*-courier-medium-r-*-140-*}, i.e. a
+14-point upright medium-weight Courier font.
 @item dimension
 Number of position codes used to index a character in the character set.
 XEmacs/MULE can only handle character sets of dimension 1 or 2.
@@ -251,8 +251,8 @@
 it set to 1, position codes 33 through 126 map to font indices 161
 through 254 (i.e. the same number but with the high bit set).  For
 example, for a font whose registry is ISO8859-1, the left half of the
-font (octets 0x20 - 0x7F) is the @code{ascii} charset, while the
-right half (octets 0xA0 - 0xFF) is the @code{latin-1} charset.
+font (octets 0x20 - 0x7F) is the @code{ascii} charset, while the right
+half (octets 0xA0 - 0xFF) is the @code{latin-iso8859-1} charset.
 @item ccl-program
 A compiled CCL program used to convert a character in this charset into
 an index into the font.  This is in addition to the @code{graphic}
@@ -400,54 +400,53 @@
 The following charsets are predefined in the C code.
 
 @example
-Name            Doc String            Type  Fi Gr Dir Registry
+Name                    Type  Fi Gr Dir Registry
 --------------------------------------------------------------
-ascii           ASCII                 94    B  0  l2r ISO8859-1
-control-1       Control characters    94       0  l2r ---
-latin-1         Latin-1               94    A  1  l2r ISO8859-1
-latin-2         Latin-2               96    B  1  l2r ISO8859-2
-latin-3         Latin-3               96    C  1  l2r ISO8859-3
-latin-4         Latin-4               96    D  1  l2r ISO8859-4
-cyrillic        Cyrillic              96    L  1  l2r ISO8859-5
-arabic          Arabic                96    G  1  r2l ISO8859-6
-greek           Greek                 96    F  1  l2r ISO8859-7
-hebrew          Hebrew                96    H  1  r2l ISO8859-8
-latin-5         Latin-5               96    M  1  l2r ISO8859-9
-thai            Thai                  96    T  1  l2r TIS620
-japanese-kana   Japanese Katakana     94    I  1  l2r JISX0201.1976
-japanese-roman  Japanese Roman        94    J  0  l2r JISX0201.1976
-japanese-old    Japanese Old          94x94 @@  0  l2r JISX0208.1978
-chinese-gb      Chinese GB            94x94 A  0  l2r GB2312
-japanese        Japanese              94x94 B  0  l2r JISX0208.19(83|90)
-korean          Korean                94x94 C  0  l2r KSC5601
-japanese-2      Japanese Supplement   94x94 D  0  l2r JISX0212
-chinese-cns-1   Chinese CNS Plane 1   94x94 G  0  l2r CNS11643.1
-chinese-cns-2   Chinese CNS Plane 2   94x94 H  0  l2r CNS11643.2
-chinese-big5-1  Chinese Big5 Level 1  94x94 0  0  l2r Big5
-chinese-big5-2  Chinese Big5 Level 2  94x94 1  0  l2r Big5
-composite       Composite             96x96    0  l2r ---
+ascii                    94    B  0  l2r ISO8859-1
+control-1                94       0  l2r ---
+latin-iso8859-1          94    A  1  l2r ISO8859-1
+latin-iso8859-2          96    B  1  l2r ISO8859-2
+latin-iso8859-3          96    C  1  l2r ISO8859-3
+latin-iso8859-4          96    D  1  l2r ISO8859-4
+cyrillic-iso8859-5       96    L  1  l2r ISO8859-5
+arabic-iso8859-6         96    G  1  r2l ISO8859-6
+greek-iso8859-7          96    F  1  l2r ISO8859-7
+hebrew-iso8859-8         96    H  1  r2l ISO8859-8
+latin-iso8859-9          96    M  1  l2r ISO8859-9
+thai-tis620              96    T  1  l2r TIS620
+katakana-jisx0201        94    I  1  l2r JISX0201.1976
+latin-jisx0201           94    J  0  l2r JISX0201.1976
+japanese-jisx0208-1978   94x94 @@  0  l2r JISX0208.1978
+japanese-jisx0208        94x94 B  0  l2r JISX0208.19(83|90)
+japanese-jisx0212        94x94 D  0  l2r JISX0212
+chinese-gb2312           94x94 A  0  l2r GB2312
+chinese-cns11643-1       94x94 G  0  l2r CNS11643.1
+chinese-cns11643-2       94x94 H  0  l2r CNS11643.2
+chinese-big5-1           94x94 0  0  l2r Big5
+chinese-big5-2           94x94 1  0  l2r Big5
+korean-ksc5601           94x94 C  0  l2r KSC5601
+composite                96x96    0  l2r ---
 @end example
 
 The following charsets are predefined in the Lisp code.
 
 @example
-Name            Doc String            Type  Fi Gr Dir Registry
+Name                     Type  Fi Gr Dir Registry
 --------------------------------------------------------------
-arabic-0        Arabic digits         94    2  0  l2r MuleArabic-0
-arabic-1        one-column Arabic     94    3  0  r2l MuleArabic-1
-arabic-2        one-column Arabic     94    4  0  r2l MuleArabic-2
-sisheng         PinYin-ZhuYin         94    0  0  l2r sisheng_cwnn\|
-                                                          OMRON_UDC_ZH
-chinese-cns-3   Chinese CNS Plane 3   94x94 I  0  l2r CNS11643.1
-chinese-cns-4   Chinese CNS Plane 4   94x94 J  0  l2r CNS11643.1
-chinese-cns-5   Chinese CNS Plane 5   94x94 K  0  l2r CNS11643.1
-chinese-cns-6   Chinese CNS Plane 6   94x94 L  0  l2r CNS11643.1
-chinese-cns-7   Chinese CNS Plane 7   94x94 M  0  l2r CNS11643.1
-ethiopic        Ethiopic              94x94 2  0  l2r Ethio
-ascii-r2l       Right-to-Left ASCII   94    B  0  r2l ISO8859-1
-ipa             IPA for Mule          96    0  1  l2r MuleIPA
-vietnamese-1    VISCII lower          96    1  1  l2r VISCII1.1
-vietnamese-2    VISCII upper          96    2  1  l2r VISCII1.1
+arabic-digit             94    2  0  l2r MuleArabic-0
+arabic-1-column          94    3  0  r2l MuleArabic-1
+arabic-2-column          94    4  0  r2l MuleArabic-2
+sisheng                  94    0  0  l2r sisheng_cwnn\|OMRON_UDC_ZH
+chinese-cns11643-3       94x94 I  0  l2r CNS11643.1
+chinese-cns11643-4       94x94 J  0  l2r CNS11643.1
+chinese-cns11643-5       94x94 K  0  l2r CNS11643.1
+chinese-cns11643-6       94x94 L  0  l2r CNS11643.1
+chinese-cns11643-7       94x94 M  0  l2r CNS11643.1
+ethiopic                 94x94 2  0  l2r Ethio
+ascii-r2l                94    B  0  r2l ISO8859-1
+ipa                      96    0  1  l2r MuleIPA
+vietnamese-lower         96    1  1  l2r VISCII1.1
+vietnamese-upper         96    2  1  l2r VISCII1.1
 @end example
 
 For all of the above charsets, the dimension and number of columns are
@@ -474,13 +473,13 @@
 (should be 0 or 1) of char @var{ch}.  @var{n} defaults to 0 if omitted.
 @end defun
 
-@defun charsets-in-region start end &optional buffer
+@defun find-charset-region start end &optional buffer
 This function returns a list of the charsets in the region between
 @var{start} and @var{end}.  @var{buffer} defaults to the current buffer
 if omitted.
 @end defun
 
-@defun charsets-in-string string
+@defun find-charset-string string
 This function returns a list of the charsets in @var{string}.
 @end defun
 
@@ -518,9 +517,9 @@
 @node ISO 2022
 @section ISO 2022
 
-This section briefly describes the ISO2022 encoding standard.  For more
-thorough understanding, please refer to the original document of
-ISO2022.
+This section briefly describes the ISO 2022 encoding standard.  For more
+thorough understanding, please refer to the original document of ISO
+2022.
 
 Character sets (@dfn{charsets}) are classified into the following four
 categories, according to the number of characters of charset:
@@ -566,8 +565,8 @@
 Usually, in the initial state, G0 is invoked into GL, and G1
 is invoked into GR.
 
-ISO2022 distinguishes 7-bit environments and 8-bit
-environments.  In 7-bit environments, only C0 and GL are used.
+ISO 2022 distinguishes 7-bit environments and 8-bit environments.  In
+7-bit environments, only C0 and GL are used.
 
 Charset designation is done by escape sequences of the form:
 
@@ -589,13 +588,11 @@
 	+ [0x2B]: designate to G3 a 94-charset whose final byte is @var{F}.
 	- [0x2D]: designate to G1 a 96-charset whose final byte is @var{F}.
 	. [0x2E]: designate to G2 a 96-charset whose final byte is @var{F}.
-	/ [0x2F]: designate to G3 a 96-charset whose final byte is
-	@var{F}.
+	/ [0x2F]: designate to G3 a 96-charset whose final byte is @var{F}.
 @end group
 @end example
 
-The following rule is not allowed in ISO2022 but can be used
-in Mule.
+The following rule is not allowed in ISO 2022 but can be used in Mule.
 
 @example
 	, [0x2C]: designate to G0 a 96-charset whose final byte is @var{F}.
@@ -613,17 +610,16 @@
 @end group
 @end example
 
-To use a charset designated to G2 or G3, and to use a
-charset designated to G1 in a 7-bit environment, you must
-explicitly invoke G1, G2, or G3 into GL.  There are two
-types of invocation, Locking Shift (forever) and Single
-Shift (one character only).
+To use a charset designated to G2 or G3, and to use a charset designated
+to G1 in a 7-bit environment, you must explicitly invoke G1, G2, or G3
+into GL.  There are two types of invocation, Locking Shift (forever) and
+Single Shift (one character only).
 
 Locking Shift is done as follows:
 
 @example
-	SI or LS0: invoke G0 into GL
-	SO or LS1: invoke G1 into GL
+	LS0 or SI (0x0F): invoke G0 into GL
+	LS1 or SO (0x0E): invoke G1 into GL
 	LS2:  invoke G2 into GL
 	LS3:  invoke G3 into GL
 	LS1R: invoke G1 into GR
@@ -646,12 +642,12 @@
 EUC-encoded text correctly, and it looks like the code in mule-coding.c
 has similar problems.)
 
-You may realize that there are a lot of ISO2022-compliant ways of
+You may realize that there are a lot of ISO-2022-compliant ways of
 encoding multilingual text.  Now, in the world, there exist many coding
 systems such as X11's Compound Text, Japanese JUNET code, and so-called
-EUC (Extended UNIX Code); all of these are variants of ISO2022.
+EUC (Extended UNIX Code); all of these are variants of ISO 2022.
 
-In Mule, we characterize ISO2022 by the following attributes:
+In Mule, we characterize ISO 2022 by the following attributes:
 
 @enumerate
 @item
@@ -675,7 +671,7 @@
 (The last two are only for Japanese.)
 
 By specifying these attributes, you can create any variant
-of ISO2022.
+of ISO 2022.
 
 Here are several examples:
 
@@ -742,7 +738,7 @@
 or process, and is used to encode the text back into the same format
 when it is written out to a file or process.
 
-For example, many ISO2022-compliant coding systems (such as Compound
+For example, many ISO-2022-compliant coding systems (such as Compound
 Text, which is used for inter-client data under the X Window System) use
 escape sequences to switch between different charsets -- Japanese Kanji,
 for example, is invoked with @samp{ESC $ ( B}; ASCII is invoked with
@@ -778,19 +774,19 @@
 @itemx autodetect
 Automatic conversion.  XEmacs attempts to detect the coding system used
 in the file.
-@item noconv
+@item no-conversion
 No conversion.  Use this for binary files and such.  On output, graphic
 characters that are not in ASCII or Latin-1 will be replaced by a
-@samp{?}. (For a noconv-encoded buffer, these characters will only be
-present if you explicitly insert them.)
+@samp{?}. (For a no-conversion-encoded buffer, these characters will
+only be present if you explicitly insert them.)
 @item shift-jis
 Shift-JIS (a Japanese encoding commonly used in PC operating systems).
 @item iso2022
-Any ISO2022-compliant encoding.  Among other things, this includes JIS
-(the Japanese encoding commonly used for e-mail), EUC (the standard Unix
-encoding for Japanese and other languages), and Compound Text (the
-encoding used in X11).  You can specify more specific information about
-the conversion with the @var{flags} argument.
+Any ISO-2022-compliant encoding.  Among other things, this includes JIS
+(the Japanese encoding commonly used for e-mail), national variants of
+EUC (the standard Unix encoding for Japanese and other languages), and
+Compound Text (an encoding used in X11).  You can specify more specific
+information about the conversion with the @var{flags} argument.
 @item big5
 Big5 (the encoding commonly used for Taiwanese).
 @item ccl
@@ -882,7 +878,7 @@
 @item force-g0-on-output
 @itemx force-g1-on-output
 @itemx force-g2-on-output
-@itemx force-g2-on-output
+@itemx force-g3-on-output
 If non-@code{nil}, send an explicit designation sequence on output
 before using the specified register.
 
@@ -913,7 +909,7 @@
 
 @item escape-quoted
 If non-nil, literal control characters that are the same as the
-beginning of a recognized ISO2022 or ISO6429 escape sequence (in
+beginning of a recognized ISO 2022 or ISO 6429 escape sequence (in
 particular, ESC (0x1B), SO (0x0E), SI (0x0F), SS2 (0x8E), SS3 (0x8F),
 and CSI (0x9B)) are ``quoted'' with an escape character so that they can
 be properly distinguished from an escape sequence.  (Note that doing
@@ -921,7 +917,7 @@
 byte-compiled files.  Note that ESC is a good choice for a quoting
 character because there are no escape sequences whose second byte is a
 character from the Control-0 or Control-1 character sets; this is
-explicitly disallowed by the ISO2022 standard.
+explicitly disallowed by the ISO 2022 standard.
 
 @item input-charset-conversion
 A list of conversion specifications, specifying conversion of characters
@@ -1018,7 +1014,7 @@
 This function decodes the text between @var{start} and @var{end} which
 is encoded in @var{coding-system}.  This is useful if you've read in
 encoded text from a file without decoding it (e.g. you read in a
-JIS-formatted file but used the @code{binary} or @code{noconv} coding
+JIS-formatted file but used the @code{binary} or @code{no-conversion} coding
 system, so that it shows up as @samp{^[$B!<!+^[(B}).  The length of the
 encoded text is returned.  @var{buffer} defaults to the current buffer
 if unspecified.
--- a/man/lispref/numbers.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/numbers.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -198,7 +198,7 @@
 
 @defun natnump object
 @cindex natural numbers
-The @code{wholenump} predicate (whose name comes from the phrase
+The @code{natnump} predicate (whose name comes from the phrase
 ``natural-number-p'') tests to see whether its argument is a nonnegative
 integer, and returns @code{t} if so, @code{nil} otherwise.  0 is
 considered non-negative.
@@ -223,7 +223,7 @@
 of the objects.
 
   At present, each integer value has a unique Lisp object in XEmacs Lisp.
-Therefore, @code{eq} is equivalent @code{=} where integers are
+Therefore, @code{eq} is equivalent to @code{=} where integers are
 concerned.  It is sometimes convenient to use @code{eq} for comparing an
 unknown value with an integer, because @code{eq} does not report an
 error if the unknown value is not a number---it accepts arguments of any
@@ -261,8 +261,8 @@
 @end defun
 
 @defun /= number-or-marker1 number-or-marker2
-This function tests whether its arguments are numerically equal, and
-returns @code{t} if they are not, and @code{nil} if they are.
+This function tests whether its arguments are numerically not equal.  It
+returns @code{t} if so, and @code{nil} otherwise.
 @end defun
 
 @defun <  number-or-marker1 number-or-marker2
@@ -395,6 +395,10 @@
 (setq foo (1+ foo))
      @result{} 5
 @end example
+
+Now that the @code{cl} package is always available from lisp code, a
+more convenient and natural way to increment a variable is
+@w{@code{(incf foo)}}.
 @end defun
 
 @defun 1- number-or-marker
--- a/man/lispref/sequences.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/sequences.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -338,7 +338,7 @@
 
 @group
 (aref "abcdefg" 1)
-     @result{} 98           ; @r{@samp{b} is @sc{ASCII} code 98.}
+     @result{} ?b
 @end group
 
 @group
@@ -368,7 +368,7 @@
 (setq x "asdfasfd")
      @result{} "asdfasfd"
 (aset x 3 ?Z)
-     @result{} 90
+     @result{} ?Z
 x
      @result{} "asdZasfd"
 @end group
@@ -400,6 +400,7 @@
 a
      @result{} [0 0 0 0 0 0 0]
 @end group
+
 @group
 (setq s "When in the course")
      @result{} "When in the course"
--- a/man/lispref/streams.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/streams.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -483,8 +483,8 @@
 
 @group
 last-output
-     @result{} (10 34 116 117 112 116 117 111 32 101 104 
-    116 32 115 105 32 115 105 104 84 34 10)
+     @result{} (?\n ?\" ?t ?u ?p ?t ?u ?o ?\  ?e ?h ?t
+                ?\  ?s ?i ?\  ?s ?i ?h ?T ?\" ?\n)
 @end group
 @end example
 
--- a/man/lispref/strings.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/strings.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -345,10 +345,30 @@
 @example
 (char-equal ?x ?x)
      @result{} t
-(char-to-string (+ 256 ?x))
-     @result{} "x"
-(char-equal ?x  (+ 256 ?x))
+(let ((case-fold-search t))
+  (char-equal ?x ?X))
      @result{} t
+(let ((case-fold-search nil))
+  (char-equal ?x ?X))
+     @result{} nil
+@end example
+@end defun
+
+@defun char= character1 character2
+This function returns @code{t} if the arguments represent the same
+character, @code{nil} otherwise.  Case is significant.
+
+@example
+(char= ?x ?x)
+     @result{} t
+(char= ?x ?X)
+     @result{} nil
+(let ((case-fold-search t))
+  (char-equal ?x ?X))
+     @result{} nil
+(let ((case-fold-search nil))
+  (char-equal ?x ?X))
+     @result{} nil
 @end example
 @end defun
 
--- a/man/lispref/windows.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/lispref/windows.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -272,7 +272,7 @@
 @end smallexample
 
 Normally, Emacs indicates the border between two side-by-side windows
-with a scroll bar (@pxref{X Frame Parameters,Scroll Bars}) or @samp{|}
+with a scroll bar (@pxref{X Frame Properties,Scroll Bars}) or @samp{|}
 characters.  The display table can specify alternative border
 characters; see @ref{Display Tables}.
 @end deffn
@@ -892,14 +892,14 @@
 Its value should be a function of no arguments.  When
 @code{display-buffer} makes a new frame, it does so by calling that
 function, which should return a frame.  The default value of the
-variable is a function that creates a frame using parameters from
-@code{pop-up-frame-alist}.
+variable is a function that creates a frame using properties from
+@code{pop-up-frame-plist}.
 @end defvar
 
-@defvar pop-up-frame-alist
-This variable holds an alist specifying frame parameters used when
-@code{display-buffer} makes a new frame.  @xref{Frame Parameters}, for
-more information about frame parameters.
+@defvar pop-up-frame-plist
+This variable holds a plist specifying frame properties used when
+@code{display-buffer} makes a new frame.  @xref{Frame Properties}, for
+more information about frame properties.
 @end defvar
 
 @defvar special-display-buffer-names
@@ -912,7 +912,7 @@
 If an element is a list, instead of a string, then the @sc{car} of the
 list is the buffer name, and the rest of the list says how to create the
 frame.  There are two possibilities for the rest of the list.  It can be
-an alist, specifying frame parameters, or it can contain a function and
+a plist, specifying frame properties, or it can contain a function and
 arguments to give to it.  (The function's first argument is always the
 buffer to be displayed; the arguments from the list come after that.)
 @end defvar
@@ -951,8 +951,8 @@
 window was previously made by this function.
 @end defun
 
-@defopt special-display-frame-alist
-This variable holds frame parameters for
+@defopt special-display-frame-plist
+This variable holds frame properties for
 @code{special-display-popup-frame} to use when it creates a frame.
 @end defopt
 
--- a/man/xemacs-faq.texi	Mon Aug 13 08:57:25 2007 +0200
+++ b/man/xemacs-faq.texi	Mon Aug 13 08:57:55 2007 +0200
@@ -8,12 +8,13 @@
 @titlepage
 @title XEmacs FAQ
 @subtitle Frequently asked questions about XEmacs
-@subtitle Last Modified:  1997/01/16
+@subtitle Last Modified:  1997-07-17
 @sp 1
 @author Tony Rossini <arossini@@stat.sc.edu>
-@author Ben Wing <wing@@netcom.com>
+@author Ben Wing <wing@@666.com>
 @author Chuck Thompson <cthomp@@cs.uiuc.edu>
 @author Steve Baur <steve@@miranova.com>
+@author Andreas Kaempf <andreas@@sccon.com>
 @page
 @end titlepage
 
@@ -31,7 +32,7 @@
 FITNESS FOR A PARTICULAR PURPOSE.
 
 If you have a Web browser, the official hypertext version is at
-<URL:http://www.miranova.com/~steve/xemacs-faq.html> and also at
+<URL:http://www.sccon.com/~andreas/xemacs-faq.html> and also at
 <URL:http://www.xemacs.org/faq/xemacs-faq.html>.  This version is much
 nicer than the unofficial hypertext versions that are archived at
 Utrecht, Oxford, Smart Pages, and other FAQ archives.
@@ -68,9 +69,12 @@
 Steven L. Baur <steve@@altair.xemacs.org>.  It was converted back to
 texinfo by Hrvoje Niksic <hniksic@@srce.hr>.
 
-This version was edited and updated by Andreas Kaempf
-<andreas@@sccon.com>.
-
+Since Steve Baur is so busy putting out multiple versions of XEmacs I
+have taken on the task of maintaining the FAQ.  I use XEmacs on a daily
+basis and I wanted to give something back to the community that has made
+XEmacs possible.  If you notice any errors or items which should be
+added or amended to this FAQ please send email to Andreas Kaempf
+<andreas@@sccon.com>. Include @samp{XEmacs FAQ} on the Subject: line.
 
 @menu
 Introduction:
@@ -79,10 +83,10 @@
 * Q1.0.3::      Where can I find it?
 * Q1.0.4::      Why Another Version of Emacs?
 * Q1.0.5::      Why Haven't XEmacs and GNU Emacs Merged?
-* Q1.0.6::      Where can I get help?
+* Q1.0.6::      Where can I get help?  
 * Q1.0.7::      Where is the mailing list archived?
 * Q1.0.8::      How do you pronounce XEmacs?
-* Q1.0.9::      What does XEmacs look like?
+* Q1.0.9::      What does XEmacs look like? 
 * Q1.0.10::     Is there a port of XEmacs to Microsoft ('95 or NT)?
 * Q1.0.11::     Is there a port of XEmacs to the Macintosh?
 * Q1.0.12::     Is there a port of XEmacs to NextStep?
@@ -96,17 +100,17 @@
 
 Credits:
 * Q1.2.1::      Who wrote XEmacs?
-* Q1.2.2::      Who contributed to this version of the FAQ?
-* Q1.2.3::      Who contributed to the FAQ in the past?
+* Q1.2.2::      Who contributed to this version of the FAQ? 
+* Q1.2.3::      Who contributed to the FAQ in the past? 
 
 Internationalization:
-* Q1.3.1::      What is the status of XEmacs v20?
+* Q1.3.1::      What is the status of XEmacs v20? 
 * Q1.3.2::      What is the status of Asian-language support, aka @var{mule}?
 * Q1.3.3::      How do I type non-ASCII characters?
 * Q1.3.4::      Can XEmacs messages come out in a different language?
 * Q1.3.5::      Please explain the various input methods in MULE/XEmacs 20.0
 * Q1.3.6::      How do I portably code for MULE/XEmacs 20.0?
-* Q1.3.7::      How about Cyrillic Modes?
+* Q1.3.7::      How about Cyrillic Modes? 
 
 Getting Started:
 * Q1.4.1::      What is a @file{.emacs} and is there a sample one?
@@ -115,7 +119,7 @@
 * Q1.4.4::      May I see an example of a useful XEmacs Lisp function?
 * Q1.4.5::      And how do I bind it to a key?
 * Q1.4.6::      What's the difference between a macro and a function?
-* Q1.4.7::      Why options saved with 19.13 don't work with 19.14 or 20.0?
+* Q1.4.7::      Why options saved with 19.13 don't work with 19.14 or later?
 @end menu
 
 @node Q1.0.1, Q1.0.2, Introduction, Introduction
@@ -130,12 +134,21 @@
 @node Q1.0.2, Q1.0.3, Q1.0.1, Introduction
 @section What is the current version of XEmacs?
 
-The current version is 19.15, released in March, 1997.
-
-It has been decided that XEmacs 19.15 will be the final release of v19.
-XEmacs 19.15 is scheduled for release in late March.  After a brief
-period of further testing, XEmacs v20.1 will be released shortly after
-that.
+The current stable version of XEmacs is 20.2, released in May, 1997.
+The next feature release will XEmacs 20.3.
+
+XEmacs 19.15 was the last release of v19, released in March, 1997.
+
+To help users who are not yet ready to move to XEmacs 20, we run a
+patch-page with official bugfixes for 19.15 at:
+
+@example
+<URL:http://www.xemacs.org/xemacs-19.15-patches/patch-page.html>
+@end example
+
+The page is maintained by Vinnie Shelton @code{<acs@@acm.org>}.  These
+fixes will be integrated to a XEmacs and released as 19.16, which would
+serve as stable XEmacs until 20.x settles completely.
 
 @node Q1.0.3, Q1.0.4, Q1.0.2, Introduction
 @section Where can I find it?
@@ -182,7 +195,8 @@
 Better Motif compliance.
 
 @item
-Some internationalization support (full MULE support starting with 20.0).
+Some internationalization support (including full MULE support, if
+compiled with it.)
 
 @item
 Variable-width fonts.
@@ -235,25 +249,17 @@
 
 Try reading this FAQ, examining the regular GNU Emacs FAQ (which can be
 found with the Emacs 19 distribution) as well as at
-@example
-<URL:http://www.eecs.nwu.edu/emacs/faq/>
-@end example
-and reading the Usenet group comp.emacs.xemacs.
+<URL:http://www.eecs.nwu.edu/emacs/faq/> and reading the Usenet group 
+comp.emacs.xemacs.
 
 If that does not help, try posting your question to comp.emacs.xemacs.
 Please @strong{do not} post XEmacs related questions to gnu.emacs.help.
 
 If you cannot post or read Usenet news, there is a corresponding mailing
 list which is available.  It can be subscribed to by sending a message
-with a subject of @samp{subscribe} to
-@example
-<xemacs-request@@xemacs.org>
-@end example
-for subscription information and
-@example
-<xemacs@@xemacs.org>
-@end example
-to send messages to the list.
+with a subject of @samp{subscribe} to <xemacs-request@@xemacs.org>
+for subscription information and <xemacs@@xemacs.org> to send messages 
+to the list.
 
 To cancel a subscription, you @strong{must} use the xemacs-request
 address.  Send a message with a subject of @samp{unsubscribe} to be
@@ -276,26 +282,34 @@
 @section What does XEmacs look like?
 
 Screen snapshots are available in the WWW version of the FAQ.
+@example
+<URL:http://www.xemacs.org/faq/xemacs-faq.html>
+@end example
 
 @node Q1.0.10, Q1.0.11, Q1.0.9, Introduction
 @section Is there a port of XEmacs to Microsoft ('95 or NT)?
 
+Altrasoft is actively seeking corporate and government sponsors to help
+fund a fully native port of XEmacs to Windows 95 and NT using full-time,
+senior-level staff working under a professionally managed project
+structure.  See <URL:http://www.altrasoft.com/> for more details or
+contact Altrasoft directly at 1-888-ALTSOFT.
+
+A private effort is being put forth by David Hobley 
+<URL:http://www.angelfire.com/wa/hobley>. 
+
+He can be reached at the following email addresses: 
+@example
+<davidh@@wr.com.au> (home)
+@end example
+
+@example
+<david_hobley@@optusvision.com.au> (work)
+@end example
+ 
 The closest is @dfn{Win-Emacs}, which is based on Lucid Emacs 19.6.
 Available from <URL:http://www.pearlsoft.com/>.
 
-There are some people actively working on a NT port of v20.1: David
-Hobley started the port.  Marc Paquette
-@example
-<marcpa@@cam.org>
-@end example
-has also became part of this effort.
-
-Email the beta list
-@example
-<xemacs-beta@@xemacs.org>
-@end example
-if you are interested in helping.
-
 There's a port of GNU Emacs (not XEmacs) at
 @example
 <URL:http://www.cs.washington.edu/homes/voelker/ntemacs.html>.
@@ -344,7 +358,7 @@
 month.  Preexisting questions that have been changed are marked as such.
 Brand new questions are tagged.
 
-All submissions are welcome.  E-mail submissions to
+All submissions are welcome.  E-mail submissions to Andreas Kaempf
 <andreas@@sccon.com>.
 
 Please make sure that @samp{XEmacs FAQ} appears on the Subject: line.
@@ -361,7 +375,7 @@
 @section How do I become a Beta Tester?
 
 Send an email message to <xemacs-beta-request@@xemacs.org> with a
-subject line of @samp{subscribe}.  Fill out and return the questionaire
+subject line of @samp{subscribe}.  Fill out and return the questionnaire
 you get back, and you will receive the password to get at the current
 beta.
 
@@ -445,11 +459,8 @@
 @itemize @bullet
 @item Steven L Baur <steve@@miranova.com>
 
-@item Darrell Kindred <dkindred@@cmu.edu>
-
-@item David Moore <dmoore@@ucsd.edu>
-
-@item Justin Sheehy <dworkin@@ccs.neu.edu>
+@item Hrvoje Niksic <hniksic@@srce.hr>
+
 @end itemize
 
 @node Q1.2.3, Q1.3.1, Q1.2.2, Introduction
@@ -463,6 +474,8 @@
 
 @item Richard Caley <rjc@@cogsci.ed.ac.uk>
 
+@item Richard Cognot <cognot@@ensg.u-nancy.fr>
+
 @item William G. Dubuque <wgd@@martigny.ai.mit.edu>
 
 @item Eric Eide <eeide@@cs.utah.edu>
@@ -473,24 +486,32 @@
 
 @item Marty Hall <hall@@aplcenmp.apl.jhu.edu>
 
+@item Darrell Kindred <dkindred@@cmu.edu>
+
+@item David Moore <dmoore@@ucsd.edu>
+
 @item Arup Mukherjee <arup+@@cmu.edu>
 
 @item Juergen Nickelsen <nickel@@prz.tu-berlin.de>
 
 @item Kevin R. Powell <powell@@csl.ncsa.uiuc.edu>
 
+@item Justin Sheehy <dworkin@@ccs.neu.edu>
+
 @item Stig <stig@@hackvan.com>
+
+@item Aki Vehtari <Aki.Vehtari@@hut.fi>
 @end itemize
 
 @node Q1.3.1, Q1.3.2, Q1.2.3, Introduction
 @section What is the status of XEmacs v20?
 
 XEmacs v20 is the version of XEmacs that includes MULE (Asian-language)
-support.  XEmacs 20.0 was released in February 1997.  When compiled
-without MULE support 20.0 is currently very similar to 19.15 (except for
-some changes to the byte-code format, some new primitive types including
-@code{char}, @code{char-table}, and @code{range-table}) and equally
-stable.
+support.  XEmacs 20.0 was released in February 1997, followed by XEmacs
+20.2 in May.  When compiled without MULE support 20.2 is currently very
+similar to 19.15 (except for some changes to the byte-code format, some
+new primitive types including @code{char}, @code{char-table}, and
+@code{range-table}) and equally stable.
 
 @node Q1.3.2, Q1.3.3, Q1.3.1, Introduction
 @section What is the status of Asian-language support, aka MULE?
@@ -561,8 +582,7 @@
 It translates ASCII inputs to Kana/PinYin/Hangul characters.
 
 @item Kana/PinYin/Hangul to Kanji transfer layer.
-It is
-interface layer for network Kana-Kanji server (Wnn and Sj3).
+It is interface layer for network Kana-Kanji server (Wnn and Sj3).
 @end enumerate
 
 These input methods are modal, namely there are mode, alphabet mode and
@@ -577,7 +597,7 @@
 @end quotation
 
 @node Q1.3.6, Q1.3.7, Q1.3.5, Introduction
-@section How do I portably code for MULE/XEmacs 20.0?
+@section How do I portably code for MULE/XEmacs 20?
 
 MORIOKA Tomohiko <morioka@@jaist.ac.jp> writes:
 
@@ -635,7 +655,7 @@
 <URL:ftp://ftp.math.ohio-state.edu/pub/users/ilya/emacs/>.  This is a
 modification to Valery Alexeev's <ava@@math.jhu.ed> @file{russian.el}
 which can be obtained from 
-<URL:ftp://tut.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/russian.el.Z>.
+<URL:ftp://ftp.cis.ohio-state.edu/pub/gnu/emacs/elisp-archive/packages/russian.el.Z>.
 @end quotation
 
 Dima Barsky <d.barsky@@ee.surrey.ac.uk> writes:
@@ -703,9 +723,8 @@
       (setq there (point))
       (setq string (buffer-substring here there)))
     (while (>= count 1)
-      (progn
-	(insert string)
-	(setq count (1- count))))))
+      (insert string)
+      (decf count))))
 @end lisp
 
 The best way to see what is going on here is to let XEmacs tell you.
@@ -728,13 +747,16 @@
 
 Or interactively, @kbd{M-x global-set-key} and follow the prompts.
 
-Jari Aalto has written a guide to Emacs keys binding, available at
-<URL:ftp://cs.uta.fi/pub/ssjaaa/ema-keys.gui>.
+You can also view Jari Aalto's <jaalto@@tre.ntc.nokia.com> file:
+
+@example
+<URL:ftp://cs.uta.fi/pub/ssjaaa/ema-keys.html>
+@end example
 
 @node Q1.4.6, Q1.4.7, Q1.4.5, Introduction
 @section What's the difference between a macro and a function?
 
-Quoting from the Lisp Reference (a.k.a @dfn{lispref}) Manual:
+Quoting from the Lisp Reference (a.k.a @dfn{Lispref}) Manual:
 
 @dfn{Macros} enable you to define new control constructs and other
 language features.  A macro is defined much like a function, but instead
@@ -747,8 +769,12 @@
 therefore construct an expansion containing these argument expressions
 or parts of them.
 
+Do not confuse the two terms with @dfn{keyboard macros}, which are
+another matter, entirely.  A keyboard macro is a key bound to several
+other keys.  Refer to manual for details.
+
 @node Q1.4.7,  , Q1.4.6, Introduction
-@section How come options saved with 19.13 don't work with 19.14 or 20.0?
+@section How come options saved with 19.13 don't work with 19.14 or later?
 
 There's a problem with options of the form:
 
@@ -758,9 +784,9 @@
 @end lisp
 
 saved by a 19.13 XEmacs that causes a 19.14 XEmacs grief.  You must
-delete these options.  19.14 and later no longer write the options
-directly to @file{.emacs} which should allow us to deal with version
-incompatibilities better in the future.
+delete these options.  XEmacs 19.14 and later no longer write the
+options directly to @file{.emacs} which should allow us to deal with
+version incompatibilities better in the future.
 
 Options saved under XEmacs 19.13 are protected by code that specifically
 requires a version 19 XEmacs.  This won't be a problem unless you're
@@ -774,6 +800,7 @@
                 (>= emacs-minor-version 12))
            (>= emacs-major-version 20)))
  ...
+ ))
 @end lisp
 
 @node Installation, Customization, Introduction, Top
@@ -784,19 +811,20 @@
 
 @menu
 Installation:
-* Q2.0.1::      Running XEmacs without installing.
-* Q2.0.2::      XEmacs is too big.
+* Q2.0.1::      Running XEmacs without installing. 
+* Q2.0.2::      XEmacs is too big. 
 * Q2.0.3::      Compiling XEmacs with Netaudio.
 * Q2.0.4::      Problems with Linux and ncurses.
 * Q2.0.5::      Do I need X11 to run XEmacs?
 * Q2.0.6::      I'm having strange crashes.  What do I do?
 * Q2.0.7::      Libraries in non-standard locations.
 * Q2.0.8::      can't resolve symbol _h_errno
-* Q2.0.9::      Where do I find external libraries?
+* Q2.0.9::      Where do I find external libraries? 
 * Q2.0.10::     After I run configure I find a coredump, is something wrong?
 * Q2.0.11::     XEmacs can't resolve host names.
-* Q2.0.12::     Why can't I strip XEmacs?
+* Q2.0.12::     Why can't I strip XEmacs? 
 * Q2.0.13::     Can't link XEmacs on Solaris with Gcc.
+* Q2.0.14::     Make on HP/UX 9 fails after linking temacs 
 
 Trouble Shooting:
 * Q2.1.1::      XEmacs just crashed on me!
@@ -809,7 +837,7 @@
 * Q2.1.8::      got (wrong-type-argument color-instance-p nil)!
 * Q2.1.9::      XEmacs causes my OpenWindows 3.0 server to crash.
 * Q2.1.10::     Warnings from incorrect key modifiers.
-* Q2.1.11::     @samp{wrong type argument: bufferp, "......"}.
+* Q2.1.11::     [This question intentionally left blank]
 * Q2.1.12::     Regular Expression Problems on DEC OSF1.
 * Q2.1.13::     HP/UX 10.10 and @code{create_process} failure
 * Q2.1.14::     @kbd{C-g} doesn't work for me.  Is it broken?
@@ -821,6 +849,7 @@
 * Q2.1.20::     @samp{Symbol's function definition is void: hkey-help-show.}
 * Q2.1.21::     Every so often the XEmacs frame freezes.
 * Q2.1.22::     XEmacs seems to take a really long time to do some things.
+* Q2.1.23::     Movemail on Linux does not work for XEmacs 19.15 and later.
 @end menu
 
 @node Q2.0.1, Q2.0.2, Installation, Installation
@@ -837,11 +866,11 @@
 A good method is to make a shell alias for xemacs:
 
 @example
-alias xemacs=/i/xemacs-19.14/src/xemacs
+alias xemacs=/i/xemacs-20.2/src/xemacs
 @end example
 
 (You will obviously use whatever directory you downloaded the source
-tree to instead of @file{/i/xemacs-19.14}).
+tree to instead of @file{/i/xemacs-20.2}).
 
 This will let you run XEmacs without massive copying.
 
@@ -1015,6 +1044,11 @@
 remember as well.
 @end quotation
 
+@quotation
+XEmacs 20.3 will unbundle the lisp hierarchy and allow the installer
+to choose exactly how much support code gets installed.
+@end quotation
+
 @node Q2.0.3, Q2.0.4, Q2.0.2, Installation
 @section Compiling XEmacs with Netaudio.
 
@@ -1048,14 +1082,14 @@
 @section Problems with Linux and ncurses.
 
 On Linux 1.3.98 with termcap 2.0.8 and the ncurses that came with libc
-5.2.18, xemacs 20.0b20 is unable to open a tty device:
+5.2.18, XEmacs 20.0b20 is unable to open a tty device:
 
 @example
 src/xemacs -nw -q
 Initialization error: Terminal type `xterm' undefined (or can't access database?)
 @end example
 
-Ben Wing <ben@@666.com&gt writes:
+Ben Wing <ben@@666.com> writes:
 
 @quotation
 Your ncurses configuration is messed up.  Your /usr/lib/terminfo is a
@@ -1148,11 +1182,10 @@
 All external libraries used by XEmacs can be found at the XEmacs FTP
 site <URL:ftp://ftp.xemacs.org/pub/aux/>.
 
-The canonical locations are as follows:
+The canonical locations (at the time of this writing) are as follows:
 
 @table @asis
 @item JPEG
-<URL:ftp://ftp.netcom.com/pub/tg/tgl/uunet/>, mirrored at
 <URL:ftp://ftp.uu.net/graphics/jpeg/>.  Version 6a is current.
 
 @item XPM
@@ -1183,7 +1216,7 @@
 @end table
 
 @node Q2.0.10, Q2.0.11, Q2.0.9, Installation
-@section After I run configure I find a coredump, is something wrong?
+@section After I run configure I find a core dump, is something wrong?
 
 Not necessarily.  If you have GNU sed 3.0 you should downgrade it to
 2.05.  From the @file{README} at prep.ai.mit.edu:
@@ -1199,7 +1232,7 @@
 @end quotation
 
 It has also been observed that the vfork test on Solaris will leave a
-coredump.
+core dump.
 
 @node Q2.0.11, Q2.0.12, Q2.0.10, Installation
 @section XEmacs doesn't resolve hostnames.
@@ -1254,19 +1287,13 @@
 
 @enumerate
 @item
-[ configure; make ]
-
-@item
-cd src
+[ ./configure; make ]
 
 @item
-rm xemacs
+rm src/xemacs
 
 @item
-strip temacs
-
-@item
-cd ..
+strip src/temacs
 
 @item
 make
@@ -1275,11 +1302,11 @@
 cp src/xemacs /usr/local/bin/xemacs
 
 @item
-cp lib-src/DOC-19.14-XEmacs /usr/local/lib/xemacs-19.14/i586-unknown-linuxaout
+cp lib-src/DOC-19.15-XEmacs /usr/local/lib/xemacs-19.15/i586-unknown-linuxaout
 @end enumerate
 @end quotation
 
-@node Q2.0.13, Q2.1.1, Q2.0.12, Installation
+@node Q2.0.13, Q2.0.14, Q2.0.12, Installation
 @section Problems linking with Gcc on Solaris
 
 There are known difficulties linking with Gnu ld on Solaris.  A typical
@@ -1298,13 +1325,33 @@
 to ld.  Future releases of XEmacs will try to do this automatically.
 @end quotation
 
-@node Q2.1.1, Q2.1.2, Q2.0.13, Installation
+@node Q2.0.14, Q2.1.1, Q2.0.13, Installation
+@section Make on HP/UX 9 fails after linking temacs
+
+Problem when building xemacs-19.15 on hpux 9:
+
+Richard Cognot <cognot@@ensg.u-nancy.fr> writes:
+
+@quotation
+make on hpux fails after linking temacs with a message:
+
+@example
+"make: don't know how to make .y."
+@end example
+
+Solution: This is a problem with HP make revision 70.X.  Either use GNU
+make, or install PHCO_6552, which will bring make to revision
+72.24.1.17.
+@end quotation
+
+
+@node Q2.1.1, Q2.1.2, Q2.0.14, Installation
 @section Help!  XEmacs just crashed on me!
 
 First of all, don't panic.  Whenever XEmacs crashes, it tries extremely
-hard to auto-save all of your files before dying. (The main time that
+hard to auto-save all of your files before dying.  (The main time that
 this will not happen is if the machine physically lost power or if you
-killed the XEmacs process using @code{kill -9}). The next time you try
+killed the XEmacs process using @code{kill -9}).  The next time you try
 to edit those files, you will be informed that a more recent auto-save
 file exists.  You can use @kbd{M-x recover-file} to retrieve the
 auto-saved version of the file.
@@ -1417,7 +1464,7 @@
 set the environment variable @var{XKEYSYMDB} to the location of the
 @file{XKeysymDB} file on your system or to the location of the one
 included with XEmacs which should be at
-@file{<xemacs_root_directory>/lib/xemacs-19.14/etc/XKeysymDB}.
+@file{<xemacs_root_directory>/lib/xemacs-19.15/etc/XKeysymDB}.
 
 @item
 The binary is finding the XKeysymDB but it is out-of-date on your system
@@ -1465,12 +1512,10 @@
 @node Q2.1.6, Q2.1.7, Q2.1.5, Installation
 @section XEmacs just locked up my Linux X server!
 
-Help! XEmacs just locked up my X server on my Linux box!
-
 There have been several reports of the X server locking up under Linux.
 In all reported cases removing speedo and scaled fonts from the font
 path corrected the problem.  This can be done with the command
-'@code{xset}.
+@code{xset}.
 
 It is possible that using a font server may also solve the problem.
 
@@ -1571,18 +1616,9 @@
 @end example
 
 @node Q2.1.11, Q2.1.12, Q2.1.10, Installation
-@section @samp{wrong type argument: bufferp, "......"}.
-
-I'm using XEmacs 19.13 on Solaris 2.5. I'm having problem using the
-bookmark. When I try to set a bookmark, I always get the following error
-message:
-
-@lisp
-wrong type argument: bufferp, "......"
-@end lisp
-
-You are using the wrong version of @code{set-text-properties}.  Please
-use the one given with Q5.1.3 (@xref{Q5.1.3}).
+@section [This question intentionally left blank]
+
+Obsolete question, left blank to avoid renumbering.
 
 @node Q2.1.12, Q2.1.13, Q2.1.11, Installation
 @section Problems with Regular Expressions on DEC OSF1.
@@ -1787,11 +1823,11 @@
 use the narrowing-down process described above.
 
 @item
-If you compiled 19.14 with @samp{--debug} (or by default in 19.15), you
-will get a Lisp backtrace output when XEmacs crashes, so you'll have
-something useful.  If you're in 19.13, you could try doing @code{call
-debug_backtrace()}---sometimes this works even after a fatal signal has
-been received.
+If you compiled 19.14 with @samp{--debug} (or by default in later
+versions), you will get a Lisp backtrace output when XEmacs crashes, so
+you'll have something useful.  If you're in 19.13, you could try doing
+@code{call debug_backtrace()}---sometimes this works even after a fatal
+signal has been received.
 @end enumerate
 @end itemize
 @end quotation
@@ -1867,10 +1903,21 @@
 @node Q2.1.17, Q2.1.18, Q2.1.16, Installation
 @section @samp{Marker does not point anywhere}
 
-This is a problem with line-number-mode in XEmacs 19.14, and affects a
-large number of other packages.  If you see this error message, turn off
+As with other errors, set @code{debug-on-error} to @code{t} to get the
+backtrace when the error occurs.  Specifically, two problems have been
+reported (and fixed).
+
+@enumerate
+@item
+A problem with line-number-mode in XEmacs 19.14 affected a large number
+of other packages.  If you see this error message, turn off
 line-number-mode.
 
+@item
+A problem with some early versions of Gnus 5.4 caused this error.
+Upgrade your Gnus.
+@end enumerate
+
 @node Q2.1.18, Q2.1.19, Q2.1.17, Installation
 @section 19.14 hangs on HP/UX 10.10.
 
@@ -1915,7 +1962,7 @@
 @item
 A more serious problem I had discovered in the meantime, that is the
 fact that subprocess handling was seriously broken: subprocesses
-e.g. started by AUCTeX for TeX compilation of a buffer would
+e.g. started by AUC TeX for TeX compilation of a buffer would
 @emph{hang}.  Actually they would wait forever for emacs to read the
 socket which connects stdout...
 @end enumerate
@@ -1952,7 +1999,7 @@
 This problem has been fixed in 19.15, and was due to a not easily
 reproducible race condition.
 
-@node Q2.1.22,  , Q2.1.21, Installation
+@node Q2.1.22, Q2.1.23, Q2.1.21, Installation
 @section XEmacs seems to take a really long time to do some things
 
 David Moore <dmoore@@ucsd.edu> writes:
@@ -1970,12 +2017,12 @@
 gdb /path/to/xemacs/xemacs ####
 @end example
 
-Where #### is the process id of your xemacs, instead of specifying the
-core.  When gdb attaches, the xemacs will stop [1] and you can type
-`where' in gdb to get a stack trace as usual.  To get things moving
-again, you can just type `quit' in gdb.  It'll tell you the program is
-running and ask if you want to quit anyways.  Say 'y' and it'll quit and
-have your emacs continue from where it was at.
+Where @code{####} is the process id of your xemacs, instead of
+specifying the core.  When gdb attaches, the xemacs will stop [1] and
+you can type `where' in gdb to get a stack trace as usual.  To get
+things moving again, you can just type `quit' in gdb.  It'll tell you
+the program is running and ask if you want to quit anyways.  Say 'y' and
+it'll quit and have your emacs continue from where it was at.
 
 2) Lisp level:
 
@@ -1987,6 +2034,25 @@
 some other strange cases.
 @end quotation
 
+@node Q2.1.23,  , Q2.1.22, Installation
+@section  Movemail on Linux doe snot work for XEmacs 19.15 and later. 
+
+Movemail used to work fine in 19.14 but has stopped working in 19.15
+and 20.x.  I am using Linux.
+
+Steven L Baur <steve@@miranova.com> writes:
+
+@quotation
+Movemail on Linux used to default to using flock file locking.  With
+19.15 and later versions it now defaults to using @code{.lock} file
+locking.  If this is not appropriate for your system, edit src/s/linux.h
+and uncomment the line that reads:
+
+@example
+#define MAIL_USE_FLOCK
+@end example
+@end quotation
+
 @node Customization, Subsystems, Installation, Top
 @chapter Customization and Options
 
@@ -1995,20 +2061,20 @@
 
 @menu
 Customization---Emacs Lisp and @file{.emacs}:
-* Q3.0.1::      What version of Emacs am I running?
+* Q3.0.1::      What version of Emacs am I running? 
 * Q3.0.2::      How do I evaluate Elisp expressions?
 * Q3.0.3::      @code{(setq tab-width 6)} behaves oddly.
 * Q3.0.4::      How can I add directories to the @code{load-path}?
 * Q3.0.5::      How to check if a lisp function is defined?
 * Q3.0.6::      Can I force the output of @code{(face-list)} to a buffer?
-* Q3.0.7::      Font selections don't get saved after @code{Save Options}.
+* Q3.0.7::      Font selections don't get saved after @code{Save Options}. 
 * Q3.0.8::      How do I make a single minibuffer frame?
 
 X Window System & Resources:
 * Q3.1.1::      Where is a list of X resources?
 * Q3.1.2::      How can I detect a color display?
 * Q3.1.3::      @code{(set-screen-width)} worked in 19.6, but not in 19.13?
-* Q3.1.4::      Specifiying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.13?
+* Q3.1.4::      Specifiying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
 * Q3.1.5::      How can I get the icon to just say @samp{XEmacs}?
 * Q3.1.6::      How can I have the window title area display the full path?
 * Q3.1.7::      @samp{xemacs -name junk} doesn't work?
@@ -2018,18 +2084,18 @@
 * Q3.2.1::      How can I set color options from @file{.emacs}?
 * Q3.2.2::      How do I set the text, menu and modeline fonts?
 * Q3.2.3::      How can I set the colors when highlighting a region?
-* Q3.2.4::      How can I limit color map usage?
+* Q3.2.4::      How can I limit color map usage? 
 * Q3.2.5::      My tty supports color, but XEmacs doesn't use them.
 
 The Modeline:
 * Q3.3.1::      How can I make the modeline go away?
 * Q3.3.2::      How do you have XEmacs display the line number in the modeline?
 * Q3.3.3::      How do I get XEmacs to put the time of day on the modeline?
-* Q3.3.4::      How do I turn off current chapter from AUC-TeX modeline?
+* Q3.3.4::      How do I turn off current chapter from AUC TeX modeline?
 * Q3.3.5::      How can one change the modeline color based on the mode used?
 
 3.4 Multiple Device Support:
-* Q3.4.1::      How do I open a frame on another screen of my multi-headed display?
+* Q3.4.1::      How do I open a frame on another screen of my multi-headed display?  
 * Q3.4.2::      Can I really connect to a running XEmacs after calling up over a modem?  How?
 
 3.5 The Keyboard:
@@ -2038,7 +2104,7 @@
 * Q3.5.3::      How do I bind C-. and C-; to scroll one line up and down?
 * Q3.5.4::      Globally binding @kbd{Delete}?
 * Q3.5.5::      Scrolling one line at a time.
-* Q3.5.6::      How to map @kbd{Help} key alone on Sun type4 keyboard?
+* Q3.5.6::      How to map @kbd{Help} key alone on Sun type4 keyboard? 
 * Q3.5.7::      How can you type in special characters in XEmacs?
 * Q3.5.8::      Why does @code{(global-set-key [delete-forward] 'delete-char)} complain?
 * Q3.5.9::      How do I make the Delete key delete forward?
@@ -2073,7 +2139,7 @@
 * Q3.9.4::      How can I get automatic horizontal scrolling?
 
 Text Selections:
-* Q3.10.1::     How can I turn off or change highlighted selections?
+* Q3.10.1::     How can I turn off or change highlighted selections? 
 * Q3.10.2::     How do I get that typing on an active region removes it?
 * Q3.10.3::     Can I turn off the highlight during isearch?
 * Q3.10.4::     How do I turn off highlighting after @kbd{C-x C-p} (mark-page)?
@@ -2087,9 +2153,9 @@
 using?
 
 To determine if you are currently running GNU Emacs 18, GNU Emacs 19,
-XEmacs 19, or Epoch, and use appropriate code, check out the example
-given in @file{etc/sample.emacs}.  There are other nifty things in there
-as well!
+XEmacs 19, XEmacs 20, or Epoch, and use appropriate code, check out the
+example given in @file{etc/sample.emacs}.  There are other nifty things
+in there as well!
 
 For all new code, all you really need to do is:
 
@@ -2104,14 +2170,10 @@
 with @kbd{C-j} after the expression.  How do I do it from another
 buffer?
 
-Use the following code:
-
-@lisp
-(put 'eval-expression 'disabled nil)
-@end lisp
-
-This sets it so that hitting @kbd{M-:} lets you type a single expression
-to be evaluated.  This line can also be put into your @file{.emacs}.
+Press @kbd{M-:} (the default binding of @code{eval-expression}), and
+enter the expression to the minibuffer.  In XEmacs prior to 19.15
+@code{eval-expression} used to be a disabled command by default.  If
+this is the case, upgrade your XEmacs.
 
 @node Q3.0.3, Q3.0.4, Q3.0.2, Customization
 @section @code{(setq tab-width 6)} behaves oddly.
@@ -2132,14 +2194,12 @@
 @lisp
 ;;; Add things at the beginning of the load-path, do not add
 ;;; duplicate directories:
-(if (null (member "bar" load-path))
-    (setq load-path (cons "bar" load-path)))
-
-(if (null (member "foo" load-path))
-    (setq load-path (cons "foo" load-path)))
+(pushnew "bar" load-path :test 'equal)
+
+(pushnew "foo" load-path :test 'equal)
 
 ;;; Add things at the end, unconditionally
-(setq load-path (append load-path '("foo" "bar")))
+(setq load-path (nconc load-path '("foo" "bar")))
 @end lisp
 
 keith (k.p.) hanlan <keithh@@nortel.ca> writes:
@@ -2149,7 +2209,7 @@
 @file{expand-file-name} like this:
 
 @lisp
-(setq load-path (cons (expand-file-name "~keithh/.emacsdir") load-path))
+(push (expand-file-name "~keithh/.emacsdir") load-path)
 @end lisp
 @end quotation
 
@@ -2187,8 +2247,14 @@
 Evaluate the expression in the @samp{*scratch*} buffer with point after
 the rightmost paren and typing @kbd{C-j}.
 
+If the minibuffer smallness is the only problem you encounter, you can
+simply press @kbd{C-h l} to get the former minibuffer contents in a
+buffer.
+
 @node Q3.0.7, Q3.0.8, Q3.0.6, Customization
-@section Font selections don't get saved after @code{Save Options}.
+@section Font selections in don't get saved after @code{Save Options}.
+
+For XEmacs 19.14 and previous:
 
 John Mann <mannj@@ll.mit.edu> writes:
 
@@ -2199,6 +2265,14 @@
 when you save options.
 @end quotation
 
+For XEmacs 19.15 and later:
+
+Implement the above as well as set the following in your @file{.emacs} 
+
+@lisp
+(setq options-save-faces t)
+@end lisp
+
 @node Q3.0.8, Q3.1.1, Q3.0.7, Customization
 @section How do I get a single minibuffer frame?
 
@@ -2269,10 +2343,10 @@
 @end lisp
 
 @node Q3.1.4, Q3.1.5, Q3.1.3, Customization
-@section Specifiying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.13?
+@section Specifiying @code{Emacs*EmacsScreen.geometry} in @file{.emacs} does not work in 19.15?
 
 In XEmacs 19.11 I specified @code{Emacs*EmacsScreen.geometry} in
-my @file{.emacs} but this does not work in XEmacs 19.13.
+my @file{.emacs} but this does not work in XEmacs 19.15.
 
 We have switched from using the term @dfn{screen} to using the term
 @dfn{frame}.
@@ -2432,9 +2506,6 @@
 @code{font}.  With Motif it may be necessary to use @code{fontList}
 instead of @code{font}.
 
-Suggestions on improving the answer to this question would be
-appreciated.
-
 @node Q3.2.3, Q3.2.4, Q3.2.2, Customization
 @section How can I set the colors when highlighting a region?
 
@@ -2462,7 +2533,7 @@
 I'm using Netscape (or another color grabber like XEmacs);
 is there anyway to limit the number of available colors in the color map?
 
-XEmacs 19.13 doesn't have such a mechanism (unlike netscape, or other
+XEmacs 19.13 didn't have such a mechanism (unlike netscape, or other
 color-hogs).  One solution is to start XEmacs prior to netscape, since
 this will prevent Netscape from grabbing all colors (but Netscape will
 complain).  You can use the flags for Netscape, like -mono, -ncols <#>
@@ -2523,12 +2594,12 @@
 @end lisp
 
 @node Q3.3.4, Q3.3.5, Q3.3.3, Customization
-@section How do I turn off current chapter from AUC-TeX modeline?
-
-With AUC-TeX, fast typing is hard because the current chapter, section
+@section How do I turn off current chapter from AUC TeX modeline?
+
+With AUC TeX, fast typing is hard because the current chapter, section
 etc. are given in the modeline.  How can I turn this off?
 
-It's not auc-tex, it comes from @code{func-menu} in @file{func-menu.el}.
+It's not AUC TeX, it comes from @code{func-menu} in @file{func-menu.el}.
 Add this code to your @file{.emacs} to turn it off:
 
 @lisp
@@ -2563,8 +2634,8 @@
 
 @lisp
 (add-hook 'lisp-mode-hook 
-        '(lambda () (set-face-background 'modeline "red" (current-buffer))
-                    (set-face-foreground 'modeline "yellow" (current-buffer))))
+          (lambda ()
+            (set-face-background 'modeline "red" (current-buffer))))
 @end lisp
 
 Then, when editing a Lisp file (i.e. when in Lisp mode), the modeline
@@ -2595,25 +2666,28 @@
 current mode.
 @end itemize
 
-This works in 19.14 as well, but there are additional modeline faces,
+This works in 19.15 as well, but there are additional modeline faces,
 @code{modeline-buffer-id}, @code{modeline-mousable}, and
 @code{modeline-mousable-minor-mode}, which you may want to customize.
 
 @node Q3.4.1, Q3.4.2, Q3.3.5, Customization
 @section How do I open a frame on another screen of my multi-headed display?
 
-The support for this has been revamped for 19.14.  Use the command
+The support for this was revamped for 19.14.  Use the command
 @kbd{M-x make-frame-on-display}.  This command is also on the File menu
 in the menubar.
 
-XEmacs 19.14 also has the command @code{make-frame-on-tty} which will
-establish a connection to any tty-like device.
+XEmacs 19.14 and later also have the command @code{make-frame-on-tty}
+which will establish a connection to any tty-like device.  Opening the
+TTY devices should be left to @code{gnuclient}, though.
 
 @node Q3.4.2, Q3.5.1, Q3.4.1, Customization
 @section Can I really connect to a running XEmacs after calling up over a modem?  How?
 
 If you're not running at least XEmacs 19.14, you can't.  Otherwise check
-out the @code{gnuattach} program supplied with XEmacs.
+out the @code{gnuattach} program supplied with XEmacs.  Starting with
+XEmacs 20.3, @code{gnuattach} and @code{gnudoit} functionality will be
+provided by @code{gnuclient}.
 
 @node Q3.5.1, Q3.5.2, Q3.4.2, Customization
 @section How can I bind complex functions (or macros) to keys?
@@ -2634,21 +2708,21 @@
 the call in a 'lambda form:
 
 @lisp
-(define-key global-map [f18]
-  (function (lambda () (interactive) (x-insert-selection t nil))))
+(global-set-key [f18]
+                (lambda () (interactive) (x-insert-selection t nil)))
 @end lisp
 
 This binds the f18 key to a @dfn{generic} functional object.  The
 interactive spec is required because only interactive functions can be
-bound to keys.  Also take a look at the doc for @code{function}.
+bound to keys.
 
 For the FAQ example you could use:
 
 @lisp
 (global-set-key [(control ?.)]
-		(function (lambda () (interactive) (scroll-up 1))))
+		(lambda () (interactive) (scroll-up 1)))
 (global-set-key [(control ?;)]
-	        (function (lambda () (interactive) (scroll-up -1))))
+	        (lambda () (interactive) (scroll-up -1)))
 @end lisp
 
 This is fine if you only need a few functions within the lambda body.
@@ -2664,6 +2738,8 @@
 (setq next-line-add-newlines nil)
 @end lisp
 
+This has been the default setting in XEmacs for some time.
+
 @node Q3.5.3, Q3.5.4, Q3.5.2, Customization
 @section How do I bind C-. and C-; to scroll one line up and down?
 
@@ -2679,8 +2755,8 @@
   (interactive)
   (scroll-down 1))
 
-(global-set-key [(control ?.)]   'scroll-up-one-line)        ; C-.
-(global-set-key [(control ?;)]   'scroll-down-one-line)      ; C-;
+(global-set-key [(control ?.)] 'scroll-up-one-line)        ; C-.
+(global-set-key [(control ?;)] 'scroll-down-one-line)      ; C-;
 @end lisp
 
 The key point is that you can only bind simple functions to keys; you
@@ -2694,11 +2770,11 @@
 than the default.  How does one do this?
 
 @lisp
-(defun Foo ()
+(defun foo ()
   (interactive)
-    (message "You hit DELETE"))
-
-(global-set-key 'delete 'Foo)
+  (message "You hit DELETE"))
+
+(global-set-key 'delete 'foo)
 @end lisp
 
 However, some modes explicitly bind @kbd{Delete}, so you would need to
@@ -2729,11 +2805,10 @@
   (interactive "p")
   (scroll-down (or arg 1)))
 
-(global-set-key 'up 'scroll-one-line-up)
-(global-set-key 'down  'scroll-one-line-down)
+(global-set-key [up]   'scroll-one-line-up)
+(global-set-key [down] 'scroll-one-line-down)
 @end lisp
 
-
 The following will also work but will affect more than just the cursor
 keys (i.e. @kbd{C-n} and @kbd{C-p}):
 
@@ -2750,7 +2825,7 @@
 (global-set-key [help] 'help-command)  		;; Help
 @end lisp
 
-The following works in XEmacs 19.13 with the addition of shift:
+The following works in XEmacs 19.15 with the addition of shift:
 
 @lisp
 (global-set-key [(shift help)] 'help-command)  		;; Help
@@ -2773,7 +2848,8 @@
 One way is to use the package @samp{x-compose}.  Then you can use
 sequences like @kbd{Compose " a} to get ä, etc.
 
-Another way is to use the iso8859-1 package.
+Another way is to use the iso-ascii package, provided in XEmacs 19.15
+and later.
 
 @node Q3.5.8, Q3.5.9, Q3.5.7, Customization
 @section Why does @code{(global-set-key [delete-forward] 'delete-char)} complain?
@@ -2802,12 +2878,16 @@
 @node Q3.5.9, Q3.5.10, Q3.5.8, Customization
 @section How do I make the Delete key delete forward?
 
-Use the @file{delbackspace} package:
+Use the @file{delbs} package:
 
 @lisp
-(load-library "delbackspace")
+(require 'delbs)
 @end lisp
 
+This will give you the functions @code{delbs-enable-delete-forward} to
+set things up, and @code{delbs-disable-delete-forward} to revert to
+``normal'' behavior.
+
 Also @xref{Q3.5.4}.
 
 @node Q3.5.10, Q3.6.1, Q3.5.9, Customization
@@ -2822,7 +2902,7 @@
 
 @quotation
 One thing about the sticky modifiers is that if you move the mouse out
-of the frame and back in, it cancels all currently "stuck" modifiers.
+of the frame and back in, it cancels all currently ``stuck'' modifiers.
 @end quotation
 
 @node Q3.6.1, Q3.6.2, Q3.5.10, Customization
@@ -2882,13 +2962,12 @@
 use @code{define-key} or @code{global-set-key}.
 
 @lisp
-(defun Mouse-Set-Point-and-Select (event)
+(defun mouse-set-point-and-select (event)
   "Sets the point at the mouse location, then marks following form"
   (interactive "@@e")
   (mouse-set-point event)
-  (mark-sexp 1)
-  )
-(define-key global-map 'button2 'Mouse-Set-Point-and-Select)
+  (mark-sexp 1))
+(define-key global-map [button2] 'mouse-set-point-and-select)
 @end lisp
 
 @node Q3.7.2, Q3.7.3, Q3.7.1, Customization
@@ -2919,16 +2998,10 @@
 @node Q3.7.4, Q3.7.5, Q3.7.3, Customization
 @section How can I get a list of buffers when I hit mouse button 3?
 
-The following code will actually replace the default popup on button3:
+The following code will replace the default popup on button3:
 
 @lisp
-(defun cw-build-buffers ()
-  "Popup buffer menu."
-  (interactive "@@")
-  (run-hooks 'activate-menubar-hook)
-  (popup-menu (car (find-menu-item current-menubar '("Buffers")))))
-
-(define-key global-map [(button3)] 'cw-build-buffers)
+(global-set-key [button3] 'popup-buffer-menu)
 @end lisp
 
 @node Q3.7.5, Q3.7.6, Q3.7.4, Customization
@@ -3066,11 +3139,11 @@
 Try something like:
 
 @lisp
-(global-set-key [(control x) T]
-		'(lambda () (interactive)
-		   (set-specifier default-toolbar-visible-p 
-				  (not (specifier-instance
-					default-toolbar-visible-p)))))
+(defun my-toggle-toolbar ()
+  (interactive)
+  (set-specifier default-toolbar-visible-p
+                 (not (specifier-instance default-toolbar-visible-p))))
+(global-set-key "\C-xT" 'my-toggle-toolbar)
 @end lisp
 
 There are redisplay bugs in 19.14 that may make the preceding result in
@@ -3095,7 +3168,7 @@
 function:
 
 @lisp
-(set-specifier scrollbar-width (cons (selected-frame) 0))
+(set-specifier scrollbar-width 0 (selected-frame))
 @end lisp
 
 You can actually turn the scrollbars on at any level you want by
@@ -3103,13 +3176,13 @@
 turn the scrollbars off only in a single buffer:
 
 @lisp
-(set-specifier scrollbar-width (cons (current-buffer) 0))
+(set-specifier scrollbar-width 0 (current-buffer))
 @end lisp
 
-Starting with 19.14 you can use the more logical form:
+In XEmacs versions prior to 19.14, you had to use the hairier construct:
 
 @lisp
-(set-specifier scrollbar-width 0 (selected-frame))
+(set-specifier scrollbar-width (cons (selected-frame) 0))
 @end lisp
 
 @node Q3.9.2, Q3.9.3, Q3.9.1, Customization
@@ -3185,7 +3258,7 @@
 (setq zmacs-regions nil)
 @end lisp
 
-To change the face for selection, look at @code{Options->Edit Faces} on
+To change the face for selection, look at @code{Options->Customize} on
 the menubar.
 
 @node Q3.10.2, Q3.10.3, Q3.10.1, Customization
@@ -3288,9 +3361,10 @@
 Web browsing with W3:
 * Q4.1.1::      What is W3?
 * Q4.1.2::      How do I run W3 from behind a firewall?
+* Q4.1.3::      Is it true that W3 supports style sheets and tables?
 
 Reading Netnews and Mail with Gnus:
-* Q4.2.1::      GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, argh!
+* Q4.2.1::      GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus,argh! 
 * Q4.2.2::      [This question intentionally left blank]
 * Q4.2.3::      How do I make Gnus stay within a single frame?
 * Q4.2.4::      How do I customize the From: line?
@@ -3303,7 +3377,7 @@
 * Q4.3.5::      Where do I find pstogif (required by tm)?
 
 Sparcworks, EOS, and WorkShop:
-* Q4.4.1::      What is SPARCworks, EOS, and WorkShop
+* Q4.4.1::      What is SPARCworks, EOS, and WorkShop 
 
 Energize:
 * Q4.5.1::      What is/was Energize?
@@ -3312,10 +3386,11 @@
 * Q4.6.1::      What is Infodock?
 
 Other Unbundled Packages:
-* Q4.7.1::      What is AucTeX?  Where do you get it?
+* Q4.7.1::      What is AUC TeX?  Where do you get it?
 * Q4.7.2::      Are there any Emacs Lisp Spreadsheets?
-* Q4.7.3::      Byte compiling AucTeX on XEmacs 19.14
-* Q4.7.4::      Problems installing AucTeX
+* Q4.7.3::      Byte compiling AUC TeX on XEmacs 19.14
+* Q4.7.4::      Problems installing AUC TeX
+* Q4.7.5::      Is there a reason for an Emacs package not to be included in XEmacs?
 @end menu
 
 @node Q4.0.1, Q4.0.2, Subsystems, Subsystems
@@ -3341,9 +3416,6 @@
 Also see the Mail Filtering FAQ at:
 <URL:http://www.cis.ohio-state.edu/hypertext/faq/usenet/mail/filtering-faq/faq.html>.
 
-Another possibility is to check out Gnus 5.  Gnus 5 has mail splitting
-capability, and can use VM as a mail reading backend.
-
 @node Q4.0.3, Q4.0.4, Q4.0.2, Subsystems
 @section How can I get VM to automatically check for new mail?
 
@@ -3384,18 +3456,9 @@
 @node Q4.0.7, Q4.0.8, Q4.0.6, Subsystems
 @section Is there a mailing list or FAQ for VM?
 
-There is no archived FAQ for VM.
-
-Kyle Jones <kyle_jones@@wonderworks.com> writes:
-
-@quotation
-No, I'm too atavistic to write one.  For some reason I'd rather just
-answer the questions myself.  I guess it serves a purpose in that the VM
-user community knows that I'm still alive, despite the 9 months since
-the last release.
-@end quotation
-
-VM has its own newsgroup gnu.emacs.vm.info.
+A FAQ for VM exists at <URL:http://www.cyberpass.net/~gorkab/vmfaq.htm>. 
+
+VM has its own newsgroups gnu.emacs.vm.info and gnu.emacs.vm.bug.
 
 @node Q4.0.8, Q4.0.9, Q4.0.7, Subsystems
 @section Remote Mailreading with VM.
@@ -3438,7 +3501,7 @@
 @node Q4.0.9, Q4.0.10, Q4.0.8, Subsystems
 @section rmail or VM gets an error incorporating new mail.
 
->From the XEmacs PROBLEMS file:
+Quoting the XEmacs PROBLEMS file:
 
 @quotation
 rmail and VM get new mail from @file{/usr/spool/mail/$USER} using a
@@ -3556,16 +3619,28 @@
 It has a home web page at
 <URL:http://www.cs.indiana.edu/elisp/w3/docs.html>.
 
-@node Q4.1.2, Q4.2.1, Q4.1.1, Subsystems
+@node Q4.1.2, Q4.1.3, Q4.1.1, Subsystems
 @section How do I run W3 from behind a firewall?
 
 There is a long, well-written, detailed section in the W3 manual that
 describes how to do this.  Look in the section entitled "Firewalls".
 
-@node Q4.2.1, Q4.2.2, Q4.1.2, Subsystems
+@node Q4.1.3, Q4.2.1, Q4.1.2, Subsystems
+@section Is it true that W3 supports style sheets and tables?
+
+Yes, and much more.  W3, as distributed with the latest XEmacs is a
+full-featured web browser.
+
+@node Q4.2.1, Q4.2.2, Q4.1.3, Subsystems
 @section GNUS, (ding) Gnus, Gnus 5, September Gnus, Red Gnus, Mamey Sapote Gnus, argh!
 
-Please see <URL:http://www.ccs.neu.edu/software/gnus/> for details.
+The Gnus numbering issues are not meant for mere mortals to know them.
+If you feel you @emph{must} enter the muddy waters of Gnus, visit the
+excellent FAQ, maintained by Justin Sheehy, at:
+
+@example
+<URL:http://www.ccs.neu.edu/software/gnus/>
+@end example
 
 @node Q4.2.2, Q4.2.3, Q4.2.1, Subsystems
 @section This question intentionally left blank.
@@ -3575,25 +3650,17 @@
 @node Q4.2.3, Q4.2.4, Q4.2.2, Subsystems
 @section How do I make Gnus stay within a single frame?
 
-When starting Gnus from the toolbar it is automatically put into a new
-frame.  Gnus not being frame-aware code, has no provision to disable
-this feature.  If you feel this is a problem here are some workarounds:
-
-@enumerate
-@item
-Don't start Gnus from the toolbar, use @kbd{M-x gnus}.  This is what I
-do.
-
-@item
-Redefine the function called by the toolbar:
+The toolbar code to start Gnus opens the new frame---and it's a feature
+rather than a bug.  If you don't like it, but would still like to click
+on the seemly icon, use the following code:
 
 @lisp
 (defun toolbar-news ()
-  "Run Gnus in the frame it was started from."
-  (interactive)
   (gnus))
 @end lisp
-@end enumerate
+
+It will redefine the callback function of the icon to just call
+@code{gnus}, without all the fancy frame stuff.
 
 @node Q4.2.4, Q4.3.1, Q4.2.3, Subsystems
 @section How do I customize the From: line?
@@ -3635,6 +3702,8 @@
 support.  When appropriate a message will be decoded in place in an
 XEmacs buffer.
 
+TM now comes as a package with XEmacs 19.15 and XEmacs 20.0.
+
 TM was written by MORIOKA Tomohiko <morioka@@jaist.ac.jp> and KOBAYASHI
 Shuhei <shuhei-k@@jaist.ac.jp>.  It is based on the work of UMEDA
 Masanobu <umerin@@mse.kyutech.ac.jp>, the original writer of GNUS.
@@ -3722,7 +3791,7 @@
 tools such as TeamWare (for configuration management), MakeTool, etc.
 @end quotation
 
-See <URL:http://www.sun.com/sunsoft/Developer-products/products.html>
+See <URL:http://www.sun.com/sunsoft/Developer-products/>
 for more info.
 
 EOS stands for "Era on SPARCworks", but I don't know what Era stands
@@ -3923,10 +3992,11 @@
 step-by-step installation instructions.
 
 @node Q4.7.1, Q4.7.2, Q4.6.1, Subsystems
-@section What is AucTeX?  Where do you get it?
-
-AucTeX is a package written by Per Abrahamsen <abraham@@dina.kvl.dk>.
-The following information is from the @file{README} and website.
+@section What is AUC TeX?  Where do you get it?
+
+AUC TeX is a package written by Per Abrahamsen <abraham@@dina.kvl.dk>.
+Starting with XEmacs 19.15, AUC TeX is bundled with XEmacs.  The
+following information is from the @file{README} and website.
 
 AUC TeX is an extensible package that supports writing and formatting
 TeX files for most variants of GNU Emacs. Many different macro packages
@@ -3948,7 +4018,7 @@
 <URL:ftp://cs.nyu.edu/pub/local/fox/dismal/>.
 
 @node Q4.7.3, Q4.7.4, Q4.7.2, Subsystems
-@section Byte compiling AucTeX on XEmacs 19.14.
+@section Byte compiling AUC TeX on XEmacs 19.14.
 
 Georges Brun-Cottan <bruncott@@dormeur.inria.fr> writes:
 
@@ -3960,26 +4030,26 @@
 @end example
 @end quotation
 
-@node Q4.7.4,  , Q4.7.3, Subsystems
-@section Problems installing AucTeX.
+@node Q4.7.4, Q4.7.5, Q4.7.3, Subsystems
+@section Problems installing AUC TeX.
 
 Jan Vroonhof <vroonhof@@math.ethz.ch> writes:
 
 @quotation
-AucTeX works fine on both stock Emacs and XEmacs has been doing so for a
-very very long time. This is mostly due to the work of Per Abrahamsen
+AUC TeX works fine on both stock Emacs and XEmacs has been doing so for
+a very very long time. This is mostly due to the work of Per Abrahamsen
 <abraham@@dina.kvl.dk> (clap clap) in particular his @file{easymenu}
 package.  Which leads to what is probably the problem...
 @end quotation
 
-Most problems with AucTeX are one of two things:
+Most problems with AUC TeX are one of two things:
 
 @itemize @bullet
 @item
 The TeX-lisp-directory in @file{tex-site.el} and the makefile don't
 match.
 
-Fix: make sure you configure AucTeX properly @strong{before} installing.
+Fix: make sure you configure AUC TeX properly @strong{before} installing.
 
 @item
 You have an old version of easymenu.el in your path.
@@ -3988,6 +4058,46 @@
 @strong{only} finds the one that came with XEmacs.
 @end itemize
 
+
+@node Q4.7.5,  , Q4.7.4, Subsystems
+@section Is there a reason for an Emacs package not to be included in XEmacs?
+
+The reason for an Emacs package not to be included in XEmacs is
+usually one or more of the following:
+
+@enumerate
+@item
+The package has not been ported to XEmacs.  This will typically happen
+when it uses GNU-Emacs-specific features, which make it fail under
+XEmacs.
+
+Porting a package to XEmacs can range from a trivial amount of change to
+a partial or full rewrite.  Fortunately, the authors of modern packages
+usually choose to support both Emacsen themselves.
+
+@item
+The package has been decided not to be appropriate for XEmacs.  It may
+have an equivalent or better replacement within XEmacs, in which case
+the developers may choose not to burden themselves with supporting an
+additional package.
+
+Each package bundled with XEmacs means more work for the maintainers,
+whether they want it or not.  If you are ready to take over the
+maintainence responsibilities for the package you port, be sure to say
+so -- we will more likely include it.
+
+@item
+The package simply hasn't been noted by the XEmacs development.  If
+that's the case, the messages like yours are very useful for attracting
+our attention.
+
+@item
+The package was noted by the developers, but they simply haven't yet
+gotten around to including/porting it.  Wait for the next release or,
+even better, offer your help.  It will be gladly accepted and
+appreciated.
+@end enumerate
+
 @node Miscellaneous, Current Events, Subsystems, Top
 @chapter The Miscellaneous Stuff
 
@@ -4006,8 +4116,8 @@
 * Q5.0.7::      Telnet from shell filters too much.
 * Q5.0.8::      Why does edt emulation not work?
 * Q5.0.9::      How can I emulate VI and use it as my default mode?
-* Q5.0.10::     What is @samp{Omit} minor mode?
-* Q5.0.11::     Filladapt doesn't work in 19.13?
+* Q5.0.10::     [This question intentionally left blank] 
+* Q5.0.11::     Filladapt doesn't work in 19.15? 
 * Q5.0.12::     How do I disable gnuserv from opening a new frame?
 * Q5.0.13::     How do I start gnuserv so that each subsequent XEmacs is a client?
 * Q5.0.14::     Strange things are happening in Shell Mode.
@@ -4020,9 +4130,13 @@
 Emacs Lisp Programming Techniques:
 * Q5.1.1::      The difference in key sequences between XEmacs and GNU Emacs?
 * Q5.1.2::      Can I generate "fake" keyboard events?
-* Q5.1.3::      How can I visit several marked files at once in dired?
-* Q5.1.4::      In 19.13, why do I get @samp{set-text-something} lisp errors with Gnus and AUC-TeX?
-* Q5.1.5::      How do I put a glyph as annotation in a buffer?
+* Q5.1.3::      Could you explain @code{read-kbd-macro} in more detail?
+* Q5.1.4::      What is the performance hit of @code{let}?
+* Q5.1.5::      What is the recommended use of @code{setq}?
+* Q5.1.6::      What is the typical misuse of @code{setq} ?
+* Q5.1.7::      I like the the @code{do} form of cl, does it slow things down?
+* Q5.1.8::      I like recursion, does it slow things down?
+* Q5.1.9::      How do I put a glyph as annotation in a buffer?
 
 Sound:
 * Q5.2.1::      How do I turn off the sound?
@@ -4086,14 +4200,23 @@
 @node Q5.0.3, Q5.0.4, Q5.0.2, Miscellaneous
 @section How do I get @samp{More} Syntax Highlighting on by default?
 
-For C, C++, and Lisp, you can add the following to your @file{.emacs}:
+Use the following code in your @file{.emacs}:
 
 @lisp
-(setq c-font-lock-keywords c-font-lock-keywords-2)
-(setq c++-font-lock-keywords c++-font-lock-keywords-2)
-(setq lisp-font-lock-keywords lisp-font-lock-keywords-2)
+(setq-default font-lock-maximum-decoration t)
 @end lisp
 
+In versions of XEmacs prior to 19.14, you had to use a kludgy solution
+like this:
+
+@lisp
+(setq c-font-lock-keywords c-font-lock-keywords-2
+      c++-font-lock-keywords c++-font-lock-keywords-2
+      lisp-font-lock-keywords lisp-font-lock-keywords-2)
+@end lisp
+
+It will work for C, C++ and Lisp.
+
 @node Q5.0.4, Q5.0.5, Q5.0.3, Miscellaneous
 @section How can I enable auto-indent?
 
@@ -4109,10 +4232,13 @@
 @lisp
 (require 'filladapt)
 (add-hook 'text-mode-hook    'turn-on-filladapt-mode)
-(add-hook 'message-mode-hook 'turn-on-filladapt-mode)
-;;; and so forth ...
+;;; and others ...
 @end lisp
 
+Note that well-behaving text-lookalike modes will run
+@code{text-mode-hook} by default (e.g. that's what Message does).  For
+the nasty ones, you'll have to provide the @code{add-hook}s yourself.
+
 Please note that the @code{fa-extras} package is no longer useful.
 
 @node Q5.0.5, Q5.0.6, Q5.0.4, Miscellaneous
@@ -4140,17 +4266,17 @@
 
 @lisp
 (setq initial-major-mode
-      (function (lambda ()
+      (lambda ()
         (text-mode)
-        (turn-on-auto-fill))))
+        (turn-on-auto-fill)))
 @end lisp
 
 Note that after your init file is loaded, if
-@code{inhibit-startup-message} is null (the default) and the startup
-buffer is @code{*scratch*} then the startup message will be inserted
-into @code{*scratch*}; it will be removed after a timeout by erasing the
-entire @code{*scratch*} buffer. Keep in mind this default usage of
-@code{*scratch*} if you desire any prior manipulation of
+@code{inhibit-startup-message} is @code{nil} (the default) and the
+startup buffer is @code{*scratch*} then the startup message will be
+inserted into @code{*scratch*}; it will be removed after a timeout by
+erasing the entire @code{*scratch*} buffer.  Keep in mind this default
+usage of @code{*scratch*} if you desire any prior manipulation of
 @code{*scratch*} from within your Emacs init file. In particular,
 anything you insert into @code{*scratch*} from your init file will be
 later erased. Also, if you change the mode of the @code{*scratch*}
@@ -4193,14 +4319,14 @@
 this, add the following line to your @file{.emacs}:
 
 @lisp
-(load "tpu-edt")
+(tpu-edt)
 @end lisp
 
 If you don't want it to replace @kbd{C-h} with an edt-style help menu
 add this as well:
 
 @lisp
-(global-set-key '(control h) 'help-for-help)
+(global-set-key [(control h)] 'help-for-help)
 @end lisp
 
 @node Q5.0.9, Q5.0.10, Q5.0.8, Miscellaneous
@@ -4221,42 +4347,14 @@
 @end quotation
 
 @node Q5.0.10, Q5.0.11, Q5.0.9, Miscellaneous
-@section What is @code{Omit} minor mode?
-
-I have no idea where this is coming from, but ever since I moved from
-19.9 to 19.13 I have started seeing that all of my buffers will get a
-minor mode called @code{Omit}.  I have no idea how it got there nor do I
-know what it does.  What is it?
-
-It's part of dired.  In dired, you can type M-o to get Omit mode and
-that will ignore uninteresting files (checkpoint files and backups, for
-example).  You get Omit in the modeline everywhere because the variable
-@code{dired-omit-files-p} is globally set to some non-nil value.  If you
-want this functionality, it's probably best to use a hook:
-
-@lisp
-(add-hook 'dired-after-readin-hook '(lambda () (dired-omit-toggle)))
-@end lisp
-
-Alternatively, since it seems odd to toggle the omit state with every
-readin, since readin can happen many times in a Dired buffer, you can
-try this hook to correct the @code{Omit} problem:
-
-@lisp
-(add-hook 'dired-mode-hook
-  (function (lambda ()
-      ;; `dired-omit-files-p' is made buffer-local by "dired-x.el", but
-      ;; maybe not soon enough.
-            (make-local-variable 'dired-omit-files-p)
-            (setq dired-omit-files-p t))))
-@end lisp
-
-This is only run once, when the Dired buffer is created.
-
+@section [This question intentionally left blank]
+
+Obsolete question, left blank to avoid renumbering
+   
 @node Q5.0.11, Q5.0.12, Q5.0.10, Miscellaneous
-@section Filladapt doesn't work in 19.13?
-
-Filladapt 2.x is included in 19.13+.  In it filladapt is now a minor
+@section Filladapt doesn't work in 19.15
+
+Filladapt 2.x is included in 19.15.  In it filladapt is now a minor
 mode and minor modes are traditionally off by default.  The following
 added to your @file{.emacs} will turn it on for all buffers:
 
@@ -4376,7 +4474,7 @@
 
 @quotation
 The standard TeX modes leave much to be desired, and are somewhat
-leniently maintained.  Serious TeX users use AucTeX (@xref{Q4.7.1}).
+leniently maintained.  Serious TeX users use AUC TeX (@xref{Q4.7.1}).
 @end quotation
 
 @node Q5.1.1, Q5.1.2, Q5.0.19, Miscellaneous
@@ -4390,27 +4488,34 @@
 today.  XEmacs is instead optimized for X events.  This causes an
 incompatibility in the way key sequences are specified, but both Emacs
 and XEmacs will accept a key sequence as a vector of lists of modifiers
-that ends with a key, e.g., to bind M-C-a, you would say [(meta control
-a)] in both Emacsen.  XEmacs has an abbreviated form for a single key,
-just (meta control a).  Emacs has an abbreviated form for the Control
-and the Meta modifiers to string-characters (the ASCII characters), as
-in "\M-\C-a".  XEmacs users need to be aware that the abbreviated form
-works only for one-character key sequences, while Emacs users need to be
-aware that the string-character is rather limited.  Specifically, the
-string-character can accomodate only 256 different values, 128 of which
-have the Meta modifier and 128 of which have not.  In each of these
-blocks, only 32 characters have the Control modifier.  Whereas [(meta
-control A)] differs from [(meta control a)] because the case differs,
-"\M-\C-a" and "\M-\C-A" do not.  Programmers are advised to use the full
-common form, both because it is more readable and less error-prone, and
-because it is supported by both Emacsen.
+that ends with a key, e.g., to bind @kbd{M-C-a}, you would say
+@code{[(meta control a)]} in both Emacsen.  XEmacs has an abbreviated
+form for a single key, just (meta control a).  Emacs has an abbreviated
+form for the Control and the Meta modifiers to string-characters (the
+ASCII characters), as in @samp{\M-\C-a}.  XEmacs users need to be aware
+that the abbreviated form works only for one-character key sequences,
+while Emacs users need to be aware that the string-character is rather
+limited.  Specifically, the string-character can accomodate only 256
+different values, 128 of which have the Meta modifier and 128 of which
+have not.  In each of these blocks, only 32 characters have the Control
+modifier.  Whereas @code{[(meta control A)]} differs from @code{[(meta
+control a)]} because the case differs, @samp{\M-\C-a} and @samp{\M-\C-A}
+do not.  Programmers are advised to use the full common form, both
+because it is more readable and less error-prone, and because it is
+supported by both Emacsen.
 @end quotation
 
+Another (even safer) way to be sure of the key-sequences is to use the
+@code{read-kbd-macro} function, which takes a string like @samp{C-c
+<up>}, and converts it to the internal key representation of the Emacs
+you use.  The function is available both on XEmacs and GNU Emacs.
+
 @node Q5.1.2, Q5.1.3, Q5.1.1, Miscellaneous
 @section Can I generate "fake" keyboard events?
 
-I wonder if there is an interactive function that can generate "fake"
-keyboard events.  This way, I could simply map them inside XEmacs.
+I wonder if there is an interactive function that can generate
+@dfn{fake} keyboard events.  This way, I could simply map them inside
+XEmacs.
 
 This seems to work:
 
@@ -4420,116 +4525,291 @@
   (dispatch-event (character-to-event ch)))
 
 ;;  Backspace and Delete stuff
-(global-set-key '(backspace)
-                '(lambda () (interactive) (cg--generate-char-event 127)))
-(global-set-key '(unknown_keysym_0x4)
-                '(lambda () (interactive) (cg--generate-char-event 4)))
+(global-set-key [backspace]
+                (lambda () (interactive) (cg--generate-char-event 127)))
+(global-set-key [unknown_keysym_0x4]
+                (lambda () (interactive) (cg--generate-char-event 4)))
 @end lisp
 
 @node Q5.1.3, Q5.1.4, Q5.1.2, Miscellaneous
-@section How can I visit several marked files at once in dired?
-
-You can put this in your @file{.emacs} and then @kbd{F} will find marked
-files:
+@section Could you explain @code{read-kbd-macro} in more detail?
+
+The @code{read-kbd-macro} function returns the internal Emacs
+representation of a human-readable string (which is its argument).
+Thus:
 
 @lisp
-(add-hook
- 'dired-load-hook
- (function (lambda ()
-	     (define-key dired-mode-map "F"
-	       (function
-		(lambda () (interactive)
-		  (mapcar 'find-file
-			  (dired-mark-get-files))))))))
+(read-kbd-macro "C-c C-a")
+     @result{} [(control ?c) (control ?a)]
+
+(read-kbd-macro "C-c C-. <up>")
+     @result{} [(control ?c) (control ?.) up]
 @end lisp
 
-Aki Vehtari <Aki.Vehtari@@hut.fi> writes:
+In GNU Emacs the same forms will be evaluated to what GNU Emacs
+understands internally---the sequences @code{"\C-x\C-c"} and @code{[3
+67108910 up]}, respectively.
+
+The exact @dfn{human-readable} syntax is defined in the docstring of
+@code{edmacro-mode}.  I'll repeat it here, for completeness.
 
 @quotation
-You can also use @file{dired-x.el} (Sebastian Kremer's Extra DIRED). It
-defines F and makes other improvements too.  See @file{dired/dired-x.el}
-in the XEmacs distribution.
-
-In your @file{~/.emacs}, add:
-
-@lisp
-(setq dired-load-hook '(lambda () (load "dired-x")))
-@end lisp
+Format of keyboard macros during editing:
+
+Text is divided into @dfn{words} separated by whitespace.  Except for
+the words described below, the characters of each word go directly as
+characters of the macro.  The whitespace that separates words is
+ignored.  Whitespace in the macro must be written explicitly, as in
+@kbd{foo SPC bar RET}.
+
+@itemize @bullet
+@item
+The special words @kbd{RET}, @kbd{SPC}, @kbd{TAB}, @kbd{DEL}, @kbd{LFD},
+@kbd{ESC}, and @kbd{NUL} represent special control characters.  The
+words must be written in uppercase.
+
+@item
+A word in angle brackets, e.g., @code{<return>}, @code{<down>}, or
+@code{<f1>}, represents a function key.  (Note that in the standard
+configuration, the function key @code{<return>} and the control key
+@kbd{RET} are synonymous.)  You can use angle brackets on the words
+@kbd{RET}, @kbd{SPC}, etc., but they are not required there.
+
+@item
+Keys can be written by their @sc{ascii} code, using a backslash followed
+by up to six octal digits.  This is the only way to represent keys with
+codes above \377.
+
+@item
+One or more prefixes @kbd{M-} (meta), @kbd{C-} (control), @kbd{S-}
+(shift), @kbd{A-} (alt), @kbd{H-} (hyper), and @kbd{s-} (super) may
+precede a character or key notation.  For function keys, the prefixes
+may go inside or outside of the brackets: @code{C-<down>} @equiv{}
+@code{<C-down>}.  The prefixes may be written in any order: @kbd{M-C-x}
+@equiv{} @kbd{C-M-x}.
+
+Prefixes are not allowed on multi-key words, e.g., @kbd{C-abc}, except
+that the Meta prefix is allowed on a sequence of digits and optional
+minus sign: @kbd{M--123} @equiv{} @kbd{M-- M-1 M-2 M-3}.
+
+@item
+The @code{^} notation for control characters also works: @kbd{^M}
+@equiv{} @kbd{C-m}.
+
+@item
+Double angle brackets enclose command names: @code{<<next-line>>} is
+shorthand for @kbd{M-x next-line RET}.
+
+@item
+Finally, @code{REM} or @code{;;} causes the rest of the line to be
+ignored as a comment.
+@end itemize
+
+Any word may be prefixed by a multiplier in the form of a decimal number
+and @code{*}: @code{3*<right>} @equiv{} @code{<right> <right> <right>},
+and @code{10*foo} @equiv{} @code{foofoofoofoofoofoofoofoofoofoo}.
+
+Multiple text keys can normally be strung together to form a word, but
+you may need to add whitespace if the word would look like one of the
+above notations: @code{; ; ;} is a keyboard macro with three semicolons,
+but @code{;;;} is a comment.  Likewise, @code{\ 1 2 3} is four keys but
+@code{\123} is a single key written in octal, and @code{< right >} is
+seven keys but @code{<right>} is a single function key.  When in doubt,
+use whitespace.
 @end quotation
 
 @node Q5.1.4, Q5.1.5, Q5.1.3, Miscellaneous
-@section In 19.13, why do I get @samp{set-text-something} lisp errors with Gnus and AUC-TeX?
-
-The real problem is out of date software.  Upgrade to later versions of
-Gnus and AUC-TeX where this problem doesn't exist.
-
-The problem lies with the needs for an Emacs function,
-@code{set-text-properties}, which generally isn't required by XEmacs.
-The solutions include adding the following code to your @file{.emacs}:
+@section What is the performance hit of @code{let}?
+
+In most cases, not noticable.  Besides, there's no avoiding
+@code{let}---you have to bind your local variables, after all.  Some
+pose a question whether to nest @code{let}s, or use one @code{let} per
+function.  I think because of clarity and maintenance (and possible
+future implementation), @code{let}-s should be used (nested) in a way to
+provide the clearest code.
+
+@node Q5.1.5, Q5.1.6, Q5.1.4, Miscellaneous
+@section What is the recommended use of @code{setq}?
+
+@itemize @bullet
+@item Global variables
+
+You will typically @code{defvar} your global variable to a default
+value, and use @code{setq} to set it later.
+
+It is never a good practice to @code{setq} user variables (like
+@code{case-fold-search}, etc.), as it ignores the user's choice
+unconditionally.  Note that @code{defvar} doesn't change the value of a
+variable if it was bound previously.  If you wish to change a
+user-variable temporarily, use @code{let}:
+
+@lisp
+(let ((case-fold-search nil))
+  ...       ; code with searches that must be case-sensitive
+  ...)
+@end lisp
+
+You will notice the user-variables by their docstrings beginning with an
+asterisk (a convention).
+
+@item Local variables
+
+Bind them with @code{let}, which will unbind them (or restore their
+previous value, if they were bound) after exiting from the @code{let}
+form.  Change the value of local variables with @code{setq} or whatever
+you like (e.g. @code{incf}, @code{setf} and such).  The @code{let} form
+can even return one of its local variables.
+
+Typical usage:
 
 @lisp
-(fset 'set-text-properties (symbol-function 'ignore))
+;; iterate through the elements of the list returned by
+;; `hairy-function-that-returns-list'
+(let ((l (hairy-function-that-returns-list)))
+  (while l
+    ... do something with (car l) ...
+    (setq l (cdr l))))
 @end lisp
 
-or 
+Another typical usage includes building a value simply to work with it.
 
 @lisp
-(defadvice set-text-properties (around ignore-strings activate)
-  "Ignore strings."
-  (or (stringp (ad-get-arg 3))
-      ad-do-it))
+;; Build the mode keymap out of the key-translation-alist
+(let ((inbox (file-truename (expand-file-name box)))
+      (i 0))
+  ... code dealing with inbox ...
+  inbox)
+@end lisp
+
+This piece of code uses the local variable @code{inbox}, which becomes
+unbound (or regains old value) after exiting the form.  The form also
+returns the value of @code{inbox}, which can be reused, for instance:
+
+@lisp
+(setq foo-processed-inbox
+      (let .....))
 @end lisp
-
-The best is probably the canonical solution (posted by C.Thompson, on
-10/17/95):
+@end itemize
+
+@node Q5.1.6, Q5.1.7, Q5.1.5, Miscellaneous
+@section What is the typical misuse of @code{setq} ?
+
+A typical misuse is probably @code{setq}ing a variable that was meant to
+be local.  Such a variable will remain bound forever, never to be
+garbage-collected.  For example, the code doing:
+
+@lisp
+(defun my-function (whatever)
+  (setq a nil)
+  ... build a large list ...
+  ... and exit ...)
+@end lisp
+
+does a bad thing, as @code{a} will keep consuming memory, never to be
+unbound.  The correct thing is to do it like this:
 
 @lisp
-(defun set-text-properties (start end props &optional buffer)
-  "You should NEVER use this function.  It is ideologically blasphemous.
-It is provided only to ease porting of broken FSF Emacs programs."
-  (if (stringp buffer) nil
-    (map-extents 
-     #'(lambda (extent ignored)
-	 (remove-text-properties
-	  start end (list (extent-property extent 'text-prop) nil)
-	  buffer))
-     buffer start end nil nil 'text-prop)
-    (add-text-properties start end props buffer)))
+(defun my-function (whatever)
+  (let (a)             ; default initialization is to nil
+    ... build a large list ...
+    ... and exit, unbinding `a' in the process  ...)
 @end lisp
 
-@node Q5.1.5, Q5.2.1, Q5.1.4, Miscellaneous
-@section How do I put a glyph as annotation in a buffer?
-
-Thomas Feuster <feuster@@tp4.physik.uni-giessen.de> writes:
+Not only is this prettier syntactically, but it makes it possible for
+Emacs to garbage-collect the objects which @code{a} used to reference.
+
+Note that even global variables should not be @code{setq}ed without
+@code{defvar}ing them first, because the byte-compiler issues warnings.
+The reason for the warning is the following:
+
+@lisp
+(defun flurgoze nil)          ; ok, global internal variable
+...
+
+(setq flurghoze t)      ; ops!  a typo, but semantically correct.
+                        ; however, the byte-compiler warns.
+
+While compiling toplevel forms:
+  ** assignment to free variable flurghoze
+@end lisp
+
+@node Q5.1.7, Q5.1.8, Q5.1.6, Miscellaneous
+@section I like the the @code{do} form of cl, does it slow things down?
+
+It shouldn't.  Here is what Dave Gillespie has to say about cl.el
+performance:
 
 @quotation
-@lisp
-(let ((image-glyph (make-glyph-internal)))
-(seems to be unavoidable to do 'make-glyph-internal')
-@end lisp
-
-Now for viewing files:
+Many of the advanced features of this package, such as @code{defun*},
+@code{loop}, and @code{setf}, are implemented as Lisp macros.  In
+byte-compiled code, these complex notations will be expanded into
+equivalent Lisp code which is simple and efficient.  For example, the
+forms
 
 @lisp
-(set-glyph-image image-glyph view-graph-file-buf))
+(incf i n)
+(push x (car p))
 @end lisp
 
-For viewing already loaded buffers:
+are expanded at compile-time to the Lisp forms
 
 @lisp
-(setq image-glyph (make-glyph 
-                   (vector view-graph-file-format :data 
-		           (buffer-substring 
-			   (point-min) 
-		       	   (point-max)))))
+(setq i (+ i n))
+(setcar p (cons x (car p)))
 @end lisp
 
-The thing I couldn't figure out is how to make XEmacs guess the format
-from the contents - like it does for files. So it's a real pain to
-extract the format from the extensions of the file-name...
+which are the most efficient ways of doing these respective operations
+in Lisp.  Thus, there is no performance penalty for using the more
+readable @code{incf} and @code{push} forms in your compiled code.
+
+@emph{Interpreted} code, on the other hand, must expand these macros
+every time they are executed.  For this reason it is strongly
+recommended that code making heavy use of macros be compiled.  (The
+features labelled @dfn{Special Form} instead of @dfn{Function} in this
+manual are macros.)  A loop using @code{incf} a hundred times will
+execute considerably faster if compiled, and will also garbage-collect
+less because the macro expansion will not have to be generated, used,
+and thrown away a hundred times.
+
+You can find out how a macro expands by using the @code{cl-prettyexpand}
+function.
 @end quotation
 
-@node Q5.2.1, Q5.2.2, Q5.1.5, Miscellaneous
+@node Q5.1.8, Q5.1.9, Q5.1.7, Miscellaneous
+@section I like recursion, does it slow things down?
+
+Yes.  Emacs byte-compiler cannot do much to optimize recursion.  But
+think well whether this is a real concern in Emacs.  Much of the Emacs
+slowness comes from internal mechanisms such as redisplay, or from the
+fact that it is an interpreter.
+
+Please try not to make your code much uglier to gain a very small speed
+gain.  It's not usually worth it.
+
+@node Q5.1.9, Q5.2.1, Q5.1.8, Miscellaneous
+@section How do I put a glyph as annotation in a buffer?
+
+Here is a solution that will insert the glyph annotation at the
+beginning of buffer:
+
+@lisp
+(make-annotation (make-glyph '([FORMAT :file FILE]
+                               [string :data "fallback-text"]))
+                 (point-min)
+                 'text
+                 (current-buffer))
+@end lisp
+
+Replace @samp{FORMAT} with an unquoted symbol representing the format of 
+the image (e.g. @code{xpm}, @code{xbm}, @code{gif}, @code{jpeg}, etc.)
+Instead of @samp{FILE}, use the image file name
+(e.g. @file{/usr/local/lib/xemacs-20.2/etc/recycle.xpm}).
+
+You can turn this to a function (that optionally prompts you for a file
+name), and inserts the glyph at @code{(point)} instead of
+@code{(point-min)}.
+
+@node Q5.2.1, Q5.2.2, Q5.1.9, Miscellaneous
 @section How do I turn off the sound?
 
 Add the following line to your @file{.emacs}:
@@ -4539,6 +4819,9 @@
 (setq sound-alist nil)
 @end lisp
 
+That will make your XEmacs totally silent -- even the default ding sound 
+(TTY beep on TTY-s) will be gone.
+
 @node Q5.2.2, Q5.2.3, Q5.2.1, Miscellaneous
 @section How do I get funky sounds instead of a boring beep?
 
@@ -4549,7 +4832,7 @@
 (load-default-sounds)
 @end lisp
 
-The sound support in XEmacs 19.14 is greatly improved over previous
+The sound support in XEmacs 19.14 was greatly improved over previous
 versions.
 
 @node Q5.2.3, Q5.2.4, Q5.2.2, Miscellaneous
@@ -4612,11 +4895,6 @@
 than previous versions.  This may prove useful if you need to customize
 any indent-functions.
 
-NB: I would have thought with the passage of time this would be the
-standard version by now, but that appears not to be the case.  The
-version of filladapt included with 19.14 is last dated 1993, and does
-not have a version number.
-
 @node Q5.3.2, Q5.3.3, Q5.3.1, Miscellaneous
 @section Fontifying hang when editing a postscript file.
 
@@ -4689,20 +4967,64 @@
 @node Q5.3.7, Q5.3.8, Q5.3.6, Miscellaneous
 @section Can I have the end of the buffer delimited in some way?
 
-Say, with: [END]?
-
-Use this:
+Say, with: @samp{[END]}?
+
+Try this:
+
+@lisp
+(let ((ext (make-extent (point-min) (point-max))))
+  (set-extent-property ext 'start-closed t)
+  (set-extent-property ext 'end-closed t)
+  (set-extent-property ext 'detachable nil)  
+  (set-extent-end-glyph ext (make-glyph [string :data "[END]"])))
+@end lisp
+
+Since this is XEmacs, you can specify an icon to be shown on
+window-system devices.  To do so, change the @code{make-glyph} call to
+something like this:
+
+@lisp
+(make-glyph '([xpm :file "~/something.xpm"]
+              [string :data "[END]"]))
+@end lisp
+
+You can inline the @sc{xpm} definition yourself by specifying
+@code{:data} instead of @code{:file}.  Here is such a full-featured
+version that works on both X and TTY devices:
 
 @lisp
-(make-annotation "[END]" (point-max) 'text (current-buffer))
+(let ((ext (make-extent (point-min) (point-max))))
+  (set-extent-property ext 'start-closed t)
+  (set-extent-property ext 'end-closed t)
+  (set-extent-property ext 'detachable nil)  
+  (set-extent-end-glyph ext (make-glyph '([xpm :data "\
+/* XPM */
+static char* eye = @{
+\"20 11 7 2\",
+\"__ c None\"
+\"_` c #7f7f7f\",
+\"_a c #fefefe\",
+\"_b c #7f0000\",
+\"_c c #fefe00\",
+\"_d c #fe0000\",
+\"_e c #bfbfbf\",
+\"___________`_`_`___b_b_b_b_________`____\", 
+\"_________`_`_`___b_c_c_c_b_b____________\", 
+\"_____`_`_`_e___b_b_c_c_c___b___b_______`\", 
+\"___`_`_e_a___b_b_d___b___b___b___b______\", 
+\"_`_`_e_a_e___b_b_d_b___b___b___b___b____\", 
+\"_`_`_a_e_a___b_b_d___b___b___b___b___b__\", 
+\"_`_`_e_a_e___b_b_d_b___b___b___b___b_b__\", 
+\"___`_`_e_a___b_b_b_d_c___b___b___d_b____\", 
+\"_____`_`_e_e___b_b_b_d_c___b_b_d_b______\", 
+\"_`_____`_`_`_`___b_b_b_d_d_d_d_b________\", 
+\"___`_____`_`_`_`___b_b_b_b_b_b__________\", 
+@} ;"]
+                                          [string :data "[END]"]))))
 @end lisp
 
-Note that you might want to put this in a hook.  Since
-@code{make-annotation} is not defined by default, you might also need:
-
-@lisp
-(require 'annotations)
-@end lisp
+Note that you might want to make this a function, and put it to a hook.
+We leave that as an excercise for the reader.
 
 @node Q5.3.8, Q5.3.9, Q5.3.7, Miscellaneous
 @section How do I insert today's date into a buffer?
@@ -4731,6 +5053,11 @@
 read this question/answer again.
 @end quotation
 
+Newsflash: this restriction has been lifted, starting with XEmacs 20.3,
+which is currently in beta.  Hrvoje Niksic <hniksic@@srce.hr> will
+appreciate it if you download a beta, try out whether abbreviations work 
+like you expect them to, and let him know.
+
 @node Q5.3.10, Q5.3.11, Q5.3.9, Miscellaneous
 @section How can I get those oh-so-neat X-Face lines?
 
@@ -4776,9 +5103,9 @@
   (save-excursion 
     (goto-char (point-min))
     (search-forward mail-header-separator)
-    (beginning-of-line nil)
+    (beginning-of-line)
     (insert "X-Face:")
-    (insert-file "~/.face")))
+    (insert-file-contents "~/.face")))
 
 (add-hook 'mail-setup-hook 'mail-insert-x-face)
 @end lisp
@@ -4911,24 +5238,41 @@
 various FAQ FTP sites, as this file is surely out of date.
 
 @menu
-* Q6.0.1::      What is new in 19.15?
+* Q6.0.1::      What is new in 20.2?
+* Q6.0.2::      What is new in 20.3?
 * Q6.0.3::      Procedural changes in XEmacs development.
 @end menu
 
-@node Q6.0.1, Q6.0.3, Current Events, Current Events
-@section What is new in 19.15?
-
-The biggest changes in 19.15 include integration of TM (a MIME package
-for VM and Gnus), EFS (the next generation of ange-ftp) and AUC TeX (the
-Emacs subsystem that includes a major mode for editing TeX and LaTeX,
-and a lot of other stuff).  Many bugs from 19.14 have been fixed for
-this release.
-
-XEmacs 20.0 (which includes full Asian-language support aka MULE) has
-been released, but is still considered unstable.  This work is being
-supported by Sun Microsystems.
-
-@node Q6.0.3,  , Q6.0.1, Current Events
+@node Q6.0.1, Q6.0.2, Current Events, Current Events
+@section What is new in 20.2?
+
+The biggest changes in 20.2 include intergration of EFS (the next
+generation of ange-ftp) and AUC Tex (the Emacs subsystem that includes a
+major mode for editing Tex and LaTeX, and a lot of other stuff).  Many
+bugs from 20.0 have been fixed for this release.  20.2 also contains a
+new system for customizing XEmacs options, invoked via @kbd{M-x
+customize}.
+
+XEmacs 20.2 is the development release (20.0 was beta), and is no longer
+considered unstable.
+
+@node Q6.0.2, Q6.0.3, Q6.0.1, Current Events
+@section What is new in 20.3?
+
+XEmacs release 20.3 is planned for autumn 1997.  It will likely contain
+a much smaller amount of code for basic functionality, with all the
+popular Lisp packages being available in the form of easy-to-install
+add-ons.
+
+Other input methods (such as skk) will be made available for Mule, as
+well as more user-level documentation.
+
+Many new features are planned, such as multiple TTY frames, support for
+Autoconf 2, synches with Emacs 20.1, and more; much of this is already
+running in various beta versions.  Ask at
+@code{<xemacs-beta-request@@xemacs.org>} for more details.
+
+@node Q6.0.3,  , Q6.0.2, Current Events
 @section Procedural changes in XEmacs development.
 
 @enumerate
@@ -4945,11 +5289,13 @@
 decided that intermediate versions will be made available in source only
 form for the truly interested.
 
-XEmacs 19.15 is the end of the road for version 19 XEmacs.  The next
-release after 19.15 will be XEmacs 20.1.
+No further XEmacs 19 feature releases are planned.  XEmacs 19.16 will
+consist of 19.15 plus the collected bugfixes, and will probably be the
+final version of XEmacs 19.
 
 @item
 As of December 1996, Steve Baur <steve@@altair.xemacs.org> has become
 the lead maintainer of XEmacs.
+@end enumerate
 
 @bye
--- a/src/emacs.c	Mon Aug 13 08:57:25 2007 +0200
+++ b/src/emacs.c	Mon Aug 13 08:57:55 2007 +0200
@@ -179,7 +179,7 @@
   /* If fatal error occurs in code below, avoid infinite recursion.  */
   if (! fatal_error_in_progress)
     {
-      fatal_error_in_progress = 1;
+      fatal_error_in_progress = dont_check_for_quit = 1;
       shut_down_emacs (sig, Qnil);
       stderr_out("\nLisp backtrace follows:\n\n");
       Fbacktrace(Qexternal_debugging_output, Qt);
--- a/src/puresize.h	Mon Aug 13 08:57:25 2007 +0200
+++ b/src/puresize.h	Mon Aug 13 08:57:55 2007 +0200
@@ -31,11 +31,15 @@
 /* Basic amount of purespace to use, in the absence of extra
    things configured in. */
 
+/* This computation is Barbra Streisand, BS
 #if (LONGBITS == 64)
 # define BASE_PURESIZE 944000
 #else
 # define BASE_PURESIZE 527000
 #endif
+*/
+
+#define BASE_PURESIZE 1400000
 
 /* If any particular systems need to change the base puresize, they
    should define SYSTEM_PURESIZE_EXTRA.  Note that this can be