From 02bb9ccdb43865cf3b9326e22d05d41f45112367 Mon Sep 17 00:00:00 2001 From: Michal Nazarewicz Date: Tue, 21 Aug 2012 15:13:36 +0200 Subject: [PATCH] [PATCH] notmuch-show: add notmuch-show-mark-read-tags option --- 53/e1c4856163af9cac69705ce13de82918a45126 | 120 ++++++++++++++++++++++ 1 file changed, 120 insertions(+) create mode 100644 53/e1c4856163af9cac69705ce13de82918a45126 diff --git a/53/e1c4856163af9cac69705ce13de82918a45126 b/53/e1c4856163af9cac69705ce13de82918a45126 new file mode 100644 index 000000000..0525fd26b --- /dev/null +++ b/53/e1c4856163af9cac69705ce13de82918a45126 @@ -0,0 +1,120 @@ +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 2DC38431FB6 + for ; Tue, 21 Aug 2012 06:13:43 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: -0.8 +X-Spam-Level: +X-Spam-Status: No, score=-0.8 tagged_above=-999 required=5 + tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, + 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 2Pe2mgT19XTL for ; + Tue, 21 Aug 2012 06:13:42 -0700 (PDT) +Received: from mail-ee0-f53.google.com (mail-ee0-f53.google.com + [74.125.83.53]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) (No client + certificate requested) by olra.theworths.org (Postfix) with ESMTPS id + 70456431FAE for ; Tue, 21 Aug 2012 06:13:42 -0700 + (PDT) +Received: by eekc4 with SMTP id c4so2447784eek.26 + for ; Tue, 21 Aug 2012 06:13:39 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; + s=20120113; h=from:to:subject:date:message-id:x-mailer; + bh=4LqLhBi3/0CxVJ9oII6qhafaK8cGVxmkQv4RKdUQOH8=; + b=NTLwbLsCkF3cQolVv894fFb9L3A4syNaQ3ljgPNQg1faS/TasnIu3k3RaNKqQZIWEg + gR01Nw4VKLGTXkuIyhZAww/QgPyjlVK6x5jgW9sOGkcm9ZFo/HK9+ABhfFYrjbGWEm37 + quxF0BfHykF04Lse3DnN/8pah3LZMWYSTyw0v/iiaPDEPFEIuqNZOdwQ1xXWMOYvgIva + coYCfpCvI+ZvRiFp4xhVo8rJscvyf0UI5E0M4t+CmJskJXIGkgFBiDjDQzihRNzmyFRx + wxKJEumgsdFx8uuZNVBuxK2KnmU8k5Y9bf3+rXbwW2o2YYDWLkF7FJDQeNvAK6eFWPMO F1vQ== +X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=google.com; s=20120113; + h=from:to:subject:date:message-id:x-mailer:x-gm-message-state; + bh=4LqLhBi3/0CxVJ9oII6qhafaK8cGVxmkQv4RKdUQOH8=; + b=XffEFQ9pK2t9fJhTWvUAQFno1hp+kpjYBB/dVQTwWYtw+tYcO5d/EA8XUloLmBZpj7 + llXHrBSVKSA8BIIPd989mAKM44kkHK2qr0MV2K+3jJqM3ganzPuK23ckJQmwHfO+ttz8 + rNsM4IiGeO7gX4jL5qga2ziPyX1ANI31Dl77n9BiMEPFWeFHcfxZOfDDRbs1d4DM0FfI + Fm/45/x3hJMt80VY9QRubweVIt8exVNM6nIGm0MiitZUNBVGP01yFw+wUUrmO55ro++V + 6kVvXUh42GDcWW2M4n4u+mieM5goWA+RZKqtiDSxHdKVX+EXuSMe7LteGZfwk++GuwZI + SkHA== +Received: by 10.14.5.78 with SMTP id 54mr13592748eek.1.1345554819886; + Tue, 21 Aug 2012 06:13:39 -0700 (PDT) +Received: by 10.14.5.78 with SMTP id 54mr13592731eek.1.1345554819730; + Tue, 21 Aug 2012 06:13:39 -0700 (PDT) +Received: from mpn-glaptop.corp.google.com + (dhcp-172-16-75-154.zrh.corp.google.com [172.16.75.154]) + by mx.google.com with ESMTPS id k41sm4319564eep.13.2012.08.21.06.13.38 + (version=SSLv3 cipher=OTHER); Tue, 21 Aug 2012 06:13:38 -0700 (PDT) +From: Michal Nazarewicz +To: notmuch@notmuchmail.org +Subject: [PATCH] notmuch-show: add notmuch-show-mark-read-tags option +Date: Tue, 21 Aug 2012 15:13:36 +0200 +Message-Id: + <416b1203c83ea56c8e915a056465d9e202329f45.1345554683.git.mina86@mina86.com> +X-Mailer: git-send-email 1.7.7.3 +X-Gm-Message-State: ALoCoQnrGaCbVCiecM+Gb0Ggaul3LKdXe0oyWzZEZbzOASZJ6WDa4LZtXOZyiaRyiKFa4FFnh7b5K9cY27nySanuO3YLdpPBUmg8vz2tquLmyieZEBYDpJ/gK+LazMzQrT4GYq9LdXe6bZJKOZQFYfcrVc+phFFUWFbrX+RsWVUgjYanxkHn0BpiU1LYqGpk2EVq/eizpHuAze9zL1+oN3Xj4iv1CRV7zA== +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, 21 Aug 2012 13:13:43 -0000 + +From: Michal Nazarewicz + +The `notmuch-show-mark-read-tags' lists tags that are to be applied when +message is read. By default, the only value is "-unread" which will remove +the unread tag. Among other uses, this variable can be used to stop +notmuch-show from modifying tags when message is shown (by setting the +variable to an empty list). +--- + + I've sent this patch a while back but I think it got lost somehow so + resending. + + emacs/notmuch-show.el | 12 ++++++++++-- + 1 files changed, 10 insertions(+), 2 deletions(-) + +diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +index 82b5399..c9fd867 100644 +--- a/emacs/notmuch-show.el ++++ b/emacs/notmuch-show.el +@@ -183,6 +183,13 @@ provided with an MLA argument nor `completing-read' input." + notmuch-show-stash-mlarchive-link-alist)) + :group 'notmuch-show) + ++(defcustom notmuch-show-mark-read-tags '("-unread") ++ "List of tags to apply when message is read, ie. shown in notmuch-show ++buffer." ++ :type '(repeat string) ++ :group 'notmuch-show) ++ ++ + (defmacro with-current-notmuch-show-message (&rest body) + "Evaluate body with current buffer set to the text of current message" + `(save-excursion +@@ -1383,8 +1390,9 @@ current thread." + (notmuch-show-get-prop :headers-visible)) + + (defun notmuch-show-mark-read () +- "Mark the current message as read." +- (notmuch-show-tag-message "-unread")) ++ "Apply `notmuch-show-mark-read-tags' to the message." ++ (when notmuch-show-mark-read-tags ++ (apply 'notmuch-show-tag-message notmuch-show-mark-read-tags))) + + ;; Functions for getting attributes of several messages in the current + ;; thread. +-- +1.7.7.3 + -- 2.26.2