unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* PRIMARY selection doesn't work
@ 2002-04-12  3:17 Michael Kifer
  2002-04-12  8:55 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Kifer @ 2002-04-12  3:17 UTC (permalink / raw)




As of about 2 weeks ago when I updated emacs from CVS, 
(x-get-selection-internal 'PRIMARY 'STRING)
stopped working.
To reproduce, just start emacs -q and select something.
Then try to paste in an xterm window.

This is all happening under Gnome 1.0 in Redhat 6.1.

putting stuff on the CLIPBOARD does work:
(x-get-selection-internal 'CLIPBOARD 'STRING)

mk

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-12  3:17 PRIMARY selection doesn't work Michael Kifer
@ 2002-04-12  8:55 ` Eli Zaretskii
  2002-04-12 16:32   ` Michael Kifer
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2002-04-12  8:55 UTC (permalink / raw)
  Cc: emacs-devel

> From: kifer@cs.sunysb.edu (Michael Kifer)
> Date: Thu, 11 Apr 2002 23:17:53 -0400
> 
> As of about 2 weeks ago when I updated emacs from CVS, 
> (x-get-selection-internal 'PRIMARY 'STRING)
> stopped working.
> To reproduce, just start emacs -q and select something.
> Then try to paste in an xterm window.

Please tell what happens when you try both calling
x-get-selection-internal and pasting into xterm.  Do you get garbage
or nothing at all?

Also, can you recall when was the previous time you resynced with the
CVS?  (I'm trying to figure out what changes could have caused this.)

> This is all happening under Gnome 1.0 in Redhat 6.1.

Did anything change in your system setup since selections worked last
time?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-12  8:55 ` Eli Zaretskii
@ 2002-04-12 16:32   ` Michael Kifer
  2002-04-18  6:48     ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Kifer @ 2002-04-12 16:32 UTC (permalink / raw)
  Cc: emacs-devel



> > From: kifer@cs.sunysb.edu (Michael Kifer)
> > Date: Thu, 11 Apr 2002 23:17:53 -0400
> > 
> > As of about 2 weeks ago when I updated emacs from CVS, 
> > (x-get-selection-internal 'PRIMARY 'STRING)
> > stopped working.
> > To reproduce, just start emacs -q and select something.
> > Then try to paste in an xterm window.
> 
> Please tell what happens when you try both calling
> x-get-selection-internal and pasting into xterm.  Do you get garbage
> or nothing at all?

Nothing gets pasted.

> Also, can you recall when was the previous time you resynced with the
> CVS?  (I'm trying to figure out what changes could have caused this.)

I think about 2-3 weeks ago.


> > This is all happening under Gnome 1.0 in Redhat 6.1.
> 
> Did anything change in your system setup since selections worked last
> time?

No, nothing changed in the system whatsoever.

thanks
mk

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-12 16:32   ` Michael Kifer
@ 2002-04-18  6:48     ` Eli Zaretskii
  2002-04-18 16:43       ` Michael Kifer
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2002-04-18  6:48 UTC (permalink / raw)
  Cc: emacs-devel


On Fri, 12 Apr 2002, Michael Kifer wrote:

> > Please tell what happens when you try both calling
> > x-get-selection-internal and pasting into xterm.  Do you get garbage
> > or nothing at all?
> 
> Nothing gets pasted.
> 
> > Also, can you recall when was the previous time you resynced with the
> > CVS?  (I'm trying to figure out what changes could have caused this.)
> 
> I think about 2-3 weeks ago.

I cannot spot any change in the logs that could affect this.  I'm 
probably missing something.  Unfortunately, I also don't have access to a 
system with both X and the CVS version of Emacs.

Does this still happen with the current CVS?  If it does, could you 
please see what does (x-selection-exists-p 'PRIMARY) return?  Also, does
x_handle_selection_request (defined on xselect.c) get called when you 
paste into another X application, and if so, could you step with a debugger
through it and see what happens inside x_handle_selection_request and its
subroutines that prevents pasting from working?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-18  6:48     ` Eli Zaretskii
@ 2002-04-18 16:43       ` Michael Kifer
  2002-04-20 13:27         ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Michael Kifer @ 2002-04-18 16:43 UTC (permalink / raw)
  Cc: emacs-devel

>>>>> "EZ" == Eli Zaretskii <of Thu, 18 Apr 2002 09:48:43 +0300> writes:

    EZ> On Fri, 12 Apr 2002, Michael Kifer wrote:

    >> > Please tell what happens when you try both calling
    >> > x-get-selection-internal and pasting into xterm.  Do you get garbage
    >> > or nothing at all?
    >> 
    >> Nothing gets pasted.
    >> 
    >> > Also, can you recall when was the previous time you resynced with the
    >> > CVS?  (I'm trying to figure out what changes could have caused this.)
    >> 
    >> I think about 2-3 weeks ago.

    EZ> I cannot spot any change in the logs that could affect this.  I'm 
    EZ> probably missing something.  Unfortunately, I also don't have access to a 
    EZ> system with both X and the CVS version of Emacs.

    EZ> Does this still happen with the current CVS?  If it does, could you 
    EZ> please see what does (x-selection-exists-p 'PRIMARY) return?

Yes, it does. (x-selection-exists-p 'PRIMARY) returns t and
(x-get-selection-internal 'PRIMARY 'STRING)
returns the text of the primary selection.
However, nothing gets pasted.

    EZ> Also, does
    EZ> x_handle_selection_request (defined on xselect.c) get called when you 
    EZ> paste into another X application, and if so, could you step with a debugger
    EZ> through it and see what happens inside x_handle_selection_request and its
    EZ> subroutines that prevents pasting from working?

The above function gets called, but unfortunately I am not familiar with
this code and with the internals of X.
When I step through this function I occasionally get a coredump in random
places or it hangs in

2616         c = kbd_buffer_get_event (&kb, used_mouse_menu);

in keyboard.c

Otherwise -- nothing suspicious :-)

If I just let it continue without stepping then it doesn't hang or
coredump, but doesn't paste either.

mk

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-18 16:43       ` Michael Kifer
@ 2002-04-20 13:27         ` Eli Zaretskii
  2002-04-20 17:49           ` Michael Kifer
  0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2002-04-20 13:27 UTC (permalink / raw)
  Cc: emacs-devel

> From: kifer@cs.sunysb.edu (Michael Kifer)
> Date: Thu, 18 Apr 2002 12:43:48 -0400
> 
>     EZ> Also, does
>     EZ> x_handle_selection_request (defined on xselect.c) get called when you 
>     EZ> paste into another X application, and if so, could you step with a debugger
>     EZ> through it and see what happens inside x_handle_selection_request and its
>     EZ> subroutines that prevents pasting from working?
> 
> The above function gets called, but unfortunately I am not familiar with
> this code and with the internals of X.
> When I step through this function I occasionally get a coredump in random
> places or it hangs in
> 
> 2616         c = kbd_buffer_get_event (&kb, used_mouse_menu);
> 
> in keyboard.c
> 
> Otherwise -- nothing suspicious :-)
> 
> If I just let it continue without stepping then it doesn't hang or
> coredump, but doesn't paste either.

Weird...

Do you see any change in behavior if you change the value of
selection-coding-system?  For example, what happens if you type
"C-x RET x latin-1 RET" and then mark a region of pure ASCII
characters and type "M-w"--can you paste that text into other
applications?  Please also try with "C-x RET x compound-text RET".

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-20 13:27         ` Eli Zaretskii
@ 2002-04-20 17:49           ` Michael Kifer
  2002-04-20 18:10             ` Eli Zaretskii
  2002-05-04  7:31             ` Eli Zaretskii
  0 siblings, 2 replies; 10+ messages in thread
From: Michael Kifer @ 2002-04-20 17:49 UTC (permalink / raw)
  Cc: emacs-devel


>>>>> "EZ" == Eli Zaretskii <of Sat, 20 Apr 2002 09:27:24 EDT> writes:

    >> From: kifer@cs.sunysb.edu (Michael Kifer)
    >> Date: Thu, 18 Apr 2002 12:43:48 -0400
    >> 
    EZ> Also, does
    EZ> x_handle_selection_request (defined on xselect.c) get called when you 
    EZ> paste into another X application, and if so, could you step with a debugger
    EZ> through it and see what happens inside x_handle_selection_request and its
    EZ> subroutines that prevents pasting from working?
    >> 
    >> The above function gets called, but unfortunately I am not familiar with
    >> this code and with the internals of X.
    >> When I step through this function I occasionally get a coredump in random
    >> places or it hangs in
    >> 
    >> 2616         c = kbd_buffer_get_event (&kb, used_mouse_menu);
    >> 
    >> in keyboard.c
    >> 
    >> Otherwise -- nothing suspicious :-)
    >> 
    >> If I just let it continue without stepping then it doesn't hang or
    >> coredump, but doesn't paste either.

    EZ> Weird...

    EZ> Do you see any change in behavior if you change the value of
    EZ> selection-coding-system?  For example, what happens if you type
    EZ> "C-x RET x latin-1 RET" and then mark a region of pure ASCII
    EZ> characters and type "M-w"--can you paste that text into other
    EZ> applications?  Please also try with "C-x RET x compound-text RET".

Absolutely -- it starts working!
Both latin-1 and compound-text work.

But the default selection-coding-system  is compound-text-with-extensions
and this doesn't work.

thanks
mk

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-20 17:49           ` Michael Kifer
@ 2002-04-20 18:10             ` Eli Zaretskii
  2002-05-04  7:31             ` Eli Zaretskii
  1 sibling, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2002-04-20 18:10 UTC (permalink / raw)
  Cc: emacs-devel

> From: kifer@cs.sunysb.edu (Michael Kifer)
> Date: Sat, 20 Apr 2002 13:49:27 -0400
> 
> Both latin-1 and compound-text work.
> 
> But the default selection-coding-system  is compound-text-with-extensions
> and this doesn't work.

So it seems like the changes introduced for compound-text-with-extensions
are the culprit, one way or the other.  But they were made 2 months ago,
not 2 weeks ago.  So probably there's some other factor at work here...

Thanks for testing, I will dwell on this.  At least you have a temporary
work-around.

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
       [not found] <200204201813.OAA02541@sbcs.cs.sunysb.edu>
@ 2002-04-20 20:06 ` Eli Zaretskii
  0 siblings, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2002-04-20 20:06 UTC (permalink / raw)
  Cc: emacs-devel

> From: kifer@cs.sunysb.edu (Michael Kifer)
> Date: Sat, 20 Apr 2002 14:13:13 -0400
> 
> I think I noticed it more like a month ago. And I update emacs from CVS
> about once a month or every two months.
> So, the timetable for the updates that you describe fits this.
> Most likely the problem was caused by the change to
> compound-text-with-extensions.

That's strange, it worked for me back then.  Does anyone else see
that pasting into X applications doesn't work?

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: PRIMARY selection doesn't work
  2002-04-20 17:49           ` Michael Kifer
  2002-04-20 18:10             ` Eli Zaretskii
@ 2002-05-04  7:31             ` Eli Zaretskii
  1 sibling, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2002-05-04  7:31 UTC (permalink / raw)
  Cc: emacs-devel

> From: kifer@cs.sunysb.edu (Michael Kifer)
> Date: Sat, 20 Apr 2002 13:49:27 -0400
> 
>     EZ> Do you see any change in behavior if you change the value of
>     EZ> selection-coding-system?  For example, what happens if you type
>     EZ> "C-x RET x latin-1 RET" and then mark a region of pure ASCII
>     EZ> characters and type "M-w"--can you paste that text into other
>     EZ> applications?  Please also try with "C-x RET x compound-text RET".
> 
> Absolutely -- it starts working!
> Both latin-1 and compound-text work.

Please see if the patch below solves the problem if you revert
selection-coding-system to compound-text-with-extensions.  Please try
that both with pure ASCII text and some non-ASCII text in the
selection.

TIA

Index: src/xselect.c
===================================================================
RCS file: /cvs/emacs/src/xselect.c,v
retrieving revision 1.113
diff -c -p -r1.113 xselect.c
*** src/xselect.c	4 Mar 2002 23:40:59 -0000	1.113
--- src/xselect.c	4 May 2002 07:29:54 -0000
*************** lisp_data_to_selection_data (display, ob
*** 1765,1775 ****
        *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1,
  				 (int *) size_ret, &stringp);
        *nofree_ret = (*data_ret == XSTRING (obj)->data);
!       if (EQ (Vnext_selection_coding_system,
! 	      Qcompound_text_with_extensions))
! 	type = QCOMPOUND_TEXT;
!       else if (NILP (type))
! 	type = (stringp ? QSTRING : QCOMPOUND_TEXT);
        Vlast_coding_system_used = (*nofree_ret
  				  ? Qraw_text
  				  : Vnext_selection_coding_system);
--- 1765,1780 ----
        *data_ret = x_encode_text (obj, Vnext_selection_coding_system, 1,
  				 (int *) size_ret, &stringp);
        *nofree_ret = (*data_ret == XSTRING (obj)->data);
!       if (NILP (type))
! 	{
! 	  if (stringp && *nofree_ret)
! 	    type = QSTRING;
! 	  else if (EQ (Vnext_selection_coding_system,
! 		       Qcompound_text_with_extensions))
! 	    type = QCOMPOUND_TEXT;
! 	  else
! 	    type = (stringp ? QSTRING : QCOMPOUND_TEXT);
! 	}
        Vlast_coding_system_used = (*nofree_ret
  				  ? Qraw_text
  				  : Vnext_selection_coding_system);

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2002-05-04  7:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-12  3:17 PRIMARY selection doesn't work Michael Kifer
2002-04-12  8:55 ` Eli Zaretskii
2002-04-12 16:32   ` Michael Kifer
2002-04-18  6:48     ` Eli Zaretskii
2002-04-18 16:43       ` Michael Kifer
2002-04-20 13:27         ` Eli Zaretskii
2002-04-20 17:49           ` Michael Kifer
2002-04-20 18:10             ` Eli Zaretskii
2002-05-04  7:31             ` Eli Zaretskii
     [not found] <200204201813.OAA02541@sbcs.cs.sunysb.edu>
2002-04-20 20:06 ` Eli Zaretskii

Code repositories for project(s) associated with this public inbox

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).