* ange-ftp sets TERM=dumb in both its subprocess and emacs' main process
@ 2003-12-23 22:28 Arturo García Ares
2003-12-24 18:58 ` Kevin Rodgers
0 siblings, 1 reply; 3+ messages in thread
From: Arturo García Ares @ 2003-12-23 22:28 UTC (permalink / raw)
Hello,
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).
Don't really know if this is a feature or a bug; in case it's a
well-known feature, I apology for wasting your time, but then I would
like to know how to reach the original TERM setting from within my
.emacs loaded via ange-ftp.
The emacs version I'm using is "GNU Emacs 21.3.1", as reported by 'emacs
-version'.
Arturo
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ange-ftp sets TERM=dumb in both its subprocess and emacs' main process
2003-12-23 22:28 ange-ftp sets TERM=dumb in both its subprocess and emacs' main process Arturo García Ares
@ 2003-12-24 18:58 ` Kevin Rodgers
2003-12-25 6:22 ` Arturo García Ares
0 siblings, 1 reply; 3+ messages in thread
From: Kevin Rodgers @ 2003-12-24 18:58 UTC (permalink / raw)
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: ange-ftp sets TERM=dumb in both its subprocess and emacs' main process
2003-12-24 18:58 ` Kevin Rodgers
@ 2003-12-25 6:22 ` Arturo García Ares
0 siblings, 0 replies; 3+ messages in thread
From: Arturo García Ares @ 2003-12-25 6:22 UTC (permalink / raw)
Cc: bug-gnu-emacs
On Wed, Dec 24, 2003 at 11:58:20AM -0700, Kevin Rodgers wrote:
>
> 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.
Thanks for the patch, it solves the problem. It certainly should go into
the next release if it's not there already.
--
Arturo
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2003-12-25 6:22 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-12-23 22:28 ange-ftp sets TERM=dumb in both its subprocess and emacs' main process Arturo García Ares
2003-12-24 18:58 ` Kevin Rodgers
2003-12-25 6:22 ` Arturo García Ares
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.