Closed ag91 closed 4 years ago
Hi! For me it works fine to run (yankpad-insert)
at the top of an empty org-mode
file.
yankpad-category-descriptions
shouldn't be executed from outside the yankpad-file
, so that functions shouldn't be called in the context of your empty file. It could be something going on with your yankpad-file
, or there might be some bug in my code (maybe both). If you could turn on M-x toggle-debug-on-error
and post the result here, and maybe also your yankpad-file
if it isn't private.
Ah! You are right, this was an issue on my side. I checked again my yankpad.org and I found out that recently I deleted a heading that I included in org-mode:
So my org-mode heading in the Yankpad file starts with:
When I removed the included heading that did not exist anymore, everything worked fine again.
Sorry for the noise! And thanks for pointing out it could be on my side: next time I will try to reproduce with a pristine Yankpad file before submitting an issue :P
On Sun 30 Aug 2020 at 23:44, Erik Sjöstrand notifications@github.com wrote:
Hi! For me it works fine to run
(yankpad-insert)
at the top of an emptyorg-mode
file.
yankpad-category-descriptions
shouldn't be executed from outside theyankpad-file
, so that functions shouldn't be called in the context of your empty file. It could be something going on with youryankpad-file
, or there might be some bug in my code (maybe both). If you could turn onM-x toggle-debug-on-error
and post the result here, and maybe also youryankpad-file
if it isn't private.
Hi! I have been scratching my head lately because any time I was trying to insert an org-mode snippet in an empty org file I would get:
If you want to reproduce just create an empty org-mode file and call
(yankpad-insert)
, really(yankpad-category-descriptions "")
for the minimal reproduction step.After some inspection of yankpad.el I found the possible culprit: apparently
yankpad-category-descriptions
uses(org-narrow-to-subtree)
which simply cannot work because an empty org-mode file has no subtree in it. I wonder if you designed the function this way for a reason because I am not sure I get whatyankpad-category-descriptions
actually does. Any chance you could ignore the errors like(ignore-errors (org-narrow-to-subtree))
? Would that make sense to skip the narrowing if no org headline is in there?Thanks for Yankpad!