From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Davis Herring Newsgroups: gmane.emacs.devel Subject: Issues with X selection handling Date: Tue, 17 Aug 2004 12:52:44 -0600 (MDT) Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Message-ID: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Trace: sea.gmane.org 1092768806 12824 80.91.224.253 (17 Aug 2004 18:53:26 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Aug 2004 18:53:26 +0000 (UTC) Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Aug 17 20:53:14 2004 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1Bx957-00059b-00 for ; Tue, 17 Aug 2004 20:53:14 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bx99I-0001yh-3i for ged-emacs-devel@m.gmane.org; Tue, 17 Aug 2004 14:57:32 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.33) id 1Bx99B-0001yQ-Dp for emacs-devel@gnu.org; Tue, 17 Aug 2004 14:57:25 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.33) id 1Bx999-0001y7-OV for emacs-devel@gnu.org; Tue, 17 Aug 2004 14:57:25 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.33) id 1Bx999-0001y4-Mt for emacs-devel@gnu.org; Tue, 17 Aug 2004 14:57:23 -0400 Original-Received: from [192.65.95.54] (helo=mailwasher-b.lanl.gov) by monty-python.gnu.org with esmtp (TLSv1:DES-CBC3-SHA:168) (Exim 4.34) id 1Bx94j-0005aP-2V for emacs-devel@gnu.org; Tue, 17 Aug 2004 14:52:49 -0400 Original-Received: from mailrelay2.lanl.gov (localhost.localdomain [127.0.0.1]) by mailwasher-b.lanl.gov (8.12.10/8.12.10/(ccn-5)) with ESMTP id i7HIqkCp008863 for ; Tue, 17 Aug 2004 12:52:46 -0600 Original-Received: from x-mail.lanl.gov (localhost.localdomain [127.0.0.1]) by mailrelay2.lanl.gov (8.12.10/8.12.10/(ccn-5)) with ESMTP id i7HIqkVU007702 for ; Tue, 17 Aug 2004 12:52:46 -0600 Original-Received: from x-mail.lanl.gov (localhost.localdomain [127.0.0.1]) by x-mail.lanl.gov (8.12.10/8.12.10/(ccn-5)) with ESMTP id i7HIqku6004204 for ; Tue, 17 Aug 2004 12:52:46 -0600 Original-Received: from localhost (herring@localhost) by x-mail.lanl.gov (8.12.10/8.12.10/Submit) with ESMTP id i7HIqitM004199 for ; Tue, 17 Aug 2004 12:52:44 -0600 X-Authentication-Warning: x-mail.lanl.gov: herring owned process doing -bs Original-To: emacs-devel@gnu.org X-Scanned-By: MIMEDefang 2.35 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:26286 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:26286 [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.