From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 4BCGKbHL+mBvbAEAgWs5BA (envelope-from ) for ; Fri, 23 Jul 2021 16:01:21 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id AIMbJbHL+mDXbwAAbx9fmQ (envelope-from ) for ; Fri, 23 Jul 2021 14:01:21 +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 DB797B915 for ; Fri, 23 Jul 2021 16:01:20 +0200 (CEST) Received: from nmbug.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 1990A27185; Fri, 23 Jul 2021 10:01:15 -0400 (EDT) Received: from mail.hostpark.net (mail.hostpark.net [212.243.197.30]) by mail.notmuchmail.org (Postfix) with ESMTPS id C48D626C01 for ; Fri, 23 Jul 2021 10:01:11 -0400 (EDT) Received: from localhost (localhost [127.0.0.1]) by mail.hostpark.net (Postfix) with ESMTP id 013AC1647F; Fri, 23 Jul 2021 16:01:09 +0200 (CEST) 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=1627048866; bh=86TWGOG/0A5to2LYKK6VuerX 08VOWi43q4FdcnPOXwc=; b=Wu7HcJMn5ScAso9FwPkYN3S9ApCslZmZMtXxUI/v lQjYPQL625/SgmHrR7VwPQExO3o9r/MxfBBKMpwEuAVtAB+E8PrBlX1KMWNr7ZDp nK/LXwhsQRiJBLcpCPmcXXyduQALEirwdT0mS0QtnwJY0XFjwXiPXGrkPcXAQbyS DdQ= X-Virus-Scanned: by Hostpark/NetZone Mailprotection at hostpark.net Received: from mail.hostpark.net ([127.0.0.1]) by localhost (mail1.hostpark.net [127.0.0.1]) (amavisd-new, port 10224) with ESMTP id LGDM9wt0cNzV; Fri, 23 Jul 2021 16:01:06 +0200 (CEST) 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 BF24816400; Fri, 23 Jul 2021 16:01:06 +0200 (CEST) From: Jonas Bernoulli To: David Bremner , Tomi Ollila , notmuch@notmuchmail.org Subject: Re: [PATCH] emacs: notmuch-tree: mark the initial message at point as read In-Reply-To: <87r1ft27ur.fsf@tethera.net> References: <20210216000138.19625-1-jonas@bernoul.li> <87im6euzwh.fsf@bernoul.li> <87ft1iuzeh.fsf@bernoul.li> <87tumcimhy.fsf@tethera.net> <87a6mi5zhg.fsf@bernoul.li> <87r1ft27ur.fsf@tethera.net> Date: Fri, 23 Jul 2021 16:01:04 +0200 Message-ID: <87fsw5i0yn.fsf@bernoul.li> MIME-Version: 1.0 Message-ID-Hash: PCAOLIHMFHI7TMPWR42KVOV6WXI3PCDJ X-Message-ID-Hash: PCAOLIHMFHI7TMPWR42KVOV6WXI3PCDJ 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=1627048881; 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=6GTEU1adTFMEO4Oe+Kri7QDSIzpvjjYmFR+NGxo9MPU=; b=PGXrtCAf1l9XEV4H7Tw6aQUDyKoel16EabGQxTMwhCvd4UMlpRvV0Dybks13oiSHxGBXuv 2i/R/QAMG0CJkxTtLXPXQT4cIjNvG1fYLcaGF3Q1EFzSoOvuwcbplKL9CpscithGcjK6Ts YVeK1zPd65f/IkYnrZddc40cwRSGcvXvWshWpoWEUg8fTcexy6XImwM/yFM13pFv5k86IK unMR67OmHTqthYyhx7L7Qp3XXB7SY2wvsiez+G/sOk0U237daqNrlOwHVl7m7N6X09kle9 pUFcXVT9MlDpDW4BQszzNmBHvuChGEgkqzp0FlL0tMPVa1fEUJxDZW/n0nXaDw== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1627048881; a=rsa-sha256; cv=none; b=K5Rd/IOh+mNnWF69rUrwnj0Cdl9/ebxo0hNGYH9Vc9v/JA7lqtbu5PDvpaBNuXRA0W0C6S ZSeD3RTW41+3ktMiWz9YXDYdlwrX9Z8W3ppyafQiQ8ntJT7xqMgy0361R41oSKvjUZHccV OlmTc+O1L5ezetPDWhlg8u5KZtb6/sQqksrx7ly0g57600LGnW9Sf+e4VtxrtvEQT6nQj7 AL27iDu26UPk1aOd28zebFD9roiGNzyx9QT57PKqQna8YQPsCrKOiJ7Fl037U3BRbXl5Mu n7sF4KT07NQNbC0d2RGXqkc3cPXm8FpWxZZ9xpgDGpea4fpFu+eQ8PE+QEwqlA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=bernoul.li header.s=sel2011a header.b=Wu7HcJMn; 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: 1.13 Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=bernoul.li header.s=sel2011a header.b=Wu7HcJMn; 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: DB797B915 X-Spam-Score: 1.13 X-Migadu-Scanner: scn0.migadu.com X-TUID: W18LJO8xp0wA David Bremner writes: > Jonas Bernoulli writes: > >> >> Please merge the proposed fix; IMO it is sound. My follow-up, the reply >> to Tomi, seems quite confused though. But just because we are uncertain >> whether there is further room for improvement, that shouldn't keep us >> from fixing the bug. Maybe in the future we can improve upon this fix >> but I probably won't investigate any time soon. >> >> Jonas > > Apologies, I should have experimented / asked before. I can't seem to > duplicate the problem being fixed here. Is it non-deterministic, or > should I expect it to always happen? If the latter, can you give me a > further hint / instructions how to reproduce? For me, whether in > tree-mode or search-mode, if I hit return the message at point is marked > unread. > > d I can always reproduce it: 1. Perform a search. 2. Visit the tree for a thread that you have previously not seen using notmuch-tree-from-search-thread. The default binding for that command is M-RET. You mentioned that you pressed RET so maybe that's why you couldn't reproduce (i.e. you invoked notmuch-search-show-thread, which doesn't have this issue). 3. Press n (notmuch-tree-next-message) a few times until you reach the last message in the tree. Do NOT press p (notmuch-tree-prev-message) to move back to the first message. 4. All messages should now be shown as "going to be marked as read". In my case that is visualized by the word "unread" being striked out. This DOES include the first message, but in this case it's not true. 5. Press q (notmuch-tree-quit) twice to return to the search view. 6. Press g (notmuch-refresh-this-buffer). You would expect that to cause the thread at point to be marked read, but it is not. 7. Visit the tree for the same thread again using notmuch-tree-from-search-thread. The second and subsequent messages are in the read state, the word "unread" is completely absent. The first message however is shown as being in the "going to be marked as read", i.e. the word "unread" is shown and struck out. The work around for this is to press RET (notmuch-tree-show-message) at this point. The word "unread" is still struck out, but if you exit now (using q twice), then this change is actually applied. Note that notmuch-search-show-thread does NOT behave as described for notmuch-tree-from-search-thread above. Applying my patch causes the former to behave like the latter. Jonas