fix: failure to recognize X switches in PGTK builds

This is a regression introduced in 1c4217a.

Doom unsets command-line-x-option-alist when it reasonably suspects it's
not running in an X environment. The heuristic for that is checking when
`initial-window-system` is set to `x`, but as it turns out, PGTK builds
of Emacs set this to `pgtk`, so PGTK users were deprived of Emacs' X
switches, like --geometry, --foreground, --font, etc (they'd throw an
"Unknown option" error at startup). This was fixed.

However, this heuristic isn't perfect. Not all PGTK users are on X (I'd
hazard to guess most of them aren't). So a more reliable check is
needed (and it's too early in the startup process for us to call
display-graphic-p on any frame). The `(not IS-LINUX)` or `(or IS-MAC
IS-WINDOWS)` I had previously used (before 1c4217a) wasn't enough
either, because users can (and do) install X on these
systems (especially where WSL is involved). Still, until I've found a
better one, this is an acceptable workaround.

Amend: 1c4217aa27
This commit is contained in:
Henrik Lissner 2022-09-25 11:24:14 +02:00
parent 731764ae71
commit 8bf308f9b1
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -448,7 +448,7 @@ users).")
;; relevant to our current OS, but `command-line-1' still processes.
(unless IS-MAC
(setq command-line-ns-option-alist nil))
(unless (eq initial-window-system 'x)
(unless (memq initial-window-system '(x pgtk))
(setq command-line-x-option-alist nil))))