From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id CArUMtaPOWAJZQAA0tVLHw (envelope-from ) for ; Sat, 27 Feb 2021 00:18:30 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id WFjBLtaPOWC+ewAA1q6Kng (envelope-from ) for ; Sat, 27 Feb 2021 00:18:30 +0000 Received: from mail.notmuchmail.org (nmbug.tethera.net [IPv6:2607:5300:201:3100::1657]) (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 BC04A13BC0 for ; Sat, 27 Feb 2021 01:18:29 +0100 (CET) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 425C026AD8; Fri, 26 Feb 2021 19:18:17 -0500 (EST) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id 2FE5126ACE for ; Fri, 26 Feb 2021 19:18:13 -0500 (EST) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 72F18165BD; Sat, 27 Feb 2021 01:18:10 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=bernoul.li; h= content-type:content-type:mime-version:message-id:date:date :references:in-reply-to:subject:subject:from:from:received :received; s=sel2011a; t=1614385088; bh=a9dyhuLkJsA0cdwLP0VYQpCX ip1jdL5LxNdkHDsqXGw=; b=bjUcnvPXc7qPAGBI30020lc0+I03gtXaoyKfVcWg Zn9s4o6E2aCwJAMNdD+aAXy15oD1xHyWnnIO7gwg/4v/KUbJNfuNSCaFH4Vz5HNc qwvFEEcoGlIm6l7TypeAfPdeWjZAeAC1S2zsAuK3/75DSJSo0aHqUP8Z2q/wXKFS UX0= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail0.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id vWT0PtkrjwFs; Sat, 27 Feb 2021 01:18:08 +0100 (CET) Received: from customer (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.hostpark.net (Postfix) with ESMTPSA id 428F5165C1; Sat, 27 Feb 2021 01:18:08 +0100 (CET) From: Jonas Bernoulli To: Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read In-Reply-To: References: <20210216000138.19625-1-jonas@bernoul.li> Date: Sat, 27 Feb 2021 01:18:06 +0100 Message-ID: <87im6euzwh.fsf@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: EE34XC6A53MYTZTUX6FPBYGWBOQYZ5XM X-Message-ID-Hash: EE34XC6A53MYTZTUX6FPBYGWBOQYZ5XM X-MailFrom: jonas@bernoul.li 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 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1614385110; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=6M+R7xFqcm3bL7AxqFtuUhdyupBNcXMzWGkAlOskS6A=; b=qZ53sfPLjbTP6H3/UpFKzLwGpEiwU+atScybMUPBeyWfjybzHh7A8N/2DLPvq9PpS6/wVZ n1ieA/kgXjcuaL4BXMJ0kwzgYNuGWPNBPStD22Cq4r3w62KBz/a2RrPaXBKssDUD9wv0M/ YRx8+79CmjoPBXJvzSim8BcmgAJXPGDXgPWilRv+80rRz2KGSCFvoz0owSX2732wcj031z 7W8kypDReNyRU/M8acLVwpfTIe6jByzxcqSk6f4MrN1ntH/dZrPXYd10reSg9gBwq5n8K4 cAtCFLTQskqkItr4yZ3FGZjOM1yrekAzxGZn22s75GyL+9nPn4HyjmaVoTVyxA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1614385110; a=rsa-sha256; cv=none; b=eAJTC0mmxuFxGmMgCPz1fzc0JLDgDf2EiVkwTwWWwHzvo7DBT69IeonMsEoSPYKd9U+rgG NU4NLb0vNCgdc/Gf445LL6y3NLh/25f76yViCrYLGKDDfO8HqhNizST2IOUBYGg8JKij2T ufHrTQDbp4OPW0Xsyz0Lo+tL/iOshz9omk6BkVQIqyUPrG7/Tj3rnmwxW/IuNsUSHNW4/2 6jC8Ve4Wiu83nZ+Ex6syM515lHlPgKHxahogv/sx2L1G7tWWbaIy5g3brFf9GI08/KiJff yI9HAS/9i2w/T2NXD+xdkP6dx+XwlaAUaZRjODTG090V5kE+0tu5KI93j6pJpg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=bernoul.li header.s=sel2011a header.b=bjUcnvPX; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Spam-Score: -0.90 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=bernoul.li header.s=sel2011a header.b=bjUcnvPX; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2607:5300:201:3100::1657 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org X-Migadu-Queue-Id: BC04A13BC0 X-Spam-Score: -0.90 X-Migadu-Scanner: scn0.migadu.com X-TUID: bLtw9rYrSVdj > 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. You're right, that's unnecessary, and it gets worse. `notmuch-tree-command-hook' is unnecessary too and if it weren't, then it would fail because its added to the buffer-local value of `post-command-hook', but that buffer is not the current buffer when the hook is run. Using `post-command-hook' in any form for this is questionable in the first place. The idiomatic approach would be to use the `point-entered' text property hook. Or `notmuch-tree-{previous,next}-message' could just do the marking explicitly. It's also not okay that `notmuch-tree-show-message-in' keeps recreating the window. `notmuch-show-command-hook' forces redisplay to update values that pass along, but don't and shouldn't use. There is more than one function to mark a message as read and they don't all end up doing the same thing. What effectively does the marking is (defun notmuch-tree-show-message-in () ... (when notmuch-show-mark-read-tags (notmuch-tree-tag-update-display notmuch-show-mark-read-tags)) ...) I am going to refactor this mess, but that will take a while. Jonas