Andreas Matthias <[email protected]> writes: > (defun round-trip() > (with-temp-buffer > (org-mode) > (insert "text\n\n* heading\n") > (let* ((tree (org-element-parse-buffer)) > (str (org-element-interpret-data tree))) > (princ (substring-no-properties str))))) > > Running this function interactively it returns a string with one blank line > between "text" and "heading". > But this blank line is missing if I run the function in batch mode with > "emacs -batch -l test.el -f round-trip". > > Is this intended? The more I try to understand the differences between > interactive and batch mode, the more I get lost.
What is likely happening is that batch emacs is not using the newer Org mode version you use when running the same function interactively. This particular issue with blank lines was a bug that has been fixed on main. -- Ihor Radchenko // yantar92, Org mode maintainer, Learn more about Org mode at <https://orgmode.org/>. Support Org development at <https://liberapay.com/org-mode>, or support my work at <https://liberapay.com/yantar92>
