Archive of RubyForge sup-talk mailing list
 help / color / mirror / Atom feed
From: its.jeff.balogh@gmail.com (Jeff Balogh)
Subject: [sup-talk] [PATCH] add a reply-to hook, for setting the Reply To field.
Date: Thu, 24 Apr 2008 01:23:10 -0400	[thread overview]
Message-ID: <1209014328-sup-5801@archie> (raw)
In-Reply-To: <1207373363-sup-374@archie>

I prefer to reply to a mailing list, then all participants:

  $ cat .sup/hooks/reply-to.rb
  ([:list, :all] & types)[0]
---
I've been happily using this locally, and forgot to send it to the list. :P

 lib/sup/modes/reply-mode.rb |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/lib/sup/modes/reply-mode.rb b/lib/sup/modes/reply-mode.rb
index e7b2929..ad50fed 100644
--- a/lib/sup/modes/reply-mode.rb
+++ b/lib/sup/modes/reply-mode.rb
@@ -19,6 +19,14 @@ Return value:
   A string containing the text of the quote line (can be multi-line)
 EOS
 
+  HookManager.register "reply-to", <<EOS
+Set the Reply To field.
+Variables:
+  types: the valid types to choose from
+Return value:
+  The reply type you desire, or nil to let sup set it.
+EOS
+
   def initialize message
     @m = message
 
@@ -92,8 +100,13 @@ EOS
     types = REPLY_TYPES.select { |t| @headers.member?(t) }
     @type_selector = HorizontalSelector.new "Reply to:", types, types.map { |x| TYPE_DESCRIPTIONS[x] }
 
+    hook_reply = HookManager.run "reply-to", :types => types
+    Redwood::log hook_reply.to_s
+
     @type_selector.set_to(
-      if @m.is_list_message?
+      if types.include? hook_reply
+        hook_reply
+      elsif @m.is_list_message?
         :list
       elsif @headers.member? :sender
         :sender
-- 
1.5.5.1



  reply	other threads:[~2008-04-24  5:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-05  5:48 [sup-talk] Setting reply to -- hook or config? Jeff Balogh
2008-04-24  5:23 ` Jeff Balogh [this message]
2008-04-24  5:56   ` [sup-talk] [PATCH] add a reply-to hook, for setting the Reply To field Marc Hartstein
2008-04-24 14:38     ` Jeff Balogh
2008-04-27  6:49 William Morgan
2008-04-27  6:50 William Morgan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1209014328-sup-5801@archie \
    --to=its.jeff.balogh@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox