orgstar

Working alongside Emacs and other tools

orgstar works on plain org files in ordinary folders, so Emacs, other apps and sync tools can work on the same files.

How orgstar treats files

Bytes on disk

orgstar edits the file's text directly; there is no separate document format. When it saves, text you didn't change is written back exactly as it was read:

Encodings

orgstar edits UTF-8 files, with or without a byte order mark. A file that starts with a BOM keeps it.

A file that isn't valid UTF-8 (UTF-16, Latin-1, or a file with invalid bytes) opens read-only. The window's subtitle says "Read-only: not UTF-8", undecodable bytes show as replacement characters, and commands that would change the file report that it "isn't UTF-8, so it can't be changed". orgstar never converts such a file.

How a save works

Saving replaces the file through a temporary file in the same folder (named .name.org.orgstar-…), under the system's file coordination, so iCloud and other coordinating apps see a complete file. The steps are:

  1. Read the file on disk. If it changed since orgstar last read or wrote it, keep both versions in the recovery folder and merge the change into your edits (see below).
  2. Read the file again. If it changed in the meantime, start over, up to three times.
  3. Replace the file. If another program replaced it between the check and the write, its version goes to the recovery folder and is merged into your edits.
  4. Read the file back. If it changed right after the write, orgstar's version goes to the recovery folder and the new disk version is merged in.

Emacs and Syncthing don't use file coordination, so these checks can't lock them out. They narrow the window in which two writers can collide, and every version a save displaces is kept in the recovery folder.

If the file keeps changing through all three attempts, the save fails with an error and your edits stay unsaved.

In the Mac App Store version, when the folder doesn't let orgstar create the temporary file, orgstar writes the file in place instead.

Automatic and explicit saving

With save = "automatic" (the default), orgstar saves a file one second after you stop typing. With "explicit", only ⌘S (Save) and ⌥⌘S (Save All) save. See Configuration. The iOS app always saves automatically.

Changes made outside orgstar

orgstar watches your folders. On the Mac it uses FSEvents; on iOS it is told of changes by file coordination and reads the folders again when you return to the app. When a file that is open in orgstar changes on disk:

The merge is a line-based three-way merge between the version orgstar last read or wrote, your edits, and the disk version. A run of lines changed on one side only takes that side; changed the same way on both, it is taken once; changed differently on both, it is a conflict. Lines keep their endings, so CRLF files and a missing final newline survive a merge. A disk version that isn't valid UTF-8 always conflicts.

After a reload or merge, orgstar also reads the file's setup files again.

The conflict sheet

The sheet shows what differs, with lines marked - on disk and + in your version, and offers:

ButtonEffect
Keep MineWrites your version over the disk version. The disk version goes to the recovery folder.
Use Disk VersionLoads the disk version. Your version goes to the recovery folder.
Merge with MarkersPuts both sets of changes in the buffer, with conflicting lines between <<<<<<< yours and >>>>>>> disk markers, as git merge leaves them. Edit and save. Your version as it was goes to the recovery folder.
CancelCloses the sheet. Automatic saving stops for the file until you decide; the Conflict button in the toolbar opens the sheet again.

On the Mac, File ▸ Revert to File on Disk loads the disk version at any time; unsaved changes go to the recovery folder.

Sync tools

iCloud Drive

orgstar reads and writes files under file coordination, which is how iCloud expects apps to work. Files iCloud hasn't downloaded yet (.name.org.icloud placeholders) aren't indexed; orgstar asks iCloud to download them and indexes them when they arrive. On iOS they appear in the Folders tab with a cloud icon until then.

Syncthing

Syncthing writes files without file coordination. orgstar sees its changes through file watching and merges them as described above.

When a file with conflict copies opens, a message says how many there are. File ▸ Resolve Sync Conflicts… (on iOS, a toolbar button while there are copies, and in Commands) lists each copy against the file, with lines marked - in the file and + in the copy:

ButtonEffect
Keep FileLeaves the file as it is.
Use CopyReplaces the buffer's text with the copy's, as an edit you can undo.
Merge with MarkersPuts every difference between the file and the copy between conflict markers in the buffer. There is no common base, so every difference is marked.

Each choice then moves the copy to the recovery folder and deletes it from the folder.

Dropbox and other tools

Any program that writes files in your folders is treated the same way: orgstar sees the change, reloads or merges, and keeps displaced versions. Programs that write through file coordination (iCloud, File Provider apps on iOS) are seen as they write; others are seen through FSEvents on the Mac and when you return to the app on iOS.

Files orgstar ignores

When scanning folders, orgstar skips Emacs lock files (.#name), backups (name~) and auto-save files (#name#), its own temporary and backup files (names containing .orgstar-), .DS_Store, .localized, and the folders in ignored-folders. With show-hidden-files = false, every dotfile and dot folder is skipped. orgstar doesn't create or honour Emacs lock files.

Recovery versions

Every version a save, a merge or a conflict resolution displaces is kept in the recovery folder, and so is a snapshot of the file before a save, at most once an hour:

Each file has a subfolder named from a hash of its path, holding its last 20 replaced versions and, apart from them, its last 10 snapshots. A version's file name has a timestamp, a label and the file's name. The labels are:

LabelKept when
externalA version written by another program was replaced or merged
localorgstar's version was replaced, or set aside by Use Disk Version, Merge with Markers or Restore
sync-conflictA Syncthing conflict copy was resolved
snapshotA save changed the file and the last snapshot was more than an hour before

File ▸ History… on the Mac, and Recovery Versions… on iOS (a toolbar button while there are versions, and in Commands), lists the open file's kept versions, newest first, each compared with the buffer (lines marked - in the buffer, + in the kept version). In the download version, History also lists the commits that changed the file when it is in a git repository. Restore puts a version's text in the buffer as an edit you can undo; the buffer as it was goes to the recovery folder first. On the Mac, Show in Finder selects the version's file. See Recovery versions and, for committing to git as you save, Committing to git.

Features that use Emacs on the Mac

Some features run Emacs in batch mode on the Mac. Everything else works without Emacs installed. The Mac App Store version never runs Emacs; it does what the download version does without Emacs, described below.

FeatureWhat runs
Emacs Lisp source blocks (emacs-lisp, elisp)The block, in emacs -Q --batch
Table formulas outside what orgstar computes itselforg-table-recalculate on a copy of the file; the table's new text replaces the old one if the table didn't change meanwhile
Lisp table formulas that orgstar's Emacs Lisp interpreter can't evaluateThe same; orgstar first asks whether to run Lisp (yes, no, always)
Export to PDF, and LaTeX and plain text orgstar can't write itselforg-latex-export-to-pdf, org-latex-export-to-latex or org-ascii-export-to-ascii
calc source blocks that orgstar's Calc refusesThe block, in emacs -Q --batch
elisp: linksThe form, after asking, in emacs -Q --batch in a copy of the file

HTML, Markdown, ODT, LaTeX and ASCII export don't use Emacs. See Code blocks, Tables and Export.

How Emacs is found

orgstar uses the first of these that is an executable file:

  1. the path in the environment variable ORGSTAR_EMACS,
  2. /opt/homebrew/bin/emacs,
  3. /usr/local/bin/emacs,
  4. /Applications/Emacs.app/Contents/MacOS/Emacs,
  5. /run/current-system/sw/bin/emacs,
  6. /usr/bin/emacs.

An app started from the Dock doesn't see your shell's PATH, which is why orgstar looks in fixed places. Without Emacs, Emacs Lisp blocks and elisp: links run in orgstar's own Emacs Lisp interpreter, and a block or form that uses something the interpreter doesn't have fails with a message. A table is recalculated up to the first formula orgstar can't compute, and the echo area names the formula and the reason. A calc block that orgstar's Calc refuses isn't run. Export to PDF with Emacs, which the Mac App Store version leaves out, reports "Emacs isn't installed, so this format can't be exported.", and a LaTeX or plain text export orgstar can't write itself stops with the reason.

What Emacs sees

Quick Look

orgstar includes a Quick Look extension for org files (.org and .org_archive). Pressing Space on an org file in Finder, or in the Files app on iOS, shows the file as the HTML export renders it, with its #+SETUPFILE keywords applied. The preview reads a file as UTF-8, or as Latin-1 when it isn't valid UTF-8.

Inside orgstar, selecting a file in the sidebar that isn't text shows a Quick Look preview, with Open with Default App and Show in Finder below it.

Spotlight

On the Mac, orgstar includes a Spotlight importer for org files. Spotlight indexes each file's text, its title (#+TITLE, else the file name), #+AUTHOR, #+DESCRIPTION, and its tags (#+FILETAGS and heading tags) and headings as keywords. The importer reads only UTF-8 files.

On iOS, the app adds the files in your folders to Spotlight itself; see iPhone and iPad.

Finder

orgstar declares the org.orgmode.org file type for the extensions .org and .org_archive, and registers as an editor for it, and as an alternate editor for plain text. Double-clicking an org file in Finder, dropping files on orgstar's Dock icon, or running open -a orgstar file.org opens each file as a buffer. Files opened while orgstar is starting open once its window is ready. To make orgstar the app that opens org files, use Finder's Get Info ▸ Open with ▸ Change All.

org-protocol and Shortcuts

orgstar registers the org-protocol: URL scheme on the Mac and iOS, and handles two sub-protocols, in both the ?key=value form and the older :/a/b/c form:

Other sub-protocols, such as open-source, show "orgstar handles org-protocol capture and store-link".

The Shortcuts action Capture to orgstar, on the Mac and iOS, files text with a capture template without opening the capture window. See Capture.

orgstar registers the orgstar: URL scheme on the Mac and iOS. These links open part of the app; the widgets and the Live Activity use them, and they work from Shortcuts, a browser, a note or open in Terminal:

LinkOpens
orgstar://agendaThe agenda
orgstar://clockThe entry of the running clock
orgstar://reviewReview Flashcards
orgstar://capture?template=tCapture with that template, or the template list
orgstar://entry?path=/path/file.org&offset=NThe file at offset N

x-callback-url

Links of the form orgstar://x-callback-url/action?parameters follow x-callback-url 1.0: another app asks orgstar to do something and names links to open afterwards. Besides an action's own parameters, every action takes:

ParameterMeaning
x-successOpened when the action succeeds, with the result's parameters added to its query
x-errorOpened when it fails, with errorCode and errorMessage added
x-cancelOpened when you close the capture window or sheet without filing
x-sourceThe calling app's name, shown when orgstar asks whether to allow it

Values are percent-encoded, as in any URL; encode a + in a value as %2B. Without x-error, an error shows in orgstar's message area.

capture

ParameterMeaning
templateA template's key in capture.toml
textThe text, inserted as %i
url, titleA link, as org-protocol gives one: %a, %:link, %:description
prompt nameThe answer to the prompt with that text: What for %^{What}, Tags for %^g, Date for %^t, Effort for %^{Effort}p

With template and text given and a parameter for every prompt in the template, orgstar files the entry without showing anything, as Capture to orgstar does in Shortcuts; on iOS the file is saved at once. %^C and %^L insert nothing. Otherwise the capture window (Mac) or sheet (iOS) opens with the template chosen (the template list without template), the text as %i and the link as %a, and asks what is missing; prompt answers given in the link aren't filled in there. Templates that make a Denote note or ask for a date tree's day (time-prompt) always open it. Closing it without filing opens x-cancel.

Result: template (the key) and file (the target, relative to its folder).

open

ParameterMeaning
fileA file relative to one of your folders (the first that has it), or an absolute path inside one
headingWith file: the first heading with this title
idInstead of file: the heading with this ID property

Shows the file or heading: in the editor on the Mac, in the reader on iOS. Result: file.

agenda

ParameterMeaning
viewA view's name: Agenda (the default), TODO List, Stuck Projects, or one in views.toml; case is ignored
limitHow many entries to return: 50 when not given, at most 200

Runs the view with your agenda settings, as the agenda shows it. Calendar events and reminders are left out. Result:

ParameterMeaning
viewThe view's name
resultThe entries, as a JSON array
countHow many entries result holds
totalHow many entries the view has; more than count when limit cut it

Each entry is an object with these keys, those without a value left out:

KeyValue
titleThe heading's title
todoIts TODO keyword
priorityIts priority letter
tagsIts tags, as an array
categoryIts category
fileIts file, relative to its folder
statusoverdue, due-soon, normal or done
dateAgenda views: the day it shows on, 2026-11-26; overdue entries show on today
time, endAgenda views: its start and end time, 10:00
kindAgenda views: scheduled, deadline, habit or timestamp
sectionBlock views: the header of the block it is in

To show an entry, pass its file and title to open as file and heading.

clock-in, clock-out and clock-status

clock-in takes id, or file and heading, as open does, and clocks in to that heading; without them, to the entry clocked last. Dangling clocks are asked about in orgstar first, as Clock In asks. clock-out stops the running clock. clock-status changes nothing.

ActionResult
clock-inAs clock-status
clock-outheading, file and minutes clocked
clock-statusrunning (true or false), and while a clock runs heading, file, started (ISO 8601) and minutes

On iOS the file is saved at once.

Errors

errorCodeWhen
unknown-actionThe action isn't one of the above
missing-parameteropen without file or id
invalid-parameterlimit isn't a number above 0
not-foundNo such file, heading, ID or view
capture-failedThe template can't be filled or filed; errorMessage says why
clock-failedClocking in or out failed; errorMessage says why
no-clockclock-out with no clock running
not-allowedYou chose Don't Allow
needs-orgstar-plusThe action needs orgstar+
not-readyThe Mac app's window isn't open yet

orgstar opens x-success, x-error and x-cancel only for other apps' schemes. It never opens orgstar: links (a link could call itself), org-protocol: links (they would capture), or http:, https:, file:, ftp:, javascript:, data:, about: and blob: links, which would send results to a web server or open a download. Such a callback is skipped and the action still runs.

Allowing apps

A link from a web page or another app could write to your files or read them. So capture without the window or sheet, clock-in, clock-out, agenda and clock-status need orgstar+, as Shortcuts actions do, and the first time an app uses one of them orgstar asks: Allow "name" to use orgstar?, with where results go. Allow remembers the app; Don't Allow opens x-error with not-allowed. An app is the x-source name together with the schemes of its callbacks, so a link that gives an allowed name but sends results to another app asks again. x-source is whatever the link says, so allow only names you expect to see.

open and capture through the window or sheet never ask, as org-protocol://capture doesn't: they show what they do and write nothing until you file.

Allowed apps are listed under Apps Allowed to Use Links, in Settings ▸ Capture on the Mac and the Settings tab on iOS, each with Forget.

Shortcuts or x-callback-url

In Shortcuts, use the Capture to orgstar action: it runs without switching apps and returns its message as a value. Use x-callback-url from apps that support it (Drafts, launchers, Shortcuts' Open X-Callback URL action, open in Terminal), and for opening entries, the agenda and the clock, which have no Shortcuts action.

Examples

orgstar://x-callback-url/capture?template=t&text=Call%20Sam&x-source=Drafts&x-success=drafts://
orgstar://x-callback-url/capture?template=w&url=https%3A%2F%2Fexample.com&title=Example&x-cancel=myapp://cancelled
orgstar://x-callback-url/open?file=work%2Fprojects.org&heading=Website
orgstar://x-callback-url/agenda?view=TODO%20List&limit=10&x-source=My%20App&x-success=myapp://agenda
orgstar://x-callback-url/clock-in?id=5f0c1e2a&x-success=myapp://clocked

The agenda example opens a link like myapp://agenda?count=1&result=%5B%7B%22title%22…&total=1&view=TODO%20List. On the Mac, try them from Terminal with open '…'.

Compatibility notes

Defaults that differ from Emacs

orgstar's defaults follow a common Doom Emacs setup rather than plain Emacs in several places. If you use plain Emacs on the same files, set these in config.toml to match your Emacs, or use Import from Emacs; see Configuration.

Settingorgstar defaultPlain Emacs default
fill-column8070
org-M-RET-may-split-linefalset
org-list-allow-alphabeticaltruenil
org-hide-emphasis-markerstruenil
org-pretty-entitiestruenil
org-startup-indentedtruenil
org-startup-truncatedfalset
electric-pair-modetrueoff
org-agenda-span10 daysa week
org-agenda-show-all-datesfalset

org-hide-emphasis-markers and org-pretty-entities matter for files you also edit in Emacs: orgstar aligns tags and tables, and fills paragraphs, by the width text has on screen in your Emacs. If they don't match your Emacs, tags and tables that orgstar aligns look misaligned in Emacs.

These behave as Emacs's defaults and have no setting in config.toml: org-log-repeat is time unless #+STARTUP says otherwise, fast TODO selection is on when keywords have keys, priorities are A to C with B as default unless #+PRIORITIES says otherwise, and org-use-sub-superscripts is {} for display (only x_{1} and x^{2} are lowered and raised).

How the agenda looks

The agenda selects the same entries as Org's, but shows them its own way (see The agenda):

Snippets and yasnippet

orgstar's snippets (see The editor) read yasnippet's field syntax, and Import from Emacs copies your org-mode snippets into snippets.toml (see Configuration). They are tested against yasnippet's own expansion. Where they differ:

Completion and dabbrev, corfu and org-roam

Completion follows Emacs's completion-at-point with corfu's list (see The editor). Where it differs:

Lint File and org-lint

Lint File (see The editor) runs the checkers of org-lint that have the same meaning in orgstar, with org-lint's names, trust and messages, and finds the same lines; the tests compare the two on the same files. It differs in these ways:

Known differences from Emacs Org

orgstar refuses some things with a message rather than doing something different from Emacs. These are the ones found in the current version.

Code blocks (see Code blocks):

Links (see Links):

Capture templates (see Capture):

Tables and dynamic blocks (see Tables and Dates and clocking):

Other: