From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: mopi <52hands@gmail.com> Newsgroups: gmane.emacs.help Subject: Re: cua-mode and long key sequences Date: 17 Apr 2007 05:47:13 -0700 Organization: http://groups.google.com Message-ID: <1176814033.533217.21720@y80g2000hsf.googlegroups.com> References: <1176798385.487954.248110@q75g2000hsh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1176816974 19097 80.91.229.12 (17 Apr 2007 13:36:14 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2007 13:36:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 17 15:35:58 2007 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 1HdnqQ-0003VG-A5 for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Apr 2007 15:35:42 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Hdnv9-0000d5-0y for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Apr 2007 09:40:35 -0400 Original-Path: shelby.stanford.edu!newshub.stanford.edu!postnews.google.com!y80g2000hsf.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 70 Original-NNTP-Posting-Host: 192.16.134.68 Original-X-Trace: posting.google.com 1176814033 19235 127.0.0.1 (17 Apr 2007 12:47:13 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 17 Apr 2007 12:47:13 +0000 (UTC) In-Reply-To: User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; sv-SE; rv:1.8.1.3) Gecko/20070309 Firefox/2.0.0.3,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: y80g2000hsf.googlegroups.com; posting-host=192.16.134.68; posting-account=2hN_GQ0AAACPrJKt-6-vp_n8wTh4w5Ay Original-Xref: shelby.stanford.edu gnu.emacs.help:147149 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:42753 Archived-At: On 17 Apr, 12:52, no-s...@cua.dk (Kim F. Storm) wrote: > mopi <52ha...@gmail.com> writes: > > There is some special cases in cua mode that I want to improve. I'm > > sure this has already been solved several times already so I turn to > > the Emacs wizards in this group. > > > Consider the following: > > 1. Mark a region. > > 2. Type C-c and press the home button. > > > What I want to do is copy the region and go to the beginning of the > > line. Instead of this Emacs helpfully greets me with "C-c is > > undefined". I understand the reason for this but I'm sure it's > > possible to make it do what I want. > > > I have looked in cua.el but it isn't that clear to me what command C-c > > sends. > > > The key sequences I want to modify is > > C-c > > C-c > > C-c > > C-c > > C-x > > C-x > > C-x > > C-x > > > Any suggestions or pointers to further reading? > > Does this patch give the desired result? > > *** cua-base.el 24 Feb 2007 22:51:52 +0100 1.78 > --- cua-base.el 17 Apr 2007 12:46:11 +0200 > *************** > *** 1429,1443 **** > (define-key cua--prefix-override-keymap [(control c)] 'cua--prefix-override-handler) > > (define-key cua--prefix-repeat-keymap [(control x) (control x)] 'cua--prefix-repeat-handler) > - (define-key cua--prefix-repeat-keymap [(control x) up] 'cua--prefix-cut-handler) > - (define-key cua--prefix-repeat-keymap [(control x) down] 'cua--prefix-cut-handler) > - (define-key cua--prefix-repeat-keymap [(control x) left] 'cua--prefix-cut-handler) > - (define-key cua--prefix-repeat-keymap [(control x) right] 'cua--prefix-cut-handler) > (define-key cua--prefix-repeat-keymap [(control c) (control c)] 'cua--prefix-repeat-handler) > ! (define-key cua--prefix-repeat-keymap [(control c) up] 'cua--prefix-copy-handler) > ! (define-key cua--prefix-repeat-keymap [(control c) down] 'cua--prefix-copy-handler) > ! (define-key cua--prefix-repeat-keymap [(control c) left] 'cua--prefix-copy-handler) > ! (define-key cua--prefix-repeat-keymap [(control c) right] 'cua--prefix-copy-handler) > > ;; Enable shifted fallbacks for C-x and C-c when region is active > (define-key cua--region-keymap [(shift control x)] 'cua--shift-control-x-prefix) > --- 1429,1438 ---- > (define-key cua--prefix-override-keymap [(control c)] 'cua--prefix-override-handler) > > (define-key cua--prefix-repeat-keymap [(control x) (control x)] 'cua--prefix-repeat-handler) > (define-key cua--prefix-repeat-keymap [(control c) (control c)] 'cua--prefix-repeat-handler) > ! (dolist (key '(up down left right home end next prior)) > ! (define-key cua--prefix-repeat-keymap (vector '(control x) key) 'cua--prefix-cut-handler) > ! (define-key cua--prefix-repeat-keymap (vector '(control c) key) 'cua--prefix-copy-handler)) > > ;; Enable shifted fallbacks for C-x and C-c when region is active > (define-key cua--region-keymap [(shift control x)] 'cua--shift-control-x-prefix) > > -- > Kim F. Storm http://www.cua.dk This solved it (after I byte compiled the patched file)! Thank you.