Path: utzoo!mnetor!tmsoft!torsqnt!hybrid!scifi!bywater!uunet!ora!jerry From: jerry@ora.com (Jerry Peek) Newsgroups: comp.mail.mh Subject: Re: Can you associate user-defined status bits with each message? Message-ID: <1991Feb9.171627.24426@ora.com> Date: 9 Feb 91 17:16:27 GMT References: <15482:Feb702:26:1891@kramden.acf.nyu.edu> <27B109FD.656@ics.uci.edu> <2572@sapwdf.UUCP> Organization: O'Reilly and Associates Inc., Cambridge, MA Lines: 82 brnstnd@kramden.acf.nyu.edu (Dan Bernstein) writes: > I need to keep track of some status bits with each message: e.g., > ``I've begun reading this,'' ``I've finished reading this,'' ``I've > sent some responses,'' ``I've finished sending responses,'' etc. I > should be able to configure the reader to understand these bits and to > read and set them automatically. Can I do this easily with mh? The other replies to Dan's questions have been about annotation and sequences. They're probably the best ways I can think of. One method I haven't seen people mention is using multiple folders and/or subfolders. You could have folders named like this: inbox (for unread messages) begun (for messages you've begun) finished ...etc... or, if you've already split your messages into folders, use subfolders: foo/unread bar/unread foo/begun bar/begun foo/finished bar/finished ...etc... If you want to change a message's category, just use "refile". You can also use "refile -link" to put a message into more than one folder at the same time... although if you also want to ask "which folders did I link this into?," there's no easy way to answer that with MH (you can do it with a shell script, though). Here are some ideas about the pluses and minuses of annotation and sequences, and some info that I haven't seen people mention yet: - Annotation lets you put arbitrary text in a message header, like: X-bug: Look on line 173 of foo/bar/glop.c you can't be as specific with sequences. - If you want to link messages into multiple folders, annotations will show up in all the links. Annotations also follow the messages when you refile them. Neither of those are true of sequences. - It's usually faster to search for messages using sequences: scan seqname than annotations: pick --annoname because the message numbers for sequences are stored in just two files... MH doesn't have to grep every message for the annotations. - If you want to use scan format files like John mentions, annotations will work... but you can't do that sort of thing with sequences. - "scan" will find the annotation that's closest to the top of a message file. If you annotate a message with the same component more than once, scan will use the most recent annotation. For example, in this header: x-attn: jlr x-attn: mtr To: bug-mh@ics.uci.edu the x-attn component will scan as "jlr". With annotations, you can reassign a message to another person or category and keep the whole history in the header. Sequences aren't permanent; annotations are. - By default, "anno" adds both a date and a text field: x-attn: Fri, 8 Feb 91 09:15:45 -0500 x-attn: jlr You might want both (it's a nice way to keep track of *when* you put the message in a category), but watch out for problems the multiple annotations cause "scan" and "pick". John used "anno -nodate". You can also annotate twice to put the date annotation after the text. - Instead of aliases like alias todo 'mark -sequence todo \!*' or shell scripts that do the same thing, I usually make what I call "versions" or "links". They take an entry in the .mh_profile like: todo: -sequence todo and a symlink named "todo" from my bin directory to the "mark" binary file. These are more efficient than writing a shell script because there's no shell to start... and, unlike aliases, you can use these versions from other programs, from shell scripts, etc. Whew. jromine@buckaroo.ics.uci.edu (John Romine) wrote: > I don't know if Jerry Peek mentions this technique in his excellent MH > nutshell handbook... Gee, thanks. :-) Yes, all the stuff people have mentioned so far is in the book, and there's a lot more. Sorry I can't re-print the book here :-)... if you've got it, though, look in sections 2.7, 5.2.1, 5.4.1, 7.1-7.4, 7.7, 7.8, 8.5-8.7 (maybe), 9.all, 10.2, and 12.11 for info about these and related topics. --Jerry Peek, jerry@ora.com, uunet!ora!jerry