From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Jan D." Newsgroups: gmane.emacs.devel Subject: Re: Change behaviour of Copy/Cut/Paste from the menu bar. Date: Wed, 21 Jan 2004 10:30:37 +0100 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: <785C5875-4BF4-11D8-902C-00039363E640@swipnet.se> References: <200401201604.i0KG4i7L001202@stubby.bodenonline.com> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 (Apple Message framework v609) Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1074677780 8285 80.91.224.253 (21 Jan 2004 09:36:20 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2004 09:36:20 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jan 21 10:36:16 2004 Return-path: Original-Received: from quimby.gnus.org ([80.91.224.244]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjEmW-0007ax-00 for ; Wed, 21 Jan 2004 10:36:16 +0100 Original-Received: from monty-python.gnu.org ([199.232.76.173]) by quimby.gnus.org with esmtp (Exim 3.35 #1 (Debian)) id 1AjEmV-0001h1-00 for ; Wed, 21 Jan 2004 10:36:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AjEk5-0001hj-CE for emacs-devel@quimby.gnus.org; Wed, 21 Jan 2004 04:33:45 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AjEjN-0001c6-5D for emacs-devel@gnu.org; Wed, 21 Jan 2004 04:33:01 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AjEio-0001O8-98 for emacs-devel@gnu.org; Wed, 21 Jan 2004 04:32:58 -0500 Original-Received: from [213.115.192.53] (helo=mail2.norrnet.net) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AjEin-0001MT-IX; Wed, 21 Jan 2004 04:32:25 -0500 Original-Received: from stubby.bodenonline.com (stubby.bodenonline.com [193.201.16.94]) by mail2.norrnet.net (BorderWare MXtreme Mail Firewall) with ESMTP id 0079CAF3FA; Wed, 21 Jan 2004 10:31:46 +0100 (CET) Original-Received: from accessno42.bodenonline.com (accessno42.bodenonline.com [193.201.16.44]) by stubby.bodenonline.com (8.12.1/8.12.1) with ESMTP id i0LANi7L018069; Wed, 21 Jan 2004 11:23:45 +0100 In-Reply-To: Original-To: rms@gnu.org X-Mailer: Apple Mail (2.609) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Emacs development discussions. List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Xref: main.gmane.org gmane.emacs.devel:19392 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19392 > - ;; Sun expects the menu bar cut and paste commands to use the > clipboard. > - ;; This has ,? to match both on Sunos and on Solaris. > - (if (string-match "Sun Microsystems,? Inc\\." > - (x-server-vendor)) > - (menu-bar-enable-clipboard)) > - > > Are you sure this should be deleted? > Someone should check what other programs do on Solaris. Well, it is redundant now that menu-bar-enable-clipboard is always called below. > > + ;; Enable CLIPBOARD copy/paste through menu bar commands. > + (menu-bar-enable-clipboard) > + > + ;; Override Paste so it looks at CLIPBOARD first. > + (defun x-clipboard-yank () > + "Insert the clipboard contents, or the last stretch of killed > text." > + (interactive) > + (let ((clipboard-text (x-get-selection 'CLIPBOARD)) > + (x-select-enable-clipboard t)) > + (if (and clipboard-text (> (length clipboard-text) 0)) > + (kill-new clipboard-text)) > + (yank))) > + > + (define-key menu-bar-edit-menu [paste] > + (cons "Paste" (cons "Paste text from clipboard" > 'x-clipboard-yank))) > + > ;;; arch-tag: f1501302-db8b-4d95-88e3-116697d89f78 > > This is ok, but I think the help string should say > "Paste text from clipboard or kill ring". I'll change it. Jan D.