From: William Morgan Date: Thu, 31 Jan 2008 06:16:54 +0000 (-0800) Subject: allow specifying a noun for tagged items, instead of always using "thread" X-Git-Url: https://git.notmuchmail.org/git?a=commitdiff_plain;h=b97d4e67046da62058a6c77225bdee26063bd4e0;p=sup 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.) --- 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}:"