GNU bug report logs - #30134
ehsell and process-environment variable

Previous Next

Package: emacs;

Reported by: SK Kim <tttuuu888 <at> gmail.com>

Date: Tue, 16 Jan 2018 02:32:01 UTC

Severity: minor

Tags: notabug

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: SK Kim <tttuuu888 <at> gmail.com>
To: 30134 <at> debbugs.gnu.org
Subject: bug#30134: ehsell and process-environment variable
Date: Thu, 18 Jan 2018 15:11:26 +0900
[Message part 1 (text/plain, inline)]
I have looked into eshell and make-term source and narrowed down the
range of the issue somewhat.

If I evaluate the test code from eshell buffer, process-environment
lose "TEST=1234" inside make-term function as below.

(defun make-term (name program &optional startfile &rest switches)
  (let ((buffer (get-buffer-create (concat "*" name "*"))))
    (cond ((not (term-check-proc buffer))
    ;; Here, process-environemnt still have "TEST=1234"
   (with-current-buffer buffer
       ;; Here, process-environemnt lost "TEST=1234"
     (term-mode))
   (term-exec buffer name program startfile switches)))
    buffer))

I still don't know why but process-environment lost some values when
creating new buffer with 'get-buffer-create' function.

You can test this as below:

1-1) emacs -Q
1-2) evaluate below code.
     (let ((process-environment (cons "TEST=1234" process-environment)))
       (get-buffer-create "test-buffer")
       (switch-to-buffer "test-buffer")
       (member "TEST=1234" process-environment))
1-3) you can see "TEST=1234" is a member of process-environment in new
buffer.

2-1) emacs -Q
2-2) M-x eshell
2-3) evaluate below code in eshell buffer.
     (let ((process-environment (cons "TEST=1234" process-environment)))
       (get-buffer-create "test-buffer")
       (switch-to-buffer "test-buffer")
       (member "TEST=1234" process-environment))
2-4) you can see "TEST=1234" is lost from process-environment.


You can also test this simply as below.

3-1) emacs -Q
3-2) M-x eshell
3-3) evaluate below code in eshell buffer.
     (let ((process-environment (cons "TEST=1234" process-environment)))
       (with-temp-buffer
         (member "TEST=1234" process-environment)))
3-4) you can see "TEST=1234" is lost from process-environment.
[Message part 2 (text/html, inline)]

This bug report was last modified 7 years and 188 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.