- Subject: Re: Re: some jedmodes
- From: "John E. Davis" <davis>
- Date: Wed, 5 Feb 2003 13:26:01 -0500
Romano Giannetti <romano@xxxxxxxxxxxxxxxx> wrote:
>Really nice, thank you! May I propose a more general version? This one works
>for jed and xjed and is i18n wise :-), and it will not jump to bob() every
I have a somewhat more general solution that you may want to try. In
jed/lib/runpgm.sl, you will find:
#ifdef XWINDOWS
custom_variable ("XTerm_Pgm", "xterm");
define _jed_run_program_hook (s)
{
s = strtrim_end (s, " \t&");
return system (sprintf ("%s -e %s &", XTerm_Pgm, s));
}
#endif
Try changing it to:
static variable Run_Pgm_In_Fg = 0;
#ifdef XWINDOWS
custom_variable ("XTerm_Pgm", "xterm");
define _jed_run_program_hook (s)
{
s = strtrim_end (s, " \t&");
variable bg = "&";
if (Run_Pgm_In_Fg) bg = "";
return system (sprintf ("%s -e %s %s", XTerm_Pgm, s, bg));
}
#endif
Then in the same file, change:
public define vrun_program ()
{
variable args = __pop_args (_NARGS);
return run_program (sprintf (__push_args (args)));
}
to:
public define vrun_program ()
{
variable args = __pop_args (_NARGS);
Run_Pgm_In_Fg = 0;
return run_program (sprintf (__push_args (args)));
}
public define vrun_program_fg ()
{
variable args = __pop_args (_NARGS);
Run_Pgm_In_Fg = 1;
return run_program (sprintf (__push_args (args)));
}
With the above changes to runpgm.sl, you should be replace the ispell
code
>#ifndef XWINDOWS
> cmd = strcat("stty opost icrnl; clear; ", command, tmp,
> "; echo press ENTER; read dummy;", % prompt
> "stty -opost -icrnl");
>#else
> flush(strcat("Calling ", command));
> cmd = strcat("xterm -e ", command, tmp);
>#endif
> () = system(cmd);
to the more simpler version:
() = vrun_program_fg ("%s %s", command, tmp);
You will probably need to add
autoload ("vrun_program_fg", "runpgm");
to the top of ispell.sl.
If something like this proves useful, I will add it to the next release.
Thanks,
--John
--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.
[2003 date index]
[2003 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]