emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: No Wayman <iarchivedmywholelife@gmail.com>
To: mick.dauer@gmail.com
Cc: emacs-orgmode@gnu.org
Subject: Re: Visibility cycling with inline tasks 2
Date: Thu, 30 Sep 2021 23:26:41 -0400	[thread overview]
Message-ID: <874ka1ifhs.fsf@gmail.com> (raw)
In-Reply-To: <CAP7OBxLB7ehqxXCUsKNUKBU_A7+DyHRc+rRhtMJ

[-- Attachment #1: Type: text/plain, Size: 468 bytes --]


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? 


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-org-inlinetask.el-Limit-children-visibility-toggle-t.patch --]
[-- Type: text/x-patch, Size: 1365 bytes --]

From 04ed84c36a4cc04838b5b75e18858996af125f77 Mon Sep 17 00:00:00 2001
From: Nicholas Vollmer <iarchivedmywholelife@gmail.com>
Date: Thu, 30 Sep 2021 23:31:50 -0400
Subject: [PATCH] org-inlinetask.el: Limit children visibility toggle to
 subtree

* org-inlinetask: (org-inlinetask-toggle-visibility): Limit toggling
to subtree.

Not sure if this is correct behavior or not. Just a suggestion.
---
 lisp/org-inlinetask.el | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/lisp/org-inlinetask.el b/lisp/org-inlinetask.el
index 3379a2e46..3bdc03ae4 100644
--- a/lisp/org-inlinetask.el
+++ b/lisp/org-inlinetask.el
@@ -334,11 +334,13 @@ This function is meant to be used in `org-cycle-hook'."
 	   (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))))))
+       (save-restriction
+         (org-narrow-to-subtree)
+         (while
+             (or (org-inlinetask-at-task-p)
+                 (and (outline-next-heading) (org-inlinetask-at-task-p)))
+           (org-inlinetask-toggle-visibility)
+           (org-inlinetask-goto-end)))))))
 
 (defun org-inlinetask-remove-END-maybe ()
   "Remove an END line when present."
-- 
2.33.0


             reply	other threads:[~2021-10-01  3:36 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-01  3:26 No Wayman [this message]
2021-10-01  6:17 ` Visibility cycling with inline tasks 2 Ihor Radchenko
2021-10-01 14:44   ` No Wayman
2021-10-01 17:04   ` Timothy
2022-04-30  8:58     ` Ihor Radchenko
  -- strict thread matches above, loose matches on Subject: below --
2021-09-29 14:48 Michael Dauer
2021-09-29 15:09 ` Ihor Radchenko
2021-09-29 18:38   ` Michael Dauer
2021-09-30  7:57     ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874ka1ifhs.fsf@gmail.com \
    --to=iarchivedmywholelife@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=mick.dauer@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).