[PATCH] ox-odt: Prevent auto-formatting in export buffers

2022-10-01 Thread David Lukes
* lisp/ox-odt.el (org-odt-template, org-odt--export-wrap): `write-region' instead of `save-buffer'. `write-file' and `save-buffer' trigger major mode changes, which leads to various mode-related hooks being run. This is undesirable: running these on generated files is wasted time and computation,

[PATCH] ox.el: Protect export from auto-formatting hooks

2022-06-21 Thread David Lukes
* ox.el, ox-odt.el: Use `write-region' instead of `write-file' or `save-buffer' to protect generated export buffers from auto-formatting hooks. In particular, `tidy' is often configured as the auto-formatter for HTML and XML, and it can corrupt the exports. TINYCHANGE --- lisp/ox-odt.el | 4 ++--

[PATCH] oc-basic.el: Stringify year from CSL-JSON date-parts

2022-06-21 Thread David Lukes
* lisp/oc-basic.el (org-cite-basic--parse-json): Make sure year extracted from date-parts is returned as string. Raise error if original type other than number or string. The stringifiation is motivated by errors like the following on Emacs 28 with nativecomp: Error during redisplay: (jit-lock-f

[PATCH] ox: Prevent auto-formatting in export buffers

2022-02-28 Thread David Lukes
* ox.el (org-export-to-file): `write-region' instead of `write-file'. * ox-odt.el (org-odt-template, org-odt--export-wrap): `write-region' instead of `save-buffer'. `write-file' and `save-buffer' trigger major mode changes, which leads to various mode-related hooks being run. This is undesirabl

[PATCH] oc-basic.el: Better handling of CSL-JSON dates

2022-02-25 Thread David Lukes
* lisp/oc-basic.el (org-cite-basic--parse-json): Make date-parsing and year extraction more resilient. Provide more informative errors when it fails. A string-based date is not only indicated by the key 'raw, but also possibly by the key 'literal. String-based dates come in various formats, not

[PATCH] org-indent: Allow indentation per level to be 0

2021-08-31 Thread David Lukes
* lisp/org-indent.el (org-indent--compute-prefixes): Prefixes should only be computed when `org-indent-indentation-per-level' is greater than 0. For one thing, the current algorithm leads to an error otherwise, and for another, this makes it possible to use org-indent just to preserve indentation