From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by olra.theworths.org (Postfix) with ESMTP id 945F7431FBC for ; Thu, 13 Dec 2012 03:45:59 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: 1.401 X-Spam-Level: * X-Spam-Status: No, score=1.401 tagged_above=-999 required=5 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FREEMAIL_FROM=0.001, FREEMAIL_REPLY=2.499, NML_ADSP_CUSTOM_MED=1.2, 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 RkweACM7-VuW for ; Thu, 13 Dec 2012 03:45:57 -0800 (PST) Received: from mail2.qmul.ac.uk (mail2.qmul.ac.uk [138.37.6.6]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by olra.theworths.org (Postfix) with ESMTPS id 65573431FB6 for ; Thu, 13 Dec 2012 03:45:57 -0800 (PST) Received: from smtp.qmul.ac.uk ([138.37.6.40]) by mail2.qmul.ac.uk with esmtp (Exim 4.71) (envelope-from ) id 1Tj7Eh-0007Q2-Nm; Thu, 13 Dec 2012 11:45:56 +0000 Received: from 93-97-24-31.zone5.bethere.co.uk ([93.97.24.31] helo=localhost) by smtp.qmul.ac.uk with esmtpsa (TLSv1:AES128-SHA:128) (Exim 4.69) (envelope-from ) id 1Tj7Eh-0002GX-1q; Thu, 13 Dec 2012 11:45:55 +0000 From: Mark Walters To: Damien Cassou , notmuch@notmuchmail.org Subject: Re: In-Reply-To: <1355216437-21109-1-git-send-email-damien.cassou@gmail.com> References: <1355216437-21109-1-git-send-email-damien.cassou@gmail.com> User-Agent: Notmuch/0.14+155~g7edfdc3 (http://notmuchmail.org) Emacs/23.4.1 (x86_64-pc-linux-gnu) Date: Thu, 13 Dec 2012 11:45:57 +0000 Message-ID: <877gomdvka.fsf@qmul.ac.uk> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Sender-Host-Address: 93.97.24.31 X-QM-SPAM-Info: Sender has good ham record. :) X-QM-Body-MD5: 39097c0135869845ccb3d33b28993a89 (of first 20000 bytes) X-SpamAssassin-Score: -1.2 X-SpamAssassin-SpamBar: - X-SpamAssassin-Report: The QM spam filters have analysed this message to determine if it is spam. We require at least 5.0 points to mark a message as spam. This message scored -1.2 points. Summary of the scoring: * -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at http://www.dnswl.org/, * medium trust * [138.37.6.40 listed in list.dnswl.org] * 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider * (markwalters1009[at]gmail.com) * 0.0 T_TVD_MIME_NO_HEADERS BODY: T_TVD_MIME_NO_HEADERS * 1.0 FREEMAIL_REPLY From and body contain different freemails * 0.1 AWL AWL: From: address is in the auto white-list X-QM-Scan-Virus: ClamAV says the message is clean 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, 13 Dec 2012 11:45:59 -0000 --=-=-= Hi This is looking good: I have two comments the second of which is significant. The first is do you want to sort (alphabetically) the headerline tags? As it stands they are in the order they appear in the thread which is probably not what is wanted. The second is that there is a notmuch-show-tag-all functions to tag all messages in the thread. Your patch is quadratic for the update (as it calculates the list of thread tags once for each message). The attached patch would avoid this and doesn't look too bad. (Note I retained no-headerline-update as an optional argument in case there are out of tree callers, eg users' .emacs files) [Note this is not purely of academic interest: on my test large thread (178 messages) updating the display after tagging all messages took some seconds without my patch and almost no time with it.] Best wishes Mark --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-mjw-tweak.patch >From ab15a4bdb50bcf6b2851806195bbe8bea3b099dc Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Thu, 13 Dec 2012 11:23:09 +0000 Subject: [PATCH] Avoid quadratic update --- emacs/notmuch-show.el | 12 +++++++----- 1 files changed, 7 insertions(+), 5 deletions(-) diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el index 93bce07..8dd6010 100644 --- a/emacs/notmuch-show.el +++ b/emacs/notmuch-show.el @@ -356,7 +356,7 @@ operation on the contents of the current buffer." "Return a string comprised of `n' spaces." (make-string n ? )) -(defun notmuch-show-update-tags (tags) +(defun notmuch-show-update-tags (tags &optional no-headerline-update) "Update the displayed tags of the current message." (save-excursion (goto-char (notmuch-show-message-top)) @@ -364,7 +364,8 @@ operation on the contents of the current buffer." (let ((inhibit-read-only t)) (replace-match (propertize (notmuch-tagger-format-tags tags) 'face 'notmuch-tag-face))))) - (notmuch-show-update-header-line)) + (unless no-headerline-update + (notmuch-show-update-header-line))) (defun notmuch-clean-address (address) "Try to clean a single email ADDRESS for display. Return a cons @@ -1461,10 +1462,10 @@ current thread." (defun notmuch-show-get-depth () (notmuch-show-get-prop :depth)) -(defun notmuch-show-set-tags (tags) +(defun notmuch-show-set-tags (tags &optional no-headerline-update) "Set the tags of the current message." (notmuch-show-set-prop :tags tags) - (notmuch-show-update-tags tags)) + (notmuch-show-update-tags tags no-headerline-update)) (defun notmuch-show-get-tags () "Return the tags of the current message." @@ -1778,7 +1779,8 @@ See `notmuch-tag' for information on the format of TAG-CHANGES." (let* ((current-tags (notmuch-show-get-tags)) (new-tags (notmuch-update-tags current-tags tag-changes))) (unless (equal current-tags new-tags) - (notmuch-show-set-tags new-tags)))))) + (notmuch-show-set-tags new-tags t))))) + (notmuch-show-update-header-line)) (defun notmuch-show-add-tag () "Same as `notmuch-show-tag' but sets initial input to '+'." -- 1.7.9.1 --=-=-= On Tue, 11 Dec 2012, Damien Cassou wrote: > From: Damien Cassou > Subject: [PATCH v4] emacs: display tags in notmuch-show with links > In-Reply-To: > > This patch obsoletes: > id:1355149964-27905-1-git-send-email-damien.cassou@gmail.com > > [PATCH 1/4] emacs: Add a thread's tags to notmuch-show header-line > [PATCH 2/4] emacs: Make tags in notmuch-show header-line clickable > [PATCH 3/4] emacs: Make all tags in `notmuch-show' clickable > [PATCH 4/4] emacs: Add unit-tests for clickable tags > > These patches make 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). > > These patches are the first of an upcoming series whose goal is to > integrate notmuch-labeler into notmuch. See the following for more > details: https://github.com/DamienCassou/notmuch-labeler > > With respect to v3, I took care of the comments you made: > - the header-line now updates when tags are changed > - the tags in the body stays clickable when tags are changed > > Additionally, I added two unit tests to cover the above two comments > and fixed some others unit tests of mine. > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch --=-=-=--