From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Quanyang Liu Newsgroups: gmane.emacs.help Subject: Re: How to copy and paste from unity to emacs in the terminal version ? Date: Sat, 16 Aug 2014 19:29:49 +0800 Message-ID: <86egwgk6z6.fsf@gmail.com> References: <8af43eeb-8822-4b82-88f3-a31c29276bcf@googlegroups.com> <7zmwb4vggo.fsf@example.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 1408188651 10222 80.91.229.3 (16 Aug 2014 11:30:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 16 Aug 2014 11:30:51 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 16 13:30:44 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 1XIcC2-0003c0-TG for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Aug 2014 13:30:43 +0200 Original-Received: from localhost ([::1]:35078 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIcC2-0001rf-GC for geh-help-gnu-emacs@m.gmane.org; Sat, 16 Aug 2014 07:30:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:35055) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIcBb-0001qf-CS for help-gnu-emacs@gnu.org; Sat, 16 Aug 2014 07:30:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XIcBS-0004Fb-BV for help-gnu-emacs@gnu.org; Sat, 16 Aug 2014 07:30:15 -0400 Original-Received: from mail-pd0-x233.google.com ([2607:f8b0:400e:c02::233]:45561) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XIcBS-0004DW-3Y for help-gnu-emacs@gnu.org; Sat, 16 Aug 2014 07:30:06 -0400 Original-Received: by mail-pd0-f179.google.com with SMTP id v10so4731203pde.38 for ; Sat, 16 Aug 2014 04:30:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:references:date:in-reply-to:message-id:user-agent :mime-version:content-type:content-transfer-encoding; bh=AGj3O540+d1+bgfBLsqsMWyAYZFzuIzV3Noo7VkOOQs=; b=Yo3dCZ11ij1szlTJUi01ip7BZ3BywxFfpqU5rUbVeTCnoXK006tA+U7fvoX0EPWZTQ 1mTZZBKsDEp8b23JLza+IGEOQTIDRYQeMaEWCEA0lenaHYYtLATf38gN+wScRVyI9vne c5uIO4B13W5oc+MLWS+rET5bLeiiLyKz77t95mgdpjSGt7xk/9Wgws80mMqWvbCzShyS XcF8jLtruDHTrA2KbwCklDZMWNgABgX/A1/4SCJICq8pSfs960mevpdJgaA139Bu7Z3y 9DNpj3F6ALUV+LZdxpViCjqLQCKwOTPZ2gPz4Le6ti0XgLeVt5FCbOJIEeBhovTd9nN9 P9Dg== X-Received: by 10.68.106.132 with SMTP id gu4mr19970000pbb.26.1408188604802; Sat, 16 Aug 2014 04:30:04 -0700 (PDT) Original-Received: from arch ([180.142.56.162]) by mx.google.com with ESMTPSA id po5sm15991078pdb.55.2014.08.16.04.30.02 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Aug 2014 04:30:04 -0700 (PDT) In-Reply-To: <7zmwb4vggo.fsf@example.com> (David Hume's message of "Sat, 16 Aug 2014 12:09:27 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2607:f8b0:400e:c02::233 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:99237 Archived-At: 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 "--clipboar= d" "--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) )) =20=20=20=20 --=20 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