refactor: cut down on pseudo-features

Way back, I added these three pseudo-features:

  (featurep 'dynamic-modules)
  (featurep 'harfbuzz)
  (featurep 'jansson)

Why? Because some build features have pseudo features (like
`tty-child-frames`, `pgtk`, and `threads`), but others don't, and I
wanted more consistency around build feature detection. Years later, I
realized it wasn't used much internally and only ended up confusing
readers who didn't realize these were Doom's additions and not built
into Emacs. Emacs' idiosyncrasies may not be nice or elegant, but
they're less surprising to elisp beginners and veterans alike.
This commit is contained in:
Henrik Lissner 2026-01-23 18:05:59 -05:00
parent 728615c8b0
commit 1a943aea69
No known key found for this signature in database
GPG key ID: B60957CA074D39A3
5 changed files with 5 additions and 4 deletions

View file

@ -144,6 +144,7 @@
(push :system features)
(put :system 'subfeatures doom-system)
;;; DEPRECATED: Remove in v3
;; Emacs needs a more consistent way to detect build features, and the docs
;; claim `system-configuration-features' is not da way. Some features (that
;; don't represent packages) can be found in `features' (which `featurep'

View file

@ -1,7 +1,7 @@
;;; term/vterm/config.el -*- lexical-binding: t; -*-
(use-package! vterm
:when (featurep 'dynamic-modules)
:when (bound-and-true-p module-file-suffix) ; requires dynamic-modules support
:commands vterm-mode
:hook (vterm-mode . doom-mark-buffer-as-real-h)
:hook (vterm-mode . hide-mode-line-mode) ; modeline serves no purpose in vterm

View file

@ -1,6 +1,6 @@
;;; tools/tree-sitter/doctor.el -*- lexical-binding: t; -*-
(unless (featurep 'dynamic-modules)
(unless (bound-and-true-p module-file-suffix) ; requires dynamic-modules support
(error! "Emacs not built with dynamic modules support"))
(if (version< emacs-version "29.1")

View file

@ -149,7 +149,7 @@ isn't disabled in `+ligatures-extras-in-modes'."
;; leave the check here for safety.
((and (> emacs-major-version 27)
(or (featurep 'ns)
(featurep 'harfbuzz))
(string-match-p "HARFBUZZ" system-configuration-features))
(featurep 'composite)) ; Emacs loads `composite' at startup
(after! ligature

View file

@ -2,6 +2,6 @@
;;; ui/ligatures/packages.el
(when (and (or (featurep 'ns)
(featurep 'harfbuzz))
(string-match-p "HARFBUZZ" system-configuration-features))
(featurep 'composite))
(package! ligature :pin "6ac1634612dbd42f7eb81ecaf022bd239aabb954"))