From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Hugo Heden Newsgroups: gmane.emacs.help Subject: Re: Emacs (in terminal): keeping clipboard synchronized with the system global one? Date: Sun, 8 Mar 2009 20:27:03 +0100 Message-ID: <2bdf908c0903081227s2971149bg22de270aa7be54ba@mail.gmail.com> References: <2bdf908c0903060433y7f99a928s4fb255ae4b48efaf@mail.gmail.com> <87ocwc2i8i.fsf@catnip.gol.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1236540544 1529 80.91.229.12 (8 Mar 2009 19:29:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Mar 2009 19:29:04 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Miles Bader Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 08 20:30:21 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LgOhM-0001Xx-QL for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Mar 2009 20:30:09 +0100 Original-Received: from localhost ([127.0.0.1]:44996 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgOg1-0002yN-Dl for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Mar 2009 15:28:45 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LgOeT-0002IZ-HP for help-gnu-emacs@gnu.org; Sun, 08 Mar 2009 15:27:09 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LgOeS-0002HG-3L for help-gnu-emacs@gnu.org; Sun, 08 Mar 2009 15:27:09 -0400 Original-Received: from [199.232.76.173] (port=50630 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LgOeR-0002H8-Rp for help-gnu-emacs@gnu.org; Sun, 08 Mar 2009 15:27:07 -0400 Original-Received: from mail-fx0-f172.google.com ([209.85.220.172]:35388) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LgOeP-0006Cj-Sg; Sun, 08 Mar 2009 15:27:06 -0400 Original-Received: by fxm20 with SMTP id 20so915207fxm.42 for ; Sun, 08 Mar 2009 12:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=utQhzMQoM4Lz0RGOO9qUa8LDMPl7pgeIy0mITInLjt0=; b=I70c3fBmRFiiRjn2eua3CvkIASpukB7gzwIEZZJDO63+c0+D6rrtakCwZP2MrscB/W p2YpreFAyqqiQjPpvEC5J24qytdlLadyeydgFLPw+e8CfQ8MpJm9W4AnIrVntJmscutP qKptjXu0WiH2HPvJ2+Y4GCrcCSX2jR6Am7NQY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=azZJZqbE6Bqr96xrSJ4zgWqCzRk0giojvYvq41kJfvGeM731qQEnxMinbe/2nIpS6t 6DnPvuxrHGuPSrKecqNw6FV8tJitzF5Mq3wvrF1XKDlTP74ULhlmTOrqxcc4/clNoEr1 53NQay69YZCBFhMmb1aHQeeWCqLlUP/8mEUD4= Original-Received: by 10.86.33.10 with SMTP id g10mr3448967fgg.44.1236540423310; Sun, 08 Mar 2009 12:27:03 -0700 (PDT) In-Reply-To: <87ocwc2i8i.fsf@catnip.gol.com> X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 2) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:62774 Archived-At: On Sun, Mar 8, 2009 at 3:37 PM, Miles Bader wrote: > Hugo Heden writes: >> =A0 (global-set-key "\M-w" 'ext-kill-ring-save) >> =A0 (global-set-key "\C-w" 'ext-kill-region)) > > Instead of redefining the keys, you should probably set the variables > `interprogram-cut-function' and `interprogram-paste-function' > (which are used by the default commands). > > -Miles > Thanks a lot Miles, yes I realized that after a while (as noted on http://hugoheden.wordpress.com/2009/03/08/copypaste-with-emacs-in-terminal/ ) -- the following works well: (global-set-key "\C-w" 'clipboard-kill-region) (global-set-key "\M-w" 'clipboard-kill-ring-save) (global-set-key "\C-y" 'clipboard-yank) (unless window-system (defun xsel-cut-function (text &optional push) (with-temp-buffer (insert text) (call-process-region (point-min) (point-max) "xsel" nil 0 nil "--primary" "--input"))) (defun xsel-paste-function() (let ((xsel-output (shell-command-to-string "xsel -o"))) (unless (string=3D (car kill-ring) xsel-output) xsel-output ))) (setq interprogram-cut-function 'xsel-cut-function) (setq interprogram-paste-function 'xsel-paste-function) ) Best regards Hugo Heden