Closed Jousimies closed 2 years ago
Hi! Thank you for posting the issue!
org-appear
shouldn't be active in buffers other than Org buffers. I am not familiar with leaf
so I'm not sure why, despite org-appear
hooked into org-mode
only, your configuration enabled org-appear
in the scratch buffer. I will look into what we can do about it.
I don't think it related to leaf. (By the way , I use borg to manage emacs packages, The org-appear.el file will be byte compile to org-appear.elc file.)
I reset my config to
(setq org-appear-trigger 'manual
org-appear-autolinks t)
(add-hook 'org-mode-hook #'org-appear-mode)
(add-hook 'meow-insert-enter-hook #'org-appear-manual-start)
(add-hook 'meow-insert-exit-hook #'org-appear-manual-stop)
In scratch buffer write something like (fdasfdasf)
, then exit meow insert mode, the error appeard. Need to input paren, otherwise no error appeared.
If I try M-x org-appear-mode , the message buffer give some infos like:
Org-Appear mode enabled in current buffer
Error in post-command-hook (org-appear--post-cmd): (wrong-type-argument stringp nil)
I try set scratch buffer to another mode , the error disappeared.
Emmm. Like the error only happened in emacs-lisp-mode.
I don't think it related to leaf.
Oh, I didn't mean it is a leaf
bug. Just that you shouldn't enable org-appear
outside Org buffers and your configuration using leaf
did enable org-appear
outside Org buffers. Your new example is doing exactly that as well.
If you want to make sure that org-appear
functions are added to hooks in Org mode only, try this instead:
(add-hook 'org-mode-hook (lambda ()
(add-hook 'evil-insert-state-entry-hook
#'org-appear-manual-start
nil
t)
(add-hook 'evil-insert-state-exit-hook
#'org-appear-manual-stop
nil
t)))
Notice that there are four arguments to add-hook
. The last argument makes the hook function buffer local and must be t
to avoid enabling org-appear
globally. Your configuration seems to omit the additional arguments, which, I think, might be the actual source of the problem.
Thank you for you help. Below config finally work as expected.
(unless
(fboundp 'org-appear-manual-start)
(autoload #'org-appear-manual-start "org-appear" nil t))
(unless
(fboundp 'org-appear-manual-stop)
(autoload #'org-appear-manual-stop "org-appear" nil t))
(setq org-appear-trigger 'manual
org-appear-autolinks t)
(add-hook 'org-mode-hook 'org-appear-mode)
(add-hook 'org-mode-hook (lambda ()
(add-hook 'meow-insert-enter-hook #'org-appear-manual-start nil t)
(add-hook 'meow-insert-exit-hook #'org-appear-manual-stop nil t)))
my org appear config :
open scratch buffer , input something like
(require 'org)
, and pressEsc
to exit meow insert mode, the error appeard.The backtrace