all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Davis Herring <herring@lanl.gov>
Subject: Issues with X selection handling
Date: Tue, 17 Aug 2004 12:52:44 -0600 (MDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0408170952350.29159-100000@x-mail.lanl.gov> (raw)

[Emacs version: 21.3.1 of May 22 2003, although I see few relevant 
changes in CVS]
I have been experimenting with different semantics for handling X 
selections (particularly `PRIMARY'), and have run across several snags in 
the x-*-selection-* functions and hooks:

 + `x-disown-selection-internal' doesn't seem to do anything.
 + `x-lost-selection-hooks' is not always executed when one would expect:
  - using the mouse to select text in Emacs and then elsewhere seems to 
never call the hooks
  - losing the clipboard usually (but not always) calls the hooks
  - explicitly owning a selection with M-: (x-own-selection-internal
'PRIMARY "foo") seems to cause the hooks to be called (later)
  - killing text with the keyboard also seems to guarantee hooks
 + Occasionally, Emacs itself (i.e. xselect.c) seems to miss a
notification that it has lost the selection -- I have, once, seen Emacs
insist that it owns the clipboard selection despite the fact that other
applications are owning and using it.

There may be some sort of race condition in xselect.c, since (if I read it
correctly) it uses 1-second-resolution time values to decide on the
relevance of X events.  But most of the time, `Vselection-alist' has the
correct values (as reported by the x-get-* methods) even when the Lisp
hooks aren't called.

I am unfortunately sufficiently familiar with neither X nor Emacs' C to
properly diagnose (much less correct) these problems; however, I have
attached an Emacs Lisp file with X-selection investigative tools;
hopefully it will be of use in discovering and/or testing fixes for the
bug(s).  Could someone please have a look at this?

Thanks in advance,
Davis Herring

-- 
This product is sold by volume, not by mass.  If it seems too dense or too 
sparse, it means mass-energy conversion has occurred during shipping.

             reply	other threads:[~2004-08-17 18:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-17 18:52 Davis Herring [this message]
2004-08-19 18:07 ` Issues with X selection handling Jan D.
2004-08-24  1:18   ` Davis Herring
2004-08-24  1:38     ` Davis Herring
2004-08-24 11:44     ` Jan D.
2004-08-25 16:05       ` Mouse-drags wait to call post-command-hook Davis Herring

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=Pine.LNX.4.44.0408170952350.29159-100000@x-mail.lanl.gov \
    --to=herring@lanl.gov \
    /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.