Hello, I was trying to create a minimal reproducible example for a different issue and I ended up with this other issue that I didn't expect and so I am reporting that first.
Issue: Opening an Org file gives (wrong-number-of-arguments #<subr looking-at> 2) error. ===== Warning (org-element-cache): org-element--cache: Org parser error in t.org::88. Resetting. The error was: (wrong-number-of-arguments #<subr looking-at> 2) Backtrace: nil Please report this to Org mode mailing list (M-x org-submit-bug-report). ===== Recipe: 1. Clone https://gitlab.com/kaushalmodi/org-mode-mwe to a temp directory (say, in /tmp) 2. cd to the org repo and check out the main branch. The Org version used when creating this report was release_9.5.3-520-g4dda0d. 3. emacs -Q -L ./lisp/ /tmp/org-mode-mwe/bug-recipes/collapse-all-post-subtrees/t.org & 4. Evaluate the "code__fold_style" src block in that test file; it sets the fold style to overlays 5. Evaluate the "code__collapse_all_posts" src block; this code hides all the subtrees with non-empty values for EXPORT_FILE_NAME or CUSTOM_ID properties. If you skip step 4, you will find the collapsing of all subtrees where EXPORT_FILE_NAME or CUSTOM_ID is set happens as expected in step 5. But if you evaluate step 4, most (or all?) subtrees remain uncollapsed. Additionally, once step 4 + 5 are evaluated, the default TAB binding that should cycle a subtree's visibility also starts behaving erratically. For example, move cursor to line 68 (* Image / Figure) in the test file t.org after completing all of the above steps. You will find these lines visible: ===== * Image / Figure :image: ** Image links :PROPERTIES: :EXPORT_FILE_NAME: image-links :EXPORT_DATE: 2017-07-15T07:49:44-04:00 :END: ===== Hit TAB once, and now you see this: it hid only the title of the subtree heading under it, but still shows the property drawer expanded! ===== * Image / Figure :image: :PROPERTIES: :EXPORT_FILE_NAME: image-links :EXPORT_DATE: 2017-07-15T07:49:44-04:00 :END: ===== Hit TAB once again, you will see: ===== * Image / Figure :image: ** Image links... ===== Now if you move the point to line 69 (* Image links), hitting the TAB will not do any kind of cycling at all. -- Kaushal Modi