From: Stephen Leake <stephen_leake@stephe-leake.org>
To: emacs-devel@gnu.org
Subject: locally modifying `compilation-environment'
Date: Sun, 13 Oct 2013 15:37:48 -0500 [thread overview]
Message-ID: <85d2n8ewkj.fsf@stephe-leake.org> (raw)
`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
next reply other threads:[~2013-10-13 20:37 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-13 20:37 Stephen Leake [this message]
2013-10-14 4:45 ` locally modifying `compilation-environment' Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=85d2n8ewkj.fsf@stephe-leake.org \
--to=stephen_leake@stephe-leake.org \
--cc=emacs-devel@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.