refactor: rename doom-features to doom-system

This commit is contained in:
Henrik Lissner
2024-10-25 21:01:26 -04:00
parent 25201a40f3
commit db76813c26
2 changed files with 7 additions and 8 deletions

View File

@ -117,7 +117,7 @@
;; announce, and don't belong in `features', so they are stored here, which can ;; announce, and don't belong in `features', so they are stored here, which can
;; include information about the external system environment. Module-specific ;; include information about the external system environment. Module-specific
;; features are kept elsewhere, however. ;; features are kept elsewhere, however.
(defconst doom-features (defconst doom-system
(pcase system-type (pcase system-type
('darwin '(macos bsd)) ('darwin '(macos bsd))
((or 'cygwin 'windows-nt 'ms-dos) '(windows)) ((or 'cygwin 'windows-nt 'ms-dos) '(windows))
@ -127,16 +127,15 @@
"A list of symbols denoting available features in the active Doom profile.") "A list of symbols denoting available features in the active Doom profile.")
;; Convenience aliases for internal use only (may be removed later). ;; Convenience aliases for internal use only (may be removed later).
(defconst doom-system (car doom-features)) (defconst doom--system-windows-p (eq 'windows (car doom-system)))
(defconst doom--system-windows-p (eq 'windows doom-system)) (defconst doom--system-macos-p (eq 'macos (car doom-system)))
(defconst doom--system-macos-p (eq 'macos doom-system)) (defconst doom--system-linux-p (eq 'linux (car doom-system)))
(defconst doom--system-linux-p (eq 'linux doom-system))
;; `system-type' is esoteric, so I create a pseudo feature as a stable and ;; `system-type' is esoteric, so I create a pseudo feature as a stable and
;; consistent alternative, and all while using the same `featurep' interface ;; consistent alternative, and all while using the same `featurep' interface
;; we're already familiar with. ;; we're already familiar with.
(push :system features) (push :system features)
(put :system 'subfeatures doom-features) (put :system 'subfeatures doom-system)
;; Emacs needs a more consistent way to detect build features, and the docs ;; Emacs needs a more consistent way to detect build features, and the docs
;; claim `system-configuration-features' is not da way. Some features (that ;; claim `system-configuration-features' is not da way. Some features (that
@ -162,7 +161,7 @@
(defconst IS-MAC doom--system-macos-p) (defconst IS-MAC doom--system-macos-p)
(defconst IS-LINUX doom--system-linux-p) (defconst IS-LINUX doom--system-linux-p)
(defconst IS-WINDOWS doom--system-windows-p) (defconst IS-WINDOWS doom--system-windows-p)
(defconst IS-BSD (memq 'bsd doom-features)) (defconst IS-BSD (memq 'bsd doom-system))
(defconst EMACS28+ (> emacs-major-version 27)) (defconst EMACS28+ (> emacs-major-version 27))
(defconst EMACS29+ (> emacs-major-version 28)) (defconst EMACS29+ (> emacs-major-version 28))
(defconst MODULES (featurep 'dynamic-modules)) (defconst MODULES (featurep 'dynamic-modules))

View File

@ -24,7 +24,7 @@
;; than the current OSes preference ;; than the current OSes preference
doom-modeline-buffer-encoding 'nondefault doom-modeline-buffer-encoding 'nondefault
doom-modeline-default-eol-type doom-modeline-default-eol-type
(pcase doom-system ('macos 2) ('windows 1) (_ 0))) (pcase (car doom-system) ('macos 2) ('windows 1) (_ 0)))
:config :config
;; Fix an issue where these two variables aren't defined in TTY Emacs on MacOS ;; Fix an issue where these two variables aren't defined in TTY Emacs on MacOS