Readable text width; line numbers off by default !337

merged merged by cmc on 2026-10-14 04:06 UTC · krz/orgstar:line-width into main

15 files changed, +76 −9

Layout: unified · split

Sources/OrgApp/OrgPreferences.swift +1
@@ -69,6 +69,7 @@ public enum OrgPreferences {
69 spec.bodyFont = string("themeBodyFont", defaults) 69 spec.bodyFont = string("themeBodyFont", defaults)
70 spec.fontSize = integer("themeFontSize", defaults) 70 spec.fontSize = integer("themeFontSize", defaults)
71 spec.lineSpacing = integer("themeLineSpacing", defaults) 71 spec.lineSpacing = integer("themeLineSpacing", defaults)
72 spec.textWidth = integer("themeTextWidth", defaults)
72 spec.headingSizeStep = integer("themeHeadingStep", defaults) 73 spec.headingSizeStep = integer("themeHeadingStep", defaults)
73 return spec 74 return spec
74 } 75 }
Sources/OrgApp/UserConfig.swift +3 −1
@@ -189,7 +189,7 @@ public enum UserConfig {
189 comment: "fold drawers when a file opens; #+STARTUP: nohidedrawers overrides", legacy: ""), 189 comment: "fold drawers when a file opens; #+STARTUP: nohidedrawers overrides", legacy: ""),
190 Setting(section: "", key: "org-cycle-hide-block-startup", defaultsKey: "hideBlockStartup", kind: .bool, fallback: .bool(false), 190 Setting(section: "", key: "org-cycle-hide-block-startup", defaultsKey: "hideBlockStartup", kind: .bool, fallback: .bool(false),
191 comment: "fold blocks when a file opens; #+STARTUP: hideblocks overrides", legacy: ""), 191 comment: "fold blocks when a file opens; #+STARTUP: hideblocks overrides", legacy: ""),
192 Setting(section: "", key: "display-line-numbers-type", defaultsKey: "showLineNumbers", kind: .lineNumbers, fallback: .bool(true), 192 Setting(section: "", key: "display-line-numbers-type", defaultsKey: "showLineNumbers", kind: .lineNumbers, fallback: .bool(false),
193 comment: "line numbers: true, false, \"relative\" or \"visual\" (View ▸ Line Numbers)", legacy: "editor.line-numbers"), 193 comment: "line numbers: true, false, \"relative\" or \"visual\" (View ▸ Line Numbers)", legacy: "editor.line-numbers"),
194 Setting(section: "", key: "org-agenda-span", defaultsKey: "agendaSpan", kind: .integer, fallback: .integer(10), 194 Setting(section: "", key: "org-agenda-span", defaultsKey: "agendaSpan", kind: .integer, fallback: .integer(10),
195 comment: "days the agenda shows", legacy: "agenda.span"), 195 comment: "days the agenda shows", legacy: "agenda.span"),
@@ -301,6 +301,8 @@ public enum UserConfig {
301 comment: "points", legacy: ""), 301 comment: "points", legacy: ""),
302 Setting(section: "theme", key: "line-spacing", defaultsKey: "themeLineSpacing", kind: .integer, fallback: .integer(2), 302 Setting(section: "theme", key: "line-spacing", defaultsKey: "themeLineSpacing", kind: .integer, fallback: .integer(2),
303 comment: "points between lines", legacy: ""), 303 comment: "points between lines", legacy: ""),
304 Setting(section: "theme", key: "text-width", defaultsKey: "themeTextWidth", kind: .integer, fallback: .integer(0),
305 comment: "the widest the text runs, in columns, centred in a wider editor; 0 for the whole width", legacy: ""),
304 Setting(section: "theme", key: "heading-size-step", defaultsKey: "themeHeadingStep", kind: .integer, fallback: .integer(1), 306 Setting(section: "theme", key: "heading-size-step", defaultsKey: "themeHeadingStep", kind: .integer, fallback: .integer(1),
305 comment: "points a heading is larger than the level below; level 4 and deeper are body size", legacy: ""), 307 comment: "points a heading is larger than the level below; level 4 and deeper are body size", legacy: ""),
306 Setting(section: "theme", key: "theme-file", defaultsKey: "themeFile", kind: .string, fallback: .string(""), 308 Setting(section: "theme", key: "theme-file", defaultsKey: "themeFile", kind: .string, fallback: .string(""),
Sources/OrgEditorAppKit/Keys.swift +10
@@ -54,6 +54,16 @@ final class OrgTextView: NSTextView {
54 var showsLineNumbers = false { 54 var showsLineNumbers = false {
55 didSet { if showsLineNumbers != oldValue { updateGutter() } } 55 didSet { if showsLineNumbers != oldValue { updateGutter() } }
56 } 56 }
57 /// The widest the text container gets, centred in the view; 0 for the view's width.
58 var textWidth: CGFloat = 0 {
59 didSet { if textWidth != oldValue { updateGutter() } }
60 }
61
62 override func setFrameSize(_ newSize: NSSize) {
63 let widthChanged = newSize.width != frame.width
64 super.setFrameSize(newSize)
65 if widthChanged, textWidth > 0 { updateGutter() }
66 }
57 var lineNumbersType = LineNumbersType.absolute { 67 var lineNumbersType = LineNumbersType.absolute {
58 didSet { if lineNumbersType != oldValue { needsDisplay = true } } 68 didSet { if lineNumbersType != oldValue { needsDisplay = true } }
59 } 69 }
Sources/OrgEditorAppKit/LineNumbers.swift +6
@@ -18,6 +18,12 @@ extension OrgTextView {
18 let digits = max(2, String(lines).count) 18 let digits = max(2, String(lines).count)
19 width = ceil(("0" as NSString).size(withAttributes: [.font: lineNumberFont]).width * CGFloat(digits) + 16) 19 width = ceil(("0" as NSString).size(withAttributes: [.font: lineNumberFont]).width * CGFloat(digits) + 16)
20 } 20 }
21 // A text width narrower than the view: the same margin either side, the numbers
22 // still just left of the text.
23 if textWidth > 0, textContainer?.widthTracksTextView == true {
24 let padding = 2 * (textContainer?.lineFragmentPadding ?? 0)
25 width = max(width, floor((bounds.width - textWidth - padding) / 2))
26 }
21 if textContainerInset.width != width { 27 if textContainerInset.width != width {
22 textContainerInset = NSSize(width: width, height: textContainerInset.height) 28 textContainerInset = NSSize(width: width, height: textContainerInset.height)
23 needsDisplay = true 29 needsDisplay = true
Sources/OrgEditorAppKit/OrgEditor.swift +1
@@ -284,6 +284,7 @@ public final class OrgEditor: NSObject {
284 for view in orgTextViews { 284 for view in orgTextViews {
285 view.font = theme.body 285 view.font = theme.body
286 view.typingAttributes = theme.base 286 view.typingAttributes = theme.base
287 view.textWidth = CGFloat(max(0, theme.spec.textWidth)) * theme.column
287 view.drawsBackground = true 288 view.drawsBackground = true
288 view.backgroundColor = theme.color("background") ?? .textBackgroundColor 289 view.backgroundColor = theme.color("background") ?? .textBackgroundColor
289 view.insertionPointColor = theme.color("cursor") ?? .textColor 290 view.insertionPointColor = theme.color("cursor") ?? .textColor
Sources/OrgEditorAppKit/ViewToggles.swift +2
@@ -54,6 +54,8 @@ extension OrgEditor {
54 } 54 }
55 textLayoutManager.invalidateLayout(for: textLayoutManager.documentRange) 55 textLayoutManager.invalidateLayout(for: textLayoutManager.documentRange)
56 } 56 }
57 // Truncated lines take the whole width; wrapped ones the text width again.
58 (textView as? OrgTextView)?.updateGutter()
57 textView.needsDisplay = true 59 textView.needsDisplay = true
58 } 60 }
59 } 61 }
Sources/OrgPresentation/ThemeSpec.swift +4 −1
@@ -44,6 +44,9 @@ public struct ThemeSpec: Equatable, Sendable {
44 public var fontSize = 13 44 public var fontSize = 13
45 /// Points between lines. 45 /// Points between lines.
46 public var lineSpacing = 2 46 public var lineSpacing = 2
47 /// The widest the text runs, in columns of `font`, centred in a wider editor; 0 for the
48 /// editor's whole width.
49 public var textWidth = 0
47 /// Points a heading is larger than the next level down (level 4 and deeper are body size). 50 /// Points a heading is larger than the next level down (level 4 and deeper are body size).
48 public var headingSizeStep = 1 51 public var headingSizeStep = 1
49 public var light: [String: RGBA] 52 public var light: [String: RGBA]
@@ -185,7 +188,7 @@ public struct ThemeSpec: Equatable, Sendable {
185 // MARK: - Reading 188 // MARK: - Reading
186 189
187 /// Keys of `[theme]` that aren't colors; config.toml's settings handle them. 190 /// Keys of `[theme]` that aren't colors; config.toml's settings handle them.
188 public static let typeKeys: Set<String> = ["font", "body-font", "font-size", "line-spacing", "heading-size-step", "theme-file"] 191 public static let typeKeys: Set<String> = ["font", "body-font", "font-size", "line-spacing", "text-width", "heading-size-step", "theme-file"]
189 192
190 /// Whether a table holds theme colors. 193 /// Whether a table holds theme colors.
191 public static func isThemeTable(_ name: String) -> Bool { 194 public static func isThemeTable(_ name: String) -> Bool {
Sources/Orgstar/ContentView.swift +3 −1
@@ -87,7 +87,7 @@ struct ContentView: View {
87 @AppStorage("backlinksShown") private var backlinksShown = true 87 @AppStorage("backlinksShown") private var backlinksShown = true
88 @AppStorage("inspectorShown") private var inspectorShown = false 88 @AppStorage("inspectorShown") private var inspectorShown = false
89 @AppStorage("showMarkup") private var showMarkup = false 89 @AppStorage("showMarkup") private var showMarkup = false
90 @AppStorage("showLineNumbers") private var showLineNumbers = true 90 @AppStorage("showLineNumbers") private var showLineNumbers = false
91 @AppStorage("lineNumbersType") private var lineNumbersType = "t" 91 @AppStorage("lineNumbersType") private var lineNumbersType = "t"
92 @AppStorage("showHiddenFiles") private var showHiddenFiles = true 92 @AppStorage("showHiddenFiles") private var showHiddenFiles = true
93 @AppStorage("ignoredFolders") private var ignoredFolders = ScanRules.defaultIgnoredFolders.sorted().joined(separator: " ") 93 @AppStorage("ignoredFolders") private var ignoredFolders = ScanRules.defaultIgnoredFolders.sorted().joined(separator: " ")
@@ -95,6 +95,7 @@ struct ContentView: View {
95 @AppStorage("themeBodyFont") private var themeBodyFont = "" 95 @AppStorage("themeBodyFont") private var themeBodyFont = ""
96 @AppStorage("themeFontSize") private var themeFontSize = 13 96 @AppStorage("themeFontSize") private var themeFontSize = 13
97 @AppStorage("themeLineSpacing") private var themeLineSpacing = 2 97 @AppStorage("themeLineSpacing") private var themeLineSpacing = 2
98 @AppStorage("themeTextWidth") private var themeTextWidth = 0
98 @AppStorage("themeHeadingStep") private var themeHeadingStep = 1 99 @AppStorage("themeHeadingStep") private var themeHeadingStep = 1
99 100
100 /// The theme's colors from config.toml with the type settings. 101 /// The theme's colors from config.toml with the type settings.
@@ -104,6 +105,7 @@ struct ContentView: View {
104 spec.bodyFont = themeBodyFont 105 spec.bodyFont = themeBodyFont
105 spec.fontSize = themeFontSize 106 spec.fontSize = themeFontSize
106 spec.lineSpacing = themeLineSpacing 107 spec.lineSpacing = themeLineSpacing
108 spec.textWidth = themeTextWidth
107 spec.headingSizeStep = themeHeadingStep 109 spec.headingSizeStep = themeHeadingStep
108 return spec 110 return spec
109 } 111 }
Sources/Orgstar/OrgstarApp.swift +7 −1
@@ -527,7 +527,7 @@ struct OrgMenuItems: View {
527struct MarkupToggle: View { 527struct MarkupToggle: View {
528 @AppStorage("showTabBar") private var showTabBar = false 528 @AppStorage("showTabBar") private var showTabBar = false
529 @AppStorage("showMarkup") private var showMarkup = false 529 @AppStorage("showMarkup") private var showMarkup = false
530 @AppStorage("showLineNumbers") private var showLineNumbers = true 530 @AppStorage("showLineNumbers") private var showLineNumbers = false
531 @AppStorage("lineNumbersType") private var lineNumbersType = "t" 531 @AppStorage("lineNumbersType") private var lineNumbersType = "t"
532 532
533 var body: some View { 533 var body: some View {
@@ -624,6 +624,7 @@ struct SettingsView: View {
624 @AppStorage("themeBodyFont") private var themeBodyFont = "" 624 @AppStorage("themeBodyFont") private var themeBodyFont = ""
625 @AppStorage("themeFontSize") private var themeFontSize = 13 625 @AppStorage("themeFontSize") private var themeFontSize = 13
626 @AppStorage("themeLineSpacing") private var themeLineSpacing = 2 626 @AppStorage("themeLineSpacing") private var themeLineSpacing = 2
627 @AppStorage("themeTextWidth") private var themeTextWidth = 0
627 @AppStorage("themeHeadingStep") private var themeHeadingStep = 1 628 @AppStorage("themeHeadingStep") private var themeHeadingStep = 1
628 629
629 /// Installed font families that aren't monospaced, for body text. 630 /// Installed font families that aren't monospaced, for body text.
@@ -790,6 +791,11 @@ struct SettingsView: View {
790 } 791 }
791 Stepper("Size: \(themeFontSize) pt", value: $themeFontSize, in: 8...36) 792 Stepper("Size: \(themeFontSize) pt", value: $themeFontSize, in: 8...36)
792 Stepper("Line spacing: \(themeLineSpacing) pt", value: $themeLineSpacing, in: 0...16) 793 Stepper("Line spacing: \(themeLineSpacing) pt", value: $themeLineSpacing, in: 0...16)
794 Picker("Text width", selection: $themeTextWidth) {
795 Text("Whole editor").tag(0)
796 ForEach([60, 70, 80, 90, 100, 120], id: \.self) { Text("\($0) columns").tag($0) }
797 if ![0, 60, 70, 80, 90, 100, 120].contains(themeTextWidth) { Text("\(themeTextWidth) columns").tag(themeTextWidth) }
798 }
793 Stepper("Headings grow by \(themeHeadingStep) pt a level", value: $themeHeadingStep, in: 0...8) 799 Stepper("Headings grow by \(themeHeadingStep) pt a level", value: $themeHeadingStep, in: 0...8)
794 } footer: { 800 } footer: {
795 Text("Tags and tables line up in columns, so Font should be monospaced. With a Body text font, prose uses it while tables, code, dates, tags and drawers keep Font.") 801 Text("Tags and tables line up in columns, so Font should be monospaced. With a Body text font, prose uses it while tables, code, dates, tags and drawers keep Font.")
Sources/OrgstarMobile/MobileEditor+Styling.swift +1
@@ -28,6 +28,7 @@ extension MobileEditor {
28 view.backgroundColor = theme.color("background") ?? .systemBackground 28 view.backgroundColor = theme.color("background") ?? .systemBackground
29 view.tintColor = theme.color("cursor") 29 view.tintColor = theme.color("cursor")
30 view.typingAttributes = theme.base 30 view.typingAttributes = theme.base
31 (view as? KeyedTextView)?.textWidth = CGFloat(max(0, theme.spec.textWidth)) * theme.column
31 themeSelection(view) 32 themeSelection(view)
32 } 33 }
33 34
Sources/OrgstarMobile/MobileFragments.swift +11
@@ -46,6 +46,12 @@ final class KeyedTextView: UITextView {
46 var onLayout: (() -> Void)? 46 var onLayout: (() -> Void)?
47 /// The text container's width while lines are truncated. 47 /// The text container's width while lines are truncated.
48 static let truncatedWidth: CGFloat = 100_000 48 static let truncatedWidth: CGFloat = 100_000
49 /// The widest the text runs, centred in a wider view; 0 for the view's width.
50 var textWidth: CGFloat = 0 {
51 didSet { if textWidth != oldValue { setNeedsLayout() } }
52 }
53 /// The side inset without a text width.
54 static let sideInset: CGFloat = 8
49 55
50 /// Long lines run off the right edge and the view scrolls sideways. 56 /// Long lines run off the right edge and the view scrolls sideways.
51 var truncates: Bool { 57 var truncates: Bool {
@@ -64,6 +70,11 @@ final class KeyedTextView: UITextView {
64 } 70 }
65 71
66 override func layoutSubviews() { 72 override func layoutSubviews() {
73 let side = textWidth > 0 && !truncates ? max(Self.sideInset, floor((bounds.width - textWidth - 2 * textContainer.lineFragmentPadding) / 2)) : Self.sideInset
74 if textContainerInset.left != side {
75 textContainerInset.left = side
76 textContainerInset.right = side
77 }
67 // The text view sets its container's width to its own when it lays out. 78 // The text view sets its container's width to its own when it lays out.
68 if truncates, textContainer.size.width != Self.truncatedWidth { 79 if truncates, textContainer.size.width != Self.truncatedWidth {
69 textContainer.size = CGSize(width: Self.truncatedWidth, height: CGFloat.greatestFiniteMagnitude) 80 textContainer.size = CGSize(width: Self.truncatedWidth, height: CGFloat.greatestFiniteMagnitude)
Tests/OrgEditorAppKitTests/EditorTests.swift +18
@@ -244,6 +244,24 @@ struct EditingTests {
244 h.checkInSync() 244 h.checkInSync()
245 } 245 }
246 246
247 @Test func textWidth() throws {
248 let h = Harness("Prose that is long enough to wrap in a narrow text area, past sixty columns of text.\n")
249 let full = try #require(h.textView.textContainer).size.width
250 var spec = ThemeSpec.default
251 spec.textWidth = 40
252 h.editor.themeSpec = spec
253 h.layout()
254 let narrow = try #require(h.textView.textContainer).size.width
255 #expect(narrow < full)
256 #expect(abs(narrow - 40 * h.editor.theme.column - 2 * h.textView.textContainer!.lineFragmentPadding) < 1)
257 // Centred: the same margin either side.
258 #expect(abs(h.textView.textContainerInset.width * 2 + narrow - h.textView.bounds.width) < 1)
259 spec.textWidth = 0
260 h.editor.themeSpec = spec
261 h.layout()
262 #expect(try #require(h.textView.textContainer).size.width == full)
263 }
264
247 @Test func mixedPitch() throws { 265 @Test func mixedPitch() throws {
248 let text = "**** Heading :tag:\nProse text.\n- item\n| a | b |\n#+begin_src sh\necho\n#+end_src\n" 266 let text = "**** Heading :tag:\nProse text.\n- item\n| a | b |\n#+begin_src sh\necho\n#+end_src\n"
249 let h = Harness(text) 267 let h = Harness(text)
docs/manual/guide/02-the-editor.org +3 −3
@@ -30,7 +30,7 @@ The two Org options are in Settings ▸ Editing as "Emacs hides emphasis markers
30- Blocks (=#+BEGIN_…= to =#+END_…=), dynamic blocks and fixed-width lines are drawn on a shaded band across the whole width of the editor, as Emacs extends the =org-block= face. Code in src blocks is highlighted for its language (see [[file:11-code-blocks.org][Code blocks]]). 30- Blocks (=#+BEGIN_…= to =#+END_…=), dynamic blocks and fixed-width lines are drawn on a shaded band across the whole width of the editor, as Emacs extends the =org-block= face. Code in src blocks is highlighted for its language (see [[file:11-code-blocks.org][Code blocks]]).
31- A folded heading shows an ellipsis after its line. 31- A folded heading shows an ellipsis after its line.
32 32
33Colours come from the theme and follow the system's light or dark appearance. The font, size and line spacing are in Settings ▸ Appearance; colours are set in =config.toml=. See [[file:13-configuration.org][Configuration]]. The font should be monospaced, since tags and tables line up by columns. A body font for prose can be set beside it, as =mixed-pitch-mode= does in Emacs: prose and headings use it, and tables, code, dates, tags, drawers and the start of each line keep the monospaced font. 33Colours come from the theme and follow the system's light or dark appearance. The font, size, line spacing and text width are in Settings ▸ Appearance; colours are set in =config.toml=. See [[file:13-configuration.org][Configuration]]. The font should be monospaced, since tags and tables line up by columns. A body font for prose can be set beside it, as =mixed-pitch-mode= does in Emacs: prose and headings use it, and tables, code, dates, tags, drawers and the start of each line keep the monospaced font.
34 34
35** Indentation and stars 35** Indentation and stars
36 36
@@ -307,7 +307,7 @@ Wrapping is display only. To rewrap the text of a paragraph, use Org ▸ Fill Pa
307| Toggle | Menu | Keys | Default | =config.toml= | Scope | 307| Toggle | Menu | Keys | Default | =config.toml= | Scope |
308|-------------------------------+-------------------------------+-------------------------------------------------+---------+----------------------------------+----------------| 308|-------------------------------+-------------------------------+-------------------------------------------------+---------+----------------------------------+----------------|
309| Show Markup | View ▸ Show Markup | =⇧⌘M= | off | =show-markup= | every buffer | 309| Show Markup | View ▸ Show Markup | =⇧⌘M= | off | =show-markup= | every buffer |
310| Show Line Numbers | View ▸ Show Line Numbers | =⇧⌘L= | on | =display-line-numbers-type= | every buffer | 310| Show Line Numbers | View ▸ Show Line Numbers | =⇧⌘L= | off | =display-line-numbers-type= | every buffer |
311| Auto fill | View ▸ Turn Auto Fill On or Off | palette | off | =auto-fill-mode= | current buffer | 311| Auto fill | View ▸ Turn Auto Fill On or Off | palette | off | =auto-fill-mode= | current buffer |
312| Inline images | Org ▸ Show or Hide Inline Images | =C-c C-x C-v= (Emacs, Doom) | off | =org-startup-with-inline-images= | current buffer | 312| Inline images | Org ▸ Show or Hide Inline Images | =C-c C-x C-v= (Emacs, Doom) | off | =org-startup-with-inline-images= | current buffer |
313| LaTeX previews | palette | =C-c C-x C-l= (Emacs, Doom) | off | =org-startup-with-latex-preview= | current buffer | 313| LaTeX previews | palette | =C-c C-x C-l= (Emacs, Doom) | off | =org-startup-with-latex-preview= | current buffer |
@@ -318,7 +318,7 @@ Toggles that apply to the current buffer last until it closes; the =config.toml=
318 318
319** Line numbers 319** Line numbers
320 320
321Line numbers show in a margin left of the text, as =display-line-numbers-mode= shows them: one number per line of the file, so wrapped lines are numbered once and folded lines are skipped. The caret's line number is brighter. Line numbers are on by default. 321Line numbers show in a margin left of the text, as =display-line-numbers-mode= shows them: one number per line of the file, so wrapped lines are numbered once and folded lines are skipped. The caret's line number is brighter. Line numbers are off by default, as in Emacs.
322 322
323View ▸ Line Numbers chooses how they count, as =display-line-numbers-type= does in =config.toml=: 323View ▸ Line Numbers chooses how they count, as =display-line-numbers-type= does in =config.toml=:
324 324
docs/manual/guide/13-configuration.org +4 −1
@@ -106,6 +106,7 @@ orgstar's menus, settings and agenda are in English and German, and follow the l
106| Body text | Same as Font, System, or any installed proportional family | Same as Font | =body-font= | 106| Body text | Same as Font, System, or any installed proportional family | Same as Font | =body-font= |
107| Size | 8 to 36 pt | 13 pt | =font-size= | 107| Size | 8 to 36 pt | 13 pt | =font-size= |
108| Line spacing | 0 to 16 pt | 2 pt | =line-spacing= | 108| Line spacing | 0 to 16 pt | 2 pt | =line-spacing= |
109| Text width | Whole editor, or 60 to 120 columns | Whole editor | =text-width= |
109| Headings grow by N pt a level | 0 to 8 pt | 1 pt | =heading-size-step= | 110| Headings grow by N pt a level | 0 to 8 pt | 1 pt | =heading-size-step= |
110| Colors: Edit in config.toml | Opens =config.toml= | | | 111| Colors: Edit in config.toml | Opens =config.toml= | | |
111| Colors: Show Default Theme | Opens =default-theme.toml= | | | 112| Colors: Show Default Theme | Opens =default-theme.toml= | | |
@@ -251,7 +252,7 @@ A key you remove from the file goes back to its default. A key that isn't in the
251| =org-use-speed-commands= | boolean | =false= | Single keys at the start of a heading line run commands (=n=, =p=, =t=, =c=, …). Mirrors =org-use-speed-commands=. | 252| =org-use-speed-commands= | boolean | =false= | Single keys at the start of a heading line run commands (=n=, =p=, =t=, =c=, …). Mirrors =org-use-speed-commands=. |
252| =org-cycle-hide-drawer-startup= | boolean | =true= | Fold drawers when a file opens. =#+STARTUP: hidedrawers= / =nohidedrawers= override it. Mirrors =org-cycle-hide-drawer-startup=. | 253| =org-cycle-hide-drawer-startup= | boolean | =true= | Fold drawers when a file opens. =#+STARTUP: hidedrawers= / =nohidedrawers= override it. Mirrors =org-cycle-hide-drawer-startup=. |
253| =org-cycle-hide-block-startup= | boolean | =false= | Fold blocks when a file opens. =#+STARTUP: hideblocks= / =nohideblocks= override it. Mirrors =org-cycle-hide-block-startup=. | 254| =org-cycle-hide-block-startup= | boolean | =false= | Fold blocks when a file opens. =#+STARTUP: hideblocks= / =nohideblocks= override it. Mirrors =org-cycle-hide-block-startup=. |
254| =display-line-numbers-type= | boolean or string | =true= | Line numbers in the editor's gutter: =true=, =false=, ="relative"= or ="visual"=. See [[file:02-the-editor.org][The editor]]. | 255| =display-line-numbers-type= | boolean or string | =false= | Line numbers in the editor's gutter: =true=, =false=, ="relative"= or ="visual"=. See [[file:02-the-editor.org][The editor]]. |
255| =org-agenda-span= | integer | =10= | Days the agenda shows. Mirrors =org-agenda-span=. | 256| =org-agenda-span= | integer | =10= | Days the agenda shows. Mirrors =org-agenda-span=. |
256| =org-agenda-start-day= | string | ="+0d"= | The agenda's first day relative to today, as ="-3d"= or ="+0d"=. Only day offsets are accepted. Mirrors =org-agenda-start-day=. | 257| =org-agenda-start-day= | string | ="+0d"= | The agenda's first day relative to today, as ="-3d"= or ="+0d"=. Only day offsets are accepted. Mirrors =org-agenda-start-day=. |
257| =org-agenda-start-on-weekday= | string | ="1"= | The day weeks start on, ="0"= (Sunday) to ="6"= (Saturday), for the week view and spans of 7 or 14 days. ="nil"= starts them on the day the view starts from. Mirrors =org-agenda-start-on-weekday=. | 258| =org-agenda-start-on-weekday= | string | ="1"= | The day weeks start on, ="0"= (Sunday) to ="6"= (Saturday), for the week view and spans of 7 or 14 days. ="nil"= starts them on the day the view starts from. Mirrors =org-agenda-start-on-weekday=. |
@@ -363,6 +364,7 @@ Publishing projects, one table each, as =org-publish-project-alist= has them. Th
363| =body-font= | string | =""= | A font family for prose, or ="system"= for the system's proportional font. =""= uses =font= throughout. | 364| =body-font= | string | =""= | A font family for prose, or ="system"= for the system's proportional font. =""= uses =font= throughout. |
364| =font-size= | integer | =13= | Points. | 365| =font-size= | integer | =13= | Points. |
365| =line-spacing= | integer | =2= | Points between lines. | 366| =line-spacing= | integer | =2= | Points between lines. |
367| =text-width= | integer | =0= | The widest the text runs, in columns of =font=, centred in a wider editor. =0= uses the whole width. |
366| =heading-size-step= | integer | =1= | Points a heading is larger than the level below. Level 4 and deeper are body size. | 368| =heading-size-step= | integer | =1= | Points a heading is larger than the level below. Level 4 and deeper are body size. |
367| =theme-file= | string | =""= | A theme in its own file in the configuration folder, applied under the colors in =config.toml=. | 369| =theme-file= | string | =""= | A theme in its own file in the configuration folder, applied under the colors in =config.toml=. |
368 370
@@ -774,5 +776,6 @@ By default the editor uses one font for everything: body text, headings, code an
774- =font-size= is the body size, at least 6 points. 776- =font-size= is the body size, at least 6 points.
775- Headings are bold. Level 1 is =font-size= plus three times =heading-size-step=, level 2 plus two times, level 3 plus one time; level 4 and deeper are body size. Set =heading-size-step = 0= for one size throughout. 777- Headings are bold. Level 1 is =font-size= plus three times =heading-size-step=, level 2 plus two times, level 3 plus one time; level 4 and deeper are body size. Set =heading-size-step = 0= for one size throughout.
776- =line-spacing= adds space between lines, in points. 778- =line-spacing= adds space between lines, in points.
779- =text-width= keeps lines of text to that many columns of =font= in a wider editor, with equal margins either side and the line numbers beside the text, as =olivetti-mode= does in Emacs. Long lines wrap at it; with lines truncated (View ▸ Truncate or Wrap Long Lines) the text takes the whole width. It changes only the display: =M-q= still fills to =fill-column=.
777 780
778On iPhone and iPad, the editor and reader use the same theme, read from the synced configuration folder. =font= and =body-font= apply when the family is installed on the device, otherwise the system's monospaced font is used, and =font-size= is the size at the default Dynamic Type setting, scaled with the size chosen on the device. The =selection= color, the =cursor= color and the =syntax-*= colors apply there too. See [[file:14-ios.org][iPhone and iPad]]. 781On iPhone and iPad, the editor and reader use the same theme, read from the synced configuration folder. =font= and =body-font= apply when the family is installed on the device, otherwise the system's monospaced font is used, and =font-size= is the size at the default Dynamic Type setting, scaled with the size chosen on the device. The =selection= color, the =cursor= color and the =syntax-*= colors apply there too. See [[file:14-ios.org][iPhone and iPad]].
docs/manual/guide/14-ios.org +2 −1
@@ -85,6 +85,7 @@ The editor and the reader use the theme set in the configuration folder's =confi
85- Font :: =font= when that family is installed on the device, otherwise the system's monospaced font. =body-font=, when set, is used for prose as on the Mac. 85- Font :: =font= when that family is installed on the device, otherwise the system's monospaced font. =body-font=, when set, is used for prose as on the Mac.
86- Size :: =font-size= is the size at the default Dynamic Type setting, 13 pt by default. Text grows and shrinks with the text size chosen in the system Settings app. 86- Size :: =font-size= is the size at the default Dynamic Type setting, 13 pt by default. Text grows and shrinks with the text size chosen in the system Settings app.
87- Line spacing and headings :: =line-spacing= and =heading-size-step= apply as on the Mac. 87- Line spacing and headings :: =line-spacing= and =heading-size-step= apply as on the Mac.
88- Text width :: =text-width= keeps the editor's text to that many columns, centred, on an iPad or a wide window.
88- Caret and selection :: the selection highlight takes the theme's =selection= colour, over block bands too; the caret and the selection handles take =cursor=. 89- Caret and selection :: the selection highlight takes the theme's =selection= colour, over block bands too; the caret and the selection handles take =cursor=.
89 90
90The editor and the reader apply these display settings; only the editor aligns tables when a file opens. The startup settings (=org-cycle-hide-*-startup=, =org-startup-*=, =org-hide-leading-stars=) apply when a file opens, and a =#+STARTUP= keyword in the file overrides them, as on the Mac. 91The editor and the reader apply these display settings; only the editor aligns tables when a file opens. The startup settings (=org-cycle-hide-*-startup=, =org-startup-*=, =org-hide-leading-stars=) apply when a file opens, and a =#+STARTUP= keyword in the file overrides them, as on the Mac.
@@ -401,7 +402,7 @@ These settings from =config.toml= apply on iOS:
401- =org-tags-column=, =org-insert-heading-respect-content=, =org-M-RET-may-split-line=, =fill-column= 402- =org-tags-column=, =org-insert-heading-respect-content=, =org-M-RET-may-split-line=, =fill-column=
402- =org-hide-emphasis-markers= and =org-pretty-entities=, for what hidden markup shows and for how tag and table alignment and filling measure text, as on the Mac 403- =org-hide-emphasis-markers= and =org-pretty-entities=, for what hidden markup shows and for how tag and table alignment and filling measure text, as on the Mac
403- =show-markup=, =org-startup-indented=, =org-hide-leading-stars=, =org-startup-with-inline-images=, =org-startup-with-latex-preview=, =org-startup-align-all-tables=, =org-startup-truncated=, =org-cycle-hide-drawer-startup=, =org-cycle-hide-block-startup= 404- =show-markup=, =org-startup-indented=, =org-hide-leading-stars=, =org-startup-with-inline-images=, =org-startup-with-latex-preview=, =org-startup-align-all-tables=, =org-startup-truncated=, =org-cycle-hide-drawer-startup=, =org-cycle-hide-block-startup=
404- =[theme]= (=font=, =font-size=, =line-spacing=, =heading-size-step=, =theme-file= and colours), =[theme.light]=, =[theme.dark]=, =[theme.todo]=, =[theme.category]= 405- =[theme]= (=font=, =body-font=, =font-size=, =line-spacing=, =text-width=, =heading-size-step=, =theme-file= and colours), =[theme.light]=, =[theme.dark]=, =[theme.todo]=, =[theme.category]=
405- =org-log-done=, =org-log-reschedule=, =org-log-redeadline=, =org-log-into-drawer= 406- =org-log-done=, =org-log-reschedule=, =org-log-redeadline=, =org-log-into-drawer=
406- =org-enforce-todo-dependencies=, =org-enforce-todo-checkbox-dependencies=, =org-track-ordered-property-with-tag=, =org-agenda-dim-blocked-tasks= 407- =org-enforce-todo-dependencies=, =org-enforce-todo-checkbox-dependencies=, =org-track-ordered-property-with-tag=, =org-agenda-dim-blocked-tasks=
407- =org-roam-directory=, =org-roam-dailies-directory=, =org-roam-dailies-file=, =org-roam-dailies-head=, =org-roam-dailies-entry= 408- =org-roam-directory=, =org-roam-dailies-directory=, =org-roam-dailies-file=, =org-roam-dailies-head=, =org-roam-dailies-entry=