From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: no-spam@cua.dk (Kim F. Storm) Newsgroups: gmane.emacs.help Subject: Re: cua-mode and long key sequences Date: Tue, 17 Apr 2007 12:52:10 +0200 Message-ID: References: <1176798385.487954.248110@q75g2000hsh.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1176807220 9590 80.91.229.12 (17 Apr 2007 10:53:40 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 17 Apr 2007 10:53:40 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: mopi <52hands@gmail.com> Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Apr 17 12:53:33 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 1HdlJQ-0006YP-Tl for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Apr 2007 12:53:29 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdlO8-0001kd-Qe for geh-help-gnu-emacs@m.gmane.org; Tue, 17 Apr 2007 06:58:20 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HdlNL-0001JN-8m for help-gnu-emacs@gnu.org; Tue, 17 Apr 2007 06:57:31 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HdlNJ-0001Iy-E8 for help-gnu-emacs@gnu.org; Tue, 17 Apr 2007 06:57:30 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HdlNJ-0001It-8a for help-gnu-emacs@gnu.org; Tue, 17 Apr 2007 06:57:29 -0400 Original-Received: from mail-relay.sonofon.dk ([212.88.64.25]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1HdlIa-0000Z2-Bf for help-gnu-emacs@gnu.org; Tue, 17 Apr 2007 06:52:36 -0400 Original-Received: (qmail 34705 invoked from network); 17 Apr 2007 10:52:31 -0000 Original-Received: from unknown (HELO kfs-l.imdomain.dk.cua.dk) (213.83.150.2) by 0 with SMTP; 17 Apr 2007 10:52:31 -0000 In-Reply-To: <1176798385.487954.248110@q75g2000hsh.googlegroups.com> (mopi's message of "17 Apr 2007 01\:26\:25 -0700") User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.97 (gnu/linux) X-detected-kernel: FreeBSD 4.6-4.9 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:42752 Archived-At: mopi <52hands@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