Subject: [sup-talk] [PATCH] fixed crasher when refining search and updated keybinding

From: [email-masked] (Christopher Warrington)
Date: Fri, 25 Jan 2008 23:32:09 -0600

Refine search no longer crashes. Also, the keybinding has been updated
to reflect the new global search keybinding. | seems to be a shifted \
on most standard 104-key keyboards.
---
 lib/sup/modes/search-results-mode.rb |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lib/sup/modes/search-results-mode.rb b/lib/sup/modes/search-results-mode.rb
index f64a227..6fdc58a 100644
--- a/lib/sup/modes/search-results-mode.rb
+++ b/lib/sup/modes/search-results-mode.rb
@@ -9,13 +9,13 @@ class SearchResultsMode < ThreadIndexMode
   end
 
   register_keymap do |k|
-    k.add :refine_search, "Refine search", '.'
+    k.add :refine_search, "Refine search", '|'
   end
 
   def refine_search
-    query = BufferManager.ask :search, "query: ", (@qobj.to_s + " ")
+    query = BufferManager.ask :search, "refine query: ", (@qobj.to_s + " ")
     return unless query && query !~ /^\s*$/
-    SearchResultsMode.spawn_from_query query, @qopts
+    SearchResultsMode.spawn_from_query query
   end
 
   ## a proper is_relevant? method requires some way of asking ferret
-- 
1.5.3.8

---

From: [email-masked] (John Bent)
Date: Sun, 27 Jan 2008 10:01:50 -0700

> on most standard 104-key keyboards.
Refine search is very nice.  Something else which might be nice would be
a persistent search history which could be scrolled through with the up
and down arrow keys.  That feature would then include refine search.

---

From: [email-masked] (William Morgan)
Date: Sat, 02 Feb 2008 18:34:02 -0800

Reformatted excerpts from Christopher Warrington's message of 2008-01-25:
> Refine search no longer crashes.

This seems fine. At first I thought it was a little weird that the
extra_opts are being discarded on refinement, but now I think that's
actually the right thing to do.

One minor tweak request: can you split this into two patches, one for
the keybinding change and one for the bugfix?

Thanks!

-- 
William <wmorgan-sup at masanjin.net>

---

From: [email-masked] (William Morgan)
Date: Sat, 02 Feb 2008 18:35:28 -0800

Reformatted excerpts from John Bent's message of 2008-01-27:
> Refine search is very nice.  Something else which might be nice would
> be a persistent search history which could be scrolled through with
> the up and down arrow keys.  That feature would then include refine
> search.

There is a non-persistent (but contextually-aware!) search history
accessible via up and down keys now. Persisting that to disk wouldn't be
very hard at all.

---

From: [email-masked] (Christopher Warrington)
Date: Sat, 2 Feb 2008 21:49:04 -0600

Refine Search no longer crashes.
---
 lib/sup/modes/search-results-mode.rb |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
 mode change 100644 => 100755 lib/sup/modes/search-results-mode.rb

diff --git a/lib/sup/modes/search-results-mode.rb b/lib/sup/modes/search-results-mode.rb
old mode 100644
new mode 100755
index f64a227..a03f0a2
--- a/lib/sup/modes/search-results-mode.rb
+++ b/lib/sup/modes/search-results-mode.rb
@@ -15,7 +15,7 @@ class SearchResultsMode < ThreadIndexMode
   def refine_search
     query = BufferManager.ask :search, "query: ", (@qobj.to_s + " ")
     return unless query && query !~ /^\s*$/
-    SearchResultsMode.spawn_from_query query, @qopts
+    SearchResultsMode.spawn_from_query query
   end

---

From: [email-masked] (Christopher Warrington)
Date: Sat, 2 Feb 2008 21:49:19 -0600

Refine Search is now bound to |. On most standard 104-key keyboards,
this appears to be shifted \, which fits in nicely since \ is global
search now.
---
 lib/sup/modes/search-results-mode.rb |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/sup/modes/search-results-mode.rb b/lib/sup/modes/search-results-mode.rb
index a03f0a2..6fdc58a 100755
--- a/lib/sup/modes/search-results-mode.rb
+++ b/lib/sup/modes/search-results-mode.rb
@@ -9,11 +9,11 @@ class SearchResultsMode < ThreadIndexMode
   end
 
   register_keymap do |k|
 
   def refine_search
-    query = BufferManager.ask :search, "query: ", (@qobj.to_s + " ")
+    query = BufferManager.ask :search, "refine query: ", (@qobj.to_s + " ")
     return unless query && query !~ /^\s*$/
     SearchResultsMode.spawn_from_query query
   end
-- 
1.5.3.8

---

From: [email-masked] (William Morgan)
Date: Sat, 02 Feb 2008 21:09:17 -0800

Both in next. Thanks!