jed-users mailing list

[2011 Date Index] [2011 Thread Index] [Other years]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]

Re: [Jed-users-l] "chat mode"?


Ulli Horlacher <framstag@xxxxxxxxxxxxxxxxxxxx> wrote:
> The write and read fifos are asynchronous: not every output generates an
> input line or vice veras.
>
> I have looked at shell.sh, but this is not what I want.
>
> Any hints or example code?

You might want to look at slang/slsh/lib/sldbsock.sl, which implements
a sockets based interface form communicating with the slang debugger
sldb.  I use this for debugging jed's slang code as follows:

   # jed -hook debug /path/to/file.sl

The `debug` function is defined below.  Another function called `_line`
is also defined.  I use it to print the current line that is being
edited, e.g.,

   (sldb) p _line

I hope this helps.  Thanks, --John

autoload ("sldb", "sldbsock");
define _line ()
{
   variable beg, end;
   push_spot ();
   push_mark ();
   bol ();
   beg = bufsubstr ();
   pop_spot ();
   push_spot ();
   push_mark ();
   eol ();
   end = bufsubstr ();
   pop_spot ();

   return strcat (beg, "^", end);
}

define debug (files)
{
   if (NULL != getenv ("DISPLAY"))
     {
	% Here setsid is used to run xterm in a different session.
	variable pgm = path_concat (_slang_install_prefix, "share/slsh/scripts/sldb");
	pgm = sprintf ("(sleep 1; setsid xterm -e '%s' --pid %d) &", pgm, getpid ());
	() = system (pgm);
     }
   sldb (files[0]);
}
_______________________________________________
Jed-users-l mailing list
Jed-users-l@xxxxxxxx
http://mailman.jtan.com/mailman/listinfo/jed-users-l


[2011 date index] [2011 thread index]
[Thread Prev] [Thread Next]      [Date Prev] [Date Next]