Sources/OrgCore/EmacsFallback.swift

12 lines · 459 bytes

 1import Foundation
 2
 3/// Whether messages may send the user to Emacs for what orgstar can't do itself. The Mac App
 4/// Store build, which can't run Emacs, turns it off at launch.
 5public enum EmacsFallback {
 6    nonisolated(unsafe) public static var offered = true
 7
 8    /// `emacs` while Emacs is offered, else `other`.
 9    public static func wording(_ emacs: String, _ other: String, offered: Bool = offered) -> String {
10        offered ? emacs : other
11    }
12}