Commit 439b0aed64

439b0aed642f9da38e43ca504d5b0befe9ed8edb

parent: 1536160f34

Verified · cmc

cmc <hello@cleberg.net> · 2026-10-14 03:31 UTC

Org's defaults for org-todo-keywords and org-insert-heading-respect-content

The fallbacks were Doom's: the PROJ LOOP STRT WAIT HOLD IDEA keyword set,
whose fast-selection keys made C-c C-t open a menu, and M-RET after the
subtree. They are now Org's, "TODO | DONE" and nil. A config.toml written
by an earlier version keeps its explicit values; Import from Emacs still
writes Doom's for a Doom configuration.

Closes #68

Layout: unified · split

Sources/OrgApp/OrgPreferences.swift +1 −1
@@ -5,7 +5,7 @@ import OrgPresentation
55/// The Org settings `config.toml` holds, read from user defaults with the file's fallbacks, for
66/// both apps.
77public enum OrgPreferences {
8 public static let defaultTodoKeywords = "TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k)"
8 public static let defaultTodoKeywords = "TODO | DONE"
99
1010 /// TODO keywords for files without `#+TODO`, and alphabetical lists.
1111 public static func orgSettings(_ defaults: UserDefaults = .standard) -> OrgSettings {
Sources/OrgApp/UserConfig.swift +2 −2
@@ -98,7 +98,7 @@ public enum UserConfig {
9898 comment: "M-q fills to this column", legacy: "editor.fill-column"),
9999 Setting(section: "", key: "org-tags-column", defaultsKey: "tagsColumn", kind: .integer, fallback: .integer(-77),
100100 comment: "negative: tags end at that column; 0: one space before them", legacy: "editor.tags-column"),
101 Setting(section: "", key: "org-insert-heading-respect-content", defaultsKey: "headingAfterSubtree", kind: .bool, fallback: .bool(true),
101 Setting(section: "", key: "org-insert-heading-respect-content", defaultsKey: "headingAfterSubtree", kind: .bool, fallback: .bool(false),
102102 comment: "M-RET adds the new heading after the subtree", legacy: "editor.insert-heading-respect-content"),
103103 Setting(section: "", key: "org-M-RET-may-split-line", defaultsKey: "splitLine", kind: .bool, fallback: .bool(false),
104104 comment: "M-RET splits the line at the caret", legacy: "editor.meta-return-may-split-line"),
@@ -110,7 +110,7 @@ public enum UserConfig {
110110 comment: "hide *bold* and =code= markers when markup is hidden", legacy: "editor.hide-emphasis-markers"),
111111 Setting(section: "", key: "org-pretty-entities", defaultsKey: "prettyEntities", kind: .bool, fallback: .bool(true),
112112 comment: "\\alpha shows as α and x_{1} is lowered when markup is hidden", legacy: "editor.pretty-entities"),
113 Setting(section: "", key: "org-todo-keywords", defaultsKey: "todoKeywords", kind: .string, fallback: .string("TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k)"),
113 Setting(section: "", key: "org-todo-keywords", defaultsKey: "todoKeywords", kind: .string, fallback: .string("TODO | DONE"),
114114 comment: "for files without #+TODO, in #+TODO syntax, one sequence per line (\\n); keys in parentheses turn on fast selection; read at launch", legacy: "editor.todo-keywords"),
115115 Setting(section: "", key: "org-log-done", defaultsKey: "logDone", kind: .choice([("nil", "nil"), ("time", "time"), ("note", "note")]),
116116 fallback: .string("nil"), comment: "nil, time (CLOSED when done) or note (CLOSED and a note)", legacy: ""),
Sources/Orgstar/ContentView.swift +1 −1
@@ -31,7 +31,7 @@ struct ContentView: View {
3131 @AppStorage("optionAsMeta") private var optionAsMeta = OptionAsMeta.left.rawValue
3232 @State private var keymap = KeymapPreset.emacs.keymap
3333 @AppStorage("tagsColumn") private var tagsColumn = -77
34 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true
34 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = false
3535 @AppStorage("splitLine") private var splitLine = false
3636 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
3737 @AppStorage("fillColumn") private var fillColumn = 80
Sources/Orgstar/OrgstarApp.swift +1 −1
@@ -576,7 +576,7 @@ struct SettingsView: View {
576576 @AppStorage("keymap") private var preset = KeymapPreset.emacs
577577 @AppStorage("optionAsMeta") private var optionAsMeta = OptionAsMeta.left.rawValue
578578 @AppStorage("tagsColumn") private var tagsColumn = -77
579 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true
579 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = false
580580 @AppStorage("splitLine") private var splitLine = false
581581 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
582582 @AppStorage("fillColumn") private var fillColumn = 80
Tests/OrgAppTests/OrgPreferencesTests.swift +3 −2
@@ -8,7 +8,8 @@ struct OrgPreferencesTests {
88 @Test func readsWhatConfigTomlSets() throws {
99 let defaults = try #require(UserDefaults(suiteName: "orgstar-preferences-\(UUID().uuidString)"))
1010 // Nothing set: the file's fallbacks, which match the Mac's.
11 #expect(OrgPreferences.orgSettings(defaults).todoSequences.first?.active.map(\.name) == ["TODO", "PROJ", "LOOP", "STRT", "WAIT", "HOLD", "IDEA"])
11 #expect(OrgPreferences.orgSettings(defaults).todoSequences.first?.active.map(\.name) == ["TODO"])
12 #expect(OrgPreferences.orgSettings(defaults).todoSequences.first?.done.map(\.name) == ["DONE"])
1213 #expect(OrgPreferences.options(defaults).logDone == nil && OrgPreferences.options(defaults).tagsColumn == -77)
1314 #expect(OrgPreferences.agendaSpan(defaults) == 10 && OrgPreferences.agendaStartOffset(defaults) == 0)
1415 #expect(OrgPreferences.orgSettings(defaults).deadlineWarningDays == 14)
@@ -19,7 +20,7 @@ struct OrgPreferencesTests {
1920 #expect(OrgPreferences.agendaOptions(AgendaOptions(), defaults).deadlineWarningDays == 14)
2021 #expect(OrgPreferences.reminders(defaults) && OrgPreferences.reminderLead(defaults) == 12)
2122 let fallbacks = OrgPreferences.options(defaults)
22 #expect(!fallbacks.metaReturnMaySplitLine && fallbacks.hideEmphasisMarkers && fallbacks.prettyEntities && fallbacks.subSuperscriptsNeedBraces)
23 #expect(!fallbacks.insertHeadingRespectContent && !fallbacks.metaReturnMaySplitLine && fallbacks.hideEmphasisMarkers && fallbacks.prettyEntities && fallbacks.subSuperscriptsNeedBraces)
2324 #expect(fallbacks.startupIndented && !fallbacks.spellCheck && fallbacks.hideDrawerStartup && !fallbacks.hideBlockStartup)
2425
2526 let problems = UserConfig.apply("""
docs/manual/guide/04-outlines.org +2 −2
@@ -48,10 +48,10 @@ Editing and in =config.toml= under the Emacs variable names:
4848
4949| Setting (=config.toml=) | Settings ▸ Editing | orgstar default | Org default |
5050|--------------------------------------+-----------------------------------------------+-----------------+-------------|
51| =org-insert-heading-respect-content= | M-RET adds the new heading after the subtree | =true= | =nil= |
51| =org-insert-heading-respect-content= | M-RET adds the new heading after the subtree | =false= | =nil= |
5252| =org-M-RET-may-split-line= | M-RET splits the line at the caret | =false= | =t= |
5353
54With =org-insert-heading-respect-content= on (the orgstar default), Insert Heading
54With =org-insert-heading-respect-content= on, Insert Heading
5555behaves as Insert Heading After Subtree: the new heading goes after the end of the
5656current subtree, at the current level. Insert Heading also does this when the caret is
5757in folded text.
docs/manual/guide/05-todos-and-tags.org +3 −3
@@ -15,13 +15,13 @@ Keywords come in sequences. Each sequence has active keywords, a =|=, and done k
1515
1616** The default keywords
1717
18Files without a =#+TODO= line use the keywords in Settings ▸ Editing ▸ Default TODO keywords, which is the =org-todo-keywords= key in =config.toml=. The default is:
18Files without a =#+TODO= line use the keywords in Settings ▸ Editing ▸ Default TODO keywords, which is the =org-todo-keywords= key in =config.toml=. The default is Org's, =TODO | DONE=. Doom Emacs's set, which Import from Emacs carries over from a Doom configuration, is:
1919
2020#+BEGIN_SRC org
2121TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k)
2222#+END_SRC
2323
24The value uses =#+TODO= syntax. To define more than one sequence, put one per line (=\n= in =config.toml=). orgstar reads this setting at launch, so a change takes effect after you restart the app. See [[file:13-configuration.org][Configuration]] for the file itself and for keyword colors under =[theme.todo]=.
24A =config.toml= written by an earlier version keeps the keywords it has. The value uses =#+TODO= syntax. To define more than one sequence, put one per line (=\n= in =config.toml=). orgstar reads this setting at launch, so a change takes effect after you restart the app. See [[file:13-configuration.org][Configuration]] for the file itself and for keyword colors under =[theme.todo]=.
2525
2626** Keywords in the file
2727
@@ -72,7 +72,7 @@ With speed commands on (=org-use-speed-commands=), =t= at the start of a heading
7272
7373=C-c C-t= behaves in one of two ways:
7474
75- If any keyword in the file has a fast-selection key, it opens fast selection (=org-use-fast-todo-selection= =auto=). The default keywords all have keys, so this is what you get unless you define keywords without keys.
75- If any keyword in the file has a fast-selection key, it opens fast selection (=org-use-fast-todo-selection= =auto=). The default keywords have no keys, so =C-c C-t= cycles until you define keywords with keys, as Doom's set has them.
7676- Otherwise it cycles: no keyword, then each keyword of the first sequence in order, then no keyword again. From a keyword in another sequence it moves through that sequence and then to no keyword. From a =#+TYP_TODO= keyword it goes straight to the sequence's first done keyword, as Org does; pressing =C-c C-t= again right away moves to the next type keyword instead. In the iOS app and the agenda, each press on a type keyword goes to the done keyword.
7777
7878=S-<right>= and =S-<left>= never use fast selection. They step through every keyword of every sequence in order, then to no keyword, and wrap around.
docs/manual/guide/07-agenda.org +1 −1
@@ -253,7 +253,7 @@ Completing or editing a reminder is done in Reminders. On the Mac, double-click
253253A keyword that isn't in =org-todo-keywords= or the file's =#+TODO= lines is not a keyword to orgstar, as to Org: it is part of the title. A heading such as =SKIPPED Call the bank= with a =SCHEDULED= date last week is therefore an open entry, and shows as overdue. To make such a word a done state, add it after the ~|~:
254254
255255#+BEGIN_SRC toml
256org-todo-keywords = "TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k) SKIPPED"
256org-todo-keywords = "TODO | DONE SKIPPED"
257257#+END_SRC
258258
259259Done entries leave the Overdue group. With =org-agenda-skip-scheduled-if-done= and =org-agenda-skip-deadline-if-done= on, they leave their own day too.
docs/manual/guide/13-configuration.org +3 −3
@@ -67,7 +67,7 @@ Automatic saving writes a file one second after you stop typing. The keymap pres
6767| Control | Choices or range | Default | Key |
6868|------------------------------------------------------------+--------------------------------------------------------+---------------------+--------------------------------------|
6969| Tags | Aligned to end at column 77; One space after the title | Aligned (=-77=) | =org-tags-column= |
70| M-RET adds the new heading after the subtree | On or off | On | =org-insert-heading-respect-content= |
70| M-RET adds the new heading after the subtree | On or off | Off | =org-insert-heading-respect-content= |
7171| M-RET splits the line at the caret | On or off | Off | =org-M-RET-may-split-line= |
7272| Lists can use letters (a. b. c.) | On or off | On | =org-list-allow-alphabetical= |
7373| M-q fills to column N | 40 to 200 | 80 | =fill-column= |
@@ -205,7 +205,7 @@ A key you remove from the file goes back to its default. A key that isn't in the
205205|--------------------------------------+---------+---------+----------------------------------------------------------------------------------------------------------------|
206206| =fill-column= | integer | =80= | The column =M-q= fills to. Mirrors =fill-column=. |
207207| =org-tags-column= | integer | =-77= | Negative: tags end at that column. =0=: one space between title and tags. Mirrors =org-tags-column=. |
208| =org-insert-heading-respect-content= | boolean | =true= | =M-RET= adds the new heading after the current subtree. Mirrors =org-insert-heading-respect-content=. |
208| =org-insert-heading-respect-content= | boolean | =false= | =M-RET= adds the new heading after the current subtree. Mirrors =org-insert-heading-respect-content=. |
209209| =org-M-RET-may-split-line= | boolean | =false= | =M-RET= in the middle of a line splits it at the caret. Mirrors the =default= entry of =org-M-RET-may-split-line=. |
210210| =org-list-allow-alphabetical= | boolean | =true= | =a.=, =b)=, =A.= are list bullets. Mirrors =org-list-allow-alphabetical=. |
211211| =org-hide-emphasis-markers= | boolean | =true= | Your Emacs hides =*bold*= and ~=code=~ markers; orgstar hides them when markup is hidden and measures text without them. Mirrors =org-hide-emphasis-markers=. |
@@ -287,7 +287,7 @@ A key you remove from the file goes back to its default. A key that isn't in the
287287| =org-clock-out-when-done= | string | ="t"= | ="t"=: marking the clocked entry done clocks out; ="nil"=: it doesn't; or the keywords that clock out, separated by spaces. Mirrors =org-clock-out-when-done=. |
288288| =org-clock-history-length= | integer | =5= | How many recently clocked entries orgstar remembers. Mirrors =org-clock-history-length=. |
289289
290The default =org-todo-keywords= is the first sequence of Doom Emacs's default:
290The default =org-todo-keywords= is Org's, ="TODO | DONE"=. Doom Emacs's set, as Import from Emacs writes it from a Doom configuration, is:
291291
292292#+BEGIN_SRC toml
293293org-todo-keywords = "TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k)"
docs/manual/guide/15-alongside-emacs.org −2
@@ -181,8 +181,6 @@ orgstar's defaults follow a common Doom Emacs setup rather than plain Emacs in s
181181| Setting | orgstar default | Plain Emacs default |
182182|--------------------------------------+-------------------------------------+---------------------------------|
183183| =fill-column= | 80 | 70 |
184| =org-todo-keywords= | =TODO PROJ LOOP STRT WAIT HOLD IDEA=, done =DONE KILL= | =TODO=, done =DONE= |
185| =org-insert-heading-respect-content= | =true= | =nil= |
186184| =org-M-RET-may-split-line= | =false= | =t= |
187185| =org-list-allow-alphabetical= | =true= | =nil= |
188186| =org-hide-emphasis-markers= | =true= | =nil= |