Export: per-file settings, and subtree and body-only for the export commands !450

merged merged by cmc on 2026-11-22 07:54 UTC · krz/orgstar:issue-112-export-settings into main

Discussion

cmc

Closes #112.

  • ExportSettings (OrgApp) keeps format, scope, body only and open-after per file path, as JSON under the exportSettings defaults key. Nothing is written to the org file. A file without an entry starts with the last used format and open-after choice, whole file, body only off.
  • Mac: the export dialog loads the file's settings and saves them on Export. Two commands, Turn Subtree Export On or Off (app.export-subtree, C-c C-e C-s) and Turn Body-Only Export On or Off (app.export-body-only, C-c C-e C-b), change the same settings, and the single-format export commands follow them. Body only with PDF, Word, RTF, plain text, ODT or iCalendar is refused with a message. The agenda-file calendar commands follow neither.
  • iOS: a Body Only toggle in the Export menu, kept per file, followed by the menu's formats, Export Subtree… and Export to HTML and Open; app.export-body-only in Commands and on the hardware keyboard. Formats without body-only export say so. Subtree export stays the existing Export Subtree… screen.
  • The dialog's body-only choice is no longer a global setting (exportBodyOnly is unused).

Tests: ExportSettingsTests (round trip, defaults, command options against the dialog's output for HTML, Markdown, LaTeX and ASCII, refusals); an oracle test in ExportScopeTests for ox-html and ox-md with C-s and C-b. swift test and both Xcode builds pass. Not run in a simulator or on a device.

The catalog entries for the four new strings were added by hand in the committed format, with all five languages; scripts/sync-strings.sh was not run.