Ralph Corderoy wrote:

$ folders +inbox
# inbox/foo showed up in the list
$ scan @foo
scan: no messages in inbox/foo
$ rmf @. # since I don't want the empty folder no more.

I soon realised what I'd done from the messages telling me that
+inbox/bar wasn't empty, etc. But I still lost all my 80-odd mail
messages in +inbox. There weren't even any ,* files since rmf doesn't
leave those behind.

I'd argue that scan should still change the current folder even if the
destination is empty. Does anyone know the reasoning behind the current design?

Hmmm... I think it's related to the way that MH commands usually don't change the context after an error. For instance, if you do "show 9876" and there is no message 9876, the current message will not be set to 9876. The same thing happens with a command like "show +somefolder" when there's no current message in +somefolder; the current folder isn't changed.

Maybe there's another reason, but I just don't remember. (I think I talked to John Romine about that ten years ago, when I wrote the CAUTION for the MH book, at http://www.ics.uci.edu/~mh/book/mh/fol.htm#index8 -- but unfortunately I didn't put any explanation in the book.) Anyone??

The "folder" command is the only one I can think of that will change the current folder to an empty folder.

About rmf warning you before removing a folder that isn't empty: you could write a little front-end script named rmf (put it in your personal bin, etc.). Have it run "folder" on the named folder (or, if there's no argument, on the current folder); if the answer isn't "<foldername> has no messages" then prompt before actually running rmf.

Sorry about that.

Jerry
--
Jerry Peek, [EMAIL PROTECTED], http://www.jpeek.com/



Reply via email to