From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "rgb" Newsgroups: gmane.emacs.help Subject: Re: How to change keys for uncomment (C-u C-c C-c)? Date: 21 Apr 2005 13:09:48 -0700 Organization: http://groups.google.com Message-ID: <1114114188.647360.119850@z14g2000cwz.googlegroups.com> References: NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1114114782 17706 80.91.229.2 (21 Apr 2005 20:19:42 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Thu, 21 Apr 2005 20:19:42 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Apr 21 22:19:41 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DOi7d-0006LJ-0w for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Apr 2005 22:18:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DOiCO-0008Kj-V4 for geh-help-gnu-emacs@m.gmane.org; Thu, 21 Apr 2005 16:22:57 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!z14g2000cwz.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: 198.74.20.78 Original-X-Trace: posting.google.com 1114114192 1082 127.0.0.1 (21 Apr 2005 20:09:52 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Thu, 21 Apr 2005 20:09:52 +0000 (UTC) In-Reply-To: User-Agent: G2/0.2 Complaints-To: groups-abuse@google.com Injection-Info: z14g2000cwz.googlegroups.com; posting-host=198.74.20.78; posting-account=C7LM4w0AAAD23IRuMuUUJVCLQTuHhTK8 Original-Xref: shelby.stanford.edu gnu.emacs.help:130338 Original-To: help-gnu-emacs@gnu.org 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:25910 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25910 JS wrote: > Kevin Rodgers wrote: > > > JS wrote: > > > When I want to uncomment someting I first need to press C-u followed > > by C-c > > > C-c but that is not very handy. Is it possible to reconfigure C-u C-c > > > C-c into ie.: > > > > > > C-c C-c C-v instead? > > > > All things are possible. But `C-c C-c C-v' is not necessarily a good > > choice, because its prefix key `C-c C-c' is already bound to > > comment-region (as you know) and all `C-c C-LETTER' keys are reserved > > for major modes. But since all of the `C-c LETTER' keys are reserved > > for users, how about `C-c c' or `C-c u': > > > > (add-hook 'this-major-mode-hook ; e.g. 'c-mode-common-hook > > (lambda () > > (local-set-key "\C-cc" 'uncomment-region))) ; or "\C-cu" > > > > I just wrote this in my .emacs file: > > > (add-hook 'this-major-mode-hook > (lambda () > (local-set-key "\C-cc" 'uncomment-region))) 'this-major-mode-hook is supposed to be replace by the name of the mode hook whose mode you actually want the key defined within. Perhaps if you just use this. (global-set-key "\C-cc" 'uncomment-region) And move to something more complicated (such as the prior suggestion) if this causes you problems.