[sup-devel] [PATCH] Saved Search Support

Rich Lane rlane at club.cc.cmu.edu
Tue Jan 19 13:00:32 EST 2010

Excerpts from Eric Sherman's message of 2010-01-18 18:44:37 -0500:
> Start an index search with a \ backslash and press enter to get a list
> of searches that were previously saved from search-results-mode with %
> percent or added from search-list-mode directly.  Saved searches may be
> used in other searches by enclosing their names in {} curly braces.
> Search names may contain letters, numbers, underscores and dashes.

This is a nice feature. A few comments:

I'd like it better if shrinking went away and the only time we expanded
was right before giving it to parse_query. I'd rather not have the
expand-on-delete or rename-tracking behaviors. These changes would
simplify the code quite a bit. I think attempting to expand a
nonexistent saved search should result in something false ("type:false",
maybe), send a warning to the log, and perhaps flash an error message.

On Ruby 1.9.1 I get:
lib/sup/search.rb:69: warning: Hash#index is deprecated; use Hash#key

SearchListMode#regen_text: looks like a mixup of each and map

Should flash an error message on name collisions, or allow overwriting.

SearchListMode#rename_selected_search, SearchListMode#save_search:
Name collision handling should be consistent with add_new_search.

I'd replace the duplicated name checking regexes with a method.

I think the strip should be done by the caller.

More information about the Sup-devel mailing list