On my Mac laptop, I can start Emacs in several ways, including (1) clicking on an icon on the dock, or (2) running
% emacs
from the Terminal app.
These two ways of launching Emacs produce instances of Emacs that run differently, because they have different settings for their environment variables.
How can I give the instance of Emacs that I start by clicking on an icon the "same"1 environment as that of an instance of Emacs started from the Unix shell command-line (as described above) right after the parent shell is initialized?
1 Well, the two environments cannot be exactly the same, because there are some environment settings, such as the value of the $$
parameter, that are specific to the respective processes. So, when I say that two environments are "the same", I mean that they agree on all the settings for which such agreement is possible in principle.