<div dir="ltr">** when ellipsis are "removed", org-cycle doesn't work "correctly" on list<br><br>Hey everyone,<br><br>This is my first communication on this mailing list and I hope I'll do<br>it well.<br><br>1) The "bug" (I'm not sure if it is a bug):<br><br>When you modify the `buffer-invisibility-spec` replacing<br>`'(outline . t)` by `'outline` (in order to remove the `...` when<br>headlines, list, etc are collapsed) by evaluating the following form:<br><br>(remove-from-invisibility-spec '(outline . t))<br>(add-to-invisibility-spec 'outline)<br><br>`org-cycle` stopped working "correctly" on lists.<br><br>You still can collapse lists but you can get them to show the list<br>content again.<br><br>For instance, with the following list (and the ellipsis removed), with<br>the point on the first item (- something), press TAB (`org-cycle`):<br><br>- something<br> - a<br> - b<br> - c<br>- something else<br><br>You'll obtain the first item collapsed:<br><br>- something<br>- something else<br><br>but if you hit TAB (`org-cycle`) again, you won't see the content (a,<br>b, c), the first item will stay collapsed.<br><br>note-1: I don't know if it can be considered as a "bug" because I<br>imagine that most org-mode users won't remove the visual feedback<br>offered by the ellipsis.<br><br>note-2: This "bug" was reported as an issue on github<br>(<a href="https://github.com/tonyaldon/org-bars/issues/5">https://github.com/tonyaldon/org-bars/issues/5</a>) by jonathanmfung,<br>regarding a section on the README where I wrote how to remove the<br>ellipsis, knowing that `org-bars` offers dynamic stars that inform<br>the visibility of subtrees. Maybe it wasn't a good idea.<br><br>2) a fix of the "bug"<br><br>I was really interested in knowing why changing the<br>`buffer-invisibility-spec` in the way previously described has an<br>impact on `org-cycle`.<br><br>I added a small patch (that modifies `org-list-struct`) to this email<br>that makes `org-cycle` work with `buffer-invisibility-spec` changed<br>in order to remove ellipsis.<br><br>The outline of the patch is as follow:<br><br>The command `org-cycle`, when in an item list, calls<br>`org-cycle-internal-local`. And `org-cycle-internal-local` computes<br>the local var `eos` (end of subtree or item) via the call of the<br>function `org-list-struct`.<br><br>(defun org-cycle-internal-local ()<br> ;;...<br> (let ((goal-column 0) eoh eol eos has-children children-skipped struct)<br> (save-excursion<br> (if (org-at-item-p)<br> (progn<br> (beginning-of-line)<br> (setq struct (org-list-struct))<br> (setq eoh (point-at-eol))<br> (setq eos (org-list-get-item-end-before-blank (point) struct))<br> (setq has-children (org-list-has-child-p (point) struct)))<br> ;; ...<br> )<br> ;;...<br> )))<br><br><br>And the problem comes from the use of the function<br>`current-indentation` in `org-list-struct` that doesn't compute<br>correctly in that context the indentation when ellipsis are removed.<br><br>The patch replaces this specific call of `current-indentation`.<br><br>note-3: I don't understand why the function `current-indentation`<br>doesn't compute "correctly" the indentation in that context.<br><br>note-4: In a default org buffer, with the items either collapsed or<br>not, with the following content and point on the first item,<br><br>- [X] first item<br> 1. sub-item 1<br> 5. [@5] sub-item 2<br> some other text belonging to first item<br>- last item<br> + tag :: description<br><br>evaluating `(org-list-struct)` gives the following structure (as<br>written in the docstring):<br><br>((1 0 \"- \" nil \"[X]\" nil 97)<br> (18 2 \"1. \" nil nil nil 34)<br> (34 2 \"5. \" \"5\" nil nil 55)<br> (97 0 \"- \" nil nil nil 131)<br> (109 2 \"+ \" nil nil \"tag\" 131))<br><br>But if you removed the ellipsis (as specified previously), and you<br>collapse the first item, evaluating `(org-list-struct)` with point on<br>the first item gives you:<br><br>((1 0 "- " nil "[X]" nil 18) (18 0 "1. " nil nil nil 34) (34 0 "5. " "5" nil nil 55))<br><br>3) Thank you for all your work on org-mode, I enjoy using it every day :)<br><br><br>Have a nice day,<br>Tony Aldon<br><br>Done with: GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+<br>Version 3.22.30, cairo version 1.15.10) of 2021-06-09<br></div>