Rasmus <ras...@gmx.us> writes: >> You cannot enforce `org-mode' as the current major mode since you can >> include other file types. > > But then I can't use org-element-at-point: > > (with-temp-buffer > (text-mode) (insert "* test\nmy txt") (goto-char (point-min)) > (org-element-at-point)) > > (with-temp-buffer > (org-mode) (insert "* test\nmy txt") (goto-char (point-min)) > (org-element-at-point))
`org-export--prepare-file-contents' is not called with the same number of arguments when it is an Org file. You can activate `org-mode' if you are in this situation (look for (when ind ...) and (when minlevel ...) in the function). Regards, -- Nicolas Goaziou