Commit 5eef7a1686
Verified · cmc
Layout: unified · split
Sources/OrgApp/EmacsImport.swift +4
| @@ -494,6 +494,10 @@ public struct EmacsImport: Sendable { | ||
| 494 | 494 | add(name, .string(location)) |
| 495 | 495 | case "org-track-ordered-property-with-tag": |
| 496 | 496 | if let tag = value.string { add(name, .string(tag)) } else { add(name, .string(truthy ? "t" : "nil")) } |
| 497 | case "org-agenda-log-mode-items": | |
| 498 | let items = (value.elements ?? []).compactMap(\.symbol).filter { ["closed", "clock", "state"].contains($0) } | |
| 499 | guard !items.isEmpty || value.symbol == "nil" else { return note("not a list of closed, clock and state") } | |
| 500 | add(name, .string(items.joined(separator: " "))) | |
| 497 | 501 | case "org-agenda-todo-ignore-scheduled", "org-agenda-todo-ignore-deadlines", "org-agenda-todo-ignore-timestamp": |
| 498 | 502 | if let days = value.integer { add(name, .string("\(days)")) } else if let symbol = value.symbol, AgendaOptions.TodoIgnore(symbol) != nil { add(name, .string(symbol)) } else { note("unexpected value \(value.description)") } |
| 499 | 503 | case "org-structure-template-alist": |
Sources/OrgApp/OrgPreferences.swift +1
| @@ -81,6 +81,7 @@ public enum OrgPreferences { | ||
| 81 | 81 | options.enforceTodoDependencies = bool("enforceTodoDependencies", defaults) |
| 82 | 82 | options.enforceTodoCheckboxDependencies = bool("enforceTodoCheckboxDependencies", defaults) |
| 83 | 83 | options.dimBlockedTasks = AgendaOptions.DimBlocked(rawValue: string("agendaDimBlockedTasks", defaults)) ?? .dim |
| 84 | options.logItems = Set(string("agendaLogModeItems", defaults).split(whereSeparator: \.isWhitespace).map(String.init)) | |
| 84 | 85 | options.todoIgnoreWithDate = bool("agendaTodoIgnoreWithDate", defaults) |
| 85 | 86 | options.todoIgnoreScheduled = AgendaOptions.TodoIgnore(string("agendaTodoIgnoreScheduled", defaults)) ?? .off |
| 86 | 87 | options.todoIgnoreDeadlines = AgendaOptions.TodoIgnore(string("agendaTodoIgnoreDeadlines", defaults), deadlines: true) ?? .off |
Sources/OrgApp/UserConfig.swift +2
| @@ -162,6 +162,8 @@ public enum UserConfig { | ||
| 162 | 162 | comment: "leave done entries out of the agenda even on the day they are scheduled", legacy: ""), |
| 163 | 163 | Setting(section: "", key: "org-agenda-skip-deadline-if-done", defaultsKey: "agendaSkipDeadlineIfDone", kind: .bool, fallback: .bool(false), |
| 164 | 164 | comment: "leave done entries out of the agenda even on the day they are due", legacy: ""), |
| 165 | Setting(section: "", key: "org-agenda-log-mode-items", defaultsKey: "agendaLogModeItems", kind: .string, fallback: .string("closed clock"), | |
| 166 | comment: "what log mode shows, separated by spaces: closed, clock, state", legacy: ""), | |
| 165 | 167 | Setting(section: "", key: "org-agenda-todo-ignore-with-date", defaultsKey: "agendaTodoIgnoreWithDate", kind: .bool, fallback: .bool(false), |
| 166 | 168 | comment: "the TODO list leaves out entries with any active timestamp", legacy: ""), |
| 167 | 169 | Setting(section: "", key: "org-agenda-todo-ignore-scheduled", defaultsKey: "agendaTodoIgnoreScheduled", kind: .string, fallback: .string("nil"), |
Tests/OrgAppTests/EmacsImportTests.swift +3 −1
| @@ -47,6 +47,7 @@ struct EmacsImportTests { | ||
| 47 | 47 | org-archive-location "archive/%s::" |
| 48 | 48 | org-agenda-todo-ignore-scheduled 'future |
| 49 | 49 | org-agenda-todo-ignore-deadlines 7 |
| 50 | org-agenda-log-mode-items '(closed clock state) | |
| 50 | 51 | org-agenda-start-day "-3d" |
| 51 | 52 | org-clock-idle-time 15 |
| 52 | 53 | org-clock-history-length 10 |
| @@ -92,6 +93,7 @@ struct EmacsImportTests { | ||
| 92 | 93 | #expect(s["org-agenda-start-on-weekday"] == .string("0")) |
| 93 | 94 | #expect(s["org-track-ordered-property-with-tag"] == .string("t")) |
| 94 | 95 | #expect(s["org-archive-location"] == .string("archive/%s::")) |
| 96 | #expect(s["org-agenda-log-mode-items"] == .string("closed clock state")) | |
| 95 | 97 | #expect(s["org-agenda-todo-ignore-scheduled"] == .string("future") && s["org-agenda-todo-ignore-deadlines"] == .string("7")) |
| 96 | 98 | #expect(s["org-agenda-start-day"] == .string("-3d")) |
| 97 | 99 | #expect(s["org-clock-idle-time"] == .integer(15)) |
| @@ -184,7 +186,7 @@ struct EmacsImportTests { | ||
| 184 | 186 | let keymap = folder.appendingPathComponent("keymap.toml") |
| 185 | 187 | #expect(KeymapLoader.load(.doom, userFile: keymap).problems.isEmpty) |
| 186 | 188 | #expect(KeymapLoader.load(.doom, userFile: keymap).keymap.keyLabels(for: "app.agenda", modes: ["normal"]).contains("C-c a")) |
| 187 | #expect(summary.hasPrefix("Imported 25 settings, 3 capture templates, 3 key bindings, 2 structure templates."), "\(summary)") | |
| 189 | #expect(summary.hasPrefix("Imported 26 settings, 3 capture templates, 3 key bindings, 2 structure templates."), "\(summary)") | |
| 188 | 190 | #expect(UserConfig.structureTemplates(defaults) == [.init(key: "el", type: "src emacs-lisp"), .init(key: "q", type: "QUOTE")]) |
| 189 | 191 | #expect(OrgPreferences.options(defaults).structureTemplates?.first { $0.key == "q" }?.type == "QUOTE") |
| 190 | 192 | #expect(defaults.string(forKey: "themeFont") == "JetBrains Mono") |
Tests/OrgAppTests/OrgPreferencesTests.swift +2
| @@ -34,6 +34,7 @@ struct OrgPreferencesTests { | ||
| 34 | 34 | org-archive-location = "~/org/archive.org::* %s" |
| 35 | 35 | org-agenda-todo-ignore-deadlines = "t" |
| 36 | 36 | org-agenda-todo-ignore-scheduled = "-2" |
| 37 | org-agenda-log-mode-items = "closed state" | |
| 37 | 38 | org-M-RET-may-split-line = true |
| 38 | 39 | org-hide-emphasis-markers = false |
| 39 | 40 | org-pretty-entities = false |
| @@ -51,6 +52,7 @@ struct OrgPreferencesTests { | ||
| 51 | 52 | #expect(OrgPreferences.options(defaults).trackOrderedPropertyWithTag == "ORDERED") |
| 52 | 53 | #expect(OrgPreferences.options(defaults).archiveLocation == "~/org/archive.org::* %s") |
| 53 | 54 | let ignoring = OrgPreferences.agendaOptions(AgendaOptions(), defaults) |
| 55 | #expect(ignoring.logItems == ["closed", "state"]) | |
| 54 | 56 | #expect(ignoring.todoIgnoreDeadlines == .near && ignoring.todoIgnoreScheduled == .days(-2) && ignoring.todoIgnoreTimestamp == .off) |
| 55 | 57 | #expect(OrgPreferences.agendaOptions(AgendaOptions(), defaults).deadlineWarningDays == 5) |
| 56 | 58 | #expect(!OrgPreferences.reminders(defaults) && OrgPreferences.reminderLead(defaults) == 30) |
Tests/OrgCoreTests/AgendaTests.swift +9 −1
| @@ -115,12 +115,13 @@ enum AgendaOracle { | ||
| 115 | 115 | |
| 116 | 116 | static func compare( |
| 117 | 117 | files: [(name: String, text: String)], start: Int, span: Int, today: Int, hour: Int = 9, minute: Int = 30, |
| 118 | prefix: [String: String]? = nil, logMode: Bool = false, skipIfDone: Bool = false | |
| 118 | prefix: [String: String]? = nil, logMode: Bool = false, logItems: Set<String>? = nil, skipIfDone: Bool = false | |
| 119 | 119 | ) throws { |
| 120 | 120 | let date = Days.date(start) |
| 121 | 121 | var form = "(org-agenda-list nil \"\(String(format: "%04d-%02d-%02d", date.year, date.month, date.day))\" \(span))" |
| 122 | 122 | if let prefix { form = "(let ((org-agenda-prefix-format \(prefixLisp(prefix)))) \(form))" } |
| 123 | 123 | if logMode { form = "(let ((org-agenda-start-with-log-mode t)) \(form))" } |
| 124 | if let logItems { form = "(let ((org-agenda-log-mode-items '(\(logItems.sorted().joined(separator: " "))))) \(form))" } | |
| 124 | 125 | if skipIfDone { form = "(let ((org-agenda-skip-scheduled-if-done t) (org-agenda-skip-deadline-if-done t)) \(form))" } |
| 125 | 126 | let emacs = try run(files: files, form: form, today: today, hour: hour, minute: minute) |
| 126 | 127 | let defaults = OrgSettings.default.withTodoKeywords(keywords)! |
| @@ -128,6 +129,7 @@ enum AgendaOracle { | ||
| 128 | 129 | var options = AgendaOptions.terminal |
| 129 | 130 | if let prefix { options.prefixFormat = prefix } |
| 130 | 131 | options.logMode = logMode |
| 132 | if let logItems { options.logItems = logItems } | |
| 131 | 133 | options.skipScheduledIfDone = skipIfDone |
| 132 | 134 | options.skipDeadlineIfDone = skipIfDone |
| 133 | 135 | let ours = Agenda.list(sources, start: start, days: span, today: today, now: (hour, minute), options: options) |
| @@ -501,6 +503,9 @@ struct AgendaLogModeTests { | ||
| 501 | 503 | * DONE Ship release :work: |
| 502 | 504 | CLOSED: [2026-10-05 Mon 16:20] SCHEDULED: <2026-10-05 Mon> |
| 503 | 505 | :LOGBOOK: |
| 506 | - State "DONE" from "NEXT" [2026-10-05 Mon 16:20] \\ | |
| 507 | Shipped at last | |
| 508 | - State "NEXT" from "TODO" [2026-10-04 Sun 08:15] | |
| 504 | 509 | CLOCK: [2026-10-05 Mon 14:00]--[2026-10-05 Mon 15:30] => 1:30 |
| 505 | 510 | - Fixed the build |
| 506 | 511 | CLOCK: [2026-10-04 Sun 22:00]--[2026-10-05 Mon 01:15] => 3:15 |
| @@ -523,6 +528,9 @@ struct AgendaLogModeTests { | ||
| 523 | 528 | let today = Days.absolute(year: 2026, month: 10, day: 5) |
| 524 | 529 | try AgendaOracle.compare(files: [("log.org", Self.file)], start: today - 1, span: 3, today: today, logMode: true) |
| 525 | 530 | try AgendaOracle.compare(files: [("log.org", Self.file)], start: today - 1, span: 3, today: today, prefix: ["agenda": " %-8:c%?-12t%s %l"], logMode: true) |
| 531 | for items: Set<String> in [["closed", "clock", "state"], ["state"], ["closed"]] { | |
| 532 | try AgendaOracle.compare(files: [("log.org", Self.file)], start: today - 1, span: 3, today: today, logMode: true, logItems: items) | |
| 533 | } | |
| 526 | 534 | } |
| 527 | 535 | } |
| 528 | 536 | |
docs/manual/guide/07-agenda.org +3 −2
| @@ -125,9 +125,10 @@ Days are sorted as =org-agenda-sorting-strategy= sorts them by default for the a | ||
| 125 | 125 | Press =l= to turn log mode (=org-agenda-log-mode=) on or off; on iOS, use Log Mode in the span menu. Each day then also shows: |
| 126 | 126 | |
| 127 | 127 | - =Closed= entries whose =CLOSED:= timestamp is on that day; |
| 128 | - =Clocked= entries for each =CLOCK:= line that starts on that day, with the clock's start and end times in the left column and the time clocked, such as =1:30=, after the title. | |
| 128 | - =Clocked= entries for each =CLOCK:= line that starts on that day, with the clock's start and end times in the left column and the time clocked, such as =1:30=, after the title; | |
| 129 | - with =state= in =org-agenda-log-mode-items=, =State:= entries for each state change logged that day (a =- State "DONE" from "TODO" [2026-10-05 Mon 16:20]= line), with the new state in parentheses and the note's first line after the title. | |
| 129 | 130 | |
| 130 | A note under a clock line (a list item directly below it) is added to the title after a =-=. These are the default =org-agenda-log-mode-items=, =(closed clock)=; state changes are not shown and there is no setting for that. | |
| 131 | A note under a clock line (a list item directly below it) is added to the title after a =-=. =org-agenda-log-mode-items= in =config.toml= picks the kinds, separated by spaces; the default is Org's, ="closed clock"=. | |
| 131 | 132 | |
| 132 | 133 | * Rows |
| 133 | 134 | |
docs/manual/guide/13-configuration.org +3
| @@ -161,6 +161,7 @@ These settings have no control in the Settings window. Some are in the View menu | ||
| 161 | 161 | | =org-deadline-warning-days= | | |
| 162 | 162 | | =org-agenda-skip-scheduled-if-done= | | |
| 163 | 163 | | =org-agenda-skip-deadline-if-done= | | |
| 164 | | =org-agenda-log-mode-items= | | | |
| 164 | 165 | | =org-agenda-todo-ignore-with-date=, =org-agenda-todo-ignore-scheduled=, =org-agenda-todo-ignore-deadlines=, =org-agenda-todo-ignore-timestamp=, =org-agenda-tags-todo-honor-ignore-options= | | |
| 165 | 166 | | =org-agenda-search-view-always-boolean= | | |
| 166 | 167 | | =org-agenda-search-view-force-full-words= | | |
| @@ -211,6 +212,7 @@ A key you remove from the file goes back to its default. A key that isn't in the | ||
| 211 | 212 | | =org-agenda-show-all-dates= | boolean | =false= | Show days without entries in the agenda; today always shows. Emacs's default is =t=. Mirrors =org-agenda-show-all-dates=. | |
| 212 | 213 | | =org-agenda-skip-scheduled-if-done= | boolean | =false= | Leave a done entry's scheduled date out of the agenda, even on its own day. Mirrors =org-agenda-skip-scheduled-if-done=. | |
| 213 | 214 | | =org-agenda-skip-deadline-if-done= | boolean | =false= | Leave a done entry's deadline out of the agenda, even on its own day. Mirrors =org-agenda-skip-deadline-if-done=. | |
| 215 | | =org-agenda-log-mode-items= | string | ="closed clock"= | What log mode shows, separated by spaces: =closed=, =clock= and =state=. Mirrors =org-agenda-log-mode-items=. | | |
| 214 | 216 | | =org-agenda-todo-ignore-with-date= | boolean | =false= | The TODO list leaves out entries with an active timestamp anywhere in their text. Mirrors =org-agenda-todo-ignore-with-date=. | |
| 215 | 217 | | =org-agenda-todo-ignore-scheduled= | string | ="nil"= | The TODO list leaves out scheduled entries: ="all"= (or ="t"=) all of them, ="future"= those scheduled after today, ="past"= today or before, ="N"= N or more days ahead, ="-N"= N or more days ago. Mirrors =org-agenda-todo-ignore-scheduled=. | |
| 216 | 218 | | =org-agenda-todo-ignore-deadlines= | string | ="nil"= | As the last, for deadlines: ="near"= (or ="t"=) those within their warning period, ="far"= those beyond it, ="all"=, ="future"=, ="past"=, ="N"=, ="-N"=. Mirrors =org-agenda-todo-ignore-deadlines=. | |
| @@ -471,6 +473,7 @@ Only variables whose names start with =org-=, =appt-=, =display-line-numbers=, = | ||
| 471 | 473 | | =org-clock-history-length= | The same key, when the value is a positive number | |
| 472 | 474 | | =org-agenda-start-day= | A day offset such as ="-3d"=; =nil= becomes ="+0d"=. Other forms aren't supported. | |
| 473 | 475 | | =org-agenda-start-on-weekday= | ="0"= to ="6"=, or ="nil"= | |
| 476 | | =org-agenda-log-mode-items= | The symbols =closed=, =clock= and =state= of the list, separated by spaces | | |
| 474 | 477 | | =org-agenda-todo-ignore-scheduled=, =-deadlines=, =-timestamp= | The symbol or number as a string; =org-agenda-todo-ignore-with-date= and =org-agenda-tags-todo-honor-ignore-options= as booleans | |
| 475 | 478 | | =org-track-ordered-property-with-tag= | A tag name as given; =t= becomes ="t"=, =nil= ="nil"= | |
| 476 | 479 | | =org-archive-location= | The same key, when the value is a =file::heading= string | |
docs/manual/guide/14-ios.org +1 −1
| @@ -351,7 +351,7 @@ These settings from =config.toml= apply on iOS: | ||
| 351 | 351 | - =org-archive-location=, =[org-structure-template-alist]= |
| 352 | 352 | - =org-use-speed-commands=, with a hardware keyboard |
| 353 | 353 | - =electric-pair-mode=, =spell-check= |
| 354 | - =org-agenda-span=, =org-agenda-start-day=, =org-agenda-start-on-weekday=, =org-deadline-warning-days=, =agenda-include-subfolders=, =org-agenda-show-all-dates=, =org-agenda-skip-scheduled-if-done=, =org-agenda-skip-deadline-if-done=, =org-agenda-search-view-always-boolean=, =org-agenda-search-view-force-full-words=, the =org-agenda-todo-ignore-= settings, =org-agenda-tags-todo-honor-ignore-options= | |
| 354 | - =org-agenda-span=, =org-agenda-start-day=, =org-agenda-start-on-weekday=, =org-deadline-warning-days=, =agenda-include-subfolders=, =org-agenda-show-all-dates=, =org-agenda-skip-scheduled-if-done=, =org-agenda-skip-deadline-if-done=, =org-agenda-search-view-always-boolean=, =org-agenda-search-view-force-full-words=, =org-agenda-log-mode-items=, the =org-agenda-todo-ignore-= settings, =org-agenda-tags-todo-honor-ignore-options= | |
| 355 | 355 | - =calendar-events=, =calendar-event-calendars= |
| 356 | 356 | - =reminders=, =appt-message-warning-time= |
| 357 | 357 | - =org-clock-history-length= |