Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when starting review: before first heading #110

Open
cashpw opened this issue Aug 1, 2023 · 1 comment
Open

Error when starting review: before first heading #110

cashpw opened this issue Aug 1, 2023 · 1 comment

Comments

@cashpw
Copy link
Contributor

cashpw commented Aug 1, 2023

I encountered this bug today after updating Emacs. The root cause is the changes to org-up-heading-safe as of version 9.7-pre. These changes broke an assumption in org-fc-narrow and caused the pointer to move up to the top of the file, rather than stop at the top-level heading. I fixed the bug by modifying the (while (org-up-heading-safe)) line in org-fc-narrow to stop when it's at the top-level heading.

(defun org-fc-narrow ()
  "Narrow the outline tree.
Only parent headings of the current heading remain visible."
  (interactive)
  (let* ((tags (org-get-tags nil 'local)))
    ;; Find the first heading with a :narrow: tag or the top level
    ;; ancestor of the current heading and narrow to its region
    (save-excursion
      (while (not (equal (org-up-heading-safe)
                         1)))
      (org-narrow-to-subtree)
      (outline-hide-subtree))
    ;; Show only the ancestors of the current card
    (org-show-set-visibility org-fc-narrow-visibility)
    (if (member "noheading" tags) (org-fc-hide-heading))))
@cashpw cashpw closed this as completed Aug 1, 2023
@cashpw cashpw reopened this Aug 1, 2023
@l3kn
Copy link
Owner

l3kn commented Aug 12, 2023

Good find, I've run into this but couldn't figure out the cause.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants