CUSTOMIZING EXMH

Contents

NAME

exmh-custom - A guide to customizing the exmh mail user interface.

CUSTOMIZING EXMH

This man page describes the four mechanisms used to customize Exmh: , the MH profile, X resources, and custom Tcl code.

Exmh is built with the assumption that you will want to customize it to some degree. The simplest way is by the user interface, which exposes numerous knobs and dials that you can adjust to control a lot of the behavior of exmh. 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 exmh. 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 exmh to slip in your new feature. It is also possible to completely replace any module of the exmh implementation. Finally, there are a few MH profile components introduced by exmh, although these may eventually migrate out of the profile and into the package.

PREFERENCES

After you have used exmh a little, you should explore all its capabilities by clicking on the 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.

There are three types of options you can set through the 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 exmh runtime behavior. Then, when you click Save in the dialog, the values are saved as X resource settings in your ~/.exmh/exmh-defaults file.

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 <Return> for the change to take effect immediately (or choose Save).

You can cycle through all the preference dialogs by using the Next 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.

If you decide you like your settings, click Save in the main dialog to save them in a exmh-defaults file in your ~/.exmh directory. Click Reset All in the main dialog to restore all the settings to those of your last Save. Within each module's preference dialog there is a Reset button that resets only those module's settings.

Warning! If you click Dismiss in the main dialog, some preferences may have been set for the current session, but they will not have been saved to your ~/.exmh/exmh-defaults file.

PREFERENCE SECTIONS

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.

The Top Ten
A collection of the ten most important preference settings.
Address Database
Control automatic address memorization, limit it to certain folders. (addr.tcl)
Background Processing
What actions occur in the background, and how frequently. (background.tcl)
Bayesian Spam Filter
An interface to external spam-filtering software, such as SpamAssassin, bogofilter, spamoracle, and others. (bogo.tcl)
Busy Indicator
What method of signaling that exmh is busy. (busy.tcl)
Editor Support
An external editor, spell program, and MHN command can be defined. (editor.tcl)
FS Box
The file selector has a few parameters, including the threshold size for large directories and whether or not you want to see files who's names begin with a period. (fileselect.tcl)
Faces
The use of the facesaver database and the decompression of X-Face and X-Image-URL components can be controlled. (faces.tcl)
Folder Cache
Set how many lines are in your folder cache display, and what folders are permanently in your folder cache. (fcache.tcl)
Folder Display
Set the number of rows of labels in the folder display. The style of nested folder display is controlled here. (fdisp.tcl)
Fonts
A font selection dialog. (fontsel.tcl)
General PGP Interface
exmh has support for a number of different versions of the Pretty Good Privacy email security program. This dialog allows you to set parameters that apply to all supported versions of PGP. For example, you can choose whether exmh can remember your pass phrase or if all PGP programs are run under an xterm instead. There are preferences dialogs for each supported version of PGP; they may or may not appear in your installed version depending on which versions of PGP are detected when exmh is run. (pgpMain.tcl)
Glimpse
Settings for the Glimpse full-text indexing system. (glimpse.tcl)
GnuPG Interface
Preferences that apply to GPG (the GNU Privacy Guard). (pgpGpg.tcl)
Hacking Support
A debug log can be enabled, and you can define the directory for personal Tcl code. (main.tcl)
Html Viewer
Settings for the built-in HTML viewer, including the proxy server and port. (html.tcl)
I-Spell
This is a module to allow interactive spelling within a sedit window it has many fine features include suggested correction and the ability to add new words to a session or to your personnel dictionary. For words that are either not correct or not generated by a combination of roots or compounds, the word is marked as not spelled correctly. (ispell.tcl)
Incorporate Mail
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)
Intelligent Signatures
Controls how different signature files are chosen based on the recipient. (seditExtras.tcl)
MH Tweaks
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)
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)
NNTP Support
Set the news server here, and the newsgroups to retrieve if you have background news retrieval enabled. (post.tcl, getnews.tcl)
PGP 2.6 Interface
Preferences that apply to PGP 2.6. (pgpPgp2.tcl)
PGP 5.0 Interface
Preferences that apply to PGP 5.0. (pgpPgp5.tcl)
PGP 6.5 Interface
Preferences that apply to PGP 6.5. (pgpPgp6.tcl)
Printing
The print command can be defined. You can also enter an arbitrary UNIX command to apply to a message. (print.tcl)
Quoting
Exmh has the ability to write to a quoting file ('@' by default). This controls how this is done. (quote.tcl)
Scan Listing
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)
Sequences Window
This is a summary window that lists which folders have messages in sequences. (seqwin.tcl)
Simple Editor
Formatting parameters can be adjusted and automatic signatures can be enabled. (sedit.tcl)
Slow Display
If your display is slow (due to being over a slow link or encryption or whatever), exmh will recognize that the display is slow and can disable certain network intensive, but non-critical operations. (extrasInit.tcl)
Sound
The sound effects can be controlled. (sound.tcl)
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)
Windows & Scrolling
Scrolling speed and parameters related to constrained text scrolling can be defined. Also can enable Wheel Mouse. Constrained scrolling keeps the last line of text stuck to the bottom of the text display. (exwin.tcl and widgetText.tcl)

BINDING UI

There are a number of keystroke bindings already defined by exmh 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 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.

Binding Syntax. The following is a very brief summary of the Tk bind syntax. For the complete story, consult the Tk man page for the bind command. The Tk syntax for the bindings events looks like this:

<modifier-type-detail>
A modifier is a key that you hold down while pressing another key. The modifiers you are likely to use are listed below. Capitalization is important.
Control Shift Meta
The type is the event type, and it can left out if the detail part implies the type. The types you will usually use are:
Key Button
The detail 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., <Key-a>, which can be shortened to <a>. For punctuation, however,

the keysyms are words. Here are some examples, and again the Key type is left out.

<comma> <period> <dollar> <asciicircum> <question> <exclam>
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.
bind . <Any-Key> {puts stdout "keysym = %K letter = %A"}

MH PROFILE

Exmh uses a couple of things from your .mh_profile file, including several components that are new.

Header-Suppress and Header-Display
You control what headers are displayed in a message with a combination of the Header-Suppress and Header-Display profile components. Hidden headers are just scrolled off the top of the message display window. Each of these profile components is a list of regular expression patterns that are used to match against the header. Case is not significant in the patterns. Its easiest to explain by giving the algorithm that uses these patterns.
By default, show all headers. If a header is in the Header-Suppress list, do not show it. If a header is in the Header-Display list, show it. The default values for these profile components are: Header-Suppress: .* Header-Display: Subject To From Date Cc Newsgroups

If you are a mail junky, you may want to use Header-Suppress to explicitly suppress the boring header components 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 Header-Suppress will hide everything, and you explicitly choose what headers you want to see by setting Header-Display.

Folder-Order
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 string match 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 Tcl's string match function, which is similar to that used in many shells.
* matches a sequence of any characters. ? matches any character. The default Folder-Order puts your inbox first. Folder-Order: inbox * My Folder-Order looks like: Folder-Order: personal exmh mxedit * mail* sun m3 mach background

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, exmh 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 Cycle back to first preference setting under the Unseen Folders section.

Folder-Unseen
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 string match patterns that are matched against folder names. If a folder name matches the pattern, it is searched for unseen messages. If the pattern begins with a !, however, then a folder that matches the pattern (not including the !) is excluded from the search. The default is *, which matches everything. Put the negated patterns first in your list of patterns (e.g., !junk* inbox*).
Folder-Ignore
The Folder-Ignore component specifies a set of string match patterns for folder names you want to ignore. These folders are not even displayed by exmh. It defaults to ".* */.* */*/.* */*/*.*" , which causes exmh to ignore directories whose name begins with a period.
Draft-Folder
The Draft-Folder component is used to know where to put messages being composed. Exmh will ask you if it is OK to create a Draft-Folder entry if you do not already have one.
ExmhShowProc
The ExmhShowProc component lets you define a program that pre-filters a message before displaying it. If an ExmhShowProc is defined, then exmh 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 Header-Display mechanism is still used even if you have a special show proc.
Scan-Proc
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. Exmh depends on this. (It makes no attempt to decipher scan formats.)
MailDrop
The MailDrop component is required if you do not have your system mail spool file in the "standard" location, which is typically /usr/spool/mail/username. 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.
Path
The Path component is used to find your mail folders. Exmh will abort if this entry is not there on the presumption that you have not set yourself up to use MH properly.

X RESOURCES

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 app-defaults file that is kept in the script library directory for exmh. Color-specific resources are contained in the app-defaults-color or app-defaults-mono file. One of these two is used depending on the display.

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, exmh will also read the local.app-defaults-color or local.app-defaults-mono if those files exist.

Each user has a ~/.exmh/exmh-defaults file in their home directory. To handle personal color-specific resources, exmh will also read your ~/.exmh/exmh-defaults-color or ~/.exmh/exmh-defaults-mono if those files exist.

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/exmh-defaults file.

The ~/.exmh/exmh-defaults file is divided into sections. The first section is for things you add by hand. The remaining sections are automatically managed by exmh. If you manually add settings to your ~/.exmh/exmh-defaults file, add entries to the beginning of this file. Add them before the comment about the rest of the file being automatically generated and you will not lose your changes.

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/exmh-defaults file is shown below. The leading "*" gets around quirks in the way Tk names its applications; different instances of the application have different names.

*scrollbarSide: left *c_current: violet red

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 exmh. Furthermore, there might be new goodies that appear in future versions that are not described here. Only by reading the app-defaults file of the current version will you be sure you are setting things correctly in your ~/.exmh/exmh-defaults file. (Hint: read through the main exmh script for the definition of the exmh(library) Tcl variable, which is the script library where app-defaults lives. The script is short, and the definition is near the beginning.)

WIDGET CLASS HIERARCHY

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 tkinspect program, which you can find in the Tcl archives.

Main
Top row of buttons and title label
Fdisp
Folder label display
Fltop
Folder label display when it is in a detached toplevel.
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
Clip
Detached message display
Sedit
Simple editor top-levels
Help
Help window
Key
Color key window
Pref
Preferences dialogs
Log
Error/debug log
Pick
The pick dialog
Glimpse
The glimpse dialog
NewFolder
The new folder dialog.
DeleteFolder
The delete folder dialog.
WhatNow
The What Now? dialog.
Error
Error popups
Dialog
General popups

RESOURCES FOR BUTTONS

exmh 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 ubuttonlist 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 exmh.

*Main.ubuttonlist *Fops.ubuttonlist *Mops.ubuttonlist *Sedit.Menubar.ubuttonlist *WhatNow.ubuttonlist
Fops is the set of folder operation buttons. Mops is the set of message operations buttons. Sedit.Menubar is the buttons in the built-in editor. WhatNow is the What Now dialog used with external editors. The ubuttonlist resource is necessary because there is no easy way to enumerate the contents of the resource database.

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:

buttonlist The list of system defined buttons lbuttonlist The list of local (site) defined buttons ubuttonlist The list of user defined buttons l-buttonlist The list of buttons deleted at the local level. u-buttonlist The list of buttons deleted at the user level.
When exmh 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:
*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
The *Main.buttonlist resource names the buttons that appear in the top row of buttons. Its value, in turn causes exmh 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 button for the details.

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 Msg_Reply Tcl command takes regular arguments for the MH repl program.

*Mops.ubuttonlist: myrepl *Mops.myrepl.text: Repl *Mops.myrepl.command: Msg_Reply -filter myrepl.filter -cc all

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.

*Mops.u-buttonlist: reply

RESOURCES FOR MENUS

The menus in exmh 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 user-defined parts. Each section has a list of menus defined with the following resources:

menulist The list of system defined menus lmenulist The list of local (site) defined menus umenulist The list of user defined menus l-menulist The list of menus deleted at the local level. u-menulist The list of menus deleted at the user level.

Each menu, in turn, has a text resource that defines the label on the menubutton. The entrylist resource lists the entries that are found under the menu. Again, the system-defined entries are listed under entrylist, the administrator defines lentrylist, and users are meant to add new entries to uentrylist. System (or local) defined entries can be removed by adding them to the l-entrylist and u-entrylist resources.

For each menu entry there are resources with the following naming convention (this is not standard Tk): if the entrylist item is foo, then:

l_foo defines the label (text) for the entry. c_foo defines the command. t_foo defines the type: "command", "check", "radio", "cascade", or "separator". v_foo defines the variable associated with check and radio entries. m_foo defines the menu associated with cascade entries.
For more information, it might be helpful to consult the Tk man page for menu adminmmary of the Tk bind syntax. For the complete story, consult the Tk man page for the bind command. The Tk syntax for the bindings events looks like this:
<modifier-type-detail>
A modifier is a key that you hold down while pressing another key. The modifiers you are likely to use are listed below. Capitalization is important.
Control Shift Meta
The type is the event type, and it can left out if the detail part implies the type. The types you will usually use are:
Key Button
The detail 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., <Key-a>, which can be shortened to <a>. For punctuation, however,

the keysyms are words. Here are some examples, and again the Key type is left out.

<comma> <period> <dollar> <asciicircum> <question> <exclam>
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.
bind . <Any-Key> {puts stdout "keysym = %K letter = %A"}

MH PROFILE

Exmh uses a couple of things from your .mh_profile file, including several components that are new.

Header-Suppress and Header-Display
You control what headers are displayed in a message with a combination of the Header-Suppress and Header-Display profile components. Hidden headers are just scrolled off the top of the message display window. Each of these profile components is a list of regular expression patterns that are used to match against the header. Case is not significant in the patterns. Its easiest to explain by giving the algorithm that uses these patterns.
By default, show all headers. If a header is in the Header-Suppress list, do not show it. If a header is in the Header-Display list, show it. The default values for these profile components are: Header-Suppress: .* Header-Display: Subject To From Date Cc Newsgroups

If you are a mail junky, you may want to use Header-Suppress to explicitly suppress the boring header components 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 Header-Suppress will hide everything, and you explicitly choose what headers you want to see by setting Header-Display.

Folder-Order
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 string match 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 Tcl's string match function, which is similar to that used in many shells.
* matches a sequence of any characters. ? matches any character. The default Folder-Order puts your inbox first. Folder-Order: inbox * My Folder-Order looks like: Folder-Order: personal exmh mxedit * mail* sun m3 mach background

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, exmh 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 Cycle back to first preference setting under the Unseen Folders section.

Folder-Unseen
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 string match patterns that are matched against folder names. If a folder name matches the pattern, it is searched for unseen messages. If the pattern begins with a !, however, then a folder that matches the pattern (not including the !) is excluded from the search. The default is *, which matches everything. Put the negated patterns first in your list of patterns (e.g., !junk* inbox*).
Folder-Ignore
The Folder-Ignore component specifies a set of string match patterns for folder names you want to ignore. These folders are not even displayed by exmh. It defaults to ".* */.* */*/.* */*/*.*" , which causes exmh to ignore directories whose name begins with a period.
Draft-Folder
The Draft-Folder component is used to know where to put messages being composed. Exmh will ask you if it is OK to create a Draft-Folder entry if you do not already have one.
ExmhShowProc
The ExmhShowProc component lets you define a program that pre-filters a message before displaying it. If an ExmhShowProc is defined, then exmh 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 Header-Display mechanism is still used even if you have a special show proc.
Scan-Proc
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. Exmh depends on this. (It makes no attempt to decipher scan formats.)
MailDrop
The MailDrop component is required if you do not have your system mail spool file in the "standard" location, which is typically /usr/spool/mail/username. 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.
Path
The Path component is used to find your mail folders. Exmh will abort if this entry is not there on the presumption that you have not set yourself up to use MH properly.

X RESOURCES

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 app-defaults file that is kept in the script library directory for exmh. Color-specific resources are contained in the app-defaults-color or app-defaults-mono file. One of these two is used depending on the display.

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, exmh will also read the local.app-defaults-color or local.app-defaults-mono if those files exist.

Each user has a ~/.exmh/exmh-defaults file in their home directory. To handle personal color-specific resources, exmh will also read your ~/.exmh/exmh-defaults-color or ~/.exmh/exmh-defaults-mono if those files exist.

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/exmh-defaults file.

The ~/.exmh/exmh-defaults file is divided into sections. The first section is for things you add by hand. The remaining sections are automatically managed by exmh. If you manually add settings to your ~/.exmh/exmh-defaults file, add entries to the beginning of this file. Add them before the comment about the rest of the file being automatically generated and you will not lose your changes.

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/exmh-defaults file is shown below. The leading "*" gets around quirks in the way Tk names its applications; different instances of the application have different names.

*scrollbarSide: left *c_current: violet red

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 exmh. Furthermore, there might be new goodies that appear in future versions that are not described here. Only by reading the app-defaults file of the current version will you be sure you are setting things correctly in your ~/.exmh/exmh-defaults file. (Hint: read through the main exmh script for the definition of the exmh(library) Tcl variable, which is the script library where app-defaults lives. The script is short, and the definition is near the beginning.)

WIDGET CLASS HIERARCHY

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 tkinspect program, which you can find in the Tcl archives.

Main
Top row of buttons and title label
Fdisp
Folder label display
Fltop
Folder label display when it is in a detached toplevel.
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
Clip
Detached message display
Sedit
Simple editor top-levels
Help
Help window
Key
Color key window
Pref
Preferences dialogs
Log
Error/debug log
Pick
The pick dialog
Glimpse
The glimpse dialog
NewFolder
The new folder dialog.
DeleteFolder
The delete folder dialog.
WhatNow
The What Now? dialog.
Error
Error popups
Dialog
General popups

RESOURCES FOR BUTTONS

exmh 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 ubuttonlist 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 exmh.

*Main.ubuttonlist *Fops.ubuttonlist *Mops.ubuttonlist *Sedit.Menubar.ubuttonlist *WhatNow.ubuttonlist
Fops is the set of folder operation buttons. Mops is the set of message operations buttons. Sedit.Menubar is the buttons in the built-in editor. WhatNow is the What Now dialog used with external editors. The ubuttonlist resource is necessary because there is no easy way to enumerate the contents of the resource database.

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:

buttonlist The list of system defined buttons lbuttonlist The list of local (site) defined buttons ubuttonlist The list of user defined buttons l-buttonlist The list of buttons deleted at the local level. u-buttonlist The list of buttons deleted at the user level.
When exmh 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:
*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
The *Main.buttonlist resource names the buttons that appear in the top row of buttons. Its value, in turn causes exmh 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 button for the details.

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 Msg_Reply Tcl command takes regular arguments for the MH repl program.

*Mops.ubuttonlist: myrepl *Mops.myrepl.text: Repl *Mops.myrepl.command: Msg_Reply -filter myrepl.filter -cc all

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.

*Mops.u-buttonlist: reply

RESOURCES FOR MENUS

The menus in exmh 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 user-defined parts. Each section has a list of menus defined with the following resources:

menulist The list of system defined menus lmenulist The list of local (site) defined menus umenulist The list of user defined menus l-menulist The list of menus deleted at the local level. u-menulist The list of menus deleted at the user level.

Each menu, in turn, has a text resource that defines the label on the menubutton. The entrylist resource lists the entries that are found under the menu. Again, the system-defined entries are listed under entrylist, the administrator defines lentrylist, and users are meant to add new entries to uentrylist. System (or local) defined entries can be removed by adding them to the l-entrylist and u-entrylist resources.

For each menu entry there are resources with the following naming convention (this is not standard Tk): if the entrylist item is foo, then:

l_foo defines the label (text) for the entry. c_foo defines the command. t_foo defines the type: "command", "check", "radio", "cascade", or "separator". v_foo defines the variable associated with check and radio entries. m_foo defines the menu associated with cascade entries.
For more information, it might be helpful to consult the Tk man page for menu adminmmary of the Tk bind syntax. For the complete story, consult the Tk man page for the bind command. The Tk syntax for the bindings events looks like this:
<modifier-type-detail>
A modifier is a key that you hold down while pressing another key. The modifiers you are likely to use are listed below. Capitalization is important.
Control Shift Meta
The type is the event type, and it can left out if the detail part implies the type. The types you will usually use are:
Key Button
The detail 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., <Key-a>, which can be shortened to <a>. For punctuation, however,

the keysyms are words. Here are some examples, and again the Key type is left out.

<comma> <period> <dollar> <asciicircum> <question> <exclam>
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.
bind . <Any-Key> {puts stdout "keysym = %K letter = %A"}

MH PROFILE

Exmh uses a couple of things from your .mh_profile file, including several components that are new.

Header-Suppress and Header-Display
You control what headers are displayed in a message with a combination of the Header-Suppress and Header-Display profile components. Hidden headers are just scrolled off the top of the message display window. Each of these profile components is a list of regular expression patterns that are used to match against the header. Case is not significant in the patterns. Its easiest to explain by giving the algorithm that uses these patterns.
By default, show all headers. If a header is in the Header-Suppress list, do not show it. If a header is in the Header-Display list, show it. The default values for these profile components are: Header-Suppress: .* Header-Display: Subject To From Date Cc Newsgroups

If you are a mail junky, you may want to use Header-Suppress to explicitly suppress the boring header components 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 Header-Suppress will hide everything, and you explicitly choose what headers you want to see by setting Header-Display.

Folder-Order
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 string match 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 Tcl's string match function, which is similar to that used in many shells.
* matches a sequence of any characters. ? matches any character. The default Folder-Order puts your inbox first. Folder-Order: inbox * My Folder-Order looks like: Folder-Order: personal exmh mxedit * mail* sun m3 mach background

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, exmh 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 Cycle back to first preference setting under the Unseen Folders section.

Folder-Unseen
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 string match patterns that are matched against folder names. If a folder name matches the pattern, it is searched for unseen messages. If the pattern begins with a !, however, then a folder that matches the pattern (not including the !) is excluded from the search. The default is *, which matches everything. Put the negated patterns first in your list of patterns (e.g., !junk* inbox*).
Folder-Ignore
The Folder-Ignore component specifies a set of string match patterns for folder names you want to ignore. These folders are not even displayed by exmh. It defaults to ".* */.* */*/.* */*/*.*" , which causes exmh to ignore directories whose name begins with a period.
Draft-Folder
The Draft-Folder component is used to know where to put messages being composed. Exmh will ask you if it is OK to create a Draft-Folder entry if you do not already have one.
ExmhShowProc
The ExmhShowProc component lets you define a program that pre-filters a message before displaying it. If an ExmhShowProc is defined, then exmh 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 Header-Display mechanism is still used even if you have a special show proc.
Scan-Proc
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. Exmh depends on this. (It makes no attempt to decipher scan formats.)
MailDrop
The MailDrop component is required if you do not have your system mail spool file in the "standard" location, which is typically /usr/spool/mail/username. 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.
Path
The Path component is used to find your mail folders. Exmh will abort if this entry is not there on the presumption that you have not set yourself up to use MH properly.

X RESOURCES

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 app-defaults file that is kept in the script library directory for exmh. Color-specific resources are contained in the app-defaults-color or app-defaults-mono file. One of these two is used depending on the display.

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, exmh will also read the local.app-defaults-color or local.app-defaults-mono if those files exist.

Each user has a ~/.exmh/exmh-defaults file in their home directory. To handle personal color-specific resources, exmh will also read your ~/.exmh/exmh-defaults-color or ~/.exmh/exmh-defaults-mono if those files exist.

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/exmh-defaults file.

The ~/.exmh/exmh-defaults file is divided into sections. The first section is for things you add by hand. The remaining sections are automatically managed by exmh. If you manually add settings to your ~/.exmh/exmh-defaults file, add entries to the beginning of this file. Add them before the comment about the rest of the file being automatically generated and you will not lose your changes.

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/exmh-defaults file is shown below. The leading "*" gets around quirks in the way Tk names its applications; different instances of the application have different names.

*scrollbarSide: left *c_current: violet red

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 exmh. Furthermore, there might be new goodies that appear in future versions that are not described here. Only by reading the app-defaults file of the current version will you be sure you are setting things correctly in your ~/.exmh/exmh-defaults file. (Hint: read through the main exmh script for the definition of the exmh(library) Tcl variable, which is the script library where app-defaults lives. The script is short, and the definition is near the beginning.)

WIDGET CLASS HIERARCHY

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 tkinspect program, which you can find in the Tcl archives.

Main
Top row of buttons and title label
Fdisp
Folder label display
Fltop
Folder label display when it is in a detached toplevel.
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
Clip
Detached message display
Sedit
Simple editor top-levels
Help
Help window
Key
Color key window
Pref
Preferences dialogs
Log
Error/debug log
Pick
The pick dialog
Glimpse
The glimpse dialog
NewFolder
The new folder dialog.
DeleteFolder
The delete folder dialog.
WhatNow
The What Now? dialog.
Error
Error popups
Dialog
General popups

RESOURCES FOR BUTTONS

exmh 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 ubuttonlist 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 exmh.

*Main.ubuttonlist *Fops.ubuttonlist *Mops.ubuttonlist *Sedit.Menubar.ubuttonlist *WhatNow.ubuttonlist
Fops is the set of folder operation buttons. Mops is the set of message operations buttons. Sedit.Menubar is the buttons in the built-in editor. WhatNow is the What Now dialog used with external editors. The ubuttonlist resource is necessary because there is no easy way to enumerate the contents of the resource database.

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:

buttonlist The list of system defined buttons lbuttonlist The list of local (site) defined buttons ubuttonlist The list of user defined buttons l-buttonlist The list of buttons deleted at the local level. u-buttonlist The list of buttons deleted at the user level.
When exmh 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:
*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
The *Main.buttonlist resource names the buttons that appear in the top row of buttons. Its value, in turn causes exmh 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 button for the details.

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 Msg_Reply Tcl command takes regular arguments for the MH repl program.

*Mops.ubuttonlist: myrepl *Mops.myrepl.text: Repl *Mops.myrepl.command: Msg_Reply -filter myrepl.filter -cc all

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.

*Mops.u-buttonlist: reply

RESOURCES FOR MENUS

The menus in exmh 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 user-defined parts. Each section has a list of menus defined with the following resources:

menulist The list of system defined menus lmenulist The list of local (site) defined menus umenulist The list of user defined menus l-menulist The list of menus deleted at the local level. u-menulist The list of menus deleted at the user level.

Each menu, in turn, has a text resource that defines the label on the menubutton. The entrylist resource lists the entries that are found under the menu. Again, the system-defined entries are listed under entrylist, the administrator defines lentrylist, and users are meant to add new entries to uentrylist. System (or local) defined entries can be removed by adding them to the l-entrylist and u-entrylist resources.

For each menu entry there are resources with the following naming convention (this is not standard Tk): if the entrylist item is foo, then:

l_foo defines the label (text) for the entry. c_foo defines the command. t_foo defines the type: "command", "check", "radio", "cascade", or "separator". v_foo defines the variable associated with check and radio entries. m_foo defines the menu associated with cascade entries.
For more information, it might be helpful to consult the Tk man page for menu adminmmary of the Tk bind syntax. For the complete story, consult the Tk man page for the bind command. The Tk syntax for the bindings events looks like this:
<modifier-type-detail>
A modifier is a key that you hold down while pressing another key. The modifiers you are likely to use are listed below. Capitalization is important.
Control Shift Meta
The type is the event type, and it can left out if the detail part implies the type. The types you will usually use are:
Key Button
The detail 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., <Key-a>, which can be shortened to <a>. For punctuation, however,

the keysyms are words. Here are some examples, and again the Key type is left out.

<comma> <period> <dollar> <asciicircum> <question> <exclam>
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.
bind . <Any-Key> {puts stdout "keysym = %K letter = %A"}

MH PROFILE

Exmh uses a couple of things from your .mh_profile file, including several components that are new.

Header-Suppress and Header-Display
You control what headers are displayed in a message with a combination of the Header-Suppress and Header-Display profile components. Hidden headers are just scrolled off the top of the message display window. Each of these profile components is a list of regular expression patterns that are used to match against the header. Case is not significant in the patterns. Its easiest to explain by giving the algorithm that uses these patterns.
By default, show all headers. If a header is in the Header-Suppress list, do not show it. If a header is in the Header-Display list, show it. The default values for these profile components are: Header-Suppress: .* Header-Display: Subject To From Date Cc Newsgroups

If you are a mail junky, you may want to use Header-Suppress to explicitly suppress the boring header components 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 Header-Suppress will hide everything, and you explicitly choose what headers you want to see by setting Header-Display.

Folder-Order
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 string match 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 Tcl's string match function, which is similar to that used in many shells.
* matches a sequence of any characters. ? matches any character. The default Folder-Order puts your inbox first. Folder-Order: inbox * My Folder-Order looks like: Folder-Order: personal exmh mxedit * mail* sun m3 mach background

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, exmh 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 Cycle back to first preference setting under the Unseen Folders section.

Folder-Unseen
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 string match patterns that are matched against folder names. If a folder name matches the pattern, it is searched for unseen messages. If the pattern begins with a !, however, then a folder that matches the pattern (not including the !) is excluded from the search. The default is *, which matches everything. Put the negated patterns first in your list of patterns (e.g., !junk* inbox*).
Folder-Ignore
The Folder-Ignore component specifies a set of string match patterns for folder names you want to ignore. These folders are not even displayed by exmh. It defaults to ".* */.* */*/.* */*/*.*" , which causes exmh to ignore directories whose name begins with a period.
Draft-Folder
The Draft-Folder component is used to know where to put messages being composed. Exmh will ask you if it is OK to create a Draft-Folder entry if you do not already have one.
ExmhShowProc
The ExmhShowProc component lets you define a program that pre-filters a message before displaying it. If an ExmhShowProc is defined, then exmh 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 Header-Display mechanism is still used even if you have a special show proc.
Scan-Proc
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. Exmh depends on this. (It makes no attempt to decipher scan formats.)
MailDrop
The MailDrop component is required if you do not have your system mail spool file in the "standard" location, which is typically /usr/spool/mail/username. 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.
Path
The Path component is used to find your mail folders. Exmh will abort if this entry is not there on the presumption that you have not set yourself up to use MH properly.

X RESOURCES

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 app-defaults file that is kept in the script library directory for exmh. Color-specific resources are contained in the app-defaults-color or app-defaults-mono