all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#32129: 26.1; Bug in add-dir-local-variable when used with eval, progn and setenv
@ 2018-07-11 23:07 Luis Gerhorst
  2018-07-11 23:18 ` Luis Gerhorst
  2018-07-11 23:20 ` Noam Postavsky
  0 siblings, 2 replies; 4+ messages in thread
From: Luis Gerhorst @ 2018-07-11 23:07 UTC (permalink / raw)
  To: 32129


(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.

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.

Configured using:
 'configure --prefix=/home/cip/2016/un65esoq/local'

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

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





^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-13  9:26 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-11 23:07 bug#32129: 26.1; Bug in add-dir-local-variable when used with eval, progn and setenv Luis Gerhorst
2018-07-11 23:18 ` Luis Gerhorst
2018-07-13  9:26   ` Noam Postavsky
2018-07-11 23:20 ` Noam Postavsky

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.