all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: lindahlb@hotmail.com
To: help-gnu-emacs@gnu.org
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)	[thread overview]
Message-ID: <0ee97faf-9c8d-4e3b-9c6a-c30025edf5e2@m3g2000hsc.googlegroups.com> (raw)
In-Reply-To: 84670f09-57c4-4eb9-a2f5-0822d486e418@a70g2000hsh.googlegroups.com

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


  reply	other threads:[~2008-04-18 21:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-18 18:18 C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix? lindahlb
2008-04-18 21:30 ` lindahlb
2008-04-18 21:37   ` lindahlb [this message]
2008-04-19  7:17 ` David Hansen
2008-04-19  8:23   ` Lennart Borgman (gmail)
2008-04-19 10:36     ` Eli Zaretskii
2008-04-19 10:57       ` Lennart Borgman (gmail)

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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0ee97faf-9c8d-4e3b-9c6a-c30025edf5e2@m3g2000hsc.googlegroups.com \
    --to=lindahlb@hotmail.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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.