jed-users mailing list

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

Re: Temporarily leaving C Mode?


Ryan Swan <ryan_swan@xxxxxxxxx> wrote:
>There many times when I want to paste into Jed while
>editing a .c file in C mode, via Konsole(KDE's
>terminal program) and want to paste in plain text
>mode.  I've tried to use set_mode(), but that didn't
>change ^M to plain old newline.  Is there a better way
>to do the following?

I use this function:

define paste ()
{
   flush ("Ready for data...");
   
   if (0 == input_pending (300))
     {
	message ("You have taken too much time");
	return;
     }
   variable as = _test_buffer_flag (2);
   ERROR_BLOCK
     {
	if (as) _set_buffer_flag (2);
     }
   _unset_buffer_flag (2);

   flush ("Pasting in progress...");
   while (input_pending (10))
     {
	variable ch = getkey ();
	if (ch == '\r')
	  {
	     ch = '\n';
	  }
	insert_char (ch);
	update (0);
     }
   EXECUTE_ERROR_BLOCK;
   message ("Done");
}

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


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