From 30ae16f4b6b3ea1b9259ee47d478a85f0ec9b8a8 Mon Sep 17 00:00:00 2001 From: Mark Walters Date: Sat, 18 Jan 2014 23:30:54 +0000 Subject: [PATCH] [PATCH 6/7] emacs: search: use orig-tags in search --- 5a/df061ec6e5aa3cd1459cebe969dcaa3eccdb2a | 102 ++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 5a/df061ec6e5aa3cd1459cebe969dcaa3eccdb2a diff --git a/5a/df061ec6e5aa3cd1459cebe969dcaa3eccdb2a b/5a/df061ec6e5aa3cd1459cebe969dcaa3eccdb2a new file mode 100644 index 000000000..cc89cf96d --- /dev/null +++ b/5a/df061ec6e5aa3cd1459cebe969dcaa3eccdb2a @@ -0,0 +1,102 @@ +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 248AA431FC9 + for ; Sat, 18 Jan 2014 15:31:25 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0.201 +X-Spam-Level: +X-Spam-Status: No, score=0.201 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + FREEMAIL_ENVFROM_END_DIGIT=1, FREEMAIL_FROM=0.001, + 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 PhCqkH2iADZJ for ; + Sat, 18 Jan 2014 15:31:20 -0800 (PST) +Received: from mail-we0-f172.google.com (mail-we0-f172.google.com + [74.125.82.172]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 8560E431FBC + for ; Sat, 18 Jan 2014 15:31:12 -0800 (PST) +Received: by mail-we0-f172.google.com with SMTP id q58so5893134wes.17 + for ; Sat, 18 Jan 2014 15:31:11 -0800 (PST) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; + h=from:to:cc:subject:date:message-id:in-reply-to:references; + bh=JilFrUBfOH6c5OhuD/HT7AR/Ixh90DR5aHN1maipx9Q=; + b=MptqKIaUcEL3qPGEVonFILfCG/Jw5ncopfrsed3dlIHiNi6YNDXhiDFOkG/G469ids + LEr6VvNoJ0NqVikFVgQY08P6E/tKe2De4D3q2iR2FAovQ+wD4z4BFLAMeddrqpkcQaun + HAsbGmYj+NuCYjoy15pHb9dClfjDE7xfS9yTlGbOX5SjPabMpmtocT/fugVaYZdNBSsw + Lj1Tg2Q705wVvI+/YZ+6a2GhUHonU315s6wYU3VhuuKvGg5jrnq+J+k6VvpwORM8FGrM + 6dB4t4lNa5fzxyBK/v3k3cJ+3I6tD3Qc9orq3kfmPrtWzSztr9MM1fs8QLM3G7mwCzfX + Fb4A== +X-Received: by 10.194.109.68 with SMTP id hq4mr8172079wjb.12.1390087871463; + Sat, 18 Jan 2014 15:31:11 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id ea4sm10966525wib.7.2014.01.18.15.31.10 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 18 Jan 2014 15:31:10 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 6/7] emacs: search: use orig-tags in search +Date: Sat, 18 Jan 2014 23:30:54 +0000 +Message-Id: <1390087855-26194-7-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +In-Reply-To: <1390087855-26194-1-git-send-email-markwalters1009@gmail.com> +References: <1390087855-26194-1-git-send-email-markwalters1009@gmail.com> +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: Sat, 18 Jan 2014 23:31:25 -0000 + +This uses the recent functionality to show the tag changes in the +search buffer. Currently this is only used to show changes the search +buffer makes itself: i.e., it does not make display any changes +reflecting tagging done by other notmuch-buffers. +--- + emacs/notmuch.el | 12 +++++++++--- + 1 files changed, 9 insertions(+), 3 deletions(-) + +diff --git a/emacs/notmuch.el b/emacs/notmuch.el +index 1436e5a..f0ea5d4 100644 +--- a/emacs/notmuch.el ++++ b/emacs/notmuch.el +@@ -753,14 +753,20 @@ non-authors is found, assume that all of the authors match." + format-string (notmuch-sanitize (plist-get result :authors)))) + + ((string-equal field "tags") +- (let ((tags (plist-get result :tags))) +- (insert (format format-string (notmuch-tag-format-tags tags tags))))))) ++ (let ((tags (plist-get result :tags)) ++ (orig-tags (plist-get result :orig-tags))) ++ (insert (format format-string (notmuch-tag-format-tags tags orig-tags))))))) + + (defun notmuch-search-show-result (result &optional pos) + "Insert RESULT at POS or the end of the buffer if POS is null." + ;; Ignore excluded matches + (unless (= (plist-get result :matched) 0) +- (let ((beg (or pos (point-max)))) ++ (let ((beg (or pos (point-max))) ++ ;; If we are inserting the result for the first time POS ++ ;; will be nil and we should set orig-tags. ++ (result (if pos ++ result ++ (plist-put result :orig-tags (plist-get result :tags))))) + (save-excursion + (goto-char beg) + (dolist (spec notmuch-search-result-format) +-- +1.7.9.1 + -- 2.26.2