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

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

Emacs21 + Expect Sometimes doesn't work


From: Tennis Smith \(tennis\)
Subject: Emacs21 + Expect Sometimes doesn't work
Date: Wed, 18 Aug 2004 05:30:56 -0700

Hi,

I hope this is the correct place to send this. If not, please let me know.

The problem is that in certain circumstances, Tcl/Expect doesn't work
correctly while in an Emacs shell.  Application output that Expect is
"expecting" will not be detected.

1 - Everything works correctly on rxvt, xterm and Emacs version
20.7.1 and earlier.

2 - The only environment that consistently has this occur is Emacs versions
21.2.95.2 and later.

The tests were gathered in a completely generic emacs environment. All emacs
instances were started without an ".emacs" file of any kind.

Steps To Recreate:

Below are two tiny TCL scripts and info about my emacs environment.

 The "test.exp" script spawns a task. The "datagen.tcl" script is
called in the spawned task and simply writes to the screen. The "test.exp"
then reads output from "datagen.tcl" Run the "test.exp" script with the
"datagen.tcl" script in the same directory.

When everything is working _correctly_, you'll see two copies of  command
output from "datagen.tcl", one from stdout and one printed from  expect
itself.

If run under an xterm, expect will be able to detect output and put it into
the "accum" variable (which is then printed). But, if run in a shell under
Emacs, expect will not detect the data and will put only blank lines into
the "accum" variable.

TIA,
-Tennis
<----------------------Begin test.exp ----------------------------------->
#!/bin/sh
# 
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x
set starter { ${1:+"$@"}
    shift
    shift
    exec expect -f $0 -- ${1:+"$@"}
}
#
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x
#
# Ive tried this test under tcsh and bash. Both have the same
# result.
#
puts ">>>>>>>>BEGIN VERSION INFO<<<<<<<<<<\
     \nTCL VERSION:\ntcl version [info tclversion]\n\
     \nEXPECT VERSION:\n[exec expect -v]\n\
     \nBASH Version:\n[exec bash --version]\n\
     \nTCSH Version:\n [exec tcsh --version]\n\
     \n>>>>>>>END VERSION INFO<<<<<<<<<<<<<<\n\n"
spawn bash
exp_send "./datagen.tcl\n"
set accum {}
expect {
    -re " " {
        set accum "${accum}$expect_out(buffer)"
        exp_continue
    }
    timeout {
        if {![string length $expect_out(buffer)]} {
            set accum  "timed out waiting for data"
        } else {
            set accum "${accum}\n\nFinal timeout\n"
        }
    }
}
puts "accum:$accum"

# End of test.exp

<-------------------------------Begin datagen.tcl------------------------>
#!/bin/sh
#
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x
set starter { ${1:+"$@"}
    shift
    shift
    exec expect -f $0 -- ${1:+"$@"}
}
#
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
x
puts "ipconfig\
\n\nWindows 2000 IP Configuration\
\n\nEthernet adapter 126 Network:\
\n\n    Connection-specific DNS Suffix  . : \
\n      IP Address. . . . . . . . . . . . : 0.0.0.0\
\n      Subnet Mask . . . . . . . . . . . : 0.0.0.0\
\n      Default Gateway . . . . . . . . . : \
\n\nEthernet adapter 172 Network:\
\n\n    Connection-specific DNS Suffix  . : \
\n      IP Address. . . . . . . . . . . . : 172.19.178.242\
\n      Subnet Mask . . . . . . . . . . . : 255.255.255.0\
\n      Default Gateway . . . . . . . . . : 172.19.178.1"
# End of datagen.tcl



Emacs Info for NON-working configuration:

In GNU Emacs 21.2.95.2 (sparc-sun-solaris2.8, X toolkit)
 of 2003-02-05 on trisha
configured using `configure
--prefix=/usr/cisco/packages/emacs/emacs-21.2+20020205
--x-includes=/usr/cisco/include --x-libraries=/usr/cisco/lib --with-pop
--with-xpm --with-jpeg --with-tiff --with-gif --with-png'
Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: nil
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: nil
  locale-coding-system: nil
  default-enable-multibyte-characters: t







reply via email to

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