- Subject: Re: [jed-users] Clipboard problem
- From: "John E. Davis" <jed@xxxxxxxxxxx>
- Date: Mon, 26 May 2025 04:48:10 -0400
Morten Bo Johansen <mbj@xxxxxxxxx> wrote:
> If you have the time, then in e.g. a scratch buffer, insert the following:
>
> define t()
> {
> insert("\(\)");
> }
>
> local_setkey("(", t);
>
> and do
>
> alt-x evalbuffer
>
> then typing "(" will insert "()".
>
> Now, try to mark the "()" with the clipboard region selection - I do this by
> holding down the shift key and then drag over the region with the left mouse
> button. Then insert the selection - I do this by holding down the shift key
> and then press the middle mouse button. Instead of inserting "()", it
> inserts "())", i.e. an extra right parenthesis is added.
>
> Why does it do this and how can I avoid it?
The reason you observe this behavior is that when you paste back into
the editor, you are actually pasting into the terminal where jed is
running, such as XTerm. This terminal then sends the pasted characters
to the input stream as if they were typed directly. In this instance,
jed detected two characters in the input stream: '(' and ')'. Since
you assigned the '(' key to insert '()', the input character '('
triggered the insertion of '()'. The second character in the input
stream was simply ')', which was inserted as is. Consequently, the
final result is: '())'.
Use 'Esc-X paste' before pasting into the editor to avoid this issue.
Thanks,
--John
>
> Jed's own copy/insert region functions have no problems.
>
> Thanks,
> Morten
> _______________________________________________
> For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
>
_______________________________________________
For list information, visit <http://jedsoft.org/jed/mailinglists.html>.
[2025 date index]
[2025 thread index]
[Thread Prev] [Thread Next]
[Date Prev] [Date Next]