From: Mark Walters Date: Sat, 14 Dec 2013 23:44:31 +0000 (+0000) Subject: [PATCH 0/5] emacs: show: redesign unread/read logic X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=4a103eee9612efd12023238744b37566349c057d;p=notmuch-archives.git [PATCH 0/5] emacs: show: redesign unread/read logic --- diff --git a/db/533d5a4b17b705ec32ca9baab5fdfa1b2ab04b b/db/533d5a4b17b705ec32ca9baab5fdfa1b2ab04b new file mode 100644 index 000000000..0051b2174 --- /dev/null +++ b/db/533d5a4b17b705ec32ca9baab5fdfa1b2ab04b @@ -0,0 +1,112 @@ +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 5EB45431FD6 + for ; Sat, 14 Dec 2013 15:44:52 -0800 (PST) +X-Virus-Scanned: Debian amavisd-new at olra.theworths.org +X-Spam-Flag: NO +X-Spam-Score: 2.7 +X-Spam-Level: ** +X-Spam-Status: No, score=2.7 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, + FREEMAIL_REPLY=2.499, 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 7UPOVqEsurcX for ; + Sat, 14 Dec 2013 15:44:47 -0800 (PST) +Received: from mail-we0-f170.google.com (mail-we0-f170.google.com + [74.125.82.170]) (using TLSv1 with cipher RC4-SHA (128/128 bits)) + (No client certificate requested) + by olra.theworths.org (Postfix) with ESMTPS id 21A27431FB6 + for ; Sat, 14 Dec 2013 15:44:47 -0800 (PST) +Received: by mail-we0-f170.google.com with SMTP id w61so3293627wes.1 + for ; Sat, 14 Dec 2013 15:44:44 -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; + bh=fG5Ol9SP3vhyJ6mTE0C6oLXA/UhzrCKZxwDw0xnnKEA=; + b=CeTBC6ci2mJXvhYD/TP0kJ3rkUYFMrm+/K6Aentakq8yWS4q3zKZXgtJlHoWqG9C9+ + FGSwGT0+TFFfm5MgIwmXY4dGaW6oZNbM3+eQvZRBswRYKngWgrV8e+ow4Rkbb89jdHdW + VjTmJ4TiRpVQqF8Ab+z3JqUnPGRuT1VpHd98ardPk0KIE/b5TSluZIzQY7O1p762p85k + x9pmbb07EQA0hTTE2I3jIKfeNLRGf+cS2AdsSP1vkg+QHyURKGWdnmNiuTtDWsuRDcHC + w9oiuvWd+V70ZOuEREuxkm2bOE4a5vj0wFYvotGXD22LsehHh7w3YtLOFhVB6fxeruUb + wu0g== +X-Received: by 10.194.222.38 with SMTP id qj6mr1064650wjc.66.1387064684462; + Sat, 14 Dec 2013 15:44:44 -0800 (PST) +Received: from localhost (93-97-24-31.zone5.bethere.co.uk. [93.97.24.31]) + by mx.google.com with ESMTPSA id x19sm11106126wia.5.2013.12.14.15.44.43 + for + (version=TLSv1.2 cipher=RC4-SHA bits=128/128); + Sat, 14 Dec 2013 15:44:43 -0800 (PST) +From: Mark Walters +To: notmuch@notmuchmail.org +Subject: [PATCH 0/5] emacs: show: redesign unread/read logic +Date: Sat, 14 Dec 2013 23:44:31 +0000 +Message-Id: <1387064676-15508-1-git-send-email-markwalters1009@gmail.com> +X-Mailer: git-send-email 1.7.9.1 +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, 14 Dec 2013 23:44:52 -0000 + +This is the first non-WIP version of this series. The previous WIP +version is at +id:1386665847-6439-1-git-send-email-markwalters1009@gmail.com + +The main changes are: all tests now pass, and tree mode is also +done. In fact tree-mode is very easy: since only one message is viewed +in the message pane at a time I think it makes sense to mark it read +immediately. + +The test change is surprisingly small but relatively intrusive. Rather +than wrapping the lisp to be executed in a progn in test_emacs I wrap +it in a handler notmuch-test-progn. The syntax is not the same as +progn so maybe the name is bad: it needs an actual lisp list of +commands as its sole argument. test_emacs is updated to supply the +commands as a lisp list. It executes each command in turn but runs the +post-command-hook after each. Note a block of the form (progn (cmd1) +(cmd2)) is viewed a single command and the post-command-hook would +only run after the progn completes. This allows the caller to avoid +running the post-command-hook when needed. Similarly a (let ....) form +is only viewed as one command; in this case the calle may need to run +the post-command-hook explicitly. + +It is surprising that all tests pass given the fairly substantial +unread/read changes. This might suggest that we need some extra tests. + +Best wishes + +Mark + + + + + + +Mark Walters (5): + emacs: show: make `seen' mean user viewed whole message + emacs: show: add an update seen function to post-command-hook + emacs: show: mark tags changed since buffer loaded + emacs: tree: make the tree code force the mark read update + test: make test_emacs call post-command-hook + + emacs/notmuch-show.el | 123 +++++++++++++++++++++++++++++++++++++++++-------- + emacs/notmuch-tag.el | 105 ++++++++++++++++++++++++++++++------------ + emacs/notmuch-tree.el | 3 + + test/test-lib.el | 16 ++++++ + test/test-lib.sh | 2 +- + 5 files changed, 198 insertions(+), 51 deletions(-) + +-- +1.7.9.1 +