From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Richard Stallman Newsgroups: gmane.emacs.devel Subject: Re: Change behaviour of Copy/Cut/Paste from the menu bar. Date: Wed, 21 Jan 2004 04:21:26 -0500 Sender: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Message-ID: References: <200401201604.i0KG4i7L001202@stubby.bodenonline.com> Reply-To: rms@gnu.org NNTP-Posting-Host: deer.gmane.org X-Trace: sea.gmane.org 1074677721 8173 80.91.224.253 (21 Jan 2004 09:35:21 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 21 Jan 2004 09:35:21 +0000 (UTC) Cc: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+emacs-devel=quimby.gnus.org@gnu.org Wed Jan 21 10:35: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 1AjElY-0007Wz-00 for ; Wed, 21 Jan 2004 10:35: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 1AjElY-0001ge-00 for ; Wed, 21 Jan 2004 10:35:16 +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 1AjEkv-0002HW-H3 for emacs-devel@quimby.gnus.org; Wed, 21 Jan 2004 04:34:37 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AjEbN-0007ME-Dd for emacs-devel@gnu.org; Wed, 21 Jan 2004 04:24:45 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1AjEaM-0006w8-32 for emacs-devel@gnu.org; Wed, 21 Jan 2004 04:24:14 -0500 Original-Received: from [199.232.76.164] (helo=fencepost.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AjEaC-0006sX-He for emacs-devel@gnu.org; Wed, 21 Jan 2004 04:23:35 -0500 Original-Received: from rms by fencepost.gnu.org with local (Exim 4.24) id 1AjEYA-0001vh-HH; Wed, 21 Jan 2004 04:21:26 -0500 Original-To: "Jan D." In-reply-to: <200401201604.i0KG4i7L001202@stubby.bodenonline.com> (jan.h.d@swipnet.se) 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:19391 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:19391 - ;; 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. + ;; 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".