From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Luis Gerhorst Newsgroups: gmane.emacs.bugs Subject: bug#32129: 26.1; Bug in add-dir-local-variable when used with eval, progn and setenv Date: Thu, 12 Jul 2018 01:18:19 +0200 Message-ID: <31BA42EC-58BC-4C69-9E04-E464AF41540D@luisgerhorst.de> References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 (Mac OS X Mail 11.4 \(3445.8.2\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1531351030 904 195.159.176.226 (11 Jul 2018 23:17:10 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Wed, 11 Jul 2018 23:17:10 +0000 (UTC) To: 32129@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Jul 12 01:17:05 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 1fdOM4-00009i-UO for geb-bug-gnu-emacs@m.gmane.org; Thu, 12 Jul 2018 01:17:05 +0200 Original-Received: from localhost ([::1]:55763 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdOO9-0003uf-ED for geb-bug-gnu-emacs@m.gmane.org; Wed, 11 Jul 2018 19:19:15 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:37495) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fdOO2-0003uW-0V for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:19:07 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fdONy-0001Ek-NL for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:48168) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fdONy-0001EB-Bb for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1fdONy-0000h1-12 for bug-gnu-emacs@gnu.org; Wed, 11 Jul 2018 19:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Luis Gerhorst Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 11 Jul 2018 23:19: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.15313511062598 (code B ref 32129); Wed, 11 Jul 2018 23:19:01 +0000 Original-Received: (at 32129) by debbugs.gnu.org; 11 Jul 2018 23:18:26 +0000 Original-Received: from localhost ([127.0.0.1]:56065 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdONM-0000fm-7N for submit@debbugs.gnu.org; Wed, 11 Jul 2018 19:18:24 -0400 Original-Received: from out4-smtp.messagingengine.com ([66.111.4.28]:40899) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1fdONK-0000fd-7t for 32129@debbugs.gnu.org; Wed, 11 Jul 2018 19:18:22 -0400 Original-Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 22BC321B6D for <32129@debbugs.gnu.org>; Wed, 11 Jul 2018 19:18:21 -0400 (EDT) Original-Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 11 Jul 2018 19:18:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=luisgerhorst.de; h=content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=MqMzX1VJ2l1j+s/IyJozu2jPnQ KgvGdnvjCltgbk6GY=; b=kCVJAp1vL80+IhxTLJUE0l+XTdJKYxG0TrIYdAYt62 7mZlJHt2y9yKhqSGxsWv/y1sls4lJfSTAp68sHOKs/NdZhpKVjl2xNerqaWyofPn UuqcdZWMLC4H36Rc/elb3B395rr2AgAYzw+EhYIc52ripQ6RY6xeEEUikljq6D3m 0= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=MqMzX1 VJ2l1j+s/IyJozu2jPnQKgvGdnvjCltgbk6GY=; b=r6vC0A2u5qkD9/G/qeczZn QCcupxuMz1Cg4F0AvtNc86cfvatNJiXLmLYnUN68YAy4xuY0zfQ1SqCSrZnOJFyy OY3+VzmmC+btcu3G+qlaN5nI1Huptcp4+1ZZvRp6hNRwoPn5pYm4lxwV6d/Hmr8s zVa3ztqgJmGR5CWe068vMnBgb/Pp+qFDs4oHQFULs7/23lFcEJWgRZCsG2sBZj1u hv+NomANacgleLeoHne8QrhK5tlNhvVQsGBbhrllqXb+jxYMcIX8MEkeDZpp+6D9 EGv+uwpTgPNO8x4bJUr0ODg0Ulmt1fCUNCwoj4OE0nPJHK6woZhfQyRoQL2BLA0g == X-ME-Proxy: X-ME-Sender: Original-Received: from luis-imac.fritz.box (p4fd7bb07.dip0.t-ipconnect.de [79.215.187.7]) by mail.messagingengine.com (Postfix) with ESMTPA id 84B6310255 for <32129@debbugs.gnu.org>; Wed, 11 Jul 2018 19:18:20 -0400 (EDT) In-Reply-To: X-Mailer: Apple Mail (2.3445.8.2) 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:148457 Archived-At: I'm sorry for the noise, I just retried it and it worked, TEST was set. = So the generated .dir-locals.el does the right thing. Anyway: Shouldn't the .dir-locals.el look different? This is of course = just a question of preference, if it makes the code more elegant or = something I would accept that it's better to leave it as it is. Best regards, Luis > On 12. Jul 2018, at 01:07, Luis Gerhorst = wrote: >=20 >=20 > (1) Open Emacs with emacs -Q > (2) Type the following code into *scratch* >=20 > (add-dir-local-variable > 'c-mode > 'eval > '(progn (make-local-variable 'process-environment) > (setq process-environment (copy-sequence = process-environment)) > (setenv "TEST" "hello"))) >=20 > (3) M-x eval-buffer >=20 > Expected .dir-locals.el contents: > ((c-mode (eval . (progn (make-local-variable 'process-environment) > (setq process-environment (copy-sequence = process-environment)) > (setenv "TEST" "hello"))))) >=20 > Actual contents: > ((c-mode (eval progn (make-local-variable 'process-environment) > (setq process-environment (copy-sequence = process-environment)) > (setenv "TEST" "hello")))) >=20 > When I open a C file and inspect process-environment, TEST is not set. >=20 > When I manually create a .dir-locals.el with the expected contents, it > works. >=20 > 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. >=20 > Configured using: > 'configure --prefix=3D/home/cip/2016/un65esoq/local' >=20 > Configured features: > XPM JPEG TIFF GIF PNG RSVG IMAGEMAGICK SOUND GPM DBUS GSETTINGS NOTIFY > ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT LIBOTF XFT ZLIB > TOOLKIT_SCROLL_BARS GTK3 X11 THREADS LCMS2 >=20 > Important settings: > value of $LC_ALL: en_US.UTF-8 > value of $LC_CTYPE: C.UTF-8 > value of $LC_MESSAGES: C.UTF-8 > value of $LC_MONETARY: de_DE.UTF-8 > value of $LC_NUMERIC: de_DE.UTF-8 > value of $LC_TIME: de_DE.UTF-8 > value of $LANG: en_US.UTF-8 > locale-coding-system: utf-8-unix >=20 >=20 >=20