From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id CKJdESsP/mLw2QAAbAwnHQ (envelope-from ) for ; Thu, 18 Aug 2022 12:06:35 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id 4I9vESsP/mJvOAAA9RJhRA (envelope-from ) for ; Thu, 18 Aug 2022 12:06:35 +0200 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 E86533B657 for ; Thu, 18 Aug 2022 12:06:34 +0200 (CEST) Received: from localhost ([::1]:48462 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oOcQ5-00086J-FD for larch@yhetil.org; Thu, 18 Aug 2022 06:06:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46232) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oOcK8-0006ai-Ob for emacs-orgmode@gnu.org; Thu, 18 Aug 2022 06:00:25 -0400 Received: from mail-lf1-x133.google.com ([2a00:1450:4864:20::133]:40753) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oOcK6-0004lw-5N for emacs-orgmode@gnu.org; Thu, 18 Aug 2022 06:00:24 -0400 Received: by mail-lf1-x133.google.com with SMTP id x19so1467720lfq.7 for ; Thu, 18 Aug 2022 03:00:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc; bh=pbR8dKeLyFIV9Y77zYnVg24cv+K35ymDizIasinaqW4=; b=nWtA7rMfHW1ydpsPqs8/xD7kbIv1y3uB7zd5QtDLgRxzXqD5M0DdfMIdsRHGKIYpeI 23LQAFwmj/61WSZe8nbzzGFO29fcLgrKWmN04EBpR5M29sw/XMkCPulDAMkmlLfkE8yM wN+tG3a5Tbkj0tAbZpOvFJvhqg5iZIIywnavsIdouEZGilyQtQ6bCq9V128VvJ0EQhEQ A0/dz0ICwBDKBio8rE2bBrHCpGrIseff8mnSxKz1NgZczPmxw9W9HuA+GMEy9uV2/QVP m5E9GVZ4sYBUZxXyL7QT8zjo64huJUNtUWPp5gCX/REQSqBPikr6bvOVCMy/RVOnyLiT 7jQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc; bh=pbR8dKeLyFIV9Y77zYnVg24cv+K35ymDizIasinaqW4=; b=ZYYJaXDDpb3qrEuALjk/Bkp/dAv291kk8lryINPKenMMAGHg05Q0dtYynf6CqIzJfI 2KAi4/LwBXK2XxvD4aMhzoEPfo2jjpPZtYLkBI3S4C33gRtGiA0wIN0urvilg6hEdZAH vyu/0CoEYAMEINGdal6KNAypPOzmujfzNqMxZugiacnXIXv121C1x5CzXjSBckbCOU6g aw22QX/PuqQvAMbTTWnSd5pc0ZApO/9U/mvFWlmgd42neh7HUb+8m865uLuw02k5nVId cZ2pc4bCnNBzPNLiZyaYi+0fuMXAJYD5eP+lMhBaFWmQ5hsJ/DcmQsyg6Lx6kDl4ZU2L KY5w== X-Gm-Message-State: ACgBeo38NH9MgINgu5F6gAwQSt/UwjNjM3OP8cvwbA39IM7micBEoMKP FiGTO9wys6GCIFFmjquhiCk= X-Google-Smtp-Source: AA6agR7hvtEYETen8LRKXODmLZpjRCwqiT7u9OeChZM4U35n21tgF96z3055QhcunsgaBmUqmID3bw== X-Received: by 2002:ac2:4425:0:b0:48c:dfc9:6231 with SMTP id w5-20020ac24425000000b0048cdfc96231mr773470lfl.165.1660816817979; Thu, 18 Aug 2022 03:00:17 -0700 (PDT) Received: from ajla.lan (217-215-144-53-no249.tbcn.telia.com. [217.215.144.53]) by smtp.googlemail.com with ESMTPSA id v20-20020a056512349400b0047f6b4f82d1sm159488lfr.250.2022.08.18.03.00.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 18 Aug 2022 03:00:17 -0700 (PDT) From: Anders Johansson To: mejlaandersj@gmail.com Cc: emacs-orgmode@gnu.org Subject: Re: [BUG] Fix for inlinetask visibility cycling causes infinite loop for Date: Thu, 18 Aug 2022 12:00:16 +0200 Message-Id: <20220818100016.47442-1-mejlaandersj@gmail.com> X-Mailer: git-send-email 2.37.2 In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::133; envelope-from=mejlaandersj@gmail.com; helo=mail-lf1-x133.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN X-Migadu-To: larch@yhetil.org X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1660817195; 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: 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=pbR8dKeLyFIV9Y77zYnVg24cv+K35ymDizIasinaqW4=; b=kQiJXkYA2XzvC3m9htIIP2MyJzv8QyFVMYH6T/CGEBkyjWqCq+yJRyIr2c1rkT3+l4r8KA Doqmz/oqHBzReBWjwpbF6AhMFzapy8WDnsCgGz6SfjzqgmqKOkfs7bfG8RO99IYegRPQ3W TbBqWMltbHaknLdLg7PSKYnufkoKwogNVG7Lj80RUxEhxmmllyPrplZb4f3l8nNbaocX5C sPvxt8gC/+HtZvvC+OmogBNzp1CcR48KHxx5d5jlJdf2goeFdiG6IXxLaeIRDXmh4PT9rz nmGt0UxjspHdpzleOa18l1SmbwALWbQcm6oGFYL/FgP8BSd8ym+Tmo9xzK4q2Q== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1660817195; a=rsa-sha256; cv=none; b=G/b+7O2t6HhiabDzyfiW+8cFejw1U/lgmEjzgvI9iOQ0WDW5i5bOahbDc2ojvSmGBd0n2b KCiccIBJmUpffdXkF2A90E0bHfGAHNkWI8kS1BbWkQMbs+uNSondBCZTBiynv1FzsDlxTt oWjXW9E65sg9ndIViukDw5hfe1s7g7LCDIafKbyTczeHQzPEOmbYiBErBdm8ATB92SCkiM Ct3mt4Tq+abWIVc67pxkKJfrr3Um6izKVMQdvrdcd8Kb34/v99QjtibU/X5KYh6LDNP021 K6zWkOOSKmtZSn34tiZXp74JI8OLOaydk0TCcQ2+vjpp8irHHzYHABHh/Rpdbg== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=nWtA7rMf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -6.66 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=nWtA7rMf; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: E86533B657 X-Spam-Score: -6.66 X-Migadu-Scanner: scn0.migadu.com X-TUID: gAQqUFjCdoAb Something like this could work. Just ensuring that we haven’t ended back at the start of the current (degenerate) inlinetask. I don’t know if this would be the most elegant solution though. I also considered whether org-inlinetask-goto-end should really move to the point after the last line of an inlinetask (is this consistent with org-element BTW?), but that would require changes across a big part of org-inlinetask and probably complicate other things. diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el index 07aa94f32..c28f5e7b4 100644 --- a/lisp/org-inlinetask.el +++ b/lisp/org-inlinetask.el @@ -334,12 +334,15 @@ (defun org-inlinetask-hide-tasks (state) (org-inlinetask-goto-end))))) (`children (save-excursion - (while - (or (org-inlinetask-at-task-p) - (and (outline-next-heading) (org-inlinetask-at-task-p))) - (org-inlinetask-toggle-visibility) - (org-inlinetask-goto-end) - (backward-char)))))) + (let ((startpoint-at-bol -1)) + (while + (or (and (org-inlinetask-at-task-p) + (not (eq startpoint-at-bol (point-at-bol)))) + (and (outline-next-heading) (org-inlinetask-at-task-p))) + (setq startpoint-at-bol (point-at-bol)) + (org-inlinetask-toggle-visibility) + (org-inlinetask-goto-end) + (backward-char))))))) (defun org-inlinetask-remove-END-maybe () "Remove an END line when present."