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 D0438431FAF for ; Mon, 6 Aug 2012 09:28:47 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at olra.theworths.org X-Spam-Flag: NO X-Spam-Score: -0.7 X-Spam-Level: X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5 tests=[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 jUD3FjhEroXj for ; Mon, 6 Aug 2012 09:28:47 -0700 (PDT) Received: from dmz-mailsec-scanner-1.mit.edu (DMZ-MAILSEC-SCANNER-1.MIT.EDU [18.9.25.12]) by olra.theworths.org (Postfix) with ESMTP id 2768B431FAE for ; Mon, 6 Aug 2012 09:28:47 -0700 (PDT) X-AuditID: 1209190c-b7f806d000006b87-84-501ff0becde6 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36]) by dmz-mailsec-scanner-1.mit.edu (Symantec Messaging Gateway) with SMTP id 8F.69.27527.EB0FF105; Mon, 6 Aug 2012 12:28:46 -0400 (EDT) Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103]) by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q76GSj3B020344; Mon, 6 Aug 2012 12:28:46 -0400 Received: from awakening.csail.mit.edu (awakening.csail.mit.edu [18.26.4.91]) (authenticated bits=0) (User authenticated as amdragon@ATHENA.MIT.EDU) by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q76GSiC5015768 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT); Mon, 6 Aug 2012 12:28:45 -0400 (EDT) Received: from amthrax by awakening.csail.mit.edu with local (Exim 4.77) (envelope-from ) id 1SyQAe-00031q-1f; Mon, 06 Aug 2012 12:28:44 -0400 Date: Mon, 6 Aug 2012 12:28:44 -0400 From: Austin Clements To: Michal Nazarewicz Subject: Re: [PATCH] notmuch-show: add notmuch-show-auto-mark-read option Message-ID: <20120806162843.GJ22601@mit.edu> References: <7c2931eb4d34ff78e4c73d721bc00dc60d185e6a.1344260116.git.mina86@mina86.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7c2931eb4d34ff78e4c73d721bc00dc60d185e6a.1344260116.git.mina86@mina86.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFmpileLIzCtJLcpLzFFi42IRYrdT0d33QT7AoPOBusWr733sFtdvzmR2 YPJYsKnU49mqW8wBTFFcNimpOZllqUX6dglcGc3HVrIU7OGvmPPiAmsD4zGeLkZODgkBE4nP 39rYIWwxiQv31rN1MXJxCAnsY5TYM/EvI4SznlHi+935rBDOCSaJX9OPMUE4Sxgldj/oZALp ZxFQkVhybh0ziM0moCGxbf9yRhBbREBN4uKfx2A1zALSEt9+N4PZwgKeEv/m/AOaysHBK6Aj cWG9OkhYSCBc4n/nIjYQm1dAUOLkzCcsEK1aEjf+vWQCKQcZs/wfB0iYUyBCYtu8v2AfiAJd MOXkNrYJjEKzkHTPQtI9C6F7ASPzKkbZlNwq3dzEzJzi1GTd4uTEvLzUIl1DvdzMEr3UlNJN jKCg5pTk2cH45qDSIUYBDkYlHt5bBvIBQqyJZcWVuYcYJTmYlER5Y98BhfiS8lMqMxKLM+KL SnNSiw8xSnAwK4nw1iwEyvGmJFZWpRblw6SkOViUxHkvp9z0FxJITyxJzU5NLUgtgsnKcHAo SfA+eQ/UKFiUmp5akZaZU4KQZuLgBBnOAzT8CEgNb3FBYm5xZjpE/hSjopQ4rzAwbQgJgCQy SvPgemFJ5xWjONArwryLQdp5gAkLrvsV0GAmoMHe8nIgg0sSEVJSDYzSOWcLnm/ws4v/O5Hb 7XtgzUp1oerfc5yz/hWe8c7dZSO6vivqzduUn4sWSDEHHivcunfvvanXmcuunVBOO3Tqw+39 RRfOHonndbbguC7zSMtz/9Xdh7odrPedvffw6oH9GnNl7hW0f++yd1kU/cBq3nqf1i9Tm/4J tesKuolIJ07oFTqjF1GjxFKckWioxVxUnAgAvJG5shUDAAA= Cc: notmuch@notmuchmail.org 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: Mon, 06 Aug 2012 16:28:47 -0000 LGTM, though I wonder: Is this actually what you want, or would you be happy with automatic read marking if it followed a different pattern (perhaps a more predictable pattern)? Quoth Michal Nazarewicz on Aug 06 at 4:20 pm: > 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"))) > > ;; Functions for getting attributes of several messages in the current > ;; thread.