From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.org!not-for-mail
From: Noah Friedman <noah@splode.com>
Newsgroups: gmane.emacs.devel
Subject: Re: setenv's broken case when value is nil
Date: Wed, 17 Feb 2010 18:02:16 -0800 (PST)
Message-ID: <20100217180216.661079.FMU4029@unexploded-cow.prv.splode.com>
References: <20100217175616.608022.FMU4029@unexploded-cow.prv.splode.com>
Reply-To: Noah Friedman <noah@splode.com>
NNTP-Posting-Host: lo.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Trace: ger.gmane.org 1266466032 1134 80.91.229.12 (18 Feb 2010 04:07:12 GMT)
X-Complaints-To: usenet@ger.gmane.org
NNTP-Posting-Date: Thu, 18 Feb 2010 04:07:12 +0000 (UTC)
To: emacs-devel@gnu.org
Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Feb 18 05:07:09 2010
Return-path: <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>
Envelope-to: ged-emacs-devel@m.gmane.org
Original-Received: from lists.gnu.org ([199.232.76.165])
	by lo.gmane.org with esmtp (Exim 4.69)
	(envelope-from <emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org>)
	id 1NhxfQ-0006nu-Bm
	for ged-emacs-devel@m.gmane.org; Thu, 18 Feb 2010 05:07:08 +0100
Original-Received: from localhost ([127.0.0.1]:36197 helo=lists.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43)
	id 1NhxfP-0006fX-S9
	for ged-emacs-devel@m.gmane.org; Wed, 17 Feb 2010 23:07:07 -0500
Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43)
	id 1NhvjJ-00011M-0A
	for emacs-devel@gnu.org; Wed, 17 Feb 2010 21:03:01 -0500
Original-Received: from [140.186.70.92] (port=38978 helo=eggs.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.43) id 1NhvjI-00010r-Aq
	for emacs-devel@gnu.org; Wed, 17 Feb 2010 21:03:00 -0500
Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69)
	(envelope-from <noah@splode.com>) id 1NhvjH-00060J-EL
	for emacs-devel@gnu.org; Wed, 17 Feb 2010 21:03:00 -0500
Original-Received: from nutty-waffle-cone.splode.com ([208.83.220.130]:53167)
	by eggs.gnu.org with esmtp (Exim 4.69)
	(envelope-from <noah@splode.com>) id 1NhvjH-00060B-17
	for emacs-devel@gnu.org; Wed, 17 Feb 2010 21:02:59 -0500
Original-Received: from unexploded-cow.prv.splode.com.splode.com (prv.splode.com
	[173.8.128.9]) (authenticated bits=0)
	by nutty-waffle-cone.splode.com (8.13.1/8.13.1) with ESMTP id
	o1I22OOQ016785
	for <emacs-devel@gnu.org>; Wed, 17 Feb 2010 18:02:43 -0800
X-DomainKeys: Sendmail DomainKeys Filter v0.2.2 nutty-waffle-cone.splode.com
	o1I22OOQ016785
DomainKey-Signature: a=rsa-sha1; s=test001; d=splode.com; c=simple; q=dns;
	h=mime-version:content-type:content-transfer-encoding:from:to:subject:reply-to:references:date:message-id;
	b=rkEQQi7PJ+0uKP1WRzp/gqoUcHI90YGC3VdGp/ob36QgJH5hJ1Y62K0gF0uJc1iq
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.4-2.6
X-Mailman-Approved-At: Wed, 17 Feb 2010 23:06:16 -0500
X-BeenThere: emacs-devel@gnu.org
X-Mailman-Version: 2.1.5
Precedence: list
List-Id: "Emacs development discussions." <emacs-devel.gnu.org>
List-Unsubscribe: <http://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=unsubscribe>
List-Archive: <http://lists.gnu.org/pipermail/emacs-devel>
List-Post: <mailto:emacs-devel@gnu.org>
List-Help: <mailto:emacs-devel-request@gnu.org?subject=help>
List-Subscribe: <http://lists.gnu.org/mailman/listinfo/emacs-devel>,
	<mailto:emacs-devel-request@gnu.org?subject=subscribe>
Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org
Xref: news.gmane.org gmane.emacs.devel:121180
Archived-At: <http://permalink.gmane.org/gmane.emacs.devel/121180>

>lorentey@elte.hu changed env.el on 2007-08-29 to define setenv-internal and
>for setenv always to keep the variable name in process-environment, even if
>value is nil.  In other words, he removed the distinction between the empty
>string and nil, and therefore you can't remove variables from the
>environment using setenv anymore.
>
>Since all kinds of environment variables have meaning when they are
>defined, even if they are just set to the empty string, this is a screw.

My proposed change is this simple:

--- /export/src/emacs/build/2010-02-03--06-16-34--99438/lisp/env.el.~1~ 2010-02-17 18:00:41.968005373 -0800
+++ /export/src/emacs/build/2010-02-03--06-16-34--99438/lisp/env.el 2010-02-17 18:00:41.968005373 -0800
@@ -178,7 +178,7 @@
   (if (string-equal "TZ" variable)
       (set-time-zone-rule value))
   (setq process-environment (setenv-internal process-environment
-                                             variable value t))
+                                             variable value))
   value)
 
 (defun getenv (variable &optional frame)