[PATCH 0/5] emacs: show: redesign unread/read logic

Mark Walters markwalters1009 at gmail.com
Sat Dec 14 15:44:31 PST 2013


This is the first non-WIP version of this series. The previous WIP
version is at
id:1386665847-6439-1-git-send-email-markwalters1009 at 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



More information about the notmuch mailing list