From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms13.migadu.com with LMTPS id WOAcI5eutGaxCAEA62LTzQ:P1 (envelope-from ) for ; Thu, 08 Aug 2024 11:40:07 +0000 Received: from aspmx1.migadu.com ([2001:41d0:403:58f0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1.migadu.com with LMTPS id WOAcI5eutGaxCAEA62LTzQ (envelope-from ) for ; Thu, 08 Aug 2024 13:40:07 +0200 X-Envelope-To: larch@yhetil.org Authentication-Results: aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=J1ClKM1R; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1723117206; 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-owner:list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=fb5XEbDYRG+1qzITqamVTkJimEni5bvaLElhCwGBorc=; b=e9LIcaB3HYtf2qEGYlsSSSQAMrEawro9wiF3Ib1IGZqcj63vjnnKTU4N9do82N9EfdaX8n HaGrSFtp35mircDk05NylrxbFNz75bDCy+gD40DbX5vME5kydLGbmasQgTvdmA97TxmIQp ptEcADsb3o4/+M8Y693VLl9L3mIGYFZOSaUKDjmf/rd9FozFBmTDXn72t5kVpvGugGhYrS s9snX3bJ+iehxTnOqffw2R4C6yGs8BpcxA2/w7Ox4s1e6mSB/wNxYrMQrihVuG6uH3w89/ Zv87xbN4JjUdUKHbTP0AvlCxTb3JEOjZWfTeHZuHtlUQG/DStrrPrR3S9uLjDg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1723117206; a=rsa-sha256; cv=none; b=OaXlD5928oVNF7O7AbwmFIPKWQx7B2DPHYToKwvI6H/GqaeATZJtIpUhbXFgHykunHT4im jXdGlm5H6ys+KvsVov46SuTmLL0YwM9UrQCdDP3/87oEyqalcOhoKZB2qtpDk8BI+s8hwj qPDeW4Jnur6SD0P3IZ34TelN7EAlUao3nS//TtOeW8muqMgpvDDSwXztmyKPX7wtHoKIv8 /SPam/Dg8PonRlcxuRMU+T/JVbcGY66jZI+3lWVvXG2CkARHjxYmfG/Sebop7jZ93T1Ik+ AlkELJGgcLAJ5saBHo/4Ke/77KtHkvIa6+LhbYx8Q8dDbnDUjAbZK/0EwdoJRQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("body hash did not verify") header.d=tethera.net header.s=2024 header.b=J1ClKM1R; dmarc=none; spf=pass (aspmx1.migadu.com: domain of notmuch-bounces@notmuchmail.org designates 2a01:4f9:c011:7a79::1 as permitted sender) smtp.mailfrom=notmuch-bounces@notmuchmail.org Received: from mail.notmuchmail.org (yantan.tethera.net [IPv6:2a01:4f9:c011:7a79::1]) (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 A587A74ACE for ; Thu, 08 Aug 2024 13:40:06 +0200 (CEST) Received: from yantan.tethera.net (localhost [127.0.0.1]) by mail.notmuchmail.org (Postfix) with ESMTP id 8D1775F810; Thu, 8 Aug 2024 11:39:58 +0000 (UTC) Received: from phubs.tethera.net (phubs.tethera.net [IPv6:2607:5300:60:3a9d::1]) by mail.notmuchmail.org (Postfix) with ESMTPS id 3AA8A5F7B8 for ; Thu, 8 Aug 2024 11:39:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tethera.net; i=@tethera.net; q=dns/txt; s=2024; t=1723117193; h=from : to : subject : in-reply-to : references : date : message-id : mime-version : content-type : from; bh=25mXmg6+AwK6bDOwQY8BP/q3f3ODb1WWHY0lv3dBepk=; b=J1ClKM1RkOFhTrWeoeJBbXcGgZEbt4wQITAuB4IWQBmLW/5Wcy86c5iOm9c6Dg091xiv0 UnvPuNRmjxv0cGQmh0CwNUoIkGYH6R24SS7XMthFrXz9ytWXiZ6dYqEv0kmZfy3HeKtgk97 WQOmTl3g1E5JKOWwKGnrAmgGQLVaWzbutueps1x5CkW7gfeRxxafhTP32wRkl4rCCkzlBa+ hcKLrog/bWYh5GFvzALkUbtszoUifgosX3eFEf43rnrsObuiFM5GAkvpvyvi0G7aZM+dt72 fVzTv5Z5mrN9p32L1D38mbKcIvppLz53PKFsfCVA5loF8t8hvEwr1hCNQdNQ== Received: from tethera.net (fctnnbsc51w-159-2-211-58.dhcp-dynamic.fibreop.nb.bellaliant.net [159.2.211.58]) by phubs.tethera.net (Postfix) with ESMTPS id 04A9418006E; Thu, 8 Aug 2024 08:39:52 -0300 (ADT) Received: (nullmailer pid 1062850 invoked by uid 1000); Thu, 08 Aug 2024 11:39:52 -0000 From: David Bremner To: Justus Winter , notmuch@notmuchmail.org Subject: Re: Selection bug In-Reply-To: <87jzilmbjq.fsf@tethera.net> References: <87fsfuuxwn.fsf@thinkbox> <87edveqpj6.fsf@tethera.net> <874jw9utdg.fsf@thinkbox> <871qraagd9.fsf@tethera.net> <87ilkh782o.fsf@europ.lan> <87r0dbslr6.fsf@tethera.net> <87jzilmbjq.fsf@tethera.net> Date: Thu, 08 Aug 2024 08:39:52 -0300 Message-ID: <87jzgrfdkn.fsf@tethera.net> MIME-Version: 1.0 Message-ID-Hash: N5SRKRUTTMQNKAIY7AFVSI3GTZQMIS7V X-Message-ID-Hash: N5SRKRUTTMQNKAIY7AFVSI3GTZQMIS7V X-MailFrom: david@tethera.net 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; digests; suspicious-header X-Mailman-Version: 3.3.3 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_IN X-Migadu-Country: DE X-Migadu-Spam-Score: 2.15 X-Spam-Score: 2.15 X-Migadu-Queue-Id: A587A74ACE X-Migadu-Scanner: mx11.migadu.com X-TUID: JKD1vXZuT9Qr David Bremner writes: > David Bremner writes: > >> >> This reproduces the problem for me. Indeed it looks a bit like a similar >> "cursor jumping" problem I have seen (and someone else has reported on >> IRC). I will see if I can figure anything more out now that I have a >> reproducer. > > I think the following is a (simpler) reproducer of the same problem. > > 1) Do a search with at least 10 results > > 2) goto line 10 > > 3) hit 'g' > > For me this consistently leaves the point on line 10 but the hl-line bar > on line 1. I have not debugged it yet, but the proximate cause is that > when notmuch-hl-line-mode is called, (point) is 1, so the bar ends up on > the first line. The whys and wherefores I don't know yet. I have been slowly trying to debug this. It is a kind of heisenbug because the position of the hl-line-mode bar is affected by using the debugger (because hl-line-mode uses post-command-hook). My current understanding is 0) the refresh calls notmuch-search to rebuild the buffer contents. 1) hl-line-highlight is being called via notmuch-search-hook 2) notmuch-search-hook is being invoked asynchronously from notmuch-search-process-filter. 3) There is a buffer local variable notmuch--search-hook-run used to make sure this happens only once per call to notmuch-search. 4) Unfortunately when the hook is invoked, (point) is 1, and that is how the hl-line-mode bar ends up on the first line, rather than where the (point) is after the refresh completes. A) one question is why notmuch-search-hook is being run so early. I vaguely remember some discussion / reason for this but I have not dug it up. B) I have some hope this can be fixed by use of the existing variable notmuch-search-target-line, but it's a bit tricky because at the point where the hook is invoked, the buffer does not have that many lines yet.