When you first start xmh, you will have folders named inbox and drafts. Folders are like the folders you'd find in an office file cabinet: they group related messages. If you don't have many messages, you may not want new folders. People who get a lot of mail, though, will. Here's how to make new folders and move or copy messages into them.
The folder name should be all one word -- don't use spaces. You can use a character like an underscore (_) to join two words into one. Long names are okay, but remember that they make the buttons bigger than short names. This is demonstrated in the Figure below. (Note that if you have a lot of buttons, or buttons with long names, you can always shorten the folder buttonbox so that it has a scrollbar -- and scroll through the folder buttons.)
Figure: Folder buttonbox with some long folder names
xmh Release 6 supports a single level of subfolders. (The Section Folders and Subfolders has more information.) Make a subfolder like a top-level folder -- but put a slash (/) and the subfolder name after the top-level folder name. For example, to make a cheese subfolder in the existing project folder, type project/cheese in the Create Folder box.
Figure: A folder with one subfolder
MH can have folders inside subfolders, many levels deep. xmh supports just one level -- but that's plenty for most users. (You can create a subfolder more than one level deep from within xmh. It will appear in the menu under the folder button. After you quit and restart xmh, though, the sub-subfolder won't appear on the folder menu anymore.)
If a folder has a subfolder, a list box will drop down when you select the button. The first entry in the list is always for the top-level folder. The other entries are for its subfolders. The next Figure shows how to select the system_b subfolder of the syserrs folder.
All xmh operations work as well on subfolders as they do on top-level folders.
The accelerator for opening a new folder is handy and fast. Click on the folder button with your second mouse button. That selects and opens the folder in one step.
If a folder has a subfolder, slide down the subfolder list to the folder you want, as the Figure below shows.
Notice that the first main window is still displaying the original folder. That's possible because xmh keeps the selected folder separate from the viewed folder. You can select a different folder by clicking its folder button, but xmh does not view that folder until you have selected Open Folder or Open Folder in New Window.
Once you have the new window open, you can compose new messages from each window, move messages to other folders, and so on.
If you move messages between two open main folder windows, the Tables of Contents will change automatically.
If you try to view the same folder from two windows, things can get confusing. It's probably best to stick with one window per folder.
NOTE: If you make a new folder and you don't move or copy any messages into it -- then, when you open it for the first time, you'll get an error message like scan: no messages in folderpath.
This isn't really an error -- it's just the MH scan command telling you that the folder is empty. If you move or link a message into the folder before you open it for the first time, you won't see the error.
The viewed folder (in the Table of Contents) won't change. (If it does change, you probably used the second mouse button accidentally.)
Figure: Two messages marked for moving
CAUTION: If you edit one of the "copied" (linked) messages by displaying it in the view window and choosing Edit Message, all the "copies" of the messages in all folders will show the same edit!
A link isn't a true copy. In this book I'll call it a link, not a copy.
Linking a message to another folder takes the same steps as moving. The difference is that when the message is marked for copying, xmh puts a C in the Table of Contents next to the message number and -> foldername (Copy) in the titlebar above the message view. Be sure to use Commit Changes when you're ready.
The accelerator for marking to copy is META-C. The accelerator for committing the changes is META-SHIFT-C.
If you accidentally delete a message, you can probably get it back (though you may have to exit xmh). See the Section Removing and Recovering Messages.
Also see the rmmer shell script, which makes it easy to recover your deleted messages. If you install rmmer on your account, you still use the Delete and Commit Changes commands (or the accelerators), as always. But rmmer puts your deleted messages into a subfolder named DELETE where it's easy to recover them if you need to. (A system program removes the "deleted" messages later.)
This is a real win for xmh users because you don't have to open an xterm window or use MH commands to recover deleted messages anymore. (Remember that because xmh can't deal with sub-subfolders, you'll need to use MH commands to recover messages you delete from subfolders -- see the Section Recovering a Removed Message for help. If you have to recover a deleted message with MH, you should use the xmh Rescan Folder command so xmh will update its folder list. This is a good thing to do any time after you use an MH command. Or use the rmmer_1.noask script instead -- it puts all deleted messages in one top-level folder (not a subfolder) named DELETE.)
The first time you delete a message in a folder, rmmer will create the DELETE subfolder for you. But the new subfolder won't appear on a menu until the next time you start xmh.
To recover a deleted message, go to the folder where it was deleted. Then go to the DELETE subfolder (see the Figure below) and move the message to its parent folder. (You can actually move the message to any folder, not just its parent.)
Figure: Recovering a message deleted by rmmer
If you think xmh doesn't have the latest view of the folder, use the Rescan Folder command on the Table of Contents menu. (The accelerator is META-SHIFT-R.) This is good to do after you've used some MH commands from, say, an xterm window.
Figure: Message and Table of Contents from different folders
The first Figure below is an example of a folder before sorting. The next Figure below shows the same folder after sorting.
Figure: Folder before sorting
Figure: Folder after sorting
Notice that one of the messages has an asterisk (*) by the number. This means that there's no acceptable Date: field in the header -- so xmh shows the date that the message file itself was modified. The message from the MH sortm command pops up in a dialog box.
After sorting, the messages don't seem to be in date order (message 3 was sent on November 23, but message 4 was sent on February 9?). But the dates are in order -- the date sort pays attention to the year. For instance, message 3 was sent in 1989. If a message doesn't have an acceptable date, the sort tries to keep the message in about the same relative position it was before -- but, as you can see, this doesn't always work.
If you have the MH 6.7 or later version of sortm, you can change it to sort by other fields. For instance, it can sort by subject. The Section Sorting Messages: sortm explains sorting switches.
You can set default sortm switches in your MH profile, so you always get one kind of sort. You can also set up xmh buttons that run the edprofile shell script -- to change the sorting order at any time while you're running xmh.
NOTE: Delete Folder deletes the selected folder, not the viewed folder.
Even though the dialog box is up, you should be able to browse through the Table of Contents, view messages, and so on. When you're sure, click Yes.
CAUTION: When you delete a folder, there's no going back. Be careful...
[Table of Contents] [Index] [Previous: Printing Your Mail] [Next: Introduction to Sequences]
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 <firstname.lastname@example.org>