[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
locally modifying `compilation-environment'
From: |
Stephen Leake |
Subject: |
locally modifying `compilation-environment' |
Date: |
Sun, 13 Oct 2013 15:37:48 -0500 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.3 (windows-nt) |
`compilation-start' uses `make-local-variable' to make
`compilation-environment' buffer-local in the created compilation
buffer.
That complains if it is let-bound, like this:
(let ((compilation-environment ...)
...)
(compilation-start cmd
'compilation-mode
(lambda (mode-name) (concat mode-name
"-gnatinspect-overriding")))
)
This gives a message:
Making compilation-environment local to
compilation-gnatinspect-overriding while let-bound!
I assume `compilation-environment' is made buffer-local so it will have
the same value for a rerun of the compile command in that buffer, which
makes sense.
But I don't see any other way to modify compilation-environment for this
compilation only.
compile-start-hook is run too late, so I can't set
compilation-environment there.
In this particular application, I can let-bind process-environment
instead (it is not made buffer-local); I don't care about re-running the
compile command. But that by-passes the purpose of
compilation-environment in general.
It seems compilation-start needs another parameter, for a local value of
compilation-environment.
--
-- Stephe
- locally modifying `compilation-environment',
Stephen Leake <=