gnu-emacs-sources
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: eclips.el - periodically collect clipboard contents


From: Thorsten Bonow
Subject: Re: eclips.el - periodically collect clipboard contents
Date: Mon, 29 May 2006 16:51:54 +0200
User-agent: Gnus/5.110004 (No Gnus v0.4) XEmacs/21.4.19 (linux)

>>>>> "Ian" == Ian Zimmerman <address@hidden> writes:

    Ian> ;;; eclips.el --- periodically collect clipboard contents

Hi,

it's great!

But since I like both kinds of music, I tried using it with XEmacs, too:

XEmacs has `x-get-selection' only as an obsolete alias to `get-selection', which
in principle does what you want, but "If there is no selection an error is
signalled."

So this is what XEmacs does most of the time, signalling errors to you ;-)

Documentation leads you to `interprogram-paste-function', which brings you to
the better suited `get-selection-foreign'. This one still gives you an error if
there is no new selection. So I finally decided on catching the error and
throwing it away...

This is what I did:

In `eclips-timer-function', I replaced

   (x-get-selection)

with

(if (featurep 'xemacs)
     (condition-case nil
         (get-selection-foreign)
       (error nil))
     (x-get-selection))

Did some quick testing, works for me (in XEmacs and GNU Emacs).

Toto


-- 
Contact information and PGP key at
http://www-users.rwth-aachen.de/thorsten.bonow

[...] if the next generation is going to make some contribution,
it'll be the discovery of how you struggle for social change
without having any hope.

Abbie Hoffman at the University of South Carolina, 1987


reply via email to

[Prev in Thread] Current Thread [Next in Thread]