Subject: Re: bug#16315: Slow paste

From: Perry Smith <[email-masked]>
Date: Sun, 6 Dec 2020 17:15:51 -0600

I no longer work as the initial bug report said.  I’m not using AIX, RealVNC,
nor JollysFastVNC.  The original report had a change which I don’t recall
not working but if I’m the only person reporting the issue, I would just close
it and leave sleeping dogs lie.

> On Dec 6, 2020, at 9:11 AM, Lars Ingebrigtsen <[email-masked]> wrote:
> 
> Perry Smith <[email-masked]> writes:
> 
>> When I copy from a Mac window and paste into emacs (yank), there is a
>> long delay.  When I started seriously testing, it was always 5 seconds
>> but I have memories that sometimes it was much longer.  I'm calling
>> these memories "false" at this point.
> 
> [...]
> 
>> and then I see the text show up in the emacs window.  I *think* what
>> is "wrong" here is in this case, get_input_pending is actually pulling
>> the text out and via the SelectionNotify handler placing the text into
>> reading_selection_reply but then returns zero because, at that point
>> in time, there is no input to be read.  Thus this if test, is not
>> true:
>> 
>>     if ((read_kbd || !NILP (wait_for_cell))
>> 	  && detect_input_pending ())
>> 
>> I'm thinking that after detect_input_pending is called in
>> wait_reading_process_output, another two lines like this:
>> 
>>     if (! NILP (wait_for_cell) && ! NILP (XCAR (wait_for_cell)))
>> 	break;
>> 
>> should be added before the if (!no_avail) line (around line 4612 in
>> the copy I am looking at.
>> 
>> I made this change in my copy and so far, it seems to work.
> 
> (This bug report unfortunately got no response at the time.)
> 
> The wait_reading_process_output function has changed a bit over the
> years since this was first reported.  Are you still seeing this issue in
> more recent Emacs versions?
> 
> If so, could you include a proposed patch?
> 
> -- 
> (domestic pets only, the antidote for overdose, milk.)
>   bloggy blog: http://lars.ingebrigtsen.no