From: no-spam@cua.dk (Kim F. Storm)
To: mopi <52hands@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: cua-mode and long key sequences
Date: Tue, 17 Apr 2007 12:52:10 +0200 [thread overview]
Message-ID: <m3hcrfs279.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <1176798385.487954.248110@q75g2000hsh.googlegroups.com> (mopi's message of "17 Apr 2007 01\:26\:25 -0700")
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 <home> 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 <home>
> C-c <end>
> C-c <next>
> C-c <prior>
> C-x <home>
> C-x <end>
> C-x <next>
> C-x <prior>
>
> 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
next prev parent reply other threads:[~2007-04-17 10:52 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-17 8:26 cua-mode and long key sequences mopi
2007-04-17 8:45 ` Lennart Borgman (gmail)
[not found] ` <mailman.2167.1176799833.7795.help-gnu-emacs@gnu.org>
2007-04-17 9:23 ` mopi
2007-04-17 9:40 ` Lennart Borgman (gmail)
[not found] ` <mailman.2171.1176803115.7795.help-gnu-emacs@gnu.org>
2007-04-17 10:09 ` mopi
2007-04-17 10:47 ` Lennart Borgman (gmail)
2007-04-18 6:23 ` Brian Elmegaard
2007-04-18 8:57 ` Kim F. Storm
[not found] ` <mailman.2203.1176886979.7795.help-gnu-emacs@gnu.org>
2007-04-18 10:50 ` Brian Elmegaard
2007-04-17 10:52 ` Kim F. Storm [this message]
[not found] ` <mailman.2173.1176807452.7795.help-gnu-emacs@gnu.org>
2007-04-17 12:47 ` mopi
2007-04-17 14:39 ` mopi
2007-04-18 8:54 ` Kim F. Storm
2007-04-18 6:17 ` Brian Elmegaard
2007-04-18 9:58 ` Peter Dyballa
[not found] ` <mailman.2207.1176890622.7795.help-gnu-emacs@gnu.org>
2007-04-18 10:44 ` Brian Elmegaard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m3hcrfs279.fsf@kfs-l.imdomain.dk \
--to=no-spam@cua.dk \
--cc=52hands@gmail.com \
--cc=help-gnu-emacs@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).