From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.help Subject: RE: Binding C-m and RETURN seperately Date: Mon, 12 Apr 2010 14:03:00 -0700 Message-ID: References: <6CECB267-E477-4CF1-BF1C-97B61C32D066@Web.DE> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0125_01CADA48.DD30BDE0" X-Trace: dough.gmane.org 1271107628 20614 80.91.229.12 (12 Apr 2010 21:27:08 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 12 Apr 2010 21:27:08 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: "'Nathaniel Flath'" , "'Peter Dyballa'" Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 12 23:27:07 2010 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.69) (envelope-from ) id 1O1R9s-0001JL-Oe for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Apr 2010 23:27:04 +0200 Original-Received: from localhost ([127.0.0.1]:45379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1QqQ-0003Al-3O for geh-help-gnu-emacs@m.gmane.org; Mon, 12 Apr 2010 17:06:58 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1O1Qmq-00028b-Hg for help-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:03:16 -0400 Original-Received: from [140.186.70.92] (port=53341 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1O1Qmp-00027j-6O for help-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:03:16 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1O1Qmn-0006K2-J8 for help-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:03:15 -0400 Original-Received: from acsinet11.oracle.com ([141.146.126.233]:44659) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1O1Qmn-0006JB-Dq for help-gnu-emacs@gnu.org; Mon, 12 Apr 2010 17:03:13 -0400 Original-Received: from rcsinet15.oracle.com (rcsinet15.oracle.com [148.87.113.117]) by acsinet11.oracle.com (Switch-3.4.2/Switch-3.4.2) with ESMTP id o3CL38PR003706 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 12 Apr 2010 21:03:09 GMT Original-Received: from acsmt354.oracle.com (acsmt354.oracle.com [141.146.40.154]) by rcsinet15.oracle.com (Switch-3.4.2/Switch-3.4.1) with ESMTP id o3CL35a8026369; Mon, 12 Apr 2010 21:03:05 GMT Original-Received: from abhmt001.oracle.com by acsmt353.oracle.com with ESMTP id 154655471271106178; Mon, 12 Apr 2010 14:02:58 -0700 Original-Received: from dradamslap1 (/130.35.178.194) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Mon, 12 Apr 2010 14:02:58 -0700 X-Mailer: Microsoft Office Outlook 11 In-reply-to: Thread-Index: Acraf95f7kgpzpMiSNC1mqAnNTF+BgAAy9vQ X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 X-Source-IP: acsmt354.oracle.com [141.146.40.154] X-Auth-Type: Internal IP X-CT-RefId: str=0001.0A090204.4BC38A8B.022E:SCFMA4539814,ss=1,fgs=0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) 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:72660 Archived-At: This is a multi-part message in MIME format. ------=_NextPart_000_0125_01CADA48.DD30BDE0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit If your RETURN (aka Enter) key sends a Control-M character, then you're out of luck: they are the same thing. If your RETURN key sends something different, that is, if Emacs can distinguish what it sends from C-m, then you can distinguish in Emacs Lisp. You can bind [return] instead of C-m. Same thing with TAB and C-i, etc. You can bind [tab] or C-i or both (to different things). But if your TAB key always sends C-i, then you cannot distinguish the two in Emacs Lisp. AFAIK. I don't quite understand what this means - I have (global-define-key (kbd "C-m") 'execute-extended-command) but it also binds RETURN. How do I make the input events distinguishable? I'm not running emacs in a terminal. Is there a way to bind C-m and return to different keybindings? Yes, of course. The input events just need to be distinguishable for GNU Emacs. ------=_NextPart_000_0125_01CADA48.DD30BDE0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
If your RETURN (aka Enter) key sends a = Control-M=20 character, then you're out of luck: they are the same = thing.
 
If your RETURN key sends something different, = that is,=20 if Emacs can distinguish what it sends from C-m, then you can = distinguish in=20 Emacs Lisp. You can bind [return] instead of C-m.
 
Same thing with TAB and C-i, etc. You can = bind [tab] or=20 C-i or both (to different things). But if your TAB key always sends C-i, = then=20 you cannot distinguish the two in Emacs Lisp. = AFAIK.

I=20 don't quite understand what this means - I have
(global-define-key = (kbd=20 "C-m") 'execute-extended-command)
but it also binds RETURN.  = How do I=20 make the input events distinguishable?  I'm not running emacs in = a=20 terminal.

Is=20 there a way to bind C-m and return to different=20 keybindings?
Yes, of course. The input events = just=20 need to be distinguishable for GNU=20 Emacs.
------=_NextPart_000_0125_01CADA48.DD30BDE0--