Return-Path: X-Original-To: notmuch@notmuchmail.org Delivered-To: notmuch@notmuchmail.org Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 507AA431FAF for ; Thu, 19 Jan 2012 05:10:36 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -2.3 X-Spam-Level: X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled Received: from olra.theworths.org ([127.0.0.1]) by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id THwpET-1MajX for ; Thu, 19 Jan 2012 05:10:35 -0800 (PST) Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 98E83431FAE for ; Thu, 19 Jan 2012 05:10:35 -0800 (PST) Received: from zancas.localnet (fctnnbsc36w-156034071197.pppoe-dynamic.High-Speed.nb.bellaliant.net [156.34.71.197]) (authenticated bits=0) by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id q0JDAKo5021639 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO); Thu, 19 Jan 2012 09:10:21 -0400 Received: from bremner by zancas.localnet with local (Exim 4.77) (envelope-from ) id 1Rnrkx-0007s8-Uj; Thu, 19 Jan 2012 09:10:19 -0400 From: David Bremner To: Jameson Graef Rollins , Notmuch Mail Subject: Re: RFC: tag macros In-Reply-To: <87vco8q1yt.fsf@servo.finestructure.net> References: <874nvtvzm5.fsf@convex-new.cs.unb.ca> <87vco8q1yt.fsf@servo.finestructure.net> User-Agent: Notmuch/0.11+61~gbaa2c97 (http://notmuchmail.org) Emacs/23.3.1 (x86_64-pc-linux-gnu) Date: Thu, 19 Jan 2012 09:10:19 -0400 Message-ID: <87d3afltxg.fsf@zancas.localnet> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Jan 2012 13:10:36 -0000 On Wed, 18 Jan 2012 10:50:50 -0800, Jameson Graef Rollins wrote: > Is all of this really easier than just adding the following to your > .emacs?: > > (define-key notmuch-search-mode-map "o" > (lambda () > (interactive) > (notmuch-show-add-tag "notmuch::patch") > (notmuch-show-add-tag "notmuch::obsolete") > (notmuch-show-remove-tag "notmuch::needs-review"))) > I started out along this route. I think there are a few advantages to the approach I posted, but only if many people are making similar snippets for more than one key. - it doesn't have the 3 lines of boilerplate per keybinding - it doesn't require the user to program in lisp; I suspect that explaining to new users how to customize their lisp snippets is some support burden as well. - it provides the equivalent of a submap, which is another few lines of boilerplate. The only actual keybinding is "t" as a prefix. In my case, assuming the API was improved a bit as Austin suggested, this would be a savings of 15-20 lines of boilerplate per user. Anyway, we can start by improving and documenting the API, and see how that goes. The actually "parse lists and turn them into keybindings" part is only the 4 line function notmuch-show-apply-tag-macro. > That seems really simple to me, and doesn't require us to support a > bunch of code to do complicated customization stuff. I'm admittedly ignorant about emacs customization stuff, this requires a single list of lists. Personally I use "setq" in .emacs for most customization; it plays much better with version control.