I think there's a slight bug in the custom-search implementation.
Patch is here:

>From cea17180933469570e9502ffa7bf67ccaa8ccfc7 Mon Sep 17 00:00:00 2001
From: Edward Z. Yang <[email protected]>
Date: Wed, 10 Jun 2009 01:42:50 -0400
Subject: [PATCH] Fix bug in which custom-search substitutions are not used.

Signed-off-by: Edward Z. Yang <[email protected]>
---
 lib/sup/ferret_index.rb |    2 +-
 lib/sup/xapian_index.rb |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/sup/ferret_index.rb b/lib/sup/ferret_index.rb
index d605e8d..34dff87 100644
--- a/lib/sup/ferret_index.rb
+++ b/lib/sup/ferret_index.rb
@@ -340,7 +340,7 @@ EOS
     query = {}
 
     subs = HookManager.run("custom-search", :subs => s) || s
-    subs = s.gsub(/\b(to|from):(\S+)\b/) do
+    subs = subs.gsub(/\b(to|from):(\S+)\b/) do
       field, name = $1, $2
       if(p = ContactManager.contact_for(name))
         [field, p.email]
diff --git a/lib/sup/xapian_index.rb b/lib/sup/xapian_index.rb
index ab25ea0..e1cfe65 100644
--- a/lib/sup/xapian_index.rb
+++ b/lib/sup/xapian_index.rb
@@ -193,7 +193,7 @@ EOS
     query = {}
 
     subs = HookManager.run("custom-search", :subs => s) || s
-    subs = s.gsub(/\b(to|from):(\S+)\b/) do
+    subs = subs.gsub(/\b(to|from):(\S+)\b/) do
       field, name = $1, $2
       if(p = ContactManager.contact_for(name))
         [field, p.email]
-- 
1.6.4.4
_______________________________________________
sup-talk mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/sup-talk

Reply via email to