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