Subject: Re: bug#13924: 24.2; Recompile and compile-environment

From: Lars Ingebrigtsen <[email-masked]>
Date: Wed, 14 Aug 2019 23:09:16 -0700

[email-masked] writes:

> This lisp code starts a compilation with the provided environment:
>
>   (let ((compilation-environment '("FOO=BAR")))
>     (compile "printenv"))
>
> Typing 'g' or 'M-x recompile' in the *compilation* buffer starts
> another compilation with the same environment.  This is evident since
> the printenv output includes FOO=BAR.
>
> However, typing 'M-x recompile' in some other buffer will not use the same
> environment as the first compilation.  FOO=BAR is no longer present.
>
> This behaviour may be a bug or a feature.  However, in my opinion it
> renders the combination of 'compilation-environment' and 'recompile'
> somewhat useless.

I think this behaviour is probably as intended.  As the doc string to
`recompile' says:

--
If this is run in a Compilation mode buffer, re-use the arguments from the
original use.  Otherwise, recompile using ‘compile-command’.
--

I think that implies that the `compilation-environment' isn't reused,
either.

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no