From 86603d354cf05fa6d8c5e8ddcb67864869f025e3 Mon Sep 17 00:00:00 2001 From: Tomi Ollila Date: Tue, 7 Aug 2012 18:51:37 +0300 Subject: [PATCH] Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option --- 75/fc47d6ea279525c44667da38822263480e1aa6 | 136 ++++++++++++++++++++++ 1 file changed, 136 insertions(+) create mode 100644 75/fc47d6ea279525c44667da38822263480e1aa6 diff --git a/75/fc47d6ea279525c44667da38822263480e1aa6 b/75/fc47d6ea279525c44667da38822263480e1aa6 new file mode 100644 index 000000000..c901c5a13 --- /dev/null +++ b/75/fc47d6ea279525c44667da38822263480e1aa6 @@ -0,0 +1,136 @@ +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 C40EE431FC0 + for ; Tue, 7 Aug 2012 08:51:28 -0700 (PDT) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 0 +X-Spam-Level: +X-Spam-Status: No, score=0 tagged_above=-999 required=5 tests=[none] + 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 aYFT2P7iTJHi for ; + Tue, 7 Aug 2012 08:51:28 -0700 (PDT) +Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) + by olra.theworths.org (Postfix) with ESMTP id DD6C6431FAF + for ; Tue, 7 Aug 2012 08:51:27 -0700 (PDT) +Received: by guru.guru-group.fi (Postfix, from userid 501) + id E56831002A4; Tue, 7 Aug 2012 18:51:37 +0300 (EEST) +From: Tomi Ollila +To: Mark Walters , + Michal Nazarewicz , notmuch@notmuchmail.org +Subject: Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option +In-Reply-To: <874noepwez.fsf@qmul.ac.uk> +References: + <7c2931eb4d34ff78e4c73d721bc00dc60d185e6a.1344260116.git.mina86@mina86.com> + <874noepwez.fsf@qmul.ac.uk> +User-Agent: Notmuch/0.13.2+128~g07453d8 (http://notmuchmail.org) Emacs/23.1.1 + (x86_64-redhat-linux-gnu) +X-Face: HhBM'cA~ +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: Tue, 07 Aug 2012 15:51:28 -0000 + +On Tue, Aug 07 2012, Mark Walters wrote: + +> On Mon, 06 Aug 2012, Michal Nazarewicz wrote: +>> From: Michal Nazarewicz +>> +>> Setting `notmuch-show-auto-mark-read' to nil stops notmuch-show from marking +>> the message as read (by removing the unread tag). Inteded for people who +>> like to mark messages read explicitly. +>> --- +>> emacs/notmuch-show.el | 16 +++++++++++++--- +>> 1 files changed, 13 insertions(+), 3 deletions(-) +>> +>> diff --git a/emacs/notmuch-show.el b/emacs/notmuch-show.el +>> index d318430..85a17b1 100644 +>> --- a/emacs/notmuch-show.el +>> +++ b/emacs/notmuch-show.el +>> @@ -183,6 +183,14 @@ provided with an MLA argument nor `completing-read' input." +>> notmuch-show-stash-mlarchive-link-alist)) +>> :group 'notmuch-show) +>> +>> +(defcustom notmuch-show-auto-mark-read t +>> + "Whether to automatically mark message as read when it is shown. If +>> +nil, message needs to be marked as read manually for instance by +>> +removing the unread tag." +>> + :type 'boolean +>> + :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 +>> @@ -1374,9 +1382,11 @@ current thread." +>> "Are the headers of the current message visible?" +>> (notmuch-show-get-prop :headers-visible)) +>> +>> -(defun notmuch-show-mark-read () +>> - "Mark the current message as read." +>> - (notmuch-show-tag-message "-unread")) +>> +(defun notmuch-show-mark-read (&optional force) +>> + "Mark the current message as read if FORCE or +>> +`notmuch-show-auto-mark-read' is non-nil." +>> + (when (or force notmuch-show-auto-mark-read) +>> + (notmuch-show-tag-message "-unread"))) +> +> +> As an alternative approach would allowing a list of tags (or even tag +> changes) to apply when a message is "read" do what you want and be more +> flexible? + +That's a great idea -- better than mine (just a variable which informs +which tag is to be removed) .. something like: + +(defcustom notmuch-message-read-tag-changes '("-unread") "docstring" ...) + +Then one can have e.g. + +'() -- for no tag changes +'("-inbox" "-unread" "+read") +'("-postilaatikko" "-lukematon" "+luettu") -- the above in finnish. + + +Tomi + + +> I am thinking of something roughly analogous to +> notmuch-message-replied-tags. I can imagine some people would like to +> remove the inbox tag automatically for example. (And since we sync with +> maildir flags the exact tag name does matter). +> +> I agree with Austin that the current unread marking is a little +> weird/unpredictable (eg notmuch-show-next-message marks a message read +> even if it is closed) but I don't think fixing that helps your use. + + +> +> Best wishes +> +> Mark +> +> +> _______________________________________________ +> notmuch mailing list +> notmuch@notmuchmail.org +> http://notmuchmail.org/mailman/listinfo/notmuch -- 2.26.2