From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.bugs Subject: bug#32129: 26.1; Bug in add-dir-local-variable when used with eval, progn and setenv Date: Wed, 11 Jul 2018 19:20:27 -0400 Message-ID: <87a7qxbbr8.fsf@gmail.com> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1531351149 9085 195.159.176.226 (11 Jul 2018 23:19:09 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2018 23:19:09 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) Cc: 32129@debbugs.gnu.org To: Luis Gerhorst Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 12 01:19:04 2018 Return-path: Envelope-to: geb-bug-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 1fdOO0-0002FJ-57 for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Jul 2018 01:19:04 +0200 Original-Received: from localhost ([::1]:55775 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdOQ7-0004Rd-04 for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jul 2018 19:21:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38376) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdOPx-0004RG-Ky for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:21:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdOPu-0002FO-BS for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:21:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48172) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fdOPu-0002FK-7H for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fdOPt-0000lH-VG for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:21:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Noam Postavsky Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Jul 2018 23:21:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 32129 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 32129-submit@debbugs.gnu.org id=B32129.15313512362872 (code B ref 32129); Wed, 11 Jul 2018 23:21:01 +0000 Original-Received: (at 32129) by debbugs.gnu.org; 11 Jul 2018 23:20:36 +0000 Original-Received: from localhost ([127.0.0.1]:56069 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdOPU-0000kF-9b for submit@debbugs.gnu.org; Wed, 11 Jul 2018 19:20:36 -0400 Original-Received: from mail-it0-f47.google.com ([209.85.214.47]:33035) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdOPS-0000jy-UB for 32129@debbugs.gnu.org; Wed, 11 Jul 2018 19:20:35 -0400 Original-Received: by mail-it0-f47.google.com with SMTP id y124-v6so480456itc.0 for <32129@debbugs.gnu.org>; Wed, 11 Jul 2018 16:20:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=JJNOlbrH/ylpz/9UIfp3dy0Ffe60PO8gZINoIZGyHZA=; b=MZ6d5unvuyembSc/J2ipA7hEk260z9fgawmZnYGGplLIygDdaw2FhO73ckRaZ95ssT nYq7z0XJUX/ISxrr92s+XLKMXcZfLEp+3/kovw7nHP5hxxOYSWsjk/rg6iwfDll/iaHk /SMsLCIzCl4FoMR+QU7edBgAG2Br99Bv469ZnTEt+n9BYfx1v4KwJiW1JgYRLfBuUbJZ WA/mw0+1ZJALrfCpc8fEdzOaLA+BILHJABP/EjJV1jCTE1ET8l4zGTcycYM1jbcw4Lm5 8kPo8LbEl1UTY6oWunUqg7rhsg1L24o+IH3wK5C3b34ipZ7jnHPFUBgLvIb1PWlWWZxh MWyg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:references:date:in-reply-to :message-id:user-agent:mime-version; bh=JJNOlbrH/ylpz/9UIfp3dy0Ffe60PO8gZINoIZGyHZA=; b=X+ep/oPbD2C8lRFQJAvpT3OKJ+qm7aUyL1aLNKenlAUjUhHOQx4fsXwmnLE7dsl4iG 3zcIjXcgiM0Nn4AF/ufotyhLlEIClzLGNUFF9hBrvRH3C/bkqkB6NYhyhmZm6XRCgLt2 jFRMyIH3MKMdHtx8C2ZgLkSxDucH0+ekr8VnYb0YenLwmhcep4YwmXi0wOI9DMWNhddE 3//HlaxvhmwNJbSQbhIa8w5fVuqr4iug0MCKs3Q6f5PxIFdveMDTfqlhWXlqAivnG7HB 7Mb5r2xEcBC8xr9Hj0JwcW1DeYQURzcl4H6DNIBpmMLBlStk3R/a3LSuzZsl+ODmeD5X Oqew== X-Gm-Message-State: AOUpUlFKFZ6v6swwdOQOViYv8d+LLvU/SfaBeGb2yolbRW1JM7pW9GUh 5df41mrZCwiIEYTtBGphp4MUDQ== X-Google-Smtp-Source: AAOMgpf5LVehWGZ+gKn1srwpjzBkdhPGW/rn5dC4bSfyAZNOfzpaL/Y8IOUSBsXYkgHpCVogrJU1pA== X-Received: by 2002:a02:2505:: with SMTP id g5-v6mr389205jag.130.1531351229070; Wed, 11 Jul 2018 16:20:29 -0700 (PDT) Original-Received: from zebian (cbl-45-2-119-34.yyz.frontiernetworks.ca. [45.2.119.34]) by smtp.googlemail.com with ESMTPSA id g6-v6sm1453981itf.33.2018.07.11.16.20.28 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jul 2018 16:20:28 -0700 (PDT) In-Reply-To: (Luis Gerhorst's message of "Thu, 12 Jul 2018 01:07:17 +0200") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:148458 Archived-At: Luis Gerhorst writes: > (1) Open Emacs with emacs -Q > (2) Type the following code into *scratch* > > (add-dir-local-variable > 'c-mode > 'eval > '(progn (make-local-variable 'process-environment) > (setq process-environment (copy-sequence process-environment)) > (setenv "TEST" "hello"))) > > (3) M-x eval-buffer > > Expected .dir-locals.el contents: > ((c-mode (eval . (progn (make-local-variable 'process-environment) > (setq process-environment (copy-sequence process-environment)) > (setenv "TEST" "hello"))))) > > Actual contents: > ((c-mode (eval progn (make-local-variable 'process-environment) > (setq process-environment (copy-sequence process-environment)) > (setenv "TEST" "hello")))) > > When I open a C file and inspect process-environment, TEST is not set. > > When I manually create a .dir-locals.el with the expected contents, it > works. When I manually create a .dir-locals.el with the actual contents it works too. > Please correct me if I'm using add-dir-local-variable wrong, I was not > able to find a version that works as expected with the above > progn. Strangely, if I use (progn (message "hello")), instead of the > progn with setenv, "hello" gets printed every time I open a C file. I think add-dir-local-variable is fine, both the expected and actual values you posted are the same (the expected one just happens to use dotted pair notation). Maybe the problem is that you need to use (setq-local process-environment ...) Otherwise your eval clause sets the global value (which is possibly being clobbered by other things in your config?).