Subject: Re: bug#74157: 30.0.92; `emacsclient-program-name' doesn't factor Emacs name changes

From: Eli Zaretskii <[email-masked]>
Date: Fri, 01 Nov 2024 16:57:23 +0200

> Date: Fri, 1 Nov 2024 16:51:32 +0900
> From: Jerome <[email-masked]>
> 
> Emacs 30 adds the `emacsclient-program-name', but its default value
> doesn't factor the build time Emacs name configuration changes (with
> prefix, suffix and sed transormation). I only verified this with the
> suffix confguration, but assume prefix and sed transformation are the
> same.
> 
> In my case I configured with `--program-suffix=-30pre'. The Emacs client
> program is, as expected, `emacsclient-30pre', but the value of
> `emacsclient-program-name' is still `'emacsclient'. The variable value
> should reflect the configure time name change(s).

It's actually more complex than that: the programs are renamed only
when Emacs is installed, not when Emacs is built.  So when Emacs is
run from the build tree, this variable should have its original name,
and only when Emacs is run from its installed location, the name
should reflect the transform.  Which means the name transformation
cannot be static, at build time; it must be done at run time when we
take note of invocation-name.

> This would make `with-editor' simpler (from Emacs 30 onward) as no
> heuristics would be needed to derive the Emacs client name. See:
> https://github.com/magit/with-editor/issues/132

It's too late for Emacs 30 for such non-trivial changes,
unfortunately.  So we can only improve this in Emacs 31.