From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: edgar@openmail.cc Newsgroups: gmane.emacs.help Subject: Re: dir-locals.el process-environment Date: Thu, 17 May 2018 19:55:01 +0000 Message-ID: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1526586828 12573 195.159.176.226 (17 May 2018 19:53:48 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 17 May 2018 19:53:48 +0000 (UTC) User-Agent: Roundcube Webmail/1.2.4 To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu May 17 21:53:44 2018 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fJOy8-00039O-BI for geh-help-gnu-emacs@m.gmane.org; Thu, 17 May 2018 21:53:44 +0200 Original-Received: from localhost ([::1]:34868 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJP0D-0001v5-NC for geh-help-gnu-emacs@m.gmane.org; Thu, 17 May 2018 15:55:53 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:49014) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fJOzl-0001v0-HV for help-gnu-emacs@gnu.org; Thu, 17 May 2018 15:55:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fJOzh-0002OK-Hb for help-gnu-emacs@gnu.org; Thu, 17 May 2018 15:55:25 -0400 Original-Received: from onethreetwo.vfemail.net ([199.16.11.132]:16099 helo=vfemail.net) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1fJOzh-0002Nk-9y for help-gnu-emacs@gnu.org; Thu, 17 May 2018 15:55:21 -0400 Original-Received: (qmail 65020 invoked by uid 89); 17 May 2018 19:55:17 -0000 Original-Received: from localhost (HELO freequeue.vfemail.net) (127.0.0.1) by localhost with (DHE-RSA-AES256-SHA encrypted) SMTP; 17 May 2018 19:55:17 -0000 Original-Received: (qmail 64957 invoked by uid 89); 17 May 2018 19:54:59 -0000 Original-Received: by simscan 1.4.0 ppid: 64955, pid: 64956, t: 0.0020s scanners:none Original-Received: from unknown (HELO smtp102-2.vfemail.net) (172.16.100.62) by FreeQueue with SMTP; 17 May 2018 19:54:59 -0000 Original-Received: (qmail 362 invoked by uid 89); 17 May 2018 19:54:48 -0000 Original-Received: by simscan 1.4.0 ppid: 356, pid: 359, t: 0.0380s scanners:none Original-Received: from unknown (HELO www.vfemail.net) (ZWRnYXJAb3Blbm1haWwuY2M=@172.16.100.137) by 172.16.100.62 with ESMTPA; 17 May 2018 19:54:48 -0000 Original-Received: from ZD900MqGVrFL6y8pD36Y6b768VfrgBha by www.vfemail.net with HTTP (HTTP/1.1 POST); Thu, 17 May 2018 14:55:01 -0500 X-Sender: edgar@openmail.cc X-detected-operating-system: by eggs.gnu.org: FreeBSD 8.x [fuzzy] X-Received-From: 199.16.11.132 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "help-gnu-emacs" Xref: news.gmane.org gmane.emacs.help:116750 Archived-At: On Sat, 03 Mar 2018 05:40:03 +0000 > I still have to check if the debugging will use those environmental > variables :P . Hello, I want to report on my progress. This allows me to source environment variables for process-environment, which is used for compilation and debugging (gdb). The variables are set with a BASH script. I hope that it is useful to others. Note that 1. the name of the sourced file needs to be changed: `/path/to/environment/file.sh' 2. Emac's `compile-command' may not need the `METHOD=dbg' (it's something for me) 3. `$ENV_VAR_CPU' sets set the number of processes to run with make. This variable is defined in `/path/to/environment/file.sh'. ┌──── │ ( │ ("src" ;https://stackoverflow.com/a/19521152 │ . │ ( │ (c++-mode │ . │ ( │ (eval ;https://emacs.stackexchange.com/a/35965 │ . (progn │ (with-temp-buffer ;https://stackoverflow.com/a/16789182 │ (call-process "bash" nil t nil "-c" │ "source /path/to/environment/file.sh; env") │ (goto-char (point-min)) │ (while (not (eobp)) │ (setq process-environment │ (cons (buffer-substring (point) (line-end-position)) │ process-environment)) │ (forward-line 1))) │ )) │ │ (compile-command │ . (concat │ "METHOD=dbg make -j $ENV_VAR_CPU -C ../")) │ ) │ ) │ ) │ ) │ ) └──── This is how I check if the environment is working: ┌──── │ # https://stackoverflow.com/a/32917097 │ xargs -0 printf %s\\n < /proc/($pidof gdb)/environ └──── These threads may be related: [https://stackoverflow.com/a/9669183] [https://lists.gnu.org/archive/html/help-gnu-emacs/2008-06/msg00158.html] [https://lists.gnu.org/archive/html/help-gnu-emacs/2008-06/msg00063.html] [https://lists.gnu.org/archive/html/help-gnu-emacs/2018-02/msg00162.html] [https://lists.gnu.org/archive/html/help-gnu-emacs/2018-03/msg00007.html] Thanks for your help! ------------------------------------------------- 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!