From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id s7yFBtqnVmEFsgAAgWs5BA (envelope-from ) for ; Fri, 01 Oct 2021 08:16:58 +0200 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id +CihAdqnVmGgFgAAB5/wlQ (envelope-from ) for ; Fri, 01 Oct 2021 06:16:58 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 663EE129AA for ; Fri, 1 Oct 2021 08:16:57 +0200 (CEST) Received: from localhost ([::1]:60608 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mWBqq-00041S-13 for larch@yhetil.org; Fri, 01 Oct 2021 02:16:56 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:52956) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mWBqA-00041G-OO for emacs-orgmode@gnu.org; Fri, 01 Oct 2021 02:16:14 -0400 Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:33597) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mWBq8-0007ij-Rf for emacs-orgmode@gnu.org; Fri, 01 Oct 2021 02:16:14 -0400 Received: by mail-pj1-x102a.google.com with SMTP id il14-20020a17090b164e00b0019c7a7c362dso3197591pjb.0 for ; Thu, 30 Sep 2021 23:16:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=WKFkALnk4PNmnWUjjBjzROYizemLOP0Bc9obmVd1rk8=; b=gYnrFqaAwKdRUwVz9jahSk5wZmk5kOMSSFkmrcxJ/BMvk9SMVH9PlXb3lVVa3sQLvv rWIibZAu/UI8JfsNSrSbHma5wFwQ6zJTPadlHnJ+EqXY+LcpE5XBISH83yQKhIskJWoA Z7CdMvXYyHtbCzYJriGS6IFK0QMuKFP1331d3k3awKrysuJKeimwttdiM0WJBK0PM4Y4 DbnP837mZD/o+Qlin8/zJu6zJTcSRmV71NeJKQ4B/yNGZk8HBiGuVt/jvKAXQtmfIBx3 XApoSlhTAcLUr4OmU7jKPYflS7J05WaJAlvRgAjxRhX9LOUuKhnlcCT8TdG7a66mT297 zz/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=WKFkALnk4PNmnWUjjBjzROYizemLOP0Bc9obmVd1rk8=; b=VEL9ADWos4+VZ9GmxEG2qw+sP7rjnpjOvz65dxj4ov4FJQDhGowiqIx7igW+Iu+P3Y oVpq5jSk2FV3nneDzRLuZUwN+oMrjNFTkO7pZyL9zt/XEHHDB+ajU3U+LKuKiVOYjMJp TC4djHNPNV3OQds+laz4QaTq42nO/z+EjO5oozhuVcYSkrf2cRfNq8fIPHs3vQKQMbi1 a/xBH1IF0akSD+NLGX/ULVCK9n109gWavlXJ8Rk+JD0Qy9N+l8kYK2Ov0BdSA9UAZR08 6R1+ljp+JSd5ND+cYm9HEs7ya5Pq0ZOmJthiib4ys1EHF8ucw8pwnM5ZcgQXmmZiO0C5 b1Zw== X-Gm-Message-State: AOAM533rXMR6s4O9vQDZi2IMaT1awWT2DDOA8dzTVDavLT+0UW9fXJ3B nNA+Zgql3Y2bgyEaw2m4GRU= X-Google-Smtp-Source: ABdhPJwwzstogp7AMer8wtY+zJ5PpZ4Ztm1qV44F1BAEwTmMHTpmUtnl9QRlDS95UeUao+ot7dWW5w== X-Received: by 2002:a17:90a:e7ca:: with SMTP id kb10mr17797663pjb.33.1633068971091; Thu, 30 Sep 2021 23:16:11 -0700 (PDT) Received: from localhost ([211.21.210.181]) by smtp.gmail.com with ESMTPSA id z12sm4337052pjb.52.2021.09.30.23.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Sep 2021 23:16:10 -0700 (PDT) From: Ihor Radchenko To: No Wayman Subject: Re: Visibility cycling with inline tasks 2 In-Reply-To: <874ka1ifhs.fsf@gmail.com> References: <874ka1ifhs.fsf@gmail.com> Date: Fri, 01 Oct 2021 14:17:28 +0800 Message-ID: <8735ple0av.fsf@localhost> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: emacs-orgmode@gnu.org, mick.dauer@gmail.com Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1633069017; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=WKFkALnk4PNmnWUjjBjzROYizemLOP0Bc9obmVd1rk8=; b=m7G8Kmi/SAnx6dQ7AA/Ivz0s0OqTQeFWqSSf51/BbbB7xDkDwvFv5InoVwIFca8uKi5Vpm qhzyQM28/FTwofefI/XP0KFpCuEmGpUHUQmzq/Dnn9hiKrpEFljlAFCPzmu5lka1smE4eC Afsc0VaGQh+AH8O9I06aiy5s58f7NnJrUw90tWAUWbawiiCCmYxPbev3kLm03eO/EEBjKt U+hGecKjEx5GXEhq2v96p8bI0xwCTN4LWlLFqDBkSTrwj8fLie7095rKLRB+nOUe1rVeQI USsAzaRbkxNFWZo382OOqcETppcgQYNwIZEC6ssKV01Iqx+kDW8muMYe733W1Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1633069017; a=rsa-sha256; cv=none; b=HKQrBE2kn+3CHUtdhU0O6DnzUaRepkMqW4y/OgjF5v83sK+gXZiEkxpqGhOyNWgPjNdJfJ W7Qlp9lnI3TwhBlHotlreewzGRAZmSRjOOupjUy5v76Drmc7PGdxMiJiwvaJFzi609ZcCw dl5kL3mxJmEVQejlOOSocOXRViWs6pTJb+wAWmKlVt/xYkuG+u3KRw/c8scYzzerFMol6S zRjHgi/tDFSd643P5xD+KKJksXAxa9kU1VPCnGEhdu99c92Z/LxYo2CwqzI2gv9t0Pjt9Q bjZu6vRlAEo3j/jZhYx2ESYLwfhCXS+w71hvR6D7QlmgmAu9W4aeXq+nHevhBA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=gYnrFqaA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -0.80 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20210112 header.b=gYnrFqaA; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 663EE129AA X-Spam-Score: -0.80 X-Migadu-Scanner: scn0.migadu.com X-TUID: Omydxz+/3wuz --=-=-= Content-Type: text/plain No Wayman writes: > I can confirm the issue you've outlined on latest 'main'. > To me it looks like the problem is in `org-inline-hide-tasks'. > I don't use inline tasks, so I'm not sure what the exact expected > behavior is, > but that function uses a `while' during `org-cycle-hook' to > iterate through all of the headings. > My intuition is that it's overshooting a boundary and toggling > visibility on more than it should. > > Does the attached patch behave more in line with what you expect? Your patch will fail with the following counterexample (when there is a subheading containing an inlinetask inside current heading): * Example ** heading 1 xxxxx ** heading 2 *************** TODO Test access with provided credentials xxxxx *************** END *** subheading *************** TODO State "high value" targets :@CB: xxxxx *************** END ** heading 3 xxxxx The recepy is same with original: 1. emacs -Q 2. paste the following snipped (right into the scratch buffer) 3. execute the two commands at the end C-x C-e for each 4. collapse all (TAB TAB) 5. expand Example (TAB) 5. go to heading 2 and expand it (TAB) I propose an alternative patch. See the attached. Best, Ihor --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=0001-org-inlinetask.el-Fix-visibility-cycling-for-inlinet.patch >From ec78cbc00b4e2abf201149b76ce41df87869627f Mon Sep 17 00:00:00 2001 Message-Id: From: Ihor Radchenko Date: Fri, 1 Oct 2021 14:03:47 +0800 Subject: [PATCH] org-inlinetask.el: Fix visibility cycling for inlinetasks * lisp/org-inlinetask.el (org-inlinetask-hide-tasks): Make sure that we loop over inlinetasks inside current section only. `org-inlinetask-goto-end' moves point to the end of the inlinetask element. If an inlinetask is followed by a heading, the function logic will treat the heading as the beginning of another inline task. Prevent it by moving the point at the end of the END line of the inlinetask. Fixes https://list.orgmode.org/orgmode/CAP7OBx+rs-7v4jstEFYC4u0=0NZ3xJKfb3CNrWeDvjmwRTvgxw@mail.gmail.com/ --- lisp/org-inlinetask.el | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index 3379a2e46..6320be12b 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -338,7 +338,8 @@ (defun org-inlinetask-hide-tasks (state) (or (org-inlinetask-at-task-p) (and (outline-next-heading) (org-inlinetask-at-task-p))) (org-inlinetask-toggle-visibility) - (org-inlinetask-goto-end)))))) + (org-inlinetask-goto-end) + (backward-char)))))) (defun org-inlinetask-remove-END-maybe () "Remove an END line when present." -- 2.32.0 --=-=-=--