From mboxrd@z Thu Jan 1 00:00:00 1970 Received: by 10.42.229.71 with SMTP id jh7cs33301icb; Thu, 27 Jan 2011 20:26:04 -0800 (PST) Received: by 10.229.239.141 with SMTP id kw13mr499575qcb.172.1296188763005; Thu, 27 Jan 2011 20:26:03 -0800 (PST) Return-Path: Received: from rubyforge.org (rubyforge.org [205.234.109.19]) by mx.google.com with ESMTP id k12si20852281vcr.144.2011.01.27.20.26.02; Thu, 27 Jan 2011 20:26:02 -0800 (PST) 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 7FFDD19783F9; Thu, 27 Jan 2011 23:26:02 -0500 (EST) Received: from pion.club.cc.cmu.edu (PION.CLUB.CC.CMU.EDU [128.237.157.88]) by rubyforge.org (Postfix) with ESMTP id 3AA7219783C6 for ; Thu, 27 Jan 2011 23:20:44 -0500 (EST) Received: from rlane by pion.club.cc.cmu.edu with local (Exim 4.69) (envelope-from ) id 1Pifuw-0001Js-UI for sup-devel@rubyforge.org; Thu, 27 Jan 2011 23:26:38 -0500 From: Rich Lane To: sup-devel Date: Thu, 27 Jan 2011 23:26:38 -0500 Message-Id: <1296187729-sup-7405@zyrg.net> User-Agent: Sup/git Subject: [sup-devel] new branch: keybindings 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 This branch makes the keybindings hook more useful. It moves the global keymap into a new GlobalMode that all others inherit from. This lets you write the same code to make a global keybinding as for a mode-specific one: class Redwood::GlobalMode keymap.add! :list_starred, "List all starred threads", "s" def list_starred SearchResultsMode.spawn_from_query "is:starred" end end I got rid of the "modes" local since I think it's better to just reopen the class with normal Ruby syntax. The keybindings hook is now exactly like the startup hook but with the O-k keybinding to reload it. This branch also makes it easier to write keybindings by catching and displaying exceptions from any keybinding, including builtin Sup ones. Masking Sup bugs isn't the goal (there's still a backtrace and bug report instructions) but the user experience is much better than losing a half-composed email. I've added some of my own keybindings (not using GlobalMode yet) to the wiki: http://sup.rubyforge.org/wiki/wiki.pl?CustomizingKeys _______________________________________________ Sup-devel mailing list Sup-devel@rubyforge.org http://rubyforge.org/mailman/listinfo/sup-devel