From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.204.79.193 with SMTP id q1cs80989bkk; Fri, 14 May 2010 08:25:20 -0700 (PDT) Received: by 10.150.174.30 with SMTP id w30mr2337845ybe.200.1273850718815; Fri, 14 May 2010 08:25:18 -0700 (PDT) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id r17si6505873ybc.32.2010.05.14.08.25.18; Fri, 14 May 2010 08:25:18 -0700 (PDT) Received-SPF: pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) client-ip=205.234.109.19; Authentication-Results: mx.google.com; spf=pass (google.com: domain of sup-devel-bounces@rubyforge.org designates 205.234.109.19 as permitted sender) smtp.mail=sup-devel-bounces@rubyforge.org Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 2A1971858351; Fri, 14 May 2010 11:25:18 -0400 (EDT) Received: from www.cquest.utoronto.ca (www.cquest.utoronto.ca [192.82.128.5]) by rubyforge.org (Postfix) with ESMTP id A9802185831E for ; Fri, 14 May 2010 11:22:26 -0400 (EDT) Received: from pinkfloyd.chass.utoronto.ca ([128.100.160.254]:38042 ident=93) by www.cquest.utoronto.ca with esmtp (Exim 4.43) id 1OCwiX-0004h6-UK; Fri, 14 May 2010 11:22:25 -0400 Received: from bwalton by pinkfloyd.chass.utoronto.ca with local (Exim 4.63) (envelope-from ) id 1OCwiX-0004GP-TK; Fri, 14 May 2010 11:22:25 -0400 From: Ben Walton To: sup-devel@rubyforge.org Date: Fri, 14 May 2010 11:22:24 -0400 Message-Id: <1273850544-16363-1-git-send-email-bwalton@artsci.utoronto.ca> X-Mailer: git-send-email 1.7.0 Subject: [sup-devel] [PATCH] Add global keybinding to clear all hooks X-BeenThere: sup-devel@rubyforge.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: Sup developer discussion List-Id: Sup developer discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: sup-devel-bounces@rubyforge.org Errors-To: sup-devel-bounces@rubyforge.org When developing/tweaking hooks, it's inconvenient to use the console mode to run the clear hooks command. Add a globally available key binding ('H') to trigger HookManager.clear. As this is now more exposed in the UI, make HookManager flash a notice to the BufferManager indicating that it cleared the hooks. Signed-off-by: Ben Walton --- bin/sup | 3 +++ lib/sup/hook.rb | 2 +- 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/bin/sup b/bin/sup index ef4092f..8638c78 100755 --- a/bin/sup +++ b/bin/sup @@ -86,6 +86,7 @@ global_keymap = Keymap.new do |k| k.add :nothing, "Do nothing", :ctrl_g k.add :recall_draft, "Edit most recent draft message", 'R' k.add :show_inbox, "Show the Inbox buffer", 'I' + k.add :clear_hooks, "Clear all hooks", 'H' k.add :show_console, "Show the Console buffer", '~' ## Submap for less often used keybindings @@ -330,6 +331,8 @@ begin end when :show_inbox BufferManager.raise_to_front ibuf + when :clear_hooks + HookManager.clear when :show_console b, new = bm.spawn_unless_exists("Console", :system => true) { ConsoleMode.new } b.mode.run diff --git a/lib/sup/hook.rb b/lib/sup/hook.rb index 08738cd..a2a39a5 100644 --- a/lib/sup/hook.rb +++ b/lib/sup/hook.rb @@ -112,7 +112,7 @@ EOS def enabled? name; !hook_for(name).nil? end - def clear; @hooks.clear; end + def clear; @hooks.clear; BufferManager.flash "Hooks cleared" end def clear_one k; @hooks.delete k; end private -- 1.7.0 _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel