From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: kill-new discards current X selection Date: Wed, 26 Aug 2009 20:41:01 +0200 Message-ID: <0F667BE2-7E6A-4054-8276-DC0A295D9E8C@swipnet.se> References: <4A95606A.6050606@gnu.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 (iPhone Mail 7A400) Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1251314675 12163 80.91.229.12 (26 Aug 2009 19:24:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 26 Aug 2009 19:24:35 +0000 (UTC) Cc: "emacs-devel@gnu.org" To: Sam Steingold Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 26 21:24:26 2009 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1MgO6X-0001Ws-Fh for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2009 21:24:22 +0200 Original-Received: from localhost ([127.0.0.1]:43889 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgO6W-0005T8-NW for ged-emacs-devel@m.gmane.org; Wed, 26 Aug 2009 15:24:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MgNR3-0005rU-5M for emacs-devel@gnu.org; Wed, 26 Aug 2009 14:41:29 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MgNQv-0005oR-IF for emacs-devel@gnu.org; Wed, 26 Aug 2009 14:41:28 -0400 Original-Received: from [199.232.76.173] (port=58064 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MgNQv-0005oM-EX for emacs-devel@gnu.org; Wed, 26 Aug 2009 14:41:21 -0400 Original-Received: from proxy1.bredband.net ([195.54.101.71]:44587) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1MgNQn-0008KF-0O; Wed, 26 Aug 2009 14:41:13 -0400 Original-Received: from iph2.telenor.se (195.54.127.133) by proxy1.bredband.net (7.3.140.3) id 49F5A15202FF9EDB; Wed, 26 Aug 2009 20:41:08 +0200 X-SMTPAUTH-B2: X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AldsACMelUpV4S1uPGdsb2JhbACBU5kyAQEBATe+BIQaBQ X-IronPort-AV: E=Sophos;i="4.44,281,1249250400"; d="scan'208";a="38519223" Original-Received: from c-6e2de155.25-1-64736c10.cust.bredbandsbolaget.se (HELO coolsville.localdomain) ([85.225.45.110]) by iph2.telenor.se with ESMTP; 26 Aug 2009 20:41:07 +0200 Original-Received: from [90.232.25.42] (host-90-232-25-42.mobileonline.telia.com [90.232.25.42]) by coolsville.localdomain (Postfix) with ESMTPSA id 744157FA07B; Wed, 26 Aug 2009 20:41:06 +0200 (CEST) In-Reply-To: <4A95606A.6050606@gnu.org> X-Mailer: iPhone Mail (7A400) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:114623 Archived-At: I for one would be very surprised if the X selection popped up in the kill-ring just because I made a kill in Emacs. An option to tell Emacs to grab the primary X selection only when something is selected with the mouse would be nice. Maybe there already exists one. I assume you mean the primary selection? Jan D. 26 aug 2009 kl. 18.18 skrev Sam Steingold : > When I select a word in an xterm and then kill in emacs, then X > selection is gone forever, replaced with the emacs kill. > The appended patch prepends the current X selection to kill-ring > before replacing the X selection with the current Emacs kill. > Is it OK to install it unconditionally, or is it better to guard it > with a user option, e.g., save-interprogram-paste-before-kill? > > > --- simple.el.~1.1005.~ 2009-08-25 16:44:36.000000000 -0400 > +++ simple.el 2009-08-26 12:15:19.000123000 -0400 > @@ -2819,6 +2819,13 @@ argument should still be a \"useful\" st > (list string "yank-handler specified for empty string")))) > (if (fboundp 'menu-bar-update-yank-menu) > (menu-bar-update-yank-menu string (and replace (car kill- > ring)))) > + (let ((interprogram-paste (and interprogram-paste-function > + (funcall interprogram-paste-function)))) > + (when interprogram-paste > + (if (listp interprogram-paste) > + (dolist (s (nreverse interprogram-paste)) > + (push s kill-ring)) > + (push interprogram-paste kill-ring)))) > (if (and replace kill-ring) > (setcar kill-ring string) > (push string kill-ring) > >