From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Kjetil S. Matheussen" Newsgroups: gmane.lisp.guile.user Subject: Re: Getting the (text) selection from the clipboard Date: Sat, 20 Jun 2009 13:18:17 +0200 (CEST) Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Trace: ger.gmane.org 1245496741 10907 80.91.229.12 (20 Jun 2009 11:19:01 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 20 Jun 2009 11:19:01 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jun 20 13:18:58 2009 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MHyb3-00064T-NL for guile-user@m.gmane.org; Sat, 20 Jun 2009 13:18:58 +0200 Original-Received: from localhost ([127.0.0.1]:47184 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHyb3-0000s5-2l for guile-user@m.gmane.org; Sat, 20 Jun 2009 07:18:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MHyaZ-0000Q1-RG for guile-user@gnu.org; Sat, 20 Jun 2009 07:18:27 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MHyaV-0000Jk-N7 for guile-user@gnu.org; Sat, 20 Jun 2009 07:18:27 -0400 Original-Received: from [199.232.76.173] (port=33109 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MHyaV-0000JQ-F1 for guile-user@gnu.org; Sat, 20 Jun 2009 07:18:23 -0400 Original-Received: from mail-forward1.uio.no ([129.240.10.70]:54150) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1MHyaV-0003ut-3P for guile-user@gnu.org; Sat, 20 Jun 2009 07:18:23 -0400 Original-Received: from exim by mail-out1.uio.no with local-bsmtp (Exim 4.69) (envelope-from ) id 1MHyaP-00067t-TG for guile-user@gnu.org; Sat, 20 Jun 2009 13:18:17 +0200 Original-Received: from mail-mx4.uio.no ([129.240.10.45]) by mail-out1.uio.no with esmtp (Exim 4.69) (envelope-from ) id 1MHyaP-00067o-Rf for guile-user@gnu.org; Sat, 20 Jun 2009 13:18:17 +0200 Original-Received: from anakin.ifi.uio.no ([129.240.64.199]) by mail-mx4.uio.no with esmtps (TLSv1:AES256-SHA:256) (Exim 4.69) (envelope-from ) id 1MHyaP-00012c-Hl for guile-user@gnu.org; Sat, 20 Jun 2009 13:18:17 +0200 X-X-Sender: ksvalast@anakin.ifi.uio.no In-Reply-To: X-UiO-Spam-info: not spam, SpamAssassin (score=-5.0, required=5.0, autolearn=disabled, UIO_MAIL_IS_INTERNAL=-5, uiobl=NO, uiouri=_URIID_) X-UiO-Scanned: D57D2EFB2ABBED606A57747ABC0F90DC4D3683BE X-UiO-SPAM-Test: remote_host: 129.240.64.199 spam_score: -49 maxlevel 80 minaction 2 bait 0 mail/h: 1 total 28276 max/h 173 blacklist 0 greylist 0 ratelimit 0 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:7334 Archived-At: Richard Shann: > > Does anyone know if there is a guile procedure to get the (text) > selection? (That is from doing Copy in another application) > Richard > Assuming you mean X selection, I've used the "xsel" program to do this: (define-macro (include filename) (define ret "") (for-each-line-in-file (string-trim-right (eval-parse filename)) (lambda (line) (set! ret (string-append ret line "\n")))) ret) (define-macro (x11-selection) (define filename (tmpnam)) (if (not (= 0 (system (string-append "xsel >" filename)))) (display "Error. x11-selection requires the \"xsel\" program: http://www.vergenet.net/~conrad/software/xsel/") `(include ,filename)))