Phase 1 of the user-commands plan in docs/plans/2026-11-27-user-commands.md (#173). This is the user-visible feature.
commands.tomlin the configuration folder (api = 1,[[command]]withname,title,file,function, optionalwhenandtimeout) and code incommands/*.js. Read without running code; problems reported by file and key like the other configuration files. Mac: throughConfigSync, reloaded on change. iOS: throughMobileModel.readConfigand theFolderPresenter; a script iCloud hasn't downloaded is reported and its download started.UserCommand: OrgCommandin OrgCore with iduser.<name>;applies(in:)fromwhenthroughKeyContext.holds;run(in:)returns.external(.userCommand(...)).DocumentSessionruns it on the #244 host, validates the returned edits (in range, non-overlapping) and commits them as oneEditResultat the base revision: one undo step, refused if the buffer changed.- API version 1, all asynchronous:
org.text(),org.selection(),org.heading(at?),org.outline(),org.file(),org.settings(),org.prompt({...})through the existing closure-based prompt UI,org.message(),org.fail(). Return value{edits, selection, message, copy}in UTF-16 offsets. - Registration:
EditorCommands.all(asnamedMacros), the palette andCommandUsage,keymap.tomlvalidation,MobileEditor.offered, the iOS Commands list and[key-bar]. - Trust: first run of a command from a file asks (Run Once, Always, Don't Run); Always stores a hash of the file and every module it imports in
TrustStore. Any change asks again, including one from sync. - Refused in a buffer holding decrypted entries.
- Cancel Running Task also cancels a user command.
- Import from Emacs lists bindings to the user's own
defuns as skipped, pointing to user commands. - Manual: a new chapter (files, API, limits, what is absent compared with Emacs Lisp, a porting table),
13-configuration.orgfile table,03-keys.org. German strings.
Tests: manifest problems; a command's edits apply as one undo step; an edit made while the command ran refuses its result; overlapping or out-of-range edits are refused; a changed script asks for trust again; when hides the command where it doesn't apply.
Open questions for the owner before starting: orgstar+ or free; default timeout.
Platforms: Mac (download and Mac App Store builds), iOS. Depends on: #244.
closed by cmc in commit 61025559a3: User commands: commands.toml, API version 1 and trust
2026-11-27 09:07 UTC