awth13 / org-appear

Toggle visibility of hidden Org mode element parts upon entering and leaving an element
MIT License
372 stars 19 forks source link

GNU Emacs 29.4: org-appear stopped working #60

Closed aykhuss closed 1 month ago

aykhuss commented 1 month ago

I recently upgraded to Emacs version 29.4 and, unfortunately, org-appear stopped working properly. Specifically, when I open an org document with a link [[http://url/][abbrev]] it is displayed in a folded state but when I move the curser over it, I expect org-appear to unfold the view, which does not happen. Inspecting the *Messages* I see this error being written out the moment I move the cursor over the link

Error in post-command-hook (org-appear--post-cmd): (error "org-link is not a valid folding spec")

I tried the latest version on master (0.3.1) as well as the org-9.7-fixes branch with the same outcome.

Versions

macOS Sonoma 14.5 emacs via homebrew (emacs-plus)

GNU Emacs 29.4
Copyright (C) 2024 Free Software Foundation, Inc.

org mode (M-x org-version)

Org mode version 9.8 (9.8-??-39272e2 @ /Users/XXX/.emacs.d/.local/straight/build-29.4/org/)

Config

Using doom emacs packages.el:

(package! org-appear
  :recipe (:host github
           :repo "awth13/org-appear"
           ))

config.el:

;; added to resolve issues in the past with org-appear
(setq org-fold-core-style 'text-properties)

;; org appear
(use-package org-appear
  :after org
  :ensure t
  :hook (org-mode . org-appear-mode)
  :config
  (setq
    org-link-descriptive t
    ;;org-hide-emphasis-markers t
    org-appear-trigger 'always
    org-appear-autolinks t
    org-appear-autoemphasis t
    org-appear-autosubmarkers t
    org-appear-autoentities t
    org-appear-autokeywords t
    org-appear-inside-latex t
    org-appear-delay 0.0))
awth13 commented 1 month ago

Hello, @aykhuss! Thank you for the detailed information.

Link toggling should work with Org versions 9.7 and above, including the 39272e2 commit, when using the org-9.7-fixes branch. The error you got is from an org-fold function that is no longer used in that branch. Are you sure you have loaded the correct version of org-appear?

I am not familiar with Doom Emacs but the package configuration should be something like

(package! example :recipe
  (:host github
   :repo "awth13/org-appear"
   :branch "org-9.7-fixes"))

After making changes to packages.el, you need to run doom sync according to Doom Emacs documentation.

aykhuss commented 1 month ago

Thank you! After some fiddling with my configuration, ultimately this solved my problem and org-appear is working like a charm!