From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Politz Newsgroups: gmane.emacs.help Subject: Re: Possible to rebind C-m to a function? (like any other control key combo?) Date: Sat, 29 Nov 2008 00:08:22 +0100 Organization: FH-Trier Message-ID: <1227913770.338606@arno.fh-trier.de> References: <8fcfe2f5-e707-424e-9896-bd0683fc94a3@s9g2000prg.googlegroups.com> <008087bb-f8b6-44b2-a123-d31a0542e368@r10g2000prf.googlegroups.com> <58193073-f789-44d7-8671-af233c1cc432@r15g2000prd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1227915649 22972 80.91.229.12 (28 Nov 2008 23:40:49 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 28 Nov 2008 23:40:49 +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 Nov 29 00:41:51 2008 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 1L6Cy7-0007jx-0V for geh-help-gnu-emacs@m.gmane.org; Sat, 29 Nov 2008 00:41:51 +0100 Original-Received: from localhost ([127.0.0.1]:47280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L6Cwx-0000Ie-0h for geh-help-gnu-emacs@m.gmane.org; Fri, 28 Nov 2008 18:40:39 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!t-online.de!inka.de!peernews!news.belwue.de!news.uni-kl.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 143-93-54-11.arno.fh-trier.de Original-X-Trace: news.uni-kl.de 1227913811 8473 143.93.54.11 (28 Nov 2008 23:10:11 GMT) Original-X-Complaints-To: usenet@news.uni-kl.de Original-NNTP-Posting-Date: Fri, 28 Nov 2008 23:10:11 +0000 (UTC) User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) In-Reply-To: <58193073-f789-44d7-8671-af233c1cc432@r15g2000prd.googlegroups.com> Cache-Post-Path: arno.fh-trier.de!unknown@dslb-084-059-221-066.pools.arcor-ip.net X-Cache: nntpcache 3.0.1 (see http://www.nntpcache.org/) Original-Xref: news.stanford.edu gnu.emacs.help:164881 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:60210 Archived-At: seberino@spawar.navy.mil wrote: > On Nov 28, 6:04 am, Xah Lee wrote: >> On Nov 27, 11:30 pm, "seber...@spawar.navy.mil" >> >> wrote: >>> There seems to be some special use for C-m as I cannot rebind it to a >>> function of my choosing like start-kbd-macro. >>> Is there anyway to make C-m into a "normal" combo I can bind like all >>> the others? >> there are ways but that gets into pretty hairy emacs customization. >> >> Ctrl+m is same as Enter in emacs. Best to avoid rebinding it. >> Similar is Ctrl+i and Tab key. > > Thanks. If someone had done the work already I'd still like to do it. > Why? C-i is sooo natural for an insert function and C-m is sooo > natural for a macro function. > > Chris > You can do it, at least in a windowed emacs: (global-set-key [return] #'(lambda nil (interactive) (message "This is RETURN."))) (global-set-key [13] #'(lambda nil (interactive) (message "This is C-m."))) ;; undo (progn (global-unset-key [return]) (global-set-key [13] 'newline)) The problem, I think, is that most libraries end up binding C-m and not [return] (likewise for C-i and [tab]). So you have to always rebind after some mode has stolen the C-m key (to [return]). -ap