commit b97d4e67046da62058a6c77225bdee26063bd4e0
parent 9e476599cb48ba830e55d5f5fcd1a13eb137ce14
Author: William Morgan <wmorgan-sup@masanjin.net>
Date: Wed, 30 Jan 2008 22:16:54 -0800
allow specifying a noun for tagged items, instead of always using "thread"
The "Apply to ..." prompt is generated by the tagger. Sometimes you're not
tagging threads, though, you're tagging something else. (E.g. in
contact-list-mode.)
Diffstat:
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/lib/sup/tagger.rb b/lib/sup/tagger.rb
@@ -1,9 +1,11 @@
module Redwood
class Tagger
- def initialize mode
+ def initialize mode, noun="thread", plural_noun=nil
@mode = mode
@tagged = {}
+ @noun = noun
+ @plural_noun = plural_noun || (@noun + "s")
end
def tagged? o; @tagged[o]; end
@@ -21,7 +23,7 @@ class Tagger
return
end
- noun = num_tagged == 1 ? "thread" : "threads"
+ noun = num_tagged == 1 ? @noun : @plural_noun
unless action
c = BufferManager.ask_getch "apply to #{num_tagged} tagged #{noun}:"