Org's defaults for TODO keywords and org-insert-heading-respect-content !330

merged merged by cmc on 2026-10-14 03:31 UTC · krz/orgstar:org-defaults into main

10 files changed, +17 −18

Layout: unified · split

Sources/OrgApp/OrgPreferences.swift +1 −1
@@ -5,7 +5,7 @@ import OrgPresentation
5/// The Org settings `config.toml` holds, read from user defaults with the file's fallbacks, for 5/// The Org settings `config.toml` holds, read from user defaults with the file's fallbacks, for
6/// both apps. 6/// both apps.
7public enum OrgPreferences { 7public 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"
9 9
10 /// TODO keywords for files without `#+TODO`, and alphabetical lists. 10 /// TODO keywords for files without `#+TODO`, and alphabetical lists.
11 public static func orgSettings(_ defaults: UserDefaults = .standard) -> OrgSettings { 11 public static func orgSettings(_ defaults: UserDefaults = .standard) -> OrgSettings {
Sources/OrgApp/UserConfig.swift +2 −2
@@ -98,7 +98,7 @@ public enum UserConfig {
98 comment: "M-q fills to this column", legacy: "editor.fill-column"), 98 comment: "M-q fills to this column", legacy: "editor.fill-column"),
99 Setting(section: "", key: "org-tags-column", defaultsKey: "tagsColumn", kind: .integer, fallback: .integer(-77), 99 Setting(section: "", key: "org-tags-column", defaultsKey: "tagsColumn", kind: .integer, fallback: .integer(-77),
100 comment: "negative: tags end at that column; 0: one space before them", legacy: "editor.tags-column"), 100 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),
102 comment: "M-RET adds the new heading after the subtree", legacy: "editor.insert-heading-respect-content"), 102 comment: "M-RET adds the new heading after the subtree", legacy: "editor.insert-heading-respect-content"),
103 Setting(section: "", key: "org-M-RET-may-split-line", defaultsKey: "splitLine", kind: .bool, fallback: .bool(false), 103 Setting(section: "", key: "org-M-RET-may-split-line", defaultsKey: "splitLine", kind: .bool, fallback: .bool(false),
104 comment: "M-RET splits the line at the caret", legacy: "editor.meta-return-may-split-line"), 104 comment: "M-RET splits the line at the caret", legacy: "editor.meta-return-may-split-line"),
@@ -110,7 +110,7 @@ public enum UserConfig {
110 comment: "hide *bold* and =code= markers when markup is hidden", legacy: "editor.hide-emphasis-markers"), 110 comment: "hide *bold* and =code= markers when markup is hidden", legacy: "editor.hide-emphasis-markers"),
111 Setting(section: "", key: "org-pretty-entities", defaultsKey: "prettyEntities", kind: .bool, fallback: .bool(true), 111 Setting(section: "", key: "org-pretty-entities", defaultsKey: "prettyEntities", kind: .bool, fallback: .bool(true),
112 comment: "\\alpha shows as α and x_{1} is lowered when markup is hidden", legacy: "editor.pretty-entities"), 112 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"),
114 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"), 114 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"),
115 Setting(section: "", key: "org-log-done", defaultsKey: "logDone", kind: .choice([("nil", "nil"), ("time", "time"), ("note", "note")]), 115 Setting(section: "", key: "org-log-done", defaultsKey: "logDone", kind: .choice([("nil", "nil"), ("time", "time"), ("note", "note")]),
116 fallback: .string("nil"), comment: "nil, time (CLOSED when done) or note (CLOSED and a note)", legacy: ""), 116 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 {
31 @AppStorage("optionAsMeta") private var optionAsMeta = OptionAsMeta.left.rawValue 31 @AppStorage("optionAsMeta") private var optionAsMeta = OptionAsMeta.left.rawValue
32 @State private var keymap = KeymapPreset.emacs.keymap 32 @State private var keymap = KeymapPreset.emacs.keymap
33 @AppStorage("tagsColumn") private var tagsColumn = -77 33 @AppStorage("tagsColumn") private var tagsColumn = -77
34 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true 34 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = false
35 @AppStorage("splitLine") private var splitLine = false 35 @AppStorage("splitLine") private var splitLine = false
36 @AppStorage("alphabeticalLists") private var alphabeticalLists = true 36 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
37 @AppStorage("fillColumn") private var fillColumn = 80 37 @AppStorage("fillColumn") private var fillColumn = 80
Sources/Orgstar/OrgstarApp.swift +1 −1
@@ -576,7 +576,7 @@ struct SettingsView: View {
576 @AppStorage("keymap") private var preset = KeymapPreset.emacs 576 @AppStorage("keymap") private var preset = KeymapPreset.emacs
577 @AppStorage("optionAsMeta") private var optionAsMeta = OptionAsMeta.left.rawValue 577 @AppStorage("optionAsMeta") private var optionAsMeta = OptionAsMeta.left.rawValue
578 @AppStorage("tagsColumn") private var tagsColumn = -77 578 @AppStorage("tagsColumn") private var tagsColumn = -77
579 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = true 579 @AppStorage("headingAfterSubtree") private var headingAfterSubtree = false
580 @AppStorage("splitLine") private var splitLine = false 580 @AppStorage("splitLine") private var splitLine = false
581 @AppStorage("alphabeticalLists") private var alphabeticalLists = true 581 @AppStorage("alphabeticalLists") private var alphabeticalLists = true
582 @AppStorage("fillColumn") private var fillColumn = 80 582 @AppStorage("fillColumn") private var fillColumn = 80
Tests/OrgAppTests/OrgPreferencesTests.swift +3 −2
@@ -8,7 +8,8 @@ struct OrgPreferencesTests {
8 @Test func readsWhatConfigTomlSets() throws { 8 @Test func readsWhatConfigTomlSets() throws {
9 let defaults = try #require(UserDefaults(suiteName: "orgstar-preferences-\(UUID().uuidString)")) 9 let defaults = try #require(UserDefaults(suiteName: "orgstar-preferences-\(UUID().uuidString)"))
10 // Nothing set: the file's fallbacks, which match the Mac's. 10 // 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"])
12 #expect(OrgPreferences.options(defaults).logDone == nil && OrgPreferences.options(defaults).tagsColumn == -77) 13 #expect(OrgPreferences.options(defaults).logDone == nil && OrgPreferences.options(defaults).tagsColumn == -77)
13 #expect(OrgPreferences.agendaSpan(defaults) == 10 && OrgPreferences.agendaStartOffset(defaults) == 0) 14 #expect(OrgPreferences.agendaSpan(defaults) == 10 && OrgPreferences.agendaStartOffset(defaults) == 0)
14 #expect(OrgPreferences.orgSettings(defaults).deadlineWarningDays == 14) 15 #expect(OrgPreferences.orgSettings(defaults).deadlineWarningDays == 14)
@@ -19,7 +20,7 @@ struct OrgPreferencesTests {
19 #expect(OrgPreferences.agendaOptions(AgendaOptions(), defaults).deadlineWarningDays == 14) 20 #expect(OrgPreferences.agendaOptions(AgendaOptions(), defaults).deadlineWarningDays == 14)
20 #expect(OrgPreferences.reminders(defaults) && OrgPreferences.reminderLead(defaults) == 12) 21 #expect(OrgPreferences.reminders(defaults) && OrgPreferences.reminderLead(defaults) == 12)
21 let fallbacks = OrgPreferences.options(defaults) 22 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)
23 #expect(fallbacks.startupIndented && !fallbacks.spellCheck && fallbacks.hideDrawerStartup && !fallbacks.hideBlockStartup) 24 #expect(fallbacks.startupIndented && !fallbacks.spellCheck && fallbacks.hideDrawerStartup && !fallbacks.hideBlockStartup)
24 25
25 let problems = UserConfig.apply(""" 26 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:
48 48
49| Setting (=config.toml=) | Settings ▸ Editing | orgstar default | Org default | 49| Setting (=config.toml=) | Settings ▸ Editing | orgstar default | Org default |
50|--------------------------------------+-----------------------------------------------+-----------------+-------------| 50|--------------------------------------+-----------------------------------------------+-----------------+-------------|
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= |
52| =org-M-RET-may-split-line= | M-RET splits the line at the caret | =false= | =t= | 52| =org-M-RET-may-split-line= | M-RET splits the line at the caret | =false= | =t= |
53 53
54With =org-insert-heading-respect-content= on (the orgstar default), Insert Heading 54With =org-insert-heading-respect-content= on, Insert Heading
55behaves as Insert Heading After Subtree: the new heading goes after the end of the 55behaves as Insert Heading After Subtree: the new heading goes after the end of the
56current subtree, at the current level. Insert Heading also does this when the caret is 56current subtree, at the current level. Insert Heading also does this when the caret is
57in folded text. 57in 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
15 15
16** The default keywords 16** The default keywords
17 17
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:
19 19
20#+BEGIN_SRC org 20#+BEGIN_SRC org
21TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k) 21TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k)
22#+END_SRC 22#+END_SRC
23 23
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]=.
25 25
26** Keywords in the file 26** Keywords in the file
27 27
@@ -72,7 +72,7 @@ With speed commands on (=org-use-speed-commands=), =t= at the start of a heading
72 72
73=C-c C-t= behaves in one of two ways: 73=C-c C-t= behaves in one of two ways:
74 74
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.
76- 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. 76- 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.
77 77
78=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. 78=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
253A 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 ~|~: 253A 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 ~|~:
254 254
255#+BEGIN_SRC toml 255#+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"
257#+END_SRC 257#+END_SRC
258 258
259Done 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. 259Done 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
67| Control | Choices or range | Default | Key | 67| Control | Choices or range | Default | Key |
68|------------------------------------------------------------+--------------------------------------------------------+---------------------+--------------------------------------| 68|------------------------------------------------------------+--------------------------------------------------------+---------------------+--------------------------------------|
69| Tags | Aligned to end at column 77; One space after the title | Aligned (=-77=) | =org-tags-column= | 69| 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= |
71| M-RET splits the line at the caret | On or off | Off | =org-M-RET-may-split-line= | 71| M-RET splits the line at the caret | On or off | Off | =org-M-RET-may-split-line= |
72| Lists can use letters (a. b. c.) | On or off | On | =org-list-allow-alphabetical= | 72| Lists can use letters (a. b. c.) | On or off | On | =org-list-allow-alphabetical= |
73| M-q fills to column N | 40 to 200 | 80 | =fill-column= | 73| 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
205|--------------------------------------+---------+---------+----------------------------------------------------------------------------------------------------------------| 205|--------------------------------------+---------+---------+----------------------------------------------------------------------------------------------------------------|
206| =fill-column= | integer | =80= | The column =M-q= fills to. Mirrors =fill-column=. | 206| =fill-column= | integer | =80= | The column =M-q= fills to. Mirrors =fill-column=. |
207| =org-tags-column= | integer | =-77= | Negative: tags end at that column. =0=: one space between title and tags. Mirrors =org-tags-column=. | 207| =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=. |
209| =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=. | 209| =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=. |
210| =org-list-allow-alphabetical= | boolean | =true= | =a.=, =b)=, =A.= are list bullets. Mirrors =org-list-allow-alphabetical=. | 210| =org-list-allow-alphabetical= | boolean | =true= | =a.=, =b)=, =A.= are list bullets. Mirrors =org-list-allow-alphabetical=. |
211| =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=. | 211| =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
287| =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=. | 287| =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=. |
288| =org-clock-history-length= | integer | =5= | How many recently clocked entries orgstar remembers. Mirrors =org-clock-history-length=. | 288| =org-clock-history-length= | integer | =5= | How many recently clocked entries orgstar remembers. Mirrors =org-clock-history-length=. |
289 289
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:
291 291
292#+BEGIN_SRC toml 292#+BEGIN_SRC toml
293org-todo-keywords = "TODO(t) PROJ(p) LOOP(r) STRT(s) WAIT(w) HOLD(h) IDEA(i) | DONE(d) KILL(k)" 293org-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
181| Setting | orgstar default | Plain Emacs default | 181| Setting | orgstar default | Plain Emacs default |
182|--------------------------------------+-------------------------------------+---------------------------------| 182|--------------------------------------+-------------------------------------+---------------------------------|
183| =fill-column= | 80 | 70 | 183| =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= |
186| =org-M-RET-may-split-line= | =false= | =t= | 184| =org-M-RET-may-split-line= | =false= | =t= |
187| =org-list-allow-alphabetical= | =true= | =nil= | 185| =org-list-allow-alphabetical= | =true= | =nil= |
188| =org-hide-emphasis-markers= | =true= | =nil= | 186| =org-hide-emphasis-markers= | =true= | =nil= |