#! /bin/sh
#
# This is a shell script that converts exmh-1.6.4 to exmh-1.6.5
#
TOP=.

findBinary()
{
    IFS=:
    for i in $PATH; do
	 test -x $i/$1 && return
    done
    echo "Fatal error: this shell script requires $2."
    exit 1
}
findBinary patch "Larry Wall's patch program"

Patch()
{
    echo "Patch $1:"
    patch -s $TOP/$1
}

NewFile()
{
    echo "New file $1"
    cat >$TOP/$1
}

NewDir()
{
    echo "New directory $1"
    mkdir "$TOP/$1"
}

RmDir()
{
    echo "Remove directory $1"
    rm -rf $TOP/$1.orig
    mv $TOP/$1 $TOP/$1.orig
}

RmFile()
{
    echo "Remove $1"
    rm -f $TOP/$1.orig
    mv $TOP/$1 $TOP/$1.orig
}

Patch exmh-bg.MASTER<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh-bg.MASTER	Fri Aug 11 10:10:13 1995
--- exmh-1.6.5/exmh-bg.MASTER	Wed Nov 22 10:03:44 1995
***************
*** 44,49 ****
--- 44,52 ----
  }
  auto_path_update $exmh(library)
  
+ # Set up environment variables
+ Env_Init
+ 
  proc Exmh_Status { string args } {
      # Just a stub version until we rendez-vous with the front end.
      # If the userLibrary Preferences_Add is done after we define the
***************
*** 91,110 ****
  if [catch {User_Init} err] {
      catch {puts stderr "User_Init: $err"}
  }
- # Make sure MH is on the path
- set hit 0
- foreach dir [split $env(PATH) :] {
-     if {[string compare $dir $mh_path] == 0} {
- 	set hit 1
- 	break
-     }
- }
- if {! $hit} {
-     set env(PATH) $mh_path:$env(PATH)
- }
- # Use an alternate context to avoid conflict with command line MH
- # This has to be the same as used by exmh so that private sequences work right.
- set env(MHCONTEXT) .exmhcontext
  
  proc Exmh_Debug { args } {
      global exmh
--- 94,99 ----
***************
*** 205,209 ****
--- 194,199 ----
  Inc_Init
  Ftoc_Init		;# Need ftoc(scanWidth)
  Flist_Init
+ set busy(style) none
  Background_Init
  Background_DoPeriodic
EOF-EOF-EOF
Patch exmh-custom.l<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh-custom.l	Wed Jul 12 11:36:28 1995
--- exmh-1.6.5/exmh-custom.l	Fri Dec  8 11:01:01 1995
***************
*** 10,16 ****
  .RE
  .sp .5
  ..
! .TH "EXMH CUSTOM" 1 "June 30, 1995" "Exmh 1.6.2"
  .SH NAME
  exmh-custom - A guide to customizing the exmh mail user interface.
  .SH "CUSTOMIZING EXMH"
--- 10,16 ----
  .RE
  .sp .5
  ..
! .TH "EXMH CUSTOM" 1 "Dec 8, 1995" "Exmh 1.6.5"
  .SH NAME
  exmh-custom - A guide to customizing the exmh mail user interface.
  .SH "CUSTOMIZING EXMH"
***************
*** 1019,1025 ****
  to override the definition of a single Tcl procedure, as explained below.
  .PP
  By the way, if you do anything interesting to the sources, send the
! results to exmhbugs@parc.xerox.com so they can be folded back into
  the master sources.  Many of the good features in \fIexmh\fP came
  about this way.
  .PP
--- 1019,1025 ----
  to override the definition of a single Tcl procedure, as explained below.
  .PP
  By the way, if you do anything interesting to the sources, send the
! results to Brent.Welch@sun.com so they can be folded back into
  the master sources.  Many of the good features in \fIexmh\fP came
  about this way.
  .PP
***************
*** 1029,1036 ****
  good on-line manual pages that come with Tcl and Tk.  There are
  books about Tcl, too.  John Ousterhout, the creator of Tcl and Tk,
  has written \fITcl and the Tk Toolkit\fP, by Addison-Wesley.
! I am writing \fIPractical Programming in Tcl and Tk\fP,
! to be published in early 1995 by Prentice-Hall.
  .PP
  Your custom Tcl code is kept in your ~/.tk/exmh directory.
  You maintain this as a Tcl library, which amounts to keeping a file
--- 1029,1036 ----
  good on-line manual pages that come with Tcl and Tk.  There are
  books about Tcl, too.  John Ousterhout, the creator of Tcl and Tk,
  has written \fITcl and the Tk Toolkit\fP, by Addison-Wesley.
! I have written \fIPractical Programming in Tcl and Tk\fP,
! published by Prentice-Hall, ISBN 0-13-182007-9.
  .PP
  Your custom Tcl code is kept in your ~/.tk/exmh directory.
  You maintain this as a Tcl library, which amounts to keeping a file
***************
*** 1073,1078 ****
--- 1073,1082 ----
  after the widget tree has been created and basically every module
  initialized.
  .PP
+ .I IMPORTANT
+ You must supply both User_Init and User_Layout because of the way
+ Tcl auto-loading works.  Just copy user.tcl and edit it.
+ .PP
  You should be able to override individual Tcl procs
  in User_Layout without having them trashed by the auto load facility.
  In this case you'd just source a file that has the new definitions.
***************
*** 1194,1199 ****
--- 1198,1205 ----
  Drag-and-drop for exmh.
  .IP editor.tcl
  The interface to editors for message composition.
+ .IP env.tcl
+ Environment variable initialization.
  .IP error.tcl
  The error handler.
  .IP extrasInit.tcl
***************
*** 1310,1315 ****
--- 1316,1323 ----
  The main guts of text bindings.
  .IP thread.tcl
  This displays the messages related to the current subject.
+ .IP uri.tcl
+ The code that scans messages for URLs.
  .IP user.tcl
  Stubs for User_Init and User_Layout.
  .IP widgetMenu.tcl
EOF-EOF-EOF
Patch exmh-ref.l<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh-ref.l	Thu Sep 28 09:18:23 1995
--- exmh-1.6.5/exmh-ref.l	Fri Dec  8 10:55:22 1995
***************
*** 10,16 ****
  .RE
  .sp .5
  ..
! .TH "EXMH REFERENCE" 1 "September 27 1995" "Exmh 1.6.3"
  .SH NAME
  exmh-ref - A detailed reference to exmh functions.
  .SH "EXMH REFERENCE CHAPTER"
--- 10,16 ----
  .RE
  .sp .5
  ..
! .TH "EXMH REFERENCE" 1 "December 8 1995" "Exmh 1.6.5"
  .SH NAME
  exmh-ref - A detailed reference to exmh functions.
  .SH "EXMH REFERENCE CHAPTER"
***************
*** 59,64 ****
--- 59,69 ----
  .IP "Frequently Asked Questions"
  This displays a Frequently-Asked-Questions file.
  It has the same info as the help.FAQ file.
+ .IP "Exmh Mailing Lists..."
+ This is a sub-menu that lets you administer your membership in the
+ exmh-related mailing lists.  See the About menu entry for an
+ explaination of the various mailing lists.  The add/remove operations
+ result in mail messages.  You'll need to Send the draft messages.
  .IP "Submit Bug Report"
  A mail message is started so you can report a problem with exmh.
  .IP "Register as an EXMH User"
***************
*** 528,540 ****
  for sending around pointers to files available via FTP or on your
  local file system.
  .IP "Insert PGP Keys..."
! Insert your PGP keys into the mail message..
  .IP Whom
  This entry displays a small window with the network addresses of
  the recipients of the message.  Clicking the button a second time
  makes the window go away.
  .IP "Spell..."
! This runs the UNIX spell command over the draft body and puts the results
  into a second pane inside the editor window.  That's all - nothing fancy.
  .IP "Find SEL"
  This searches the draft for the current X selection.  The intent is that
--- 533,552 ----
  for sending around pointers to files available via FTP or on your
  local file system.
  .IP "Insert PGP Keys..."
! Insert your PGP keys into the mail message.  You can use the key
! selector to choose any key in your public keyring.  Just type in
! a pattern that matches part of the key ID.  Matching keys are
! displayed in the listbox.
  .IP Whom
  This entry displays a small window with the network addresses of
  the recipients of the message.  Clicking the button a second time
  makes the window go away.
  .IP "Spell..."
! This runs either the UNIX spell or ispell command.
! Choose between these two options in the Simple Editor preferences.
! (Don't confuse that with the setting under Editor Support preferences.)
! If you use ispell then the draft is reloaded after ispell terminates.
! If you use spell then the output of spell is put
  into a second pane inside the editor window.  That's all - nothing fancy.
  .IP "Find SEL"
  This searches the draft for the current X selection.  The intent is that
EOF-EOF-EOF
Patch exmh-use.l<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh-use.l	Tue Jul 18 15:54:47 1995
--- exmh-1.6.5/exmh-use.l	Sat Dec  9 13:01:55 1995
***************
*** 1,6 ****
  '\"
  '\" 
! '\" $Header: /home/bwelch/src/exmh/RCS/exmh-use.l,v 1.3 1995/07/18 22:54:26 bwelch Exp $ SPRITE (Berkeley)
  '/" 
  .\" .DS
  .\"	Begin an indented unfilled display.
--- 1,6 ----
  '\"
  '\" 
! '\" $Header: /home/bwelch/src/exmh/RCS/exmh-use.l,v 1.4 1995/12/09 21:01:50 bwelch Exp $ SPRITE (Berkeley)
  '/" 
  .\" .DS
  .\"	Begin an indented unfilled display.
***************
*** 20,26 ****
  .RE
  .sp .5
  ..
! .TH "EXMH" 1 "May 23, 1995" "Exmh 1.6.2"
  .SH NAME
  exmh-use - A more advanced user guide to the exmh mail user interface.
  .SH INTRODUCTION
--- 20,26 ----
  .RE
  .sp .5
  ..
! .TH "EXMH" 1 "Dec 8, 1995" "Exmh 1.6.5"
  .SH NAME
  exmh-use - A more advanced user guide to the exmh mail user interface.
  .SH INTRODUCTION
***************
*** 242,248 ****
  .PP
  The black diamond to the right of the status message area is a grip
  that you use to change the boundaries between subwindows.
! Press the first mouse button on this and a horizontal line appears.
  As you drag the line up and down, the status message indicates
  what boundary you are changing.
  Initially you are adjusting the scan listing (middle subwindow).
--- 242,252 ----
  .PP
  The black diamond to the right of the status message area is a grip
  that you use to change the boundaries between subwindows.
! The resize unfortunately depends on heuristics based on the size of
! text being displayed in the window, so you have to have a message
! displayed before the resize will work.
! .PP
! Press the first mouse button on the black diamond and a horizontal line appears.
  As you drag the line up and down, the status message indicates
  what boundary you are changing.
  Initially you are adjusting the scan listing (middle subwindow).
***************
*** 708,716 ****
  man page.  However, if you know PGP, you will find the PGP features of
  \fIexmh\fP useful.
  .PP
! \fIHint:\fP.  The \fIPGP in an xterm\fP menu entry will run PGP interactively.
! In particular, it will extract and save public key blocks from messages.
! So, if someone sends you their key, use this operation to save it.
  .SH MIME FORMATTING
  .PP
  \fIWarning!\fP  The line-break formatting described above can
--- 712,722 ----
  man page.  However, if you know PGP, you will find the PGP features of
  \fIexmh\fP useful.
  .PP
! \fIHint:\fP.  The \fIInsert PGP Keys\fP menu entry is hiding over in
! the Sedit More... menu.  Use this to insert your public key or other
! public keys into a mail message.  By default, only your keys are listed
! in the key chooser.  Just type in part of the key ID of any key you want
! to choose and matching keys are displayed.  Try '*' to list all keys.
  .SH MIME FORMATTING
  .PP
  \fIWarning!\fP  The line-break formatting described above can
***************
*** 986,1003 ****
  (i.e., has leading /).  In the second case (POP),
  the third field is an optional user ID.
  .IP presortmulti
! This is a combination of multidrop and presort.  Set up your
! .xmhcheck file to use the MyIncTmp folder, (e.g., instead of inbox).
! All messages in this folder get filtered by slocal.
  .DS
  folder_name	/filename/of/dropbox
  or
  folder_name	POP_hostname [POP_user_name]
  .DE
- .IP multidrop+filter
- Currently there is no combination of presort and multidrop,
- but there should be.  If you are adventurous, take a look
- at inc.tcl and combine Inc_Presort with Inc_All.
  .SH FACES
  .PP
  One of the more fun features of exmh is its ability to display the facesaver
--- 992,1011 ----
  (i.e., has leading /).  In the second case (POP),
  the third field is an optional user ID.
  .IP presortmulti
! This is a combination of multidrop and presort.
! Any dropbox that is associated with the MyIncTmp folder gets filtered
! just as with presort.
! .PP
! The \fB.xmhcheck\fB file.
! The following shows the format
! of the .xmhcheck file.  If the folder_name is MyIncTmp and you
! use presortmulti inc style, then messages are filtered after they
! are fetched from the dropbox.
  .DS
  folder_name	/filename/of/dropbox
  or
  folder_name	POP_hostname [POP_user_name]
  .DE
  .SH FACES
  .PP
  One of the more fun features of exmh is its ability to display the facesaver
***************
*** 1182,1187 ****
--- 1190,1200 ----
  overhaul some of the exmh internals to improve this situtation.
  In the meantime...
  .PP
+ Really big folders with lots of messages in the unseen sequence are
+ really slow.  Use the "Catch-up unseen" folder More... operation to clear
+ the unseen sequence.  You probably want to do this when you import mail
+ from other systems mailboxes.
+ .PP
  \fBMore Keyboard Stuff\fP.
  If you really like using the keyboard instead of the mouse,
  you can change folders, set the target folder, and select messages
***************
*** 1255,1260 ****
--- 1268,1282 ----
  The patch makes "folders -recurse" run much faster because
  it avoids directories that do not have subfolders.
  The patches apply to MH 6.7.
+ .SH "UPGRADING WITH PATCHES"
+ .PP
+ There are usually patch files to go between releases (e.g. from 1.6.4 to 1.6.5).
+ The best way to use these patches is to patch your 1.6.4
+ .B source directory
+ and then reinstall using the procedure described above.
+ This has the benefit of fixing the version number in the main script.
+ Finally, this is how the patches are generated, so if you apply them
+ to your installed directories they might not work properly.
  .SH "TK SEND AND XAUTHORITY"
  .PP
  The thing that causes the most trouble with new exmh users is the
***************
*** 1282,1287 ****
--- 1304,1316 ----
  xhost -
  .DE
  .PP
+ With release 1.6.4 and later you can have exmh police your xhost list.
+ It can clear out any hosts that creep onto the list.  This typically
+ happens with wrapper scripts used to run other programs.  If you use
+ Xauthority properly, the additional use of xhost is completely bogus
+ and insecure.  Not to mention that it breaks Tk send.  Under
+ Background Processing preferences, select "Keep xhost list clear".
+ .PP
  The other alternative is to recompile the Tk library with the
  -DTK_NO_SECURITY compile flag.  This is appropriate if your X server
  just cannot do the Xauthority protocol, or you think your environment
***************
*** 1301,1314 ****
  .PP
  Metamail (for MIME support) is available in thumper.bellcore.com:pub/nsb
  .PP
! Faces are available from cs.indiana.edu:/pub/faces.  The individual
! databases are:
  .DS
! facedir.tar.Z		accumulated personal faces
! facesaver.tar.Z		Usenix FaceSaver faces
! logos.tar.Z		Internet domain logos
! news.tar.Z		Usenet news hierarchy icons
! 			  (not intended for e-mail)
  .DE
  Glimpse is available from the University of Arizona:
  http://glimpse.cs.arizona.edu:1994/
--- 1330,1349 ----
  .PP
  Metamail (for MIME support) is available in thumper.bellcore.com:pub/nsb
  .PP
! Faces are available from cs.indiana.edu:/pub/faces.
! The individual databases are located under /pub/faces/picons/db,
! and they include .xbm, .xpm, and .gif representations.
! I recommend gettings domains.tar.Z, misc.tar.Z, and unknown.tar.Z.
! If you have room, also get usenix.tar.Z and users.tar.Z.
  .DS
! Database           Date            Bytes       Description
! domains.tar.Z      95.12.06        1356923     Company, Country and Univ Logos
! misc.tar.Z         95.11.12        58991       Things like root and postmaster
! news.tar.Z         95.12.06        372765      For newsgroup (not mail)
! unknown.tar.Z      95.11.12        19074       Default images
! usenix.tar.Z       95.04.13        19472394    The USENIX database
! users.tar.Z        95.12.08        2012905     Other personal faces
! weather.tar.Z      95.11.12        146329      For weather (not mail)
  .DE
  Glimpse is available from the University of Arizona:
  http://glimpse.cs.arizona.edu:1994/
EOF-EOF-EOF
Patch exmh.CHANGES<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh.CHANGES	Tue Oct 10 15:18:25 1995
--- exmh-1.6.5/exmh.CHANGES	Fri Dec  8 11:03:53 1995
***************
*** 1,4 ****
--- 1,49 ----
  HISTORY
+ 1.6.5 12/7/95
+     Added support for TMPDIR or EXMHTMPDIR environment variables to map /tmp
+     Created env.tcl and Env_Init to collect envar hacking into a module
+     Major flist.tcl cleanup/rewrite.  This manages unseen folder state.
+     Removed tearoff ability from MIME popup menu
+     Trim spaces from MIME font sizes
+     Limit debug log size with preference item under Hacking Support.
+     Fixed <Unmap> and <Map> bindings to only fire on the main window.
+     Added multipart/fv-infohaus application/fv-infohaus MIME handlers
+     Added https: URL protocol type to URL scanning code.
+     Added preference item for netscape command line flags (e.g. -install)
+     Added 8-bit checks to signatures, cut/paste, insert file (SEDIT)
+     Fixed MIME preview for non-draft folder messages
+     Tweak faces init to delete image handling for Tk < 4.0
+     New PGP key name matching algorithm from Stefan Monnier
+     Fixed deadlock in presort-inc and pressing the Inc UI button.  The inc
+ 	causes a background operation that may trigger a rescan of the folder
+ 	that blocks waiting for the background inc to complete: deadlock.
+     Update fileselect to remember current directory
+     Fixed + bindings for keyboard folder selection (Tk 4.0)
+     Changed default scrollbar side to Left.
+     Eliminated black diamond resize error when no message is displayed.
+     Changed Commit to sync message sequence state before starting background
+ 	operations.
+     Eliminated rescan upon completion of background Rmm,
+ 	which seems to interfere with commit processing (refiles not done)
+     Fixed -bitmap typo in faces.tcl
+     Fixed "icon" busy style to display hourglass better in Tk 4.0
+     Append default domain to "simple" hostnames:
+ 	bwelch@sage maps to bwelch@sage.eng.sun.com before faces lookup
+ 	THIS MAY AFFECT LOCAL DATABASES
+     Sedit menu commands can now reference $exmh(...) variables
+     Use winfo width and height to save detached folder display size,
+ 	as opposed to asking the widget (-width)
+     Fixed bug with enabling/disabling folder cache display.
+     Fixed sedit behavior after deleting entire body of message.
+     Fixed undefined exmh(library) bug in Sound_Error
+     Fixed reparsing of multi-line Content-Type headers
+     Tmp file for Mosaic backdoor changed from softlink to hardlink
+     Trim spaces from Pick field values
+     Limit PS flags to only find processes under the same USER
+     Added CLIPBOARD selection support (helps OpenWindows)
+     Added operations to the Help menu that let you subscribe and unsubscribe
+ 	from the various exmh-related mailing lists.
+ 
  1.6.4 10/10/95
      Fixed Report Bug use of tk_version
      Added 'binary' to the '7bit' and '8bit' MIME type checks to avoid decoding
EOF-EOF-EOF
Patch exmh.MASTER<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh.MASTER	Wed Jun 14 13:45:58 1995
--- exmh-1.6.5/exmh.MASTER	Wed Nov 22 09:32:49 1995
***************
*** 48,66 ****
      }
  }
  
! # Make sure MH is on the path
! set hit 0
! foreach dir [split $env(PATH) :] {
!     if {[string compare $dir $mh_path] == 0} {
! 	set hit 1
! 	break
!     }
! }
! if {! $hit} {
!     set env(PATH) $mh_path:$env(PATH)
! }
! # Use an alternate MH context file to avoid conflicts with command line use.
! set env(MHCONTEXT) .exmhcontext
  
  # For session managers
  wm command . "$argv0 $argv"
--- 48,55 ----
      }
  }
  
! # Set up the environment
! Env_Init
  
  # For session managers
  wm command . "$argv0 $argv"
EOF-EOF-EOF
Patch exmh.README<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh.README	Mon Oct  9 14:33:06 1995
--- exmh-1.6.5/exmh.README	Sat Dec  9 13:00:29 1995
***************
*** 1,12 ****
  <ftp://ftp.sunlabs.com/pub/tcl/exmh/exmh.README>
! Last modified: Mon Oct  9 14:32:48 PDT 1995
! exmh version: 1.6.4
  Brent.Welch@eng.sun.com
  
  exmh is a TCL/TK based interface to the MH mail system.
  
! Version 1.6* is compatible with Tk 4.0 and Tk 3.6 through Tk 3.3
! 	(You really want the non-beta Tk 4.0.)
  exmh is known to work with MH versions 6.7 and 6.8.*
  
  Experienced EXMH installers should check FLASHES below and
--- 1,12 ----
  <ftp://ftp.sunlabs.com/pub/tcl/exmh/exmh.README>
! Last modified: Fri Dec  8 09:23:17 PST 1995
! exmh version: 1.6.5
  Brent.Welch@eng.sun.com
  
  exmh is a TCL/TK based interface to the MH mail system.
  
! Version 1.6* is compatible with Tk 4.1, Tk4.0, Tk3.6, and Tk3.3
!     Some features (e.g., color face icons) only work with Tk 4.0 or greater.
  exmh is known to work with MH versions 6.7 and 6.8.*
  
  Experienced EXMH installers should check FLASHES below and
***************
*** 19,28 ****
  the part at the end about the TK send command.
  See also the on-line FAQ file under the Help... menu.
  
- **************************************************
- 
  There are 4 man pages for exmh - make sure your users can access them.
! (Soon they will be HTML viewable from within exmh, but not yet.)
  
  exmh.l - a tutorial
  exmh-use.l - a more comprehensive user guide
--- 19,28 ----
  the part at the end about the TK send command.
  See also the on-line FAQ file under the Help... menu.
  
  There are 4 man pages for exmh - make sure your users can access them.
! (Soon they will be HTML viewable from within exmh, but not yet.
! The HTML is hiding in the html subdirectory, or see
! http://www.sunlabs.com/~bwelch/exmh/man/index.html)
  
  exmh.l - a tutorial
  exmh-use.l - a more comprehensive user guide
***************
*** 29,34 ****
--- 29,36 ----
  exmh-custom.l - a guide to exmh customization
  exmh-ref.l - a terse description of all buttons and menu entries.
  
+ **************************************************
+ 
  Please encourage your exmh users to REGISTER via the
  Register menu entry under the Help... menu.  This let's
  me track exmh usage and get user feedback.  I won't
***************
*** 87,92 ****
--- 89,100 ----
  This information is now available via the FAQ button in exmh.
  
  FLASHES
+ 1.6.5 includes an overhaul of the Flist module that highlights folders
+ 	with unseen messages, and counts unseen messages in total.
+     This also detects 8-bit characters in all cases within Sedit.
+     CLIPBOARD support for OpenWindows users (Tk 4.* only)
+     TMPDIR and EXMHTMPDIR environment variables honored to map /tmp
+ 
  1.6.4 has fixes for the bugs in 1.6.3
  
  1.6.3 collects many minor enhancements, plus
EOF-EOF-EOF
Patch exmh.install<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh.install	Tue Oct 10 15:01:14 1995
--- exmh-1.6.5/exmh.install	Mon Dec 11 17:01:42 1995
***************
*** 13,20 ****
  #
  source ./install.tcl
  
! set vers 1.6.4
! set date 10/10/95
  
  # Define app name and install save file
  install_init exmh ./.exmhinstall
--- 13,20 ----
  #
  source ./install.tcl
  
! set vers 1.6.5
! set date 12/11/95
  
  # Define app name and install save file
  install_init exmh ./.exmhinstall
EOF-EOF-EOF
Patch exmh.l<<'EOF-EOF-EOF'
*** exmh-1.6.4/exmh.l	Wed Sep 27 20:55:22 1995
--- exmh-1.6.5/exmh.l	Sat Dec  9 13:01:49 1995
***************
*** 1,6 ****
  '\"
  '\" 
! '\" $Header: /home/bwelch/src/exmh/RCS/exmh.l,v 1.4 1995/09/28 03:55:19 bwelch Exp $ SPRITE (Berkeley)
  '/" 
  .\" .DS
  .\"	Begin an indented unfilled display.
--- 1,6 ----
  '\"
  '\" 
! '\" $Header: /home/bwelch/src/exmh/RCS/exmh.l,v 1.5 1995/12/09 21:01:45 bwelch Exp $ SPRITE (Berkeley)
  '/" 
  .\" .DS
  .\"	Begin an indented unfilled display.
***************
*** 20,32 ****
  .RE
  .sp .5
  ..
! .TH "EXMH TOUR" 1 "May 23, 1995" "Exmh 1.6.2"
  .SH NAME
  exmh - An introduction to the exmh mail user interface.
  .SH INTRODUCTION
  .PP
  This man page provides a quick tour through some of the basic features of
! .I exmh version 1.6.2,
  which provides a graphical user interface to the MH mail system.
  .PP
  After you read this tutorial you should be able to use
--- 20,32 ----
  .RE
  .sp .5
  ..
! .TH "EXMH TOUR" 1 "Dec 8, 1995" "Exmh 1.6.5"
  .SH NAME
  exmh - An introduction to the exmh mail user interface.
  .SH INTRODUCTION
  .PP
  This man page provides a quick tour through some of the basic features of
! .I exmh version 1.6.5,
  which provides a graphical user interface to the MH mail system.
  .PP
  After you read this tutorial you should be able to use
EOF-EOF-EOF
Patch lib/aliases.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/aliases.tcl	Wed Sep 27 10:13:56 1995
--- exmh-1.6.5/lib/aliases.tcl	Thu Oct 12 11:10:02 1995
***************
*** 126,132 ****
  #
  proc AliasesInitProfile {} {
      global mhProfile aliasOK
!     if [winfo exists .alaisfile] {
  	return
      }
      Widget_Toplevel .aliasfile "Setup Alias File"
--- 126,132 ----
  #
  proc AliasesInitProfile {} {
      global mhProfile aliasOK
!     if [winfo exists .aliasfile] {
  	return
      }
      Widget_Toplevel .aliasfile "Setup Alias File"
EOF-EOF-EOF
Patch lib/app-defaults<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/app-defaults	Wed Sep 27 23:06:27 1995
--- exmh-1.6.5/lib/app-defaults	Mon Dec 11 09:03:15 1995
***************
*** 166,171 ****
--- 166,179 ----
  *Glimpse*Text.height:	20
  *Glimpse*Text.width:	80
  
+ ! Icon bitmaps
+ *iconUpBitmap:         flagup.bitmap
+ *iconDownBitmap:       flagdown.bitmap
+ *iconSpoolBitmap:      flagup.bitmap
+ *iconUpLabel:          $flist(newMsgs) Unseen
+ *iconDownLabel:        exmh
+ *iconSpoolLabel:       $exmh(numUnInced) Spooled
+ 
  ! Top-level resources that don't correspond to a TK widget
  
  ! Scrollbar location - left or right
***************
*** 214,220 ****
  *Main.bind.m.c_compose:	Sedit_ComposeUI
  
  *Main.help.text:	Help...
! *Main.help.m.entrylist:	help colorkey faq sep bug reg pgp
  *Main.help.m.l_colorkey:	Color Legend
  *Main.help.m.c_colorkey:	Help_KeyDisplay
  *Main.help.m.l_help:	Quick Intro
--- 222,228 ----
  *Main.bind.m.c_compose:	Sedit_ComposeUI
  
  *Main.help.text:	Help...
! *Main.help.m.entrylist:	help colorkey faq sep list bug reg pgp
  *Main.help.m.l_colorkey:	Color Legend
  *Main.help.m.c_colorkey:	Help_KeyDisplay
  *Main.help.m.l_help:	Quick Intro
***************
*** 226,234 ****
--- 234,266 ----
  *Main.help.m.c_bug:	Report_Bug
  *Main.help.m.l_reg:	Register as an EXMH User
  *Main.help.m.c_reg:	Report_Registration
+ *Main.help.m.l_list:	Exmh Mailing Lists...
+ *Main.help.m.m_list:	list
+ *Main.help.m.t_list:	cascade
  *Main.help.m.l_pgp:	Pgp Setup
  *Main.help.m.c_pgp:	Pgp_Help
  
+ *Main.help.m.list.entrylist: about adduser deluser adddig deldig addann delann addwork delwork
+ 
+ *Main.help.m.list.l_about: About the exmh mailing lists
+ *Main.help.m.list.c_about: Help Lists {About the exmh mailing lists}
+ *Main.help.m.list.l_adduser: Subscribe to exmh-users
+ *Main.help.m.list.c_adduser: Report_Subscribe exmh-users subscribe
+ *Main.help.m.list.l_deluser: Unsubscribe from exmh-users
+ *Main.help.m.list.c_deluser: Report_Subscribe exmh-users unsubscribe
+ *Main.help.m.list.l_adddig: Subscribe to exmh-users digest
+ *Main.help.m.list.c_adddig: Report_Subscribe exmh-users-digest subscribe
+ *Main.help.m.list.l_deldig: Unsubscribe from exmh-users digest
+ *Main.help.m.list.c_deldig: Report_Subscribe exmh-users-digest unsubscribe
+ *Main.help.m.list.l_addann: Subscribe to exmh-announce
+ *Main.help.m.list.c_addann: Report_Subscribe exmh-announce subscribe
+ *Main.help.m.list.l_delann: Unsubscribe from exmh-announce
+ *Main.help.m.list.c_delann: Report_Subscribe exmh-announce unsubscribe
+ *Main.help.m.list.l_addwork: Subscribe to exmh-workers
+ *Main.help.m.list.c_addwork: Report_Subscribe exmh-workers subscribe
+ *Main.help.m.list.l_delwork: Unsubscribe from exmh-workers
+ *Main.help.m.list.c_delwork: Report_Subscribe exmh-workers unsubscribe
+ 
  !
  ! Resources that create the Folder ops buttons and menu
  ! NOTICE: In 1.4 and higher, the entrylist etc. are attached to the
***************
*** 450,456 ****
  	multipart/x-sun-attachment application/x-shell-script \
  	audio/basic audio/x-sunaudio application/x-suncalendar \
  	multipart/report message/x-delivery-status-05 \
! 	application/x-pgp-message
  *mimeUTypes:
  !
  *mime_text/plain:		Mime_ShowText
--- 482,489 ----
  	multipart/x-sun-attachment application/x-shell-script \
  	audio/basic audio/x-sunaudio application/x-suncalendar \
  	multipart/report message/x-delivery-status-05 \
! 	application/x-pgp-message \
! 	multipart/fv-infohaus application/fv-infohaus
  *mimeUTypes:
  !
  *mime_text/plain:		Mime_ShowText
***************
*** 476,481 ****
--- 509,516 ----
  *mime_application/pgp:			Pgp_ShowMessage
  *mime_application/x-pgp-message:	Pgp_ShowMessage
  *mime_image:			Mime_ShowImage
+ *mime_application/fv-infohaus:	Mime_ShowText
+ *mime_multipart/fv-infohaus:	Mime_ShowMultipart
  !
  ! Mime fonts
  ! mimeCharsets lists the known mime charsets
***************
*** 854,867 ****
  *sedit_typeKillsSel: 1
  *sedit_scrollButton: Middle
  
! *sedit_editprocs: selpaste seldelete backspace openline deleol delbol \
  	delwordforw delwordback delchar transpose transemacs transword \
  	composechar bof eof linestart lineend up1line down1line \
  	backword forwword backchar forwchar up1page down1page
  
! *sedit_key_selpaste:	 <Control-y>
  
! *sedit_key_seldelete:	 <Control-w> <Key-Delete>
  *sedit_key_backspace:	 <Control-h> <Key-BackSpace>
  *sedit_key_openline:	 <Control-o>
  *sedit_key_deleol:	 <Control-k>
--- 889,903 ----
  *sedit_typeKillsSel: 1
  *sedit_scrollButton: Middle
  
! *sedit_editprocs: selpaste selcopy seldelete backspace openline deleol delbol \
  	delwordforw delwordback delchar transpose transemacs transword \
  	composechar bof eof linestart lineend up1line down1line \
  	backword forwword backchar forwchar up1page down1page
  
! *sedit_key_selpaste:	 <Control-y> <Key-F18>
  
! *sedit_key_seldelete:	 <Control-w> <Key-Delete> <Key-F20>
! *sedit_key_selcopy:	 <Key-F16>
  *sedit_key_backspace:	 <Control-h> <Key-BackSpace>
  *sedit_key_openline:	 <Control-o>
  *sedit_key_deleol:	 <Control-k>
EOF-EOF-EOF
Patch lib/audit.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/audit.tcl	Wed Sep 27 21:43:48 1995
--- exmh-1.6.5/lib/audit.tcl	Wed Nov 22 09:24:17 1995
***************
*** 28,34 ****
  proc AuditInner { event } {
      global audit
      if ![info exists audit(file)] {
! 	if [catch {open /tmp/.exmhaudit.[pid] w 0600} audit(file)] {
  	    Exmh_Status $audit(file)
  	    set audit(file) {}
  	}
--- 28,34 ----
  proc AuditInner { event } {
      global audit
      if ![info exists audit(file)] {
! 	if [catch {open [Env_Tmp]/.exmhaudit.[pid] w 0600} audit(file)] {
  	    Exmh_Status $audit(file)
  	    set audit(file) {}
  	}
***************
*** 85,91 ****
      switch -- $view {
  	Past { set path $mhProfile(path)/.exmhaudit }
  	Current -
! 	default { set path /tmp/.exmhaudit.[pid] }
      }
      $t delete 1.0 end
      if [catch {open $path} in] {
--- 85,91 ----
      switch -- $view {
  	Past { set path $mhProfile(path)/.exmhaudit }
  	Current -
! 	default { set path [Env_Tmp]/.exmhaudit.[pid] }
      }
      $t delete 1.0 end
      if [catch {open $path} in] {
***************
*** 120,126 ****
  	unset audit($index)
      }
      close $file
!     exec cat /tmp/.exmhaudit.[pid] >> $mhProfile(path)/.exmhaudit
      Exmh_Status "Updated $mhProfile(path)/.exmhaudit"
!     exec rm /tmp/.exmhaudit.[pid]
  }
--- 120,126 ----
  	unset audit($index)
      }
      close $file
!     exec cat [Env_Tmp]/.exmhaudit.[pid] >> $mhProfile(path)/.exmhaudit
      Exmh_Status "Updated $mhProfile(path)/.exmhaudit"
!     exec rm [Env_Tmp]/.exmhaudit.[pid]
  }
EOF-EOF-EOF
Patch lib/background.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/background.tcl	Wed Aug 30 17:11:38 1995
--- exmh-1.6.5/lib/background.tcl	Tue Nov 21 17:38:58 1995
***************
*** 250,255 ****
--- 250,256 ----
  	Exmh_Status $err
      }
      if [catch {send $exmh(interp) [list BackgroundComplete $tag]} err ] {
+ 	puts stderr "exmh-bg: BackgroundComplete($tag) failed: $err"
  	Exmh_Status $err
      }
  }
***************
*** 269,275 ****
  	    set fail "process $exmh(pid)"
  	} else {
  	    if [catch {send $exmh(interp) $args} err] {
! 		case $err {
  		    {remote\ interpreter\ did\ not\ respond} {
  			if {$check && [BgLostPid $exmh(pid) exmh]} {
  			    set fail "process $exmh(pid)"
--- 270,276 ----
  	    set fail "process $exmh(pid)"
  	} else {
  	    if [catch {send $exmh(interp) $args} err] {
! 		switch -- $err {
  		    {remote\ interpreter\ did\ not\ respond} {
  			if {$check && [BgLostPid $exmh(pid) exmh]} {
  			    set fail "process $exmh(pid)"
***************
*** 278,283 ****
--- 279,287 ----
  		    {no\ registered\ interpeter*} {
  			set fail "interp $exmh(interp)"
  		    }
+ 		    default {
+ 			# puts stderr "BgRPC: $args: $err"
+ 		    }
  		}
  	    } else {
  		return $err
***************
*** 376,382 ****
      global bgaction
      catch {unset bgaction($action)}
      Exmh_Debug BackgroundComplete $action
!     if [regexp {(Refile|Rmm) (.*)} $action x y folder] {
  	global exmh
  	if {[string compare $exmh(folder) $folder] == 0} {
  	    Exmh_Status "Updating scan listing"
--- 380,386 ----
      global bgaction
      catch {unset bgaction($action)}
      Exmh_Debug BackgroundComplete $action
!     if [regexp {Refile (.*)} $action x folder] {
  	global exmh
  	if {[string compare $exmh(folder) $folder] == 0} {
  	    Exmh_Status "Updating scan listing"
EOF-EOF-EOF
Patch lib/busy.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/busy.tcl	Wed Jul 20 23:45:21 1994
--- exmh-1.6.5/lib/busy.tcl	Fri Nov 10 13:16:26 1995
***************
*** 110,137 ****
  }
  proc busy { args } {
      global busy
-     if ![info exists busy(style)] Busy_Init
      switch $busy(style) {
  	icon		{busyIcon $args}
  	cursorAll	{busyCursor $args}
  	cursor		{busyCursorHack $args}
! 	default		{}
      }
  }
  proc busyIcon { cmd } {
!     global exwin exmh errorInfo busy
  
!     if [info exists exwin(faceCanvas)] {
! 	set h [$exwin(faceCanvas) create bitmap 24 24 -anchor c \
! 		    -bitmap $busy(Xbitmap) -foreground $busy(color)]
! 	update idletasks
      }
  
      set error [catch {uplevel #0 $cmd} result]
      set ei $errorInfo
  
!     if [info exists h] {
! 	$exwin(faceCanvas) delete $h
      }
  
      if $error {
--- 110,140 ----
  }
  proc busy { args } {
      global busy
      switch $busy(style) {
  	icon		{busyIcon $args}
  	cursorAll	{busyCursor $args}
  	cursor		{busyCursorHack $args}
! 	default		{eval $args}
      }
  }
  proc busyIcon { cmd } {
!     global errorInfo busy
  
!     set parent [Face_BusyParent]
!     # Recreate the widget every time so that display works properly
!     if [catch {
! 	set label \
! 	    [label $parent.busy -foreground $busy(color) -bitmap $busy(Xbitmap)]
! 	Face_BusyPlace $label
!     } err] {
! 	Exmh_Debug $err
      }
  
      set error [catch {uplevel #0 $cmd} result]
      set ei $errorInfo
  
!     if [info exists label] {
! 	Face_BusyDestroy $label
      }
  
      if $error {
EOF-EOF-EOF
Patch lib/error.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/error.tcl	Wed Sep 27 09:50:43 1995
--- exmh-1.6.5/lib/error.tcl	Wed Nov 22 09:24:30 1995
***************
*** 116,123 ****
  
  proc ExmhMailError { w errInfo } {
      global exmh
!     if [catch {open /tmp/exmhErrorMsg w} out] {
! 	Exmh_Status "Cannot open /tmp/exmhErrorMsg" purple
  	return
      }
      if [catch {
--- 116,123 ----
  
  proc ExmhMailError { w errInfo } {
      global exmh
!     if [catch {open [Env_Tmp]/exmhErrorMsg w} out] {
! 	Exmh_Status "Cannot open [Env_Tmp]/exmhErrorMsg" purple
  	return
      }
      if [catch {
***************
*** 146,156 ****
  	puts $out $errInfo
  	close $out
      } msg] {
! 	Exmh_Status "/tmp/exmhErrorMsg $msg" purple
  	return
      }
      if [catch {
! 	exec send /tmp/exmhErrorMsg
      } msg] {
  	Exmh_Status "Send error: $msg" purple
  	return
--- 146,156 ----
  	puts $out $errInfo
  	close $out
      } msg] {
! 	Exmh_Status "[Env_Tmp]/exmhErrorMsg $msg" purple
  	return
      }
      if [catch {
! 	exec send [Env_Tmp]/exmhErrorMsg
      } msg] {
  	Exmh_Status "Send error: $msg" purple
  	return
EOF-EOF-EOF
Patch lib/extrasInit.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/extrasInit.tcl	Tue Oct 10 14:44:22 1995
--- exmh-1.6.5/lib/extrasInit.tcl	Thu Oct 12 12:53:44 1995
***************
*** 20,26 ****
  	set faces(enabled) 0
      }
      # faces(suffix) starts out (by default) with {xpm gif xbm}
!     if {![info exists faces(suffix)] || ([llength $faces(suffix)] == 0)} {
  	set faces(suffix) xbm
      }
      if {$tk_version >= 4.0} {
--- 20,27 ----
  	set faces(enabled) 0
      }
      # faces(suffix) starts out (by default) with {xpm gif xbm}
!     if {![info exists faces(suffix)] || ([llength $faces(suffix)] == 0) ||
! 	($tk_version < 4.0)} {
  	set faces(suffix) xbm
      }
      if {$tk_version >= 4.0} {
EOF-EOF-EOF
Patch lib/exwin.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/exwin.tcl	Mon Oct  9 09:39:03 1995
--- exmh-1.6.5/lib/exwin.tcl	Tue Nov 21 11:31:21 1995
***************
*** 18,24 ****
  Contrained scrolling keeps the last line of text in a window stuck
  to the bottom of the window.  This can be set independently for
  the scan listing (FTOC)." {
! 	{exwin(scrollbarSide) scrollbarSide {CHOICE right left} {Scrollbar side}
  "Which side the scrollbars appear on.  This
  only takes effect after you restart exmh."}
  	{exwin(scrollSpeed) scrollSpeed 1 {Drag-Scroll speed}
--- 18,24 ----
  Contrained scrolling keeps the last line of text in a window stuck
  to the bottom of the window.  This can be set independently for
  the scan listing (FTOC)." {
! 	{exwin(scrollbarSide) scrollbarSide {CHOICE left right} {Scrollbar side}
  "Which side the scrollbars appear on.  This
  only takes effect after you restart exmh."}
  	{exwin(scrollSpeed) scrollSpeed 1 {Drag-Scroll speed}
***************
*** 247,253 ****
      catch {destroy $exwin(boundary)}
      # Deduce height of text line in FTOC
      if ![info exists exwin(ftocLineHeight)] {
! 	set exwin(ftocLineHeight) [ExwinLineHeight $exwin(ftext)]
      }
      switch $exwin(mode) {
  	ftoc {
--- 247,257 ----
      catch {destroy $exwin(boundary)}
      # Deduce height of text line in FTOC
      if ![info exists exwin(ftocLineHeight)] {
! 	if [catch {ExwinLineHeight $exwin(ftext)} x] {
! 	    Exmh_Status "Display a message before resizing" warn
! 	    return
! 	}
! 	set exwin(ftocLineHeight) $x
      }
      switch $exwin(mode) {
  	ftoc {
EOF-EOF-EOF
Patch lib/faces.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/faces.tcl	Mon Oct  9 10:33:35 1995
--- exmh-1.6.5/lib/faces.tcl	Wed Nov 22 09:24:41 1995
***************
*** 37,44 ****
      set faces(name,user) {$user}
      set faces(name,unknown) unknown
  
      # Build search path
-     set faces(enabled) 1
      foreach set $faces(sets) {
  	set faces(path,$set) {}
      }
--- 37,45 ----
      set faces(name,user) {$user}
      set faces(name,unknown) unknown
  
+     set faces(defaultDomain) [string tolower \
+ 	[string trim $faces(defaultDomain) ". "]]
      # Build search path
      foreach set $faces(sets) {
  	set faces(path,$set) {}
      }
***************
*** 75,81 ****
  	lappend faces(path,$set) $dir/MISC
  	set faces(map,$dir/MISC) 0
      }
-     set faces(enabled) 1
  }
  
  
--- 76,81 ----
***************
*** 113,129 ****
      set parts [string tolower [split $fromwho @]]
      set user [lindex $parts 0]
      set machine [lindex $parts 1]
!     if [string match "" $machine] {
  	set machine [string tolower $faces(defaultDomain)]
!     }
  
      set from [split $machine .]
      set pathlist [FacePathlist $from]
  
!     Exmh_Debug \n$user ==> $pathlist
  
      # Loop through Face path
! Tputs lookup: [time {
      set matches {}
      foreach set $faces(sets) {
  	eval set tail $faces(name,$set)
--- 113,131 ----
      set parts [string tolower [split $fromwho @]]
      set user [lindex $parts 0]
      set machine [lindex $parts 1]
!     if {[string length $machine] == 0} {
  	set machine [string tolower $faces(defaultDomain)]
!     } elseif {[string first . $machine] == -1} {
!       append machine . $faces(defaultDomain)
!    }
  
      set from [split $machine .]
      set pathlist [FacePathlist $from]
  
! #    Exmh_Debug \n$user ==> $pathlist
  
      # Loop through Face path
! #Tputs lookup: [time {
      set matches {}
      foreach set $faces(sets) {
  	eval set tail $faces(name,$set)
***************
*** 163,171 ****
  	    }
  	}
      }
! }]
  
!     Exmh_Debug matches=$matches
  
      if !$faces(rowEnabled) {
  	foreach face $matches {
--- 165,173 ----
  	    }
  	}
      }
! #   }]
  
!     Exmh_Debug Faces matches $matches
  
      if !$faces(rowEnabled) {
  	foreach face $matches {
***************
*** 261,267 ****
  
      return $label
  }
! 
  proc Face_ShowFace facelist {
      foreach face $facelist {
  	if ![FaceShowFile $face [FaceAlloc]] {
--- 263,287 ----
  
      return $label
  }
! proc Face_BusyParent {} {
!     global faces
!     return $faces(frame)
! }
! proc Face_BusyPlace {busy} {
!     global faces
!     place $busy -in $faces(frame) -anchor c -relx 0.5 -rely 0.5
!     raise $busy
!     update idletasks
! }
! proc Face_BusyDestroy {busy} {
!     global faces
!     catch {
! 	destroy $busy
! 	# This hack forces the underlying labels to redisplay immediatly
! 	$faces(default) config -fg [lindex [$faces(default) config -fg] 4]
! 	$faces(frame).l1 config -fg [lindex [$faces(frame).l1 config -fg] 4]
!     }
! }
  proc Face_ShowFace facelist {
      foreach face $facelist {
  	if ![FaceShowFile $face [FaceAlloc]] {
***************
*** 273,279 ****
  proc Face_ShowFile facefile {
      set pane [FaceAlloc]
      if ![FaceShowFile $facefile $pane] {
! 	$pane -bitmap error
  	return 0
      }
      return 1
--- 293,299 ----
  proc Face_ShowFile facefile {
      set pane [FaceAlloc]
      if ![FaceShowFile $facefile $pane] {
! 	$pane config -bitmap error
  	return 0
      }
      return 1
***************
*** 287,303 ****
      switch -- [file extension $facefile] {
  	.ppm - .pgm - .pbm - .gif {
  	    if [catch {
! Tputs image create: [time {
  		set image [image create photo -file $facefile -palette $faces(palette)]
! }]
  		if $faces(defer) {
  		    DeferWork faces(work) [list $pane config -image $image] \
  			      [list image delete $image]
  
  		} else {
! Tputs image display: [time {
  		    $pane config -image $image
! }]
  		}
  	    } id] {
  		Exmh_Debug $id
--- 307,323 ----
      switch -- [file extension $facefile] {
  	.ppm - .pgm - .pbm - .gif {
  	    if [catch {
! # Tputs image create: [time {
  		set image [image create photo -file $facefile -palette $faces(palette)]
! # }]
  		if $faces(defer) {
  		    DeferWork faces(work) [list $pane config -image $image] \
  			      [list image delete $image]
  
  		} else {
! # Tputs image display: [time {
  		    $pane config -image $image
! # }]
  		}
  	    } id] {
  		Exmh_Debug $id
***************
*** 331,338 ****
  proc FaceXFace { xface {pane {}}} {
      global faces
      Exmh_Status "$faces(xfaceProg)" red
! Tputs decode x-face: [time {
!     if [catch {open "| $faces(xfaceProg) > /tmp/FACE.[pid].xbm" w} fid] {
  	Exmh_Status $fid error
  	return 0
      } else {
--- 351,358 ----
  proc FaceXFace { xface {pane {}}} {
      global faces
      Exmh_Status "$faces(xfaceProg)" red
! # Tputs decode x-face: [time {
!     if [catch {open "| $faces(xfaceProg) > [Env_Tmp]/FACE.[pid].xbm" w} fid] {
  	Exmh_Status $fid error
  	return 0
      } else {
***************
*** 343,356 ****
  	Exmh_Status $err error
  	return 0
      }
! }]
      if [string match "" $pane] {
  	set pane [FaceAlloc]
      }
! Tputs show x-face: [time {
!     set ret [FaceShowFile /tmp/FACE.[pid].xbm $pane]
! }]
!     exec rm /tmp/FACE.[pid].xbm
      Exmh_Status ok
      return $ret
  }
--- 363,376 ----
  	Exmh_Status $err error
  	return 0
      }
! # }]
      if [string match "" $pane] {
  	set pane [FaceAlloc]
      }
! # Tputs show x-face: [time {
!     set ret [FaceShowFile [Env_Tmp]/FACE.[pid].xbm $pane]
! # }]
!     exec rm [Env_Tmp]/FACE.[pid].xbm
      Exmh_Status ok
      return $ret
  }
***************
*** 418,424 ****
  	([file mtime $faces(base)$file]  <= $faceMap(modtime,$file)) } {
  	return {}
      }
!     Exmh_Debug FaceMap $file $item
      if ![catch {open $faces(base)$file} in] {
  	set faceMap(modtime,$file) [file mtime $faces(base)$file]
  	while {[gets $in input] >= 0} {
--- 438,444 ----
  	([file mtime $faces(base)$file]  <= $faceMap(modtime,$file)) } {
  	return {}
      }
! #    Exmh_Debug FaceMap $file $item
      if ![catch {open $faces(base)$file} in] {
  	set faceMap(modtime,$file) [file mtime $faces(base)$file]
  	while {[gets $in input] >= 0} {
***************
*** 460,466 ****
      upvar #0 $name queue
  
      if [info exists queue] {
! 	after cancel DeferWorkProc $name
  	foreach w $queue {
  	    catch [lindex $w 1]
  	}
--- 480,486 ----
      upvar #0 $name queue
  
      if [info exists queue] {
! 	after cancel [list DeferWorkProc $name]
  	foreach w $queue {
  	    catch [lindex $w 1]
  	}
EOF-EOF-EOF
Patch lib/fcache.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/fcache.tcl	Tue Aug 15 10:38:44 1995
--- exmh-1.6.5/lib/fcache.tcl	Tue Nov 21 17:53:35 1995
***************
*** 104,110 ****
  	    # we're new here
  	    lappend nickNameFolders($nickname) $folder
  	    foreach clashingFolder $folders {
! 	       unset folderNickName($clashingFolder)
  	       Fcache_FolderName $clashingFolder
  	    }
  	    return [Fcache_FolderName $folder]
--- 104,110 ----
  	    # we're new here
  	    lappend nickNameFolders($nickname) $folder
  	    foreach clashingFolder $folders {
! 	       catch {unset folderNickName($clashingFolder)}
  	       Fcache_FolderName $clashingFolder
  	    }
  	    return [Fcache_FolderName $folder]
***************
*** 141,154 ****
  	    }
  	}
      } else {
! 	if {$fcache(lastLines) == 0} {
! 	    Fcache_CreateWindow
  	} elseif {$fcache(lastLines) != $fcache(lines)} {
- 	    global fdisp
  	    set h [expr {$fcache(lines) * ($fdisp(itemHeight) + $fdisp(ygap)) + $fdisp(ygap)}]
  	    $fdisp(cache) configure -height $h
  	}
! 	if {[string compare $args nodisplay] != 0} {
  	    if [FcacheLRU] {
  		after 1 {Fcache_Display 1}
  	    }
--- 141,157 ----
  	    }
  	}
      } else {
! 	global fdisp
! 	set nodisplay [expr {[string compare $args nodisplay] == 0}]
! 	if {$fcache(lastLines) == 0 || ![info exists fdisp(cache)]} {
! 	    if {!$nodisplay} {
! 		Fcache_CreateWindow
! 	    }
  	} elseif {$fcache(lastLines) != $fcache(lines)} {
  	    set h [expr {$fcache(lines) * ($fdisp(itemHeight) + $fdisp(ygap)) + $fdisp(ygap)}]
  	    $fdisp(cache) configure -height $h
  	}
! 	if {!$nodisplay} {
  	    if [FcacheLRU] {
  		after 1 {Fcache_Display 1}
  	    }
EOF-EOF-EOF
Patch lib/fdisp.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/fdisp.tcl	Tue Sep 12 10:06:30 1995
--- exmh-1.6.5/lib/fdisp.tcl	Fri Dec  8 11:31:16 1995
***************
*** 137,146 ****
  proc Fdisp_Checkpoint { varName } {
      # Add Xresources lines to $varName that save window size
      upvar $varName newstuff
!     global fdisp
      catch {
! 	set width [lindex [$fdisp(topWidget).can config -width] 4]
! 	set height [lindex [$fdisp(topWidget).can config -height] 4]
  	lappend newstuff "*Fltop.Canvas.height:\t$height"
  	lappend newstuff "*Fltop.Canvas.width:\t$width"
      }
--- 137,153 ----
  proc Fdisp_Checkpoint { varName } {
      # Add Xresources lines to $varName that save window size
      upvar $varName newstuff
!     global fdisp tk_version
      catch {
! 	set can $fdisp(topWidget).can
! 	set width [winfo width $can]
! 	set height [winfo height $can]
! 	set bd [lindex [$can config -borderwidth] 4]
! 	if {$tk_version >= 4.0} {
! 	    incr bd [$can cget -highlightthickness]
! 	}
! 	set width [expr $width - 2*$bd]
! 	set height [expr $height - 2*$bd]
  	lappend newstuff "*Fltop.Canvas.height:\t$height"
  	lappend newstuff "*Fltop.Canvas.width:\t$width"
      }
EOF-EOF-EOF
Patch lib/fileselect.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/fileselect.tcl	Mon Oct  9 10:47:18 1995
--- exmh-1.6.5/lib/fileselect.tcl	Thu Dec  7 10:25:22 1995
***************
*** 184,193 ****
      if {"$dir" == "." && [info exists fileselect(lastDir)]} {
  	set dir $fileselect(lastDir)
      }
!     set fileselect(pwd) [pwd]
      fileselect.cd $dir
      $fileselect(direntry) delete 0 end
!     $fileselect(direntry) insert 0 [pwd]/
  
      $fileselect(list) delete 0 end
      $fileselect(list) insert 0 "Big directory:"
--- 184,196 ----
      if {"$dir" == "." && [info exists fileselect(lastDir)]} {
  	set dir $fileselect(lastDir)
      }
!     if [catch {pwd} fileselect(pwd)] {
! 	cd
! 	set fileselect(pwd) [pwd]
!     }
      fileselect.cd $dir
      $fileselect(direntry) delete 0 end
!     $fileselect(direntry) insert 0 $fileselect(pwd)/
  
      $fileselect(list) delete 0 end
      $fileselect(list) insert 0 "Big directory:"
***************
*** 277,283 ****
  	if [string match ~* $selname] {
  	    set selected $selname
  	} else {
! 	    set selected $seldir/$selname
  	}
      }
  
--- 280,286 ----
  	if [string match ~* $selname] {
  	    set selected $selname
  	} else {
! 	    set selected [string trimright $seldir /]/$selname
  	}
      }
  
***************
*** 441,446 ****
--- 444,450 ----
      if [catch {set listFile [glob -nocomplain $path*]}] {
  	return  $returnList
      }
+     set newdir "."
      foreach el $listFile {
  	if {$dir != 0} {
  	    if [file isdirectory $el] {
***************
*** 448,454 ****
--- 452,463 ----
  	    }
  	} elseif ![file isdirectory $el] {
  	    lappend returnList [file tail $el]
+ 	    set newdir [file dirname $el]
  	}	    
+     }
+     if {[string compare $newdir "."] != 0} {
+ 	$fileselect(direntry) delete 0 end
+ 	$fileselect(direntry) insert 0 $newdir
      }
      
      return $returnList
EOF-EOF-EOF
Patch lib/flist.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/flist.tcl	Thu Sep 28 21:27:47 1995
--- exmh-1.6.5/lib/flist.tcl	Wed Nov  1 14:13:30 1995
***************
*** 1,9 ****
  #
  # flist.tcl
  #
! # Manage the folder list.  This includes information about which folders
! # have nested folders under them, and which folders have unseen messages.
! # The display of this information is done by the fdisp.tcl module
  #
  # Some of the routines here are set up to run in a background interpreter.
  # When you see calls to BgRPC it is invoking the routine in the
--- 1,12 ----
  #
  # flist.tcl
  #
! # Manage the folder list.
! # For folder display (fdisp.tcl):
! #	What folders have nested folders under them
! #	What folders have unseen messages
! # For scan listing (ftoc.tcl):
! #	What messages are unread.
  #
  # Some of the routines here are set up to run in a background interpreter.
  # When you see calls to BgRPC it is invoking the routine in the
***************
*** 21,45 ****
  
  proc Flist_Init {} {
      global flist
!     FlistInitVars		;# Reset unseen msgs state
      set flist(context) {}
      set flist(contextMtime) 0
      set flist(cacheFileMtime) 0
      Flist_FindAllFolders
  }
! proc FlistInitVars {} {
      global flist
      set flist(unseen) {}	;# Sequence of folders to visit
!     if ![info exists flist(unvisited)] {
! 	set flist(unvisited) {}	;# Unseen folders not yet visited
!     }
      set flist(unvisitedNext) {}	;# Temporary copy (next iteration)
!     set flist(newMsgs) 0
      set flist(newFolders) 0
      if ![info exists flist(debug)] {
  	set flist(debug) 0
      }
      if {$flist(debug)} {
  	trace variable flist(unseen) w FlistTraceUnseen
  	trace variable flist(unvisited) w FlistTraceUnvisited
  	set flist(listbox) .flistbox
--- 24,58 ----
  
  proc Flist_Init {} {
      global flist
!     FlistResetVars		;# Reset unseen msgs state
      set flist(context) {}
      set flist(contextMtime) 0
      set flist(cacheFileMtime) 0
      Flist_FindAllFolders
  }
! proc FlistResetVars {} {
      global flist
      set flist(unseen) {}	;# Sequence of folders to visit
!     set flist(unvisited) {}	;# Unseen folders not yet visited
!     Exmh_Debug FlistInitVars
      set flist(unvisitedNext) {}	;# Temporary copy (next iteration)
!     set flist(newMsgs) 0	;# Total count of unseen messages
      set flist(newFolders) 0
+ 
+     # flist(new,$folder)	is the number of unseen in a folder
+     # flist(newseq,$folder)	is the message id's of unseen messages
+     # flist(mtime,$folder)	is modify time of .mh_sequences file
+     foreach x [array names flist] {
+ 	if [regexp {^(new|newseq|mtime),} $x] {
+ 	    # reset per-folder new and newseq state
+ 	    unset flist($x)
+ 	}
+     }
      if ![info exists flist(debug)] {
  	set flist(debug) 0
      }
      if {$flist(debug)} {
+ 	trace variable flist(newMsgs) w FlistTraceNewMsgs
  	trace variable flist(unseen) w FlistTraceUnseen
  	trace variable flist(unvisited) w FlistTraceUnvisited
  	set flist(listbox) .flistbox
***************
*** 46,51 ****
--- 59,65 ----
  	set f $flist(listbox)
  	if ![winfo exists $f] {
  	    Exwin_Toplevel $f "Flist Debug" Flist
+ 	    Widget_Label $f newMsgs {top fillx } -textvariable flist(newMsgs)
  	    Widget_Frame $f top Labels
  	    Widget_Label $f.top unseen {left fill expand} -text Unseen
  	    Widget_Label $f.top unvisited {left fill expand} -text Unvisited
***************
*** 55,60 ****
--- 69,80 ----
  	}
      }
  }
+ proc FlistTraceNewMsgs {args} {
+     global flist
+     set l [info level]
+     incr l -1
+     Exmh_Debug flist(newMsgs) => $flist(newMsgs) : [info level $l] $args
+ }
  proc FlistTraceUnseen {args} {
      global flist
      $flist(listbox).unseen delete 0 end
***************
*** 74,79 ****
--- 94,100 ----
  
  proc Flist_Refresh {} {
      global flist
+     FlistResetVars
      FlistFindAllInner
      Fdisp_Redisplay
      Flist_FindUnseen 1
***************
*** 108,116 ****
      Widget_Message .scanning msg -cursor watch -text "
  Scanning for nested folders.
  (folders -all -fast -recurse)
- This can be very slow if you have
- not patched the MH folders command.
- A patch comes with exmh.
  
  The results are cached in
  $mhProfile(path)/.folders
--- 129,134 ----
***************
*** 236,241 ****
--- 254,261 ----
      }
  }
  
+ # The routines below here manage the unseen sequence state per folder.
+ 
  proc FlistSeq { folder sequence } {
      global mhProfile
      # Explode a sequence into a list of message numbers
***************
*** 266,395 ****
      }
      return $seq
  }
! # Call Flist_UnseenUpdate from external sorting programs after
! # they add messages to a folder
! proc Flist_UnseenUpdate { folder } {
!     global exmh flist
!     Flist_UnseenMsgs $folder
!     if {[string compare $folder $exmh(folder)] == 0} {
! 	Scan_FolderUpdate $folder
!     }
!     if {[lsearch $flist(unvisited) $folder] < 0} {
! 	lappend flist(unvisited) $folder
! 	set flist(unvisitedNext) $flist(unvisited)
!     }
!     # This wiggles the flag and sorts flist(unvisited)
!     Flist_Done
! }
! proc Flist_UnseenMsgs { folder } {
      global flist exmh
!     set unseen [Mh_Unseen $folder]	;# Read .mh_sequences file
  
!     if {$folder == $exmh(folder)} {
! 	set seen [Msg_Seen]		;# Trim out viewed messages
! 	foreach id $seen {
! 	    set ix [lsearch $unseen $id]
! 	    if {$ix >= 0} {
! 		set unseen [lreplace $unseen $ix $ix]
! 	    }
! 	}
      }
!     if {[llength $unseen] == 0} {
! 	catch {
! 	    FlistUnseenFolder $folder
! 	}
      } else {
! 	if ![info exists flist(new,$folder)] {
! 	    Fdisp_HighlightUnseen $folder
! 	    set before 0
! 	} else {
! 	    set before $flist(new,$folder)
! 	}
! 	# Update state variables
! 	set flist(newseq,$folder) $unseen
! 	set flist(new,$folder) [llength $unseen]
! 	incr flist(newMsgs) [expr $flist(new,$folder) - $before]
      }
!     return $unseen
! }
! proc Flist_NumUnseen { folder } {
!     global flist
!     if [info exists flist(new,$folder)] {
! 	return $flist(new,$folder)
      } else {
! 	return 0
!     }
! }
! proc Flist_UnseenFolders {} {
!     global flist
!     return $flist(unseen)
! }
! proc FlistReset {} {
!     global flist
!     FlistInitVars
! }
! proc FlistResetUnseen {folder} {
!     global flist
! 
!     if [info exists flist(newseq,$folder)] {
! 	set seq $flist(newseq,$folder)
!     } else {
! 	set seq {}
!     }
!     Flist_AddUnseen $folder $seq
! }
! proc Flist_AddUnseen {folder seq} {
!     global flist exmh
!     set num [llength $seq]
!     if {$num <= 0} {
! 	FlistUnseenFolder $folder
! 	return
!     }
! 
!     if {$folder == $exmh(folder)} {
! 	Flist_UpdateUnseen $folder $seq
! 	return
!     }
!     incr flist(newMsgs) $num
!     set flist(new,$folder) $num
!     set flist(newseq,$folder) $seq
!     incr flist(newFolders)
!     lappend flist(unseen) $folder
!     lappend flist(unvisitedNext) $folder
!     Fdisp_HighlightUnseen $folder
! }
! proc FlistKeepUnseens {list} {
!     global flist exmh
!     foreach f $list {
! 	if [info exists flist(newseq,$f)] {
! 	    set num [llength $flist(newseq,$f)]
! 	    incr flist(newMsgs) $num
! 	    incr flist(newFolders)
! 	    lappend flist(unseen) $f
! 	    if {$f != $exmh(folder)} {
! 		lappend flist(unvisitedNext) $f
  	    }
- 	} else {
- 	    Exmh_Debug FlistKeepUnseens lost $f
  	}
      }
- }
- proc Flist_UpdateUnseen {folder seq} {
-     global flist exmh
-     # Check overlap with already seen msgs
-     foreach id [Msg_Seen] {
- 	set ix [lsearch $seq $id]
- 	if {$ix >= 0} {
- 	    set seq [lreplace $seq $ix $ix]
- 	}
-     }
      set num [llength $seq]
      if {$num <= 0} {
  	return
      }
      incr flist(newMsgs) $num
!     set flist(new,$folder) $num
!     set flist(newseq,$folder) $seq
      if {[lsearch $flist(unseen) $folder] < 0} {
  	incr flist(newFolders)
  	lappend flist(unseen) $folder
--- 286,334 ----
      }
      return $seq
  }
! 
! # Add unseen messages to the list for a given folder.
! # This has to be careful about already known unseen messages
! # and messages that have been read but not committed as read.
! proc Flist_AddUnseen {folder seq} {
      global flist exmh
!     Exmh_Debug Flist_AddUnseen 1 $folder $seq
  
!     # Check overlap with already seen msgs and unseen messages already known
!     if ![info exists flist(newseq,$folder)] {
! 	set flist(newseq,$folder) {}
! 	set flist(new,$folder) 0
      }
!     if {[string compare $folder $exmh(folder)] == 0} {
! 	set known [concat [Msg_Seen] $flist(newseq,$folder)]
      } else {
! 	set known $flist(newseq,$folder)
      }
!     # Subtract elements of $known from $seq
!     if {[llength $known] > [llength $seq]} {
! 	set nseq {}
! 	foreach id $seq {
! 	    if {[lsearch $known $id] < 0} {
! 		lappend nseq $id
! 	    }
! 	}
! 	set seq $nseq
      } else {
! 	foreach id $known  {
! 	    set ix [lsearch $seq $id]
! 	    if {$ix >= 0} {
! 		set seq [lreplace $seq $ix $ix]
  	    }
  	}
      }
      set num [llength $seq]
      if {$num <= 0} {
  	return
      }
      incr flist(newMsgs) $num
!     incr flist(new,$folder) $num
!     set flist(newseq,$folder) [concat $flist(newseq,$folder) $seq]
!     Exmh_Debug Flist_AddUnseen 2 $folder $flist(newseq,$folder)
      if {[lsearch $flist(unseen) $folder] < 0} {
  	incr flist(newFolders)
  	lappend flist(unseen) $folder
***************
*** 400,411 ****
      }
      Fdisp_HighlightUnseen $folder
  }
! proc Flist_Done {{keep {}}} {
      global flist exmh
  
!     if {[llength $keep] > 0} {
! 	FlistKeepUnseens $keep
!     }
      if {$flist(newMsgs) > 0} {
  	if {$flist(newMsgs) == 1} {set msg "msg"} else {set msg "msgs"}
  	if {$flist(newFolders) == 1} {set f "folder"} else {set f "folders"}
--- 339,348 ----
      }
      Fdisp_HighlightUnseen $folder
  }
! proc Flist_Done {} {
      global flist exmh
  
!     Exmh_Debug Flist_Done
      if {$flist(newMsgs) > 0} {
  	if {$flist(newMsgs) == 1} {set msg "msg"} else {set msg "msgs"}
  	if {$flist(newFolders) == 1} {set f "folder"} else {set f "folders"}
***************
*** 429,461 ****
  }
  
  
  # Flist enumerates folders that have unseen messages.
  proc Flist_FindUnseen {{reset 0}} {
      Exmh_Debug Flist_FindUnseen end [time [list FlistFindUnseen $reset]]
  }
  
! proc FlistFindStart {} {
      global flist
      if ![info exists flist(active)] {
  	set flist(active) 0
      }
      if {$flist(active)} {
  	error "FlistActive"
      }
      set flist(active) 1
!     set unseen $flist(unseen)
!     FlistReset
!     return $unseen
  }
  proc FlistFindUnseen {reset} {
      global mhProfile flist curFolder
!     if [catch {BgRPC FlistFindStart} unseen] {
  	# Flist active
  	return
      }
-     if {$reset} {
- 	Fdisp_ClearHighlights
-     }
      FlistGetContext
      set result {}
      set keep {}
--- 366,433 ----
  }
  
  
+ # Call Flist_UnseenUpdate from external sorting programs after
+ # they add messages to a folder
+ 
+ proc Flist_UnseenUpdate { folder } {
+     global exmh flist
+     Flist_UnseenMsgs $folder
+     if {[string compare $folder $exmh(folder)] == 0} {
+ 	Scan_FolderUpdate $folder
+     }
+     if {[lsearch $flist(unvisited) $folder] < 0} {
+ 	lappend flist(unvisited) $folder
+ 	set flist(unvisitedNext) $flist(unvisited)
+     }
+     # This wiggles the flag and sorts flist(unvisited)
+     Flist_Done
+ }
+ proc Flist_UnseenMsgs { folder } {
+     global flist
+     Flist_AddUnseen $folder [Mh_Unseen $folder]
+     return $flist(newseq,$folder)
+ }
+ proc Flist_NumUnseen { folder } {
+     global flist
+     if [info exists flist(new,$folder)] {
+ 	return $flist(new,$folder)
+     } else {
+ 	return 0
+     }
+ }
+ proc Flist_UnseenFolders {} {
+     global flist
+     return $flist(unseen)
+ }
+ 
  # Flist enumerates folders that have unseen messages.
  proc Flist_FindUnseen {{reset 0}} {
      Exmh_Debug Flist_FindUnseen end [time [list FlistFindUnseen $reset]]
  }
  
! proc FlistFindStart {reset} {
      global flist
      if ![info exists flist(active)] {
  	set flist(active) 0
      }
+     Exmh_Debug FlistFindStart active $flist(active)
      if {$flist(active)} {
  	error "FlistActive"
      }
      set flist(active) 1
!     if {$reset} {
! 	Fdisp_ClearHighlights
! 	FlistResetVars
!     }
!     return 
  }
  proc FlistFindUnseen {reset} {
      global mhProfile flist curFolder
!     Exmh_Debug FlistFindUnseen reset $reset
!     if [catch {BgRPC FlistFindStart $reset}] {
  	# Flist active
  	return
      }
      FlistGetContext
      set result {}
      set keep {}
***************
*** 476,486 ****
  	    if {![file exists $path] ||
  		([info exists flist(mtime,$f)] &&
  		 ([file mtime $path] <= $flist(mtime,$f)))} {
! 		if {$reset} {
! 		    BgRPC FlistResetUnseen $f
! 		} elseif {[lsearch $unseen $f] >= 0} {
! 		    lappend keep $f
! 		}
  	    } else {
  		if {[catch {open $path} in] == 0} {
  		    set se \n[read $in]
--- 448,454 ----
  	    if {![file exists $path] ||
  		([info exists flist(mtime,$f)] &&
  		 ([file mtime $path] <= $flist(mtime,$f)))} {
! 		# No state to report
  	    } else {
  		if {[catch {open $path} in] == 0} {
  		    set se \n[read $in]
***************
*** 489,500 ****
  			BgRPC Flist_AddUnseen $f [FlistSeq $f $seq]
  		    }
  		    close $in
  		}
- 		set flist(mtime,$f) [file mtime $path]
  	    }
  	}
      }
!     BgRPC Flist_Done $keep
  }
  proc FlistGetContext {} {
      global flist mhProfile
--- 457,468 ----
  			BgRPC Flist_AddUnseen $f [FlistSeq $f $seq]
  		    }
  		    close $in
+ 		    set flist(mtime,$f) [file mtime $path]
  		}
  	    }
  	}
      }
!     BgRPC Flist_Done
  }
  proc FlistGetContext {} {
      global flist mhProfile
***************
*** 528,533 ****
--- 496,502 ----
  }
  proc FlistUnseenFolder { folder } {
      global flist
+     Exmh_Debug FlistUnseenFolder $folder
      catch {unset flist(new,$folder)}
      catch {unset flist(newseq,$folder)}
      Fdisp_UnHighlightUnseen $folder
***************
*** 542,547 ****
--- 511,520 ----
      set ix [lsearch $flist(unvisited) $folder]
      if {$ix >= 0} {
  	set flist(unvisited) [lreplace $flist(unvisited) $ix $ix]
+     }
+     set ix [lsearch $flist(unvisitedNext) $folder]
+     if {$ix >= 0} {
+ 	set flist(unvisitedNext) [lreplace $flist(unvisitedNext) $ix $ix]
      }
  }
  
EOF-EOF-EOF
Patch lib/folder.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/folder.tcl	Tue Aug 15 10:00:04 1995
--- exmh-1.6.5/lib/folder.tcl	Mon Dec 11 08:45:38 1995
***************
*** 110,117 ****
      Flist_Visited $f
      set exmh(folder) $f
      if {$ftoc(autoSort)} {
! 	global flist
! 	if {$flist(new,$f) > 0} {
  	    Ftoc_Sort
  	}
      }
--- 110,116 ----
      Flist_Visited $f
      set exmh(folder) $f
      if {$ftoc(autoSort)} {
! 	if [Flist_NumUnseen $f] {
  	    Ftoc_Sort
  	}
      }
***************
*** 200,207 ****
  proc FolderCommit { rmmCommit moveCommit copyCommit } {
      global exmh exwin ftoc
  
      Ftoc_Commit $rmmCommit $moveCommit $copyCommit
!     Exmh_CheckPoint	;# Writing out cache
      if $ftoc(autoPack) {
  	Background_Wait	;# Let folder ops complete
          Folder_Pack	;# Before packing
--- 199,208 ----
  proc FolderCommit { rmmCommit moveCommit copyCommit } {
      global exmh exwin ftoc
  
+     Msg_CheckPoint	;# Update sequence state
      Ftoc_Commit $rmmCommit $moveCommit $copyCommit
!     Exmh_Debug Scan_CacheUpdate [time Scan_CacheUpdate]
! 
      if $ftoc(autoPack) {
  	Background_Wait	;# Let folder ops complete
          Folder_Pack	;# Before packing
***************
*** 211,219 ****
  # Streamlined Commit called before Folder_Change
  proc Folder_CommitType { type } {
      global ftoc
      if {[string compare $type "Change folder"] == 0} {
- 	busy Ftoc_Commit Mh_Rmm Mh_Refile Mh_Copy
  	Msg_CheckPoint
  	if $ftoc(autoPack) {
  	    Background_Wait	;# Let folder ops complete
  	    BgAction Pack Folder_Pack	;# Before packing
--- 212,221 ----
  # Streamlined Commit called before Folder_Change
  proc Folder_CommitType { type } {
      global ftoc
+     Exmh_Debug Folder_CommitType $type
      if {[string compare $type "Change folder"] == 0} {
  	Msg_CheckPoint
+ 	busy Ftoc_Commit Mh_Rmm Mh_Refile Mh_Copy
  	if $ftoc(autoPack) {
  	    Background_Wait	;# Let folder ops complete
  	    BgAction Pack Folder_Pack	;# Before packing
***************
*** 275,281 ****
  	set folderlist $exmh(folder)
      }
      set uid 0
!     while {[file exists [set fn /tmp/exmh.[pid].purge.$uid]]} {
  	incr uid
      }
      set out [open $fn w]
--- 277,283 ----
  	set folderlist $exmh(folder)
      }
      set uid 0
!     while {[file exists [set fn [Env_Tmp]/exmh.[pid].purge.$uid]]} {
  	incr uid
      }
      set out [open $fn w]
EOF-EOF-EOF
Patch lib/ftoc.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/ftoc.tcl	Wed Sep 27 10:05:44 1995
--- exmh-1.6.5/lib/ftoc.tcl	Wed Nov  8 09:24:41 1995
***************
*** 834,839 ****
--- 834,840 ----
      global ftoc
  
      if {$ftoc(changed) != 0} then {
+ 	Exmh_Debug Ftoc_Changes $type
  	if {("$allowAuto" == "1") && $ftoc(autoCommit)} {
  	    Folder_CommitType $type
  	    return 0
EOF-EOF-EOF
Patch lib/glimpse.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/glimpse.tcl	Tue Oct  3 10:16:48 1995
--- exmh-1.6.5/lib/glimpse.tcl	Thu Dec  7 13:56:55 1995
***************
*** 1,4 ****
! # $Header: /home/bwelch/src/exmh/lib/RCS/glimpse.tcl,v 1.7 1995/10/03 17:16:39 bwelch Exp $
  #
  # link glimpse to exmh to provide full text searching within and
  # across folders faster but less thoroughly than pick
--- 1,4 ----
! # $Header: /home/bwelch/src/exmh/lib/RCS/glimpse.tcl,v 1.8 1995/12/07 21:56:47 bwelch Exp $
  #
  # link glimpse to exmh to provide full text searching within and
  # across folders faster but less thoroughly than pick
***************
*** 487,493 ****
  	update idletask
      } else {
          # For working 'send' (SECURE X-servers)
! 	set path /tmp/glimpse.[pid].$i
  	if [catch {open $path w} out] {
  	Exmh_Status "$path $out"
  	return
--- 487,493 ----
  	update idletask
      } else {
          # For working 'send' (SECURE X-servers)
! 	set path [Env_Tmp]/glimpse.[pid].$i
  	if [catch {open $path w} out] {
  	Exmh_Status "$path $out"
  	return
EOF-EOF-EOF
Patch lib/help.FAQ<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/help.FAQ	Mon Oct  9 10:25:00 1995
--- exmh-1.6.5/lib/help.FAQ	Tue Oct 17 11:08:55 1995
***************
*** 294,300 ****
  
      Your .maildelivery file cannot be group or world writable,
      otherwise slocal just ignores it.
! 	chown 644 ~/.maildelivery
  
      Here is a fragment of a .maildelivery file as an example:
  
--- 294,300 ----
  
      Your .maildelivery file cannot be group or world writable,
      otherwise slocal just ignores it.
! 	chmod 644 ~/.maildelivery
  
      Here is a fragment of a .maildelivery file as an example:
  
EOF-EOF-EOF
Patch lib/help.FAQ.orig<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/help.FAQ.orig	Mon Oct  9 14:50:20 1995
--- exmh-1.6.5/lib/help.FAQ.orig	Mon Nov 20 10:01:48 1995
***************
*** 13,19 ****
  6c. How do you create an X-Face: header line?
  7. Can I use EXMH as a news reader?
  8. How do I change those default wheat-colors for the widgets in EXMH?
! 9. What's the difference between presort and multidrop inc-styles?
  10. How do I fix the "exmh-bg lost UI {process XXXX}" message?
  10b. What does "exmh-bg cannot rendez-vous with UI - exiting" mean?
  11. How come messages are not really removed when I delete them?
--- 13,21 ----
  6c. How do you create an X-Face: header line?
  7. Can I use EXMH as a news reader?
  8. How do I change those default wheat-colors for the widgets in EXMH?
! 9a. How do I get POP to work with exmh?
! 9b. What's the difference between presort and multidrop inc-styles?
! 9c. How do I set up my .maildelivery file to filter mail?
  10. How do I fix the "exmh-bg lost UI {process XXXX}" message?
  10b. What does "exmh-bg cannot rendez-vous with UI - exiting" mean?
  11. How come messages are not really removed when I delete them?
EOF-EOF-EOF
Patch lib/inc.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/inc.tcl	Wed Sep 27 21:42:43 1995
--- exmh-1.6.5/lib/inc.tcl	Mon Oct 23 14:47:38 1995
***************
*** 218,224 ****
      catch {exec rmdir $mhProfile(path)/MyIncTmp}
  
      Flist_FindUnseen		;# Needed to set new message state.
!     BgRPC Inc_PresortFinish
  }
  proc Inc_PresortFinish {} {
      global exmh ftoc
--- 218,230 ----
      catch {exec rmdir $mhProfile(path)/MyIncTmp}
  
      Flist_FindUnseen		;# Needed to set new message state.
!     # This after breaks a potential deadlock:
!     # UI Inc button is pressed - registers outstanding Inc operation
!     # PresortFinish notes new messages in the current folder and wants
!     # to rescan the folder to pick up the changes.
!     # The scan notes the outstanding operation and waits for it to complete.
!     # Deadlock
!     after 1 {BgRPC Inc_PresortFinish}
  }
  proc Inc_PresortFinish {} {
      global exmh ftoc
EOF-EOF-EOF
Patch lib/main.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/main.tcl	Thu Jun 22 14:31:00 1995
--- exmh-1.6.5/lib/main.tcl	Thu Nov 30 16:08:21 1995
***************
*** 16,30 ****
  
      global tk_version
  
-     # Deal with sys V LOGNAME
-     global env
-     if [catch {set env(USER)} user] {
- 	if [catch {set env(LOGNAME)} user] {
- 	    puts stderr "No USER or LOGNAME envar"
- 	    set user ""
- 	}
- 	set env(USER) $user
-     }
      # Tk 4.0b3 bogosity
      if [catch {tk colormodel .}] {
  	rename tk tk-orig
--- 16,21 ----
***************
*** 64,69 ****
--- 55,63 ----
  "Debug information is recorded in a log that you can view
  from within exmh.  Turning off the log may save some
  memory usage.  You can enable the log temporarily."}
+ 	{exmh(logLines)	logLines 1000	{Max lines in debug log}
+ "The log is implemented in a text widget.  This setting limits
+ the number of lines kept in the log."}
  	{flist(debug)		flistDebug OFF	{Debug flist}
  "A listbox that displays the unseen and unvisited folder state
  is displayed to debug the flist module."}
***************
*** 110,115 ****
--- 104,110 ----
      Glimpse_Init
      Background_Init
      fileselect_Init
+     Busy_Init
  
      wm protocol . WM_DELETE_WINDOW Exmh_Done
      Exwin_Layout
***************
*** 123,130 ****
  	wm iconify .
      }
      update
!     bind . <Unmap> ExmhUnmapped
!     bind . <Map> ExmhMapped
  
      Folder_Change $exmh(folder)
      busy ExmhJunk
--- 118,125 ----
  	wm iconify .
      }
      update
!     bind . <Unmap> {ExmhUnmapped %W}
!     bind . <Map> {ExmhMapped %W}
  
      Folder_Change $exmh(folder)
      busy ExmhJunk
***************
*** 313,324 ****
      destroy .
  }
  
! proc ExmhUnmapped {} {
      # This triggers auto-commit
!     Ftoc_Changes iconified
  }
! proc ExmhMapped {} {
!     Inc_Mapped
  }
  
  #### Exmh_Debugging
--- 308,323 ----
      destroy .
  }
  
! proc ExmhUnmapped {w} {
      # This triggers auto-commit
!     if {$w == "."} {
! 	Ftoc_Changes iconified
!     }
  }
! proc ExmhMapped {w} {
!     if {$w == "."} {
! 	Inc_Mapped
!     }
  }
  
  #### Exmh_Debugging
***************
*** 383,388 ****
--- 382,392 ----
  	    if {$exmh(logYview)} {
  		$exmh(log) yview -pickplace "end - 1 lines"
  	    }
+ 	    scan [$exmh(log) index end] %d numlines
+ 	    if {$numlines > $exmh(logLines)} {
+ 		set numlines [expr {$numlines - $exmh(logLines)}]
+ 		$exmh(log) delete 1.0 $numlines.0
+ 	    }
  	}
      }
  }
***************
*** 413,419 ****
  proc ExmhLogSave {} {
      global exmh
      for {set id 0} {$id < 100} {incr id} {
! 	set name /tmp/exmhlog.$id
  	if ![file exists $name] {
  	    if ![catch {open $name w} logfile] {
  		break
--- 417,423 ----
  proc ExmhLogSave {} {
      global exmh
      for {set id 0} {$id < 100} {incr id} {
! 	set name [Env_Tmp]/exmhlog.$id
  	if ![file exists $name] {
  	    if ![catch {open $name w} logfile] {
  		break
***************
*** 423,429 ****
      if [catch {
  	puts $logfile [$exmh(log) get 1.0 end]
  	close $logfile
! 	Exmh_Status "Saved log in /tmp/exmhlog.$id" blue
      } msg] {
  	Exmh_Status "Cannot save log: $msg" purple
      }
--- 427,433 ----
      if [catch {
  	puts $logfile [$exmh(log) get 1.0 end]
  	close $logfile
! 	Exmh_Status "Saved log in [Env_Tmp]/exmhlog.$id" blue
      } msg] {
  	Exmh_Status "Cannot save log: $msg" purple
      }
EOF-EOF-EOF
Patch lib/mh.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/mh.tcl	Thu Jul 27 09:12:11 1995
--- exmh-1.6.5/lib/mh.tcl	Thu Dec  7 15:39:10 1995
***************
*** 55,61 ****
  # If the context file gets corrupted, just remove it and try again.
  proc MhExec { args } {
      global mhProfile
-     Exmh_Debug MhExec $args
      Audit $args
      if [catch {eval exec $args} result] {
  	global errorInfo
--- 55,60 ----
***************
*** 67,72 ****
--- 66,75 ----
  	    error $result $errorInfo
  	}
      } else {
+ #	These Exmh_Debug calls break up the atomicity of commit actions
+ #	by the background process because of Tk send and timer handling.
+ #	The periodic maintenence task can sneak in on us.
+ #	Exmh_Debug MhExec $args
  	return $result
      }
  }
***************
*** 75,87 ****
  # passed to Msg_Comp, Msg_Reply, and Msg_Forward, respectively.
  proc Mh_CompSetup {} {
      global exmh mhProfile msg
!     if {([string compare $exmh(folder) $mhProfile(draft-folder)] == 0) &&
! 	([string length $msg(id)] != 0)} {
  	Exmh_Status "comp -use $msg(id)"
  	Mh_SetCur $mhProfile(draft-folder) $msg(id)
      } else {
  	Exmh_Status "comp"
  	MhExec comp -nowhatnowproc
      }
  }
  proc Mh_CompUseSetup {} {
--- 78,96 ----
  # passed to Msg_Comp, Msg_Reply, and Msg_Forward, respectively.
  proc Mh_CompSetup {} {
      global exmh mhProfile msg
!     set indrafts [expr \
! 	[string compare $exmh(folder) $mhProfile(draft-folder)] == 0]
!     if {$indrafts && ([string length $msg(id)] != 0)} {
  	Exmh_Status "comp -use $msg(id)"
  	Mh_SetCur $mhProfile(draft-folder) $msg(id)
      } else {
  	Exmh_Status "comp"
  	MhExec comp -nowhatnowproc
+ 	if {$indrafts} {
+ 	    # In drafts with no previously current message
+ 	    Scan_Folder $exmh(folder)
+ 	    Msg_Change [Mh_Sequence $exmh(folder) cur]
+ 	}
      }
  }
  proc Mh_CompUseSetup {} {
***************
*** 506,516 ****
  	return [MhExec mhpath +$folder $msg]
      }
  }
  proc Mh_Refile {srcFolder msgs folder} {
      while {[llength $msgs] > 0} {
  	set chunk [lrange $msgs 0 19]
  	set msgs [lrange $msgs 20 end]
- 	Exmh_Debug MhExec refile $chunk -src +$srcFolder +$folder
  	eval {MhExec refile} $chunk {-src +$srcFolder +$folder}
      }
  }
--- 515,530 ----
  	return [MhExec mhpath +$folder $msg]
      }
  }
+ 
+ # Note - do not put Exmh_Debug calls into Mh_Refile, Mh_Copy, or Mh_Rmm
+ # because that seems to open a window that allows the periodic background
+ # tasks to run.  This causes a race between commit actions and background
+ # inc/flist actions.
+ 
  proc Mh_Refile {srcFolder msgs folder} {
      while {[llength $msgs] > 0} {
  	set chunk [lrange $msgs 0 19]
  	set msgs [lrange $msgs 20 end]
  	eval {MhExec refile} $chunk {-src +$srcFolder +$folder}
      }
  }
***************
*** 518,524 ****
      while {[llength $msgs] > 0} {
  	set chunk [lrange $msgs 0 19]
  	set msgs [lrange $msgs 20 end]
- 	Exmh_Debug MhExec refile $chunk -link -src +$srcFolder +$folder
  	eval {MhExec refile} $chunk {-link -src +$srcFolder +$folder}
      }
  }
--- 532,537 ----
***************
*** 526,532 ****
      while {[llength $msgs] > 0} {
  	set chunk [lrange $msgs 0 19]
  	set msgs [lrange $msgs 20 end]
- 	Exmh_Debug MhExec rmm +$folder $chunk
  	eval {MhExec rmm +$folder} $chunk
      }
  }
--- 539,544 ----
***************
*** 718,724 ****
      Widget_Message .newuser msg -aspect 1000 -text "
  Exmh is a front end to the MH mail handling system.
  Feel free to send comments and bug reports to
! 	exmhbugs@parc.xerox.com
  
  It appears you have not used the MH mail system before.
  (Your [file tail $mhProfile(profile)] is missing or incomplete.)
--- 730,736 ----
      Widget_Message .newuser msg -aspect 1000 -text "
  Exmh is a front end to the MH mail handling system.
  Feel free to send comments and bug reports to
! 	Brent.Welch@eng.sun.com
  
  It appears you have not used the MH mail system before.
  (Your [file tail $mhProfile(profile)] is missing or incomplete.)
EOF-EOF-EOF
Patch lib/mime.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/mime.tcl	Mon Oct  9 14:34:05 1995
--- exmh-1.6.5/lib/mime.tcl	Wed Nov 22 09:25:14 1995
***************
*** 307,312 ****
--- 307,313 ----
      global mime mimeFont
      set charset [Mime_GetCharset $tkw $part]
      if ![info exists mimeFont(charset,$charset)] {
+ 	set mime(fontSize) [string trim $mime(fontSize)]
  	if [catch {Mime_GetFont $tkw medium r plain $mime(fontSize) $charset} \
  		font] {
  	    MimeInsertNote $tkw [MimeLabel $part part] "Error: $font"
***************
*** 1601,1606 ****
--- 1602,1611 ----
  	}
      }
  
+     global tk_version
+     if {$tk_version >= 4.0} {
+ 	$mimeHdr($part,menu) config -tearoff 0
+     }   
      $mimeHdr($part,menu) configure -disabledforeground Black
      MimeMenuAdd $part command \
  	-label $menuLabel \
***************
*** 1607,1613 ****
  	-state disabled \
  	-font $mimeFont(title)
      MimeMenuAdd $part separator
!  
      menu_bind $mimeHdr($part,menu) $tkw
      bind $tkw <ButtonPress-3> {text_menu_post %W %x %y %X %Y}
      bind $tkw <Any-ButtonRelease-3> {text_menu_unpost %W}
--- 1612,1618 ----
  	-state disabled \
  	-font $mimeFont(title)
      MimeMenuAdd $part separator
! 
      menu_bind $mimeHdr($part,menu) $tkw
      bind $tkw <ButtonPress-3> {text_menu_post %W %x %y %X %Y}
      bind $tkw <Any-ButtonRelease-3> {text_menu_unpost %W}
***************
*** 1689,1695 ****
      global mime mimeHdr
  
      set uid 0
!     while {[file exists [set fn "/tmp/exmh.[pid].$part.$uid"]]} {
  	incr uid
      }
      lappend mime(junkfiles) $fn
--- 1694,1700 ----
      global mime mimeHdr
  
      set uid 0
!     while {[file exists [set fn "[Env_Tmp]/exmh.[pid].$part.$uid"]]} {
  	incr uid
      }
      lappend mime(junkfiles) $fn
***************
*** 1746,1752 ****
  	}
  	default {
  	    MimeInsertNote $w $tagName \
! 		"Unknown coding of $encoding for \"$string\" 0"
  	}
      }
  }
--- 1751,1757 ----
  	}
  	default {
  	    MimeInsertNote $w $tagName \
! 		"Unknown coding of $encoding for \"$string\"" 0
  	}
      }
  }
***************
*** 1905,1910 ****
--- 1910,1918 ----
  proc MimeInsertSeparator {tkw part width} {
      global mimeHdr mime
  
+     if [$tkw compare insert != "insert linestart"] {
+        $tkw insert insert "\n"
+     }
      if {$mime(showSeparator)} {
  	set looks {-relief sunken \
  	  -borderwidth 2 \
***************
*** 1970,1975 ****
--- 1978,1984 ----
      # Let's try and find a working font
      set i 1
      set family $mime(family,$charset,$fontSet,$i)
+     set size [string trim $size]
  
      set font "-*-$family-$weight-$slant-*-*-*-$size-*-*-$spacing-*-$registry-$encoding"
      $w tag add dummyTag end
***************
*** 2067,2073 ****
  }
  
  proc Mime_Uudecode { infile outfile } {
!     set tmpfile /tmp/exmh.uud.[file tail $infile].[pid]
      if [catch {open $tmpfile w 0600} out] {
  	Exmh_Status $out
      } else {
--- 2076,2082 ----
  }
  
  proc Mime_Uudecode { infile outfile } {
!     set tmpfile [Env_Tmp]/exmh.uud.[file tail $infile].[pid]
      if [catch {open $tmpfile w 0600} out] {
  	Exmh_Status $out
      } else {
EOF-EOF-EOF
Patch lib/mosaic.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/mosaic.tcl	Thu Mar 30 17:20:48 1995
--- exmh-1.6.5/lib/mosaic.tcl	Wed Nov 22 09:25:24 1995
***************
*** 11,17 ****
  	    Exmh_Status "$uri(mosaicApp) pid $mosaic(pid)"
  	}
      }
!     if [catch {open /tmp/Mosaic.$mosaic(pid) w} out] {
  	error $out
      }
      puts $out $newwin
--- 11,17 ----
  	    Exmh_Status "$uri(mosaicApp) pid $mosaic(pid)"
  	}
      }
!     if [catch {open [Env_Tmp]/Mosaic.$mosaic(pid) w} out] {
  	error $out
      }
      puts $out $newwin
***************
*** 52,60 ****
  proc Mosaic_ShowPartDirect { tkw part } {
      global mimeHdr mime
      set fileName $mimeHdr($part,file)
!     catch {exec rm -f /tmp/exmh.[pid].html}
!     exec ln -s $fileName /tmp/exmh.[pid].html
!     set fileName /tmp/exmh.[pid].html
      Exmh_Status "HTML Load $fileName"
      $tkw insert insert "Viewing HTML ...\n"
      URI_StartViewer file://localhost$fileName
--- 52,60 ----
  proc Mosaic_ShowPartDirect { tkw part } {
      global mimeHdr mime
      set fileName $mimeHdr($part,file)
!     catch {exec rm -f [Env_Tmp]/exmh.[pid].html}
!     exec ln $fileName [Env_Tmp]/exmh.[pid].html
!     set fileName [Env_Tmp]/exmh.[pid].html
      Exmh_Status "HTML Load $fileName"
      $tkw insert insert "Viewing HTML ...\n"
      URI_StartViewer file://localhost$fileName
EOF-EOF-EOF
Patch lib/msg.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/msg.tcl	Wed Aug  9 11:38:55 1995
--- exmh-1.6.5/lib/msg.tcl	Wed Nov  8 13:59:52 1995
***************
*** 509,515 ****
  
  proc Msg_Edit {} {
      global exmh msg editor
!     Exmh_Status "Editting $exmh(folder)/$msg(id)"
      #
      # Hack because exmh-async isn't appropriate in this case.
      #
--- 509,515 ----
  
  proc Msg_Edit {} {
      global exmh msg editor
!     Exmh_Status "Editing $exmh(folder)/$msg(id)"
      #
      # Hack because exmh-async isn't appropriate in this case.
      #
EOF-EOF-EOF
Patch lib/pgpMatch.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/pgpMatch.tcl	Fri Jun 30 11:30:50 1995
--- exmh-1.6.5/lib/pgpMatch.tcl	Thu Dec  7 14:00:44 1995
***************
*** 6,13 ****
  # 
  
  # $Log: pgpMatch.tcl,v $
! # Revision 1.4  1995/06/09  20:56:42  bwelch
! # Fixed 3.6'ism
  #
  # Revision 1.4  1995/06/09  20:56:42  bwelch
  # Fixed 3.6'ism
--- 6,13 ----
  # 
  
  # $Log: pgpMatch.tcl,v $
! # Revision 1.5  1995/12/07  22:00:11  bwelch
! # New PGP key name matching algorithm from Stefan Monnier
  #
  # Revision 1.4  1995/06/09  20:56:42  bwelch
  # Fixed 3.6'ism
***************
*** 69,75 ****
  
      set email [string tolower [string trim $email]]
  
!     if {($pgp(cacheids) != "no") && [info exists pgpMatch($email)]} {
  	return $pgpMatch($email)
      }
  
--- 69,75 ----
  
      set email [string tolower [string trim $email]]
  
!     if {($pgp(cacheids) != "none") && [info exists pgpMatch($email)]} {
  	return $pgpMatch($email)
      }
  
***************
*** 79,85 ****
  	set id $email
      }
  
!     set sep {][{}<>()@"|,;!' }
  
      # split into login, domain and comment
      if {![regexp "^(.*\[$sep])?(\[^$sep]+)@(\[^$sep]+)(.*)\$" $id {} comment1 login domain comment2]} {
--- 79,85 ----
  	set id $email
      }
  
!     set sep "]\[{}<>()@\"|,;!' "
  
      # split into login, domain and comment
      if {![regexp "^(.*\[$sep])?(\[^$sep]+)@(\[^$sep]+)(.*)\$" $id {} comment1 login domain comment2]} {
***************
*** 89,131 ****
      set loginids [Misc_Filter x {$x != {}} [split [string tolower "$login"] "."]]
      set domainids [Misc_Filter x {$x != {}} [split [string tolower "$domain"] "."]]
  
!     set pgpkeys(0) [PgpMatch_InitialKeyList $loginids $domainids $commentids $keyring]
      set subids [concat \
  	    [Misc_Map x {format "(^|\[$sep.])${x}(\\.\[^$sep]*)*@"} $loginids] \
  	    [Misc_Map x {format "@(\[^$sep]*\\.)*${x}(\$|\[$sep.])"} [Misc_Reverse $domainids]] \
  	    [Misc_Map x {format "(^|\[$sep.])${x}(\$|\[$sep.])"} $commentids]]
  
      foreach subidindex [Misc_IntList 0 [llength $subids]] {
! 	set subid [lindex $subids $subidindex]
! 	set pgpkeys([expr $subidindex + 1]) {}
  
! 	foreach class [Misc_Reverse [Misc_IntList 0 [expr $subidindex + 1]]] {
! 	    set tmp [Misc_Segregate key {[regexp -nocase $subid $key]} $pgpkeys($class)]
! 	    set pgpkeys([expr $class + 1]) [concat $pgpkeys([expr $class + 1]) [lindex $tmp 0]]
! 	    set pgpkeys($class) [lindex $tmp 1]
! 	}
      }
  
      set maxmatches [llength $subids]
!     set bestmatches $maxmatches
!     while {($bestmatches > 0) && ($pgpkeys($bestmatches) == {})} {
! 	set bestmatches [expr $bestmatches - 1]
!     }
  
      # check the match's quality
!     if {([llength $pgpkeys($bestmatches)] != 1) || \
! 	    ((100 * ($bestmatches + 1)) / ($maxmatches + 1) < $pgp(minmatch))} {
! 	if {$bestmatches > 0} {
! 	    set pgpkeys($bestmatches) [concat $pgpkeys($bestmatches) $pgpkeys([expr $bestmatches - 1])]
! 	    set pgpkeys([expr $bestmatches - 1]) {}
! 	}
! 	ExmhLog "<PgpMatch_Email> $id is ambiguous: [join $pgpkeys($bestmatches) ", "]"
! 	set result [Pgp_KeyBox "Please select the key of $id" $keyring $pgpkeys($bestmatches)]
      } else {
! 	set result $pgpkeys($bestmatches)
      }
      while {$result == {}} {
! 	set result [Pgp_KeyBox "You didn't select a key for $id" $keyring $pgpkeys($bestmatches)]
      }
      set pgpMatch($email) $result
      foreach key $result {
--- 89,133 ----
      set loginids [Misc_Filter x {$x != {}} [split [string tolower "$login"] "."]]
      set domainids [Misc_Filter x {$x != {}} [split [string tolower "$domain"] "."]]
  
!     set pgpbestkeys [PgpMatch_InitialKeyList $loginids $domainids $commentids $keyring]
!     set pgpnextkeys {}
      set subids [concat \
  	    [Misc_Map x {format "(^|\[$sep.])${x}(\\.\[^$sep]*)*@"} $loginids] \
  	    [Misc_Map x {format "@(\[^$sep]*\\.)*${x}(\$|\[$sep.])"} [Misc_Reverse $domainids]] \
  	    [Misc_Map x {format "(^|\[$sep.])${x}(\$|\[$sep.])"} $commentids]]
  
+     set bestmatches 0
      foreach subidindex [Misc_IntList 0 [llength $subids]] {
!        set subid [lindex $subids $subidindex]
  
!        set next [Misc_Segregate key {[regexp -nocase $subid $key]} $pgpnextkeys]
!        set best [Misc_Segregate key {[regexp -nocase $subid $key]} $pgpbestkeys]
!        set top [lindex $best 0]
!        if {$top == {}} {
! 	  set pgpbestkeys [concat [lindex $best 1] [lindex $next 0]]
! 	  set pgpnextkeys [lindex $next 1]
!        } else {
! 	  set bestmatches [expr $bestmatches + 1]
! 	  set pgpbestkeys $top
! 	  set pgpnextkeys [concat [lindex $best 1] [lindex $next 0]]
!        }
      }
  
      set maxmatches [llength $subids]
!     set pgpbestkeys [PgpMatch_UnflattenKeyList $pgpbestkeys]
!     set pgpnextkeys [PgpMatch_UnflattenKeyList $pgpnextkeys]
  
      # check the match's quality
!     if {([llength $pgpbestkeys] != 1) || \
! 	   ((100 * ($bestmatches + 1)) / ($maxmatches + 1) < $pgp(minmatch))} {
!        set pgpbestkeys [concat $pgpbestkeys $pgpnextkeys]
!        ExmhLog "<PgpMatch_Email> $id is ambiguous: [join $pgpbestkeys ", "]"
!        set result [Pgp_KeyBox "Please select the key of $id" $keyring $pgpbestkeys]
      } else {
!        set result $pgpbestkeys
      }
      while {$result == {}} {
! 	set result [Pgp_KeyBox "You didn't select a key for $id" $keyring $pgpbestkeys]
      }
      set pgpMatch($email) $result
      foreach key $result {
***************
*** 154,164 ****
      return $pgpSimpleMatch($name)
  }
  
! #
  proc Pgp_FlatKeyList { pattern keyring } {
      global pgp
  
      set keys [PgpExec_KeyList $pattern $keyring]
      set userids {}
      foreach key $keys {
  	if {[llength $key] > 2} {
--- 156,170 ----
      return $pgpSimpleMatch($name)
  }
  
! # returns a list of keys where every entry only has one userid
! # for instance rather than {0214 "monnier" "monnier@di"} it will give
! # {0214 "monnier"} {0214 "monnier@di"}
  proc Pgp_FlatKeyList { pattern keyring } {
      global pgp
  
+     Exmh_Debug Pgp_FlatKeyList $pattern $keyring
      set keys [PgpExec_KeyList $pattern $keyring]
+     Exmh_Debug Keys $keys
      set userids {}
      foreach key $keys {
  	if {[llength $key] > 2} {
***************
*** 173,178 ****
--- 179,208 ----
      return $userids
  }
  
+ # kind of the opposite to Pgp_FlatKeyList
+ proc PgpMatch_UnflattenKeyList { keylist } {
+    
+    if {"$keylist" == {}} {
+       return {}
+    }
+ 
+    set result {}
+    set curKeyid [lindex [lindex $keylist 0] 0]
+    set curKey [list $curKeyid]
+ 
+    foreach key $keylist {
+       if {[lindex $key 0] == $curKeyid} {
+ 	 lappend curKey [lindex $key 1]
+       } else {
+ 	 lappend result $curKey
+ 	 set curKey $key
+ 	 set curKeyid [lindex $key 0]
+       }
+    }
+    lappend result $curKey
+    return $result
+ }
+ 
  # returns a list of pgpkeys that should be as small as possible,
  # while (hopefully) still containing the key matching the guy specified by
  # $loginids $domainids and $commentids
***************
*** 253,258 ****
--- 283,290 ----
  		$w.key.sframe.yscroll {right filly} \
  		$w.key.sframe.list {left expand fill}
      }
+     # Make sure keyring is correct - it can vary from use to use of the keybox
+     $keybox(listbut) configure -command [list keybox.list.cmd $w $keyring]
      $keybox(sel) configure -textvariable keybox(filter)
      set keybox(state) ""
      set keybox(filter) {}
***************
*** 278,284 ****
      if {$keybox(state) == "cancel"} {
  	error "cancel"
      }
!     return $keybox(result)
  }
  
  proc keybox.ok.cmd {w} {
--- 310,316 ----
      if {$keybox(state) == "cancel"} {
  	error "cancel"
      }
!     return [PgpMatch_UnflattenKeyList $keybox(result)]
  }
  
  proc keybox.ok.cmd {w} {
EOF-EOF-EOF
Patch lib/pgpMisc.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/pgpMisc.tcl	Fri Jun 30 11:34:24 1995
--- exmh-1.6.5/lib/pgpMisc.tcl	Fri Dec  8 11:33:57 1995
***************
*** 11,16 ****
--- 11,19 ----
  # Revision 1.3  1995/06/30  18:33:59  bwelch
  # Added Pgp_FixHeader to update headers
  #
+ # Revision 1.3  1995/06/30  18:33:59  bwelch
+ # Added Pgp_FixHeader to update headers
+ #
  # Revision 1.2  1995/05/25  21:03:21  bwelch
  # Added Widget_BindEntryCmd
  #
EOF-EOF-EOF
Patch lib/pick.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/pick.tcl	Mon Apr 17 17:03:44 1995
--- exmh-1.6.5/lib/pick.tcl	Tue Nov 21 14:55:53 1995
***************
*** 149,156 ****
  	    set who $field$iter
  	    set or 0
  	    for {set i 1} {$i <= $pick($pane,$who,or)} {incr i} {
! 		set text $pick($pane,$who,$i)
! 		if {$text == {}} continue
  
  		if {$inpane != $pane} {
  		    if $hadpane {lappend cmd -or}
--- 149,156 ----
  	    set who $field$iter
  	    set or 0
  	    for {set i 1} {$i <= $pick($pane,$who,or)} {incr i} {
! 		set text [string trim $pick($pane,$who,$i)]
! 		if {[string length $text] == 0} continue
  
  		if {$inpane != $pane} {
  		    if $hadpane {lappend cmd -or}
EOF-EOF-EOF
Patch lib/print.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/print.tcl	Wed May 24 16:04:56 1995
--- exmh-1.6.5/lib/print.tcl	Wed Nov 22 09:25:35 1995
***************
*** 57,63 ****
  	Exmh_Status $in
  	return
      }
!     set file /tmp/postscript.[pid]
      if [catch {open $file w 0600} out] {
  	Exmh_Status $out
      }
--- 57,63 ----
  	Exmh_Status $in
  	return
      }
!     set file [Env_Tmp]/postscript.[pid]
      if [catch {open $file w 0600} out] {
  	Exmh_Status $out
      }
***************
*** 92,98 ****
  	return
      }
      if {[string compare $body body] == 0} {
! 	set file /tmp/exmh.body.$msg(id).[pid]
  	set what Body
  	set print(cleanup) 1
  	set print(redisplay) 0
--- 92,98 ----
  	return
      }
      if {[string compare $body body] == 0} {
! 	set file [Env_Tmp]/exmh.body.$msg(id).[pid]
  	set what Body
  	set print(cleanup) 1
  	set print(redisplay) 0
***************
*** 133,139 ****
      button $b3.ok -text "OK" -command {Message_ApplyOk}
      Widget_BindEntryCmd $e1.entry <Return> {Message_ApplyOk}
      if {$print(cleanup)} {
! 	checkbutton $b3.nuke -text "Cleanup /tmp" -variable print(cleanup)
      } else {
  	checkbutton $b3.nuke -text "Redisplay msg" -variable print(redisplay)
      }
--- 133,139 ----
      button $b3.ok -text "OK" -command {Message_ApplyOk}
      Widget_BindEntryCmd $e1.entry <Return> {Message_ApplyOk}
      if {$print(cleanup)} {
! 	checkbutton $b3.nuke -text "Cleanup [Env_Tmp]" -variable print(cleanup)
      } else {
  	checkbutton $b3.nuke -text "Redisplay msg" -variable print(redisplay)
      }
EOF-EOF-EOF
Patch lib/ps.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/ps.tcl	Mon Apr  3 15:11:15 1995
--- exmh-1.6.5/lib/ps.tcl	Fri Nov 24 11:49:31 1995
***************
*** 36,42 ****
  catch {unset ps}
  set ps(cmd) ps
  set ps(pflag) ""	;# -p on some systems to query process
! set ps(aflag) ax	;# To list all processes
  
  switch -glob -- [string tolower $os] {
      sunos {
--- 36,42 ----
  catch {unset ps}
  set ps(cmd) ps
  set ps(pflag) ""	;# -p on some systems to query process
! set ps(aflag)  x	;# To list all processes owned by the user
  
  switch -glob -- [string tolower $os] {
      sunos {
***************
*** 43,49 ****
  	if [regexp ^5 [exec uname -r]] {
  	    set ps(cmd) /bin/ps	;# Not /usr/ucb
  	    set ps(pflag) -p
! 	    set ps(aflag) -e
  	}
      }
      *bsd*	-
--- 43,49 ----
  	if [regexp ^5 [exec uname -r]] {
  	    set ps(cmd) /bin/ps	;# Not /usr/ucb
  	    set ps(pflag) -p
! 	    set ps(aflag) "-u $env(USER)"
  	}
      }
      *bsd*	-
***************
*** 56,62 ****
      }
      ultrix	{
  	set ps(pflag) ""
! 	set ps(aflag) -e
      }
      osf1	-
      aix		-
--- 56,62 ----
      }
      ultrix	{
  	set ps(pflag) ""
! 	set ps(aflag) "-u $env(USER)"
      }
      osf1	-
      aix		-
***************
*** 72,78 ****
  	# SYS V like systems
  	# Verified: irix, hp-ux
  	set ps(pflag) -p
! 	set ps(aflag) -e
      }
      default {
  	puts stderr "Unknown OS $os - check ps.tcl"
--- 72,78 ----
  	# SYS V like systems
  	# Verified: irix, hp-ux
  	set ps(pflag) -p
! 	set ps(aflag) "-u $env(USER)"
      }
      default {
  	puts stderr "Unknown OS $os - check ps.tcl"
EOF-EOF-EOF
Patch lib/report.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/report.tcl	Mon Oct  9 09:37:25 1995
--- exmh-1.6.5/lib/report.tcl	Mon Dec 11 09:09:17 1995
***************
*** 39,45 ****
  "To: Brent.Welch@eng.sun.com
  Subject: Register exmh user
  -----
! $env(USER) is a user of exmh $exmh(version)
  [exec uname -a]
  
  >   Please register as an exmh user so I can more accurately
--- 39,45 ----
  "To: Brent.Welch@eng.sun.com
  Subject: Register exmh user
  -----
! $exmh(version) $env(USER)
  [exec uname -a]
  
  >   Please register as an exmh user so I can more accurately
***************
*** 53,66 ****
  >	Brent Welch - Sun Labs - Brent.Welch@eng.sun.com
  
  
! Please delete all but one of the next 5 lines.
  
- I am already on an exmh-related mailing list.
- DO NOT add me to any exmh-related mailing list.
- Add me to the exmh-announce mailing list to learn about new releases.
- Add me to the exmh-users discussion list, which gets announcements, too.
- Add me to the exmh-workers programmers list, which gets all traffic, too.
- 
  I like exmh because...
  
  I don't really like...
--- 53,60 ----
  >	Brent Welch - Sun Labs - Brent.Welch@eng.sun.com
  
  
! Please comment on exmh:
  
  I like exmh because...
  
  I don't really like...
***************
*** 68,70 ****
--- 62,82 ----
      close $out
      Edit_DraftID [file tail $draft]
  }
+ proc Report_Subscribe {list what} {
+     global mhProfile exmh tk_version
+ 
+     set draft [Mh_Path $mhProfile(draft-folder) new]
+     if [catch {open $draft w} out] {
+ 	Exmh_Status "Cannot write $draft"
+ 	return
+     }
+     puts $out "To: majordomo@sunlabs.sun.com"
+     puts $out "Subject: exmh mailing list"
+     puts $out "------"
+     puts $out "$what $list"
+     puts $out "--"
+     puts $out "$exmh(version)"
+     close $out
+     Edit_DraftID [file tail $draft]
+ }
+ 
EOF-EOF-EOF
Patch lib/scan.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/scan.tcl	Fri Jun  9 14:34:43 1995
--- exmh-1.6.5/lib/scan.tcl	Wed Nov 22 09:25:44 1995
***************
*** 293,306 ****
  }
  proc Scan_AllFolders { {force 0} } {
      global flist mhProfile ftoc wish
!     if [catch {open /tmp/scancmds w} out] {
  	Exmh_Status "Scan_AllFolders $out"
  	return
      }
      puts $out "wm withdraw ."
      set myname [winfo name .]
!     puts $out {catch { exec touch /tmp/scanctx.[pid] }}
!     puts $out {set env(MHCONTEXT) /tmp/scanctx.[pid]}
      foreach f $flist(allfolders) {
  	if {$force || ! [Scan_CacheValid $f]} {
  	    puts $out "catch \{send $myname \{Exmh_Status \"scan +$f\"\}\}"
--- 293,306 ----
  }
  proc Scan_AllFolders { {force 0} } {
      global flist mhProfile ftoc wish
!     if [catch {open [Env_Tmp]/scancmds w} out] {
  	Exmh_Status "Scan_AllFolders $out"
  	return
      }
      puts $out "wm withdraw ."
      set myname [winfo name .]
!     puts $out {catch { exec touch [Env_Tmp]/scanctx.[pid] }}
!     puts $out {set env(MHCONTEXT) [Env_Tmp]/scanctx.[pid]}
      foreach f $flist(allfolders) {
  	if {$force || ! [Scan_CacheValid $f]} {
  	    puts $out "catch \{send $myname \{Exmh_Status \"scan +$f\"\}\}"
***************
*** 308,317 ****
  	}
      }
      puts $out "catch \{send $myname \{Exmh_Status \"scans completed\"\}\}"
!     puts $out {exec rm /tmp/scanctx.[pid]}
!     puts $out "exec rm /tmp/scancmds"
      puts $out exit
      close $out
!     Exmh_Status "wish -f /tmp/scancmds &" blue
!     exec $wish -f /tmp/scancmds &
  }
--- 308,317 ----
  	}
      }
      puts $out "catch \{send $myname \{Exmh_Status \"scans completed\"\}\}"
!     puts $out "exec rm [Env_Tmp]/scanctx.\[pid]"
!     puts $out "exec rm [Env_Tmp]/scancmds"
      puts $out exit
      close $out
!     Exmh_Status "wish -f [Env_Tmp]/scancmds &" blue
!     exec $wish -f [Env_Tmp]/scancmds &
  }
EOF-EOF-EOF
Patch lib/sedit.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/sedit.tcl	Mon Sep 11 09:55:12 1995
--- exmh-1.6.5/lib/sedit.tcl	Thu Dec  7 15:41:50 1995
***************
*** 37,42 ****
--- 37,43 ----
  }
  proc Sedit_Start { draft } {
      global sedit
+     global exmh	;# for menu references to $exmh(...)
      if ![info exists sedit(init)] {
  	Sedit_Init
      }
***************
*** 423,428 ****
--- 424,432 ----
  	    SeditSave $draft $t		;# Restore draft deleted by MH
  	    set mhProfile(sendasync) $async
  	    $sedit($t,toplevel).but.send config -state normal
+ 	    if {[string compare $exmh(folder) $mhProfile(draft-folder)] == 0} {
+ 		Scan_Folder $exmh(folder)
+ 	    }
  	}
      }
  }
EOF-EOF-EOF
Patch lib/seditBind.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/seditBind.tcl	Fri Jun 30 16:37:19 1995
--- exmh-1.6.5/lib/seditBind.tcl	Thu Dec  7 14:51:43 1995
***************
*** 158,172 ****
  	SeditDirty %W
      }
      SeditBind Entry selpaste {
! 	if [catch {
! 	    %W insert insert [selection get]
! 	}] {
! 	    if [catch {%W insert insert [cutbuffer get]}] {
! #		catch {%W insert insert $sedit(killbuf)}
  	    }
  	}
      }
  
      # when the compose char is pressed, wait for 2 chars
      # (the first may be part of the composechar event)
      if {$tk_version >= 4.0} {
--- 158,171 ----
  	SeditDirty %W
      }
      SeditBind Entry selpaste {
! 	if [catch {%W insert insert [selection get]}] {
! 	    if [catch {%W insert insert [selection get -selection CLIPBOARD]} {
! 		catch {%W insert insert [cutbuffer get]}
  	    }
  	}
      }
  
+ 
      # when the compose char is pressed, wait for 2 chars
      # (the first may be part of the composechar event)
      if {$tk_version >= 4.0} {
***************
*** 434,439 ****
--- 433,446 ----
      # Selection bindings
      if {$tk_version >= 4.0} {
  	set tclass TSelect
+     }
+     SeditBind $tclass selcopy {
+ 	catch {clipboard clear ; clipboard append [Text_Selection]}
+ 	cutbuffer set [Text_Selection]
+     }
+     SeditBind Entry selcopy {
+ 	catch {clipboard clear ; clipboard append [Text_Selection]}
+ 	cutbuffer set [Text_Selection]
      }
  
      bind $tclass <Button-1>	{WidgetTextSelBegin %W %x %y char}
EOF-EOF-EOF
Patch lib/seditExtras.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/seditExtras.tcl	Wed Sep 27 22:59:26 1995
--- exmh-1.6.5/lib/seditExtras.tcl	Thu Dec  7 10:48:29 1995
***************
*** 19,26 ****
      # Do an unformatted save so Mh_Whom gets the right info
      set format $sedit($t,format)
      set sedit($t,format) 0
!     SeditSave $draft $t
!     SeditDirty $t
      set sedit($t,format) $format
  
      set id [file tail $draft]
--- 19,32 ----
      # Do an unformatted save so Mh_Whom gets the right info
      set format $sedit($t,format)
      set sedit($t,format) 0
!     if [catch {
! 	SeditSave $draft $t
! 	SeditDirty $t
!     } err] {
! 	set sedit($t,format) $format
! 	SeditMsg $t $err
! 	return
!     }
      set sedit($t,format) $format
  
      set id [file tail $draft]
***************
*** 55,60 ****
--- 61,71 ----
      if [catch {
  	set in [open $sig]
  	set signature [read $in]
+ 	# check for 8bit characters in the signature
+ 	set 8bit 0
+ 	if [regexp "\[\x80-\xff\]" $signature] {
+ 	    set 8bit 1
+ 	}
  	if {!$sedit($t,multi)} {
  	    if ($sedit(sigDashes)) {
  		$t insert end "\n-- \n"
***************
*** 61,69 ****
  	    } else {
  		$t insert end \n
  	    }
  	    $t insert end $signature
  	} else {
! 	    $t mark set fileinsert [SeditAppendPart text/plain]
  	    $t insert fileinsert \n
  	    $t insert fileinsert $signature
  	}
--- 72,88 ----
  	    } else {
  		$t insert end \n
  	    }
+ 	    # check for 8bit characters in the signature
+ 	    if $8bit {
+ 		set sedit($t,8bit) 1
+ 	    }
  	    $t insert end $signature
  	} else {
! 	    set type text/plain
! 	    if $8bit {
! 		append type "; charset=iso-8859-1"
! 	    }
! 	    $t mark set fileinsert [SeditAppendPart $type]
  	    $t insert fileinsert \n
  	    $t insert fileinsert $signature
  	}
***************
*** 82,95 ****
      global sedit
      if {$newpart < 0} {
  	return
-     } elseif {$newpart > 0} {
- 	set ix [SeditMimeType $type]
- 	if {[string length $ix] == 0} {
- 	    return
- 	}
      }
      Exmh_Status "SeditInsertFile $file $type $desc"
!     if [file readable $file] {
  	set cmd ""
  	set uuname [file tail $file]
  	switch -- $encoding {
--- 101,121 ----
      global sedit
      if {$newpart < 0} {
  	return
      }
      Exmh_Status "SeditInsertFile $file $type $desc"
!     if ![file readable $file] {
! 	SeditMsg $t "Cannot read $file"
!     } else {
! 	if {[regexp ^text $type]} {
! 	    if [catch {open $file r} in] {
! 		SeditMsg $t $in
! 		return
! 	    }
! 	    if [regexp "\[\x80-\xff\]" [read $in]] {
! 		set sedit($t,8bit) 1
! 	    }
! 	    close $in
! 	}
  	set cmd ""
  	set uuname [file tail $file]
  	switch -- $encoding {
***************
*** 143,148 ****
--- 169,178 ----
  	    }
  	} else {
  	    if {$newpart} {
+ 		set ix [SeditMimeType $type]
+ 		if {[string length $ix] == 0} {
+ 		    return
+ 		}
  		set mark fileinsert
  		$t mark set $mark $ix
  		if {$desc != {}} {
***************
*** 168,175 ****
  	}
  	focus $t
  	SeditDirty $t
-     } else {
- 	SeditMsg $t "Cannot read $file"
      }
  }
  proc SeditCiteSelection { draft t } {
--- 198,203 ----
***************
*** 181,187 ****
      regsub -all "\n\n+" $line \x01 line
      set space 0
      foreach line [split $line \x01] {
! 	regsub -all "\n($sedit(pref,replPrefix))?" $line { } line
  
  	set limit 70
  	set cutoff 50
--- 209,216 ----
      regsub -all "\n\n+" $line \x01 line
      set space 0
      foreach line [split $line \x01] {
! 	regsub -all {]|[.^$*+|()\[\\]} $sedit(pref,replPrefix) {\\&} pattern
! 	regsub -all "\n *($pattern)?" $line { } line
  
  	set limit 70
  	set cutoff 50
***************
*** 217,222 ****
--- 246,259 ----
      set name [FSBox "Select file name"]
      if {$name != ""} {
  	if [file readable $name] {
+ 	    # check for 8bit characters in the file
+ 	    catch {
+ 		set in [open $name]
+ 		if [regexp "\[\x80-\xff\]" [read $in]] {
+ 		    set sedit($t,8bit) 1
+ 		}
+ 		close $in
+ 	    }
  	    SeditInsertFile $draft $t $name
  	} else {
  	    SeditMsg $t "Cannot read $name"
***************
*** 398,404 ****
  	return
      }
      # Do an unformatted save so spell gets the right info
!     set path /tmp/exmh.s[pid].[file tail $t]
      SeditSaveBody $t $path
  
      switch -- $sedit(spell) {
--- 435,441 ----
  	return
      }
      # Do an unformatted save so spell gets the right info
!     set path [Env_Tmp]/exmh.s[pid].[file tail $t]
      SeditSaveBody $t $path
  
      switch -- $sedit(spell) {
***************
*** 409,415 ****
      if [string match exmh-async* $prog] {
  	# exmh-async isn't really right
  	# craft a wish script instead
! 	set script /tmp/exmh.w[pid].[file tail $t]
  	if [catch {open $script w} out] {
  	    Exmh_Status $out
  	    return 0
--- 446,452 ----
      if [string match exmh-async* $prog] {
  	# exmh-async isn't really right
  	# craft a wish script instead
! 	set script [Env_Tmp]/exmh.w[pid].[file tail $t]
  	if [catch {open $script w} out] {
  	    Exmh_Status $out
  	    return 0
***************
*** 481,486 ****
--- 518,524 ----
  proc SeditGuessContentType { filename } {
      global mimeType
  
+     set filename [string tolower $filename]
      if [catch {mailcap_guess_content_type $filename} type] {
  	if ![info exists mimeType] {
  	    SeditLoadMimeTypes
***************
*** 550,557 ****
          }
  	SeditDirty $t	;# force abort check
      }
! 
!     Msg_Clip $mhProfile(draft-folder) [SeditId $draft]
  }
  
  proc Sedit_Mailto { url } {
--- 588,601 ----
          }
  	SeditDirty $t	;# force abort check
      }
!     set id [SeditId $draft]
!     if [regexp {^[0-9]+$} $id] {
! 	set f $mhProfile(draft-folder)
!     } else {
! 	set f [file dirname $id]
! 	set id [file tail $id]
!     }
!     Msg_Clip $f $id
  }
  
  proc Sedit_Mailto { url } {
***************
*** 567,573 ****
  
      set format $sedit($t,format)
      set sedit($t,format) 0
!     SeditSave $draft $t
      set sedit($t,format) $format
  
      set env(mhdraft) $draft
--- 611,621 ----
  
      set format $sedit($t,format)
      set sedit($t,format) 0
!     if [catch {SeditSave $draft $t} err] {
! 	SeditMsg $t $err
! 	set sedit($t,format) $format
! 	return
!     }
      set sedit($t,format) $format
  
      set env(mhdraft) $draft
EOF-EOF-EOF
Patch lib/seditMime.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/seditMime.tcl	Wed Sep 27 11:29:16 1995
--- exmh-1.6.5/lib/seditMime.tcl	Wed Nov  8 15:43:41 1995
***************
*** 224,230 ****
      # we will be inserting new headers (Content-Type, etc.)
  
      $t insert header "\nMime-Version: 1.0"
!     $t mark set header "header + 1c"
      set h [$t index header]		;# for headerOrig
  
      if {! $promote} {
--- 224,237 ----
      # we will be inserting new headers (Content-Type, etc.)
  
      $t insert header "\nMime-Version: 1.0"
!     global tk_version
!     if {(($tk_version >= 4.0) && [$t compare header == "end -1c"]) ||
! 	(($tk_version < 4.0) && [$t compare header == "end"])} {
! 	# Nothing left after deleting the body
! 	$t insert header "\n"
!     } else {
! 	$t mark set header "header + 1c"
!     }
      set h [$t index header]		;# for headerOrig
  
      if {! $promote} {
***************
*** 362,368 ****
      # Wrap up text between mark and mark2 in a multipart structure.
      # Return the text index just after the new Content-Type header
      #
!     Exmh_Debug SeditMultiInner level=$level $mark $mark2
      if {[string length $level] == 0} {
  	set level 0
      } else {
--- 369,375 ----
      # Wrap up text between mark and mark2 in a multipart structure.
      # Return the text index just after the new Content-Type header
      #
!     Exmh_Debug SeditMultiInner level=$level $mark [$t index $mark] $mark2
      if {[string length $level] == 0} {
  	set level 0
      } else {
***************
*** 376,382 ****
      set origin [$t index $mark]
      $t insert $mark "Content-Type: $type ;\n\tboundary=\"$boundary\"\n"
      set h [$t index $mark]
!     Exmh_Debug SeditMultiInner $mark at $h
  
      # Insert the terminating --boundary-- line and set multiN.next to be
      # just before that --boundary-- line.
--- 383,389 ----
      set origin [$t index $mark]
      $t insert $mark "Content-Type: $type ;\n\tboundary=\"$boundary\"\n"
      set h [$t index $mark]
!     Exmh_Debug SeditMultiInner origin at $origin $mark at $h
  
      # Insert the terminating --boundary-- line and set multiN.next to be
      # just before that --boundary-- line.
***************
*** 500,505 ****
--- 507,513 ----
      } else {
  	set charset us-ascii
      }
+     Exmh_Debug SeditFixupCharset $charset
      foreach range [FtocMakePairs [$t tag ranges Charset]] {
  	set start [lindex $range 0]
  	set end [$t index "$start lineend"]
EOF-EOF-EOF
Patch lib/seditQP.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/seditQP.tcl	Tue Apr 18 17:34:49 1995
--- exmh-1.6.5/lib/seditQP.tcl	Tue Oct 17 12:45:57 1995
***************
*** 53,75 ****
      }
      if {$quote} {
  	SeditMsg $t "Quoting text"
      } else {
  	SeditMsg $t "8-bit encoding"
      }
      set state header
      set done 0
      set needCoder 0
      set type text
      set boundaries {}
      for {set len [gets $in line]} {$len >= 0} {set len [gets $in line]} {
  	if {$state == "header"} {
  	    if [regexp -nocase content-transfer-encoding $line] {
  		set done 1
  	    }
  	    if [regexp -nocase {content-type:(.*)$} $line match type] {
! 
  		set params [split $type \;]
  		set type [string tolower [string trim [lindex $params 0]]]
  		foreach sub [lrange $params 1 end] {
  		    if [regexp {([^=]+)=(.+)} $sub match key val] {
  			set key [string trim [string tolower $key]]
--- 53,88 ----
      }
      if {$quote} {
  	SeditMsg $t "Quoting text"
+ 	Exmh_Debug Quoting text
      } else {
  	SeditMsg $t "8-bit encoding"
+ 	Exmh_Debug 8-bit encoding
      }
      set state header
      set done 0
      set needCoder 0
      set type text
+     set typeActive 0
      set boundaries {}
      for {set len [gets $in line]} {$len >= 0} {set len [gets $in line]} {
  	if {$state == "header"} {
  	    if [regexp -nocase content-transfer-encoding $line] {
+ 		Exmh_Debug coding already done
  		set done 1
  	    }
+ 	    if {[regexp "^\[ \t]" $line] && $typeActive} {
+ 		append type $line
+ 	    }
  	    if [regexp -nocase {content-type:(.*)$} $line match type] {
! 		set typeActive 1
! 	    } else {
! 		set typeActive 0
! 	    }
! 	    if {$len == 0 || [regexp ^-- $line]} {
! 		set state body
  		set params [split $type \;]
  		set type [string tolower [string trim [lindex $params 0]]]
+ 		Exmh_Debug type $type
  		foreach sub [lrange $params 1 end] {
  		    if [regexp {([^=]+)=(.+)} $sub match key val] {
  			set key [string trim [string tolower $key]]
***************
*** 80,90 ****
  			}
  		    }
  		}
- 	    }
- 	    if {$len == 0 || [regexp ^-- $line]} {
- 		set state body
  		if {! $done && [regexp -nocase text $type]} {
  		    set needCoder 1
  		}
  	    }
  
--- 93,101 ----
  			}
  		    }
  		}
  		if {! $done && [regexp -nocase text $type]} {
  		    set needCoder 1
+ 		    Exmh_Debug needCoder $type
  		}
  	    }
  
***************
*** 108,120 ****
--- 119,135 ----
  			set done 1
  		    } else {
  			set state header
+ 			set typeActive 0
+ 			set type text
  			set done 0
  		    }
  		    set needCoder 0
+ 		    Exmh_Debug no coder $line
  		}
  	    }
  	    if {$needCoder} {
  		set needCoder 0
+ 		Exmh_Debug coding
  		if {$quote} {
  		    puts $out "Content-Transfer-Encoding: quoted-printable"
  		    puts $out $savedLine
***************
*** 158,164 ****
  	    set x [expr [lindex $special 1]+1]
  	    set word [eval {string range $line} $word]
  	    set special [eval {string range $line} $special]
- 	    Exmh_Debug word($word) special($special)
  	    if {[string length $special] == 0} {
  		set line {}
  	    } else {
--- 173,178 ----
EOF-EOF-EOF
Patch lib/select.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/select.tcl	Mon Sep 11 11:44:58 1995
--- exmh-1.6.5/lib/select.tcl	Thu Oct 12 13:34:59 1995
***************
*** 46,56 ****
  proc Select_EntryBind { w } {
      global select
      set select(entry) $w
!     Widget_Bindtags $w Entry
      bind $w <Any-Key>	{SelectTypein %W %A}
      bind $w <Key-plus>	{SelectToggle %W }
      bind $w <space>	{SelectComplete %W}
      bind $w <Return>	{SelectReturn %W}
      bind $w <Control-h>	{SelectBackSpace %W}
      bind $w <Delete>	{SelectBackSpace %W}
      bind $w <Control-c>	{SelectCancel %W}
--- 46,57 ----
  proc Select_EntryBind { w } {
      global select
      set select(entry) $w
!     Widget_Bindtags $w [list $w Entry]
      bind $w <Any-Key>	{SelectTypein %W %A}
      bind $w <Key-plus>	{SelectToggle %W }
      bind $w <space>	{SelectComplete %W}
      bind $w <Return>	{SelectReturn %W}
+     bind $w <BackSpace>	{SelectBackSpace %W}
      bind $w <Control-h>	{SelectBackSpace %W}
      bind $w <Delete>	{SelectBackSpace %W}
      bind $w <Control-c>	{SelectCancel %W}
EOF-EOF-EOF
Patch lib/sound.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/sound.tcl	Thu Sep 28 15:14:26 1995
--- exmh-1.6.5/lib/sound.tcl	Thu Oct 12 10:30:15 1995
***************
*** 65,71 ****
  }
  
  proc Sound_Error {  } {
!     global sound
      if {!$sound(enabled) || ($sound(cmd) == {})} {
  	return
      }
--- 65,71 ----
  }
  
  proc Sound_Error {  } {
!     global sound exmh
      if {!$sound(enabled) || ($sound(cmd) == {})} {
  	return
      }
EOF-EOF-EOF
Patch lib/tclIndex<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/tclIndex	Tue Oct 10 15:03:42 1995
--- exmh-1.6.5/lib/tclIndex	Fri Dec  8 11:14:14 1995
***************
*** 138,143 ****
--- 138,146 ----
  set auto_index(FacePathlist) "source $dir/faces.tcl"
  set auto_index(Face_Delete) "source $dir/faces.tcl"
  set auto_index(FaceAlloc) "source $dir/faces.tcl"
+ set auto_index(Face_BusyParent) "source $dir/faces.tcl"
+ set auto_index(Face_BusyPlace) "source $dir/faces.tcl"
+ set auto_index(Face_BusyDestroy) "source $dir/faces.tcl"
  set auto_index(Face_ShowFace) "source $dir/faces.tcl"
  set auto_index(Face_ShowFile) "source $dir/faces.tcl"
  set auto_index(FaceShowFile) "source $dir/faces.tcl"
***************
*** 600,605 ****
--- 603,609 ----
  set auto_index(PgpMatch_Email) "source $dir/pgpMatch.tcl"
  set auto_index(PgpMatch_Simple) "source $dir/pgpMatch.tcl"
  set auto_index(Pgp_FlatKeyList) "source $dir/pgpMatch.tcl"
+ set auto_index(PgpMatch_UnflattenKeyList) "source $dir/pgpMatch.tcl"
  set auto_index(PgpMatch_InitialKeyList) "source $dir/pgpMatch.tcl"
  set auto_index(Pgp_KeyBox) "source $dir/pgpMatch.tcl"
  set auto_index(keybox.ok.cmd) "source $dir/pgpMatch.tcl"
***************
*** 607,613 ****
  set auto_index(keybox.list.cmd) "source $dir/pgpMatch.tcl"
  set auto_index(PgpMatch_CheckPoint) "source $dir/pgpMatch.tcl"
  set auto_index(Flist_Init) "source $dir/flist.tcl"
! set auto_index(FlistInitVars) "source $dir/flist.tcl"
  set auto_index(FlistTraceUnseen) "source $dir/flist.tcl"
  set auto_index(FlistTraceUnvisited) "source $dir/flist.tcl"
  set auto_index(Flist_Refresh) "source $dir/flist.tcl"
--- 611,618 ----
  set auto_index(keybox.list.cmd) "source $dir/pgpMatch.tcl"
  set auto_index(PgpMatch_CheckPoint) "source $dir/pgpMatch.tcl"
  set auto_index(Flist_Init) "source $dir/flist.tcl"
! set auto_index(FlistResetVars) "source $dir/flist.tcl"
! set auto_index(FlistTraceNewMsgs) "source $dir/flist.tcl"
  set auto_index(FlistTraceUnseen) "source $dir/flist.tcl"
  set auto_index(FlistTraceUnvisited) "source $dir/flist.tcl"
  set auto_index(Flist_Refresh) "source $dir/flist.tcl"
***************
*** 621,636 ****
  set auto_index(Flist_SubFolders) "source $dir/flist.tcl"
  set auto_index(Flist_FolderSet) "source $dir/flist.tcl"
  set auto_index(FlistSeq) "source $dir/flist.tcl"
  set auto_index(Flist_UnseenUpdate) "source $dir/flist.tcl"
  set auto_index(Flist_UnseenMsgs) "source $dir/flist.tcl"
  set auto_index(Flist_NumUnseen) "source $dir/flist.tcl"
  set auto_index(Flist_UnseenFolders) "source $dir/flist.tcl"
- set auto_index(FlistReset) "source $dir/flist.tcl"
- set auto_index(FlistResetUnseen) "source $dir/flist.tcl"
- set auto_index(Flist_AddUnseen) "source $dir/flist.tcl"
- set auto_index(FlistKeepUnseens) "source $dir/flist.tcl"
- set auto_index(Flist_UpdateUnseen) "source $dir/flist.tcl"
- set auto_index(Flist_Done) "source $dir/flist.tcl"
  set auto_index(Flist_FindUnseen) "source $dir/flist.tcl"
  set auto_index(FlistFindStart) "source $dir/flist.tcl"
  set auto_index(FlistFindUnseen) "source $dir/flist.tcl"
--- 626,637 ----
  set auto_index(Flist_SubFolders) "source $dir/flist.tcl"
  set auto_index(Flist_FolderSet) "source $dir/flist.tcl"
  set auto_index(FlistSeq) "source $dir/flist.tcl"
+ set auto_index(Flist_AddUnseen) "source $dir/flist.tcl"
+ set auto_index(Flist_Done) "source $dir/flist.tcl"
  set auto_index(Flist_UnseenUpdate) "source $dir/flist.tcl"
  set auto_index(Flist_UnseenMsgs) "source $dir/flist.tcl"
  set auto_index(Flist_NumUnseen) "source $dir/flist.tcl"
  set auto_index(Flist_UnseenFolders) "source $dir/flist.tcl"
  set auto_index(Flist_FindUnseen) "source $dir/flist.tcl"
  set auto_index(FlistFindStart) "source $dir/flist.tcl"
  set auto_index(FlistFindUnseen) "source $dir/flist.tcl"
***************
*** 703,710 ****
--- 704,723 ----
  set auto_index(PsByID) "source $dir/ps.tcl"
  set auto_index(PsByName) "source $dir/ps.tcl"
  set auto_index(PsTest) "source $dir/ps.tcl"
+ set auto_index(Select_Bindings) "source $dir/select.tcl"
+ set auto_index(SelectPlus) "source $dir/select.tcl"
+ set auto_index(SelectDigit) "source $dir/select.tcl"
+ set auto_index(Select_EntryBind) "source $dir/select.tcl"
+ set auto_index(SelectTypein) "source $dir/select.tcl"
+ set auto_index(SelectBackSpace) "source $dir/select.tcl"
+ set auto_index(SelectToggle) "source $dir/select.tcl"
+ set auto_index(SelectComplete) "source $dir/select.tcl"
+ set auto_index(SelectReturn) "source $dir/select.tcl"
+ set auto_index(SelectCancel) "source $dir/select.tcl"
+ set auto_index(SelectClear) "source $dir/select.tcl"
  set auto_index(Report_Bug) "source $dir/report.tcl"
  set auto_index(Report_Registration) "source $dir/report.tcl"
+ set auto_index(Report_Subscribe) "source $dir/report.tcl"
  set auto_index(Rich_Init) "source $dir/rich2tk.tcl"
  set auto_index(Rich_Display) "source $dir/rich2tk.tcl"
  set auto_index(Rich_DisplayString) "source $dir/rich2tk.tcl"
***************
*** 857,873 ****
  set auto_index(SeditInitMimeType) "source $dir/seditQP.tcl"
  set auto_index(SeditFixupEncoding) "source $dir/seditQP.tcl"
  set auto_index(SeditQuoteHeader) "source $dir/seditQP.tcl"
- set auto_index(Select_Bindings) "source $dir/select.tcl"
- set auto_index(SelectPlus) "source $dir/select.tcl"
- set auto_index(SelectDigit) "source $dir/select.tcl"
- set auto_index(Select_EntryBind) "source $dir/select.tcl"
- set auto_index(SelectTypein) "source $dir/select.tcl"
- set auto_index(SelectBackSpace) "source $dir/select.tcl"
- set auto_index(SelectToggle) "source $dir/select.tcl"
- set auto_index(SelectComplete) "source $dir/select.tcl"
- set auto_index(SelectReturn) "source $dir/select.tcl"
- set auto_index(SelectCancel) "source $dir/select.tcl"
- set auto_index(SelectClear) "source $dir/select.tcl"
  set auto_index(Sound_Off) "source $dir/sound.tcl"
  set auto_index(Sound_On) "source $dir/sound.tcl"
  set auto_index(Sound_Feedback) "source $dir/sound.tcl"
--- 870,875 ----
***************
*** 1008,1022 ****
  set auto_index(WidgetGetResources) "source $dir/widgets.tcl"
  set auto_index(WidgetResListSubtract) "source $dir/widgets.tcl"
  set auto_index(Xns_GetMail) "source $dir/xns.tcl"
- set auto_index(MimeSunInit) "source $dir/mimeSun.tcl"
- set auto_index(MimeSunAttachment) "source $dir/mimeSun.tcl"
- set auto_index(Mime_ShowShellScript) "source $dir/mimeSun.tcl"
- set auto_index(MimeSunViewScript) "source $dir/mimeSun.tcl"
- set auto_index(MimeSunHideScript) "source $dir/mimeSun.tcl"
- set auto_index(Mime_ShowSunCalendar) "source $dir/mimeSun.tcl"
- set auto_index(MimeSunAppointment) "source $dir/mimeSun.tcl"
- set auto_index(MimeSunAppSelection) "source $dir/mimeSun.tcl"
- set auto_index(MimeSunAppInner) "source $dir/mimeSun.tcl"
  set auto_index(Exwin_Init) "source $dir/exwin.tcl"
  set auto_index(ExwinFixupFtextLines) "source $dir/exwin.tcl"
  set auto_index(Exwin_Layout) "source $dir/exwin.tcl"
--- 1010,1015 ----
***************
*** 1036,1041 ****
--- 1029,1043 ----
  set auto_index(Exwin_Grab) "source $dir/exwin.tcl"
  set auto_index(Exwin_CheckPoint) "source $dir/exwin.tcl"
  set auto_index(Exwin_ClearCheckPoint) "source $dir/exwin.tcl"
+ set auto_index(MimeSunInit) "source $dir/mimeSun.tcl"
+ set auto_index(MimeSunAttachment) "source $dir/mimeSun.tcl"
+ set auto_index(Mime_ShowShellScript) "source $dir/mimeSun.tcl"
+ set auto_index(MimeSunViewScript) "source $dir/mimeSun.tcl"
+ set auto_index(MimeSunHideScript) "source $dir/mimeSun.tcl"
+ set auto_index(Mime_ShowSunCalendar) "source $dir/mimeSun.tcl"
+ set auto_index(MimeSunAppointment) "source $dir/mimeSun.tcl"
+ set auto_index(MimeSunAppSelection) "source $dir/mimeSun.tcl"
+ set auto_index(MimeSunAppInner) "source $dir/mimeSun.tcl"
  set auto_index(Glimpse_Startup) "source $dir/glimpse.tcl"
  set auto_index(Glimpse_Search) "source $dir/glimpse.tcl"
  set auto_index(Glimpse_SearchInner) "source $dir/glimpse.tcl"
***************
*** 1062,1064 ****
--- 1064,1068 ----
  set auto_index(MsgShow) "source $dir/msgShow.tcl"
  set auto_index(MsgShowInText) "source $dir/msgShow.tcl"
  set auto_index(MsgParseFrom) "source $dir/msgShow.tcl"
+ set auto_index(Env_Init) "source $dir/env.tcl"
+ set auto_index(Env_Tmp) "source $dir/env.tcl"
EOF-EOF-EOF
Patch lib/textSelect.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/textSelect.tcl	Wed Sep 27 09:57:52 1995
--- exmh-1.6.5/lib/textSelect.tcl	Thu Dec  7 14:29:26 1995
***************
*** 136,145 ****
  
  # Return the current selection (from any window) or cut buffer 0.
  proc Text_Selection {} {
!     set sel ""
!     catch {set sel [selection get]}
!     if {[string length $sel] == 0} {
! 	catch {set sel [cutbuffer get 0]}
      }
      return $sel
  }
--- 136,147 ----
  
  # Return the current selection (from any window) or cut buffer 0.
  proc Text_Selection {} {
!     if [catch {selection get} sel] {
! 	if [catch {selection get -selection CLIPBOARD} sel] {
! 	    if [catch {cutbuffer get 0} sel] {
! 		return ""
! 	    }
! 	}
      }
      return $sel
  }
***************
*** 154,159 ****
--- 156,162 ----
  	set TextType($w) text
      }
      set st [$w index $start]
+     set tags [$w tag names $st]		;# Hack to save tags
      if {[string length $end] == 0} {
  	set e [$w index "$start + 1c"]
      } else {
***************
*** 184,189 ****
--- 187,196 ----
  	    $w delete $st $e
  	}
      }
+     # This hack supports the tags used in sedit to label parts of multiparts
+     foreach tag $tags {
+ 	$w tag add $tag $st "$st lineend +1c"
+     }
  }
  
  # Do kill buffer processing.  If addkill is true, then add to the kill ring
***************
*** 284,292 ****
  }
  
  proc Text_Yank { w } {
!     global tk_priv
      set sel [Text_Selection]
      if {[string length $sel] != 0} {
  	set start [$w index insert]
  	Text_Insert $w insert $sel
  	$w yview -pickplace insert
--- 291,303 ----
  }
  
  proc Text_Yank { w } {
!     global tk_priv sedit
      set sel [Text_Selection]
      if {[string length $sel] != 0} {
+ 	# check for 8bit characters in the selection
+ 	if [regexp "\[\x80-\xff\]" $sel] {
+ 	    set sedit($w,8bit) 1
+ 	}
  	set start [$w index insert]
  	Text_Insert $w insert $sel
  	$w yview -pickplace insert
EOF-EOF-EOF
Patch lib/uri.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/lib/uri.tcl	Mon Oct  9 09:56:25 1995
--- exmh-1.6.5/lib/uri.tcl	Thu Dec  7 09:39:08 1995
***************
*** 52,64 ****
  get a text/html MIME part, choose this.  Otherwise you must
  ask for the browser to be started for each text/html part."}
  	{uri(mosaicApp) uriMosaicApp	{Mosaic} {Mosaic program name}
! "This is the application which exmh will launch when you press a
! URL button or on a hyperlink in the body of a message.
! The variable \$xuri gets replaced with the URL."}
  	{uri(viewerApp) uriViewerApp	{Mosaic $xuri} {Other URL Viewer}
! "This is the application which exmh will launch when you press a
! URL button or on a hyperlink in the body of a message.
! The varialbe \$xuri gets replaced with the URL."}
  	{uri(logOnEnter) uriLogOnEnter	ON	{Show selected URL}
  "With 'Show selected URL' enabled exmh will display
  the coresponding URL if you move with the mouse on an
--- 52,65 ----
  get a text/html MIME part, choose this.  Otherwise you must
  ask for the browser to be started for each text/html part."}
  	{uri(mosaicApp) uriMosaicApp	{Mosaic} {Mosaic program name}
! "This is the name of the binary program that corresponds to the
! Mosaic viewer option.  For example, some sites use \"xmosaic\"."}
! 	{uri(netscapeFlags) uriNetscapeFlags	{-install} {Netscape flags}
! "These are additional flags passed to netscape when it starts up.
! The -install flag makes it use a private colormap."}
  	{uri(viewerApp) uriViewerApp	{Mosaic $xuri} {Other URL Viewer}
! "This is the command line used if you select the \"other\" browser option.
! The variable \$xuri gets replaced with the URL."}
  	{uri(logOnEnter) uriLogOnEnter	ON	{Show selected URL}
  "With 'Show selected URL' enabled exmh will display
  the coresponding URL if you move with the mouse on an
***************
*** 88,96 ****
  	switch -- $uri(viewer) {
  	    Mosaic	{ Mosaic_Load $xuri}
  	    netscape {
! 		if [ catch { exec netscape -remote openURL($xuri) } tmp ] {
  		    if { [ string first "not running on" $tmp ] != -1 } {
! 		        exec netscape $xuri &
  		        Exmh_Status "Starting netscape"
                      }
  		}
--- 89,97 ----
  	switch -- $uri(viewer) {
  	    Mosaic	{ Mosaic_Load $xuri}
  	    netscape {
! 		if [ catch { eval {exec netscape} $uri(netscapeFlags) {-remote openURL($xuri)} } tmp ] {
  		    if { [ string first "not running on" $tmp ] != -1 } {
! 		        eval {exec netscape} $uri(netscapeFlags) { $xuri & }
  		        Exmh_Status "Starting netscape"
                      }
  		}
***************
*** 208,214 ****
      Exmh_Debug "URI_ScanMsg $limit"
      set multiline 0
      set hit 0
!     set protocol (ftp|http|gopher|nntp|telnet|wais|file|prospero|finger|urn|mailto|news|solo|x500)
  
      for {set i 0} {[$w compare $i.0 < $limit]} {if {! $hit} {incr i}} {
  	if {! $hit} {
--- 209,215 ----
      Exmh_Debug "URI_ScanMsg $limit"
      set multiline 0
      set hit 0
!     set protocol (ftp|http|https|gopher|nntp|telnet|wais|file|prospero|finger|urn|mailto|news|solo|x500)
  
      for {set i 0} {[$w compare $i.0 < $limit]} {if {! $hit} {incr i}} {
  	if {! $hit} {
***************
*** 302,308 ****
  	    set hit 1
  
          } elseif {[regexp -indices -nocase \
!  "(ftp|http|gopher|nntp|telnet|wais|file|prospero|finger)://\[^ \n\t\]+\[^ \n\t,\.\)>\"\]" \
  		$text indices] == 1} {
  	    # check for unencapsulated URIs by protocol if no < > present
  	    Exmh_Debug Regexp4 $indices
--- 303,309 ----
  	    set hit 1
  
          } elseif {[regexp -indices -nocase \
!  "(ftp|http|https|gopher|nntp|telnet|wais|file|prospero|finger)://\[^ \n\t\]+\[^ \n\t,\.\)>\"\]" \
  		$text indices] == 1} {
  	    # check for unencapsulated URIs by protocol if no < > present
  	    Exmh_Debug Regexp4 $indices
EOF-EOF-EOF
Patch misc/unseenwin.tcl<<'EOF-EOF-EOF'
*** exmh-1.6.4/misc/unseenwin.tcl	Tue Jun 13 17:26:11 1995
--- exmh-1.6.5/misc/unseenwin.tcl	Thu Oct 26 09:58:59 1995
***************
*** 86,94 ****
  Note; if \"Hide When Empty\" is on, this option has no use."
      }
  
!     { unseenwin(clickmode) unseenWinClickMode
        {CHOICE None Raise Warp {Warp & Show}}
!       {Click Mode}
  "The behaviour when you click on the unseen window depends
  on this setting.
  
--- 86,94 ----
  Note; if \"Hide When Empty\" is on, this option has no use."
      }
  
!     { unseenwin(b1mode) unseenWinButton1
        {CHOICE None Raise Warp {Warp & Show}}
!       {Button 1 Mode}
  "The behaviour when you click on the unseen window depends
  on this setting.
  
***************
*** 99,107 ****
  Warp & Show: Warp then select the first unseen message"
      }
  
!     { unseenwin(mclickmode) unseenWinModifiedClickMode
        {CHOICE None Raise Warp {Warp & Show}}
!       {Modified Click Mode}
  "The behaviour when you shift-click, control-click or
  shift-contol-click on the unseen window depends
  on this setting.
--- 99,107 ----
  Warp & Show: Warp then select the first unseen message"
      }
  
!     { unseenwin(mb1mode) unseenWinModifiedButton1
        {CHOICE None Raise Warp {Warp & Show}}
!       {Modified Button 1 Mode}
  "The behaviour when you shift-click, control-click or
  shift-contol-click on the unseen window depends
  on this setting.
***************
*** 112,117 ****
--- 112,127 ----
  Warp:        Raise then change to the folder clicked on
  Warp & Show: Warp then select the first unseen message"
      }
+ 
+     { unseenwin(b3mode) unseenWinButton3
+       {CHOICE Nothing Compose}
+       {Button 3 Mode}
+ "The behaviour when you press mouse button 3 depends on
+ this setting.
+ 
+ Nothing:     Does nothing
+ Compose:     Starts a mail composition"
+     }
    }
  
    trace variable unseenwin(on)            w UnseenWinToggle
***************
*** 122,128 ****
    foreach v {minlines maxlines minwidth maxwidth} {
      trace variable unseenwin($v) w UnseenWinChangeMinMax
    }
!   foreach v {clickmode mclickmode} {
      trace variable unseenwin($v) w UnseenWinToggleClick
    }
  
--- 132,138 ----
    foreach v {minlines maxlines minwidth maxwidth} {
      trace variable unseenwin($v) w UnseenWinChangeMinMax
    }
!   foreach v {b1mode mb1mode} {
      trace variable unseenwin($v) w UnseenWinToggleClick
    }
  
***************
*** 169,183 ****
      UnseenWinSetGeom $unseenwin(minwidth) $unseenwin(minlines)
      pack .unseen.lb -fill both
  
!     bind .unseen.lb <1> {UnseenWinClick %y clickmode}
      foreach b { Shift-1 Control-1 Control-Shift-1 } {
!       bind .unseen.lb <$b> {UnseenWinClick %y mclickmode}
      }
      foreach b { B1-Motion Shift-B1-Motion Control-B1-Motion
                  2 B2-Motion
                  3 B3-Motion Control-3 Control-Shift-3 } {
        bind .unseen.lb <$b> {;}
!    }
  
      UnseenWinToggleIcon
      UnseenWinToggleClick
--- 179,195 ----
      UnseenWinSetGeom $unseenwin(minwidth) $unseenwin(minlines)
      pack .unseen.lb -fill both
  
!     bind .unseen.lb <1> {UnseenWinClick %y b1mode}
      foreach b { Shift-1 Control-1 Control-Shift-1 } {
!       bind .unseen.lb <$b> {UnseenWinClick %y mb1mode}
      }
      foreach b { B1-Motion Shift-B1-Motion Control-B1-Motion
                  2 B2-Motion
                  3 B3-Motion Control-3 Control-Shift-3 } {
        bind .unseen.lb <$b> {;}
!     }
!     bind .unseen.lb <ButtonPress-3> {UnseenWinButton3 press %X %Y}
!     bind .unseen.lb <Any-ButtonRelease-3> {UnseenWinButton3 release}
  
      UnseenWinToggleIcon
      UnseenWinToggleClick
***************
*** 207,224 ****
   proc UnseenWinTrace {array elem op} {
    global flist unseenwin
  
!   if {[scan $elem "new,%s" folder] != 1} {
!     return
    }
-   set num $flist($elem)
-   set index [lsearch $unseenwin(folders) $folder]
-   if {$num == 0} {
-     UnseenWinRemove $index $folder
-   } elseif {$index == -1} {
-     UnseenWinAdd $folder $num
-   } else {
-     UnseenWinShow $index 1 $folder $num
-   }
  }
  
   proc UnseenWinShow {index delete folder count} {
--- 219,242 ----
   proc UnseenWinTrace {array elem op} {
    global flist unseenwin
  
!   catch {
!     if {[scan $elem "new,%s" folder] != 1} {
!       return
!     }
!     set num $flist($elem)
!     set index [lsearch $unseenwin(folders) $folder]
!     if {$index == -1} {
!       if {$num > 0} {
!         UnseenWinAdd $folder $num
!       }
!     } else {
!       if {$num == 0} {
!         UnseenWinRemove $index $folder
!       } else {
!         UnseenWinShow $index 1 $folder $num
!       }
!     }
    }
  }
  
   proc UnseenWinShow {index delete folder count} {
***************
*** 378,385 ****
    global unseenwin tk_version
  
    if [winfo exists .unseen] {
!     if {[string match "W*" $unseenwin(clickmode)] ||
!         [string match "W*" $unseenwin(mclickmode)]} {
        bind .unseen.lb <Leave> {UnseenWinSetSelection}
        bind .unseen.lb <Motion> {UnseenWinMove %y}
      } else {
--- 396,403 ----
    global unseenwin tk_version
  
    if [winfo exists .unseen] {
!     if {[string match "W*" $unseenwin(b1mode)] ||
!         [string match "W*" $unseenwin(mb1mode)]} {
        bind .unseen.lb <Leave> {UnseenWinSetSelection}
        bind .unseen.lb <Motion> {UnseenWinMove %y}
      } else {
***************
*** 485,488 ****
--- 503,521 ----
    wm deiconify .
    raise .
    update idletasks
+ }
+ 
+  proc UnseenWinButton3 {action {x 0} {y 0}} {
+   global unseenwin
+ 
+   switch $unseenwin(b3mode) {
+     Nothing {
+       return
+     }
+     Compose {
+       if {[string compare $action release] == 0} {
+         Msg_Compose
+       }
+     }
+   }
  }
EOF-EOF-EOF
RmFile misc/unseenwin-flist.patch
NewDir html
NewFile html/exmh-custom.html<<'EOF-EOF-EOF'
<!-- manual page source format generated by RosettaMan, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<HTML>
<HEAD>
<TITLE>Exmh Customization Guide</TITLE>
</HEAD>
<BODY>
<A NAME="sect0" HREF="#toc0"><H2>EXMH-CUSTOM</H2></A>
A guide to customizing the exmh mail user interface.<P>
<A NAME="toc"><B>Table of Contents</B></A>
<UL>
<LI><A NAME="toc1" HREF="#sect1">CUSTOMIZING EXMH</A></LI>
<LI><A NAME="toc2" HREF="#sect2">PREFERENCES</A></LI>
<LI><A NAME="toc3" HREF="#sect3">PREFERENCE SECTIONS</A></LI>
<LI><A NAME="toc4" HREF="#sect4">BINDING UI</A></LI>
<LI><A NAME="toc5" HREF="#sect5">MH PROFILE</A></LI>
<LI><A NAME="toc6" HREF="#sect6">X RESOURCES</A></LI>
<LI><A NAME="toc7" HREF="#sect7">WIDGET CLASS HIERARCHY</A></LI>
<LI><A NAME="toc8" HREF="#sect8">RESOURCES FOR BUTTONS</A></LI>
<LI><A NAME="toc9" HREF="#sect9">RESOURCES FOR MENUS</A></LI>
<LI><A NAME="toc10" HREF="#sect10">BUTTON GROUPS</A></LI>
<LI><A NAME="toc11" HREF="#sect11">COLOR RESOURCES</A></LI>
<LI><A NAME="toc12" HREF="#sect12">COLORIZING HEADERS</A></LI>
<LI><A NAME="toc13" HREF="#sect13">GEOMETRY AND POSITION RESOURCES</A></LI>
<LI><A NAME="toc14" HREF="#sect14">ICON POSIITONS</A></LI>
<LI><A NAME="toc15" HREF="#sect15">ICON APPEARANCE</A></LI>
<LI><A NAME="toc16" HREF="#sect16">FOLDER DISPLAY RESOURCES</A></LI>
<LI><A NAME="toc17" HREF="#sect17">MIME RESOURCES</A></LI>
<LI><A NAME="toc18" HREF="#sect18">SEDIT BINDING RESOURCES</A></LI>
<LI><A NAME="toc19" HREF="#sect19">MISCELLANEOUS RESOURCES</A></LI>
<LI><A NAME="toc20" HREF="#sect20">PROGRAMMING EXMH</A></LI>
<LI><A NAME="toc21" HREF="#sect21">CODE ORGANIZATION</A></LI>
<LI><A NAME="toc22" HREF="#sect22">SEE ALSO</A></LI>
<LI><A NAME="toc23" HREF="#sect23">AUTHOR</A></LI>
<LI><A NAME="toc24" HREF="#sect24">THANKS</A></LI>
</UL>

<A NAME="sect1" HREF="#toc1"><H2><B>CUSTOMIZING</B> <B>EXMH</B></H2></A>
This man page describes the four mechanisms used to customize <I>Exmh</I>: Preferences, the MH profile, X resources, and custom Tcl code.<P>
<I>Exmh</I> is built with the assumption that you will want to customize it to some degree. The simplest way is by the Preferences user interface, which exposes numerous knobs and dials that you can adjust to control a lot of the behavior of <I>exmh</I>. The second way is by defining X resources. You will need to do this if you want to control fonts and colors. It would be great if there was a user interface for this, but this is something that has not been crossed off the TODO list, yet. You also use X resources to define new buttons and menus. The third way is by adding custom Tcl code to the implementation of <I>exmh</I>. A personal library of Tcl routines is supported. You can either add new buttons or menus to invoke your functionality, or take advantage of some hook points inside <I>exmh</I> to slip in your new feature. It is also possible to completely replace any module of the <I>exmh</I> implementation. Finally, there are a few MH profile components introduced by <I>exmh</I>, although these may eventually migrate out of the profile and into the Preferences package.<P>

<A NAME="sect2" HREF="#toc2"><H2><B>PREFERENCES</B></H2></A>
After you have used <I>exmh</I> a little, you should explore all its capabilities by clicking on the Preferences button. There is a two-level preferences scheme, mainly because there are too many knobs and dials. At the top-level you see a menu that corresponds to different modules of the implementation. Clicking on one of the items brings up the preferences items for that module. Use the Help button to display more detailed information about the preference items. If you click on the label of an item, the help text is scrolled to the information for that item.<P>
There are three types of options you can set through the Preferences dialog: choices, booleans, and general items. Each of these are tied to a Tcl variable and an X resource name. Changes in the Preference user interface change the value of the Tcl variable, which affects the <I>exmh</I> runtime behavior. Then, when you click <B>Save</B> in the dialog, the values are saved as X resource settings in your ~/.exmhdefaults file.<P>
Choices are represented by radio-style buttons where only one button in the set can be enabled at once. Changes take effect immediately. Booleans are represented by check-style buttons. If the checkbox is dark, then the option is turned on. Changes take effect immediately. Numeric and filename settings have entry widgets in which you can type in a new value. Press &lt;Return&gt; for the change to take effect immediately (or choose <B>Save</B>).<P>
You can cycle through all the preference dialogs by using the <B>Next</B> button, which takes you to the next preference section. There is also a Prev button to go back. You should take time at least once to go through all the Preference sections to get an idea of what sort of options are available.<P>
If you decide you like your settings, click <B>Save</B> in the main Preferences dialog to save them in a .exmh-defaults file in your home directory. Click <B>Reset</B> <B>All</B> in the main dialog to restore all the settings to those of your last <B>Save</B>. Within each module's preference dialog there is a <B>Reset</B> button that resets only those module's settings.<P>
<I>Warning</I>! If you click <B>Dismiss</B> in the main dialog, some preferences may have been set for the current session, but they will not have been saved to your ~/.exmh-defaults file.<P>

<A NAME="sect3" HREF="#toc3"><H2><B>PREFERENCE</B> <B>SECTIONS</B></H2></A>
Here is a short summary of the preference sections and what features they control. The Tcl module that the section corresponds to is listed so you can dig into the code if you want to.<P>
Hacking Support<BR>
 A debug log can be enabled, and you can define the directory for personal Tcl code. (main.tcl)<P>
MH Tweaks<BR>
 Background sending can be enabled. The naming convention for deleted files (leading , or #) is set. The age of files to purge can be defined. (mh.tcl)<P>
Simple Editor<BR>
 Formatting parameters can be adjusted and automatic signatures can be enabled. (sedit.tcl)<P>
Editor Support<BR>
 An external editor, spell program, and MHN command can be defined. (editor.tcl)<P>
Printing<BR>
 The print command can be defined. You can also enter an arbitrary UNIX command to apply to a message. (print.tcl)<P>
Scan Listing<BR>
 You set the number of lines in the scan listing here. There are several tweaks on message viewing: Implied Direction, Next Guard, Auto Commit, Advance After Link, Show New Messages, Skip Marked. You can also choose the scan format width here. (ftoc.tcl)<P>
MIME There are several adjustments you can make to the MIME message display. Note that the font sizes chosen here do not affect non-MIME messages. (mime.tcl)<P>
WWW Exmh can communicate with an external HTML viewer (e.g., Mosaic or netscape) in order to display pages from the World Wide Web. It can scan the current message for embedded URL. The URLs are changed into active text buttons. Click on one and the web browser is asked to display the page. Use the preferences to choose the external viewer and to control if the URL scanning is done automatically. (uri.tcl)<P>
Incorporate Mail<BR>
 The method you use to Inc can be set. You can set inc to run when you start exmh and when you open the exmh window. (inc.tcl)<P>
Windows &amp; Scrolling<BR>
 Scrolling speed and parameters related to constrained text scrolling can be defined. Constrained scrolling keeps the last line of text stuck to the bottom of the text display. (exwin.tcl and widgetText.tcl)<P>
Folder Cache<BR>
 Set how many lines are in your folder cache display, and what folders are permanently in your folder cache. (fcache.tcl)<P>
Folder Display<BR>
 Set the number of rows of labels in the folder display. The style of nested folder display is controlled here. (fdisp.tcl)<P>
Sound<BR>
 The sound effects can be controlled. (sound.tcl)<P>
Faces<BR>
 The use of the facesaver database and the decompression of X-Face components can be controlled. (faces.tcl)<P>
PGP interface<BR>
 You choose whether <I>exmh</I> can remember your pass phrase or if all PGP programs are run under an xterm instead. (pgp.tcl)<P>
Background Processing<BR>
 What actions occur in the background, and how frequently. (background.tcl)<P>
FS Box<BR>
 The file selector has a few parameters, including the threshold size for large directories and whether or not you want to see files whos names begin with a period.<P>
Busy Indicator<BR>
 What method of signaling that exmh is busy. (busy.tcl)<P>

<A NAME="sect4" HREF="#toc4"><H2><B>BINDING</B> <B>UI</B></H2></A>
There are a number of keystroke bindings already defined by <I>exmh</I> that invoke different Tcl commands. You can change the bindings and add bindings for new commands via the Bind dialog. Open the dialog from the <I>Commands</I> menu entry under the Bindings menu. The dialog presents a scrollable column of commands and their bindings, plus an area at the top to define a new binding.<P>
<B>Binding</B> <B>Syntax</B>. The following is a very brief summary of the Tk bind syntax. For the complete story, consult the Tk man page for the <I>bind</I> command. The Tk syntax for the bindings events looks like this:<P>
&lt;<I>modifier</I>-<I>type</I>-<I>detail</I>&gt;<BR>
 A <I>modifier</I> is a key that you hold down while pressing another key. The modifiers you are likely to use are listed below. Capitalization is important.<P>
Control<BR>
 Shift<BR>
 Meta<BR>
 The <I>type</I> is the event type, and it can left out if the detail part implies the type. The types you will usually use are:<P>
Key<BR>
 Button<BR>
 The <I>detail</I> specifies the key or button number for the event. Keys are named by their X keysym. For the letters and digits, the keysym is just the letter or digit, e.g., &lt;Keya&gt;, which can be shortened to &lt;a&gt;. For punctuation, however, the keysyms are words. Here are some examples, and again the Key type is left out.<P>
&lt;comma&gt;<BR>
 &lt;period&gt;<BR>
 &lt;dollar&gt;<BR>
 &lt;asciicircum&gt; &lt;question&gt;<BR>
 &lt;exclam&gt;<BR>
 Perhaps the easiest way to figure out the keysym is to use the following Tcl/Tk command. Run the Tcl/Tk shell, wish, and enter this command. Then type with the mouse over the little window it displays.<P>
bind . &lt;Any-Key&gt; {puts stdout &quot;keysym = %K letter = %A"}<P>

<A NAME="sect5" HREF="#toc5"><H2><B>MH</B> <B>PROFILE</B></H2></A>
<I>Exmh</I> uses a couple of things from your .mh_profile file, including several components that are new.<P>
Header-Suppress and Header-Display<BR>
 You control what headers are displayed in a message with a combination of the Header-Suppress and HeaderDisplay profile components. Hidden headers are just scrolled off the top of the message display window. Each of these profile components is a list of <I>regular</I> <I>expression</I> <I>patterns</I> that are used to match against the header. Case is <I>not</I> significant in the patterns. Its easiest to explain by giving the algorithm that uses these patterns.<P>
By default, show all headers.<BR>
 If a header is in the Header-Suppress list, do not show it. If a header is in the Header-Display list, show it.<P>
The default values for these profile components are:<P>
Header-Suppress: .*<BR>
 Header-Display: Subject To From Date Cc<P>
If you are a mail junky, you may want to use Header-Suppress to explicitly suppress the boring header componets you already know about. The new, interesting components inserted by random mailers will be displayed for you to check out. In contrast, the default for HeaderSuppress will hide everything, and you explicitly choose what headers you want to see by setting HeaderDisplay.<P>
Folder-Order<BR>
 The Folder-Order component defines a sort ordering for your folder labels in the folder display area. Each item in the order can be the name of a folder, or a <I>string</I> <I>match</I> pattern to match on the folder names. All folder names that match the same pattern are sorted alphabetically. Longer pattern matches have priority over shorter patterns. The patterns use the syntax of<P>
Tcl's string match function, which is similar to that used in many shells.<P>
* matches a sequence of any characters. ? matches any character.<P>
The default Folder-Order puts your inbox first.<P>
Folder-Order: inbox *<P>
My Folder-Order looks like:<P>
Folder-Order: personal exmh mxedit * mail* sun m3 mach background<P>
The other effect of Folder-Order is to define a traversal order for visiting folders with unread mail in them. When you do a Next and are at the end of a folder, <I>exmh</I> will automatically change folders to the next one in the Folder-Order that has unseen messages, if any. When there are no more folders with unseen mail, then you will change back to the first folder in your Folder-Order, unless you disable this by turning off the <I>Cycle</I> <I>back</I> <I>to</I> <I>first</I> preference setting under the Unseen Folders section.<P>
Folder-Unseen<BR>
 The Folder-Unseen component lets you constrain the search through folders for the ones with messages in the unseen message sequence. Its value is a set of <I>string</I> <I>match</I> <I>patterns</I> <I>that</I> <I>are</I> <I>matched</I> <I>against</I> <I>folder</I> <I>names</I>. <I>If</I> <I>a</I> <I>folder</I> <I>name</I> <I>matches</I> <I>the</I> <I>pattern</I>, <I>it</I> <I>is</I> <I>searched</I> <I>for</I> <I>unseen</I> <I>messages</I>. <I>If</I> <I>the</I> <I>pattern</I> <I>begins</I> <I>with</I> <I>a</I> !, <I>however</I>, <I>then</I> <I>a</I> <I>folder</I> <I>that</I> <I>matches</I> <I>the</I> <I>pat_</I>t<I>ern</I> (<I>not</I> <I>including</I> <I>the</I> !) <I>is</I> <I>excluded</I> <I>from</I> <I>the</I> <I>search</I>. <I>The</I> <I>default</I> <I>is</I> *, <I>which</I> <I>matches</I> <I>everything</I>. <I>Put</I> <I>the</I> <I>negated</I> <I>patterns</I> <I>first</I> <I>in</I> <I>your</I> <I>list</I> <I>of</I> <I>patterns</I> (<I>e</I>.<I>g</I>., !<I>junk</I>* <I>inbox</I>*).<P>
<I>Folder</I>-<I>Ignore</I><BR>
 The Folder-Ignore component specifys a set of <I>string</I> <I>match</I> patterns for folder names you want to ignore. These folders are not even displayed by exmh. It defaults to .*, which causes <I>exmh</I> to ignore all directories whose name begins with a period.<P>
Draft-Folder<BR>
 The Draft-Folder component is used to know where to put messages being composed. <I>Exmh</I> will ask you if it is ok to create a Draft-Folder entry if you do not already have one.<BR>
<P>
ExmhShowProc<BR>
 The ExmhShowProc component lets you define a program that pre-filters a message before displaying it. If an ExmhShowProc is defined, then <I>exmh</I> runs that program with the current message as the standard input and displays what is generated on the program's standard output. Note that the Header-Suppress and HeaderDisplay mechanism is still used even if you have a special show proc.<P>
Scan-Proc<BR>
 The Scan-Proc component can be used to define an alternative scan program. If you change the scan format, you need to make sure that the first item on each scan line is the message number. <I>Exmh</I> depends on this. (It makes no attempt to decipher scan formats.)<P>
MailDrop<BR>
 The MailDrop component is required if you do not have your system mail spool file in the &quot;standard&quot; location, which is typically /usr/spool/mail/<I>username</I>. If you do not define MailDrop correctly then Inc will not do anything because it will not file your new messages in the system spool file.<P>
Path The Path component is used to find your mail folders. <I>Exmh</I> will abort if this entry is not there on the presumption that you have not set yourself up to use MH properly.<P>

<A NAME="sect6" HREF="#toc6"><H2><B>X</B> <B>RESOURCES</B></H2></A>
The X resource database is used as a repository of Preference settings, window positions, and definitions of fonts, colors, buttons, and menus. The information in the database can come from a variety of sources, which can be confusing. The default values come from the <B>app-defaults</B> file that is kept in the script library directory for <I>exmh</I>. Colorspecific resources are contained in the app-defaults-color or app-defaults-mono file. One of these two is used depending on the display.<P>
A site administrator can add local resource specifications in the local-app-defaults file. Put this into the exmh script library directory (the same place as app-defaults). To handle site-specific color-specific resources, <I>exmh</I> will also read the local.app-defaults-color or local.appdefaults-mono if those files exist.<P>
Each user has a ~/.exmh-defaults file in their home directory. To handle personal color-specific resources, <I>exmh</I> will also read your ~/.exmh-defaults-color or ~/.exmhdefaults-mono if those files exist.<P>
I do not recommend putting exmh-related resource settings in your ~/.Xdefaults, although you can do that. If you do, be warned that values from the ~/.Xdefaults file and the RESOURCE_MANAGER property on the root window will be overridden by things in your ~/.exmh-defaults file.<P>
The ~/.exmh-defaults file is divided into sections. The first section is for things you add by hand. The remaining sections are automatically managed by <I>exmh</I>. If you manually add settings to your ~/.exmh-defaults file, add entries to the <I>beginning</I> of this file. Add them before the comment about the rest of the file being automatically generated and you will not lose your changes.<P>
If a resource has a multiword value, you *should not quote* the value in the resource file. The right way to specify these in your ~/.exmh-defaults file is shown below. The leading &quot;*&quot; gets around quirks in the way Tk names its applications; different instances of the application have different names.<P>
<pre>
*scrollbarSide:    left 
*c_current: violet red
</pre>
Finally, if you are really serious about fiddling with resources, you should look through the app-defaults file. For one thing, there is no guarantee that the resource names used in this man page, which correspond to version 1.5, will be exactly the same in later versions of <I>exmh</I>. Furthermore, there might be new goodies that appear in future versions that are not described here. Only by reading the appdefaults file of the current version will you be sure you are setting things correctly in your ~/.exmh-defaults file. (<I>Hint</I>: read through the main exmh script for the definition of the <A HREF="man/exmh-library">exmh(library)</A> Tcl variable, which is the script library where app-defaults lives. The script is short, and the definition is near the beginning.)<P>

<A NAME="sect7" HREF="#toc7"><H2><B>WIDGET</B> <B>CLASS</B> <B>HIERARCHY</B></H2></A>
If you want to dive into the widget tree and fiddle with fonts and colors and such, here are the class descriptions. I also highly recommend the <I>tkinspect</I> program, which you can find in the Tcl archives.<P>
Main Top row of buttons and title label<P>
Fdisp<BR>
 Folder label display<P>
Fltop<BR>
 Folder label display when it is in a detached toplevel.<P>
Fops Folder operation buttons and folder label<P>
Ftoc Folder table of contents display<P>
Mid Frame around Face, Msgid, Status, Mops<P>
Mid.Face<BR>
 Bitmap display<P>
Mid.Right.Status.label<BR>
 Message label<P>
Mid.Right.Status.msg<BR>
 Status line<P>
Mid.Right.Mops<BR>
 Message buttons<P>
Msg Message display<P>
Clip Detached message display<P>
Sedit<BR>
 Simple editor top-levels<P>
Help Help window<P>
Key Color key window<P>
Pref Preferences dialogs<P>
Log Error/debug log<P>
Pick The pick dialog<P>
Glimpse<BR>
 The glimpse dialog<P>
NewFolder<BR>
 The new folder dialog.<P>
DeleteFolder<BR>
 The delete folder dialog.<P>
WhatNow<BR>
 The What Now? dialog.<P>
Error<BR>
 Error popups<P>
Dialog<BR>
 General popups<P>

<A NAME="sect8" HREF="#toc8"><H2><B>RESOURCES</B> <B>FOR</B> <B>BUTTONS</B></H2></A>
<I>exmh</I> uses X resources to specify its buttons and menus on the main display, the editor window, and the What Now dialog. You can add a button to one of these areas of the user interface by listing it in a <B>ubuttonlist</B> resource and then adding some more resources that describe the button. X resource names are hierarchical, and these are the button list resources used by <I>exmh</I>.<P>
*Main.ubuttonlist<BR>
 *Fops.ubuttonlist<BR>
 *Mops.ubuttonlist<BR>
 *Sedit.Menubar.ubuttonlist<BR>
 *WhatNow.ubuttonlist<BR>
 <B>Fops</B> is the set of folder operation buttons. <B>Mops</B> is the set of message operations buttons. <B>Sedit.Menubar</B> is the buttons in the built-in editor. <B>WhatNow</B> is the What Now dialog used with external editors. The <B>ubuttonlist</B> resource is necessary because there is no easy way to enumerate the contents of the resource database.<P>
There are actually several resources associated with each set of buttons in order to provide maximum flexibility. There are three sources of button definitions: system buttons are defined by the base release ("at the factory"); local buttons are defined by your site administrator; user buttons are defined by each user. In addition, the site and the user can delete buttons with other resources. The resources are:<P>
<dl>
<dt>buttonlist <dd>    The list of system defined buttons
<dt>lbuttonlist <dd>   The list of local (site) defined buttons
<dt>ubuttonlist <dd>   The list of user defined buttons
<dt>l-buttonlist <dd>The list of buttons deleted at the local level.
<dt>u-buttonlist <dd>The list of buttons deleted at the user level.
</dl>
When <I>exmh</I> creates a set of buttons, (e.g., the *Main buttons), t asks for the definition of all these resources to determine what buttons are being defined    (e.g., *Main.buttonlist, *Main.ubuttonlist, and so on.) For each of these buttons, additional resources specify the text label and command for each button. This is best explained by an example. Here are the definitions for the main buttons:
<pre>
*Main.buttonlist:    quit pref alias
*Main.quit.text:     Quit 
*Main.quit.command:  Exmh_Done
*Main.pref.text:     Preferences 
*Main.pref.command:  Preferences_Dialog 
*Main.alias.text:    Aliases
*Main.alias.command: Aliases_Pref
</pre>
The <B>*Main.buttonlist</B> resource names the buttons that appear in the top row of buttons. Its value, in turn causes <I>exmh</I> to look around for the other resources that define the text and command attributes for each button. The command is a Tcl command, and most are simple commands of one or two words. If you are really inspired you can set many different attributes of a Tk button via resources, but you'll have to consult the Tk man page on <I>button</I> for the details.<P>
As another example, here is how you would add a Repl button to the message buttons. By default, there are a few variations on Reply under the Reply... menu. You might like a Repl button that does your most common form of reply. The <B>Msg_Reply</B> Tcl command takes regular arguments for the MH <I>repl</I> program.<P>
*Mops.ubuttonlist: myrepl<BR>
 *Mops.myrepl.text: Repl<BR>
 *Mops.myrepl.command: Msg_Reply -filter myrepl.filter -cc all<P>
If you hate the Reply... menu altogether, you can remove it by adding it to the u-buttonlist resource. You'll have to look at the master app-defaults file to find out the internal name of each button.<P>
*Mops.u-buttonlist: reply<BR>
<P>

<A NAME="sect9" HREF="#toc9"><H2><B>RESOURCES</B> <B>FOR</B> <B>MENUS</B></H2></A>
The menus in <I>exmh</I> are defined in a similar way. It is a little more complex because there is more to a menu than a button, but the general idea is the same. There are parallel sets of resources for the system-defined and userdefined parts. Each section has a list of menus defined with the following resources:
<dl>
<dt>menulist
<dd>The list of system defined menus 
<dt>lmenulist<dd>The list of local (site) defined menus
<dt>umenulist<dd>The list of user defined menus
<dt>l-menulist <dd>The list of menus deleted at the local level.
<dt>u-menulist <dd>The list of menus deleted at the user level.
</dl>
Each menu, in turn, has a <B>text</B> resource that defines the label on the menubutton. The <B>entrylist</B> resource lists the entries that are found under the menu. Again, the systemdefined entries are listed under <B>entrylist</B>, the administrator defines <B>lentrylist</B>, and users are meant to add new entries to <B>uentrylist</B>. System (or local) defined entries can be removed by adding them to the <B>l-entrylist</B> and <B>u-entrylist</B> resources.<P>
For each menu entry there are resources with the following naming convention (this is not standard Tk): if the entrylist item is <I>foo</I>, then:
<pre>
l_<I>foo</I> defines the label (text) for the entry.
c_<I>foo</I> defines the command.
 t_<I>foo</I> defines the type: &quot;command", &quot;check", &quot;radio", &quot;cascade", or &quot;separator". 
v_<I>foo</I> defines the variable associated with check and radio entries. 
m_<I>foo</I> defines the menu associated with cascade entries. 
</pre>
For more information, it might be helpful to consult the Tk man page for <I>menu</I>. For example, here is how the main menus for exmh are defined:
<pre>
*Main.menulist:          bind help
*Main.bind.text:         Bindings 
*Main.bind.m.entrylist:  command sedit 
*Main.bind.m.l_command:  Commands 
*Main.bind.m.c_command:  Bind_Pref
*Main.bind.m.l_sedit:    Simple Edit
*Main.bind.m.c_sedit:    Sedit_Pref
*Main.help.text:         Help 
*Main.help.m.entrylist:  help colorkey faq 
*Main.help.m.l_colorkey: Color Legend 
*Main.help.m.c_colorkey: Help_KeyDisplay
*Main.help.m.l_help:     Quick Intro
*Main.help.m.c_help:     Help 
*Main.help.m.l_faq:      Frequently Asked Questions 
*Main.help.m.c_faq:      Help FAQ
</pre>
Note    the    additional    <B>.m</B>     component     in     the <B>*Main.help.m.entrylist</B> resource name.    The <B>*Main.help</B> resource corresponds to the menubutton, and <B>*Main.help.m</B> corresponds to the menu associated with that button.<P>
For another example, we can use the <B>uentrylist</B> resource to add a new menu entry to the message More... menu. It will be a check-button type entry that will set the Tcl variable that controls the &quot;skip marked&quot; behavior of Next and Prev. In addition, we will separate the user-defined entries from the system entries with a special separator menu entry. The resources in your ~/.exmh-defaults would look something like this:
<pre>
*Mops.more.m.uentrylist: sep skip
*Mops.more.m.t_sep: separator
*Mops.more.m.t_skip: check
*Mops.more.m.l_skip: Skip marked messages 
*Mops.more.m.v_skip: ftoc(skipMarked)
</pre>
In this case the Tcl variable is <B>ftoc(skipMarked)</B>, which is an element of an associative Tcl array. Menu entries that use Tcl variables defined by <I>exmh</I> might stop working in a future release. However, you can easily get an idea of what the important variables are by searching through the code for Preferences_Add calls. These calls set up the releationship between the internal Tcl variables and the Preference items you see in the interface. In most cases the variables are elements of an associative array. In this example, <B>ftoc</B> is the array that holds the state variables for ftoc.tcl, which implements the scan listing.<P>

<A NAME="sect10" HREF="#toc10"><H2><B>BUTTON</B> <B>GROUPS</B></H2></A>
When you use <I>exmh</I>, you will notice that some of the message buttons are disabled when there is no current message. This is implemented by putting the Mops buttons and menu entries into groups. The group membership is defined via resources. The groups are <I>current</I>, <I>range</I>, and <I>nodraft</I>. The current group contains all the buttons and menu entries that are enabled when there is a current message. The range group contains buttons and menu entries that can be applied to multiple messages. The nodraft group is for those buttons and menu entries that ought to be disabled when you are in the drafts folder.<P>
For each group there are several corresponding resources that list the buttons, (system, local, and user), and menu entries, (system, local, and user), in the group. These are the group-defining resources and (part of) their default values.<pre>
*Mops.g_current:	link move delete reply forward
*Mops.gm_current:	Print {Unmark (Undo)} Clip Redistribute {Burst Digest} {Save to file} {Use message as draft} {Edit message} {uudecode message} {Print as postscript} {Apply command to body} {Apply command to message} {Mark Unseen} {PGP Encrypt} {old PGP...} {Highlight URI}
*Mops.ug_current:
*Mops.ugm_current:

*Mops.g_range:		link move delete forward
*Mops.gm_range:		Print {Unmark (Undo)} {Mark Unseen}
*Mops.ug_range:
*Mops.ugm_range:

*Mops.g_nodraft:	reply forward
*Mops.gm_nodraft:	Redistribute
*Mops.ug_nodraft:
*Mops.ugm_nodraft:
</pre>
The naming convention for buttons and menu entries is different. The buttons are named the same way they appear in the <B>buttonlist</B> resource specification. The menu entries are named by their textual label. If a menu entry label includes spaces, then the label must be grouped. Braces are used for compatibility with the Tcl grouping syntax.<P>
<I>Warning</I>! If you move things between the *Mops.buttonlist and the *Mops.more.m.entrylist, then you will have to adjust your group settings because the naming convention for buttons and menus is different.<P>

<A NAME="sect11" HREF="#toc11"><H2><B>COLOR</B> <B>RESOURCES</B></H2></A>
The basic TK widget color attributes are listed below. Most of these are defined in app-defaults-color to obtain a family of gray levels.<P>
background<BR>
 The main background of a widget. Default is a light gray (#efefef)<P>
foreground<BR>
 The foreground, (e.g., for text). Default is black.<P>
activeBackground<BR>
 The background of a button or menu when the mouse is over it. Default is white.<P>
activeForeground<BR>
 The foreground of a button or menu when the mouse is over it. Default is black.<P>
disabledForeground<BR>
 The foreground color of a button or menu that has been disabled. Default is grey50.<P>
selectBackground<BR>
 The background of text when it is selected. Default is canary blue.<P>
highlightColor<BR>
 The color of the focus highlight rectangle when a widget has focus. Default is black.<P>
highlightBackground<BR>
 The color of the focus highlight rectangle when a widget does not have focus. Default is the same gray as background.<P>
selector<BR>
 The color of the checkbutton and radiobutton glyph when the button is selected. Default is black.<P>
troughColor<BR>
 The &quot;other background&quot; for scrollbars and scales. Default is gray (#dfdfdf)<P>
You can specify colors for particular classes of widgets. All the labels are blue in exmh, by default, because of the following in app-defaults:<P>
*Label.foreground: blue<BR>
<P>
The following resources are used to control the looks in the scan listing and folder label display. The fact that some have a trailing Bg or Fg is purely historical accident. Originally you could only specify the foreground (for current and unseen) or the background (for moved and deleted) but now, for the benefit of greyscale users, you can specify all of them. You might also look at the fdispColor.tcl and ftocColor.tcl files that use these resources.<P>
c_current<BR>
 The color for the current message and current folder. Default is violet red.<P>
c_currentBg<BR>
 The background color for the current message. Default is white.<P>
c_unseen<BR>
 The color for unseen messages and folders that contain unseen messages. Default is blue.<P>
c_unseenBg<BR>
 The background color for unseen messages. Default is normal background (same as text widget default background).<P>
c_moved<BR>
 The background color for messages that are marked for refile, and the background label color for the target folder for refile. Default is yellow.<P>
c_movedFg<BR>
 The foreground color for messages that are marked for refile. The default is normal forground.<P>
c_deletedFg<BR>
 The foreground color for messages marked for delete. Default is normal foreground.<P>
c_foreground<BR>
 The foreground color for labels in the folder display. Default is black.<P>
c_background<BR>
 The background color for labels in the folder display. Default is white.<P>
c_popup<BR>
 The color for the popups that display nested folders. Default is grey.<P>
c_st_normal<BR>
 The color for normal status messages. Default is blue.<P>
c_st_error<BR>
 The color for error messages. Default is purple.<P>
c_st_warn<BR>
 The color for warning messages. Default is red.<P>
c_st_background<BR>
 The color for messages from the background process. Default is medium sea green.<P>
c_uri<BR>
 The color used to highlight URL and URN text by the Highlight URI function. The default is thistle.<P>

<A NAME="sect12" HREF="#toc12"><H2><B>COLORIZING</B> <B>HEADERS</B></H2></A>
A set of resources are used to specify colors and other font attributes of message headers.<P>
m_tagnames<BR>
 This defines a list of mail headers for which you want to define special looks when they are displayed in the message area. For each tagname, you should define another resource with name m_<I>tagname</I> (e.g, m_subject) that has the text tag configuration options for that header line. Consult the Tk man page on the text widget to see what sort of tag configuration options there are. In addition, two special tagnames are used for defaults if there are no more specific matching tag name. &quot;default&quot; applies to displayed headers, while &quot;hidden&quot; applies to hidden ones (scrolled off the top).<P>
For example, here is what I have in my own ~/.exmh-defaults file:
<pre>
*m_tagnames:	hidden subject from x-filters-matched content-type x-mailer replied replied-to
*m_hidden:	-font 6x10
*m_subject:	-foreground blue
*m_x-filters-matched:	-foreground "medium sea green"
*m_content-type:	-foreground "medium sea green"
*m_x-mailer:	-foreground "medium sea green"
*m_from:	-foreground blue
*m_replied:	-foreground "violet red"
</pre>

<A NAME="sect13" HREF="#toc13"><H2><B>GEOMETRY</B> <B>AND</B> <B>POSITION</B> <B>RESOURCES</B></H2></A>
Exmh automatically remembers the position of top-level windows, both within a session and between successive runs of <I>exmh</I>. It does this by saving some <B>position</B> resource specifications in your ~/.exmh-defaults file. In addition, <I>exmh</I> will remember the geometry of the main window and of the detached folder display.<P>
<I>Warning</I>: If you use a virtual root window manager, the memory of a window location will cause problems if you start <I>exmh</I> in a new &quot;room". If you move <I>exmh</I> to a new room, you'll have to edit your ~/.exmh-defaults and delete all the *position resource specifications. Or, you can turn off the <I>Remember</I> <I>Window</I> <I>Positions</I> preference item under Window Stuff. Then, when exmh exits, it removes these for you.<P>
You can adjust the width and height of some of the text windows. Here are the default values.
<pre>
*Fltop*Canvas.width:	500
*Fltop*Canvas.height:	100
*Sedit*Text.height:	24
*Sedit*Text.width:	80
*Clip*Text.height:	48
*Clip*Text.width:	80
*Help*Text.height:	30
*Help*Text.width:	80
*Log*Text.width:	80
*Log*Text.height:	20
</pre>

<A NAME="sect14" HREF="#toc14"><H2><B>ICON</B> <B>POSIITONS</B></H2></A>
The <B>iconposition</B> resources specify the location of the icons, both for the main window and the detached folder display (if any). The format is +X+Y to specify the upperleft hand point. If you use - instead of +, then the position is relative to the lower-right corner instead of the upper-left corner. By default no position is specified so your window manager will place the icon. The <B>iconic</B> resource indicates the startup disposition of the window.
<pre>
exmh.iconposition:
exmh.iconic:		0
*Fltop.iconposition:
*Fltop.iconic:		0
</pre>
<A NAME="sect15" HREF="#toc15"><H2><B>ICON</B> <B>APPEARANCE</B></H2></A>
You can control the bitmap and the label on the icon. There are three states for the icon: no mail, spooled mail, and unread mail. For each of these states you can define a bitmap and a label. The label can include references to exmh variables, as you will see in the default values. The value for the Bitmap is a file name. If it is relative then it is assumed to be in the exmh script library. Specify an absolute pathname otherwise.
<pre>
*iconUpBitmap:         flagup.bitmap
*iconDownBitmap:       flagdown.bitmap
*iconSpoolBitmap:      flagup.bitmap
*iconUpLabel:          $flist(newMsgs) Unseen
*iconDownLabel:        exmh
*iconSpoolLabel:       $exmh(numUnInced) Spooled
</pre>
You can reference any global exmh variable in the icon label. The two most useful are $<A HREF="man/flist-newMsgs">flist(newMsgs)</A>, which is a count across all folders of messages in the unseen sequence, and $<A HREF="man/exmh-numUnInced">exmh(numUnInced)</A>, which is the number of messages in your system spool file. This later value is only computed by the background &quot;count&quot; operation.<P>

<A NAME="sect16" HREF="#toc16"><H2><B>FOLDER</B> <B>DISPLAY</B> <B>RESOURCES</B></H2></A>
fl_font<BR>
 The font for the labels in the folder display. Default is &quot;fixed".<P>
fl_xgap<BR>
 The horizontal gap, in pixels, between labels in the folder display. The default is 8.<P>
fl_ygap<BR>
 The vertical gap, in pixels, between labels in the folder display. The default is 8.<P>
fl_curbutton<BR>
 The button that choses the current folder in the folder display.    The default is 1. (1=left, 2=middle, 3=right).<P>
fl_navbutton<BR>
 The button that navigates nested folders in the folder display.    The default is 2. (1=left, 2=middle, 3=right).<P>
fl_tarbutton<BR>
 The button that choses the target folder for refile in the folder display. The default is 3. (1=left, 2=middle, 3=right).<P>

<A NAME="sect17" HREF="#toc17"><H2><B>MIME</B> <B>RESOURCES</B></H2></A>
Resources are used to define the set of understood MIME types and to define the font families used to display messages in various character sets.<P>
mimeTypes<BR>
 This lists the Content-Types for which handler procedures are defined. For each of these there is a corresponding mime_<I>content</I>/<I>type</I> resource that specifies the Tcl command used to display a part of that type. <B>mimeUTypes</B> is the parallel resource so that users can add content types of their own. For example:
<pre>
*mimeTypes: text/plain text/richtext text/enriched multipart/mixed \
	multipart/digest multipart/parallel multipart/alternative \
	application/octet-stream message/external-body message/rfc822 \
	image application/pgp multipart/x-tioga text/x-html text/html \
	multipart/x-sun-attachment application/x-shell-script \
	audio/basic audio/x-sunaudio application/x-suncalendar \
	multipart/report message/x-delivery-status-05 \
	application/x-pgp-message \
	multipart/fv-infohaus application/fv-infohaus
*mimeUTypes:
!
*mime_text/plain:		Mime_ShowText
*mime_text/richtext:		Mime_ShowRichText
*mime_text/enriched:		Mime_ShowRichText
*mime_text/x-html:		Mosaic_ShowPart
*mime_text/html:		Mosaic_ShowPart
*mime_multipart/mixed:		Mime_ShowMultipart
*mime_multipart/report:		Mime_ShowMultipart
*mime_multipart/digest:		Mime_ShowMultipartDigest
*mime_multipart/parallel:	Mime_ShowMultipartParallel
*mime_multipart/alternative:	Mime_ShowMultipartAlternative
*mime_multipart/x-tioga:	Tioga_ShowMsg
*mime_multipart/x-sun-attachment:	Mime_ShowMultipart
*mime_application/x-shell-script:	Mime_ShowShellScript
*mime_audio/basic:			Mime_ShowAudio
*mime_audio/x-sunaudio:			Mime_ShowAudio
*mime_application/x-suncalendar:	Mime_ShowSunCalendar
*mime_application/octet-stream:	Mime_ShowApplicationOctet
*mime_message/external-body:	Mime_ShowMessageExternal
*mime_message/rfc822:		Mime_ShowRfc822
*mime_message/x-delivery-status-05:		Mime_ShowText
*mime_application/pgp:			Pgp_ShowMessage
*mime_application/x-pgp-message:	Pgp_ShowMessage
*mime_image:			Mime_ShowImage
*mime_application/fv-infohaus:	Mime_ShowText
*mime_multipart/fv-infohaus:	Mime_ShowMultipart
</pre>
mimeCharsets<BR>
 A font has a character set, which is an encoding for the characters. This is an optional parameter to the text Content-type. us-ascii is the basic ASCII charset, which lacks special characters used in many European languages. The iso-8859-1 character set has 8-bit characters and is used to encode accented and other special characters used in latin-based languages. The iso-8859-8 is used for hebrew. The iso-2022-jp is used for kanji. You need a specialized version of the Tk toolkit to display kanji.
<pre>
*mimeCharsets: us-ascii iso-8859-1 iso-8859-8 iso-2022-jp
*mimeUCharsets:
*mime_us-ascii_registry:	iso8859
*mime_us-ascii_encoding:	*
*mime_iso-8859-1_registry:	iso8859
*mime_iso-8859-1_encoding:	1
*mime_iso-8859-8_registry:	iso8859
*mime_iso-8859-8_encoding:	8
*mime_iso-2022-jp_registry:   iso8859
*mime_iso-2022-jp_encoding:   1
</pre>
mime_<I>charset</I>_plain_families<BR>
 A font has a family that determines the basic look for the font, like times or helvetica. Each of the family resources specifies a list of families that are tried, in order, to find a font that is supported by the X server. The plain family resource lists a set of font families that are used for ordinary text/plain messages.<BR>
mime_<I>charset</I>_fixed_families<BR>
The fixed families are used to display fixed-width fonts.    Fixed is one of the types allowd by text/enriched fonts.<BR>
mime_<I>charset</I>_proportional_families<BR>
The proportional families are used for text/enriched.<BR>
mime_<I>charset</I>_title_families<BR>
The title families are used for menu and section titles.<BR>
<pre>
*mime_us-ascii_plain_families:	fixed clean lucidatypewriter courier terminal
*mime_us-ascii_fixed_families:	lucidatypewriter fixed clean courier terminal
*mime_us-ascii_proportional_families:	times "new century schoolbook" \
					lucidabright charter lucida helvetica
*mime_us-ascii_title_families:	times "new century schoolbook" \
				lucidabright charter lucida helvetica
*mime_iso-8859-1_plain_families:	lucidatypewriter fixed courier terminal
*mime_iso-8859-1_fixed_families:	lucidatypewriter fixed courier terminal
*mime_iso-8859-1_proportional_families:	times "new century schoolbook" \
					lucidabright charter lucida helvetica
*mime_iso-8859-1_title_families:	times "new century schoolbook" \
				lucidabright charter lucida helvetica
*mime_iso-8859-8_plain_families:	fixed
*mime_iso-8859-8_fixed_families:	fixed
*mime_iso-8859-8_proportional_families:	
*mime_iso-8859-8_title_families:	

*mime_iso-2022-jp_plain_families:     fixed
*mime_iso-2022-jp_fixed_families:     fixed
*mime_iso-2022-jp_proportional_families:
*mime_iso-2022-jp_title_families:
</pre>
mimeExtMethods<BR>
 This resource lists thte set of external access methods for use with message/external-body MIME parts. For each of these methods there is a corresponding resource that lists the Tcl command that handles the access method.
<pre>
*mimeExtMethods:	local-file anon-ftp
*mimeUExtMethods:
*mime_local-file:	MimeLocalFileTransfer
*mime_anon-ftp:		MimeFTPTransfer
</pre>

<A NAME="sect18" HREF="#toc18"><H2><B>SEDIT</B> <B>BINDING</B> <B>RESOURCES</B></H2></A>
sedit_typeKillsSel<BR>
 Set to 1 or 0 to enable or disable type-in-kills selection: if there is selected text, typing new characters delete the selection.<P>
sedit_scrollButton<BR>
 Set to Middle (the default), Shift-Middle, or Right, to control which button is used for drag-scrolling text widgets.<P>
sedit_editprocs<BR>
 This is a list of built-in editing functions. It doesn't really make sense to change this unless you edit seditBind.tcl to provide an implementation for the edit function.<P>
sedit_key_<I>function</I><P>
There is a corresponding resource for each function listed in sedit_editprocs. The value of the resources is one or more event sequences that trigger the function.<P>

<A NAME="sect19" HREF="#toc19"><H2><B>MISCELLANEOUS</B> <B>RESOURCES</B></H2></A>
helpInOneWindow<BR>
 Set this to 1 to get a new preferences interface.<P>

<A NAME="sect20" HREF="#toc20"><H2><B>PROGRAMMING</B> <B>EXMH</B></H2></A>
<I>Exmh</I> is implemented as a Tcl/Tk script that uses the MH programs to manage your mail. The script is interpreted at runtime and is therefore distributed in source form. You can read the source to figure out what really going on. Furthermore, you can take advantage of the Tcl library facility in order to override parts of the implementation. Warning: it is easy to add new Tcl procedures, or to replace whole modules (i.e., files) of the exmh implementation. It is more awkward to override the definition of a single Tcl procedure, as explained below.<P>
By the way, if you do anything interesting to the sources, send the results to Brent.Welch@sun.com so they can be folded back into the master sources. Many of the good features in <I>exmh</I> came about this way.<P>
Even if you do not know Tcl you can probably figure it out as you read through the source. There is not enough room here to talk in any detail about Tcl programming. There are reasonably good on-line manual pages that come with Tcl and Tk. There are books about Tcl, too. John Ousterhout, the creator of Tcl and Tk, has written <I>Tcl</I> <I>and</I> <I>the</I> <I>Tk</I> <I>Toolkit</I>, by Addison-Wesley. I have written <I>Practical</I> <I>Programming</I> <I>in</I> <I>Tcl</I> <I>and</I> <I>Tk</I>, published by Prentice-Hall, ISBN 0-13-182007-9.<P>
Your custom Tcl code is kept in your ~/.tk/exmh directory. You maintain this as a Tcl library, which amounts to keeping a file called <B>tclIndex</B> up-to-date. This index file records which files implement which Tcl procedures. The normal Tcl shells (tclsh and wish) provide a Tcl command <B>auto_mkindex</B> that generates this file for you. Within a Tcl shell you use it like this:<P>
auto_mkindex ~/.tk/exmh *.tcl<BR>
 The first argument is a directory name, and the second argument is a filename pattern, which is usually *.tcl. If you add a new file or procedure to this directory, remember to update the index by running this command.<P>
The Tcl library facility is used by <I>exmh</I> for the main sources, too. The implementation has been chopped up into over 50 files, and these are loaded on demand as different features of <I>exmh</I> are invoked. The per-user library directory is search first, which means you can replace parts of the <I>exmh</I> implementation. While this is quite flexible, it is not ideal. The natural unit of replacement is a whole file, which might contain several Tcl procedures, even though you only want to change one. Also, when a new <I>exmh</I> release comes out, there might be incompatibilities with your customized code.<P>
NOTE: if you use TclX, then the auto_path stuff is different and the personal library seems not to work. If you figure out the right thing to do in auto_path_update (in the main <I>exmh</I> script), let me know.<P>
In most cases you will merely supply new code as opposed to replacing (i.e., fixing) parts of the implementation. Because you can define buttons and menus that invoke this new code without touching the released sources, you should be able to graft on new functionality somewhat cleanly.<P>
The user.tcl file contains two empty hook procedures, User_Init and User_Layout. User_Init is called early, before most other modules are initialized. User_Layout is called late, just after the widget tree has been created and basically every module initialized.<P>
<I>IMPORTANT</I> You must supply both User_Init and User_Layout because of the way Tcl auto-loading works. Just copy user.tcl and edit it.<P>
You should be able to override individual Tcl procs in User_Layout without having them trashed by the auto load facility. In this case you'd just source a file that has the new definitions. It turns out that Tcl procs have a global scope, so you could also just define the procs right inside User_Layout. Say, for example, you hate the constrained text scrolling. Try this:
<pre>
proc User_Layout {} {
    # This procedure is called late, after WidgetTextYview has 
    # been defined by the Exmh library. Let's override it now. 
    proc WidgetTextYview { t args } { 
	eval {$t yview} $args
    }
}
</pre>
There are some optional hook procedures with names beginning with Hook_. These procedures are called if they exist, so you do not need stub versions if you don't use them. Because of the way the library facility works, though, you have to include your Hook procedures in your copy of user.tcl or source the file that contains them from inside your User_Init procedure.<P>
In addition, you can have several hook procedures called from the same point by appending things to the standard hook names. That is, the implementation will call all procedures that match the pattern Hook_Foo*, so you could define Hook_FooBrent and Hook_FooWelch and both would be called at the Foo hook point. The hook points are:<P>
Hook_FolderChange $folder<BR>
 Called after you changed into the named folder.<P>
folderHook(enter,$folder)<P>
folderHook(leave,$folder)<BR>
 The <B>folderHook</B> array can be used to define enter and leave hooks for a folder. Just set these array elements to be the Tcl commands you want invoked before and after the folder change.<P>
Hook_CheckPoint<BR>
 Called at Quit time.<P>
Hook_SeditSend $draft<BR>
 Called as a message is being sent. The argument is the pathname of the draft message. You could frob the message here before it is delivered. If this raises an error, the message is not sent.<P>
Hook_MsgShow $pathname mimeHdr<BR>
 Called before a message is displayed. The first argument is the pathname of the message file. The second is the name of an array that contains the header information plucked out of the message. Because of multipart messages, the elements of the array look like:<P>
mimeHdr(0=1,hdrs)<BR>
 Lists all the headers defined in the message. The header keys are downcased (from, to, subject, etc.).<P>
mimeHdr(0=1,hdr,<I>key</I>)<BR>
 Contains the header line with the given <I>key</I>, e.g. <B>from</B> or <B>subject</B>.<P>
Note that the MsgParseFrom procedure, which is defined in msgShow.tcl, will extract the address part of a header line, so use it as a starting point for your code.<P>

<A NAME="sect21" HREF="#toc21"><H2><B>CODE</B> <B>ORGANIZATION</B></H2></A>
I've tried to split up <I>exmh</I> into meaningful modules, separating out display modules (e.g., fdisp) from those that maintain display-independent data structures (e.g., flist). Things like the Find and Pick dialogs are in their own file, so you can easily replace those. I have not documented the interfaces between modules at all, so you'll have to read some code. Note that the .tcl file names reflect the names of the procedures defined in them so you can locate definitions. In addition, many modules use a single global array to hold their state variables, and this array variable has the same name as the module.<P>
If you are really interested in the internals of exmh (i.e., something about it really bugs you!) you can look into the implementation in order to see what is wrong and how you might do things better. The following is a list of the files in the implementation along with a short explaination of what the Tcl procedures in it are for.<P>
exmh.MASTER<BR>
 This is the main script. It gets patched with sitedependent information and the results are written to <I>exmh</I>, which gets installed. It doesn't define much because it loads just about everything from the script library.<P>
exmh-bg.MASTER<BR>
 This is the main script for the background process. It redefines a few procedures, and loads in the rest of its implementation from the library. The initial rendez-vous between the background process is implemented in this script and in some supporting routines in background.tcl<P>
install.tcl<BR>
 These are supporting routines for the installation process. This should be generic enough for use with your own Tcl application. Feel free to borrow it.<P>
exmh.install<BR>
 This is the installation script for exmh.<P>
exmh-async<BR>
 This is the wrapper for external editors.<P>
The remainder of the files are kept in the script library.<P>
aliases.tcl<BR>
 A browser for the MH aliases file.<P>
audit.tcl<BR>
 Maintain an audit log of mail handling operations.<P>
background.tcl<BR>
 The background processing module. This can run in a separate process or as part of the main process. The BgRPC routine is used to invoke a background operation, and it works in either case.<P>
bindings.tcl<BR>
 This has the default bindings and the implementation of the binding user interface.<P>
busy.tcl<BR>
 Three different ways to indicate that exmh is busy doing something.<P>
buttons.tcl<BR>
 The resource-based button and menu implementation.<P>
cutbuffer.tcl<BR>
 A stub for the C cutbuffer extension.<P>
dragNdrop.tcl<BR>
 Drag-and-drop for exmh.<P>
editor.tcl<BR>
 The interface to editors for message composition.<P>
env.tcl<BR>
 Environment variable initialization.<P>
error.tcl<BR>
 The error handler.<P>
extrasInit.tcl<BR>
 This has Init routines for optional modules. The idea is to avoid loading their complete implementation until they are actually used.<P>
exwin.tcl<BR>
 The main window display is set up here. The code that remembers where toplevel windows go is here.<P>
faces.tcl<BR>
 The interface to the faces database.<P>
fcache.tcl<BR>
 The folder cache display.<P>
fdisp.tcl<BR>
 The main folder display.<P>
fdispColor.tcl<BR>
 The color definitions for the folder display.<P>
fdispPopup.tcl<BR>
 The nested folder popup implementation.<P>
fileselect.tcl<BR>
 The file selection dialog.<P>
find.tcl<BR>
 The find dialog.<P>
flag.tcl<BR>
 The appearance of the icon is managed here.<P>
flist.tcl<BR>
 The set of unseen folders is managed by this module.<P>
folder.tcl<BR>
 Folder operations like Folder_Change and Folder_Commit.<P>
folderNew.tcl<BR>
 The folder create and delete dialogs.<P>
ftoc.tcl<BR>
 The scan listing (folder table-of-contents).<P>
ftocColor.tcl<BR>
 Color definitinos for the highlights in the scan listing.<P>
ftocFind.tcl<BR>
 The search routines over the scan listing.<P>
help.tcl<BR>
 Some very simple help text and a color key.<P>
import.tcl<BR>
 Routines to import folders from UCB mail.<P>
inc.tcl<BR>
 Several ways to incorporate mail.<P>
labels.tcl<BR>
 There are three labels in the display - can you see them?<P>
mailcap.tcl<BR>
 Routines to parse the mailcap files.<P>
main.tcl<BR>
 The main Exmh procedure, plus Exmh_Status and<P>
Exmh_Debug.<P>
mh.tcl<BR>
 A basic layer on top fo the MH commands.<P>
mime.tcl<BR>
 The mime display code.<P>
mosaic.tcl<BR>
 Code to request Mosaic to display an HTML page.<P>
msg.tcl<BR>
 Message operations - although these tend to be distributed partly among ftoc.tcl and mh.tcl as well.<P>
msgShow.tcl<BR>
 This used to be the main message display code, but it has become dwarfed by the mime display.<P>
partial.tcl<BR>
 Code to concatinate the parts of a message/partial MIME message.<P>
pgp.tcl<BR>
 An interface to the Pretty Good Privacy system.<P>
pgpEWN.tcl<BR>
 This implements the PGP function in the external editor What Now dialog.<P>
pgpExec.tcl<BR>
 This executs the PGP program to get things done.<P>
pgpMatch.tcl<BR>
 This looks for keys in your keyring.<P>
pgpMisc.tcl<BR>
 This has the main post-processing hook for messages.<P>
pick.tcl<BR>
 An interface to the MH <I>pick</I> program.<P>
preferences.tcl<BR>
 The preferences user interface.<P>
print.tcl<BR>
 Routines to print messages.<P>
ps.tcl<BR>
 Code to rummage through the process table.    OSspecific.<P>
report.tcl<BR>
 This impelemnts the Bug Report and Register New User forms.<P>
rich2tk.tcl<BR>
 This parses text/enriched MIME content-types.<P>
scan.tcl<BR>
 This manages the scan caches.<P>
sedit.tcl<BR>
 The main routines for the built-in editor.<P>
seditBind.tcl<BR>
 The keybindings for the built-in editor.<P>
seditCompose.tcl<BR>
 The mapping for the Compose key sequences that allow input of 8-bit characters.<P>
seditEnriched.tcl<BR>
 The composition of text/enriched is implemented here.<P>
seditExtras.tcl<BR>
 More editor stuff, like Whom, Spell, Sign, Find, and the dialogs associated with Insert Part.<P>
seditMime.tcl<BR>
 The MIME multipart structuring is implemented here.<P>
seditQP.tcl<BR>
 This is code to handle 8-bit characters via the MIME quoted-printable encoding.<P>
select.tcl<BR>
 The keyboard selection of folders and messages is implemeted here.<P>
sound.tcl<BR>
 Sound effects.<P>
text.tcl<BR>
 Some text tagging routines.<P>
textButton.tcl<BR>
 An implementation of a pseudo-button in a text widget.<P>
textSelect.tcl<BR>
 The main guts of text bindings.<P>
thread.tcl<BR>
 This displays the messages related to the current subject.<P>
uri.tcl<BR>
 The code that scans messages for URLs.<P>
user.tcl<BR>
 Stubs for User_Init and User_Layout.<P>
widgetMenu.tcl<BR>
 Support for the popup menus used in MIME messages.<P>
widgetText.tcl<BR>
 Contrained text scrolling and dragging a selection off the window is handled by the routines here.<P>
widgets.tcl<BR>
 A basic layer on top of the Tk widgets. These routines integrate the pack geometry manager. Even more important, they guard against errors that occur because of missing fonts. You should try and use these instead of the straight Tk widget commands.<P>
xns.tcl<BR>
 An interface to xnsgetmail for those folks with mail on an XNS mail server.<P>

<A NAME="sect22" HREF="#toc22"><H2><B>SEE</B> <B>ALSO</B></H2></A>
exmh-use, exmh-ref, exmh, mh<P>

<A NAME="sect23" HREF="#toc23"><H2><B>AUTHOR</B></H2></A>
Brent.Welch@Sun.COM<P>

<A NAME="sect24" HREF="#toc24"><H2><B>THANKS</B></H2></A>
To Xerox PARC/CSL, for supporting this work initially, to Sun Microsystems Laboratories for continuing the support, and to all the exmh users that contributed ideas and code.<P>

</BODY></HTML>
EOF-EOF-EOF
NewFile html/exmh-ref.html<<'EOF-EOF-EOF'
<Html>
<Head>
<Title>Exmh Reference Page</Title>
<!-- manual page source format generated by RosettaMan, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<!-- Author: brent welch -->
<!-- Author: bwelch -->
</Head>
<Body>
<h1>
<a NAME="sect0" HREF="#toc0"><b>EXMH</b> <b>REFERENCE</b> <b>CHAPTER</b></a>
 </h1>This man page gives complete, but terse, information about <i>Exmh</i>. 

<h1>
<a NAME="toc"><b>Table of Contents</b></a>
 </h1>

<ul>
<li>
<a NAME="toc1" HREF="#sect1">EXMH REFERENCE CHAPTER</li></a>
 
<li>
<a NAME="toc2" HREF="#sect2">COMMAND LINE OPTIONS</li></a>
 
<li>
<a NAME="toc3" HREF="#sect3">EXMH MAIN BUTTONS</li></a>
 
<li>
<a NAME="toc4" HREF="#sect4">FOLDER BUTTONS</li></a>
 
<li>
<a NAME="toc5" HREF="#sect5">MESSAGE BUTTONS</li></a>
 
<li>
<a NAME="toc6" HREF="#sect6">SEDIT</li></a>
 
<li>
<a NAME="toc7" HREF="#sect7">SEE ALSO</li></a>
 
<li>
<a NAME="toc8" HREF="#sect8">AUTHOR</li></a>
 
<li>
<a NAME="toc9" HREF="#sect9">THANKS</li></a>
</ul>
<a NAME="sect2" HREF="#toc2"> 

<h2><b>COMMAND</b> <b>LINE</b> <b>OPTIONS</b></a>
 </h2>There are just a handful of command line options for exmh. Note that Xt-like command line options are not supported because <i>exmh</i> is based on Tk, not Xt. 
<p>

<dl><b> 
<dt>-bgAction</b> <i>action</i> 
<dd>Override background processing setting. Valid actions are: off, count, msgchk, flist, and inc. <b> 
<dt>-bgPeriod</b> <i>minutes</i> 
<dd>Override background period setting. <b> 
<dt>-geometry</b> <i>geometry</i> 
<dd>Initial geometry to use for the window. Exmh remembers the geometry when you change it interactively, so you do not really need to specify it each time on the command line. <b> 
<dt>-iconposition</b> <i>geometry</i> 
<dd>Initial position to use for the icon in the form +<i>xoff</i>+<i>yoff</i>. You can use minus signs instead of + to position relative to the right and bottom of the screen. <b> 
<dt>-iconic</b> 
<dd>Begin execution iconic. <b> 
<dt>-</b> <b>sedit</b> 
<dd>Override the editor command defined in Preferences and use the built-in editor (sedit) instead. 
<dt><i>folder</i> 
<dd>It the argument is not one of the flags given above, it is assumed to be the name of a folder. In this case <i>exmh</i> begins in that folder. 
</dl>
<a NAME="sect3" HREF="#toc3"> 

<h2><b>EXMH</b> <b>MAIN</b> <b>BUTTONS</b></a>
 </h2>There are three sets of buttons in exmh, the main, or top row, folder operations, and message operations. The main set has global commands: Log, Help..., Bindings..., Aliases, Preferences, and Quit. 
<p>
Help... 
<br>
Help is a menu with several choices: 
<p>
Quick Intro 
<br>
This provides a useful sub-set of this man page. 
<p>
Color Legend 
<br>
This provides a highlighting key for color or monochrome screens. 
<p>
Frequently Asked Questions 
<br>
This displays a Frequently-Asked-Questions file. It has the same info as the help.FAQ file. 
<p>
Exmh Mailing Lists... 
<br>
This is a sub-menu that lets you administer your membership in the exmh-related mailing lists. See the About menu entry for an explaination of the various mailing lists. The add/remove operations result in mail messages. You'll need to Send the draft messages. 
<p>
Submit Bug Report 
<br>
A mail message is started so you can report a problem with exmh. 
<p>
Register as an EXMH User 
<br>
A mail message is started to you can register as an exmh user. There is an opportunity to sign up for the mailing lists and provide positive and negative feedback about exmh. 
<p>
Pgp Setup 
<br>
Get started with PGP. There is some help text and an interface to create your public key / private key pair. 
<p>
Bindings... 
<br>
Exmh has two sets of key bindings. One for simple editting, and another to invoke commands. The editting bindings are used in the simple editor and in the various text entry widgets. The command bindings are in effect otherwise, and they allow you to invoke various Exmh commands without using buttons or menus. This is a menu with three choices: 
<p>
Commands 
<br>
This brings up a dialog that lets you edit the keystroke bindings. All of the defined bindings are displayed, and you can edit their associated keystroke in place. Use the entry to the right of each command to alter or add key bindings. There are further directions in the dialog box. 
<p>
Simple Edit 
<br>
These bindings result in class definitions for the Entry and Text widget classes. The default bindings are Emacs-like. See the Tk man page on the bind command for details about the syntax, if you need to. In Tk versions 3.3 and later, "Meta" is an ok synonym for "Mod1". To emulate Emacs, any keystroke that is defined to be &lt;Meta-<i>x</i>&gt; will also result in a binding for &lt;Escape&gt;<i>x</i>. 
<p>
Compose Key 
<br>
The compose key is used to insert 8-bit characters. This dialog shows you the key sequences used to get special characters. You can define which key maps to Compose in the Simple Edit bindings dialog. 
<p>
Log If you have enabled the debug log under the Hacking Support preferences section, then this button appears. It displays the debug log. 
<p>
Aliases 
<br>
This displays an interface to the MH alias file. You will be prompted to set up the MH profile entry that names the alias file, if needed. There are a pair of lists in the interface. To the left is a list of your aliases. Selecting one will display the address(s) of the alias in the right-hand list. Under each list are three buttons: Insert, Change, and Delete, that let you operate on the aliases or the addresses associated with an alias. As you view messages, the From address of the current message is displayed in the dialog. There is a Help button in the dialog that gives more tips about using it. 
<p>
Preferences 
<br>
This displays a dialog that lets you customize <i>exmh</i>. There is also a different Help button in the Preference dialog that explains how to make selections and get more info. In particular, you can click on the descriptive label for an item to get a popup with more detailed information on the preference item. 
<p>
Quit This quits exmh. If there are pending changes to draft messages, they are saved first. 
<p>
<a NAME="sect4" HREF="#toc4"> 

<h2><b>FOLDER</b> <b>BUTTONS</b></a>
 </h2>The middle set of buttons has folder commands: New, Flist, Inc, Commit, Search... and More... 
<p>
New This pops up a dialog box from which you can create new folders. When entering a folder name, the `@' character is short for the current folder name. Note that the Delete folder operation is under the More menu. 
<p>
Flist 
<p>
The Flist button refreshes the color feedback of folder buttons so you can tell which folders have unseen messages in them. If you use presort inc style, then this is done automatically. However, if you read all the unseen messages in a folder from outside <i>exmh</i>, then it will miss the transition out of the unseen state, so the Flist button will help reset its view of the folder state. 
<p>
Inc The Inc button will incorporate new mail from your spool file into your mail folders. This command is also bound to the keystroke `i'. 
<p>
Commit 
<br>
The Commit button causes pending delete and move operations to occur. This command is also bound to the keystroke &lt;Control-Return&gt;. Know that messages marked for deletion are removed by means of the MH <b>rmm</b> command. In most systems, <b>rmm</b> will rename the message to a name begining with either a comma (,) or pound sign (#). Unlike <b>xmh</b>, <b>exmh</b> requires that you commit changes before changing folders and doing other operations that modify the scan listing (e.g., Pack, Sort, Rescan). However, you can set Auto Commit under the Scan Listing preferences to have exmh automatically commit changes when needed. See also the description of the "Purge Folder" operation. 
<p>
Search... 
<br>
This is a menu of different search methods. The first two operations use a simple Find dialog. The Pick and Glimpse interfaces have their own dialogs. The menu entries under Search... are: 
<p>
Search help 
<br>
This help text describes the search methods in more detail. 
<p>
Current message 
<br>
Enter a string to find in the current message. &lt;Return&gt; causes the search to begin. &lt;Control-s&gt; and &lt;Control-r&gt; cause subsequent forward and reverse searches, respectively. 
<p>
Folder table of contents 
<br>
This search is done by scanning the folder table of contents display, so it only hits on the current folder scan output. Select the All button to select all matching messages. Use Pick for more general searching. 
<p>
All messages in current folder (pick) 
<p>
This provides an interface to the MH <b>pick</b> command. Begin by chosing from the "pick attribute" menu in the dialog. These include headers like Subject, From, To, and Cc, as well as date criteria like Before, and After. You can search for a string in the body of messages with the "Search" field. You can enter a pattern for any of these, and <b>pick</b> selects messages that satisfy the logical AND of these pattern specifications. Note that the Before and After patterns are date-specific, and <b>pick</b> understands many forms of date patterns. Read the MH man page on <b>pick</b> for the complete story. You can build up more complex logical search expressions by clicking the Or button. 
<p>
Pick from Seq/msgs(s) 
<br>
This entry lets you limit <b>pick</b> to a specific set of messages. In particular, you can specify a sequence name (e.g., "unseen"), and have pick find all messages with that sequence identifier. After the pick completes, a range of messages is selected that satisfies the search, and you can operate on these messages as described below. 
<p>
Add to Sequence(s) 
<br>
This entry lets you apply a sequence name to the set of messages that are selected by the search. You can select these later by using the "Pick from Seq" field. 
<p>
Add to Sel 
<br>
This button is part of the <i>pick</i> interface. Set this before the pick to add the results of the pick to whatever message range is already selected in the table of contents. Otherwise a new selection is made. 
<p>
New FTOC 
<br>
This button is part of the <i>pick</i> interface. It causes the table of contents to be replaced with the set of currently selected messages. These can be the result of a pick, or you can just make a selection with the mouse. <i>Warning</i>: after projecting a new table of contents, a subsequent <i>pick</i> will only find things in this limited table of contents. 
<p>
Mark Seen 
<br>
This button is part of the <i>pick</i> interface. Use this to remove the selected messages from the unseen sequence. 
<p>
All messages in all folders (glimpse) 
<br>
This brings up an interface to the Glimpse text index tool. You must first index your mail, so to get started click "index" to build your indexes. This process runs in the background, and the status of the index process is displayed in the Glimpse log. The storage overhead of the indexes is about 10% to 15%, which is quite good for a full text index system. To search, enter a word in the search area and press "Search". The button changes to a "Stop" button, although the stop may take a moment to take effect. The search results are displayed in the log. Click on the message in the log and exmh will visit that message. For more details, see the exmh-use man page. 
<p>
Display related messages 
<br>
This selects messages that have the same subject as the current message, or that are "in-reply-to" the current message. The folder table of contents is replaced by one that only lists the related messages. 
<p>
More... 
<br>
This is a menu with more folder operations in it: 
<p>
Rescan folder 
<br>
Rescan forces a rescan of the folder contents. <i>Exmh</i> maintains a cache of the scan output that could get confused. The Rescan button forces a full scan. If you just want to scan the new messages that have arrived in the folder you are currently reading, it is more efficient to click on the folder's label in the top pane. This will invoke a scan merging procedure that attempts to preserve the cached results of previous scans. You should only need Rescan when you have reason to believe that <i>exmh</i> is out of sync. 
<p>
List only selected messages 
<br>
This changes the table of contents to list only the selected messages. This is useful after a pick or table of contents search that has highlighted several messages throughout the folder. You must use Rescan folder to get the full listing back. 
<p>
Pack folder 
<br>
This will renumber messages in the current folder to eliminate any gaps in the number sequence. 
<p>
Sort folder 
<br>
This is a cascade menu that provides different ways to sort your folder: by date, by subject, and by the sender. The subject and sender sorts also do some grouping by date so that messages from one person or about one subject may be grouped into several subgroups based on their age. See the MH sortf command manual page for details. 
<p>
Find all folders 
<p>
This refreshes the display of folder buttons, and it will pick up any new folders you have created. This currently uses the MH command "folders -fast -recurse", which can be slow. The results are saved, so you should not need to wait for this scanning unless you change your folder structure. (You can also edit the .folders file in your MH mail directory.) The <i>exmh</i> distribution comes with a two-line patch for the MH folders program that speeds it up considerably. This is found in the misc/folder.patch file. 
<p>
Delete folder 
<br>
This lets you delete a folder. The folder must be empty, except for .xmhcache, .mh_sequences, and any .nfs junk files. 
<p>
Catch-up Unseen 
<br>
This clears the unseen sequence from the current folder. 
<p>
Update scan caches 
<br>
This runs another process in the background to update any scan caches that are out of date. 
<p>
Update all scan caches 
<br>
This runs another process in the background to update all the scan caches. 
<p>
Purge folder 
<br>
When MH deletes a message it really only renames it to have a name like #N or ,N if it was message N. The Purge operation will clean up these junk files that are older than 7 days. (This age parameter can be adjusted by a Preference item under the MH Tweaks section.) 
<p>
Purge all folders 
<br>
This runs through all your folders deleting old junk files. This is done in the background so you can continue to use the user interface during the process. 
<p>
Import mailbox folders 
<br>
If you use a program like Elm or Sun's Mailtool, you can import their message folder contents into the format used by MH. This menu entry brings up a dialog that lets you do this. After you specify the directory that contains the mail folders, a display with a checkbutton for each folder is created. You can select which folders to import. The originals are left alone, so you'll have to delete them yourself after you import them into MH. 
<p>
Audit 
<p>
This is a cascade menu entry that lets you either view the audit summary statistics or the current audit log. Note that the audit log is appended into ~/Mail/.exmhaudit when you quit exmh. 
<p>
Re-read MH Profile 
<br>
If you change something important in your MH profile, you can get exmh to reprocess it with this operation. 
<p>
<a NAME="sect5" HREF="#toc5"> 

<h2><b>MESSAGE</b> <b>BUTTONS</b></a>
 </h2>The last set of commands are message operations. Several of these work in a batch fashion on all the messages in a selected set. These include Delete, Move, Link, Forward, Unmark, and Print. Some of these buttons and menu entries are disabled if there is no current message. Disabled actions have their text greyed out. 
<p>
Forward 
<br>
Forward the current message(s). Also keystroke `f'. 
<p>
Send Compose a mail message. Chose the editor to use via the Preferences dialog. Also keystroke `c' (for "compose"). 
<p>
Prev Move to the previous message. Also keystroke `p'. Keystroke `P' changes the current message without displaying it. Use `s' to display such a message. 
<p>
Next Move to the next message. This will chain to the next folder with unread messages if you are at the end of the current folder. The "Next" folder is defined by the Folder-Order .mh_profile entry, and it is always the first folder in the order that has unseen messages. (This keeps you in the interesting folders and away from the dregs if you organize your Folder-Order properly.) Also keystroke `n'. Keystroke `N' changes the current message without displaying it. Keystroke `F' changes to the next folder with unseen messages. 
<p>
Delete 
<br>
Mark the current message(s) for deletion and go to the next message. Also keystroke `d'. If you change your mind, select the message again and "Unmark" it via the entry under the message More... menu. 
<p>
Move Mark the selected message(s) to be moved to the target folder and go to the next message. Also keystroke `m'. Note that selecting a target folder also moves the current message(s). So, you use the Move button if the correct target folder is already selected. If you make a mistake and want to move the message to a different folder, just select it again and right click on the proper destination folder. If you don't want to move it at all, then "Unmark" the message. 
<p>
Link Similar to move, except that the message is linked into the other folder so that it appears in both places. While this appears like a copy, the same message is shared between the folders to save disk space. 
<p>
Reply... 
<br>
This is a menu of reply options. By default there are two choices, but you can easily define more variations on reply. The default choices are: 
<p>
Reply to sender &lt;Key-r&gt; 
<br>
Reply to the current message, only to the person that send the original. Also keystroke `r'. 
<p>
Reply all &lt;Key-R&gt; 
<br>
Reply to the current message, including on the cc line everyone that got the original message. (It invokes MH <b>repl</b> with: -cc cc -cc to). Also keystroke `R'. 
<p>
Reply help 
<br>
This pops up a display that tells you how to program new reply buttons. You'll need to be familiar with the MH repl command and its filters. Check out the <b>repl</b> and <b>mh-format</b> manual pages. 
<p>
More... 
<br>
This is a menu of more message operations. 
<p>
Print 
<br>
Print the current message, or the selected set of messages. The print command is defined via the Preferences dialog. The whole message is printed, headers and all. 
<p>
Unmark (Undo) 
<br>
Cancel a move or delete mark on the selected message(s). Also keystroke `u'. 
<p>
Clip Display a new toplevel window containing the current message. 
<p>
First Unseen 
<br>
Display the first unseen message, if any. Also keystroke `U'. 
<p>
Burst Digest 
<br>
Use the MH <b>burst</b> command to split up a digest message into its individual messages. In addition, the new messages are added to the unseen sequence. You can control whether or not the orignal message is replaced with just the digest header by specifying burst options in your .mh_profile. (E.g., "burst: -inplace"). 
<p>
Redistribute 
<br>
This uses the MH <b>dist</b> command to resend a message to a different recipient. Your editor is invoked with a small buffer containing only Resent-To: and Resent-Cc: lines. 
<p>
Save to file 
<br>
This simply copies the current message(s) to a file selected via the file selector dialog. 
<p>
Use message as draft 
<br>
This copies the current message into the drafts folder and opens your editor on the message. 
<p>
Edit message 
<br>
This opens your editor on the message so that you can annotate it. 
<p>
uudecode message 
<br>
This simple runs uudecode with the current message as input. A file selection dialog lets you choose the name of the resulting file. 
<p>
Print postscript content 
<br>
This is useful for non-MIME messages that contain a postscript file. The message body (everything from the initial %!PS onwards) is put into a temp file and then the Preferences Postscript Print Command is used to print that file. 
<p>
Apply command to message 
<br>
This runs a UNIX command over the current message (all of it). A dialog lets you set the command, with occurrences of $file replaced with the pathname of the message. The default value of the UNIX command is hiding under the Print preferences entry. 
<p>
Apply command to body 
<br>
This runs a UNIX command over a temporary file containing the body of the current message. 
<p>
Mark Unseen 
<br>
This puts the current message(s) back into the unseen sequence. 
<p>
PGP Encrypt 
<br>
Replace the current message with an encrypted version of it. 
<p>
old PGP... 
<br>
This is a menu of operations that apply to PGP messages that are not wrapped up in a MIME format. Those are handled automatically. This menu is used to tell exmh explicitly what to do. You can Decrypt, View, or Extract Keys. 
<p>
Scan for URLs 
<br>
Scan through the message body and look for URL and URN references. If any are found, they are highlighted and made into active text. Click on the text and Mosaic will be started on that URI. You can set the command to use via the URI preferences section. Also keystroke `z'. 
<p>
View selected URL 
<br>
If you have manually selected an embedded URL, then use this menu entry to get exmh to ask your web browser to display the selected URL. If the automatic scanning doesn't work perfectly, you can do a manual selection on top of an incorrect active text button. 
<p>
Concatenate partial messages 
<br>
If you get a message in parts, as a MIME type message/partial, then select all the messages that have the parts and invoke this operation. 
<p>
<a NAME="sect6" HREF="#toc6"> 

<h2><b>SEDIT</b></a>
 </h2>The built-in editor, <b>sedit</b>, has a dozen or so commonly used editing operations bound to keystrokes. These are Emacslike, but you can change them from within the editor through the "Simple Edit" dialog available under the main "Bindings" menu. In addition, the editor has a number of buttons and menu entries used to manipulate your draft messages. 
<p>
Abort 
<br>
This deletes the draft message and removes the editor window. 
<p>
Save&amp;Quit 
<br>
This will save the message and quit the editor window. The idea is that you will come back to the draft via the drafts folder later. 
<p>
Help This button brings up a window with a short explanation of the editor. 
<p>
Insert @ 
<br>
The is only active while you are replying to a message. When you are replying to a message, the file named "@" is a symbolic link to the message to which you are replying. When this file is inserted, it is formatted a bit, unlike the Insert File... operation. The mail headers are stripped off, quoted-printable text is decoded so you get 8-bit characters in the edit buffer, and each line is prefixed with a short string to distinguish the inserted lines. You can set this prefix via an Xresource, replPrefix. The default prefix is "&gt; ". If you want to change this and still have trailing blanks, it turns out this works ok. The resource value seems to begin with the first non-blank character, but then extends all the way to the newline character. 
<p>
Sign This appends your ~/.signature file to the draft. If this file is instead an executable script or program, it is executed in order to generate the signature. 
<p>
Sign... 
<br>
If you have multiple files that match the ~/.signature* pattern, the Sign button is replaced with a menu of possibilities. If you choose the autoSign Simple Editor Preference, then this menu is used to choose which signature file (or program) is used when automatically signing the message as it gets posted. 
<p>
Send When you are done with the message, click Send. This is also bound to the keystroke &lt;Control-c&gt;&lt;Control-c&gt;. 
<p>
Text... 
<br>
This menu is used to add bold, italic, underline, etc. to your messages. This results in a MIME message of type text/enriched. The formatting commands are supposed to be palatable to a non-MIME reader, but you may want to take this into consideration. If you disable the "Format mail" setting (described below), the looks are discarded before sending the message. 
<p>
More... 
<br>
This menu contains a few entries for less common operations. They are: 
<p>
Keep on send 
<br>
This is a checkbox menu item that is off (unhighlighted) by default. If selected it prevents the editor window from disappearing after you send or abort a message. This is useful if you'd like to compose a few similar messges. (I also use it to debug the enriched text formatter.) 
<p>
Format mail 
<br>
This is a checkbox menu item that is enabled (highlighted) by default. Formatting means to break long lines (&gt; 80 characters). This is done as the file is saved, not as you type. So, while the Tk text widget does line wrapping while you enter text, <b>sedit</b> does not break these lines until you go to send the message. <b>If</b> <b>you</b> <b>insert</b> <b>a</b> <b>file</b> <b>into</b> <b>a</b> <b>message</b> <b>that</b> <b>has</b> <b>critical</b> <b>formatting,</b> <b>you</b> <b>may</b> <b>want</b> <b>to</b> <b>disable</b> <b>the</b> <b>Format</b> <b>option.</b> 
<p>
Attempt mhn 
<br>
If this is selected, your message is run through <b>mhn</b> in order to expand any # directives that format a MIME mesage. See also the "Run mhn now" menu entry below, and see the <b>mhn</b> man page for details. 
<p>
Quote Printable 
<br>
If this is selected, then any text MIME parts are run through the quoted-printable encoder to wrap up 8-bit characters in a 7-bit safe encoding. The Quoted Printable default preference setting under Simple Editor can be set to automatic, never, or always. In automatic mode, quoting is enabled when you enter a Compose key sequence to generate an 8-bit character. 
<p>
Cite Selection 
<br>
This formats and inserts the current selection. It is assumed to be in the currently displayed mail message, and the sender of that message is identified before the formatted text. Hint: this is the only useful way to include text from PGP encryped messages and text/enriched messages. The formatting of text/enriched is lost, however. 
<p>
Insert File... 
<br>
This brings up a dialog box that lets you insert a file into the message. 
<p>
Insert Part... 
<br>
This is similar to Insert File, except that it creates a MIME multipart message structure to wrap up the inserted file. It tries to determine the type of the file based on <b>nametemplate</b> entries in the metamail mailcap description file. It presents a dialog that lets you override the type, add a Content-Description, and choose an encoding for the file. When you insert the first Part of a message you are asked whether or not to save the existing message body. If you save it, it becomes the text/plain first part of the multipart message. 
<p>
Insert External... 
<br>
This sets up an Message/External-Body MIME message part. This is useful for sending around pointers to files available via FTP or on your local file system. 
<p>
Insert PGP Keys... 
<br>
Insert your PGP keys into the mail message. You can use the key selector to choose any key in your public keyring. Just type in a pattern that matches part of the key ID. Matching keys are displayed in the listbox. 
<p>
Whom This entry displays a small window with the network addresses of the recipients of the message. Clicking the button a second time makes the window go away. 
<p>
Spell... 
<br>
This runs either the UNIX spell or ispell command. Choose between these two options in the Simple Editor preferences. (Don't confuse that with the setting under Editor Support preferences.) If you use ispell then the draft is reloaded after ispell terminates. If you use spell then the output of spell is put into a second pane inside the editor window. That's all nothing fancy. 
<p>
Find SEL 
<br>
This searches the draft for the current X selection. The intent is that you select mispelled words in the output of the spell command and use this menu entry to locate them in the draft. (The find and keybinding mechanisms were stressed by this addition - expect a cleanup someday. There is no reasonable way to define keystroke accellerators for the find and still be able to change them in the Bind dialog. - don't ask...). 
<p>
Save Buffer 
<br>
This saves the editor buffer into a file in your drafts folder. Most likely you really want the "Keep on Send" function instead of Save, because that function preserves the draft after you send it, while ordinarily (in spite of "Save") MH will rename the draft after you send it. 
<p>
Run mhn now 
<br>
This processes the draft with <b>mhn</b> and puts the result back into the buffer. After this you can use "Insert Part..." to add more parts, but you should not use any new <b>mhn</b> directives. 
<p>
Mime Preview 
<br>
This displays the message as it will appear when an exmh user receives it. A detached top-level window is used, as with message Clip. 
<p>
Alternate Editor 
<br>
Save the draft and invoke your alternate editor on the message. Define the alternate under the Editor Support preferences.. 
<p>
PGP... 
<br>
This is a menu of options that use the Pretty Good Privacy package to to encryption and authentication. An explaination of pgp is beyond the scope of this manual. This works by inserting a header into your message that indicates what action to do. The actual encryption or whatever is done after you hit the Send button. If you use an external editor you can insert the headers in that, and exmh will run your message through PGP for you when you send it. The four supported headers are: 
<p>
pgp-action: signclear 
<br>
pgp-action: signbinary 
<br>
pgp-action: encrypt 
<br>
pgp-action: encryptsign 
<br>


<p>
<a NAME="sect7" HREF="#toc7"> 

<h2><b>SEE</b> <b>ALSO</b></a>
 </h2>exmh-use, exmh, exmh-custom, mh 
<p>
<a NAME="sect8" HREF="#toc8"> 

<h2><b>AUTHOR</b></a>
 </h2>Brent.Welch@Sun.COM 
<p>
<a NAME="sect9" HREF="#toc9"> 

<h2><b>THANKS</b></a>
 </h2>To Xerox PARC/CSL, for supporting this work initially, to Sun Microsystems Laboratories for continuing the support, and to all the exmh users that contributed ideas and code. 
<p>


<p>

<p>


</Body>
</Html>
EOF-EOF-EOF
NewFile html/exmh-use.html<<'EOF-EOF-EOF'
<Html>
<Head>
<Title>Exmh User's Guide</Title>
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<!-- manual page source format generated by RosettaMan, -->
<!-- Author: brent welch -->
</Head>
<Body>


<h1>
<a NAME="toc">Table of Contents</a>
</h1>
<ul>
<li>
<a NAME="toc0" HREF="#sect0">NAME</li></a>
 
<li>
<a NAME="toc1" HREF="#sect1">INTRODUCTION</li></a>
 
<li>
<a NAME="toc2" HREF="#sect2">OVERVIEW OF FEATURES</li></a>
 
<li>
<a NAME="toc3" HREF="#sect3">GETTING STARTED</li></a>
 
<li>
<a NAME="toc4" HREF="#sect4">KEYBOARD COMMANDS</li></a>
 
<li>
<a NAME="toc5" HREF="#sect5">THE EXMH DISPLAY</li></a>
 
<li>
<a NAME="toc6" HREF="#sect6">FOLDER DISPLAY</li></a>
 
<li>
<a NAME="toc7" HREF="#sect7">FOLDER CACHE</li></a>
 
<li>
<a NAME="toc8" HREF="#sect8">FOLDER TABLE OF CONTENTS</li></a>
 
<li>
<a NAME="toc9" HREF="#sect9">MESSAGE DISPLAY</li></a>
 
<li>
<a NAME="toc10" HREF="#sect10">MANAGING MESSAGES</li></a>
 
<li>
<a NAME="toc11" HREF="#sect11">SENDING MAIL</li></a>
 
<li>
<a NAME="toc12" HREF="#sect12">THE BUILT-IN EDITOR</li></a>
 
<li>
<a NAME="toc13" HREF="#sect13">MAIL FORMATTING</li></a>
 
<li>
<a NAME="toc14" HREF="#sect14">MIME FORMATTING</li></a>
 
<li>
<a NAME="toc15" HREF="#sect15">USING ANOTHER EDITOR</li></a>
 
<li>
<a NAME="toc16" HREF="#sect16">FILTERING MAIL</li></a>
 
<li>
<a NAME="toc17" HREF="#sect17">FACES</li></a>
 
<li>
<a NAME="toc18" HREF="#sect18">SEARCHING IN EXMH</li></a>
 
<li>
<a NAME="toc19" HREF="#sect19">TIPS</li></a>
 
<li>
<a NAME="toc20" HREF="#sect20">INSTALLATION</li></a>
 
<li>
<a NAME="toc21" HREF="#sect21">UPGRADING WITH PATCHES</li></a>
 
<li>
<a NAME="toc22" HREF="#sect22">TK SEND AND XAUTHORITY</li></a>
 
<li>
<a NAME="toc23" HREF="#sect23">MORE INFORMATION</li></a>
 
<li>
<a NAME="toc24" HREF="#sect24">FILES</li></a>
 
<li>
<a NAME="toc25" HREF="#sect25">SEE ALSO</li></a>
 
<li>
<a NAME="toc26" HREF="#sect26">AUTHOR</li></a>
 
<li>
<a NAME="toc27" HREF="#sect27">THANKS</li></a>
 
</ul>
<a NAME="sect0" HREF="#toc0"> 

<h2>NAME</a>
 </h2>exmh-use - A more advanced user guide to the exmh mail user interface. 
<p>
<a NAME="sect1" HREF="#toc1"> 

<h2><b>INTRODUCTION</b></a>
 </h2>This man page provides more detail information about using <i>exmh</i>, such as managing nested folders, filtering mail, and using an external editor. The <i>exmh</i>-<i>custom</i> man page describes customization of <i>exmh</i>, and the <i>exmh</i>-<i>ref</i> man page describes all the buttons and menus of <i>exmh</i>. 
<p>
<i>Exmh</i> uses the regular MH programs to manipulate your mail folders and messages. This means it is compatible with command-line use of MH programs, and its actions should be familar if you are an experienced MH user. If you are a new MH user, then the details of running MH programs is hidden behind the graphical interface. 
<p>
This man page will occasionally make references to advanced MH features like scan formats and reply filters. If you do not know about these you can ignore the comments. If you do know about them, however, you will see that <i>exmh</i> can be affected by settings for these features in your MH profile. 
<p>
<a NAME="sect2" HREF="#toc2"> 

<h2><b>OVERVIEW</b> <b>OF</b> <b>FEATURES</b></a>
 </h2>As well as providing basic MH functionality, <i>exmh</i> has a number of other features: 
<p>
<b>MIME</b> <b>support</b>. <i>Exmh</i> can display MIME (Multipurpose Internet Mail Extensions) messages, either directly or with the help of the <i>metamail</i> package. The built-in editor lets you compose enriched text messages and insert files as parts of a multipart message. 
<p>
<b>Sun</b> <b>Attachments</b>. These attachments are cooerced into MIME format. Special treatment is given to certain common sun attachments like Calendar Appointments. You cannot create a Sun format attachment within <i>exmh</i>, hoever. 
<p>
<b>Nested</b> <b>Folder</b> <b>Display</b>. A display of your folders appears as a set of labels, one for each folder. This is similar to <i>xmh</i>, except that the folder labels are highlighted to indicate the current folder, the target folder for moves, folders with unread mail in them, and folders with nested folders under them. <i>Exmh</i> supports arbitrarily nested folder structures, unlike <i>xmh</i>, which only supports a single level of nesting. 
<p>
<b>Scan</b> <b>Listing</b> <b>Highlights</b>. The scan listing (folder tableof-contents) is also highlighted to indicate the current message, unread messages, and messages marked for move or delete. Either color or monochrome highlighting is used, depending on your display. 
<p>
<b>Facesaver</b> <b>bitmap</b> <b>display</b>. If you have a facesaver database on your system, <i>exmh</i> displays the bitmap face of the person that sent the current message (or their organization). 
<p>
<b>Background</b> <b>processing</b>. You can set <i>exmh</i> to run <i>inc</i> periodically, check for new mesages arriving asynchronously in folders, run the MH <i>msgchk</i> program, or count up the messages in your mail spool file. 
<p>
<b>Mail</b> <b>filtering</b>. <i>Exmh</i> is designed to work with external agents that filter arriving mail into different folders. 
<p>
<b>Unseen</b> <b>folder</b> <b>display</b>. If you use a system that delivers mail into various folders, not just inbox, then you have the problem of finding what folders have unseen messages in them. <i>exmh</i> provides feedback in the folder display so you can tell which folders have new messages. Also, the Next command will chain to the next folder with unread messages if you are at the end of the current folder. 
<p>
<b>Pick</b>. An interface to MH <i>pick</i> lets you select messages by patterns in the header fields, by date, or by sequence name. The interface is similar, but not identical, to the <i>xmh</i> pick interface. 
<p>
<b>Fast</b> <b>Search</b>. Because <i>pick</i> can be slow, <i>exmh</i> also implements fast searching over the current folder listing and current message body. 
<p>
<b>Glimpse</b> <b>interface</b>. Glimpse is a full text search tool from the University of Arizona. It has a low overhead indexing scheme that costs about 10% to 12% of your mail storage space. It is quite useful to find messages in any of your many folders. 
<p>
<b>Editor</b> <b>interface</b>. You can hook <i>exmh</i> to your favorite editor using the <i>exmh</i>-<i>async</i> script. Or, Tcl-based editors such as <i>mxedit</i> can interact with <i>exmh</i> directly. As the default, a simple built-in editor named <i>sedit</i> is provided. 
<p>
<b>Keybinding</b> <b>User</b> <b>Interface</b>. Bindings for common editting and cursor motion commands are exposed in a UI that lets you choose keystroke sequences to match your expectations. You can also define key bindings for Tcl commands that are part of the implementation. 
<p>
<b>Aliases</b> <b>User<b></b>Interface</b>. A browser for your MH aliases lets you define new aliases and insert aliases into mail messages. 

<p>
<b>Pretty</b> <b>Good</b> <b>Privacy</b> <b>(PGP)</b>. If you have PGP, you can use it from <i>exmh</i> to digitally sign, encrypt, and decrypt messages. 
<p>
<b>Preferences</b> <b>User</b> <b>Interface</b>. There are many knobs and dials you can adjust to control the behavior of <i>exmh</i>. 
<p>
<b>URL</b> <b>Smarts</b>. Exmh can scan for embedded URLs in your messages, and it can look for X-URI: mail headers. These are turned into active text buttons. Click on them and exmh asks your favorite Web browser to display the URL. 
<p>
<b>User</b> <b>Programming</b>. If the preference settings are not enough for you, you can program <i>exmh</i> more directly. You can define new buttons and menus and add new Tcl code to its implementation. This is described in the <i>exmh</i>-<i>custom</i> man page. 
<p>
<a NAME="sect3" HREF="#toc3"> 

<h2><b>GETTING</b> <b>STARTED</b></a>
 </h2>Mostly likely you are already an MH user. If not, go through the tutorial in the basic 
<a HREF="exmh.html"><i>exmh</i></a>
 man page. 
<p>
If you previously used a mail reader like Elm or Sun's mailtool that manages mail folders in mbox-like files, then you can use the <i>Import</i> <i>mailbox</i> <i>folders</i> menu entry to copy your old folder contents into the folders manage by MH and <i>exmh</i>. This menu entry is under the folder More... menu. 
<p>
There is an extensive Preferences system for <i>exmh</i> that lets you tune it in many ways. Throughout the man page, references to Preference settings will be made when there are tunable parameters associated with a feature. A more complete description of the Preference facility is given in the 
<a HREF="exmh-custom.html"><i>exmh</i>-<i>custom</i></a>
 man page. 
<p>
<a NAME="sect4" HREF="#toc4"> 

<h2><b>KEYBOARD</b> <b>COMMANDS</b></a>
 </h2>Several of the folder and message operations have keystroke bindings so you can do much of your browsing with hands on the keyboard. The default bindings are given here using the Tk syntax that you'll need to use in the Bind dialogs. Capitalization is important. For more information, see the <i>exmh</i>-<i>custom</i> man page. 
<p>
&lt;Control-Return&gt; - Commit 
<br>
&lt;Key-i&gt; - Inc 
<br>
&lt;Key-f&gt; - Forward 
<br>
&lt;Key-r&gt; - Reply 
<br>
&lt;Key-c&gt; - Compose 
<br>
&lt;Key-p&gt; - Previous 
<br>
&lt;Key-P&gt; - Previous message, but do not display it. 
<br>
&lt;minus&gt; - Previous message, even if it is marked for delete or move. 
<br>
&lt;Key-n&gt; - Next 
<br>
&lt;Key-N&gt; - Next message, but do not display it. 
<br>
&lt;Key-F&gt; - Change to next folder with unseen messages. 
<br>
&lt;Key-U&gt; - Next unseen message, if any. 
<br>
&lt;Key-s&gt; - Display the current message. 
<br>
&lt;Key-d&gt; - Delete and advance 
<br>
&lt;Key-D&gt; - Delete and advance, but do not display. 
<br>
&lt;Key-m&gt; - Move and advance 
<br>
&lt;Key-M&gt; - Move and advance, but do not display. 
<br>
&lt;Key-u&gt; - Unmark a pending delete or refile from the current message(s). 
<br>
&lt;Key-z&gt; - Highlight embedded URLs 
<br>
&lt;space&gt; - page forward the message display. 
<br>
&lt;BackSpace&gt; - page back the message display. 
<br>
&lt;dollar&gt; - `$' Go to last message, but do not display. 
<br>
&lt;asciicircum&gt; - `^' Go to first message, but do not display. 
<br>
&lt;question&gt; - `?' Bring up the Command binding dialog. </p>
<p>
You can browse, change, and define new command keystrokes via the Bind user interfaces available under the Bindings menu. There are two dialogs: one for editing commands in the built-in editor, and another for the command bindings described above. 
<p>
<a NAME="sect5" HREF="#toc5"> 

<h2><b>THE</b> <b>EXMH</b> <b>DISPLAY</b></a>
 </h2>At the top of the display is a subwindow that has a label for each of your top-level folders. In the middle there is a table of contents for the current folder. At the bottom the current message is displayed. Both the folder display and table of contents have some highlights that are described below. 
<p>
The command buttons are grouped into three sets. The buttons along the top apply to <i>exmh</i> itself, such as Help, Preferences, and Quit. The buttons above the scan listing are operations on folders, like Inc and Commit. There is a menu there labeled More... that has several more folderrelated operations like Pack and Sort. The row of buttons above the message display are for operations on messages, such as Send, Next, and Delete. There is another menu here labeled More... that has several more operations on messages, such as Print, Edit, Burst Digest, and Edit Message. 
<p>
The version number of <i>exmh</i> is displayed next to the top row of buttons. The release cycle for <i>exmh</i> goes something like 1.5alpha, 1.5beta, 1.5gamma, ... 1.5, 1.6alpha, and so on. The unqualified versions are deemed "stable" enough for naive users. 
<p>
Summary information for the current folder appears next to the folder buttons. This indicates the current folder and how many messages are in it. Just below the scan listing is a status line that provides some feedback about what <i>exmh</i> is doing. When a new message is displayed, the subject or Content-Description component is displayed there. Just to the left of this the folder and number of the current message is displayed. 
<p>
To the left of the message buttons the EXMH logo appears. This is replaced with the facesaver image of the person, or their organization, that sent the current message. 
<p>
The black diamond to the right of the status message area is a grip that you use to change the boundaries between subwindows. The resize unfortunately depends on heuristics based on the size of text being displayed in the window, so you have to have a message displayed before the resize will work. 
<p>
Press the first mouse button on the black diamond and a horizontal line appears. As you drag the line up and down, the status message indicates what boundary you are changing. Initially you are adjusting the scan listing (middle subwindow). If you drag the line off the top of the scan listing, the mode changes and are now adjusting the folder cache size, if it exists. If you drag the line above the folder cache, the mode changes again you are changing the main folder display area. As you drag the line down, the mode changes again. The main drawback of the automatic mode sensing is that you cannot grow the main folder display area by more than the size of the folder cache, if it exists. 
<p>
There are also preference settings for each of the subwindow sizes. Look under Scan Listing, Folder Cache, and Folder Display preferences. 
<p>
<a NAME="sect6" HREF="#toc6"> 

<h2><b>FOLDER</b> <b>DISPLAY</b></a>
 </h2>The top subwindow has a label for each of your MH folders. The folder display is highlighted to reflect the state of folders. The <i>Color</i> <i>Legend</i> menu item under the main Help menu will display a key for the highlights. 
<p>
black - the current folder. 
<br>
bold outline - a folder with unseen messages. stippled background - the target folder for move and link operations. 
<p>
On color displays: 
<p>
red - the current folder. 
<br>
blue - a folder with unseen messages. yellow - the target folder for move and link operations. Folders that have nested folders under them are highlighted by a shadow box. 
<p>
The mouse bindings for the folders labels are: 
<p>
Left - Change to folder. 
<br>
Middle - View nested folders. 
<br>
Right - Refile current messages to the folder. 
<p>
Shift-Right - Link current messages to the folder. Shift-Middle - Drag a folder label to some drop target. 
<p>
Note that a right click does two things at once. It selects the target folder for refile, and it marks the currently selected message(s) for pending refile to that folder. This might seem over-eager at first, but it is quite useful once you get used to it. The currently selected target folder remains highlighted, and you can move a message to this folder by clicking the Move button or typing `m'. 
<p>
A middle click on the folder label displays a popup window with the folder labels for nested folders, and you can operate on these labels just like the top-level ones. The popups work recursively for nested folders. When the mouse leaves the pop-up it is withdrawn. The Folder Display preferences lets you adjust how the pop-up behaves. 
<p>
<i>Hint</i>: If you change the popup-related settings, you'll have to resize the <i>exmh</i> window a bit to force it to redisplay the folder labels. Only then will the new bindings take effect. 
<p>
You can make the folder display into a separate top-level window with a setting under the Folder Display Preferences. This means you can close the main window and still view the folder display to see what folders have new mail in them. When you click on a folder label the main window will be opened automatically. 
<p>
<a NAME="sect7" HREF="#toc7"> 

<h2><b>FOLDER</b> <b>CACHE</b></a>
 </h2>Below the main folder display is a cache line of recently visted folders. If you have nested folders, their complete pathname is given in the cache window. Using the Folder Cache preferences settings you can choose how many lines of folder cache. You can also put some folders into the cache permanently with the Sticky Folders preference item. 
<p>
If you don't have many folders, the folder cache line is really just a waste of screen real estate. In this case, set the number of folder cache lines to 0 in the Folder Cache Preferences section to eliminate this part of the display altogether. 
<p>
You can drag folders in and out of the folder cache. Use &lt;Shift-Button-2&gt; to drag a folder label. Drag a label from the main display into the cache to add it, or from the cache to the main display to remove it from the cache. 
<p>
<a NAME="sect8" HREF="#toc8"> 

<h2><b>FOLDER</b> <b>TABLE</b> <b>OF</b> <b>CONTENTS</b></a>
 </h2>The middle subwindow lists the messages in the current folder. 
<br>


<p>
The lines of the scan listing are highlighted to reflect the state of each message. On color displays: 
<p>
Red - the current message. 
<br>
Blue - unread messages. 
<br>
Grey background - messages marked for deletion. Yellow background - message marked for refile to another folder. 
<p>
On monochrome displays: 
<p>
Reverse video - the current message. Underlined - unread messages. 
<br>
Cross-hatched background - messages marked for deletion. Stippled background - message marked for refile to another folder. 
<p>
The mouse bindings for the scan listing are listed below. "Drag" refers to holding the mouse button down while moving the mouse. 
<p>
Left - select and display a message. 
<br>
Left-Drag - select a range of messages. 
<br>
Shift-Left - modify the selected range. 
<br>
Middle-Drag - scroll the display. 
<br>
Right - select but do not display the message. 
<br>
Shift-Right - Drag folder/msgID to drop target. 
<p>
Several of the operations on messages can be applied to a set of selected messages. You can create a discontinuous selection by using the Shift-Left (and Shift-Left-Drag) mouse actions. 
<p>
<i>Hint</i>: The scan listing comes from <i>both</i> the MH <i>scan</i> and <i>inc</i> programs, depending on circumstance. If you define a custom scan format, set the same filter in your profile for both <i>inc</i> and <i>scan</i>. 
<p>
<a NAME="sect9" HREF="#toc9"> 

<h2><b>MESSAGE</b> <b>DISPLAY</b></a>
 </h2>The current message, if any, is displayed in the bottom subwindow. The uninteresting mail headers are scrolled off the top of this display initially. You can control this with the Header-Display and Header-Suppress profile entries as described in the <i>exmh</i>-<i>custom</i> man page. That man page also describes how to colorize different mail headers. 
<p>
Pressing the space bar will page you through the message, or take you to the next message if you are at the end of the current message. Backspace will go back a page. You can also scroll the message with the mouse by using the scrollbar or drag-scrolling. 
<p>
MIME messages are indicated by displaying their contentdescription in the status line. The mouse cursor is changed to a watch while the MIME message is parsed and displayed. On a color display, a MIME message body is displayed in a slightly darker background. This shading is used to indicate the depth of nesting in a multipart MIME structure. 
<p>
A popup menu is available to process MIME messages, such as saving their contents or processing the contents with an external viewer. Press the right mouse button in the message display area to obtain this menu. Make sure you press the mouse button over the message body, not the headers. For multipart messages, the menu changes depending on what part of the message you are looking at. See also the Preferences entry for MIME for some parameters you can adjust. 
<p>
Every content type can be saved or printed, and other types can have additional options depending on entries in your site's mailcap file. The print function just prints the item as text using your Print preferences command. The print-with-mailcap entry, if available, uses the print command as defined for the content-type in the mailcap file. 
<p>
You can display a message in a new top-level window in order to save it around on your display. Use the Clip operation under the message More... menu. This will display the current message in a new, larger window. 
<p>
Exmh can cooperate with a WWW browser to display web pages. If you get a URL in a mail message, then use the `z' keystroke to highlight the URLs in the message. (This is adhoc and not %100 accurate.) The URLs are turned into active text buttons. Click on one and exmh asks your web browser to display the page. You can have exmh scan every message automatically for URLs, although this can be slow. Tune this with the settings under the WWW preferences. 
<p>
If exmh sees special X-URL (or X-URI) headers it will turn the facesaver area into an active button. It takes on a raised relief and when you click on the face (or exmh logo) then the web browser is asked to display the URL in the XURL header. More and more folks are putting X-URL headers into their mail messages so you can find their home page. 
<p>
<a NAME="sect10" HREF="#toc10"> 

<h2><b>MANAGING</b> <b>MESSAGES</b></a>
 </h2>There are three basic actions you can take with a mail message: leave it alone, delete it, or refile it to another folder. You automatically advance to the next message after you delete or refile the current message. This makes it easy to go through your mail messages, deleting and refiling as you go. There are several settings under the Scan Listing preferences section that control the behavior of <i>exmh</i> when reading mail, and some of these will be mentioned below. 
<p>
Like <i>xmh</i>, <i>exmh</i> does deletes and refiles in two steps. In the first step you <i>mark</i> a message as needing some action. Later on you <i>commit</i> these changes by pressing the Commit button, or by pressing &lt;Control-Return&gt;. Unlike <i>xmh</i>, however, <i>exmh</i> requires that you commit changes before you view a different folder. Marked messages are highlighted in the scan listing, as described above. If you reselect a message marked for refile, the destination folder for that message is shown in the Status line. 
<p>
<b>Deleting</b> <b>Messages</b>. To delete a message, use the Delete button or press `d'. Delete results in a call to <i>rmm</i>. If you want deleted messages to be refiled into a special folder (e.g. +wastebasket or +deleted), you'll have to define a shell script and register that as your rmmproc in your .mh_profile. 
<p>
<i>Trick</i>: If you press `D' to delete a message, then you advance to the next message without displaying it, so you can quickly go through a folder to clean it up. 
<p>
<b>Refiling</b> <b>Messages</b>. To refile a message, right click on the destination folder. This marks the current message(s) for refile to that folder, and leaves the folder selected as the current target folder. If the right target is already selected, then you can use the Move button or type `m' to refile the message and advance to the next message. 
<p>
<i>Trick</i>: If you press `M' to refile, you advance but do not display the next message. 
<p>
<b>Undo</b><i>Unmark</i> (<i>Undo</i>) message More... menu entry. This operation applies to the currently selected message(s), not necessarily to the last message you marked for delete or refile. If you want to change the disposition of a message, like refile it instead of delete it, you do not need to unmark it first. Just select it and take the new action. 

<p>
<i>Trick</i>: use `-' (minus) to back up to a message you just marked, and `u' to unmark the message. 
<p>
<b>Linking</b> <b>Messages</b>. To link the current message(s) into a folder, hold the shift key down as you right click the desination folder label. If the right folder happens to be selected as the target already, you can also use the Link button. If you use Link frequently, you should adjust the 
<p>
Scan Listing preferences item for <i>Advance</i> <i>after</i> <i>Link</i>. If you turn this off, then the current message remains selected after a Link, which makes it easier to link a message into multiple folders. 
<p>
<b>Auto</b> <b>Commit</b>. The <i>Auto</i> <i>Commit</i> Scan Listing preferences item will let <i>exmh</i> commit your changes when you change folders, sort or pack a folder, or quit the program. Without auto commit, you will be propted to commit when you try to take one of these actions and have messages still marked for delete or refile. In addition, auto commit will commit changes when you close the main window. 
<p>
<b>Implied</b> <b>Direction</b>. The next message viewed after a Delete or Move is usually the next message. However, if you set the <i>Implied</i> <i>Direction</i> preference item, then <i>exmh</i> will remember your last Next or Prev action and move that direction after a Delete or Move. This means you can just as conveniently go through a folder backwards as forwards, although it might catch you by suprise. 
<p>
<b>Skipping</b> <b>Marked</b> <b>Messages</b>. The <i>skip</i> <i>marked</i> <i>msgs</i> preference item controls whether Next and Prev take you to a message marked for delete or refile, or whether you skip over these. Remember the handy `-' key binding, which takes you to the previous message even if it is marked. 
<p>
<b>Changing</b> <b>Folders</b> <b>Automatically</b>. When you are at the end of a folder, <i>exmh</i> will be ready to take you to the next folder that has unseen messages in it. You can just press Next, and it will automatically change folders for you. If you have marked messages, however, you will be reminded of that. At this point you can press the Commit button, or if you have auto-commit enabled, then you can press the Next button again to trigger the commit and folder change. If you always want to be warned before an automatic folder change, enable the <i>Next</i> <i>Guard</i> preference item. With this enabled you will have to click Next twice (or type `n' twice) to get the automatic folder change. It will also tell you to which folder it is about to change. 
<p>
The final twist on automatic folder changing is that, by default, <i>exmh</i> will automatically change back to your "first" folder if there are no more folders with unseen messages in them. You can disable this feature with the <i>Cycle</i> <i>back</i> <i>to</i> <i>first</i> preference item. The default Folder-Order profile component defines inbox to be the first folder, so ordinarily you will change back there. The Folder-Order profile component is described in the <i>exmh</i>-<i>custom</i> man page. 
<p>
<a NAME="sect11" HREF="#toc11"> 

<h2><b>SENDING</b> <b>MAIL</b></a>
 </h2>This section describes how to start a mail message. The messages are created as templates in your drafts folder and then your editor is opened on the draft. The next two sections describe how to actually compose the message when using the built-in editor or an external editor. 
<p>
<b>Sending</b> <b>a</b> <b>New</b> <b>Message</b>. Use the Send message button to create a new draft message. This runs the MH <i>comp</i> command to set up the template for the draft, so it is affected by your components file, if any, and your comp profile entry, if any. 
<p>
<b>Replying</b> <b>to</b> <b>a</b> <b>Message</b>. The Reply... menu has two entries: <i>Reply</i> <i>to</i> <i>sender</i> and <i>Reply</i> <i>all</i>. These use the MH <i>repl</i> command, so they are affected by your replcomps file, if any, and your repl profile entry, if any. The first entry uses -<i>nocc</i> <i>to</i> -<i>nocc</i> <i>cc</i> so that the reply just goes to the sender and you, while the other entry uses -<i>cc</i> <i>all</i> so that the reply goes to everyone in the To and Cc headers of the original message. There is also an entry that displays instructions for adding more entries to the Reply... menu. This is described in more detail in the <i>exmh</i>-<i>custom</i> man page.. 
<p>
<b>Forwarding</b> <b>a</b> <b>Message</b>. Use the Forward button to forward the current message, or messages. This uses the MH <i>forw</i> command to set up the message, so it is affected by your forwcomps file and your forw profile entry, if these exist. 
<p>
<b>Using</b> <b>an</b> <b>Existing</b> <b>Message</b> <b>as</b> <b>a</b> <b>Template</b>. You can use an existing message as a template for a new message by using the <i>Use</i> <i>message</i> <i>as</i> <i>draft</i> menu entry under the message More... menu. In this case the message is copied into the draft folder first. You will also use this menu entry if you have to go back into your drafts folder to continue work on a message draft. 
<p>
<a NAME="sect12" HREF="#toc12"> 

<h2><b>THE</b> <b>BUILT-IN</b> <b>EDITOR</b></a>
 </h2>The built-in editor provides a handful of text editting commands and several operations that affect the formatting of a mail message. 
<p>
<b>Sending</b> <b>a</b> <b>Message</b>. Usually all you need to do is fill in the headers of your message, type in the message, and press the Send button. When you start, the cursor will be positioned at the end of the first empty header line, or at the begining of the message body if, as with reply, all the headers are already initialized. When entering the headers, &lt;Tab&gt; will take you to the next header line, and &lt;DoubleTab&gt; will position the cursor at the start of the message body. 
<p>
The only important rule to remember about mail messages is that the header and body are separated by a blank line. In addition, MH supports a header separator line of all dashes, ------. 
<p>
<b>Saving</b> <b>a</b> <b>Draft</b>. If you want to save a message draft and return to it later, use the Save&amp;Quit button. If you want to send a message but save it for use as another draft, select the <i>Keep</i> <i>on</i> <i>Send</i> checkbox item under the More... menu. In this case, when you click Send the editor will remain open and the message will remain in your drafts folder. Otherwise the draft message is removed from the drafts folder after it has been succesfully sent. (Actually, it is renamed in the same fashion that <i>rmm</i> renames deleted messages.) If you quit <i>exmh</i> and you have drafts in progress, they are automatically saved and remain in your drafts folder. 
<p>
<i>Warning</i>! the Save button under the More... just writes the editor's buffer to the file system. It does not imply that the draft will remain after it is sent. You probably want Save&amp;Quit or Keep on Send instead. 
<p>
<b>Aborting</b> <b>a</b> <b>Draft</b>. If you decide you do not want to send a message, you can delete it by pressing the Abort button. If you have not changed the initial template it will be aborted immediately. Otherwise it will prompt you for confirmation. 
<p>
<i>Trick</i>: a second click on the Abort button is the same as clicking the OK button in the confirmation dialog. 
<p>
<b>Signatures</b>. The editor supports signatures in two ways. If you select Auto-sign from the Simple Editor Preferences section, then your .signature file will be appended to the message when you press the Send button. Otherwise, you can use the Sign button to insert your .signature file at the end of the message. 
<p>
If you have several files that match the pattern ~/.signature*, then you will have a menu of signature options available under the Sign... menu, which replaces the Sign button. You can define the default choice with a Preference setting under the Simple Editor section. With auto-sign, the Sign... menu has a set of check box items that determine which signature file will be used. Otherwise, the menu simply selects which signature you want to insert at the end of the message, and the signature is inserted when you select the menu entry. If you are composing a multipart MIME message, your signature is added as another MIME part. 
<p>
<i>Trick</i>: if your signature file has the execute permission set, then exmh will try and execute it and use its output for the signature. If you accidentally have the execute bit set, the error that occurs may not be that clear. 
<p>
<a NAME="sect13" HREF="#toc13"> 

<h2><b>MAIL</b> <b>FORMATTING</b></a>
 </h2><b>Line</b> <b>Breaks</b>. By default, you can just type in long lines and they will wrap at word boundaries when the line gets too long. This actually happens twice, the first time by the Tk text widget when you enter text. Unfortunately, this doesn't actually insert newline characters, and it is done based on the size of the window. Therefore, the line breaking is done a second time by <i>exmh</i> after you press the Send button. The line length limit defaults to 79, although you can change that in the Simple Edit Preferences section. 
<p>
<i>Hint</i>: If you change the line length, you should also resize the editor window to match the width (e.g. 72) so your message will look right as you type it in. Set the following resource in your ~/.exmh-defaults 
<p>
*Sedit*Text.width: 72 
<br>


<p>
<b>Changing</b> <b>Fonts</b>. You can use the Text... menu to change the font of the selected text. This promotes your message to a MIME content-type of text/enriched. The encoding of these text looks is also done when you press the Send button. You may see the encoding after clicking Send as a side-effect of the way this is implemented. 
<p>
The <i>Insert</i> <i>File</i>... menu entry is used to insert a file asis, with no MIME structure. The file is inserted at the current insert point in the editor. 
<p>
The <i>Insert</i> @ button is used to insert the body of the message being replied to. This button is only enabled when you are replying to a message. The body is formatted a little, just by prefixing each line of the message body with a string. The default is "&gt; ", and you can change this via the Simple Editor Preferences section. 
<p>
<i>Note</i>: it is apparently not possible to define a repl prefix with leading spaces. This is a side effect of storing the prefix in the X resources database. 
<p>
The <i>Cite</i> <i>Selection</i> menu entry formats and inserts selected text. It is assumed that the text is from the current message, and the sender of that message is identified just before the inserted text. You can use this feature to insert text from several different messages. 
<p>
The <b>PGP</b> menu provides access to the Pretty Good Privacy public key system. With this you can send messages with a digital signature that certifies that you sent the message. 
<p>
You can also encrypt and decrypt messages with PGP. A complete discussion of PGP is far beyond the scope of this man page. However, if you know PGP, you will find the PGP features of <i>exmh</i> useful. 
<p>
<i>Hint</i>:. The <i>Insert</i> <i>PGP</i> <i>Keys</i> menu entry is hiding over in the Sedit More... menu. Use this to insert your public key or other public keys into a mail message. By default, only your keys are listed in the key chooser. Just type in part of the key ID of any key you want to choose and matching keys are displayed. Try `*' to list all keys. 
<p>
<a NAME="sect14" HREF="#toc14"> 

<h2><b>MIME</b> <b>FORMATTING</b></a>
 </h2><i>Warning</i>! The line-break formatting described above can interact poorly with the formatting described next. This is one of the roughest spots in the <i>exmh</i> implementation. For example, if you include a file in your message that has important formatting, like a Postscript file or some program code, you will want to disable the line-break formatting. You can do this by turning off the <i>Format</i> <i>mail</i> checkbox item under the More... menu. 
<p>
If you are familiar with MHN directives, you can enter them into your message. In this case, you will want to select the <i>Attempt</i> <i>MHN</i> checkbox menu item under the More... menu. Again, you will probably want to disable <i>Format</i> <i>mail</i> to make sure that long MHN directives are not chopped into multiple lines at the wrong place. 
<p>
You can create a multipart MIME message by using the <i>Insert</i> <i>Part</i>... menu item. This adds another part to your message, promoting it to MIME content-type multipart/mixed if necessary. The first time you add a part, you have the option of preserving the existing message body or completely replacing it. When the file is inserted you are asked to choose its MIME content-type and content-transfer-encoding. 
<p>
The <i>Insert</i> <i>External</i>... menu entry is used to create a MIME part of Content-Type message/external-body. This is an indirect reference to a file, which is either a local file or a file available via anonymous FTP. A dialog lets you fill in the various parameters to the indirect reference. For an anonymous FTP pointer, the <i>Site</i> is the internet host name and the <i>Directory</i> and <i>File</i> <i>name</i> determine what file it is. The <i>Transfer</i> <i>mode</i> is either "text" or "image". Use "image" to ensure that all 8 bits of each byte get transferred. The <i>Description</i> is for the benefit of the reciever of the mail message and should describe what the pointer references. 
<p>
<i>Trick</i>: A file section dialog appears first, but this is not always appropriate if you are making an external reference to a non-local FTP site. Just hit cancel on the file selection dialog. Then, when you enter the file name, the content-type will be inferred from the name. You can always override the content-type if <i>exmh</i> guesses wrong. 
<p>
<b>8</b> <b>BIT</b> <b>CHARACTERS</b> 
<br>
The built-in editor supports 8-bit characters found in European character sets. Insert an 8-bit character by pressing the Compose key and then two other keys to get the special character. For example, Compose, then <b>e</b> and <b>`</b> creates an accented e character. All the vowels can be composed with ` ` and " to get accents, and there are several more bindings. The complete table of compose key sequences is given by the <i>Compose</i> <i>Key</i> entry in the Bindings... menu. 
<p>
When you compose a mail message that contains 8-bit characters you need to be careful when sending it. Some mail gateways do not like 8-bit characters and will bounce the message or corrupt it. The Quoted-Printable encoding will protect 8-bit characters. The built-in editor will do this quoting for you if it detects input of an 8-bit character. The quoting is done when you press Send. You can control whether or not this happens with a combination of the Quote Printable menu entry (for per-message control) and the Quoted Printable default preference item for the Simple Editor. 
<p>
The built-in editor handles the special coding required when including 8-bit characters in mail headers. 
<p>
When you are replying to a message that contains 8-bit characters, it may be encoded, too. The Insert @ operation will first decode the message so that the true 8-bit characters are inserted into the editor buffer. This works better than the repl filters than include the message body. If you use one of those, then you'll see the quoted-printable encoding instead of the 8-bit character. 
<p>
<a NAME="sect15" HREF="#toc15"> 

<h2><b>USING</b> <b>ANOTHER</b> <b>EDITOR</b></a>
 </h2>You can use your favorite editor with exmh by specifying an <i>Editor</i> <i>command</i> in the Editor Support Preferences section. This command has the complete pathname of the draft message appended to it before it is executed. Several examples of editor commands include: 
<p>
sedit 
<br>
mxedit 
<br>
emacsclient &amp; 
<br>
gnuclient &amp; 
<br>
exmh-async emacs 
<br>
exmh-async emacsclient 
<br>
exmh-async gnuclient exmh-async xterm -e vi 
<br>
The built-in editor is called <i>sedit</i>. <i>Mxedit</i> is a Tcl-based editors that know how to communicate with <i>exmh</i> about draft messages. <i>emacsclient</i> is a program that is used to communicate with a running <i>emacs</i> in order to get it to edit a specified file. You will need the "server.el" package for emacs in order to set up your emacs as a server for this arrangement. There is more information about this in the misc directory of the <i>exmh</i> distribution. <i>emacsclient</i> can used in two ways. If you can post the message directly from emacs, then just use "emacsclient &amp;" and <i>exmh</i> forgets about the draft and assumes <i>emacs</i> will take care of it. Otherwise, use the exmh-async wrapper that is described below. 
<p>
After the editor exits you are presented with a <i>What</i> <i>Now</i> dialog that gives you several options: Send, Abort, Save, Re-edit, and More... Under the More.. menu you can apply MHN, run a spell checker, or run the MH whom program to verify the addresses you have specified. You can also invoke the built-in editor, <i>sedit</i>, in case you want to use its MIME composition features. 
<p>
There is an "Alternate Editor" preference setting. The built-in editor has a menu entry that saves the draft and starts the alternate editor. The What Now dialog also has a menu entry to do this. 
<p>
In most cases you will use the <i>exmh</i>-<i>async</i> wrapper script to run an external editor. This is a short Tcl/Tk script that runs your editor and then communicates with <i>exmh</i> when your editor exits. This means the <i>exmh</i> user interface can remain active while you compose your message. You can even compose several messages at once. You will get a different <i>What</i> <i>Now</i> dialog for each message draft. 
<p>
The <i>exmh</i>-<i>async</i> wrapper tries to pass through all the arguments to the editor command you specify. However, a couple arguments are picked up by the Tcl/Tk shell (wish). Some tricks are played, however, so you can protect arguments. For example, the following works: 
<p>
exmh-async xterm {-geo 80x40+0+0} -e vi {+c /: *$} This protects the -geo argument from exmh-async, and it protects the complex format of the <i>vi</i> search command from interpretation by the Tcl parser. 
<p>
As a final note, if you try to test exmh-async from the command line, you need to execute it like this: 
<p>
exmh-async exmh xterm -e vi &amp; 
<p>
The first argument is the name of the exmh application, which is needed for the Tk-based communication between exmh-async and exmh. This argument does not appear when you define the command in Preferences. 
<p>
<a NAME="sect16" HREF="#toc16"> 

<h2><b>FILTERING</b> <b>MAIL</b></a>
 </h2>One of the strong points for <i>exmh</i> is its support for mail filtering systems that file messages into different folders as they are delivered. The filtering is done by looking for patterns in the mail headers. For example, you can put all the mail from your boss into one folder, and all the mail from a mailing list or digets into another folder. <i>Exmh</i> visually highlights the folders that have new mail. This depends on the definition of the Unseen-Sequence profile component, and the support of this sequence by the mail filtering system. Both the <i>slocal</i> and <i>procmail</i> filtering systems use the <i>rcvstore</i> program that takes care of these details. The <i>inc</i> program also adds messages to the unseen sequence, so even if you do not filter mail the new messages in inbox will be highlighted by <i>exmh</i>. 
<p>
The standard filter used with MH is described in the mhook (or slocal) man page. Below is a quick summary of how it works. You must maintain a file named ~/.maildelivery that has your mail filter specifications. The contents of the file are explained below. If you can forward mail into programs at your site, then put this into your .forward file to get filtering: 
<p>
| /usr/local/mh/lib/slocal -user yourname 
<p>
Alternatively, if you select the "presort" inc-style described below, then exmh will run slocal for you each time you say Inc. 
<p>
If you use the <i>procmail</i> system, or perhaps supply your own, use the MH rcvstore program to put messages into folders. This program updates the unseen sequence so exmh can find the new mail. Unfortunately, the rcvstore program is in the MH library, so you must reference it with a long pathname, (e.g., /usr/local/mh/lib/rcvstore.) 
<p>
A sample .maildelivery filter file is shown below. Note: this file is ignored if it has group or world write permission. It uses the <i>rcvstore</i> program to refile messages into different folders. The first field is the header to match, and the second is the value to look for. This is a caseinsensitive string. The third column specifies an action. In this case | says to pipe the message into the program in the last column. The fourth column provides limited decision making. In this case the ? means to try and match this filter if the message has not already matched a previous filter. The complete syntax of the filters is given in the mhook man page. 
<p>

<pre>
subject exmh   | ? "/usr/local/lib/mh/rcvstore +exmh"
subject mxedit | ? "/usr/local/lib/mh/rcvstore +mxedit"
subject book   | ? "/usr/local/lib/mh/rcvstore +book"
to journalclub | ? "/usr/local/lib/mh/rcvstore +journal"
from footbag-digest" | ? "/usr/local/lib/mh/rcvstore +footlist"
default -      | ? "/usr/local/lib/mh/rcvstore +inbox"
</pre>
<i>Warning</i>! If you use the .maildelivery file to filter messages, you should always have a default action in the file that refiles the messages into your inbox (or some catch-all folder). Depending on your local configuration, there might not be a good pre-default default action. If there is no default action, mail that does not match a filter will be discarded! 
<p>
A patch for the slocal program is distributed with exmh. It adds an additional syntax to the maildelivery file that makes it simpler to use rcvstore. Use the + operation instead of | (pipe) to specify a refile action. The above example looks like this: 
<p>

<pre>
subject exmh   + ? "exmh"
subject mxedit + ? "mxedit"
subject book   + ? "book"
to journalclub + ? "journal"
from footbag-digest" + ? "footlist"
default -      + ? "inbox"
</pre>
<b>Incorportating</b> <b>Mail</b>. The filtering support affects the way you incorportate mail from your system spool file. <i>Exmh</i> supports several different styles: <i>inbox</i>, <i>multidrop</i>, <i>presort</i>, <i>presortmulti</i> and <i>none</i>. Use the <i>Incorporate</i> <i>Mail</i> preference section to choose one. You may also want to enable periodic inc under the <i>Background</i> <i>Processing</i> preferences section. 
<p>
inbox 
<br>
Inc moves new messages into your inbox folder. This is the default. No filitering is done, but the inbox folder label will highlight when new mail is incorporated into it, and unread messages will be highlighted. 
<p>
none If you use your .forward file to process mail through an external program in order to deliver messages into various folders, then you don't need Inc in the user interface. Selecting "none" will eliminate the Inc button altogether and disable the internal Inc procedure. A background "flist" task is a nice complement to this setting so that you can see what folders are getting mail. 
<p>
presort 
<br>
Inc moves new messages directly into various folders. This is similar to what you may be doing already with an external program. This is built this into exmh in order to elminate the need for an external program. (I cannot use a .forward file at my site.) The way presort works is to inc from your spool file into a temporary folder (MyIncTmp). Then, the MH filtering hook <i>slocal</i> is run on each message. In this mode, it is expected that the filtering action is to put the message into a folder. You do this by specifying an action that is to pipe the message into the MH <i>rcvstore</i> program. See the MH man page for <i>mhook</i> for details. 
<p>
multidrop 
<br>
This assumes that you use POP or the MH maildelivery facilities (see <i>mhook</i>) to put new messages into a set of dropboxes (inbox-like files). You set up the correspondence between POP hosts and folders, or between inbox files and folders with your ~/.xmhcheck file. Inc moves messages from the POP server or dropboxes into folders. The format of each line of ~/.xmhcheck file is shown below. In the first case, the file name must be an absolute pathname (i.e., has leading /). In the second case (POP), the third field is an optional user ID. 
<p>
presortmulti 
<br>
This is a combination of multidrop and presort. Any dropbox that is associated with the MyIncTmp folder gets filtered just as with presort. 
<p>
The <b>.xmhcheck</b> file. The following shows the format of the .xmhcheck file. If the folder_name is MyIncTmp and you use presortmulti inc style, then messages are filtered after they are fetched from the dropbox. 
<p>

<pre>
folder_name /filename/of/dropbox
or
folder_name POP_hostname [POP_user_name]
</pre>
<a NAME="sect17" HREF="#toc17"> 

<h2><b>FACES</b></a>
 </h2>One of the more fun features of exmh is its ability to display the facesaver bitmap of the person that sent you mail. There are two sources of the bitmap images, either the facesaver database or inline X-Face mail header fields. These two sources can be used independently, but the main trick is getting <i>exmh</i> configured properly to use them. 
<p>
<b>Facesaver</b> <b>Database</b>. The exmh installer asks for two pieces of facesaver-related information: the root directory of your faces installation and a search path of faces directories. This assumes that you have retrieved the faces software and associated databases and installed them under on directory, which is referred to as its root directory. The default is /usr/local/faces. Underneath this directory there is assumed to be one or more directories that contain facesaver databases. It is these directories that are named in the search path; the names are relative to the root of the faces installation. Typically there is facesaver, logos, and a local database, which is called "parc" at my site. The first two databases come from the facesaver.tar.Z and logos.tar.Z files, respecitively. The default values are: 
<p>

<pre>
Faces Root Directory    /usr/local/faces
Faces Search Path       parc logos news facesaver
</pre>
If you are setting up your own database, you need to understand how it is organized. It is easiest to demonstrate by example. For myself, welch@parc.xerox.com, my facesaver image is found as com/xerox/parc/welch/face.xbm. <i>Exmh</i> will look for this file under each of the directories named by the faces search path. The complete pathname might be /usr/local/faces/parc/com/xerox/parc/welch/face.xbm. If a bitmap is not found, then the search algorithm trims off trailing components in an effort to find a more general bitmap, typically a company or organizational logo. At your site, for example, you might only have /usr/local/faces/logos/com/xerox/face.xbm, which contains the Xerox corporate logo. 
<p>
If your <i>exmh</i> installation is not correct, or if you have a personal faces database that the <i>exmh</i> maintainer doesn't know about, then you can also override the install-time settings with the FACEPATH environment variable. This is a more traditional search path of colon-separated directory names. 
<p>
<b>X-Face</b> <b>headers</b>. The X-Face header contains a compressed version of a facesaver bitmap, which is a 48x48x1 (monochrome) bitmap. The faces software comes with some filters and scripts to generate these and decompress them. The orignial purpose of the X-Face header is as a way of distributing your facesaver image so that folks can update their database. However, at the moment <i>exmh</i> just decompresses the bitmap and displayes it. It requires a Preference setting for the X-Face pipeline for this to work. If the pipeline is blank (the default), no processing is done. To decompress and display the header, use a pipeline setting like this: 
<p>
uncompface | ikon2xbm 
<br>
The uncompface program comes with the faces software. It also has a version of <i>ikon2xbm</i>, but a faster version of this program (a C program instead of some scripts) is distributed with <i>exmh</i> in its misc directory. Future versions of <i>exmh</i> will cache the results of decompressing the X-Face line in a personal faces database, but in the current version it just writes the file to /tmp/FACES.[pid]. If you are inspired you could add a Hook_MsgDisplay to stash this file into a real facesaver database. The <i>exmh</i>-<i>custom</i> man page describes hook procedures. 
<p>
<a NAME="sect18" HREF="#toc18"> 

<h2><b>SEARCHING</b> <b>IN</b> <b>EXMH</b></a>
 </h2>There are several ways to search for things in exmh: 
<p>
Find in message body 
<br>
Searching uses regular expression syntax, and case is ignored. 
<p>
Find in table of contents 
<br>
Searching uses regular expression syntax, and case is ignored. This just searches over what you can see in the display. If you select All, then all matching messages are selected. 
<p>
Hint: Use the "List only selected messages" folder More... menu entry to get a listing that only contains the selected messages. 
<p>
Pick by attributes 
<br>
A general search (i.e, MH pick) over the messages in the folder. This can run slowly because each message in the folder must be processed. You can match on various header fields by using the "Choose pick option" menu in the Pick dialog. If you choose more than one option, the messages must match all of them, unless you use the Not and Or buttons to build up more complex criteria. This interface is explained in more detail in the <i>exmh</i> man page. 
<p>
The "Add to Sequence(s)" option will add the matching messages to an MH sequence. Just pick a meaningful name for the sequence. (Sequences are not supported well by exmh, yet.) The "Pick from Seq/msg(s)" lets you narrow the search to a sequence (e.g., "unseen" or something you defined yourself) or a set of messages (e.g., last:100 for the last 100 messages in the folder). 
<br>


<p>
The "All to Sel" option determines if the matching messages are added to the currently selected set, or if a new set is created. 
<p>
Glimpse full text 
<br>
Glimpse is a full text searching tool from the University of Arizona. Invoke the "Glimpse full text" menu entry under the Search... menu to bring up an interface to this tool. You must first index your mail, so to get started click "index" to build your indexes. This process runs in the background, and the status of the index process is displayed in the Glimpse log. The storage overhead of the indexes is about 10% to 15%, which is quite good for a full text index system. 
<p>
To search, enter a word in the search area and press "Search". The button changes to a "Stop" button, although the stop may take a moment to take effect. The search results are displayed in the log. Click on the message in the log and exmh will visit that message. 
<p>
Glimpse supports approximate pattern matching, so under the Opts... menu you can choose how many errors are allowed in a word match. You can also control if the search is case sensitive or whole word. 
<p>
Exmh creates one glimpse index per mail folder. These are stored under the ~/Mail/.glimpse directory. This lets you limit the search to the current folder, or to the current folder and its subfolders. 
<p>
To update the index, just press index again. If a folder has not changed then the index is not rebuilt. While Glimpse has an incremental reindex feature, exmh does not use it. There appear to be bugs in it. 
<p>
For more information about Glimpse, see this URL: http://glimpse.cs.arizona.edu:1994/ 
<p>
<a NAME="sect19" HREF="#toc19"> 

<h2><b>TIPS</b></a>
 </h2><b>Background</b> <b>Processing</b>. You can set up <i>exmh</i> to periodically incorporate mail (i.e., <i>inc</i>) for you. If you already do this via an external agent, then you should have <i>exmh</i> periodically check for new mail in your folders, which is the <i>flist</i> action. The folder highlighting and icon feedback work best with <i>inc</i> and <i>flist</i>. You can also have it periodically run <i>msgchk</i> or count messages in your spool file, but the disadvantage of doing this is that there is no audible or icon feedback when it sees mail waiting in your spool file. Instead, there is just a status message that you might not notice. Choose what background action is taken and how frequently it is done with the Background Processing preferences section. 
<p>
<b>Scan</b> <b>Caches</b>. <i>Exmh</i> maintains a cache of the scan output for each folder. If you run MH programs from the command line it can invalidate the cache. You can manually update the cache with the <i>Rescan</i> <i>Folder</i> operation under the Folder More... menu. There are also menu entries that update scan caches for all your folders. These run in the background so the user interface can remain active. The scan cache is compatible with <i>xmh</i>. 
<p>
<b>Performance</b>. If you want message display to go as fast as possible, do three things. 1) Disable the X-Face pipeline command so you do not try to decompress X-Face headers. 2) Disable the facesaver database, which is distinct from the X-Face pipeline. Actually, this is only slow on the first message you receive from a new email address. The pathname of the bitmap image that corresponds to that address is cached to avoid the expensive lookup the next time you view a message from that address. 3) Disable the Graphic Separator in the MIME preferences. That uses a 3D line of text instead of a blank line, and it takes a bit longer to display. 
<p>
<i>exmh</i> does not like really big folders. If you have more than several hundred messages in a folder you will notice that folder change times get pretty slow. Take this as a nudge to reorganize things into subfolders. Every three months I move saved messages into subfolders with names like 94Q2, 94Q3, etc. I understand the performance problems involved, and plan to overhaul some of the exmh internals to improve this situtation. In the meantime... 
<p>
Really big folders with lots of messages in the unseen sequence are really slow. Use the "Catch-up unseen" folder More... operation to clear the unseen sequence. You probably want to do this when you import mail from other systems mailboxes. 
<p>
<b>More</b> <b>Keyboard</b> <b>Stuff</b>. If you really like using the keyboard instead of the mouse, you can change folders, set the target folder, and select messages by number with keyboard commands. When you type plus ('+'), focus warps to the status line so you can type in the name of a folder. In this mode, a plus cycles between choosing the target folder for moves or a folder to change into. &lt;space&gt; does folder name completion, &lt;Return&gt; accepts the folder name, and &lt;Control-c&gt; cancels the folder selection. If you start by typing a number (not plus), that message is selected, but it is not displayed until you press &lt;Return&gt;. 
<p>
<a NAME="sect20" HREF="#toc20"> 

<h2><b>INSTALLATION</b></a>
 </h2>Installation is done via the exmh.install script. Invoke it as: 
<p>
wish -f ./exmh.install 
<br>
This puts up a dialog box that lets you patch various file system specific pathnames and enable or disable features that your system cannot support (e.g., facesaver, sound). Read the info in the dialog box and enter the appropriate file system pathnames. Click <b>Patch</b> to sed the exmh.MASTER script and create the main exmh file, then click <b>TclIndex</b> to generate the library index, and click <b>Test</b> to try it out. If you are satisfied, click <b>Install</b> to copy the main script and the supporting libraries into their destination directories. 
<p>
Note: the "Script Library" and the "Install lib directory" are usually the same place. The script library is the runtime value of the library directory, while the install lib directory is the install-time value. During the Test run, the Script library is automatically set to "./lib" so you can run without installing. When you hit the Patch button, some consistency checks are done and a relative pathname will trigger a warning. You can ignore this when you are testing, but you should install a working copy that only references absolute pathnames. 
<p>
NOTE: Currently you cannot leave the script library where it gets unpacked. The installation procedure really assumes that the Install Directory is a different place than ./lib. You'll get an error during the install, and in fact, background.tcl will get removed as it tries to copy it onto itself. 
<p>
The original motivation for install-directory vs scriptdirectory was AFS installations in which writeable volumes have different names than their read-only, replicated volumes. In this case you want to install to the writeable volume, but run from the read-only replicas. 
<p>
If you get the Script library wrong, it will be manifest as a Tcl error about an undefined procedure named Exmh. 
<p>
Upon startup, the install will look for ../*/.exmhinstall so you can retrieve configuration information from previous versions installed in peer directories. You can also maintain configuration information via the "Conf" button, which looks for ../*/.exmhinstall*. 
<p>
A patch to the MH <b>slocal</b> program is included as "misc/slocal.patch". The patch adds a "+" syntax to your .maildelivery file that results in messages being filed into a folder by means of the MH <b>rcvstore</b> library program. You can keep your patched copy of <b>slocal</b> distinct from the installed version because <i>exmh</i> runs <b>slocal</b> directly. The installation dialog lets you set up the pathname for your custom copy. 
<p>
There is also a patch for the MH folder.c program. The patch makes "folders -recurse" run much faster because it avoids directories that do not have subfolders. The patches apply to MH 6.7. 
<p>
<a NAME="sect21" HREF="#toc21"> 

<h2><b>UPGRADING</b> <b>WITH</b> <b>PATCHES</b></a>
 </h2>There are usually patch files to go between releases (e.g. from 1.6.4 to 1.6.5). The best way to use these patches is to patch your 1.6.4 <b>source</b> <b>directory</b> and then reinstall using the procedure described above. This has the benefit of fixing the version number in the main script. Finally, this is how the patches are generated, so if you apply them to your installed directories they might not work properly. 
<p>
<a NAME="sect22" HREF="#toc22"> 

<h2><b>TK</b> <b>SEND</b> <b>AND</b> <b>XAUTHORITY</b></a>
 </h2>The thing that causes the most trouble with new exmh users is the Tk send facility and the Xauthority mechanism. This matters if you use the detached background process or the <i>exmh</i>-<i>async</i> editor wrapper. 
<p>
The send facility is used for communication between Tk interpreters. The most recent releases of Tk require that you have your X environment set up to use Xauthority. The details for doing this vary from X server to X server. The basic idea is that, <i>before</i> you start the X server you create a file, ~/.Xauthority, that contains a random bit string. The file is only readable by your user account. You pass the name of this file to the X server when you start it up. Then, each time a window is created, the client programs read this file and pass the random bit string to the server. The idea is that only programs run from your account can read the file to get the right bit string. For the details, read about the -auth or -xauth argument to your server. 
<p>
Even if you get this right, you must also make sure that the old <i>xhost</i> security system is not used. That is, the xhost list must be empty. To do this, run the following command: 
<p>
xhost - 
<br>


<p>
With release 1.6.4 and later you can have exmh police your xhost list. It can clear out any hosts that creep onto the list. This typically happens with wrapper scripts used to run other programs. If you use Xauthority properly, the additional use of xhost is completely bogus and insecure. Not to mention that it breaks Tk send. Under Background 
<p>
Processing preferences, select "Keep xhost list clear". 
<p>
The other alternative is to recompile the Tk library with the -DTK_NO_SECURITY compile flag. This is appropriate if your X server just cannot do the Xauthority protocol, or you think your environment is safe enough. That is, you don't have to worry about other users popping up rogue windows on your display. 
<p>
<a NAME="sect23" HREF="#toc23"> 

<h2><b>MORE</b> <b>INFORMATION</b></a>
 </h2>You are welcome to send bug reports and comments about exmh to the following email address: Brent.Welch@Sun.COM. 
<p>
Exmh is available via FTP on parcftp.xerox.com in the pub/exmh directory. 
<p>
MH is available as pub/mh/mh-6.8.tar.Z from ftp.ics.uci.edu 
<p>
Tcl and Tk are available in the ucb/tcl directory on ftp.cs.berkeley.edu 
<p>
Expect is available as pub/expect/expect.tar.Z from ftp.cme.nist.gov 
<p>
Metamail (for MIME support) is available in thumper.bellcore.com:pub/nsb 
<p>
Faces are available from cs.indiana.edu:/pub/faces. The individual databases are located under /pub/faces/picons/db, and they include .xbm, .xpm, and .gif representations. I recommend gettings domains.tar.Z, misc.tar.Z, and unknown.tar.Z. If you have room, also get usenix.tar.Z and users.tar.Z. 
<pre>
Database           Date            Bytes       Description
domains.tar.Z      95.12.06        1356923     Company, Country and Univ Logos
misc.tar.Z         95.11.12        58991       Things like root and postmaster
news.tar.Z         95.12.06        372765      For newsgroup (not mail)
unknown.tar.Z      95.11.12        19074       Default images
usenix.tar.Z       95.04.13        19472394    The USENIX database
users.tar.Z        95.12.08        2012905     Other personal faces
weather.tar.Z      95.11.12        146329      For weather (not mail)
</pre>
Glimpse is available from the University of Arizona: 
<br>
http://glimpse.cs.arizona.edu:1994/ 
<br>
or ftp://cs.arizona.edu/glimpse 
<p>
To get PGP, send mail to pgp-bugs@mit.edu. 
<p>
<a NAME="sect24" HREF="#toc24"> 

<h2><b>FILES</b></a>
 </h2>Your mail is collected under a directory usually called Mail. If you are using another mail system that uses that directory, set your Path MH profile entry to something else. The current folder and other information is stored in a file named "context" in your Mail directory. Your mail is stored as one message per file in directories that correspond to your mail folders. Nested folders are supported, up to the maximum depth supported for directories in your file system. Information about message sequences is kept in a file named is in the sequence named "cur", for example. New mail is in the sequence named "unseen". You can define more sequences, up to 10 per folder, but exmh doesn't support them very well. 
<p>
Exmh adds a few more files for its own purposes. It uses an alternate context stored in .exmhcontext so that command line MH programs and exmh do not interfere with each other. The .folders file lists all the mail folders you have. Each folder has a .xmhcache file that has a cache of the scan output. 
<p>
<a NAME="sect25" HREF="#toc25"> 

<h2><b>SEE</b> <b>ALSO</b></a>
 </h2>exmh, exmh-ref, exmh-custom, mh 
<p>
<a NAME="sect26" HREF="#toc26"> 

<h2><b>AUTHOR</b></a>
 </h2>Brent.Welch@Sun.COM 
<p>
<a NAME="sect27" HREF="#toc27"> 

<h2><b>THANKS</b></a>
 </h2>To Xerox PARC/CSL, for supporting this work initially, to Sun Microsystems Laboratories for continuing the support, and to all the exmh users that contributed ideas and code. 
<p>


</Body>
</Html>
EOF-EOF-EOF
NewFile html/exmh.html<<'EOF-EOF-EOF'
<Html>
<Head>
<Title>man page(1) manual page</Title>
<!-- manual page source format generated by RosettaMan, -->
<!-- available via anonymous ftp from ftp.cs.berkeley.edu:/ucb/people/phelps/tcltk/rman.tar.Z -->
<!-- Author: bwelch -->
<!-- Author: bwelch -->
<!-- Author: bwelch -->
</Head>
<Body>

<a NAME="sect0" HREF="#toc0">


<h2>EXMH</a>
 </h2>An introduction to the exmh mail user interface. 
<p>
<a NAME="sect1" HREF="#toc1"> </a>
 </p></p> 

<h1>
<a NAME="toc"><b><header>Table of Contents</b></a>
 </h1>

<p>
<ul>
<li>
<a NAME="toc1" HREF="#sect1">INTRODUCTION</li></a>
 
<li>
<a NAME="toc2" HREF="#sect2">GETTING STARTED</li></a>
 
<li>
<a NAME="toc3" HREF="#sect3">RUNNING EXMH</li></a>
 
<li>
<a NAME="toc4" HREF="#sect4">THE EXMH DISPLAY</li></a>
 
<li>
<a NAME="toc5" HREF="#sect5">SENDING MAIL</li></a>
 
<li>
<a NAME="toc6" HREF="#sect6">MOUSING AROUND</li></a>
 
<li>
<a NAME="toc7" HREF="#sect7">GETTING NEW MAIL</li></a>
 
<li>
<a NAME="toc8" HREF="#sect8">READING MIME MESSAGES</li></a>
 
<li>
<a NAME="toc9" HREF="#sect9">REPLYING TO MAIL</li></a>
 
<li>
<a NAME="toc10" HREF="#sect10">SELECTING MESSAGES</li></a>
 
<li>
<a NAME="toc11" HREF="#sect11">SEARCHING</li></a>
 
<li>
<a NAME="toc12" HREF="#sect12">FORWARDING MESSAGES</li></a>
 
<li>
<a NAME="toc13" HREF="#sect13">DELETING MESSAGES</li></a>
 
<li>
<a NAME="toc14" HREF="#sect14">LEAVING EXMH</li></a>
 
<li>
<a NAME="toc15" HREF="#sect15">PREFERENCES</li></a>
 
<li>
<a NAME="toc16" HREF="#sect16">WHAT IS MH MAIL?</li></a>
 
<li>
<a NAME="toc17" HREF="#sect17">MORE ABOUT EXMH</li></a>
 
<li>
<a NAME="toc18" HREF="#sect18">SEE ALSO</li></a>
 
<li>
<a NAME="toc19" HREF="#sect19">AUTHOR</li></a>
 
<li>
<a NAME="toc20" HREF="#sect20">THANKS</li></a>
 
</ul>
</p></p></hr> </header> 
<a HREF="#toc"></a>
 
<p>
<a NAME="sect1" HREF="#toc1"> 

<h2><b>INTRODUCTION</b></a>
 </h2>This man page provides a quick tour through some of the basic features of <i>exmh</i> <i>version</i> <i>1</i>.<i>6</i>.<i>5</i>, which provides a graphical user interface to the MH mail system. 
<p>
After you read this tutorial you should be able to use <i>exmh</i> for your basic daily mail reading needs. You will learn how to send mail, read mail, manage your messages in folders, and adjust some of the <i>exmh</i> features by means of its Preferences user interface. 
<p>
There are three other exmh man pages. 
<a HREF="exmh-use.html"><i>exmh</i>-<i>use</i></a>
 provides information about using the more advanced features of <i>exmh</i>. If you are already an experienced email user, you may want to just read the GETTING STARTED section here and then skip to the <i>exmh</i>-<i>use</i> man page. 
<a HREF="exmh-custom"><i>exmh</i>-<i>custom</i></a>
 describes how to customize exmh to suit your needs. 
<a HREF="exmh-ref.html"><i>exmh</i>-<i>ref</i></a>
 lists each button and menu entry in <i>exmh</i> and explains what they do. If you are an experienced <i>exmh</i> user, this may be the most useful man page for you. For example: 
<p>
man exmh-ref 
<br>


<p>
A cleaned up version of these man pages appear in the 3rd edition of the book by Jerry Peek, <i>MH</i> &amp; <i>xmh</i>: <i>email</i> <i>for</i> <i>users</i> <i>and</i> <i>programmers</i>, which is published by O'Reilly &amp; Associates. 
<p>
<a NAME="sect2" HREF="#toc2"> 

<h2><b>GETTING</b> <b>STARTED</b></a>
 </h2>If you are already an MH or <i>xmh</i> user, you can start with the examples given in this tour. If you are a new user, exmh will up your basic MH environment. This includes a Mail directory which will have one subdirectory for each mail folder, plus several files that MH mail uses for its own purposes. You also get a ~/.mh_profile file that has user settings for MH and exmh. 
<p>
<i>Exmh</i> 
<p>
When you run <i>exmh</i> for the first time it checks a few things in your MH profile. In particular, it depends on the Draft-Folder and Unseen-Sequence profile components. If these profile components are not present, a dialog appears and <i>exmh</i> can set them up for you. If you do not let <i>exmh</i> create them nor set them up by hand, <i>exmh</i> will not work properly. These profile entries are described in the <i>exmhref</i> man page. 
<p>
<i>Exmh</i> has been designed to be very flexible, although it will work just fine "out of the box". The Preference package used to adjust some of the settings in exmh is introduced in this man page, and some of the important settings are described here. A more complete guide to customizing <i>exmh</i> is given in the <i>exmh</i>-<i>custom</i> man page. 
<p>
<a NAME="sect3" HREF="#toc3"> 

<h2><b>RUNNING</b> <b>EXMH</b></a>
 </h2>The command to start <i>exmh</i> looks like this: 
<p>
exmh -display <i>hostname</i>:0 &amp; 
<br>
If your DISPLAY environment variable is set up properly, then the -display argument is not needed, and the command is even simpler. You do not need to specify a -geometry argument, although <i>exmh</i> supports one. Instead, simply position and size the window using your window manager. When <i>exmh</i> quits, it saves the geometry information so you don't have to worry about it. It does this with all its top level windows, so you can adjust their position once and then forget about it. There are more command line options described in the <i>exmh</i>-<i>ref</i> man page. 
<p>
You can add the exmh command to your startup X environment by editting your startup file (like .xsession). You might also want to add it to the main menu of your window manager. The details about this vary from X system to X system, so ask your local X guru for help. <i>Exmh</i> also supports the window manager session protocol, which means that session-smart window managers will automatically start exmh for you if you quit X when <i>exmh</i> is running. 
<p>
<a NAME="sect4" HREF="#toc4"> 

<h2><b>THE</b> <b>EXMH</b> <b>DISPLAY</b></a>
 </h2>This section describes the main parts of the <i>exmh</i> display. It probably makes sense to run exmh at this point so you can follow along. There are three sets of buttons in the interface, and three main subwindows. 
<p>
<b>Main</b> <b></b>. Along the top of the window is a set of buttons and menus that apply to <i>exmh</i> itself. Quit, for example, quits <i>exmh</i>. The Help button pops up a menu, and you can select the entries there to get more on-line information about <i>exmh</i>. Use the left mouse button to select the buttons and menus. A button will change its appearence when you press it, and it will be invoked when you release the mouse over the button. If you slide the mouse off the button before releasing it, nothing happens. 
<br>


<p>
<b>Folder</b> <b>Display</b>. Below the main buttons is the folder display subwindow. It has a special button for each of your top-level folders, and these are called <i>folder</i> <i>labels</i>. As a new user you will see two folder labels, one for inbox and drafts. The inbox folder is for your new messages, and the drafts folder is for messages you are writing. If you have used MH (or xmh) before, then you may have many more folders that will appear in this display. The mouse bindings for folder labels are explained in the <i>exmh</i>-<i>use</i> man page. The <i>Color</i> <i>Legend</i> from the Help menu also tells you how the folder labels respond to mouse clicks. 
<p>
<b>Folder</b> <b>Cache</b>. A second folder display called the <i>folder</i> <i>cache</i> may appear under the main folder display. This shows the folder labels for recently used folders. If you only have a few folders this wastes screen real estate. The PREFERENCES section near the end of this man page explains how to turn this off via the Folder Cache preferences setting. If you are a first-time exmh user, Exmh tries to guess if you need this display based on the number of folders and nested folders you have. 
<p>
<b>Folder</b> <b>Buttons</b>. The middle set of buttons is for operations that apply to folders. For example, you can create a new folder with the New button here. The More... button displays a popup menu with several more operations you can apply to folders. Some of these buttons will be introduced in this man page. All of these buttons and menus are explained in detail in the <i>exmh</i>-<i>ref</i> man page. 
<p>
To the left of the folder buttons, summary information about the current folder is displayed. 
<p>
<b>Table</b> <b>of</b> <b>Contents</b>. The middle subwindow of the display shows a summary of the messages in the folder. It shows the message number, the date of the mesage, the subject of the message, and, space permitting, the first few words of the message. Left click on a line in the table of contents to view the corresponding message. The mouse bindings for the table of contents are described in more detail in the <i>exmhuse</i> man page. 
<p>
MH experts: The display in this window comes from both the MH scan program or MH inc programs, so it is affected by the form specification used by these programs. 
<p>
<b>Color</b> <b>and</b> <b>Monochrome</b> <b>Highlights</b>. Both the folder display and table of contents windows use highlights to give you visual clues about the state of messages and folders. Your unread messages are highlighted in the table of contents and the folders that contain unread message are highlighted in the folder display. Pull down the main Help menu and select 
<p>
<i>Color</i> <i>Legend</i> to display a key to the highlights for your display. The highlighting is covered in more detail later in the <i>exmh</i>-<i>use</i> man page. The <i>exmh</i>-<i>custom</i> man page tells how you can control the highlighting yourself. 
<p>
<b>Status</b> <b>Line</b>. Just below the table of contents is the status line. This has two parts. The left part shows the name of the folder and the message number for the current message, if any. The right part gives feedback about what <i>exmh</i> is doing. After it displays a message, the Subject component is displayed there. 
<p>
<b>Subwindow</b> <b>Resize</b> <b>Diamond.</b> The black diamond to the right of the status line is used to change the size of the internal windows. Press the first mouse button on this target and a horizontal line appears. Drag it up and down to adjust the window sizes. Try dragging it all the way to the top and bottom of the exmh window to see how the mode changes to adjust different windows. 
<p>
<b>Message</b> <b>Buttons</b> The bottom row of buttons are for operations that apply to the current message. Several of these operations will be introduced in this man page. The right hand button labeled More... brings up a menu with several more advanced message operations. 
<p>
<i>Hint</i>: Many of these message operations have keyboard shortcuts that make it easy to use <i>exmh</i> with your hands on the keyboard. Some of the short-cuts are introduced in this man page, and all of them are listed in the <i>exmh</i>-<i>use</i> man page. 
<p>
<b>Message</b> <b>Display</b>. The bottom subwindow displays the current message, if any. Some of the less interesting mail headers start out scrolled off the top of this window. 
<p>
<a NAME="sect5" HREF="#toc5"> 

<h2><b>SENDING</b> <b>MAIL</b></a>
 </h2>A good way to test things out is to send a message to yourself. Here are the steps you take to do that: 
<p>
1. Click the Send button, which is in the Message buttons in the bottom group. A new window will open that contains the template for your message. The built-in editor, which is called <i>sedit</i>, will start out with the insert cursor positioned at the end of the first empty header line. Enter your user name after the To: header. If you want to send the message to more than one person, use a comma to separate the names. 
<p>
2. Position the insert cursor on the next header line. You can do this a few different ways. The most direct way is to click the left mouse button where you want the cursor to be. 
<p>
There are keyboard shortcuts, too. If you press &lt;Tab&gt; the editor will take you to the end of the next header line. You can also use the arrow keys or some emacs-like bindings to move the cursor. &lt;Control-n&gt; goes to the next line, &lt;Control-f&gt; moves the cursor forward a character. &lt;Control-p&gt; moves up a line, and &lt;Control-b&gt; moves back a character. The <i>Simple</i> <i>Edit</i> menu entry shows you all the keybindings. 
<p>
3. The next header is the Cc: line. People listed in the Cc: line get a "courtesy" (or "carbon") copy of the message. By convention, the message is primarily for the people listed in the To: component, and the people in the Cc: component are getting the message "for information." In this case, you can leave the Cc: component empty. 
<p>
Move the insert cursor to the Subject: line and enter a Subject. The people that receive your message will get an idea of what the message is about from the subject, so take a moment to think of a good one. For this test, you can type something like "exmh test message". 
<p>
4. Make sure the headers are OK. In particular, make sure there are no blank lines in the headers. The mail system treats a blank line as meaning "end-of-headers", so you don't want to prematurely end the header section. If you have a blank line, position the insert cursor on it and use Backspace to remove the empty line. 
<p>
Position the cursor at the start of the message body. You can use the mouse for this, or you can press &lt;Tab&gt; twice quickly and the editor will position the cursor correctly. When using the default MH message templates, this will be right after the line of all dashes. 
<p>
5. Type in your message. When you type in a long message, the lines will wrap automatically at word boundaries. To get a blank line for paragraph boundaries, press &lt;Return&gt;. The built-in editor supports several editting commands that are based on the GNU emacs key bindings. If you select the <i>Simple</i> <i>Edit</i> menu entry under the main Bindings menu, you will bring up a dialog that lets you view and edit the key bindings. 
<p>
6. If you are happy with the message, you send it by pressing the Send button at the top-right corner of the window. The Send button will turn grey, and the window will disappear once the message has been sent succesfully. 
<p>
If you do not want to send the message, press the Abort button instead. If you want to save the message draft and continue to work on it later, press the Save&amp;Quit button. 
<p>
Working on a saved draft message is described in the <i>exmhuse</i> man page. 
<p>
Send yourself a few messages, or have a friend send you a few test messages. You will use these test messages to practice moving around in a folder and deleting messages. Make one of the messages pretty long so you can practice scrolling through it. 
<p>
Finally, try sending mh-mime-sample@online.ora.com a message. This addresses a program that will return a MIME message to you. Just put this address in the To field with anything as the message body and subject. Reading this message will be described below. 
<p>
<a NAME="sect6" HREF="#toc6"> 

<h2><b>MOUSING</b> <b>AROUND</b></a>
 </h2>The selection is dragged out with the left mouse button. You can modify the selection by holding the Shift key while pressing the left button. A double-click begins a wordoriented selection, and a triple-click begins a lineoriented selection. If you drag a selection off the bottom or top of a window the text will be scrolled automatically and the selection will be extended. 
<p>
Paste is done with the middle mouse button. <i>The</i> <i>current</i> <i>insert</i> <i>point</i> <i>is</i> <i>used</i>, If you drag the middle mouse button, then the window is scrolled instead as described below. There is also a key-binding for paste, which is &lt;Control-y&gt;. Use &lt;Control-w&gt; or the &lt;Delete&gt; key to delete the selection. 
<p>
The middle mouse button is used for "drag-scrolling". To scroll, simply press the middle mouse button over the text and drag the text. If you press the Shift key, the scrolling is faster. Drag-scrolling works in the text widgets, for vertical scrolling, and the one-line entry widgets, for horizontal scrolling. The text widgets are used to display the folder contents and the current message. The entry widgets are used in various dialogs in order to enter values. You can change the scrolling button to the right button or to only work with shift-middle. Set this up in the Simple Edit Bindings... dialog. 
<p>
Buttons and menus are also sensitive to which mouse button is pressed. Only the left button activates a button, and it is the &lt;ButtonRelease&gt; event that is important. If you accidentally move the mouse off of the button as you release it, nothing will happen. Don't worry, the wrong button will not be invoked. 
<p>
Press the left button over a menubutton to pull down a menu. Most of the menus in <i>exmh</i> are distinguished with a "..." in their label, e.g. "More...". The menu will go away when the button is released. Release the mouse button off the menu if you do not want to invoke any menu item. (In some versions of Tk, the middle button will "tear off" a Tk menu. This is quite handy if you use the menu often. To get the menu to go away, you must click the left button over the menubutton. This will reattach the menu to the menubutton, and another left click will make the menu go away. In the latest versions of Tk, the first menu entry is a dashed line that invokes this tear-off operation.) 
<p>
<a NAME="sect7" HREF="#toc7"> 

<h2><b>GETTING</b> <b>NEW</b> <b>MAIL</b></a>
 </h2>By now you should have some new mail waiting. Press the Inc button from the middle set of buttons that do Folder operations. This will transfer messages from your system spool file into your inbox folder. You will hear an audible cue if there was new mail, and the table of contents will be updated to reflect the new messages in your inbox. New messages will be underlined (on a monochrome screen), or blue (on a color screen), to indicate that you have not read them yet. 
<p>
To view the new message, click on its line in the table of contents, or press the Next button in the bottom group of buttons. The message will be displayed in the bottom subwindow, and the line in the table of contents will be highlighted to remind you which message is being displayed. 
<p>
To view the next message, click the Next button. The keyboard shortcut for this is the `n' key. 
<p>
The view the previous message, click the Prev button. The keyboard shortcut for this is the `p' key. 
<p>
<b>Scrolling</b> <b>through</b> <b>messages</b>. If you get a message that is too long to fit into the message window, then the scrollbar will change its appearance to indicate how much text is displayed. The scrollbar is Motif-like. You can click on the arrows at either end to go up and down one line. If you click above or below the elevator box you go up and down one page. You can drag the elevator box to scroll, too. 
<p>
You can also scroll text windows in <i>exmh</i> by dragging with the middle mouse button. Press the middle button over the text area, not the scrollbar, and hold it down while you move the mouse up or down. If you hold the shift key at the same time, the scrolling is faster. This works in the folder Table of Contents window, too. 
<p>
<i>Hint</i>. The space bar is a keyboard short-cut that does a combination of scrolling and advancing to the next message. If the message is long, then space will scroll by one screen. Once you are at the end of the message, space will advance to the next message, just like the `n' key. You can use the BackSpace key to scroll back through a message. 
<p>
<a NAME="sect8" HREF="#toc8"> 

<h2><b>READING</b> <b>MIME</b> <b>MESSAGES</b></a>
 </h2>By now you should have also received the sample MIME message from mh-mime-sample@online.ora.com. The MIME message has three parts to it, and these are numbered and labeled in the display. The first part is a multipart/alternative content, which means there are a few different ways to view the content. This is indicated by the message under the heading <b>1.</b> that there are alternative views of the following content. <i>Exmh</i> will go ahead and display what it thinks is the best alternative, and you see the text/enriched content displayed in part <b>1.2</b>. If you want to see the other alternatives, then you can press the right button over section 1 to get a popup menu with some choices. 
<p>
The next two parts are an audio clip and a picture in GIF format. The audio clip is handled directly by exmh, and it displays two active text buttons labeled "Play attached audio" and "Save audio file". Click on either of these with the left mouse button. The part corresponding to the image displays a message about what the type is, and suggests that you press the right mouse button to display a menu. You can always press the right button to get a MIME menu that has type-specific options for parts of your message. If you press the right button over part <b>2.</b>, then the popup menu will offer you these choices: 
<p>
Decode part as MIME 
<br>
Save Hello from the author... 
<br>
View using mailcap rule... 
<br>
Pass an audio fragment to metamail... </p>
<p>
The first item is a checkbox menu item that lets you view the raw content if you want to. The Save... menu entry displays a file selection box so you can choose a nontemporary file to store the content. This same function is available through the text button, but not all MIME parts displays buttons like this. The next two entries should result in the same thing. They use the mailcap specifications to run another program that displays the content. In the first case, View using mailcap rule..., <i>exmh</i> runs the program directly. In the other case, Pass to metamail..., the <i>metamail</i> program is run first, and it decodes the mailcap file and runs the external program. Again, the text button labeled "Play attached audio" also plays the audio. 
<p>
<a NAME="sect9" HREF="#toc9"> 

<h2><b>REPLYING</b> <b>TO</b> <b>MAIL</b></a>
 </h2>Select one of the messages from your friend that you'd like to answer. Press the left button over the Reply... menu button. A menu with a few entries will be displayed. Select the <i>Reply</i> <i>to</i> <i>sender</i> menu entry by dragging the mouse down to that entry and letting up over it. The menu entry has a &lt;Key-r&gt; in it, which means that you could also press the `r' key to invoke this function. 
<p>
This time the built-in editor will open a window with a message that is partly filled in. All the headers are initialized based on the header components from the original message. The built-in editor will automatically position the cursor at the begining of the message body. You can enter your reply message like you did with the previous messages. You should also double-check the header components. In this case, add yourself to the Cc: component so you will get a copy of the reply message. When you are done, press the Send button in the editor window to send the message. 
<p>
There are a number of ways to control the format of your reply messages. The MH <i>repl</i> command has several formatting options, and because <i>exmh</i> uses <i>repl</i> to set up the reply message, you can customize your reply format. <i>Exmh</i> lets you define several variations on reply and add them to the Reply... menu. This is described in the <i>exmh</i>-<i>custom</i> man page. 
<p>
It should not take long for you to get the copy of the reply message. Wait a minute or so and press the Inc button. The keyboard short-cut for Inc is the `i' key. 
<p>
<a NAME="sect10" HREF="#toc10"> 

<h2><b>SELECTING</b> <b>MESSAGES</b></a>
 </h2>Before we go on to more things you can do with messages, we need to talk about selecting multiple messages at once. Several of the message operations in <i>exmh</i> can operate on a set of messages. You can manually select multiple messages by using the mouse, or you can select messages based on their content. 
<p>
<b>Using</b> <b>the</b> <b>Mouse</b>. To select messages with the mouse, press the left button and then drag out a selection. This will select a contiguous range of messages. If the messages you want to select are not so nicely organized, you can make a disjoint selection by holding down the Shift key while making your selection. This adds new messages to the selection. If you shift-click on a message that is already selected, then it becomes unselected. If you need to select a lot of messages, simply drag the mouse off the top or bottom of the window. It will be scrolled automatically and the selection will be extended. 
<p>
<a NAME="sect11" HREF="#toc11"> 

<h2><b>SEARCHING</b></a>
 </h2>The Search... menu has several operations for finding messages and finding text within a message. There is also a help entry that explains searching in more detail. 
<p>
If you select "Find in message body" or "Find in table of contents" a small search dialog appears. Enter the search string and use the Next or Prev buttons to find the next match. When you are searching over the table of contents, you can select All to select all matching messages. 
<p>
The other way to search a folder is with "Pick by attributes". The MH pick program is used to search the current folder for messages that match mail headers like From or Subject. You can build up boolean expressions among search criteria. This is a much more general search mechanism than the "Find in table of contents" operation. 
<p>
Get started in the Pick dialog by pressing the "Choose pick attribute" button. A menu of attribute types appears, including the Subject, From, To, and Cc header components. You can type a regular expression pattern in these entries to search for messages that have a matching header component. 
<p>
The Before and After attributes are dates. You can find all messages before or after a given date by using these fields. You can specify dates as mm/dd/yy. Be sure to include the year. Dates can also be keywords like "today", "yesterday", "tomorrow", and any day of the week ("Sunday", "Monday", and so on.) 
<p>
The Search attribute is used to search for something in the body of a message. This will run little slower because <i>pick</i> must read through all of your messages, not just their headers. 
<p>
If you select more than one attribute, <i>pick</i> finds messages that match all the criteria. In otherwords, it does the logical <i>and</i> of the search criteria. If you want to search for this <i>or</i> that, then you need to press the Or button in the dialog. This adds another set of fields to the dialog, and pick will search for everthing that matches the first set <i>or</i> matches the second set. 
<p>
The "Add to Sel" checkbutton should be set <i>before</i> you do the search. This controls whether or not the selected messages are added to any existing selection. 
<p>
Finally, use the "Pick" button to do the search. Once the search has completed you can perform a few operations on the selection. You can delete and refile messages as described later. You can also display a new table of contents that only contains the selected messages. Use the "New FTOC" button for this. You can also clear the unseen state of the messages with the "Mark Seen" button. 
<p>
The "Clear" button resets the fields. 
<p>
The two entries in the dialog are used to control MH sequences. The only sequence exmh really supports well is the "unseen" sequence, although you can define up to 10 sequences in each folder. 
<p>
If you use New FTOC to get a new scan listing, it would be better if it appeared in a new window, but currently it replaces the table of contents. You can move around and manipulate messages in this table of contents. However, if you do another pick, it will only find things in this limited table of contents, not the whole folder. (Yes, this is a bug .) Use the Rescan Folder menu entry in the folder More... menu to get a complete folder listing. 
<p>
<a NAME="sect12" HREF="#toc12"> 

<h2><b>FORWARDING</b> <b>MESSAGES</b></a>
 </h2>If you want to send someone a copy of a message or messages that you have received, use the Forward message operation. Select the messages as described in the previous section, then press the Forward button. The keyboard short-cut for forward is the `f' key. 
<p>
The message template will have a copy of the selected messages. You fill in the headers, and you can also add a short message before the start of the forwarded messages. When you are done, press Send to forward the messages. 
<p>
<a NAME="sect13" HREF="#toc13"> 

<h2><b>DELETING</b> <b>MESSAGES</b></a>
 </h2>After you have read a message, you might want to remove it to keep your mail folders tidy. <i>Exmh</i> uses two steps to remove mail. In the first step you <i>mark</i> a message as being deleted. In the second step you <i>commit</i> the operations on all marked messages. 
<p>
The Delete operation applies to the current message, or you can also select a range of messages by dragging out a selection in the table of contents. You can delete the current message(s) by pressing the Delete button. The keyboard short-cut is the `d' key. The deleted message(s) will be highlighted after the delete operation so you can easily see the state of the message. On a monochrome screen, a cross hatching will be drawn through the table of contents line for the message. On a color screen, the table of contents line will get a dark grey background. 
<p>
After you mark a message for delete, you are automatically advanced to the next message. This makes it easy to go through your folder and clean it up. Click `d' to delete, or click `n' to leave it alone. 
<p>
<i>Hint</i>. If you are really in a hurry, use `D' and `N' as your keyboard short-cuts. This prevents the next message from being displayed, which can be slow for complex multi-media messages. 
<p>
When you are ready to commit the pending delete actions, press the Commit button. The keyboard shortcut for commit is &lt;Control-Return&gt;. 
<p>
If you decide you do not want to delete a message you can unmark it. Use the <i>Unmark</i> (<i>Undo</i>) menu entry that is under the message More... menu. The unmark operation applies to the current message or messages, so you have to select the messages to unmark first. The keyboard short-cut for unmark is `u'. 
<p>
<i>Hint</i>. The minus, `-', keyboard shortcut takes you to the previous message, even if it has been marked for delete. Ordinarily the Prev operation, and the `p' short-cut for it, will skip over marked messages. 
<p>
<a NAME="sect14" HREF="#toc14"> 

<h2><b>LEAVING</b> <b>EXMH</b></a>
 </h2>Press the Quit button to leave exmh. It will take a few moments to close down because it saves some state information before quitting. The Quit button will grey out after you click it, and you will see a few status messages as it shuts itself down. 
<p>
<a NAME="sect15" HREF="#toc15"> 

<h2><b>PREFERENCES</b></a>
 </h2>Try out the Preferences by turning off the folder cache. This just takes up display space if you don't have many folders. If you have lots of nested folders, though, you might even want to make this display bigger! 
<p>
Click the Preference button, which brings up a dialog that has buttons for several of the modules that make up <i>exmh</i>. Click on the Folder Cache button to bring up the preference items that control the folder cache. In this case there are just two items: the number of lines of labels in the cache, and the names of folders that are always in the cache. Click in the first field and backspace over the default value of 1. Type in 0 instead, and press &lt;Return&gt;. Voila! The folder cache disappears. 
<p>
If you like this setting, press Save one the main Preference dialog and your changes will be saved to a file named ~/.exmh-defaults. Press Reset if you want to undo your changes. You should be a little careful here, because you are allowed to Dismiss the preference dialog without saving. 
<p>
Another useful preference item to set is under Background Processing. You can arrange for <i>exmh</i> to periodically run <i>inc</i> so your messages are automatcially transferred into your inbox. The advantage of doing this is that the folder label highlighting works best this way. Unfortunately, <i>exmh</i> does not give you any visual clues when mail is only waiting in your system spool file. 
<p>
More details about the Preferences dialog are given in the <i>exmh</i>-<i>use</i> man page, and an overview of the various preference sections is given in the <i>exmh</i>-<i>custom</i> man page.. 
<p>
<a NAME="sect16" HREF="#toc16"> 

<h2><b>WHAT</b> <b>IS</b> <b>MH</b> <b>MAIL?</b></a>
 </h2>MH is a collection of UNIX programs that store, manipulate, and display your mail. MH originated from RAND, and it is now in the public domain. Exmh uses these programs to do all the hard work, while it concentrates on the user interface. 
<p>
You can use the MH programs to read your mail. Run them from the UNIX command line like you would cd, ls, cc, or make. They are useful when you are connecting over a slow line or cannot run exmh for some other reason. For more details, there are individual man pages for each MH program, plus one overview man page called MH. Below is a short summary of the main MH programs used by exmh. 
<p>
folder 
<br>
Query or set the current folder. 
<p>
inc Incorporate mail from your system spool file into your folders. 
<p>
scan Display a listing of a mail folder. 
<p>
show Display a mail message. 
<p>
next Display the next mail message. (Exmh doesn't actually run this.) 
<p>
prev Display the previous mail message. (Exmh doesn't actually run this.) 
<p>
rmm Delete a mail message. 
<p>
refile 
<br>
Move a message into another mail folder. 
<p>
repl Reply to a mail message 
<p>
forw Forward one or more mail messages. 
<p>
comp Compose a new mail message. 
<p>
MH keeps track of the current folder and the current message in between uses of these MH programs. For example: 
<pre>% scan +inbox unseen 
1713 04/14 foote.PARC@xerox. Have you started blasting cdroms yet?&lt;&lt;Probably. 
1715 04/14 FlashBack Publish 1232: Tactix Introduces Break through in Unix Ad 
1716 04/14 FlashBack Publish 1234: CERT Advisory - NCSA HTTP Daemon for UNIX&lt; 
1717 M04/15 To:welch PGP test&lt;&lt;-----BEGIN PGP MESSAGE----- Version: 2 
1718 M04/17 flash@flashback.c mime-flashback-w MIME FlashBack April 13th, 1995 
1719 -04/16 Bill Wohler Notes for MH Chapters 20-22&lt;&lt;Brent, I have been 
1720+-04/17 "Allen R. Carl" Re: Tabs&lt;&lt;Brent, where is this -tabs resource se 
% show 1717 (Message 1717 displayed) 
% next (Message 1718 displayed) 
% rmm (Message 1718 deleted) 
% repl 1717 (Set up template for reply to message 1717, invoke editor) </pre>


<p>
Each user has a .mh_profile file that stores general MH settings as well as per-command settings. Each line has a key, and a value. For example, your mail directory is set with the Path profile entry: 
<p>
Path: Mail 
<br>


<p>
If your old mail system uses that directory already, just edit your .mh_profile to change the name used for your MH mail folders. 
<p>
<a NAME="sect17" HREF="#toc17"> 

<h2><b>MORE</b> <b>ABOUT</b> <b>EXMH</b></a>
 </h2>This man page should get you started with <i>exmh</i>. If you decide you want to know more about it, here are some of the features described in the other <i>exmh</i> man pages. 
<p>
<b>MIME</b> <b>support</b>. <i>Exmh</i> can display MIME (Multipurpose Internet Mail Extensions) messages, either directly or with the help of the <i>metamail</i> package. The built-in editor lets you compose enriched text messages and insert files as parts of a multipart message. 
<p>
<b>Mail</b> <b>Folders</b>. You can create other mail folders to hold messages about certain topics or from certain people. You can create a hierarchical arrangement of folders, just like the hierarchical directory structure of the file system. The folder display supports these <i>nested</i> <i>folders</i>, and it allows you to nest folders to any depth. 
<p>
<b>Mail</b> <b>Filtering</b>. Mail filtering lets you sort mail into different folders <i>before</i> you read it. If you get lots of mail, this is a great way to avoid plowing through junk mail just to get your important messages. The folder labels are highlighted to indicate which folders have unread mail in them. 
<p>
<b>Facesaver</b> <b>bitmap</b> <b>display</b>. If you have a facesaver database on your system, <i>exmh</i> displays the bitmap face of the person that sent the current message (or their organization). 
<p>
<b>Background</b> <b>processing</b>. You can set <i>exmh</i> to run <i>inc</i> periodically, check for new mesages arriving asynchronously in folders, run the MH <i>msgchk</i> program, or count up the messages in your mail spool file. 
<p>
<b>Editor</b> <b>interface</b>. You can hook <i>exmh</i> to your favorite editor using the <i>exmh</i>-<i>async</i> script. Or, Tcl-based editors such as <i>mxedit</i> can interact with <i>exmh</i> directly. 
<p>
<b>Keybinding</b> <b>User</b> <b>Interface</b>. You can define new key bindings for Tcl commands that are part of the implementation. 
<p>
<b>Aliases</b> <b>User<b></b>Interface</b>. A browser for your MH aliases lets you define new aliases and insert aliases into mail messages. 

<p>
<b>Pretty</b> <b>Good</b> <b>Privacy</b> <b>(PGP)</b>. If you have PGP, you can use it from <i>exmh</i> to digitally sign, encrypt, and decrypt messages. 
<p>
<b>User</b> <b>Programming</b>. If the preference settings are not enough for you, you can program <i>exmh</i> more directly. You can define new buttons and menus and add new Tcl code to its implementation. 
<p>
<a NAME="sect18" HREF="#toc18"> 

<h2><b>SEE</b> <b>ALSO</b></a>
 </h2>exmh-use, exmh-ref, exmh-custom, mh 
<p>
<a NAME="sect19" HREF="#toc19"> 

<h2><b>AUTHOR</b></a>
 </h2>Brent.Welch@Sun.COM 
<p>
<a NAME="sect20" HREF="#toc20"> 

<h2><b>THANKS</b></a>
 </h2>To Xerox PARC/CSL, for supporting this work initially, to Sun Microsystems Laboratories for continuing the support, and to all the exmh users that contributed ideas and code. 
<p>


<p>

<p>


</Body>
</Html>
EOF-EOF-EOF
NewFile lib/app-defaults.orig<<'EOF-EOF-EOF'
!
! Application defaults for Exmh
!
! The best place to put your personal defaults for exmh is
! in the beginning of your ~/.exmh-defaults.  You'll note that
! the tail of that file is written by the Preferences dialog.
! If you put anything into ~/.Xresources, then you'll need to
! use "exmh" as the prefix for the resource name (not *).
!
! The reason *resourceName is used here is because multiple
! instances of exmh have different names (exmh, exmh #2, etc),
! plus there is the background process named exmh-bg that shares resources.
! HOWEVER, never put *geometry into a TK resource specifciation
! because that will attempt to set the geometry of *every* widget!
!	Use exmh.geometry instead.
!
! Class				Description
! -----				-----------
! Main				Top row of buttons and title label
! Fdisp				Folder label display
! Fdisp.Frame.Canvas		    and its canvas.
! Fops				Folder operation buttons and folder label
! Ftoc				Folder table of contents display
! Mid				Frame around Face, Msgid, Status, Mops
! Mid.Face			Bitmap display
! Mid.Right.Status.label	Message label
! Mid.Right.Status.msg 		Status line
! Mid.Right.Mops		Message buttons
! Msg				Message display
!
! toplevel windows.
!
! Fltop				Detached toplevel folder label display
! Fltop.Canvas			    and its canvas.
! Clip				Detached message display
! Sedit				Simple editor top-levels
! Help				Help window
! Key				Color key window
! Pref				Preferences dialogs
! Log				Error/debug log
! Error				Error popups
! Pick				Pick dialog
! WhatNow			WhatNow? dialog
! Find				Find dialog
! NewFolder			Create folder dialog
! DeleteFolder			Delete folder dialog
! Alias				The aliases browser
! FileSelect			The file selection dialog
! Dialog 			General popups

! Fonts

*font: fixed

!*Ftoc*Text.font: 6x10
!*Msg*Text.font: fixed
!*Sedit*Text.font: fixed

! Tk widgets:

*Entry.relief:		sunken
*Entry.borderWidth:	2
*Label.relief:		flat
*Label.borderWidth:	0
*Button.relief:		raised
*Menubutton.relief:	raised
*Checkbutton.relief:	raised
*Radiobutton.relief:	raised

! For the old, cramped 3.6 appearance
! Buttons have an extra 2 pixels added in comparision with
! all other types of butons, hence the 1 and the 2 here
*padX:		2
*padY:		2
*Button.padX:	1
*Button.padY:	1
*Button.highlightThickness: 0
*Checkbutton.highlightThickness: 0
*Radiobutton.highlightThickness: 0
*Menuutton.highlightThickness: 0

! Cursors
*Text.cursor:			xterm
*Ftoc*Text.cursor:		hand2
*Dialog*cursor:			top_left_arrow
*Status*cursor:			top_left_arrow
*Status.boundary.cursor:	double_arrow
*Main.quit.cursor:		gumby
*Entry.cursor:			xterm

! special configuration resources for widgets used in unusual ways:

! exmh status field is an entry being used as a label:
*statusConfig:		-relief flat -borderwidth 0

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

*LabeledEntry.borderWidth:		2
*LabeledEntry.relief:			flat
*LabeledEntry*Label.borderWidth:	0
*LabeledEntry*Label.relief:		flat
*LabeledEntry*Label.anchor:		e
*LabeledEntry*Entry.borderWidth:	2
*LabeledEntry*Entry.relief:		sunken

*Pick*LabeledEntry*Label.width:		20
*Pick.borderWidth:			2
*Pick.relief:				ridge

*Glimpse*Text.cursor:			hand2
*Glimpse*Text.wrap:			word

! This selects a new preference display
*helpInOneWindow:			1

*Preference.borderWidth:		2
*Preference.relief:			flat
*Preference*Label.borderWidth:		2
*Preference*Label.relief:		flat
*Preference*Label.anchor:		e
*Preference*Entry.borderWidth:		2
*Preference*Entry.relief:		sunken
*Preference*Checkbutton.relief:		flat
*Preference*Radiobutton.relief:		flat

*Text.wrap:				word
*Ftoc.Text.wrap:			none
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! To avoid a resizing bug in TK, do not specify geometry resources
! for the toplevel windows.  Instead, use "position", which
! exmh groks.  The bug is that you cannot specify a geometry like
! +10-40 for a toplevel frame (frame creation barfs), and if you
! specify a width and height, it has to be in pixels (because the
! gridded text subwindow isn't created yet) and you don't have
! any clue as to the right size.  If you guess wrong, the window
! will jump from your wrong size to the correct size that has room
! to pack all its subwindows.  Alternatively, go ahead and pick a
! pixel size for the toplevel, but do not specify a geometry for
! the text subwindow.

exmh.geometry:
*position:
exmh.iconposition:
exmh.iconic:		0
*Fltop.iconposition:
*Fltop.iconic:		0
*Fltop*Canvas.width:	500
*Fltop*Canvas.height:	100
*Sedit*Text.height:	24
*Sedit*Text.width:	80
*Clip*Text.height:	48
*Clip*Text.width:	80
*Help*Text.height:	30
*Help*Text.width:	80
*Log*Text.width:	80
*Log*Text.height:	20
*Alias*alias.listbox.geometry:	20x10
*Alias*addr.listbox.geometry:	30x10
*FileSelect*Listbox.geometry:	32x16
*Alias*alias.listbox.width:	20
*Alias*addr.listbox.width:	30
*Alias*Listbox.height:		10
*FileSelect*Listbox.width: 	32
*FileSelect*Listbox.height: 	16
*Glimpse*Text.height:	20
*Glimpse*Text.width:	80

! Icon bitmaps
*iconUpBitmap:         flagup.bitmap
*iconDownBitmap:       flagdown.bitmap
*iconSpoolBitmap:      flagup.bitmap
*iconUpLabel:          $flist(newMsgs) Unseen
*iconDownLabel:        exmh
*iconSpoolLabel:       $exmh(numUnInced) Spooled

! Top-level resources that don't correspond to a TK widget

! Scrollbar location - left or right
*scrollbarSide:		right

! Resources that tweak the folder label display
!	fl_toplevel - put the flist display in a detached, toplevel window
!	fl_font - label font in the flist display canvas
!	fl_curbutton - which button selects the current folder
!	fl_navbutton - which button navigates to subfolders
!	fl_tarbutton - which button selects a folder as the target for moves
!	fl_xgap	  - gap between labels, X direction
!	fl_ygap	  - gap between labels, Y direction

*fl_toplevel: 0
*fl_font: fixed
*fl_tarbutton: 3
*fl_navbutton: 2
*fl_curbutton: 1
*fl_xgap: 8
*fl_ygap: 8

!
! Resources that create the Main buttons
! ubuttonlist is meant to be overridden by users to add buttons
!
*Main.buttonlist:	quit pref alias
*Main.ubuttonlist:
*Main.menulist:		bind help
*Main.umenulist:

*Main.quit.text:	Quit
*Main.quit.command:	Exmh_Done
*Main.pref.text:	Preferences
*Main.pref.command:	Preferences_Dialog
*Main.alias.text:	Aliases
*Main.alias.command:	Aliases_Pref

*Main.bind.text:	Bindings...
*Main.bind.m.entrylist: command sedit compose
*Main.bind.m.l_command: Commands
*Main.bind.m.c_command: Bind_Pref
*Main.bind.m.l_sedit:	Simple Edit
*Main.bind.m.c_sedit:	Sedit_Pref
*Main.bind.m.l_compose:	Compose Key
*Main.bind.m.c_compose:	Sedit_ComposeUI

*Main.help.text:	Help...
*Main.help.m.entrylist:	help colorkey faq sep list bug reg pgp
*Main.help.m.l_colorkey:	Color Legend
*Main.help.m.c_colorkey:	Help_KeyDisplay
*Main.help.m.l_help:	Quick Intro
*Main.help.m.c_help:	Help
*Main.help.m.l_faq:	Frequently Asked Questions
*Main.help.m.c_faq:	Help FAQ
*Main.help.m.t_sep:	separator
*Main.help.m.l_bug:	Submit Bug Report
*Main.help.m.c_bug:	Report_Bug
*Main.help.m.l_reg:	Register as an EXMH User
*Main.help.m.c_reg:	Report_Registration
*Main.help.m.l_list:	Exmh Mailing Lists...
*Main.help.m.m_list:	list
*Main.help.m.t_list:	cascade
*Main.help.m.l_pgp:	Pgp Setup
*Main.help.m.c_pgp:	Pgp_Help

*Main.help.m.list.entrylist: about adduser deluser adddig deldig addann delann addwork delwork

*Main.help.m.list.l_about: About the exmh mailing lists
*Main.help.m.list.c_about: Help Lists {About the exmh mailing lists}
*Main.help.m.list.l_adduser: Subscribe to exmh-users
*Main.help.m.list.c_adduser: Report_Subscribe exmh-users subscribe
*Main.help.m.list.l_deluser: Unsubscribe from exmh-users
*Main.help.m.list.c_deluser: Report_Subscribe exmh-users unsubscribe
*Main.help.m.list.l_adddig: Subscribe to exmh-users digest
*Main.help.m.list.c_adddig: Report_Subscribe exmh-users-digest subscribe
*Main.help.m.list.l_deldig: Unsubscribe from exmh-users digest
*Main.help.m.list.c_deldig: Report_Subscribe exmh-users-digest unsubscribe
*Main.help.m.list.l_addann: Subscribe to exmh-announce
*Main.help.m.list.c_addann: Report_Subscribe exmh-announce subscribe
*Main.help.m.list.l_delann: Unsubscribe from exmh-announce
*Main.help.m.list.c_delann: Report_Subscribe exmh-announce unsubscribe
*Main.help.m.list.l_addwork: Subscribe to exmh-workers
*Main.help.m.list.c_addwork: Report_Subscribe exmh-workers subscribe
*Main.help.m.list.l_delwork: Unsubscribe from exmh-workers
*Main.help.m.list.c_delwork: Report_Subscribe exmh-workers unsubscribe

!
! Resources that create the Folder ops buttons and menu
! NOTICE: In 1.4 and higher, the entrylist etc. are attached to the
! menu widget pathname, not the menu button.  NOTICE.
!
*Fops.menulist:		more search
*Fops.umenulist:

*Fops.more.text: 	More...
*Fops.more.m.entrylist: rescan project pack sort find delete catchup scanall scanall2 purge purgeall import audit mhprof
*Fops.more.m.uentrylist:

*Fops.more.m.l_rescan: 	Rescan folder
*Fops.more.m.c_rescan:	busy Scan_FolderForce ; Msg_ShowSomething
*Fops.more.m.l_project: List only selected messages
*Fops.more.m.c_project:	Ftoc_NewFtoc
*Fops.more.m.l_pack:	Pack folder
*Fops.more.m.c_pack:	busy Folder_Pack ; Msg_ShowSomething
*Fops.more.m.l_sort:	Sort folder...
*Fops.more.m.t_sort:	cascade
*Fops.more.m.m_sort:	sort
*Fops.more.m.sort.entrylist:	date subject from
*Fops.more.m.sort.l_date:	By Date
*Fops.more.m.sort.c_date:	busy Folder_Sort -datefield date; Msg_ShowSomething
*Fops.more.m.sort.l_subject:	By Subject
*Fops.more.m.sort.c_subject:	busy Folder_Sort -textfield subject ; Msg_ShowSomething
*Fops.more.m.sort.l_from:	By Sender
*Fops.more.m.sort.c_from:	busy Folder_Sort -textfield from ; Msg_ShowSomething
*Fops.more.m.l_find:	Find all folders
*Fops.more.m.c_find:	busy Flist_Refresh
*Fops.more.m.l_delete:	Delete folder
*Fops.more.m.c_delete:	Folder_Delete
*Fops.more.m.l_catchup:	Catch-up Unseen
*Fops.more.m.c_catchup:	Pick_MarkSeen
*Fops.more.m.l_scanall:	Update scan caches
*Fops.more.m.c_scanall:	Scan_AllFolders
*Fops.more.m.l_scanall2:	Update all scan caches
*Fops.more.m.c_scanall2:	Scan_AllFolders 1
*Fops.more.m.l_purge:	Purge folder
*Fops.more.m.c_purge:	Folder_PurgeBg
*Fops.more.m.l_purgeall:	Purge all folders
*Fops.more.m.c_purgeall:	Folder_PurgeAllBg
*Fops.more.m.l_import:	Import mailbox folders
*Fops.more.m.c_import:	Import_Dialog
*Fops.more.m.t_audit:	cascade
*Fops.more.m.l_audit:	Audit
*Fops.more.m.m_audit:	audit
*Fops.more.m.l_mhprof:	Re-read MH Profile
*Fops.more.m.c_mhprof:	MhParseProfile

*Fops.more.m.audit.entrylist:	stat view
*Fops.more.m.audit.l_stat:	Summary Statistics
*Fops.more.m.audit.c_stat:	Audit_Stats
*Fops.more.m.audit.l_view:	View Log
*Fops.more.m.audit.c_view:	Audit_View


*Fops.search.text: 	Search...
*Fops.search.m.entrylist: help msg fast pick glimpse thread
*Fops.search.m.uentrylist:

*Fops.search.m.l_help: Search Help
*Fops.search.m.c_help: Help Search
*Fops.search.m.l_msg: Current message
*Fops.search.m.c_msg: Find_Msg
*Fops.search.m.l_fast: Folder table of contents
*Fops.search.m.c_fast: Find_FTOC
*Fops.search.m.l_pick: All messages in current folder (pick)
*Fops.search.m.c_pick:	Pick
*Fops.search.m.l_glimpse: All messages in all folders (glimpse)	
*Fops.search.m.c_glimpse: Glimpse_Startup
*Fops.search.m.l_thread: Display related messages	
*Fops.search.m.c_thread: Thread_Display


*Fops.buttonlist:	commit inc flist new
*Fops.ubuttonlist:

*Fops.commit.text:	Commit
*Fops.commit.command:	Folder_Commit
*Fops.inc.text:		Inc
*Fops.inc.command:	Inc
*Fops.flist.text:	Flist
*Fops.flist.command:	busy Flist_FindUnseen 1
*Fops.new.text:		New
*Fops.new.command:	Folder_New

!
! Resources that create the Message ops buttons and menus
!
*Mops.menulist:		more reply
*Mops.umenulist:

*Mops.reply.text: 	Reply...
*Mops.reply.m.entrylist: reply replyall
*Mops.reply.m.uentrylist: sep help

*Mops.reply.m.l_reply: 	Reply to sender <Key-r>
*Mops.reply.m.c_reply:		Msg_Reply -nocc to -nocc cc
*Mops.reply.m.l_replyall: 	Reply all <Key-R>
*Mops.reply.m.c_replyall:	Msg_Reply -cc to -cc cc

*Mops.reply.m.t_sep:	separator
*Mops.reply.m.l_help:	Defining more...
*Mops.reply.m.c_help:	Msg_ReplyHelp

*Mops.more.text: 	More...
*Mops.more.m.entrylist: 	print unmark clip xunseen burst distrib save use edit uudecode postscript apply1 apply2 munseen pgpencrypt pgp uriscan uriopen partial
*Mops.more.m.uentrylist:

*Mops.more.m.l_print: 	Print
*Mops.more.m.c_print:	Print
*Mops.more.m.l_unmark: 	Unmark (Undo)
*Mops.more.m.c_unmark:	Ftoc_Unmark
*Mops.more.m.l_clip: 	Clip
*Mops.more.m.c_clip:	Msg_Clip
*Mops.more.m.l_xunseen: First Unseen
*Mops.more.m.c_xunseen:	Msg_ShowUnseen
*Mops.more.m.l_burst: 	Burst Digest
*Mops.more.m.c_burst:	Msg_BurstDigest
*Mops.more.m.l_distrib: 	Redistribute
*Mops.more.m.c_distrib:	Msg_Dist Mh_DistSetup
*Mops.more.m.l_save: 	Save to file
*Mops.more.m.c_save:	Msg_Save
*Mops.more.m.l_use: 	Use message as draft
!
! The \$ is required because menu commands are eval'ed when the menu
! is defined (for sedit), but in this case we want to re-eval it
! each time the entry is selected.
!
*Mops.more.m.c_use:	Msg_Compose +\$exmh(folder) \$msg(id)
*Mops.more.m.l_edit: 	Edit message
*Mops.more.m.c_edit:	Msg_Edit
*Mops.more.m.l_uudecode: 	uudecode message
*Mops.more.m.c_uudecode:	Msg_UUdecode
*Mops.more.m.l_postscript: 	Print postscript content
*Mops.more.m.c_postscript:	Print_Postscript
*Mops.more.m.l_apply1: 	Apply command to message
*Mops.more.m.c_apply1:	Message_Apply
*Mops.more.m.l_apply2: 	Apply command to body
*Mops.more.m.c_apply2:	Message_Apply body
*Mops.more.m.l_munseen: Mark Unseen
*Mops.more.m.c_munseen:	Msg_MarkUnseen
*Mops.more.m.l_pgpencrypt: PGP Encrypt
*Mops.more.m.c_pgpencrypt: Pgp_ExmhEncrypt
*Mops.more.m.l_pgp:	old PGP...
*Mops.more.m.t_pgp:	cascade
*Mops.more.m.m_pgp:	pgp
*Mops.more.m.l_uriscan: Scan for URLs
*Mops.more.m.c_uriscan: URI_ScanMsg
*Mops.more.m.l_uriopen: View selected URL
*Mops.more.m.c_uriopen: URI_OpenSelection
*Mops.more.m.l_partial: Concatenate partial messages
*Mops.more.m.c_partial: Partial_Concatenate

*Mops.more.m.pgp.entrylist: decrypt pgpview pgpextract 
*Mops.more.m.pgp.l_decrypt: PGP Decrypt
*Mops.more.m.pgp.c_decrypt:	Pgp_Decrypt
*Mops.more.m.pgp.l_pgpview: PGP View
*Mops.more.m.pgp.c_pgpview:	Pgp_View
*Mops.more.m.pgp.l_pgpextract: PGP Extract keys
*Mops.more.m.pgp.c_pgpextract: PgpExec_ExtractKeys \"\$mhProfile(path)/\$exmh(folder)/\$msg(id)\"

*Mops.buttonlist:	link move delete next prev comp forward
*Mops.ubuttonlist:

*Mops.link.text: 	Link
*Mops.link.command:	Msg_Move Ftoc_CopyMark advance?
*Mops.move.text: 	Move
*Mops.move.command:	Msg_Move Ftoc_MoveMark
*Mops.delete.text: 	Delete
*Mops.delete.command:	Msg_Remove
*Mops.next.text: 	Next
*Mops.next.command:	Ftoc_Next show
*Mops.prev.text: 	Prev
*Mops.prev.command:	Ftoc_Prev show
*Mops.comp.text: 	Send
*Mops.comp.command:	Msg_Compose
*Mops.forward.text: 	Forward
*Mops.forward.command:	Msg_Forward

! The group assignments associate buttons with three states:
!	current: there is a current message
!	  range: there is a range of messages selected
!	nodraft: we are *not* in the drafts folder
!
! In addition, to support a special case, there is
!	   comp: a group with a single item, the Send (or comp) button.

*Mops.groups:		current range nodraft comp pgp

*Mops.g_current:	link move delete reply forward
*Mops.gm_current:	Print {Unmark (Undo)} Clip Redistribute {Burst Digest} {Save to file} {Use message as draft} {Edit message} {uudecode message} {Print as postscript} {Apply command to body} {Apply command to message} {Mark Unseen} {PGP Encrypt} {old PGP...} {Highlight URI}
*Mops.ug_current:
*Mops.ugm_current:

*Mops.g_range:		link move delete forward
*Mops.gm_range:		Print {Unmark (Undo)} {Mark Unseen}
*Mops.ug_range:
*Mops.ugm_range:

*Mops.g_nodraft:	reply forward
*Mops.gm_nodraft:	Redistribute
*Mops.ug_nodraft:
*Mops.ugm_nodraft:

*Mops.g_comp:		comp

!
! MIME message type handlers
! mimeTypes lists the known mime types
! mimeUTypes is meant to be overridden by users with additional types
! mime_type/subtype maps to the TCL procedure to handle the type
!
*mimeTypes: text/plain text/richtext text/enriched multipart/mixed \
	multipart/digest multipart/parallel multipart/alternative \
	application/octet-stream message/external-body message/rfc822 \
	image application/pgp multipart/x-tioga text/x-html text/html \
	multipart/x-sun-attachment application/x-shell-script \
	audio/basic audio/x-sunaudio application/x-suncalendar \
	multipart/report message/x-delivery-status-05 \
	application/x-pgp-message \
	multipart/fv-infohaus application/fv-infohaus
*mimeUTypes:
!
*mime_text/plain:		Mime_ShowText
*mime_text/richtext:		Mime_ShowRichText
*mime_text/enriched:		Mime_ShowRichText
*mime_text/x-html:		Mosaic_ShowPart
*mime_text/html:		Mosaic_ShowPart
*mime_multipart/mixed:		Mime_ShowMultipart
*mime_multipart/report:		Mime_ShowMultipart
*mime_multipart/digest:		Mime_ShowMultipartDigest
*mime_multipart/parallel:	Mime_ShowMultipartParallel
*mime_multipart/alternative:	Mime_ShowMultipartAlternative
*mime_multipart/x-tioga:	Tioga_ShowMsg
*mime_multipart/x-sun-attachment:	Mime_ShowMultipart
*mime_application/x-shell-script:	Mime_ShowShellScript
*mime_audio/basic:			Mime_ShowAudio
*mime_audio/x-sunaudio:			Mime_ShowAudio
*mime_application/x-suncalendar:	Mime_ShowSunCalendar
*mime_application/octet-stream:	Mime_ShowApplicationOctet
*mime_message/external-body:	Mime_ShowMessageExternal
*mime_message/rfc822:		Mime_ShowRfc822
*mime_message/x-delivery-status-05:		Mime_ShowText
*mime_application/pgp:			Pgp_ShowMessage
*mime_application/x-pgp-message:	Pgp_ShowMessage
*mime_image:			Mime_ShowImage
*mime_application/fv-infohaus:	Mime_ShowText
*mime_multipart/fv-infohaus:	Mime_ShowMultipart
!
! Mime fonts
! mimeCharsets lists the known mime charsets
! mimeUCharsets is meant to be overridden by users with additional
! fonts available
! mime_charset maps to a font which uses the charset.
!
*mimeCharsets: us-ascii iso-8859-1 iso-8859-8 iso-2022-jp
!
*mimeUCharsets:

!
! For each defined character set, we need to know the registry and
! encoding used to find the fonts.
! US-ASCII is a subset of all the ISO-8859 character sets, so we can
! wildcard the encoding for it.  ISO-8859-1 and ISO-8859-8 ship with
! X11r5, so they're defined here.  Any addtional charsets which exist at
! your site should be defined here.
*mime_us-ascii_registry:	iso8859
*mime_us-ascii_encoding:	*
*mime_iso-8859-1_registry:	iso8859
*mime_iso-8859-1_encoding:	1
*mime_iso-8859-8_registry:	iso8859
*mime_iso-8859-8_encoding:	8
!
! modified by k.furukawa, jan.1995.  for multipart message problem
! We should specify a 8bit font for iso-2022-jp here, since it
! corresponds to -font option.  For a 16bit font or -kanjifont option, 
! japanized Tk treats it independently.  (You may specify 16bit font
! in the file exmh like "option add *Text.KanjiFont kanji24".)
!
*mime_iso-2022-jp_registry:   iso8859
*mime_iso-2022-jp_encoding:   1

! For each charset, we have four differerent possible ways that the
! characters may be displayed.  "plain" is how they are displayed in
! an ordinary (text/plain) message; "fixed" is how fixed face
! characters are displayed in enriched text; "proportional" is how
! proportional face characters are displayed in enriched text; and
! "title" is how part headers are displayed.
!
! The list which follows are families which provide this style for
! this character set in order of preference.  If none of the familes
! are found for a particular characterset/display style,  a wildcard
! is used for the family.
! These may be overridden by users.
*mime_us-ascii_plain_families:	fixed clean lucidatypewriter courier terminal
*mime_us-ascii_fixed_families:	lucidatypewriter fixed clean courier terminal
*mime_us-ascii_proportional_families:	times "new century schoolbook" \
					lucidabright charter lucida helvetica
*mime_us-ascii_title_families:	times "new century schoolbook" \
				lucidabright charter lucida helvetica
*mime_iso-8859-1_plain_families:	lucidatypewriter fixed courier terminal
*mime_iso-8859-1_fixed_families:	lucidatypewriter fixed courier terminal
*mime_iso-8859-1_proportional_families:	times "new century schoolbook" \
					lucidabright charter lucida helvetica
*mime_iso-8859-1_title_families:	times "new century schoolbook" \
				lucidabright charter lucida helvetica
*mime_iso-8859-8_plain_families:	fixed
*mime_iso-8859-8_fixed_families:	fixed
*mime_iso-8859-8_proportional_families:	
*mime_iso-8859-8_title_families:	

*mime_iso-2022-jp_plain_families:     fixed
*mime_iso-2022-jp_fixed_families:     fixed
*mime_iso-2022-jp_proportional_families:
*mime_iso-2022-jp_title_families:

!
! Mime External message access methods
*mimeExtMethods:	local-file anon-ftp
*mimeUExtMethods:
!
*mime_local-file:	MimeLocalFileTransfer
*mime_anon-ftp:		MimeFTPTransfer

!
! Richtext commands
*richCommands:		bold italic fixed smaller bigger underline \
			indent verbatim param excerpt center nl lt \
			x-color
*richUCommands:

*rich_bold:		Rich_FontChange
*richVar_bold:		boldDepth
*rich_italic:		Rich_FontChange
*richVar_italic:	italicDepth
*rich_fixed:		Rich_FontChange
*richVar_fixed:		fixedDepth

*rich_smaller:		Rich_FontChange
*richVar_smaller:	size
! point size taken from mimeFontSize
!*richInit_size:		120
*richInc_smaller:	-20
*richVar_bigger:	size
*rich_bigger:		Rich_FontChange
*richInc_bigger:	20

*rich_underline:	Rich_UnderlineChange
*richVar_underline:	underDepth

*richVar_indent:	indent
*richInc_indent:	4

*richVar_verbatim:	verbatim

*richVar_param:		paramDepth

*rich_excerpt:		Rich_ExcerptChange
*richVar_excerpt:	excerptDepth

*richVar_center:	center

! These are here for richtext compatibility
*rich_nl:		Rich_NewLine
*rich_lt:		Rich_LessThan

! Extensions
*richVar_x-color:	colorDepth
*rich_x-color:		Rich_Color

! Built-in editor (sedit) buttons and menus

! The following buttons and menus are special and always exist
! in a standard arrangement.  You can override their commands and labels.
! The variables $draft, $t, and $f are expanded when the button
! or menu is defined.  If you want variables to be substitued when the
! operation is invoked, escape the $ as in \$foo

*Sedit.Menubar.builtin: 	quit send sign
*Sedit.Menubar.quit.text: 	Dismiss
*Sedit.Menubar.quit.command:	SeditQuit $draft $t
*Sedit.Menubar.send.text:	Send
*Sedit.Menubar.send.padX:	15
*Sedit.Menubar.send.command:	SeditSend $draft $t
!
! The sign button turns into a menu with one entry for
! each file that matches the glob pattern ~/.signature*
!
*Sedit.Menubar.sign.text:	Sign
*Sedit.Menubar.sign.command:	SeditSign $draft $t
!
! buttons is standard buttons
! ubuttons is for extra user-specific buttons
*Sedit.Menubar.buttonlist:	help repl abort save
*Sedit.Menubar.ubuttonlist:
*Sedit.Menubar.help.text:	Help
*Sedit.Menubar.help.command:	SeditHelp
*Sedit.Menubar.abort.text:	Abort
*Sedit.Menubar.abort.command:	SeditAbort $draft $t
*Sedit.Menubar.save.text: 	Save&Quit
*Sedit.Menubar.save.command: 	SeditSave $draft $t SeditNuke

! The repl button is well-known.  It is disabled except when replying.
*Sedit.Menubar.repl.text:	Insert @
*Sedit.Menubar.repl.command:	SeditInsertFile $draft $t @
!
! menus is for standard menus
! umenus is for extra user-specific menus
!*Sedit.Menubar.menulist:	text mime more pgp
*Sedit.Menubar.menulist:	text more pgp
*Sedit.Menubar.umenulist:

*Sedit.Menubar.text.text:	Text...
*Sedit.Menubar.text.m.entrylist: plain fixed bold italic underline smaller bigger
*Sedit.Menubar.text.m.l_plain:	Plain
*Sedit.Menubar.text.m.c_plain:	SeditMimeEnriched x-plain
*Sedit.Menubar.text.m.l_fixed:	Fixed
*Sedit.Menubar.text.m.c_fixed:	SeditMimeEnriched fixed
*Sedit.Menubar.text.m.l_bold:	Bold
*Sedit.Menubar.text.m.c_bold:	SeditMimeEnriched bold
*Sedit.Menubar.text.m.l_italic:	Italic
*Sedit.Menubar.text.m.c_italic:	SeditMimeEnriched italic
*Sedit.Menubar.text.m.l_underline:	Underline
*Sedit.Menubar.text.m.c_underline:	SeditMimeEnriched underline
*Sedit.Menubar.text.m.l_smaller:	Smaller
*Sedit.Menubar.text.m.c_smaller:	SeditMimeEnriched smaller
*Sedit.Menubar.text.m.l_bigger:	Bigger
*Sedit.Menubar.text.m.c_bigger:	SeditMimeEnriched bigger

*Sedit.Menubar.more.text:	More...
*Sedit.Menubar.more.m.entrylist: keep format mhn quote cite insert part external \
insertkeys whom spell find mhn2 save preview alt
*Sedit.Menubar.more.m.l_keep: Keep on send
*Sedit.Menubar.more.m.t_keep: check
*Sedit.Menubar.more.m.v_keep: sedit($t,keep)
*Sedit.Menubar.more.m.l_format: Format mail
*Sedit.Menubar.more.m.t_format: check
*Sedit.Menubar.more.m.v_format: sedit($t,format)
*Sedit.Menubar.more.m.l_mhn: Attempt mhn
*Sedit.Menubar.more.m.t_mhn: check
*Sedit.Menubar.more.m.v_mhn: sedit($t,mhn)
*Sedit.Menubar.more.m.l_quote: Quote Printable
*Sedit.Menubar.more.m.t_quote: check
*Sedit.Menubar.more.m.v_quote: sedit($t,quote)
*Sedit.Menubar.more.m.l_cite: Cite Selection
*Sedit.Menubar.more.m.c_cite: SeditCiteSelection $draft $t
*Sedit.Menubar.more.m.l_insert: Insert File...
*Sedit.Menubar.more.m.c_insert: SeditInsertFileDirect $draft $t
*Sedit.Menubar.more.m.l_part: Insert Part...
*Sedit.Menubar.more.m.c_part: SeditInsertFileDialog $draft $t
*Sedit.Menubar.more.m.l_external: Insert External...
*Sedit.Menubar.more.m.c_external: SeditInsertExternalDialog $draft $t
*Sedit.Menubar.more.m.l_insertkeys:   Insert PGP Keys...
*Sedit.Menubar.more.m.c_insertkeys:   Pgp_InsertKeys $draft $t
*Sedit.Menubar.more.m.l_whom:	Whom
*Sedit.Menubar.more.m.c_whom:	SeditWhom $draft $f $t
*Sedit.Menubar.more.m.l_save: Save Buffer
*Sedit.Menubar.more.m.c_save: SeditSave $draft $t
*Sedit.Menubar.more.m.l_spell: Spell...
*Sedit.Menubar.more.m.c_spell: SeditSpell $draft $f $t
*Sedit.Menubar.more.m.l_find: Find SEL
*Sedit.Menubar.more.m.c_find: Sedit_Find $draft $t
*Sedit.Menubar.more.m.l_mhn2: Run mhn now
*Sedit.Menubar.more.m.c_mhn2: SeditMHN $draft $t
*Sedit.Menubar.more.m.l_preview: Mime Preview
*Sedit.Menubar.more.m.c_preview: SeditClip $draft $t
*Sedit.Menubar.more.m.l_alt: Alternate Editor
*Sedit.Menubar.more.m.c_alt: SeditAlternate $draft $t

*Sedit.Menubar.pgp.text:	PGP...
*Sedit.Menubar.pgp.m.entrylist: none sign signbin encrypt encsign signkey
*Sedit.Menubar.pgp.m.l_encrypt: Encrypt
*Sedit.Menubar.pgp.m.c_encrypt: Pgp_SeditEncrypt encrypt $draft $t
*Sedit.Menubar.pgp.m.l_sign:    Sign clear
*Sedit.Menubar.pgp.m.c_sign:    Pgp_SeditEncrypt signclear $draft $t
*Sedit.Menubar.pgp.m.l_signbin: Sign binary
*Sedit.Menubar.pgp.m.c_signbin: Pgp_SeditEncrypt signbinary $draft $t
*Sedit.Menubar.pgp.m.l_encsign: Encrypt & sign
*Sedit.Menubar.pgp.m.c_encsign: Pgp_SeditEncrypt encryptsign $draft $t
*Sedit.Menubar.pgp.m.l_none:	No action
*Sedit.Menubar.pgp.m.c_none:   	Pgp_SeditEncrypt none $draft $t
*Sedit.Menubar.pgp.m.l_signkey:	Change Default Key
*Sedit.Menubar.pgp.m.c_signkey:	Pgp_SetMyName

! This stuff is just a skeleton.  The functions don't do much yet
*Sedit.Menubar.mime.text:	Mime...
*Sedit.Menubar.mime.m.entrylist: type format delete

*Sedit.Menubar.mime.m.l_format: Format
*Sedit.Menubar.mime.m.t_format: cascade
*Sedit.Menubar.mime.m.m_format: format

*Sedit.Menubar.mime.m.format.entrylist: marks tags

*Sedit.Menubar.mime.m.format.l_marks: Show Marks
*Sedit.Menubar.mime.m.format.c_marks: SeditMimeShowMarks $t
*Sedit.Menubar.mime.m.format.l_tags: Show Tags
*Sedit.Menubar.mime.m.format.c_tags: SeditMimeShowTags $t

! The following menu is special because it gets dynamically updated
! as parts are added to the message.
*Sedit.Menubar.mime.m.l_delete: Delete Part
*Sedit.Menubar.mime.m.t_delete: cascade
*Sedit.Menubar.mime.m.m_delete: delete

*Sedit.Menubar.mime.m.delete.entrylist: body

*Sedit.Menubar.mime.m.delete.l_body: Delete Body
*Sedit.Menubar.mime.m.delete.c_body: SeditPartDelete Body


*Sedit.Menubar.mime.m.l_type: Type
*Sedit.Menubar.mime.m.t_type: cascade
*Sedit.Menubar.mime.m.m_type: type

*Sedit.Menubar.mime.m.type.entrylist: text multi audio image message application video
*Sedit.Menubar.mime.m.type.l_text: Text
*Sedit.Menubar.mime.m.type.t_text: cascade
*Sedit.Menubar.mime.m.type.m_text: text
*Sedit.Menubar.mime.m.type.text.entrylist: plain enriched
*Sedit.Menubar.mime.m.type.text.l_plain: Plain
*Sedit.Menubar.mime.m.type.text.c_plain: SeditMimeType text/plain
*Sedit.Menubar.mime.m.type.text.l_enriched: Enriched
*Sedit.Menubar.mime.m.type.text.c_enriched: SeditMimeType text/enriched

*Sedit.Menubar.mime.m.type.l_multi: Multipart
*Sedit.Menubar.mime.m.type.t_multi: cascade
*Sedit.Menubar.mime.m.type.m_multi: multi
*Sedit.Menubar.mime.m.type.multi.entrylist: mixed alternative parallel digest
*Sedit.Menubar.mime.m.type.multi.l_mixed: Mixed
*Sedit.Menubar.mime.m.type.multi.c_mixed: SeditMimeType multipart/mixed
*Sedit.Menubar.mime.m.type.multi.l_alternative: Alternative
*Sedit.Menubar.mime.m.type.multi.c_alternative: SeditMimeType multipart/alternative
*Sedit.Menubar.mime.m.type.multi.l_parallel: Parallel
*Sedit.Menubar.mime.m.type.multi.c_parallel: SeditMimeType multipart/parallel
*Sedit.Menubar.mime.m.type.multi.l_digest: Digest
*Sedit.Menubar.mime.m.type.multi.c_digest: SeditMimeType multipart/digest


*Sedit.Menubar.mime.m.type.l_audio: Audio
*Sedit.Menubar.mime.m.type.t_audio: cascade
*Sedit.Menubar.mime.m.type.m_audio: audio
*Sedit.Menubar.mime.m.type.audio.entrylist: basic
*Sedit.Menubar.mime.m.type.audio.l_basic: Basic
*Sedit.Menubar.mime.m.type.audio.c_basic: SeditMimeType audio/basic

*Sedit.Menubar.mime.m.type.l_image: Image
*Sedit.Menubar.mime.m.type.t_image: cascade
*Sedit.Menubar.mime.m.type.m_image: image
*Sedit.Menubar.mime.m.type.image.entrylist: basic
*Sedit.Menubar.mime.m.type.image.l_basic: Basic
*Sedit.Menubar.mime.m.type.image.c_basic: SeditMimeType image/basic

*Sedit.Menubar.mime.m.type.l_message: Message
*Sedit.Menubar.mime.m.type.t_message: cascade
*Sedit.Menubar.mime.m.type.m_message: message
*Sedit.Menubar.mime.m.type.message.entrylist: external digest
*Sedit.Menubar.mime.m.type.message.l_external: External Body
*Sedit.Menubar.mime.m.type.message.c_external: SeditMimeType message/external
*Sedit.Menubar.mime.m.type.message.l_digest: Digest
*Sedit.Menubar.mime.m.type.message.c_digest: SeditMimeType message/digest

*Sedit.Menubar.mime.m.type.l_application: Application
*Sedit.Menubar.mime.m.type.t_application: cascade
*Sedit.Menubar.mime.m.type.m_application: app
*Sedit.Menubar.mime.m.type.app.entrylist: postscript
*Sedit.Menubar.mime.m.type.app.l_postscript: Postscript
*Sedit.Menubar.mime.m.type.app.c_postscript: SeditMimeType application/postscript

*Sedit.Menubar.mime.m.type.l_video: Video
*Sedit.Menubar.mime.m.type.t_video: cascade
*Sedit.Menubar.mime.m.type.m_video: video
*Sedit.Menubar.mime.m.type.video.entrylist: basic
*Sedit.Menubar.mime.m.type.video.l_basic: Basic
*Sedit.Menubar.mime.m.type.video.c_basic: SeditMimeType video/basic

!
! WhatNowDialog buttons and menus
!
*WhatNow.buttonlist: abort dismiss reedit send
*WhatNow.ubuttonlist:
*WhatNow.menulist: more
*WhatNow.umenulist:

*WhatNow.abort.text:	Kill
*WhatNow.abort.command:	EditDialogDone abort $id
*WhatNow.dismiss.text:	Dismiss
*WhatNow.dismiss.command: EditDialogDone dismiss $id
*WhatNow.reedit.text:	Re-edit
! I cannot remember why nohide is useful here, bw 3/15/95
!*WhatNow.reedit.command: EditDialogDone reedit $id nohide
*WhatNow.reedit.command: EditDialogDone reedit $id
*WhatNow.send.text:	Send
*WhatNow.send.command: EditDialogDone send $id

*WhatNow.more.text: More...
*WhatNow.more.m.entrylist: whom mhn spell sedit encrypt alt
*WhatNow.more.m.l_whom:	Whom
*WhatNow.more.m.c_whom:	EditDialogDone whom $id nohide
*WhatNow.more.m.l_mhn:	MHN
*WhatNow.more.m.c_mhn:	EditDialogDone mhn $id nohide
*WhatNow.more.m.l_spell:	Spell
*WhatNow.more.m.c_spell:	EditDialogDone spell $id nohide
*WhatNow.more.m.l_sedit:	Sedit
*WhatNow.more.m.c_sedit:	EditDialogDone sedit $id
*WhatNow.more.m.l_alt:		Alternate Editor
*WhatNow.more.m.c_alt:		EditDialogDone alternate $id

*WhatNow.more.m.t_encrypt:	cascade
*WhatNow.more.m.m_encrypt:	encrypt
*WhatNow.more.m.l_encrypt:	PGP...

*WhatNow.more.m.encrypt.entrylist:	encrypt encsign sign signbin
*WhatNow.more.m.encrypt.l_encrypt:	encrypt
*WhatNow.more.m.encrypt.c_encrypt:	Pgp_EncryptWhatNow encrypt $id
*WhatNow.more.m.encrypt.l_encsign:	encrypt & sign
*WhatNow.more.m.encrypt.c_encsign:	Pgp_EncryptWhatNow encryptsign $id
*WhatNow.more.m.encrypt.l_sign:		sign clear
*WhatNow.more.m.encrypt.c_sign:		Pgp_EncryptWhatNow signclear $id
*WhatNow.more.m.encrypt.l_signbin:	sign binary
*WhatNow.more.m.encrypt.c_signbin:	Pgp_EncryptWhatNow signbinary $id

! Sedit bindings
*sedit_typeKillsSel: 1
*sedit_scrollButton: Middle

*sedit_editprocs: selpaste selcopy seldelete backspace openline deleol delbol \
	delwordforw delwordback delchar transpose transemacs transword \
	composechar bof eof linestart lineend up1line down1line \
	backword forwword backchar forwchar up1page down1page

*sedit_key_selpaste:	 <Control-y> <Key-F18>

*sedit_key_seldelete:	 <Control-w> <Key-Delete> <Key-20>
*sedit_key_selcopy:	 <Key-F16>
*sedit_key_backspace:	 <Control-h> <Key-BackSpace>
*sedit_key_openline:	 <Control-o>
*sedit_key_deleol:	 <Control-k>
*sedit_key_delbol:	 <Control-x><Key-Delete>
*sedit_key_delwordforw:	 <Meta-d>
*sedit_key_delwordback:	 <Meta-h>
*sedit_key_delchar:	 <Control-d>
*sedit_key_transpose:	 <Control-t>
*sedit_key_transemacs:
*sedit_key_transword:	 <Meta-t>

*sedit_key_composechar:	 <Multi_key>

*sedit_key_bof:		<Meta-less>
*sedit_key_eof:		<Meta-greater>
*sedit_key_linestart:	 <Control-a>
*sedit_key_lineend:	 <Control-e>
*sedit_key_up1line:	 <Control-p> <Key-Up>
*sedit_key_down1line:	 <Control-n> <Key-Down>
*sedit_key_backword:	 <Meta-b>
*sedit_key_forwword:	 <Meta-f>
*sedit_key_backchar:	 <Control-b> <Key-Left>
*sedit_key_forwchar:	 <Control-f> <Key-Right>
*sedit_key_up1page:	 <Meta-v>
*sedit_key_down1page:	 <Control-v>


! EOF
EOF-EOF-EOF
NewFile lib/env.tcl<<'EOF-EOF-EOF'
# env.tcl
#
# Grab things from the environment
#
# Copyright (c) 199 Sun Microsystems
# Use and copying of this software and preparation of derivative works based
# upon this software are permitted. Any distribution of this software or
# derivative works must comply with all applicable United States export
# control laws. This software is made available AS IS, and Sun Microsystems
# makes no warranty about the software, its performance or its conformity to
# any specification.

# Env_Init sets up:
#	MHCONTEXT	to give exmh a private MH context file
#	USER		to avoid dealing with LOGNAME
#	TMPDIR		to allow retargeting /tmp
#	PATH		to make sure the MH programs are on the path

proc Env_Init {} {
    global env

    # Use an alternate context to avoid conflict with command line MH
    # This has to be the same as used by exmh so that private sequences work
    # right.
    set env(MHCONTEXT) .exmhcontext

    # Merge LOGNAME into USER so we only need to look for one later
    if [catch {set env(USER)} user] {
	if [catch {set env(LOGNAME)} user] {
	    puts stderr "No USER or LOGNAME envar"
	    set user ""
	}
	set env(USER) $user
    }

    # Init TMPDIR
    if [info exists env(EXMHTMPDIR)] {
	set env(TMPDIR) $env(EXMHTMPDIR)
    }
    if {![info exists env(TMPDIR)] || ![file isdirectory $env(TMPDIR)]} {
	set env(TMPDIR) /tmp
    }

    # Make sure MH is on the path
    global mh_path
    set hit 0
    foreach dir [split $env(PATH) :] {
	if {[string compare $dir $mh_path] == 0} {
	    set hit 1
	    break
	}
    }
    if {! $hit} {
	set env(PATH) $mh_path:$env(PATH)
    }

}

proc Env_Tmp {} {
    global env
    return $env(TMPDIR)
}

EOF-EOF-EOF
NewFile lib/help.Lists<<'EOF-EOF-EOF'
There are three exmh-related mailing lists.  The lists are linked
together so you only need to pick one:

exmh-announce@sunlabs.sun.com
is a moderated list that is used for announcements about new exmh releases.
This gets very little traffic.

exmh-users@sunlabs.sun.com
is an open list used for general question and answer about exmh.
This list also gets any messages sent to exmh-announce, so you'll
hear about new releases on this list, too.  There is also a digest
version of this list.

exmh-workers@sunlabs.sun.com
is an open list meant more for experts that are dabbling with the
internals of exmh.  This list also gets the exmh-users messages
(and therefore also gets the exmh-announce messages).

Use the other menu operations to add or remove yourself from these lists.
If you need more detailed help about administration of these lists,
send mail to
majordomo@sunlabs.sun.com
with a message that just says
"help"
EOF-EOF-EOF
NewFile misc/HP.VUE.notes<<'EOF-EOF-EOF'
Return-Path: exmh-mail-errors@parc.xerox.com 
Return-Path: <exmh-mail-errors@parc.xerox.com>
Received: from Eng.Sun.COM (engmail1.Eng.Sun.COM) by sage.Eng.Sun.COM (5.x/SMI-SVR4)
	id AA19484; Fri, 27 Oct 1995 02:34:39 -0700
Received: from mercury.Sun.COM (mercury.EBay.Sun.COM) by Eng.Sun.COM (5.x/SMI-5.3)
	id AA18112; Fri, 27 Oct 1995 02:34:36 -0700
Received: from alpha.xerox.com by mercury.Sun.COM (Sun.COM)
	id CAA04662; Fri, 27 Oct 1995 02:34:36 -0700
Received: from mu.parc.xerox.com ([13.2.116.81]) by alpha.xerox.com with SMTP id <15326(9)>; Fri, 27 Oct 1995 02:10:10 PDT
Received: by mu.parc.xerox.com id <162703>; Fri, 27 Oct 1995 01:47:37 -0700
Received: from alpha.xerox.com ([13.1.64.93]) by mu.parc.xerox.com with SMTP id <162701>; Fri, 27 Oct 1995 01:47:10 -0700
Received: from hp.com ([15.255.152.4]) by alpha.xerox.com with SMTP id <14700(3)>; Fri, 27 Oct 1995 01:46:43 PDT
Received: from hazel.pwd.hp.com by hp.com with ESMTP
	(1.37.109.16/15.5+ECS 3.3) id AA266433595; Fri, 27 Oct 1995 01:46:36 -0700
Received: from localhost by hazel.pwd.hp.com with SMTP
	(1.39.111.2/16.2) id AA077983582; Fri, 27 Oct 1995 08:46:22 GMT
Message-Id: <199510270846.AA266433595@hp.com>
X-Mailer: exmh version 1.6.4 10/10/95
To: Paolo Brutti <gi0570@rh0015.roma.tlsoft.it>
Cc: exmh-users@parc.xerox.com
Subject: Re: VUE exmh wrapper 
In-Reply-To: Your message of "Fri, 27 Oct 1995 08:42:53 +0100."
             <9510270742.AA09717@rh0015.roma.tlsoft.it> 
Mime-Version: 1.0
	boundary="===_0_Fri_Oct_27_08:29:38_GMT_1995"
Date: Fri, 27 Oct 1995 01:46:22 PDT
From: John Haxby <jch@hazel.pwd.hp.com>
Sender: exmh-mail-errors@parc.xerox.com
Precedence: bulk
X-Comment: (Un)subscription requests to exmh-users-request@parc.xerox.com
Content-Type: multipart/mixed ;
	boundary="===_0_Fri_Oct_27_08:29:38_GMT_1995"
Content-Length: 4602

This is a multipart MIME message.

--===_0_Fri_Oct_27_08:29:38_GMT_1995
Content-Type: text/plain; charset=us-ascii

> I installed exmh a few weeks ago and I kept getting your same error
> about SIGCHILD being ignored.
> Only recently I discovered that this was caused by VUE, so, being a new
> UNIX user, I am currently starting exmh only from an xterm.
> Could you please send me your wrapper?

OK, assume one has got it, then so has everyone else :-)

Attached, without warranty express or implied, and no support from me or my employer and no liability either, you'll find several things.  The first are some actions, excerpts from user-prefs.vf or standalone files, doesn't really matter.  The important thing is that the "Mailer" action eventually results in "detach exmh" ...

--===_0_Fri_Oct_27_08:29:38_GMT_1995
Content-Type: text/plain; charset=us-ascii
Content-Description: VUE actions

#
# These can all go in ~/.vue/types/user-prefs.vf.  See the description for
# customizing your mailer, editor and terminal emulator in the on-line help.
#
ACTION Mailer
	TYPE		MAP		Exmh
END

ACTION  MailAFile
	TYPE		MAP		ExmhFile
END

ACTION Exmh
	TYPE		COMMAND
	EXEC-STRING	detach exmh
	WINDOW-TYPE	NO-STDIO
END

ACTION ExmhFile
	DESCRIPTION	Mail one or more files using exmh 
	TYPE		COMMAND
	EXEC-STRING	mailfile %(File)Arg_1"Files:"% %(File)Args%
	WINDOW-TYPE	NO-STDIO
END


--===_0_Fri_Oct_27_08:29:38_GMT_1995
Content-Type: text/plain; charset=us-ascii
Content-Description: ... continued ...

The "detach" command is a little C-program that runs whatever you tell it.  It's a like running something in the background except that it detaches the process from a terminal and, most importantly for HP VUE, sets SIGCHLD to SIG_DFL.

The ExmhFile action replaces the old MailxFile action that is invoked then you drop a file on the mail icon.  For those that don't know and do care, this action used to invoke mailx with a subject and recipient prompted from a dialog box.  ExmhFile runs the attached wish script to create a MIME bodypart for the file(s) and throws the whole lot at exmh.  I haven't tried the mailfile script extensively, so it's bound to fail in interesting ways if you use it in anger:-)

jch

--===_0_Fri_Oct_27_08:29:38_GMT_1995
Content-Type: application/x-c-source; charset=us-ascii
Content-Description: detach.c

#include <unistd.h>
#include <signal.h>

main (int argc, char *argv[])
{
    int pid, fd, i;

    if ((pid = fork()) < 0) {
	perror ("fork");
	exit (1);
    }
    if (pid != 0)
	exit (0);

    fd = open ("/dev/null", 2);
    dup2 (fd, 0);
    dup2 (fd, 1);
    dup2 (fd, 2);
    for (i = 3; i < 64; i++)
	close (i);
    setsid ();
    signal (SIGCHLD, SIG_DFL);
    argv++;
    execvp (*argv, argv);
}

--===_0_Fri_Oct_27_08:29:38_GMT_1995
Content-Type: application/x-tcl
Content-Description: mailfile

#!/bin/sh
# -*- tcl -*- \
exec wish "$0" ${1+"$@"}

wm withdraw .
#
# Create a draft file.  This mechanism isn't perfect, there's a window,
# but it is slightly safer than nothing at all
#
set draftfolder [string trimleft [exec mhparam draft-folder] +]

while {1} {
    set draftfile [exec mhpath +$draftfolder new]
    if ![catch {open $draftfile {WRONLY CREAT EXCL}} draftfd] {
	break
    }
}

foreach arg $argv {
    lappend subject $argv
}
if ![info exists subject] {
    set subject "<stdin>"
}
puts $draftfd "To: \nCc: \nSubject: $subject"
puts $draftfd "Mime-Version: 1.0"
set boundary "_=[exec date]=_"
puts $draftfd "Content-type: multipart/mixed; boundary=\"$boundary\"\n"

puts $draftfd "--$boundary"
puts $draftfd "Content-type: text/plain\n"
puts $draftfd "\t\[Introductory Text]\n"

if {[llength $argv] == 0} {
    puts $draftfd "--$boundary"
    puts $draftfd "Content-type: text/plain\n"
    while {![eof stdin]} {
	set bytes [read stdin 8192]
	puts -nonewline $draftfd $bytes
    }
    if ![string match "*\n" $bytes] {
	puts $draftfd ""
    }
    puts $draftfd "--$boundary--"
} else {
    foreach arg $argv {
	puts $draftfd "--$boundary"
	switch -glob -- $arg {
	    *.ps {set type "application/postscript"}
	    * {set type "text/plain"}
	}
	puts $draftfd "Content-type: $type"
	puts $draftfd "Content-description: $arg\n"

	if [catch {open $arg r} fd] {
	    puts $draftfd "\t$arg: $fd"
	} else {
	    while {![eof $fd]} {
		set bytes [read $fd 8192]
		puts -nonewline $draftfd $bytes
	    }
	    close $fd
	    if ![string match "*\n" $bytes] {
		puts $draftfd ""
	    }
	}
    }
    puts $draftfd "--$boundary--"
}

close $draftfd
send exmh Msg_CompUse $draftfolder [file tail $draftfile]
destroy .

--===_0_Fri_Oct_27_08:29:38_GMT_1995--



EOF-EOF-EOF
NewFile misc/mailsort<<'EOF-EOF-EOF'
Return-Path: exmh-mail-errors@parc.xerox.com
Return-Path: <exmh-mail-errors@parc.xerox.com>
Received: from Eng.Sun.COM (engmail1.Eng.Sun.COM) by sage.Eng.Sun.COM (5.x/SMI-SVR4)
	id AA00278; Fri, 27 Oct 1995 13:18:09 -0700
Received: from mercury.Sun.COM (mercury.EBay.Sun.COM) by Eng.Sun.COM (5.x/SMI-5.3)
	id AA13719; Fri, 27 Oct 1995 13:14:46 -0700
Received: from alpha.xerox.com by mercury.Sun.COM (Sun.COM)
	id NAA04275; Fri, 27 Oct 1995 13:14:45 -0700
Received: from mu.parc.xerox.com ([13.2.116.81]) by alpha.xerox.com with SMTP id <15664(8)>; Fri, 27 Oct 1995 12:50:06 PDT
Received: by mu.parc.xerox.com id <162704>; Fri, 27 Oct 1995 12:24:24 -0700
Received: from alpha.xerox.com ([13.1.64.93]) by mu.parc.xerox.com with SMTP id <162701>; Fri, 27 Oct 1995 12:24:01 -0700
Received: from protocol.zycad.com ([192.195.24.2]) by alpha.xerox.com with SMTP id <15721(1)>; Fri, 27 Oct 1995 12:23:38 PDT
Received: from zycad.zycad.com by protocol.zycad.com (4.1/SMI-4.1)
	id AA05335; Fri, 27 Oct 95 15:23:50 EDT
Received: from dylan.zycad.com by zycad.zycad.com (4.1/SMI-4.1)
	id AA06745; Fri, 27 Oct 95 12:22:51 PDT
Received: from localhost by dylan.zycad.com (4.1/SMI-4.1)
	id AA01995; Fri, 27 Oct 95 12:22:18 PDT
Message-Id: <9510271922.AA01995@dylan.zycad.com>
X-Mailer: exmh version 1.6.4 10/10/95
To: exmh-users@parc.xerox.com
Subject: archiving script
X-Face: ">yuo)@,|JK{&H8/6`D<C3x-{s78]+cJ5UA-^.+x-{Bl^le6GqgDuCdD6$.YHXw>bjy1MyN
 {'[Wrs#IjHn0&%z5|cn<blv8+/l<SM<E2Z&o.
Mime-Version: 1.0
	boundary="===_0_Fri_Oct_27_12:20:00_PDT_1995"
Date: Fri, 27 Oct 1995 12:22:17 PDT
From: Olly Stephens <olly@dylan.zycad.com>
Sender: exmh-mail-errors@parc.xerox.com
Precedence: bulk
X-Comment: (Un)subscription requests to exmh-users-request@parc.xerox.com
Content-Type: multipart/mixed ;
	boundary="===_0_Fri_Oct_27_12:20:00_PDT_1995"
Content-Length: 3491

This is a multipart MIME message.

--===_0_Fri_Oct_27_12:20:00_PDT_1995
Content-Type: text/plain; charset=us-ascii


I mentioned in passing on the exmh-workers mailing list a script that I
use via cron to archive my mail.  I had a couple of requests for it so
I thought I'd send it out to all exmh-users.

It goes through all folders (that don't look like archive folders) moving
any messages older than a month (actually 28 days) into sub-folders which
are named by the month.  I use this to keep the folder sizes nice and small.
So, for example, a typical folder hierarchy looks like:

	% folder +exmh -fast -recurse
	exmh
	exmh/Sep-95
	exmh/Aug-95
	exmh/Jul-95
	exmh/Jun-95
	exmh/May-95
	exmh/Apr-95
        ....

Once the script has archived messages, it packs the main folder to keep
things neat.

To use it, you'll probably have to modify a few paths and it's written
in perl so you'll need that (a tcl or sh version would be fairly simple
as it doesn't really use anything uniquely perlesque).

It's fairly trivial;  it's only claim to intelligence is the use of
a custom scan format to calculate the archive folder, saving us the
trouble of trying to find the date in the message.

A word of warning before using it though;  it currently confuses exmh
somewhat.  This is why I mentioned it in a previous mail - I was describing
the bug.  It's nothing that a quick "Rescan folder" won't fix but bear
it in mind.  Rewriting it in tcl and getting it to "send" a rescan command
to exmh might not be a bad idea....

Enjoy,

Olly



--===_0_Fri_Oct_27_12:20:00_PDT_1995
Content-Type: application/octet-stream
Content-Description: mailsort

#!/usr/local/bin/perl
#
# mailsort - sorts all MH mail folders moving mail older than a month
#            (well, 28 days actually) into sub-folders called "Jun-94" etc.
#            then packs the main folder
#
# Usage: mailsort [folder-list]
#          defaults to sorting all folders (including sub folders) that
#          don't look like archive folders and which have more than 100 msgs
#          useful if called from a cron job (say once a week)
#
# Caveat: if you have regular folders called mmm-yy where mmm is a month
#         and yy is a year, you may want to modify the scan format used
#
# Olly Stephens <olly@zycad.com>
#

# you may want to modify the following paths

$mh = '/usr/local/bin/mh' ;
$yes = '/usr/ucb/yes' ;

if ($#ARGV >= 0) {
  @folders = @ARGV ;
} else {
  open(FOLDERS, "$mh/folder -all -recurse |") || die "couldn't run folder\n" ;
  while (<FOLDERS>) {
    chop ;
    if ((/(\S+)\+?\s+has\s+(\d+)\smessage/) && ($2 > 100) &&
        ($1 !~ /\/(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-\d\d$/)) {
      push(@folders, $1) ;
      print "pushing $1\n" ;
    }
  }
  close(FOLDERS) ;
}

$scanfmt = '%(msg) %(month{date})-%(void(year{date}))%02(modulo 100)' ;

foreach $f (@folders) {
  print "scanning $f...\n" ;
  open(SCAN, "$mh/scan -format '$scanfmt' +$f \`$mh/pick +$f -before -28\` |")
                         || die "couldn't run scan or pick\n" ;
  undef %subfolders ;
  undef %subcount ;
  while (<SCAN>) {
    chop ;
    @line = split ;
    $subfolders{$line[1]} .= " $line[0]" ;
    $subcount{$line[1]}++ ;
  }
  close(SCAN) ;

  $pack = 0 ;
  foreach $s (keys(%subfolders)) {
    print "  adding $subcount{$s} messages to $s...\n" ;
    `$yes | $mh/refile -src +$f +$f/$s $subfolders{$s}` ;
    $pack = 1 ;
  }

  `$mh/folder -pack +$f` if ($pack) ;
}

--===_0_Fri_Oct_27_12:20:00_PDT_1995--



EOF-EOF-EOF
NewFile misc/more.colors<<'EOF-EOF-EOF'
!
! Set colors
!
*c_current: 				linen
*c_currentBg:   			#75813ae174bc
*c_unseen:      			#e666be340000
*c_unseenBg:    			#476c000046a8
*c_unseenf: 				#476c000046a8
*c_moved: 				slateblue4
*c_movedFg: 				lightgray
*c_deleted:     			black
*c_deletedFg:   			gray40
*c_background:  			#476c000046a8
*c_foreground:  			#ffcdff
*c_popup:				slateblue3
*c_label:       			linen

*c_st_normal:				linen
*c_st_error:				red
*c_st_warn:				yellow2
*c_st_background:			antiquewhite

*c_uri:					thistle
*c_uriFg:				black
*c_uriAbg:				white
*c_uriAfg:				black

*background:				#476c000046a8
*foreground:				lightgray
*activeBackground:			#75813ae174bc
*activeForeground:			snow
*disabledForeground:			gray40
*fl_background:				#476c000046a8
*Main*foreground:       		linen
*highlightBackground:			#476c000046a8
*msg.t.background:			gray75
*msg.t.foreground:			black

*Entry.background:                      gray75
*Entry.foreground:                      black
*Text.selectBackground:			light blue
*mid.right.top.msg.background:          #476c000046a8
*Sedit.Entry.background:                #476c000046a8
*Sedit.Entry.foreground:                linen

*Label.foreground:                      yellow
*Main*Label.foreground:                 yellow
*Fops*Label.foreground:                 yellow
*Mid*Label.foreground:                  yellow
*Button*foreground:			linen
*Radiobutton.foreground:		linen
*Scrollbar.activeForeground:		#7581000074bc
*Scrollbar.foreground:		        #75813ae174bc
!*Scrollbar.troughColor:			#476c000046a8
*Scrollbar.troughColor:			cadetblue

*Mid.Right.Status.msg*foreground:	white

*Msg*Menu.foreground:			linen

*insertBackground:			linen
*Entry*insertBackground:		black
*selectColor:				#f374cf5bffff


!
! Cursors
!
*cursor:				top_left_arrow snow black
!*Dialog*cursor:				top_left_arrow snow black
!*Status*cursor:				top_left_arrow snow black
*Text.cursor:				xterm snow
*Entry.cursor:				xterm black
*Ftoc*Text.cursor:			hand2
*Sedit*Text.cursor:			xterm snow
*msg.t.cursor:				xterm black
*Status.boundary.cursor:		double_arrow snow black
*Main.quit.cursor:			gumby black yellow

*Mid.Right.Status.msg*cursor:		top_left_arrow snow black

!
! Fonts
!
*font:				-adobe-helvetica-medium-r-*--*-140-100-100-*-*-*-*
*Msg*font:			-adobe-courier-medium-r-*--*-140-100-100-*-*-*-*
*Ftoc*font:			-adobe-courier-medium-r-*--*-140-100-100-*-*-*-*
*Mops*font:			-adobe-helvetica-medium-r-*--*-140-100-100-*-*-*-*
*Fops*font:			-adobe-helvetica-medium-r-*--*-140-100-100-*-*-*-*
*Main*font:			-adobe-helvetica-medium-r-*--*-140-100-100-*-*-*-*
*Mid.Right.Status*font:		-adobe-helvetica-medium-r-*--*-100-100-100-*-*-*-*
*Button*font:			-adobe-helvetica-medium-r-*--*-140-100-100-*-*-*-*
*Sedit*font:			-adobe-courier-medium-r-*--*-140-100-100-*-*-*-*
*Sedit*Menubar*font:		-adobe-helvetica-medium-r-*--*-140-100-100-*-*-*-*
*Sedit*Button*font:		-adobe-helvetica-medium-r-*--*-140-100-100-*-*-*-*
*fl_font:			-adobe-helvetica-medium-r-*--*-120-100-100-*-*-*-*

!
! Header design
!
*m_tagnames:		hidden subject from date cc to
*m_hidden:		-font 6x10
*m_default:		-foreground black
*m_date:	-foreground SlateBlue4 -font -adobe-helvetica-bold-r-*--*-120-100-100-*-*-*-*
*m_from:	-foreground SlateBlue4 -font -adobe-helvetica-bold-r-*--*-120-100-100-*-*-*-*
*m_to:		-foreground SlateBlue4 -font -adobe-helvetica-bold-r-*--*-120-100-100-*-*-*-*
*m_cc:		-foreground SlateBlue4 -font -adobe-helvetica-bold-r-*--*-120-100-100-*-*-*-*
*m_subject:	-foreground SlateBlue3 -font -adobe-helvetica-bold-r-*--*-180-100-100-*-*-*-*

EOF-EOF-EOF
NewFile misc/popclient<<'EOF-EOF-EOF'
Return-Path: exmh-mail-errors@parc.xerox.com 
Return-Path: <exmh-mail-errors@parc.xerox.com>
Received: from Eng.Sun.COM (engmail1.Eng.Sun.COM) by sage.Eng.Sun.COM (5.x/SMI-SVR4)
	id AA05329; Thu, 26 Oct 1995 03:08:27 -0700
Received: from mercury.Sun.COM (mercury.EBay.Sun.COM) by Eng.Sun.COM (5.x/SMI-5.3)
	id AA06420; Thu, 26 Oct 1995 03:08:24 -0700
Received: from alpha.xerox.com by mercury.Sun.COM (Sun.COM)
	id DAA17161; Thu, 26 Oct 1995 03:08:24 -0700
Received: from mu.parc.xerox.com ([13.2.116.81]) by alpha.xerox.com with SMTP id <15324(5)>; Thu, 26 Oct 1995 03:01:12 PDT
Received: by mu.parc.xerox.com id <162704>; Thu, 26 Oct 1995 02:41:19 -0700
Received: from alpha.xerox.com ([13.1.64.93]) by mu.parc.xerox.com with SMTP id <162695>; Thu, 26 Oct 1995 02:40:59 -0700
Received: from mendel.sis.pasteur.fr ([157.99.64.100]) by alpha.xerox.com with SMTP id <15317(3)>; Thu, 26 Oct 1995 02:40:44 PDT
Received: from josephine.sis.pasteur.fr (josephine.sis.pasteur.fr [157.99.60.23]) by mendel.sis.pasteur.fr (8.6.11/8.6.9) with ESMTP id KAA06059 for <exmh-users@parc.xerox.com>; Thu, 26 Oct 1995 10:36:19 +0100
Received: from localhost (localhost [127.0.0.1])
          by josephine.sis.pasteur.fr (8.6.12/jtpda-5.1) with SMTP id KAA15119
          for exmh-users@parc.xerox.com; Thu, 26 Oct 1995 10:36:16 +0100
Message-Id: <199510260936.KAA15119@josephine.sis.pasteur.fr>
X-Mailer: exmh version 1.6.1 5/23/95
From: Stephane Bortzmeyer <bortzmeyer@pasteur.fr>
To: exmh-users@parc.xerox.com
Subject: POP with exmh (Was: New release of exmh )
In-Reply-To: Ron Frederick <frederic@parc.xerox.com>'s message of "Wed, 
 25 Oct 95 12:49:18 PDT."
             <95Oct25.124928pdt.16136@ecco.parc.xerox.com> 
Mime-Version: 1.0
Date: Thu, 26 Oct 1995 02:36:13 PDT
X-Mts: smtp
Sender: exmh-mail-errors@parc.xerox.com
Precedence: bulk
X-Comment: (Un)subscription requests to exmh-users-request@parc.xerox.com
Content-Type: text/plain; charset=us-ascii
Content-Length: 1908

On Wednesday 25 October 95, at 12 h 49, the keyboard of Ron Frederick 
<frederic@parc.xerox.com> wrote:

>     Fixed FAQ table of contents.  FAQ #9 now has three parts:
> 	9a. How do I get POP to work with exmh?

The FAQ gives good explanations. However, it seems something is missing 
in it: you DO NOT have to run a "POP aware" MH to use exmh and a POP 
server. Neither you are forced to patch/configure/hack elm, pine, etc to 
read mail which is available from a POP server. These 
patches/configurations are always painful and very often not so well 
documented.

The solution I suggest, which works fine with exmh, is to use a 
completely separate program, which is a pure POP client ("pure" because 
it only retrieves: it doesn't display or compose). This program connects 
to the POP server, retrieves the mail, puts it in a standard place 
(typically /var/spool/mail/username) where ANY mail program, WITHOUT 
patch or special configuration can pick it. 

I know four such programs, "popclient" being the most famous:

"popclient" <ftp://ftp.mal.com/pub/pop> but Archie will find many places.
"popc" <ftp://ftp.imag.fr/pub/Linux/net>
"popmail" <ftp://ftp.cic.net/pub/Software/unix/mail>
"gwpop" <ftp://ftp.pasteur.fr/pub/Network/gwpop>

I wrote gwpop and therefore I'm a little biased towards it :-)

You can also use slocal or procmail to make these programs deliver 
directly in MH folders. This is what I do with gwpop+procmail. exmh has 
been setup to "Way to inc: none" and "Background processing: flist". That 
way, exmh displays automatically folders with new mail.

I have a very detailed documentation of my setup, available on request, 
but only in French.

Stephane Bortzmeyer           Institut Pasteur
bortzmeyer@pasteur.fr         Service d'Informatique Scientifique
                              Paris, France
+33 1 40 61 34 62

http://web.cnam.fr/personnes/bortzmeyer/home_page.dom


EOF-EOF-EOF
NewFile misc/unseenwin.TODO<<'EOF-EOF-EOF'
TO DO list for the unseen window
--------------------------------

1. Solve the odd weird synchronisation problems

   (maybe Brent's new flist.tcl will do this for us)

2. When set so the window grows to accomodate the list, should be
   able to specify an anchor position

   (this is really something that the window manager should do [I think]
    but it should be possible by extracting the new geometry after the
    window is resized and repositioning it so that the given anchor
    position (nw, ne, sw, se) remains in the same place)
EOF-EOF-EOF
