help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: dir-locals.el process-environment


From: edgar
Subject: Re: dir-locals.el process-environment
Date: Wed, 28 Feb 2018 22:18:50 +0000
User-agent: Roundcube Webmail/1.2.4

Yes! Sorry again. Thank you for your help. The whole process is like this:

1. create .dir-locals.el in the top directory with this:

     (
      ("src"                   ;https://stackoverflow.com/a/19521152
       . ((c++-mode
;https://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
           .
           ((eval              ;https://emacs.stackexchange.com/a/35965
             . (progn
                 (make-local-variable 'process-environment)
                 (setq process-environment
                       (copy-sequence process-environment))
                 (setenv "CC" "mpicc")))
            (compile-command . "printf x$CC"))))))

2. visit src/main.C (it can be empty)
3. press F5 (or M-x compile RET)

Actual output
The result is a buffer with the following contents.
    -*- mode: compilation; default-directory: "src/" -*-
    Compilation started at DATE

    printf x$CC
    x
    Compilation finished at DATE

Expected output
I was expecting
    -*- mode: compilation; default-directory: "src/" -*-
    Compilation started at DATE

    printf x$CC
    xmpicc
    Compilation finished at DATE

System specifications
- GNU Emacs 25.2.2 (x86_64-pc-linux-gnu, GTK+ Version 3.22.21) of 2017-09-22, modified by Debian - Linux 4.13.0-32-generic #35-Ubuntu (it's not like Ubuntu is my cup of tea, but it was the best compromise at the time)

-------------------------------------------------

ONLY AT VFEmail! - Use our Metadata Mitigator to keep your email out of the 
NSA's hands!
$24.95 ONETIME Lifetime accounts with Privacy Features! 15GB disk! No bandwidth quotas! Commercial and Bulk Mail Options!


reply via email to

[Prev in Thread] Current Thread [Next in Thread]