Subject: Re: bug#32921: emacsclient obeys Xresources even when launched with -nw

From: Eli Zaretskii <[email-masked]>
Date: Thu, 19 May 2022 10:02:39 +0300

> From: Po Lu <[email-masked]>
> Cc: Eli Zaretskii <[email-masked]>,  [email-masked],  [email-masked]
> Date: Thu, 19 May 2022 09:37:50 +0800
> 
> What we actually need is not to remove that code, but to add a
> terminal-local version of `default-frame-alist': as-is I think the code
> will probably also end up overwriting the default value of
> `inverse-video' when connecting to a new display with a different value
> of that resource.

It cannot be terminal-local, I think, because we want it to be in
effect for future terminals as well.

In frameset.el, we have a solution for a similar problem: instead of
setting the literal frame-parameter PARAM, we set a specially-named
parameter GUI:PARAM.  Then, when we need to actually create a frame,
we consult those GUI:PARAM parameters, and apply them as needed.

So my proposal is to modify window-system-initialization in x-win.el
to define special XRESOURCE:FOO parameters in default-frame-alist,
instead of defining FOO parameters themselves, and then change the GUI
frame-parameter handlers to define the FOO parameters from the values
of those XRESOURCE:FOO parameters.  (We only need this special
handling for frame parameters that are not ignored on TTY frames.)

Does this make sense?