Tag inheritance settings and org-tag-alist !257

merged merged by cmc on 2026-10-11 09:12 UTC · krz/orgstar:tag-inheritance into main

18 files changed, +184 −17

Layout: unified · split

Sources/OrgApp/EmacsImport.swift +39
@@ -492,6 +492,15 @@ public struct EmacsImport: Sendable {
492492 case "org-archive-location":
493493 guard let location = value.string, location.contains("::") else { return note("not a file::heading location") }
494494 add(name, .string(location))
495 case "org-use-tag-inheritance":
496 if let regexp = value.string { add(name, .string("{\(regexp)}")) } else if let tags = value.elements, !tags.isEmpty {
497 add(name, .string(tags.compactMap(\.string).joined(separator: " ")))
498 } else { add(name, .string(truthy ? "t" : "nil")) }
499 case "org-tags-exclude-from-inheritance":
500 add(name, .string((value.elements ?? []).compactMap(\.string).joined(separator: " ")))
501 case "org-tag-alist":
502 guard let alist = Self.tagAlist(value.elements ?? []) else { return note("entries orgstar can't read") }
503 add(name, .string(alist))
495504 case "org-track-ordered-property-with-tag":
496505 if let tag = value.string { add(name, .string(tag)) } else { add(name, .string(truthy ? "t" : "nil")) }
497506 case "org-agenda-log-mode-items":
@@ -595,6 +604,36 @@ public struct EmacsImport: Sendable {
595604 }
596605 }
597606
607 /// `org-tag-alist` in `#+TAGS` syntax: `("work" . ?w)` is `work(w)`, `(:startgroup)` `{`,
608 /// `(:startgrouptag)` `[`, `(:grouptags)` `:`, and `(:newline)` a new line.
609 static func tagAlist(_ entries: [Sexp]) -> String? {
610 var lines: [[String]] = [[]]
611 for entry in entries {
612 let marker = entry.elements?.first?.symbol ?? entry.symbol
613 switch marker {
614 case ":startgroup": lines[lines.count - 1].append("{")
615 case ":endgroup": lines[lines.count - 1].append("}")
616 case ":startgrouptag": lines[lines.count - 1].append("[")
617 case ":endgrouptag": lines[lines.count - 1].append("]")
618 case ":grouptags": lines[lines.count - 1].append(":")
619 case ":newline": lines.append([])
620 default:
621 if let tag = entry.string {
622 lines[lines.count - 1].append(tag)
623 } else if case .dotted(let head, let key) = entry, head.count == 1, let tag = head[0].string {
624 guard case .character(let code) = key, let scalar = Unicode.Scalar(code) else {
625 lines[lines.count - 1].append(tag)
626 continue
627 }
628 lines[lines.count - 1].append("\(tag)(\(Character(scalar)))")
629 } else {
630 return nil
631 }
632 }
633 }
634 return lines.map { $0.joined(separator: " ") }.filter { !$0.isEmpty }.joined(separator: "\n")
635 }
636
598637 /// `("el" . "src emacs-lisp")` entries that aren't Org's own.
599638 mutating func structureTemplates(_ entries: [Sexp], source: String, id: () -> Int) {
600639 for entry in entries {
Sources/OrgApp/OrgPreferences.swift +3
@@ -14,6 +14,8 @@ public enum OrgPreferences {
1414 settings.listAllowAlphabetical = bool("alphabeticalLists", defaults)
1515 settings.propertyInheritance = .init(string("propertyInheritance", defaults))
1616 settings.deadlineWarningDays = integer("deadlineWarningDays", defaults)
17 settings.tagInheritance = .init(string("tagInheritance", defaults))
18 settings.tagsExcludedFromInheritance = Set(string("tagsExcludedFromInheritance", defaults).split(whereSeparator: \.isWhitespace).map(String.init))
1719 return settings
1820 }
1921
@@ -37,6 +39,7 @@ public enum OrgPreferences {
3739 options.enforceTodoCheckboxDependencies = bool("enforceTodoCheckboxDependencies", defaults)
3840 options.archiveLocation = string("archiveLocation", defaults).nonEmpty
3941 options.clockIntoDrawer = string("clockIntoDrawer", defaults).nonEmpty
42 options.tagAlist = string("tagAlist", defaults).nonEmpty
4043 options.clockRoundingMinutes = integer("clockRoundingMinutes", defaults)
4144 options.clockOutRemoveZeroTimeClocks = bool("clockRemoveZeroTime", defaults)
4245 options.clockInSwitchToState = string("clockInSwitchToState", defaults).nonEmpty
Sources/OrgApp/UserConfig.swift +6
@@ -123,6 +123,12 @@ public enum UserConfig {
123123 comment: "an entry can't be done while it has unchecked boxes", legacy: ""),
124124 Setting(section: "", key: "org-archive-location", defaultsKey: "archiveLocation", kind: .string, fallback: .string("%s_archive::"),
125125 comment: "where Archive Subtree moves an entry without an ARCHIVE property or #+ARCHIVE: file::heading, %s the file's name", legacy: ""),
126 Setting(section: "", key: "org-use-tag-inheritance", defaultsKey: "tagInheritance", kind: .string, fallback: .string("t"),
127 comment: "t, nil, tags that inherit separated by spaces, or a regexp in braces such as \"{^@}\"", legacy: ""),
128 Setting(section: "", key: "org-tags-exclude-from-inheritance", defaultsKey: "tagsExcludedFromInheritance", kind: .string, fallback: .string(""),
129 comment: "tags that never inherit, separated by spaces", legacy: ""),
130 Setting(section: "", key: "org-tag-alist", defaultsKey: "tagAlist", kind: .string, fallback: .string(""),
131 comment: "tags C-c C-q offers in files without #+TAGS, in #+TAGS syntax: \"work(w) home(h) { @office(o) @home(H) }\"", legacy: ""),
126132 Setting(section: "", key: "org-track-ordered-property-with-tag", defaultsKey: "trackOrderedTag", kind: .string, fallback: .string("nil"),
127133 comment: "nil, t (the tag ORDERED) or a tag that Toggle ORDERED Property toggles too", legacy: ""),
128134 Setting(section: "", key: "org-startup-indented", defaultsKey: "startupIndented", kind: .bool, fallback: .bool(true),
Sources/OrgCore/Agenda/AgendaSource.swift +1
@@ -213,6 +213,7 @@ public struct AgendaSource: Sendable {
213213
214214 var itags: [String] = fileTags
215215 for ancestor in model.ancestors(of: index) { itags += model.headings[ancestor].localTags }
216 itags = itags.filter(settings.inheritsTag)
216217 var tags: [(String, Bool)] = itags.map { ($0, true) } + info.localTags.map { ($0, false) }
217218 // `delete-dups` over the reversed list: the most local copy of a tag stays.
218219 var seen: Set<String> = []
Sources/OrgCore/Commands/Archive.swift +1 −1
@@ -121,7 +121,7 @@ extension EmacsBuffer {
121121 while upHeadingSafe() != nil { ancestors.insert(lineTags(point), at: 0) }
122122 var inherited: [String] = []
123123 let fileTags = (keyword("FILETAGS") ?? "").split(whereSeparator: { $0 == ":" || $0 == " " || $0 == "\t" }).map(String.init)
124 for tag in fileTags + ancestors.flatMap({ $0 }) where !inherited.contains(tag) && !local.contains(tag) { inherited.append(tag) }
124 for tag in fileTags + ancestors.flatMap({ $0 }) where settings.inheritsTag(tag) && !inherited.contains(tag) && !local.contains(tag) { inherited.append(tag) }
125125 return (local, inherited)
126126 }
127127 }
Sources/OrgCore/Commands/ColumnView.swift +2 −4
@@ -216,9 +216,7 @@ public enum ColumnView {
216216 case "PRIORITY": return h.priority ?? model.orgSettings.priorities.default
217217 case "TAGS": return h.localTags.isEmpty ? "" : ":" + h.localTags.joined(separator: ":") + ":"
218218 case "ALLTAGS":
219 let tags = model.ancestors(of: index).flatMap { model.headings[$0].localTags } + h.localTags
220 var seen: Set<String> = []
221 let all = (model.fileTags + tags).filter { seen.insert($0).inserted }
219 let all = model.tags(of: index).map(\.value)
222220 return all.isEmpty ? "" : ":" + all.joined(separator: ":") + ":"
223221 case "DEADLINE", "SCHEDULED", "CLOSED":
224222 // From the planning line under the heading.
@@ -340,7 +338,7 @@ public enum ColumnView {
340338 if others.isEmpty { continue }
341339 }
342340 if !excludeTags.isEmpty {
343 let tags = model.ancestors(of: i).flatMap { headings[$0].localTags } + headings[i].localTags + model.fileTags
341 let tags = model.tags(of: i).map(\.value)
344342 if tags.contains(where: excludeTags.contains) { continue }
345343 }
346344 rows.append(Row(level: level, start: headings[i].headingRange.lowerBound, values: values))
Sources/OrgCore/Commands/Command.swift +3
@@ -27,6 +27,9 @@ public struct EditingOptions: Sendable, Equatable, Codable {
2727 public var enforceTodoDependencies = false
2828 /// `org-enforce-todo-checkbox-dependencies`: an entry can't become done with unchecked boxes.
2929 public var enforceTodoCheckboxDependencies = false
30 /// `org-tag-alist` in `#+TAGS` syntax, a line for each `:newline`: the tags C-c C-q offers in
31 /// files without `#+TAGS`.
32 public var tagAlist: String?
3033 /// `org-clock-rounding-minutes`: clocks start and end on multiples of this many minutes.
3134 public var clockRoundingMinutes = 0
3235 /// `org-clock-out-remove-zero-time-clocks`.
Sources/OrgCore/Commands/TagCommands.swift +3 −1
@@ -37,7 +37,9 @@ public struct SetTags: OrgCommand {
3737 }
3838 let currentText = HeadingLine(heading).tags.map { (context.text as NSString).substring(with: NSRange($0.range)) } ?? ""
3939 let current = currentText.split(separator: ":").map(String.init)
40 let table = FastSelection.tagTable(context.tree.settings.setupKeywords + context.text) ?? Self.bufferTags(context).map { .option(key: "\0", name: $0) }
40 let table = FastSelection.tagTable(context.tree.settings.setupKeywords + context.text)
41 ?? context.options.tagAlist.flatMap { alist in FastSelection.tagTable(alist.split(separator: "\n").map { "#+TAGS: " + $0 }.joined(separator: "\n")) }
42 ?? Self.bufferTags(context).map { .option(key: "\0", name: $0) }
4143 let tags: [String]
4244 if let fast = FastSelection.tags(table: table, current: current, inherited: inheritedTags(context)) {
4345 guard let answer = context.answers["tags"] else {
Sources/OrgCore/Parser/Settings.swift +10
@@ -51,6 +51,14 @@ public struct OrgSettings: Sendable, Equatable {
5151 public var propertyInheritance: SemanticSettings.PropertyInheritance = .none
5252 /// `org-deadline-warning-days`.
5353 public var deadlineWarningDays = 14
54 /// `org-use-tag-inheritance` and `org-tags-exclude-from-inheritance`.
55 public var tagInheritance: SemanticSettings.TagInheritance = .all
56 public var tagsExcludedFromInheritance: Set<String> = []
57
58 /// `org-remove-uninherited-tags` for one tag.
59 public func inheritsTag(_ tag: String) -> Bool {
60 SemanticSettings(tagInheritance: tagInheritance, tagsExcludedFromInheritance: tagsExcludedFromInheritance).inheritsTag(tag)
61 }
5462 /// Keyword lines from the file's `#+SETUPFILE`s, as `#+KEY: value` lines: they count as
5563 /// the file's own, before them.
5664 public var setupKeywords = ""
@@ -139,6 +147,8 @@ enum SettingsScanner {
139147 settings.listAllowAlphabetical = defaults.listAllowAlphabetical
140148 settings.propertyInheritance = defaults.propertyInheritance
141149 settings.deadlineWarningDays = defaults.deadlineWarningDays
150 settings.tagInheritance = defaults.tagInheritance
151 settings.tagsExcludedFromInheritance = defaults.tagsExcludedFromInheritance
142152 settings.setupKeywords = defaults.setupKeywords
143153 settings.startup = startup
144154 return settings
Sources/OrgCore/Semantic/DocumentModel.swift +6 −4
@@ -21,9 +21,11 @@ public struct DocumentModel: Sendable {
2121
2222 private typealias PendingBlock = (node: SyntaxNode, heading: Int?, affiliated: [SyntaxNode])
2323
24 /// `settings` default to the tree's property inheritance.
24 /// `settings` default to the tree's tag and property inheritance.
2525 public init(tree: OrgTree, settings: SemanticSettings? = nil) {
26 self.settings = settings ?? SemanticSettings(propertyInheritance: tree.settings.propertyInheritance)
26 self.settings = settings ?? SemanticSettings(tagInheritance: tree.settings.tagInheritance,
27 tagsExcludedFromInheritance: tree.settings.tagsExcludedFromInheritance,
28 propertyInheritance: tree.settings.propertyInheritance)
2729 self.orgSettings = tree.settings
2830 for (key, value) in SetupFile.keywords(tree.settings.setupKeywords) { fileKeyword(key, value.trimmingCharacters(in: .whitespaces)) }
2931 var pending: [PendingBlock] = []
@@ -93,10 +95,10 @@ public struct DocumentModel: Sendable {
9395 public func tags(of index: Int) -> [Resolved<String>] {
9496 let local = headings[index].localTags
9597 var inherited: [Resolved<String>] = []
96 if settings.tagInheritance {
98 if settings.tagInheritance != .none {
9799 let layers = [(fileTags, ValueSource.file)] + ancestors(of: index).map { (headings[$0].localTags, ValueSource.heading($0)) }
98100 for (tags, source) in layers {
99 for tag in tags where !settings.tagsExcludedFromInheritance.contains(tag)
101 for tag in tags where settings.inheritsTag(tag)
100102 && !local.contains(tag) && !inherited.contains(where: { $0.value == tag }) {
101103 inherited.append(Resolved(tag, source))
102104 }
Sources/OrgCore/Semantic/SemanticSettings.swift +37 −2
@@ -21,12 +21,47 @@ public struct SemanticSettings: Sendable, Equatable {
2121 }
2222 }
2323
24 public var tagInheritance: Bool
24 /// `org-use-tag-inheritance`.
25 public enum TagInheritance: Sendable, Equatable {
26 case all, none
27 /// Only these tags.
28 case only(Set<String>)
29 /// Tags this regular expression matches.
30 case matching(String)
31
32 /// As `config.toml` writes it: `t`, `nil`, tag names separated by spaces, or a regular
33 /// expression in braces, `{^@}`.
34 public init(_ text: String) {
35 let trimmed = text.trimmingCharacters(in: .whitespaces)
36 if trimmed.isEmpty || trimmed == "t" {
37 self = .all
38 } else if trimmed == "nil" {
39 self = .none
40 } else if trimmed.hasPrefix("{"), trimmed.hasSuffix("}"), trimmed.count >= 2 {
41 self = .matching(String(trimmed.dropFirst().dropLast()))
42 } else {
43 self = .only(Set(trimmed.split(whereSeparator: \.isWhitespace).map(String.init)))
44 }
45 }
46 }
47
48 public var tagInheritance: TagInheritance
2549 public var tagsExcludedFromInheritance: Set<String>
2650 public var propertyInheritance: PropertyInheritance
2751
52 /// `org-remove-uninherited-tags` for one tag: whether `tag` passes to children.
53 public func inheritsTag(_ tag: String) -> Bool {
54 switch tagInheritance {
55 case .all: !tagsExcludedFromInheritance.contains(tag)
56 case .none: false
57 case .only(let tags): tags.contains(tag)
58 case .matching(let pattern):
59 tag.range(of: pattern, options: .regularExpression) != nil && !tagsExcludedFromInheritance.contains(tag)
60 }
61 }
62
2863 public init(
29 tagInheritance: Bool = true,
64 tagInheritance: TagInheritance = .all,
3065 tagsExcludedFromInheritance: Set<String> = [],
3166 propertyInheritance: PropertyInheritance = .none
3267 ) {
Tests/OrgAppTests/EmacsImportTests.swift +6 −1
@@ -51,6 +51,9 @@ struct EmacsImportTests {
5151 org-clock-into-drawer "CLOCKS"
5252 org-clock-rounding-minutes 5
5353 org-clock-out-when-done '("DONE" "KILL")
54 org-use-tag-inheritance "^@"
55 org-tags-exclude-from-inheritance '("proj" "crypt")
56 org-tag-alist '(("work" . ?w) ("home" . ?h) (:newline) (:startgroup) ("@office" . ?o) "@home" (:endgroup))
5457 org-agenda-start-day "-3d"
5558 org-clock-idle-time 15
5659 org-clock-history-length 10
@@ -97,6 +100,8 @@ struct EmacsImportTests {
97100 #expect(s["org-track-ordered-property-with-tag"] == .string("t"))
98101 #expect(s["org-archive-location"] == .string("archive/%s::"))
99102 #expect(s["org-agenda-log-mode-items"] == .string("closed clock state") && s["org-clock-into-drawer"] == .string("CLOCKS"))
103 #expect(s["org-use-tag-inheritance"] == .string("{^@}") && s["org-tags-exclude-from-inheritance"] == .string("proj crypt"))
104 #expect(s["org-tag-alist"] == .string("work(w) home(h)\n{ @office(o) @home }"))
100105 #expect(s["org-clock-rounding-minutes"] == .integer(5) && s["org-clock-out-when-done"] == .string("DONE KILL"))
101106 #expect(s["org-agenda-todo-ignore-scheduled"] == .string("future") && s["org-agenda-todo-ignore-deadlines"] == .string("7"))
102107 #expect(s["org-agenda-start-day"] == .string("-3d"))
@@ -190,7 +195,7 @@ struct EmacsImportTests {
190195 let keymap = folder.appendingPathComponent("keymap.toml")
191196 #expect(KeymapLoader.load(.doom, userFile: keymap).problems.isEmpty)
192197 #expect(KeymapLoader.load(.doom, userFile: keymap).keymap.keyLabels(for: "app.agenda", modes: ["normal"]).contains("C-c a"))
193 #expect(summary.hasPrefix("Imported 29 settings, 3 capture templates, 3 key bindings, 2 structure templates."), "\(summary)")
198 #expect(summary.hasPrefix("Imported 32 settings, 3 capture templates, 3 key bindings, 2 structure templates."), "\(summary)")
194199 #expect(UserConfig.structureTemplates(defaults) == [.init(key: "el", type: "src emacs-lisp"), .init(key: "q", type: "QUOTE")])
195200 #expect(OrgPreferences.options(defaults).structureTemplates?.first { $0.key == "q" }?.type == "QUOTE")
196201 #expect(defaults.string(forKey: "themeFont") == "JetBrains Mono")
Tests/OrgAppTests/OrgPreferencesTests.swift +3
@@ -38,6 +38,8 @@ struct OrgPreferencesTests {
3838 org-agenda-log-mode-items = "closed state"
3939 org-clock-into-drawer = "3"
4040 org-clock-rounding-minutes = 5
41 org-use-tag-inheritance = "work home"
42 org-tags-exclude-from-inheritance = "crypt"
4143 org-clock-in-switch-to-state = "STRT"
4244 org-clock-out-when-done = "DONE KILL"
4345 org-M-RET-may-split-line = true
@@ -60,6 +62,7 @@ struct OrgPreferencesTests {
6062 #expect(ignoring.logItems == ["closed", "state"] && OrgPreferences.options(defaults).clockIntoDrawer == "3")
6163 #expect(OrgPreferences.options(defaults).clockRoundingMinutes == 5 && OrgPreferences.options(defaults).clockInSwitchToState == "STRT")
6264 #expect(OrgPreferences.clockOutWhenDone(defaults) == ["DONE", "KILL"])
65 #expect(OrgPreferences.orgSettings(defaults).tagInheritance == .only(["work", "home"]) && OrgPreferences.orgSettings(defaults).tagsExcludedFromInheritance == ["crypt"])
6366 #expect(ignoring.todoIgnoreDeadlines == .near && ignoring.todoIgnoreScheduled == .days(-2) && ignoring.todoIgnoreTimestamp == .off)
6467 #expect(OrgPreferences.agendaOptions(AgendaOptions(), defaults).deadlineWarningDays == 5)
6568 #expect(!OrgPreferences.reminders(defaults) && OrgPreferences.reminderLead(defaults) == 30)
Tests/OrgCoreTests/AgendaTests.swift +50 −2
@@ -158,9 +158,11 @@ enum AgendaOracle {
158158 }
159159
160160 /// A TODO list or tags view: `form` runs it in Emacs, `ours` builds ours from the sources.
161 static func compareList(files: [(name: String, text: String)], form: String, today: Int, _ ours: ([AgendaSource]) -> [AgendaItem]) throws {
161 static func compareList(files: [(name: String, text: String)], form: String, today: Int, settings: (inout OrgSettings) -> Void = { _ in },
162 _ ours: ([AgendaSource]) -> [AgendaItem]) throws {
162163 let emacs = try run(files: files, form: form, today: today, hour: 9, minute: 30)
163 let defaults = OrgSettings.default.withTodoKeywords(keywords)!
164 var defaults = OrgSettings.default.withTodoKeywords(keywords)!
165 settings(&defaults)
164166 let mine = ours(files.map { AgendaSource(path: $0.name, text: $0.text, defaults: defaults) })
165167 #expect(describe(mine) == describe(emacs.first?.items ?? []), "\(form)")
166168 }
@@ -672,3 +674,49 @@ struct TodoIgnoreTests {
672674 }
673675 }
674676}
677
678/// `org-use-tag-inheritance` and `org-tags-exclude-from-inheritance` in tag matches.
679struct TagInheritanceTests {
680 static let file = """
681 #+FILETAGS: :ft:
682 * Project :work:proj:@office:
683 ** TODO Child :home:
684 *** TODO Grandchild
685 * Other :@home:
686 ** TODO Under other
687
688 """
689
690 @Test(.enabled(if: ProcessInfo.processInfo.environment["ORGSTAR_SKIP_ORACLE"] == nil))
691 func inheritsLikeOrg() throws {
692 let today = Days.absolute(year: 2026, month: 10, day: 5)
693 let cases: [(String, String, SemanticSettings.TagInheritance, Set<String>)] = [
694 ("t", "nil", .all, []),
695 ("nil", "nil", .none, []),
696 ("'(\"work\" \"ft\")", "nil", .only(["work", "ft"]), []),
697 ("\"^@\"", "nil", .matching("^@"), []),
698 ("t", "'(\"proj\" \"ft\")", .all, ["proj", "ft"]),
699 ("\"^[a-z]\"", "'(\"proj\")", .matching("^[a-z]"), ["proj"]),
700 ]
701 for (inherit, exclude, mode, excluded) in cases {
702 for match in ["work", "proj", "ft", "@office|@home", "home"] {
703 try AgendaOracle.compareList(
704 files: [("t.org", Self.file)],
705 form: "(let ((org-use-tag-inheritance \(inherit)) (org-tags-exclude-from-inheritance \(exclude))) (org-tags-view nil \"\(match)\"))",
706 today: today,
707 settings: { $0.tagInheritance = mode; $0.tagsExcludedFromInheritance = excluded }
708 ) { Agenda.tagsMatch($0, match: match) }
709 }
710 }
711 }
712
713 @Test func tagAlistOffersFastKeys() {
714 let text = "* Task\n"
715 var options = EditingOptions.org
716 options.tagAlist = "work(w) home(h)\n{ @office(o) @home(H) }"
717 let context = EditContext(revision: 0, text: text, tree: OrgParser.parse(text), selection: [2..<2], options: options)
718 guard case .prompt(let prompt) = SetTags().run(in: context) else { Issue.record("no prompt"); return }
719 #expect(prompt.fast?.items.contains(.option(key: "w", name: "work")) == true)
720 #expect(prompt.fast?.items.contains(.option(key: "H", name: "@home")) == true)
721 }
722}
Tests/OrgCoreTests/SemanticTests.swift +1 −1
@@ -75,7 +75,7 @@ struct InheritanceTests {
7575 let m = model(text, SemanticSettings(tagsExcludedFromInheritance: ["noinherit"]))
7676 #expect(m.tags(of: 1).map(\.value) == ["f", "x", "y"])
7777 #expect(m.tags(of: 1).map(\.source) == [.file, .heading(0), .heading(1)])
78 #expect(model(text, SemanticSettings(tagInheritance: false)).tags(of: 1).map(\.value) == ["y"])
78 #expect(model(text, SemanticSettings(tagInheritance: .none)).tags(of: 1).map(\.value) == ["y"])
7979 }
8080
8181 @Test func ownTagWinsOverInherited() {
docs/manual/guide/05-todos-and-tags.org +5 −1
@@ -259,6 +259,8 @@ Typing =:= at the end of a heading line also completes tags: from the =#+TAGS= l
259259
260260** Fast tag selection
261261
262A file without =#+TAGS= lines uses =org-tag-alist= from =config.toml= instead, written as a =#+TAGS= line; separate rows with =\n=: =org-tag-alist = "work(w) home(h)\n{ @office(o) @home(H) }"=.
263
262264When a =#+TAGS= line gives at least one tag a key, Set Tags opens fast selection (=org-fast-tag-selection=):
263265
264266#+BEGIN_SRC org
@@ -287,7 +289,9 @@ The view shows the inherited tags, the current selection, and each tag with its
287289
288290** Inheritance
289291
290An entry inherits the tags of its ancestors and the file's =#+FILETAGS= (=org-use-tag-inheritance= =t=). Fast selection lists inherited tags separately. Agenda matches and clock tables with =:tags t= use the inherited tags too. orgstar has no setting to limit inheritance (=org-tags-exclude-from-inheritance=).
292An entry inherits the tags of its ancestors and the file's =#+FILETAGS= (=org-use-tag-inheritance= =t=). Fast selection lists inherited tags separately. Agenda matches, column view's =ALLTAGS=, archiving and clock tables with =:tags t= use the inherited tags too.
293
294=org-use-tag-inheritance= in =config.toml= limits which tags inherit: ="nil"= none, tag names separated by spaces only those, or a regular expression in braces, ="{^@}"=, the tags it matches. =org-tags-exclude-from-inheritance= names tags that never inherit, such as =crypt=; as in Org, it applies when inheritance is =t= or a regular expression, not with a list of names. Both are read at launch.
291295
292296#+BEGIN_SRC org
293297,#+FILETAGS: :home:
docs/manual/guide/13-configuration.org +7
@@ -156,6 +156,7 @@ These settings have no control in the Settings window. Some are in the View menu
156156| =show-markup= | View ▸ Show Markup (=⇧⌘M=) |
157157| =ignored-folders= | |
158158| =org-archive-location= | |
159| =org-use-tag-inheritance=, =org-tags-exclude-from-inheritance=, =org-tag-alist= | |
159160| =org-track-ordered-property-with-tag= | |
160161| =org-agenda-start-on-weekday= | |
161162| =org-deadline-warning-days= | |
@@ -195,6 +196,9 @@ A key you remove from the file goes back to its default. A key that isn't in the
195196| =org-enforce-todo-dependencies= | boolean | =false= | An entry can't become done while a descendant has an active TODO keyword, or under an =ORDERED= parent while an earlier sibling has one. Mirrors =org-enforce-todo-dependencies=. |
196197| =org-enforce-todo-checkbox-dependencies= | boolean | =false= | An entry can't become done while its text has an unchecked checkbox. Mirrors =org-enforce-todo-checkbox-dependencies=. |
197198| =org-archive-location= | string | ="%s_archive::"= | Where Archive Subtree moves an entry that has no =ARCHIVE= property and whose file has no =#+ARCHIVE:=, as =file::heading=; =%s= is the file's name. Mirrors =org-archive-location=. |
199| =org-use-tag-inheritance= | string | ="t"= | Which tags inherit: ="t"= all, ="nil"= none, tag names separated by spaces, or a regular expression in braces such as ="{^@}"=. Read at launch. Mirrors =org-use-tag-inheritance=. |
200| =org-tags-exclude-from-inheritance= | string | =""= | Tags that never inherit, separated by spaces. Read at launch. Mirrors =org-tags-exclude-from-inheritance=. |
201| =org-tag-alist= | string | =""= | The tags Set Tags offers in files without =#+TAGS=, in =#+TAGS= syntax with keys and groups, rows separated by =\n=. Mirrors =org-tag-alist=. |
198202| =org-track-ordered-property-with-tag= | string | ="nil"= | A tag that Toggle ORDERED Property adds and removes with the property: ="t"= for the tag =ORDERED=, or a tag name. Mirrors =org-track-ordered-property-with-tag=. |
199203| =org-startup-indented= | boolean | =true= | Indent bodies under their headings, as =org-indent-mode=. =#+STARTUP: indent= / =noindent= override it. Mirrors =org-startup-indented=. |
200204| =org-hide-leading-stars= | boolean | =false= | Show only a heading's last star, without indentation. =#+STARTUP: hidestars= / =showstars= override it. Mirrors =org-hide-leading-stars=. |
@@ -481,6 +485,9 @@ Only variables whose names start with =org-=, =appt-=, =display-line-numbers=, =
481485| =org-clock-into-drawer= | A drawer name as given, a number as a string, =t= or =nil= |
482486| =org-clock-rounding-minutes=, =org-clock-out-remove-zero-time-clocks= | The same key |
483487| =org-clock-in-switch-to-state= | A keyword string; a function isn't supported |
488| =org-use-tag-inheritance= | =t=, =nil=, a list of tags as names separated by spaces, or a regular expression in braces |
489| =org-tags-exclude-from-inheritance= | The list's tags separated by spaces |
490| =org-tag-alist= | =#+TAGS= syntax: =("work" . ?w)= is =work(w)=; =:startgroup=, =:endgroup=, =:startgrouptag=, =:grouptags=, =:endgrouptag= and =:newline= become ={=, =}=, =[=, =:=, =]= and a new row |
484491| =org-clock-out-when-done= | =t=, =nil=, or a list of keywords as a string separated by spaces |
485492| =org-agenda-start-day= | A day offset such as ="-3d"=; =nil= becomes ="+0d"=. Other forms aren't supported. |
486493| =org-agenda-start-on-weekday= | ="0"= to ="6"=, or ="nil"= |
docs/manual/guide/14-ios.org +1
@@ -349,6 +349,7 @@ These settings from =config.toml= apply on iOS:
349349- =org-log-done=, =org-log-reschedule=, =org-log-redeadline=, =org-log-into-drawer=
350350- =org-enforce-todo-dependencies=, =org-enforce-todo-checkbox-dependencies=, =org-track-ordered-property-with-tag=, =org-agenda-dim-blocked-tasks=
351351- =org-archive-location=, =[org-structure-template-alist]=
352- =org-use-tag-inheritance=, =org-tags-exclude-from-inheritance=, =org-tag-alist=
352353- =org-use-speed-commands=, with a hardware keyboard
353354- =electric-pair-mode=, =spell-check=
354355- =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=