[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C-mode blows away may Ctrl-C binding with a prefix -- how to remap
From: |
lindahlb |
Subject: |
Re: C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix? |
Date: |
Fri, 18 Apr 2008 14:37:03 -0700 (PDT) |
User-agent: |
G2/1.0 |
On Apr 18, 3:30 pm, linda...@hotmail.com wrote:
> On Apr 18, 12:18 pm, linda...@hotmail.com wrote:
>
> > Hi,
>
> > I'm currently using Windows-esque key bindings for copy (Ctrl-c), cut
> > (Ctrl-x) and paste (Ctrl-v). They work fine, except when I open a C/C+
> > + file. In the major mode, it remaps the (Ctrl-c) key to a keymap
> > prefix. I want to remap this keymap prefix to another key and return
> > the (Ctrl-c) mapping to my own copy command. How do I do this?
>
> > I currently have a c-mode customization hook, but couldn't figure out
> > how to do it there. Here is what I tried:
> > (define-key c-mode-base-map "\C-c" 'smart-copy)
>
> > Thanks,
> > Brian
>
> Well, for now I don't use the \C-c prefix, so blowing that away with
> 'smart-copy is good enough for now. Took forever to find this but,
> here it goes:
>
> ;; assure that the \C-c isn't a prefix and, instead, performs a smart-
> copy
> (setq overriding-local-map
> (let
> ((map (make-sparse-keymap)))
> (suppress-keymap map)
> (define-key map "\C-c" 'smart-copy)
> map
> )
> )
>
> Pain in the butt, and it doesn't bother to remap the "\C-c" prefix,
> but that can be done by those that really need it.
Oh, leave out the (suppress-keymap map) line (it was a copy and paste
artifact), otherwise you can't type anything. :D