From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id iDjAGhAOOGA8TgAA0tVLHw (envelope-from ) for ; Thu, 25 Feb 2021 20:52:32 +0000 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AHWhFhAOOGDwVAAA1q6Kng (envelope-from ) for ; Thu, 25 Feb 2021 20:52:32 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [144.217.243.247]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 8481E2E247 for ; Thu, 25 Feb 2021 21:52:31 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id F142426BE0; Thu, 25 Feb 2021 15:52:27 -0500 (EST) Received: from lahtoruutu.iki.fi (lahtoruutu.iki.fi [185.185.170.37]) by mail.notmuchmail.org (Postfix) with ESMTPS id 0AB3F26AD0 for ; Thu, 25 Feb 2021 15:52:26 -0500 (EST) Received: from guru.guru-group.fi (unknown [IPv6:2a02:2380:1:9:5054:ff:feb7:a4bc]) (using TLSv1.2 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) (Authenticated sender: too) by lahtoruutu.iki.fi (Postfix) with ESMTPSA id 8C2AC1B00257; Thu, 25 Feb 2021 22:52:23 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1614286343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HRRJVJjcWzTIyPcX4MXxJ3f2sHmq9VJe5J1LtsbQCak=; b=TUq17YKmxDDgaSfCiQyP4WF1qN9eyFBxTOKHqGnWJEqjwE2cntVEl0IqZC4alMoXCsGXpS piC3k5b92L6+U3P5Eqvkclmc40m66Cg5nzXUkRNwza0xeEPp4m1wgigGq+pt4wUKF78aUk wN2oc5AAA+Gv0VWre1vwL+C8aTQ7Ri86i3ap2W3093ODjXigbgzpYk+sLKramfBE/43lg0 +e/6KSPuI2TjZEY0de0Mzm6mdrVnAMmS9HAwdrR1ND7PxnCJT70JivMMDmyyE7Ac4MnZTT TTqdRemfOFRkbSbYk4MXKfPjKHrV9TBLHOyBPeP6j7HynQHbog7OMLp82GRSZQ== From: Tomi Ollila To: Jonas Bernoulli , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read In-Reply-To: <20210216000138.19625-1-jonas@bernoul.li> References: <20210216000138.19625-1-jonas@bernoul.li> User-Agent: Notmuch/0.31.4+128~gc67b63a (https://notmuchmail.org) Emacs/27.1 X-Face: HhBM'cA~ MIME-Version: 1.0 ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=too smtp.mailfrom=tomi.ollila@iki.fi ARC-Seal: i=1; s=lahtoruutu; d=iki.fi; t=1614286343; a=rsa-sha256; cv=none; b=rGzTe7DPfxYSPbayxLWwU7oYhj+jJuznAI4ggqO9OcZFpcpkhJDghsATuez9Mgd98lljLX l6md1mhg8eXxS3V9AjSGEYHbUFYgYFF/XK+mJ2SYeYGl++WR+M9DsNN4BoHKKfN129Rgpi jPQ3wposII6PxWUGeSzkutBBGMlEAN84YP6EAAUg1AV6XCkvKK54y65DeB9CedTpjNwkyu T0BmPSukqObrQj4lFAaty3VRzAsIG+L+g3eT7e3lNWrtOnr5c+PbfD7b0sm3l0dMuU045I Mu3i2RLd2YGXLiI+1ElTAATwEP2Lyv2zS81GZlviQ0sGWrw0esi13dZhqhtDCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=lahtoruutu; t=1614286343; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HRRJVJjcWzTIyPcX4MXxJ3f2sHmq9VJe5J1LtsbQCak=; b=E76SCnqaNtiolpK8O2nEKofZbct2lEHnrgehWUjPHqsFyDrEGmB6CbtVfAma1+560NFYma 2JGtIbpu9cVOJ2yFoLPmauoevqgJS09/8pGLW8N8qxWo3SqC50bn+djEBypTrkWP55QhBW vBmG43C0NUdFCVuhddGM+jXl3G6qFGRY6Yc7TTBS6MH+cLp8s4I4xg+SGMP8TsboLvkCLT iOfev1BToiXxciNAIz1eYPUyWxtKEGKDtilj7hLmS0lOvUjPDHk1X0y8BpnVXDfk+PuX17 EW+BhFdIQZEpyIpFWrcEOEdFATWUO5D/lDJ2UDB1Yscu9hKrXw/WItB6zehQCw== Message-ID-Hash: FA3AB7O4LKI2KRZ6QOBXAKR3CXRGCFWH X-Message-ID-Hash: FA3AB7O4LKI2KRZ6QOBXAKR3CXRGCFWH X-MailFrom: tomi.ollila@iki.fi X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-notmuch.notmuchmail.org-0; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; suspicious-header X-Mailman-Version: 3.2.1 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: 2.56 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=iki.fi header.s=lahtoruutu header.b=TUq17YKm; arc=reject ("signature check failed: fail, {[1] = sig:iki.fi:reject}"); dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 144.217.243.247 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: 8481E2E247 X-Spam-Score: 2.56 X-Migadu-Scanner: scn0.migadu.com X-TUID: Vd7w2z2FspxO On Tue, Feb 16 2021, Jonas Bernoulli wrote: > When moving between message in a tree or show buffer, the message at > point is marked as read. Likewise when creating such a buffer, then > the message that is initially at point is supposed to be marked as > read as well. > > The latter worked for `notmuch-show' but not for `notmuch-tree'. > Press "RET" or "M-RET" in a search buffer to observe these behaviors. > > In both cases the marking is supposed to be done by the function > `notmuch-show-command-hook'. In the case of `notmuch-show' that > function is added directly to `post-command-hook'. > > `notmuch-tree' instead adds the function `notmuch-tree-command-hook' > to `post-command-hook' and that calls `notmuch-show-command-hook', > in the respective show buffer, but of course only if that exists. > > Because the tree buffer is created asynchronously, the show buffer > doesn't exist yet by the time the `post-command-hook' is run, so > we have to explicitly run `notmuch-tree-command-hook' once the > show buffer exists. > > The show buffer is created when `notmuch-tree-goto-and-insert-msg' > calls `notmuch-tree-show-message-in'. `notmuch-tree-process-filter' > is what finally brings us here. Long message, small change (which is good). I try to understand whether adding notmuch-tree-command-hook to post-command-hook in notmuch-tree.el (not in this change) actually have any effect. Tomi > --- > emacs/notmuch-tree.el | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/emacs/notmuch-tree.el b/emacs/notmuch-tree.el > index 13007a13..d9265fd5 100644 > --- a/emacs/notmuch-tree.el > +++ b/emacs/notmuch-tree.el > @@ -949,7 +949,8 @@ (defun notmuch-tree-goto-and-insert-msg (msg) > (goto-char (point-max)) > (forward-line -1) > (when notmuch-tree-open-target > - (notmuch-tree-show-message-in))))) > + (notmuch-tree-show-message-in) > + (notmuch-tree-command-hook))))) > > (defun notmuch-tree-insert-tree (tree depth tree-status first last) > "Insert the message tree TREE at depth DEPTH in the current thread. > -- > 2.30.1 > _______________________________________________ > notmuch mailing list -- notmuch@notmuchmail.org > To unsubscribe send an email to notmuch-leave@notmuchmail.org