jed-users mailing list

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

Re: Esc-q and new line / line feed chars


G. Milde <g.milde@xxxxxx> wrote:
>#!/usr/bin/python
>#
># Transform tex-like paragraph into line

A purist would use something like this:

#!/usr/bin/env jed-script
if (__argc != 3)
{
   () = fprintf (stderr, "Usage: %s <input-file> <output-file>\n", __argv[0]);
   exit (1);
}
static variable Input_File = __argv[1];
static variable Output_File = __argv[2];
static define process_file (file)
{
   () = read_file ();
   trim_buffer ();
   while (eol (), not eobp ())
     {
	del ();
	if (looking_at ("\n"))
	  go_down (1);
	else
	  insert_single_space ();
     }
   () = write_buffer (Output_File);
}
process_file (Input_File, Output_File);
exit (0);

--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>.


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