bug-gnu-emacs
[Top][All Lists]
Advanced

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

Re: ange-ftp sets TERM=dumb in both its subprocess and emacs' main proce


From: Kevin Rodgers
Subject: Re: ange-ftp sets TERM=dumb in both its subprocess and emacs' main process
Date: Wed, 24 Dec 2003 11:58:20 -0700
User-agent: Mozilla/5.0 (X11; U; SunOS i86pc; en-US; rv:0.9.4.1) Gecko/20020406 Netscape6/6.2.2

Arturo García Ares wrote:

I'm having the following problem: if I start emacs with the command
line:

        $ emacs -l /ftp@host:.emacs

(that's the method I use to run emacs with my own config from a
'foreign' environment, substituting host for the real name)

then the TERM environment variable that the ftp-loaded .emacs sees is
"dumb" instead of the original setting, and that screws my config. I
understand that ange-ftp has to set TERM=dumb in it's own process to
keep the ftp client from cluttering the output with escape sequences,
but I see that it's also setting TERM=dumb in the main emacs process
(well, the truth is that only process-environment is changed, *not* the
real process environment).


The trick is to make that setting local to the ange-ftp process buffer.
ange-ftp-start-process tries to do that, by establishing a temporary
binding of process-environment before calling setenv, but that doesn't
work because setenv destructively modifies the process-environment list
structure.

Here's a patch:

*** emacs-21.3/lisp/net/ange-ftp.el.orig        Tue Oct 22 02:14:33 2002
--- emacs-21.3/lisp/net/ange-ftp.el     Wed Dec 24 11:56:40 2003
***************
*** 1916,1922 ****
     ;; but that doesn't work: ftp never responds.
     ;; Can anyone find a fix for that?
     (let ((process-connection-type t)
!         (process-environment process-environment)
          (buffer (get-buffer-create name)))
       (save-excursion
        (set-buffer buffer)
--- 1916,1922 ----
     ;; but that doesn't work: ftp never responds.
     ;; Can anyone find a fix for that?
     (let ((process-connection-type t)
!         (process-environment (copy-sequence process-environment))
          (buffer (get-buffer-create name)))
       (save-excursion
        (set-buffer buffer)

--
Kevin Rodgers






reply via email to

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