From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Grant Rettke Newsgroups: gmane.emacs.help Subject: Re: How to copy and paste from unity to emacs in the terminal version ? Date: Sat, 16 Aug 2014 07:51:44 -0500 Message-ID: References: <8af43eeb-8822-4b82-88f3-a31c29276bcf@googlegroups.com> <7zmwb4vggo.fsf@example.com> <86egwgk6z6.fsf@gmail.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1408193526 28934 80.91.229.3 (16 Aug 2014 12:52:06 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Aug 2014 12:52:06 +0000 (UTC) Cc: Emacs Help To: Quanyang Liu Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 16 14:52:01 2014 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XIdSj-0003Qt-FS for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Aug 2014 14:52:01 +0200 Original-Received: from localhost ([::1]:35372 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIdSj-00042v-5P for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Aug 2014 08:52:01 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45282) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIdSY-00042p-DQ for help-gnu-emacs@gnu.org; Sat, 16 Aug 2014 08:51:51 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIdST-0004Aq-Pl for help-gnu-emacs@gnu.org; Sat, 16 Aug 2014 08:51:50 -0400 Original-Received: from mail-oa0-x22b.google.com ([2607:f8b0:4003:c02::22b]:48488) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIdST-0004Ai-LI for help-gnu-emacs@gnu.org; Sat, 16 Aug 2014 08:51:45 -0400 Original-Received: by mail-oa0-f43.google.com with SMTP id i7so2842880oag.2 for ; Sat, 16 Aug 2014 05:51:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type:content-transfer-encoding; bh=W2oPRDSmfDyRYRdC8nVSJkGlU5142g7XllVnCIXvrn0=; b=acPi0Z0cxrF1nrOkdLJyOajwZNsTK93TzeZoqOpBbmG4TC9oVMM7NZsfsBcDH5wsgc Fkx+f/JNbPfYywbRPEmjVGbcfBzhQBlpZ41MoW9QlDUg5kdVHlN7jT0/7UI9z8RG8vMQ ZCGUZcXzSybQBQhOv5f4jDTn+arWgkq9vAPMBf6T79PJ4D9XOV6JBDfuZTsvM+G4Bivh +mAXiphaPB6hhVaqX7OBgY/mAUzHmnMKoryYhngm8Uuo+czk/8mesTnSQH4j8oaPUg0v YA5X9Rrt0DXeAwau8y8PJzqCkSE/lmsaeGd3tenUZPWJEsCXNlumYLbf/JPVsLhV5wPo xnRQ== X-Received: by 10.60.58.36 with SMTP id n4mr2020196oeq.73.1408193504499; Sat, 16 Aug 2014 05:51:44 -0700 (PDT) Original-Received: by 10.182.77.39 with HTTP; Sat, 16 Aug 2014 05:51:44 -0700 (PDT) In-Reply-To: <86egwgk6z6.fsf@gmail.com> X-Google-Sender-Auth: 9jSGfNOL2_7bXu0MM1UIvamcMmY X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:4003:c02::22b X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:99238 Archived-At: Untested: http://blog.binchen.org/posts/paste-string-from-clipboard-into-minibuffer-i= n-emacs.html Grant Rettke | ACM, ASA, FSF, IEEE, SIAM gcr@wisdomandwonder.com | http://www.wisdomandwonder.com/ =E2=80=9CWisdom begins in wonder.=E2=80=9D --Socrates ((=CE=BB (x) (x x)) (=CE=BB (x) (x x))) =E2=80=9CLife has become immeasurably better since I have been forced to st= op taking it seriously.=E2=80=9D --Thompson On Sat, Aug 16, 2014 at 6:29 AM, Quanyang Liu wrote: > On Sat, Aug 16 2014 at 19:09:27 +0800, David Hume wrote: >> Kro Ly writes: >> >>> Hi, i'm using emacs in the terminal and I'd like to know how to copy >>> and paste something from firefox to emacs for instance ? >>> Thanks. >> >> That depends on the terminal I think. If it is xterm you can press the >> middle mouse button to paste. > Maybe you can try to use xsel. The way I use is below: > > ;; use xsel to copy/paste in emacs-nox > (unless window-system > (when (getenv "DISPLAY") > (defun xsel-cut-function (text &optional push) > (with-temp-buffer > (insert text) > (call-process-region (point-min) (point-max) "xsel" nil 0= nil "--clipboard" "--input"))) > (defun xsel-paste-function() > (let ((xsel-output (shell-command-to-string "xsel --clipboard -= -output"))) > (unless (string=3D (car kill-ring) xsel-output) > xsel-output ))) > (setq interprogram-cut-function 'xsel-cut-function) > (setq interprogram-paste-function 'xsel-paste-function) > )) > > -- > Quanyang Liu =EF=BC=88=E5=88=98=E5=85=A8=E9=98=B3=EF=BC=89 > Undergraduate > Department of Computer Science and Engineering > Shanghai Jiao Tong University >