From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: lindahlb@hotmail.com Newsgroups: gmane.emacs.help Subject: Re: C-mode blows away may Ctrl-C binding with a prefix -- how to remap prefix? Date: Fri, 18 Apr 2008 14:30:58 -0700 (PDT) Organization: http://groups.google.com Message-ID: <84670f09-57c4-4eb9-a2f5-0822d486e418@a70g2000hsh.googlegroups.com> References: <622ea63d-19ca-4f82-b554-af8be4bcb86d@u69g2000hse.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1208586778 3669 80.91.229.12 (19 Apr 2008 06:32:58 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Apr 2008 06:32:58 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 19 08:33:20 2008 connect(): Connection refused 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 1JmziB-0006BR-V2 for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Apr 2008 01:09:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmzhW-0000d5-Vr for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2008 19:09:03 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!a70g2000hsh.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 33 Original-NNTP-Posting-Host: 198.24.6.134 Original-X-Trace: posting.google.com 1208554258 29878 127.0.0.1 (18 Apr 2008 21:30:58 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 18 Apr 2008 21:30:58 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: a70g2000hsh.googlegroups.com; posting-host=198.24.6.134; posting-account=H8l0FAkAAAA7CA8nd7Yd_bolZ1hW67_X User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:158020 X-Mailman-Approved-At: Fri, 18 Apr 2008 19:06:52 -0400 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:53373 Archived-At: 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.