From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Ittay Dror Newsgroups: gmane.emacs.help Subject: Re: copy/paste & Emacs on XWindows Date: 20 Mar 2003 07:59:07 +0200 Organization: Qlusters Inc. Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <1048139947.1181.4.camel@rum> References: <87isugl63m.fsf@sdf.lonestar.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1048140135 10180 80.91.224.249 (20 Mar 2003 06:02:15 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 20 Mar 2003 06:02:15 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu Mar 20 07:02:14 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18vt81-0002dz-00 for ; Thu, 20 Mar 2003 07:02:13 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vt67-0008AZ-02 for gnu-help-gnu-emacs@m.gmane.org; Thu, 20 Mar 2003 01:00:15 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 18vt5g-0007yO-00 for help-gnu-emacs@gnu.org; Thu, 20 Mar 2003 00:59:48 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 18vt5Y-0007UN-00 for help-gnu-emacs@gnu.org; Thu, 20 Mar 2003 00:59:43 -0500 Original-Received: from adsl-139-109.barak.net.il ([62.90.139.109] helo=hirame.qlusters.com) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18vt5X-0007Jz-00 for help-gnu-emacs@gnu.org; Thu, 20 Mar 2003 00:59:39 -0500 Original-Received: from [10.100.0.13] ([10.100.0.13]) by hirame.qlusters (8.10.2/8.10.2) with ESMTP id h2K5sb032076 for ; Thu, 20 Mar 2003 07:54:37 +0200 Original-To: help-gnu-emacs@gnu.org In-Reply-To: X-Mailer: Ximian Evolution 1.2.2 (1.2.2-3) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7742 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7742 On Wed, 2003-03-19 at 20:41, Peter Lee wrote: > Ittay Dror writes: > > > i have this hack: > > (defun if-copy-mark-to-primary-selection () > > (if mark-active > > (x-set-selection 'PRIMARY (buffer-substring (region-beginning) > > (region-end))))) > > > > (add-hook 'post-command-hook 'if-copy-mark-to-primary-selection) > > > > what it does is copy the region to the primary selection, (which is not > > the clipboard), use the middle mouse button to paste it in another > > window. if you wish to copy to the clipboard, change PRIMARY to > > CLIPBOARD. > > Thanks a bunch! I will try this when I get home. One other > thing... what about copying from clipboard to Emacs? Any tricks for > that ? Or should that just work as is? it should work as it. check that the variable x-select-enable-clipboard is set to t. however, i think that the middle mouse button will try to paste from there and not the primary selection, as it normally does. anyway, below are other hacks i use. (defadvice mouse-yank-at-click (around yank-from-primary last act) "i want the middle mouse button to always paste the primary selection" (let ((x-select-enable-clipboard nil)) ad-do-it)) (defadvice mouse-set-region (around kill-to-primary last act) "i want the mouse drags to copy only to primary selection" (let ((x-select-enable-clipboard nil)) ad-do-it)) (defadvice mouse-drag-region (around kill-to-primary last act) "i want the mouse drags to copy only to primary selection" (let ((x-select-enable-clipboard nil)) ad-do-it)) and while i'm at it, these are my hacks for using the cut buffers instead of the kill ring (if you use kde, then the cut buffers is the history you see in klipper). (defadvice current-kill (around use-cut-buffer first act) "use the cut buffer instead of the kill ring" (let ((text (if (> n 0) (x-get-cut-buffer n) ad-do-it))) (setq ad-return-value text))) (defadvice yank (before fix-arg last act) "when invoked with prefix argument, yank passes current-kill the value of arg-1. so if i do 1 -, i get the same as just -" (if (not (or (listp arg) (eq arg '-))) (setq arg (1+ arg)))) -- =================================== Ittay Dror (ittay@qlusters.com) User Space Team, R&D Qlusters Inc. +972-3-6081976 Fax: +972-3-6081841