Changing How Commands Work

[previous] [next] [table of contents] [index]

As with all standard X applications, xmh may be customized through entries in a resource file. The Section Command-line Settings gives an overview. Your online xmh(1) manual page has a complete list of resources. (The section is called "Application-Specific Resources.") Most of them are pretty straightforward. A few resource file entries that change the way commands work are explained in this section.

HideBoringHeaders

If HideBoringHeaders is on, then xmh will attempt to skip uninteresting header fields within messages by scrolling them off. The line at the top of the window will be the first "interesting" field (Date:, To:, From:, or Subject:) in the message. You can use the scrollbar to see the hidden fields. (The default is on.)

PrintCommand

PrintCommand is the sh (Bourne shell) command to execute to print a message. You have to specifically redirect standard output (and standard error, in xmh Release 3). When the print command is run, the full file path of each message file is appended to the specified print command. (The default is enscript >/dev/null 2>/dev/null.) For more information and examples, see the Section Changing the Print Command.

ReplyInsertFilter

ReplyInsertFilter is a shell command to be executed when you click the Insert button in a composition window. The full path and filename of the source message is added to the end of the command before being passed to sh(1). The default filter is cat, which puts a copy of the message header and body into the composition. This section shows two other interesting filters. The first filter uses the sed stream editor to include a copy of the original message, without the header, with a right angle bracket and a space at the start of each line, as in the next Figure:
xmh*ReplyInsertFilter: sed -e "1,/^$/d" -e "s/^/> /"

Figure: Original message and reply with special ReplyInsertFilter

ormarwsr.gif

Another useful filter is:

xmh*ReplyInsertFilter: /xxx/yyy/mhl -form mhl.body
(You'll need to replace the /xxx/yyy with the pathname of the MH library directory where the mhl program is stored.) The mhl program is for message formatting, and its standard mhl.body format file extracts the body of a mail message. For help, read the Section mhl.

NOTE: There's a bug in some xmh app-defaults files. If your filter doesn't seem to work, try using xmh.ReplyInsertFilter instead of xmh*ReplyInsertFilter in your resource file.

SendBreakWidth

Lines in a draft message that have more characters than the SendBreakWidth will be broken when the draft is sent. The default is 2000 in xmh Release 5 -- but only 85 in Release 4, which means that lines wider than 85 characters will be broken in xmh R4. Setting a very large SendBreakWidth, such as 2000, is a good idea when you're mailing source code or other text that should never be broken. For a more detailed explanation, see the Section Line Wrapping.

SendWidth

After lines (wider than the SendBreakWidth, see the previous section) in a draft message are broken, the widest resulting line will be no wider than SendWidth. (The default is lines 72 characters wide.) For a more detailed explanation, see the Section Line Wrapping.

SkipCopied, SkipDeleted, SkipMoved

By default, when you mark a message for deleting, moving, or copying (actually, linking), the View Next Message and View Previous Message commands skip over the message. For instance, they'll skip over a message to be deleted if the SkipDeleted value is true. (By default, all three of these are true.)

If you want the View Next Message and the View Previous Message commands to let you view messages marked for copying (linking), set this entry in your resource file:

xmh*SkipCopied: false
Messages marked for deleting and moving would still be skipped because the SkipDeleted and SkipMoved would default to true.

TocGeometry

TocGeometry is the initial geometry for new main xmh windows. This geometry setting doesn't include the master window that opens when you first start xmh (see the Section Command-line Settings). For example, if you start xmh this way:
xmh -geometry 830x250+50+5 -xrm '*TocGeometry:475x440' -xrm '*CompGeometry: 660x460' &
you'll get a short, wide master window at the top of the screen (830 pixels wide and 250 pixels high). Each time you click on Open Folder in New Window, you'll get a 475x440-pixel table of contents window. It's important to make an entry for CompGeometry to make sure that the composition windows are no more than the normal 72 (or 80) characters wide -- this keeps lines the right width in messages you send. These geometries let you use setups like the one in the Figure below, with windows onto several folders at the same time.

Figure: Screen with new geometry settings

swbogats.gif

Otherwise, the messages you send could have lines that are too wide or too narrow for most peoples' terminals.

TocWidth

TocWidth sets the number of characters to generate for each message in a folder's Table of Contents, which is stored in the .xmhcache file. (The default is 100.)

If your folders have thousands of messages, you can speed up xmh by setting TocWidth to a smaller number than 100 -- just enough to fill your Table of Contents window. Try a setting of 80 instead.

The Section Changing Table of Contents shows how to change the format.

ShapeStyle

If your X setup can do it, xmh R4 and later will use rounded buttons. (The figures in this book do.) Using rectangular buttons can speed up your display, though. To do that, use the entry:
xmh*ShapeStyle: Rectangle

Summary of Resources

The Table below is an alphabetical list of xmh resources. It was adapted from the R6 xmh(1) manual page.

Table: xmh Resources

banner (default: "xmh X Consortium R6")
A short string that is the default label of the folder, Table of Contents, and view.
blockEventsOnBusy (default: true)
Whether to disallow user input and show a busy cursor while xmh is busy processing a command.
busyCursor (default: "watch")
The name of the symbol used to represent the position of the pointer, displayed if blockEventsOnBusy is true, when xmh is processing a time-consuming command.
busyPointerColor (default: XtDefaultForeground)
The foreground color of the busy cursor.
checkFrequency (default: 1)
How often to check for new mail, make checkpoints, and rescan the Table of Contents, in minutes. If checkNewMail is true, xmh checks to see if you have new mail each interval. If makeCheckpoints is true, checkpoints are made every fifth interval. Also every fifth interval, the Table of Contents is checked for inconsistencies with the file system, and rescanned if out of date. To prevent all of these checks from occurring, set CheckFrequency to 0. This resource is retained for backward compatibility with user resource files; see also checkpointInterval, mailInterval, and rescanInterval.
checkNewMail (default: true)
If true, xmh will check at regular intervals to see if new mail has arrived for any of the top level folders and any opened subfolders. A visual indication will be given if new mail is waiting to be incorporated into a top level folder. The interval can be adjusted with mailInterval.
checkpointInterval (default: 5 times the value of checkFrequency)
Specifies in minutes how often to make checkpoints of volatile state, if makeCheckpoints is true.
checkpointNameFormat (default: "%d.CKP")
Specifies how checkpointed files are to be named. The value of this resource will be used to compose a file name by inserting the message number as a string in place of the required single occurence of "%d". If the value of the resource is the empty string, or if no "%d" occurs in the string, or if "%d" is the value of the resource, the default will be used instead. Checkpointing is done in the folder of origin unless an absolute pathname is given. xmh does not assist the user in recovering checkpoints, nor does it provide for removal of the checkpoint files.
commandButtonCount (default: 0)
The number of command buttons to create in a button box in between the toc and the view areas of the main window. xmh will create these buttons with the names button1, button2 and so on, in a box with the name commandBox. xmh users can specify labels and actions for the buttons in a private resource file; see the Section A New Buttonbox for the Main Windows.
compGeometry
Initial geometry for windows containing compositions.
cursor (default: "left_ptr")
The name of the symbol used to represent the pointer.
debug (default: false)
Whether or not to print information to stderr as xmh runs. See the Section Use the debug Resource.
draftsFolder (default: "drafts")
The folder used for message drafts.
geometry (default: none)
Default geometry to use.
hideBoringHeaders (default: "on")
If ``on'', then xmh will attempt to skip uninteresting header lines within messages by scrolling them off the top of the view. See the Section HideBoringHeaders.
initialFolder (default: "inbox")
Which folder to display on startup. May also be set with the command-line option -initial. See the Section Initial Folder.
initialIncFile (default: no value)
The absolute path name of your incoming mail drop file. In some installations, for example those using the Post Office Protocol, no file is appropriate. In this case, initialIncFile should not be specified, or may be specified as the empty string, and inc will be invoked without a -file argument. This resource is ignored if xmh finds an .xmhcheck file (the Section Incorporate New Mail).
mailInterval (default: the value of checkFrequency)
Specifies the interval in minutes at which the mail should be checked, if mailWaitingFlag or checkNewMail is true.
mailPath (default: the Path: MH profile entry, or "$HOME/Mail" if none)
The full path prefix for locating your mail folders. May also be set with the command line option, -path. See the Section MH Directory Path.
mailWaitingFlag
If true, xmh will attempt to set an indication in its icon when new mail is waiting to be retrieved. If mailWaitingFlag is true, then checkNewMail is assumed to be true as well. The -flag command line option is a quick way to turn on this resource.
makeCheckpoints (default: false)
If true, xmh will attempt to save checkpoints of volatile edits. The frequency of checkpointing is controlled by the resource checkpointInterval. For the location of checkpointing, see checkpointNameFormat.
mhPath (default: "/usr/local/mh6")
What directory in which to find the MH commands. If a command isn't found in the user's path, then the path specified here is used.
newMailBitmap (default: "black6")
The bitmap to show in the folder button when a folder has new mail.
newMailIconBitmap (default: "flagup")
The bitmap suggested to the window manager for the icon when any folder has new mail.
noMailBitmap (default: "box6")
The bitmap to show in the folder button when a folder has no new mail.
noMailIconBitmap (default: "flagdown")
The bitmap suggested to the window manager for the icon when no folders have new mail.
pickGeometry
Initial geometry for pick windows.
pointerColor (default: XtDefaultForeground)
The foreground color of the pointer.
prefixWmAndIconName (default: true)
Whether to prefix the window and icon name with "xmh: ".
printCommand (default: "enscript >/dev/null 2>/dev/null")
An sh command to execute to print a message. See the Section Changing the Print Command.
replyInsertFilter (default: "cat")
An sh command to be executed when the Insert button is activated in a composition window. See the Section ReplyInsertFilter.
rescanInterval (default: 5 times the value of checkFrequency)
How often to check the Table of Contents of currently viewed folders and of folders with messages currently being viewed, and to update the Table of Contents if xmh sees inconsistencies with the file system in these folders.
reverseReadOrder (default: false)
When true, the next message will be the message prior to the current message in the table of contents, and the previous message will be the message after the current message in the table of contents.
sendBreakWidth (default: 2000)
When a message is sent from xmh, lines longer than this value will be split into multiple lines, each of which is no longer than SendWidth. See the Section SendBreakWidth.
sendWidth (default: 72)
When a message is sent from xmh, lines longer than SendBreakWidth characters will be split into multiple lines, each of which is no longer than this value. See the Section SendWidth.
showOnInc (default: true)
Whether to automatically show the current message after incorporating new mail.
skipCopied (default: true)
Whether to skip over messages marked for copying when using View Next Message and View Previous Message. See the Section SkipCopied, SkipDeleted, SkipMoved.
skipDeleted (default: true)
Whether to skip over messages marked for deletion when using View Next Message and View Previous Message. See the Section SkipCopied, SkipDeleted, SkipMoved.
skipMoved (default: true)
Whether to skip over messages marked for moving to other folders when using View Next Message and View Previous Message. See the Section SkipCopied, SkipDeleted, SkipMoved.
stickyMenu (default: false)
If true, when popup command menus are used, the most recently selected entry will be under the cursor when the menu pops up. See the file clients/xmh/Xmh.sample for an example of how to specify resources for popup command menus.
tempDir (default: "/tmp")
Directory for xmh to store temporary files. For privacy, a user might want to change this to a private directory.
tocGeometry
Initial geometry for main xmh toc and view windows. See the Section TocGeometry.
tocPercentage (default: 33)
The percentage of the main window that is used to display the Table of Contents.
tocWidth (default: 100)
How many characters to generate for each message in a folder's table of contents. See the Section TocWidth.
viewGeometry
Initial geometry for windows showing a view of a message.

[Table of Contents] [Index] [Previous: Command-line Options] [Next: Changing Buttons; Accelerators]


Last change $Date: 1996/06/06 15:13:30 $

This file is from the third edition of the book MH & xmh: Email for Users & Programmers, ISBN 1-56592-093-7, by Jerry Peek. Copyright © 1991, 1992, 1995 by O'Reilly & Associates, Inc. This file is freely-available; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation. For more information, see the file copying.htm.

Suggestions are welcome: Jerry Peek <jpeek@jpeek.com>