From b97d4e67046da62058a6c77225bdee26063bd4e0 Mon Sep 17 00:00:00 2001 From: William Morgan Date: Wed, 30 Jan 2008 22:16:54 -0800 Subject: [PATCH] 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.) --- lib/sup/tagger.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/sup/tagger.rb b/lib/sup/tagger.rb index 3e72463..d62f340 100644 --- 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}:" -- 2.45.2