[PATCH] emacs: tree: mark read change
authorMark Walters <markwalters1009@gmail.com>
Tue, 9 Jun 2015 09:51:07 +0000 (10:51 +0100)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 21:49:00 +0000 (14:49 -0700)
da/862c97660e661694715aa045b256bb3b98034a [new file with mode: 0644]

diff --git a/da/862c97660e661694715aa045b256bb3b98034a b/da/862c97660e661694715aa045b256bb3b98034a
new file mode 100644 (file)
index 0000000..130cfc4
--- /dev/null
@@ -0,0 +1,109 @@
+Return-Path: <markwalters1009@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 1366D6DE020B\r
+ for <notmuch@notmuchmail.org>; Tue,  9 Jun 2015 02:51:21 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: 0.52\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=0.52 tagged_above=-999 required=5 tests=[AWL=1.090,\r
+ DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+ FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001,\r
+ RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01,\r
+ RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id qXA9FLGlvQAZ for <notmuch@notmuchmail.org>;\r
+ Tue,  9 Jun 2015 02:51:19 -0700 (PDT)\r
+Received: from mail-wg0-f54.google.com (mail-wg0-f54.google.com\r
+ [74.125.82.54]) by arlo.cworth.org (Postfix) with ESMTPS id 150966DE0159 for\r
+ <notmuch@notmuchmail.org>; Tue,  9 Jun 2015 02:51:19 -0700 (PDT)\r
+Received: by wgbgq6 with SMTP id gq6so8729896wgb.3\r
+ for <notmuch@notmuchmail.org>; Tue, 09 Jun 2015 02:51:16 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+ h=from:to:cc:subject:date:message-id;\r
+ bh=ojzKQWo/yc/XsnnYo60d6LOEQihVQNCl7dEkTyPtcX0=;\r
+ b=mrkmbV9t+HT796Dc5FxdeLnN1MBFsJALNMLg7ri91fhGbpIUQ+a0N0XrKFnA9VhUTk\r
+ RLGKEzjT4JTvdf1bedvx6yioen6QCMDJJ2SuOBj6q59q9jAM7y2X2cAo74CmYonV24RZ\r
+ u+FYgxNLbhxzSwhuasEbmc1/6mXtcrlQrR+3CCyIF12nZ0O3bLeLBUdYypulugmogS7q\r
+ f2ztK4zosJd6zd10dog1/NqNVYJiTbbonapdN6jPHP/jE0niXBnPT/hwEyz70Z1Ish+s\r
+ qekZNAdB4zIWbjjxYQslTN6xIOxNKZ8WE5rM6mYnKks5dCA796EjvqSOwTM9skW5wu/9\r
+ 1wLA==\r
+X-Received: by 10.194.206.65 with SMTP id lm1mr40923092wjc.117.1433843475984; \r
+ Tue, 09 Jun 2015 02:51:15 -0700 (PDT)\r
+Received: from localhost (5751dfa2.skybroadband.com. [87.81.223.162])\r
+ by mx.google.com with ESMTPSA id a19sm1968853wiv.2.2015.06.09.02.51.15\r
+ (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);\r
+ Tue, 09 Jun 2015 02:51:15 -0700 (PDT)\r
+From: Mark Walters <markwalters1009@gmail.com>\r
+To: notmuch@notmuchmail.org\r
+Subject: [PATCH] emacs: tree: mark read change\r
+Date: Tue,  9 Jun 2015 10:51:07 +0100\r
+Message-Id: <1433843467-32398-1-git-send-email-markwalters1009@gmail.com>\r
+X-Mailer: git-send-email 2.1.4\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.18\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 09 Jun 2015 09:51:21 -0000\r
+\r
+The mark read code for tree mode did not get updated in the recent\r
+changes. This updates it to match. Since the user can customize the\r
+mark read logic we just call the show logic in the message pane.\r
+---\r
+\r
+An alternative would be to mark any message explicitly viewed in\r
+tree-mode as read. That would be simpler but I think this is better as\r
+it deals with user customized mark read functions -- for example if\r
+the user has a customized function that only marks a message read if\r
+the whole message is viewed then this version will do the same in tree\r
+mode.\r
+\r
+Best wishes\r
+\r
+Mark\r
+\r
+\r
+\r
+emacs/notmuch-tree.el | 8 ++++++++\r
+ 1 file changed, 8 insertions(+)\r
+\r
+diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el\r
+index 8b6cd51..182235e 100644\r
+--- a/emacs/notmuch-tree.el\r
++++ b/emacs/notmuch-tree.el\r
+@@ -413,6 +413,13 @@ (defun notmuch-tree-message-window-kill-hook ()\r
+       (ignore-errors\r
+       (delete-window notmuch-tree-message-window)))))\r
\r
++(defun notmuch-tree-command-hook ()\r
++  (when (eq major-mode 'notmuch-tree-mode)\r
++    ;; We just run the notmuch-show-command-hook on the message pane.\r
++    (when (buffer-live-p notmuch-tree-message-buffer)\r
++      (with-current-buffer notmuch-tree-message-buffer\r
++      (notmuch-show-command-hook)))))\r
++\r
+ (defun notmuch-tree-show-message-in ()\r
+   "Show the current message (in split-pane)."\r
+   (interactive)\r
+@@ -855,6 +862,7 @@ (defun notmuch-tree-worker (basic-query &optional query-context target open-targ\r
+ the same as for the function notmuch-tree."\r
+   (interactive)\r
+   (notmuch-tree-mode)\r
++  (add-hook 'post-command-hook #'notmuch-tree-command-hook t t)\r
+   (setq notmuch-tree-basic-query basic-query)\r
+   (setq notmuch-tree-query-context query-context)\r
+   (setq notmuch-tree-target-msg target)\r
+-- \r
+2.1.4\r
+\r