emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Multi-tty design (Re: Reordering etc/NEWS)


From: David Kastrup
Subject: Re: Multi-tty design (Re: Reordering etc/NEWS)
Date: Tue, 22 May 2007 08:37:53 +0200
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/23.0.51 (gnu/linux)

Miles Bader <address@hidden> writes:

> David Kastrup <address@hidden> writes:
>>> I was thinking of (let ((process-environment (cons FOO
>>> process-environment)))
>>
>> Do we actually have code like this around?t.
>
> Yes.
>
>> It would appear somewhat strange in pre-multitty since it more or
>> less assumes that process-environment can contain multiple mentions of
>> environment variables with only the first taking effect
>
> This usage style is explicitly supported by the C code which exports
> process-enviroment -- it only exports the first occurance of any given
> environment variable.
>
> Indeed, given this support, it's a much more elegant and efficient idiom
> for elisp than copy+setenv....

Hm, maybe the shared tails idea will indeed be the most expedient idea
for playing with several concepts.  It appears to do the trick for
most use cases.

The only thing that does not really look nice is deleting the first
element of the shared tail global-process-environment: one would have
to do the deletion the hard way, by doing something like

(setq tail (member "WHATEVER" process-environment))
(setcar tail (cadr tail))
(setcdr tail (cddr tail))

Which does not work when WHATEVER is the last environment variable...
Maybe one should start global-process-environment with a dummy entry.
Ugly.

Is there any way to check whether process-environment is
terminal-local (the global binding), or let-bound?  Maybe a solution
can be manufactured around that.

-- 
David Kastrup




reply via email to

[Prev in Thread] Current Thread [Next in Thread]