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 adding resources that describe the button. X resource names are hierarchical; these are the button list resources used by exmh:
*Main.ubuttonlist *Fops.ubuttonlist *Mops.ubuttonlist *Sedit.Menubar.ubuttonlist *WhatNow.ubuttonlistThese resources are necessary because there's no easy way to enumerate the contents of the resource database.
When exmh starts up, it asks for the definition of both buttonlist and ubuttonlist resources. app-defaults has definitions for its buttons under the buttonlist resource; users should add new buttons with the ubuttonlist resource. To remove some system buttons, you have to override the definition of the buttonlist resource. 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: Preferencesin.pref.textnew file or procedure to this directory, remember to update the index by running this command.exmh uses the Tcl library facility for the main sources, too. The implementation has been split into more than 50 files; exmh loads these on demand as different features are invoked. The per-user library directory is searched first; this means you can replace parts of the exmh implementation. While this is quite flexible, it is not ideal. The natural unit of replacement is a whole file -- but a file might contain several Tcl procedures, even though you want to change only one. Also, when a new exmh release comes out, there might be incompatibilities with your customized code.
(Note for TclX users: the auto_path stuff is different; the personal library seems not to work. If you figure out the right thing to do in the main exmh script auto_path_update procedure, let me know.)
In most cases you'll merely supply new code -- as opposed to replacing (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.
Start your custom Tcl library by copying the user.tcl file from the script library into your ~/.tk/exmh directory. It 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 almost every module has been initialized.
Some optional hook procedures have names beginning with Hook_. These procedures are called, if they exist, so you don't need stub versions if you don't use them. Because of the way the library facility works, though, you have to either include your Hook procedures in your copy of user.tcl or source the file that contains them from inside your User_Init procedure.
You can also call several hook procedures from the same point by appending things to the standard hook names. That is, the implementation calls all procedures that match the pattern Hook_Foo*. You could define Hook_FooBrent and Hook_FooWelch; both would be calle