[news.groups] Vote confirmation

mesard@bbn.com (Wayne Mesard) (07/14/89)

[Disclaimer: This article is long and redundant.  It describes how to
automate the vote-collecting/confirming process using MH.  I wanted to
explain it carefully in hopes that it will be useful to others.]

In article <10808@xenna.Encore.COM> cook@encore.com writes:
>Hey, people, like that's what computers are for, right?  You don't
>have to do the doggie work of PERSONALLY confirming each vote!
[...]
>Perhaps someone who has done the scripture would be kind
>enough to post a pointer

I don't think confirmations are necessary, although it is always
appreciated.  A mid-vote list of From: lines is certainly adequate.
When I conducted the talk.animal-rights vote, I was able to streamline
the confirmation process using MH, C-shell aliases and some shell
scripts.  So for those vote-takers who are so inclined, here's what I
did:

1) I created symbolic links from ~/bin/yr and ~/bin/nr to MH's repl
command.  (The names mean "yes response" and "no response".)

2) I put the following lines in my ~/.mh_profile file:

   yr: -editor yi -nocc all -annotate
   nr: -editor ni -nocc all -annotate
   yi-next: repl_emacs
   ni-next: repl_emacs

This creates two new MH commands which work just like vanilla repl
except that they use "yi" and "ni" as first-time-only editors, they only
send replies to the sender of the original and they annotate the
original message to note that you've replied.  [N.B.  repl_emacs is my
usual editor for repl(1).  You'll want to substitute whatever your repl
uses.  E.g., emacs or vi.]

3) Now, a vote confirmation will say one of two things ["Thanks for
voting YES" or "Thanks for nothing, you slimeball" :-].  The two editors
"yi" and "ni" (for "yes include" and "no include") are one line shell
scripts which insert the appropriate text into the draft message file.
Here they are:

~/bin/yi:
  cat /usr/mesard/Mail/yes >> /usr/mesard/Mail/draft

~/bin/ni:
  cat /usr/mesard/Mail/no >> /usr/mesard/Mail/draft

4) The text files /usr/mesard/Mail/{yes,no} are the actual responses
sent out.  For example:

  Your "yes" vote on the creation of talk.animal-rights has been received.
  Thanks for voting.

  --
  void *Wayne_Mesard();         Mesard@BBN.COM         BBN, Cambridge, MA

5) Finally, I put some aliases in my .cshrc file:

  alias y "yr \!*; refile +y;next"
  alias n "nr \!*; refile +n;next"
  alias fv "folder +y; folder +n"   # Show up-to-the-minute voting results


Summary: Create two symbolic links to repl(1)
-------  Add four lines to ~/.mh_profile
         Create two "editor" shell scripts
         Create two response messages
         Create some aliases

Sample interaction:
------ -----------
**> show
(Message inbox:45)
To: mesard@bbn.com
From: joe@blow.com
Subject: I vote NO
Date: Fri, 14 Jul 89 08:42:14 -0400

I vote NO.

Joe.
**> n

What now? l
From: mesard@BBN.COM
To: joe@blow.com
Reply-To: mesard@BBN.COM
Subject: Re: I vote NO
In-reply-to: Your message of Fri, 14 Jul 89 08:42:14 -0400.

Your "no" vote on the creation of talk.animal-rights has been received.
Thanks for voting.

--
void *Wayne_Mesard();         Mesard@BBN.COM         BBN, Cambridge, MA

What now? s

[[[Message gets sent and next message in +inbox is displayed]]]


Explanation:
-----------
I read a NO vote (using show(1)).  Since it's the current message, I
type "n" which invokes the csh alias from step 5 above.  [Note that n takes
the same arguments as repl(1) so, e.g., "n +inbox last" is valid.]  

The alias, in turn, invokes nr, which calls ni and gives me a "What
now?"  prompt familiar to MH users.

At this point (after typing one key), I have a draft message addressed
to the voter thanking him/her for the NO vote.  Now I can do any of the
usual things that one does with whatnow(1):

 - Type "l" to see the message
 - Type "e" to edit the message using my normal repl(1) editor.  (If I
   want to add something in addition to the generic response, or if I
   notice that the address MH came up with doesn't match the address in
   the sender's signature and I want to change it.)
 - Type "s" to send the message

After the message has been sent, nr exits and n finishes up by filing
the message in the NO-votes folder and moving on to the next new
message. 

All that with only two keystrokes!

-- 
unsigned *Wayne_Mesard();    "A thousand pounds?!  That's almost a ton!"
Mesard@BBN.COM               
BBN, Cambridge, MA                                                   -MS