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 36C4D431FC0 for ; Tue, 7 Aug 2012 09:38:50 -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 bIhelswUOMw9 for ; Tue, 7 Aug 2012 09:38:49 -0700 (PDT) Received: from guru.guru-group.fi (guru.guru-group.fi [46.183.73.34]) by olra.theworths.org (Postfix) with ESMTP id 79A36431FAF for ; Tue, 7 Aug 2012 09:38:49 -0700 (PDT) Received: by guru.guru-group.fi (Postfix, from userid 501) id 782F11002A4; Tue, 7 Aug 2012 19:38:59 +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: <87mx26bt2z.fsf@qmul.ac.uk> References: <7c2931eb4d34ff78e4c73d721bc00dc60d185e6a.1344260116.git.mina86@mina86.com> <874noepwez.fsf@qmul.ac.uk> <87mx26bt2z.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=utf-8 Content-Transfer-Encoding: quoted-printable 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 16:38:50 -0000 On Tue, Aug 07 2012, Mark Walters wrote: > On Tue, 07 Aug 2012, Michal Nazarewicz wrote: [ ... ] >> Mark Walters writes: >>> 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? >> >> Something like the following (not tested)? > > Yes this was what I had in mind. I like this (both the symmetry with > reply tags and the added flexibility) but I will let others > comment. (There is one small bug in your draft: see below) I like the idea -- and the draft! > > Best wishes > > Mark Tomi > >> From: Michal Nazarewicz >> Date: Mon, 6 Aug 2012 15:31:20 +0200 >> Subject: [PATCH] notmuch-show: add notmuch-show-mark-read-tags option >> >> 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 rem= ove >> 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). >> --- >> 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 dcfc190..92a4beb 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) >>=20=20 >> +(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)) >>=20=20 >> (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))) > > This needs to be (apply 'notmuch-show-tag-message ...) >>=20=20 >> ;; Functions for getting attributes of several messages in the current >> ;; thread. >> >> --=20 >> Best regards, _ _ >> .o. | Liege of Serenely Enlightened Majesty of o' \,=3D./ `o >> ..o | Computer Science, Micha=C5=82 =E2=80=9Cmina86=E2=80=9D Nazarewicz= (o o) >> ooo +------------------ooO--(_)--Ooo-- > _______________________________________________ > notmuch mailing list > notmuch@notmuchmail.org > http://notmuchmail.org/mailman/listinfo/notmuch