From: Austin Clements Date: Tue, 20 Nov 2012 04:23:02 +0000 (+1900) Subject: Re: [PATCH v2] emacs: display tags in notmuch-show with links X-Git-Url: http://git.tremily.us/gitweb.cgi?a=commitdiff_plain;h=d4e118b2ef3710e3c30bd2eb71d79b31ccde82e2;p=notmuch-archives.git Re: [PATCH v2] emacs: display tags in notmuch-show with links --- diff --git a/04/e1845e20469a05f637a4317145bd296c65ce51 b/04/e1845e20469a05f637a4317145bd296c65ce51 new file mode 100644 index 000000000..618d9757e --- /dev/null +++ b/04/e1845e20469a05f637a4317145bd296c65ce51 @@ -0,0 +1,130 @@ +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 B0043431FC2 + for ; Mon, 19 Nov 2012 20:23:07 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.7 +X-Spam-Level: +X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 + tests=[RCVD_IN_DNSWL_LOW=-0.7] 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 xBPdyXcsnujQ for ; + Mon, 19 Nov 2012 20:23:07 -0800 (PST) +Received: from dmz-mailsec-scanner-5.mit.edu (DMZ-MAILSEC-SCANNER-5.MIT.EDU + [18.7.68.34]) + by olra.theworths.org (Postfix) with ESMTP id 0F2D4431FBC + for ; Mon, 19 Nov 2012 20:23:06 -0800 (PST) +X-AuditID: 12074422-b7f746d0000008cc-d7-50ab05aa1947 +Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) + by dmz-mailsec-scanner-5.mit.edu (Symantec Messaging Gateway) with SMTP + id 0D.6D.02252.AA50BA05; Mon, 19 Nov 2012 23:23:06 -0500 (EST) +Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) + by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id qAK4N5iQ005671; + Mon, 19 Nov 2012 23:23:06 -0500 +Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) + (authenticated bits=0) + (User authenticated as amdragon@ATHENA.MIT.EDU) + by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id qAK4N2oH024486 + (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); + Mon, 19 Nov 2012 23:23:04 -0500 (EST) +Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) + (envelope-from ) + id 1TafMU-0008Qf-NN; Mon, 19 Nov 2012 23:23:02 -0500 +Date: Mon, 19 Nov 2012 23:23:02 -0500 +From: Austin Clements +To: Ethan Glasser-Camp +Subject: Re: [PATCH v2] emacs: display tags in notmuch-show with links +Message-ID: <20121120042302.GF22284@mit.edu> +References: <1353266322-20318-1-git-send-email-damien.cassou@gmail.com> + <87ip921pqu.fsf@betacantrips.com> +MIME-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <87ip921pqu.fsf@betacantrips.com> +User-Agent: Mutt/1.5.21 (2010-09-15) +X-Brightmail-Tracker: + H4sIAAAAAAAAA+NgFmpnleLIzCtJLcpLzFFi42IRYrdT0V3FujrAYPodKYtdd7cyWdzp2cVi + cf3mTGYHZo+ds+6yezxbdYs5gCmKyyYlNSezLLVI3y6BK+P9AZmCA4IVh9fOZ2xgfMHbxcjJ + ISFgIrHoZDsjhC0mceHeerYuRi4OIYF9jBJH165kgnA2MEocaDrFCOGcZJI48/ctK4SzhFGi + afVaVpB+FgFViZ3tC8FmsQloSGzbvxzI5uAQETCV+HtQHSTMLJAisbJjJzOILSzgJrHo5TEW + EJtXQEdi1YTrYGOEBLIlru3tY4OIC0qcnPmEBaJXS+LGv5dMICOZBaQllv/jAAlzCuhJnJy6 + HKxcVEBFYsrJbWwTGIVmIemehaR7FkL3AkbmVYyyKblVurmJmTnFqcm6xcmJeXmpRbqmermZ + JXqpKaWbGMHh7aK0g/HnQaVDjAIcjEo8vA8SVgUIsSaWFVfmHmKU5GBSEuXt/wUU4kvKT6nM + SCzOiC8qzUktPsQowcGsJMLbVA6U401JrKxKLcqHSUlzsCiJ815LuekvJJCeWJKanZpakFoE + k5Xh4FCS4D3IsjpASLAoNT21Ii0zpwQhzcTBCTKcB2j4RZAa3uKCxNzizHSI/ClGRSlx3icg + CQGQREZpHlwvLP28YhQHekWY9wBIFQ8wdcF1vwIazAQ0+FrAcpDBJYkIKakGxlmHFxhXW6nm + zPs9wV3v1pIgv3JrZzcGdYUIjzUK05codb938mg4eKRuU+7HXOnSG1UhPx4kSu5f1tgQ+Vjm + eoTpnJs26bl65ceP9Gee/alQv1xy2WTrFw+0dojtXej0ccWD3c8OTC/ckhWg8ujBJZ/uN6kv + tY2CP8p38Kxf9NyaP+esu+reb0osxRmJhlrMRcWJACqkikgaAwAA +Cc: notmuch mailing list +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: Tue, 20 Nov 2012 04:23:07 -0000 + +Quoth Ethan Glasser-Camp on Nov 18 at 5:59 pm: +> Damien Cassou writes: +> +> > This patch obsoletes +> > id:1352565719-12397-1-git-send-email-damien.cassou@gmail.com +> > +> > [PATCH 1/4] emacs: Add a thread's tags to emacs header-line +> > [PATCH 2/4] emacs: Make tags in header-line clickable +> > [PATCH 3/4] emacs: Make tags that appear in `notmuch-show' clickable +> > [PATCH 4/4] emacs: Add unit-tests for clickable tags in notmuch-show +> > +> > This patch makes clickable all tags that appear in notmuch-show +> > buffers. Each tag is a link to open a new notmuch-search buffer for +> > this tag. Additionally, the buffer's header-line now shows the +> > thread's tags (clickable only if the `header-button' library is loaded +> > or loadable). +> +> Looks fine to me. Let me just get the notes from my bikeshed, in case +> you get asked to roll another version :) +> +> - You might want to use #' on lambdas. +> +> - It bothers me how similar notmuch-tagger-{body,header}-button-action +> are. I thought it might be better to unify them by seeing what type +> the button argument was. Here's my (untested) approach which you might +> find prettier or uglier. +> +> (notmuch-tagger-all-button-get (button attrib) +> "Utility function to do button-get on different kinds of buttons." +> (cond +> ((integer-or-marker-p button) +> (button-get button attrib)) +> ((and (featurep 'header-button) +> (listp button)) +> (header-button-get button attrib)) +> (t (error "unknown type of button %s" button)) + +This seems like overkill given that all of the common code in +notmuch-tagger-{body,header}-button-action is already abstracted into +a common function. Were there other places where code was duplicated +because of the difference between regular buttons and header buttons? + +> - The comment for notmuch-tagger-make-body-link reads that it will work +> "everywhere except in the header-line". Does this mean mode-line, menu +> bar, or what? How about just "won't work in the header-line"? +> +> - In patch 3: +> +> +If tags the result of this function is to be used within the +> +> I think this should just read "If the result". +> +> Ethan