From 8bf308f9b100c92cc3e95b7f9855c047301583fd Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Sun, 25 Sep 2022 11:24:14 +0200 Subject: [PATCH] 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: 1c4217aa27de --- lisp/doom.el | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lisp/doom.el b/lisp/doom.el index 057d02fdb..47aff98f8 100644 --- a/lisp/doom.el +++ b/lisp/doom.el @@ -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))))