From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Raffaele Ricciardi Newsgroups: gmane.emacs.help Subject: Re: How to speed up cutting & pasting from/to emacs? Date: Sun, 12 Jul 2015 17:24:13 +0200 Message-ID: References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1436714719 21067 80.91.229.3 (12 Jul 2015 15:25:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 12 Jul 2015 15:25:19 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jul 12 17:25:19 2015 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 1ZEJ82-0005qY-VC for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Jul 2015 17:25:19 +0200 Original-Received: from localhost ([::1]:51089 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZEJ82-0004t5-2z for geh-help-gnu-emacs@m.gmane.org; Sun, 12 Jul 2015 11:25:18 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 48 Original-X-Trace: individual.net HsclCixZV0vJEEiQWUy1Og5coQ2WNPlfItn4jgUv78Va5s9iC+ Cancel-Lock: sha1:nJYhFdwjcRoO66R/nsQkBu4zOfw= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.0.1 In-Reply-To: Original-Xref: usenet.stanford.edu gnu.emacs.help:213344 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:105631 Archived-At: Here is a possible solution, complete with code. I have not tested it, but I have solved a similar problem recently. Anyway, use it at your own risk, as they say. You could write a script that transfers the current selection to the clipboard and then asks Emacs to paste it. Then you would bind this script to a keyboard shortcut. This way, you could select the text to copy and then press that keyboard shortcut to paste it into Emacs. I will assume that you have both the `xsel` and the `xbindkeys` programs on your system. Apparently, there are two different programs whose name is `xsel` around... Mine is version 1.2.0 by Conrad Parker. I will also assume that your Emacs instance is running as an *edit server*. Let's call our script ~/bin/emacs-yank: --8<---------------cut here---------------start------------->8--- #!/bin/sh # Copy the current selection to the clipboard. xsel --output | xsel --input --clipboard # Ask Emacs to paste from the clipboard. emacsclient --no-wait --eval "(yank)" --8<---------------cut here---------------end--------------->8--- Remember to make the script executable: chmod +x ~/bin/emacs-yank Here is the `~/.xbindkeysrc.scm` file to tell `xbindkeys` to bind Windows+Alt+E to the above script (of course, you must adjust the absolute path to the script): --8<---------------cut here---------------start------------->8--- (xbindkey '(mod4 alt e) "/home/lele/bin/emacs-yank") --8<---------------cut here---------------end--------------->8--- Remember to start `xbindkeys`: xbindkeys That's all. Good luck.