jlumpe / ox-json

JSON export back end for Emacs Org mode
MIT License
82 stars 6 forks source link

"user-error: Not on a heading" #4

Closed sunox1 closed 2 years ago

sunox1 commented 4 years ago

Hello, Thanks for the cool-looking tool! I am trying to set title, author, etc. using #+OPTIONS, but I keep getting the error "user-error: Not on a heading". This seems to happen whenever the first line of the .org file is not a heading (e.g. * xyz).

pabloaperezfernandez commented 4 years ago

I have the same problem. I have a bunch of directives at the top, and I get the same error. If I remove the #+ items, it works.

tomb7890 commented 4 years ago

I'm having this problem too. Would love a solution or workaround.

jlumpe commented 3 years ago

I have recently delved back into the hell that is Emacs development in order to release a new version of the package. I've managed to reproduce this with org 9.1,9 so I think there is some backwards-incompatible change in the API between that and the current 9.4. I haven't been able to test any of the intermediate versions because of course Emacs isn't capable of installing a specific version of a package. Could you tell me what version you are all running (SPC SPC org-version)?

leinster commented 2 years ago

Thanks for this, it's very handy!

I'm on org-mode version 9.6 and see this problem.

It seems to be triggered by the call to (org-get-tags) in ox-json-transcode-headline; if I comment out the enclosing push call it works.

It looks to me like the call isn't occurring at a header. The docs for org-get-tags mention an optional pos-or-element argument; I tried it with (org-get-tags headline nil) but this gave me an error Wrong number of arguments: (0 . 0), 2 which I don't understand, and I'm out of my depth.

Please ignore this, the error was occurring on an emacs running org-mode 9.1.9, not 9.6; sorry for the noise.

jlumpe commented 2 years ago

Just to confirm - you are on 9.1.9 and not on 9.6?

leinster commented 2 years ago

Yes, sorry for the confusion! I was running against 9.1.9 on another machine and stupidly checked org-version locally.

jlumpe commented 2 years ago

Okay, I'm going to go ahead and close this issue because currently stated minimum org version is 9.2 and I don't expect this will change.