From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Lennart Borgman (gmail)" Newsgroups: gmane.emacs.devel Subject: Re: On cut, copy, paste etc... Date: Fri, 01 Aug 2008 21:53:18 +0200 Message-ID: <489369AE.4080709@gmail.com> References: <4892D6AC.6000308@alice.it> <4892E5EA.9070200@alice.it> <4893007E.1020502@alice.it> <87myjw7qcy.fsf@gmx.de> <87vdykravs.fsf@gmx.de> <48935D99.9030901@harpegolden.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1217620430 28970 80.91.229.12 (1 Aug 2008 19:53:50 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Aug 2008 19:53:50 +0000 (UTC) Cc: angelo.graziosi@alice.it, emacs-devel@gnu.org, svenjoac@gmx.de, David De La Harpe Golden To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Aug 01 21:54:40 2008 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 1KP0i0-0005XD-6S for ged-emacs-devel@m.gmane.org; Fri, 01 Aug 2008 21:54:40 +0200 Original-Received: from localhost ([127.0.0.1]:33002 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KP0h5-0007iG-Jk for ged-emacs-devel@m.gmane.org; Fri, 01 Aug 2008 15:53:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KP0gz-0007gN-SU for emacs-devel@gnu.org; Fri, 01 Aug 2008 15:53:37 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KP0gy-0007fZ-Th for emacs-devel@gnu.org; Fri, 01 Aug 2008 15:53:37 -0400 Original-Received: from [199.232.76.173] (port=37314 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KP0gy-0007fO-Ij for emacs-devel@gnu.org; Fri, 01 Aug 2008 15:53:36 -0400 Original-Received: from ch-smtp02.sth.basefarm.net ([80.76.149.213]:43235) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1KP0gs-0006rG-Uz; Fri, 01 Aug 2008 15:53:32 -0400 Original-Received: from c83-254-151-176.bredband.comhem.se ([83.254.151.176]:64047 helo=[127.0.0.1]) by ch-smtp02.sth.basefarm.net with esmtp (Exim 4.68) (envelope-from ) id 1KP0gp-0003Vc-9Y; Fri, 01 Aug 2008 21:53:28 +0200 User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.9) Gecko/20071031 Thunderbird/2.0.0.9 Mnenhy/0.7.5.666 In-Reply-To: X-Antivirus: avast! (VPS 080801-0, 2008-08-01), Outbound message X-Antivirus-Status: Clean X-Originating-IP: 83.254.151.176 X-ACL-Warn: Too high rate of unknown addresses received from you X-Scan-Result: No virus found in message 1KP0gp-0003Vc-9Y. X-Scan-Signature: ch-smtp02.sth.basefarm.net 1KP0gp-0003Vc-9Y cf8d5b477d7d8a033788a218658e2213 X-detected-kernel: by monty-python.gnu.org: Linux 2.6? (barebone, rare!) 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:101921 Archived-At: Eli Zaretskii wrote: > Okay, but what does all this have to do with the original issue? You > are asking for a different behavior of C-w; I'm saying that no matter > how it behaves wrt the X selection and the clipboard, we could modify > kill-region in small ways so that clipboard-kill-region would be > unnecessary, and we then could bind kill-region to menu-bar>Edit>Cut. It sounds like a good thing to me. Beside that I suggest applying something like the patch below to cua-base.el for similar reasons. Index: cua-base.el =================================================================== RCS file: /sources/emacs/emacs/lisp/emulation/cua-base.el,v retrieving revision 1.98 diff -u -b -r1.98 cua-base.el --- cua-base.el 27 Jun 2008 07:34:47 -0000 1.98 +++ cua-base.el 1 Aug 2008 19:44:20 -0000 @@ -1514,6 +1514,61 @@ (defvar cua--saved-state nil) +(defun cua-show-cua-in-edit-menu() + "Change the binding hints in the menus for CUA keys. +If `cua-mode' is on then this function may change the binding +hint text in the edit menu for the CUA keys C-c, C-x and C-v to +show those strings. + +For this to happen the variable `cua-show-cua-in-edit-menu' must +also be non-nil and `cua-enable-cua-keys' must be t. + +Otherwise the binding hints are reset to their default, ie +, and . + +This function should be called after turning on/off `cua-mode'." + (if (and cua-mode + cua-show-cua-in-edit-menu + (eq cua-enable-cua-keys t)) + (progn + (define-key menu-bar-edit-menu [paste] + '(menu-item "Paste" + ;;clipboard-yank + cua-paste + :help "Paste text from clipboard" + :keys "C-v")) + (define-key menu-bar-edit-menu [copy] + '(menu-item "Copy" + ;;clipboard-kill-ring-save + cua-copy-region + :enable mark-active + :help "Copy text in region to the clipboard" + :keys "C-c")) + (define-key menu-bar-edit-menu [cut] + '(menu-item "Cut" + ;;clipboard-kill-region + cua-cut-region + :enable mark-active + :help "Delete text in region and copy it to the clipboard" + :keys "C-x")) + ) + (define-key menu-bar-edit-menu [paste] + (cons "Paste" (cons "Paste text from clipboard" 'clipboard-yank))) + (define-key menu-bar-edit-menu [copy] + (cons "Copy" (cons "Copy text in region to the clipboard" + 'clipboard-kill-ring-save))) + (define-key menu-bar-edit-menu [cut] + (cons "Cut" (cons "Delete text in region and copy it to the clipboard" + 'clipboard-kill-region))))) + +(defcustom cua-show-cua-in-edit-menu t + "Show C-c, C-x and C-v in the edit menu." + :set (lambda(sym val) + (set-default sym val) + (cua-show-cua-in-edit-menu)) + :type 'boolean + :group 'cua) + ;;;###autoload (define-minor-mode cua-mode "Toggle CUA key-binding mode. @@ -1604,7 +1659,8 @@ (if (and (nth 1 cua--saved-state) (nth 2 cua--saved-state)) " and" "") (if (nth 2 cua--saved-state) " PC-Selection" "") (if (or (nth 1 cua--saved-state) (nth 2 cua--saved-state)) " enabled" ""))) - (setq cua--saved-state nil)))) + (setq cua--saved-state nil))) + (cua-show-cua-in-edit-menu)) ;;;###autoload