jed-users mailing list

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

Re: pasting text using the X clipboard


On 12.09.06, Juergen Lemke wrote:
 
> Is there a way to automate this process? Is it
> possible for jed to figure out that text is being
> pasted from the X clipboard and temporarily revert to
> "no mode" before the text is inserted?

My workaround for this problem uses the input_pending() function to guess
whether the newline char comes from a paste operation or the <Return> key:

   !if (is_defined("x_server_vendor"))   % not needed in xjed
      setkey("newline_indent", "^M"); % correct mouse-insertion problem

with

   public define newline_indent()
   {
     if (input_pending(0))
        newline();
     else
        call("newline_and_indent");
   }


This has the advantage, that you do not need any special action or
keypress before the paste. It could err (to the side of not
auto-indenting) if you type faster than jed can process the input.

Günter

--------------------------
To unsubscribe send email to <jed-users-request@xxxxxxxxxxx> with
the word "unsubscribe" in the message body.
Need help? Email <jed-users-owner@xxxxxxxxxxx>.


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