all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Perry Smith <pedzsan@gmail.com>
To: 16315@debbugs.gnu.org
Subject: bug#16315: Slow paste
Date: Wed, 1 Jan 2014 09:42:20 -0600	[thread overview]
Message-ID: <72CCD5AC-959C-4E7E-B54C-7CD1632BD2E5@gmail.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2605 bytes --]

Hi,

I have a Mac (10.8.5) running JollysFastVNC (1.48) viewing a RealVNC server (5.0.1) on AIX (6.1 TL08 SP03) running emacs (24.3).

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.

I believe it started when emacs 24 was being developed but I'm not sure.  I know the issue existed in 24.2 and did not exist in emacs 23 that I was using but I don't recall which subversion that was.

I've turned on TRACE_SELECTION in xselect.c and I've also duplicated those macros in keyboard.c and process.c.  When I start emacs -q I get this output:

10748140: get_input_pending returning 0
10748140: last check: read_kdb=-1 NILP(wait_for_cell):1
10748140: get_input_pending returning 0
10748140: no_avail:0
10748140: pselect 2

followed by a half second pause.  This is the normal polling of the input (I guess its normal).  I go to a Mac window, select some text, then hit command-C to copy it into the cut buffer, then select the VNC window (where emacs is already the active window) and hit control-Y to paste.

I get:

10748140: get_input_pending returning 1
10748140: get_input_pending returning 1
10748140: Get selection UTF8_STRING, type _EMACS_TMP_
10748140:   Start waiting 5 secs for SelectionNotify
10748140: last check: read_kdb=0 NILP(wait_for_cell):0
10748140: Received SelectionNotify
10748140: get_input_pending returning 0
10748140: no_avail:0
10748140: pselect 2

followed by a 5 second pause, then I get

10748140:   Got event = 1
10748140: Reading selection data
10748140: Read 7 bytes from property _EMACS_TMP_
10748140:   Delete property _EMACS_TMP_

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.

Perry Smith


[-- Attachment #2: Message signed with OpenPGP using GPGMail --]
[-- Type: application/pgp-signature, Size: 495 bytes --]

             reply	other threads:[~2014-01-01 15:42 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-01 15:42 Perry Smith [this message]
2020-12-06 15:11 ` bug#16315: Slow paste Lars Ingebrigtsen
2020-12-06 23:15   ` Perry Smith
2020-12-06 23:16     ` Lars Ingebrigtsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=72CCD5AC-959C-4E7E-B54C-7CD1632BD2E5@gmail.com \
    --to=pedzsan@gmail.com \
    --cc=16315@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.