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:37:03 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0ee97faf-9c8d-4e3b-9c6a-c30025edf5e2@m3g2000hsc.googlegroups.com> References: <622ea63d-19ca-4f82-b554-af8be4bcb86d@u69g2000hse.googlegroups.com> <84670f09-57c4-4eb9-a2f5-0822d486e418@a70g2000hsh.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 1208586742 3580 80.91.229.12 (19 Apr 2008 06:32:22 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Apr 2008 06:32:22 +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:32:53 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 1Jmzis-0006Df-VU for geh-help-gnu-emacs@m.gmane.org; Sat, 19 Apr 2008 01:10:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JmziD-0001Mq-UH for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Apr 2008 19:09:45 -0400 Original-Path: shelby.stanford.edu!headwall.stanford.edu!newsfeed.stanford.edu!postnews.google.com!m3g2000hsc.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 38 Original-NNTP-Posting-Host: 198.24.6.134 Original-X-Trace: posting.google.com 1208554623 30990 127.0.0.1 (18 Apr 2008 21:37:03 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Fri, 18 Apr 2008 21:37:03 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: m3g2000hsc.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:158021 X-Mailman-Approved-At: Fri, 18 Apr 2008 19:07:03 -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:53372 Archived-At: 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