Path: utzoo!utgpu!jarvis.csri.toronto.edu!rutgers!att!cbnewsc!gregg From: gregg@cbnewsc.ATT.COM (gregg.g.wonderly) Newsgroups: comp.mail.mh Subject: Re: Refile Message-ID: <1250@cbnewsc.ATT.COM> Date: 14 Jun 89 14:42:36 GMT Distribution: na Organization: AT&T Bell Laboratories Lines: 55 For those thinking about adding certain defaults to MH, please keep them in the .mh_profile file. Use m_find() instead of getenv(). They both return (char *). m_find() searches both .mh_profile, and the {path}/context file, so beware of using something that might exist in {path}/context. For the refile(1) example, something like if (folder == NULL) folder = m_find ("refile-default"); seems appropriate. Then you can add the line refile-default: +misc to your .mh_profile. I am not sure whether I prefer the symlink to another command name in this case or not. For the next release of MH, I would like to see a new program incorporated which allows use/manipulation of the {path}/context and .mh_profile entries. I have written one such program which I called, mhcontext. It has the options -delete, -component and -text. When envoked with '-comp string', it prints the value of that entry on stdout. E.g. $ mhcontext -comp Unseen-sequence unread $ This gives shell script front ends half a change at being portable given the flexibility that MH provides. $ mhcontext -comp oFolder-stack -text "`mhcontext -comp folder-stack`" $ alias popfs 'mhcontext -comp folder-stack -text \ "`mhcontext -comp ofolder-stack`"' $ mhcontext -comp Folder-Stack -text "`seq unread`" Allows me to use my seq(1) program (which I described here previously, to 1) Save the previous folder stack. 2) Create an alias which allows me to restore the saved value 3) Create a new folder stack containing the folders with messages having the 'unread' sequence set. There are many other possibilities, I won't enumerate them here. The -delete switch allows you to delete a component from the {path}/context file (attempts to delete something from .mh_profile yield an interesting message). This options intended usage is to allow the context file to be accessed by scripts which will maintain their own information there. Comments? -- ----- gregg.g.wonderly@att.com (AT&T bell laboratories)