Any comments on this? To me it's not obvious what code should be
added to x_own_selection() to fix the bug.
--
Hrvoje Niksic <hniksic(a)srce.hr> | Student at FER Zagreb, Croatia
--------------------------------+--------------------------------
A sadist is a masochist who follows the Golden Rule.
------- Start of forwarded message -------
Message-ID: <199811101141.MAA19689(a)takefive.co.at>
Mime-Version: 1.0 (NeXT Mail 4.1mach v148)
Content-Type: text/enriched; charset=us-ascii
Content-Transfer-Encoding: 7bit
From: joe(a)takefive.co.at (Joe Leherbauer)
Date: Tue, 10 Nov 1998 12:41:08 +0100
Subject: BUG: 20.4 fails to report timestamp of X selection
Newsgroups: comp.emacs.xemacs
I'm using a plain xemacs-20.4 sparc-sun-solaris2.4 binary kit downloaded
via ftp
on a Solaris 2.5 machine.
I select some text and copy-region-as-kill.
xemacs becomes the owner of the X11 PRIMARY selection.
When my own X application queries the timestamp of that selection,
xemacs signals an error like this:
unrecognized selection-conversion type:
nil, #<<INTERNAL EMACS BUG (opaque, size=4) 0x5d5e80>
The same happens with the CLIPBOARD selection.
Scanning through file src/xselect.c I found the following
which might be the reason (my own comments start with JL):
..
static void
x_own_selection (Lisp_Object selection_name, Lisp_Object selection_value)
{
...
Time thyme = DEVICE_X_MOUSE_TIMESTAMP (d);
...
/* Now update the local cache */
{
/* We do NOT use time_to_lisp() here any more, like we used to.
That assumed equivalence of time_t and Time, which is not
necessarily the case (e.g. under OSF on the Alphas, where
Time is a 64-bit quantity and time_t is a 32-bit quantity).
Opaque pointers are the clean way to go here.
*/
Lisp_Object selection_time = make_opaque (sizeof (thyme), (void *) &thyme);
JL:
As the comment indicates a change has been made here.
An opaque value is now used instead of time_to_lisp() (which I guess
returns an integer ?)
I think the maintainer forgot to update function x_get_local_selection not
far below which uses that selection_time.
<nofill>
..
static Lisp_Object
x_get_local_selection (Lisp_Object selection_symbol, Lisp_Object target_type)
{
...
/* TIMESTAMP and MULTIPLE are special cases 'cause that's easiest. */
if (EQ (target_type, QTIMESTAMP))
{
handler_fn = Qnil;
value = XCAR (XCDR (XCDR (local_value)));
}
JL:
At this point `value' holds the selection time, the opaque type from above.
Later in that function `value' is checked against several common types,
but not whether it's an opaque type.
So `x_get_local_selection' fails and signals an error.
---
Josef Leherbauer TakeFive Software GmbH
Software Engineer Jakob-Haringer-Str. 8
A-5020 Salzburg/Austria
joe(a)takefive.co.at Tel +43 662 457 915 0
http://www.takefive.com/ Fax +43 662 457 915 6
The Source Code Engineering Company
</nofill>
------- End of forwarded message -------