From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: despen@verizon.net Newsgroups: gmane.emacs.help Subject: Re: key map entry for shift-return? Date: Thu, 09 Jul 2009 20:48:06 GMT Message-ID: References: <961bb7e9-56d4-40d5-b0dc-4c15e0da722b@x25g2000prf.googlegroups.com> <878wiykk2r.fsf@catnip.gol.com> <1648be38-5e41-4d7b-98d8-1f6e6494d2a2@g7g2000prg.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1247198365 13359 80.91.229.12 (10 Jul 2009 03:59:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 10 Jul 2009 03:59:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jul 10 05:59:19 2009 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 1MP7GY-00018V-PS for geh-help-gnu-emacs@m.gmane.org; Fri, 10 Jul 2009 05:59:19 +0200 Original-Received: from localhost ([127.0.0.1]:60887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MP7GY-0002FP-3r for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Jul 2009 23:59:18 -0400 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news1.google.com!npeer02.iad.highwinds-media.com!news.highwinds-media.com!feed-me.highwinds-media.com!cyclone1.gnilink.net!spamkiller.gnilink.net!gnilink.net!nwrddc02.gnilink.net.POSTED!d15a3661!not-for-mail Original-Newsgroups: gnu.emacs.help,comp.emacs User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux) Cancel-Lock: sha1:dY/taHHQqBoVziIi4PBNW+TsBi0= Original-Lines: 58 Original-NNTP-Posting-Host: 74.105.221.162 Original-X-Complaints-To: abuse@verizon.net Original-X-Trace: nwrddc02.gnilink.net 1247172486 74.105.221.162 (Thu, 09 Jul 2009 16:48:06 EDT) Original-NNTP-Posting-Date: Thu, 09 Jul 2009 16:48:06 EDT Original-Xref: news.stanford.edu gnu.emacs.help:170707 comp.emacs:98379 X-Mailman-Approved-At: Thu, 09 Jul 2009 23:57:54 -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:65916 Archived-At: Xah Lee writes: > On Jul 9, 10:21 am, des...@verizon.net wrote: >> Xah Lee writes: >> > On Jul 9, 7:27 am, Miles Bader wrote: >> >> Alan Mackenzie writes: >> >> > Hey, stop being so enigmatic! I think the OP only wants Shift Return >> >> > for his own use, which should be OK. So please tell him (and me) what >> >> > this other complexity is. >> >> >> He's just looking for an excuse to flog his screeds... >> >> > Well, perhaps just a sentence or two to answer Alan. >> >> > Basically, for good or bad, emacs does not capture the key by itself, >> > but goes thru ascii representation in its implementation... my >> > phrasing here is not exactl but don't want to spend too much time >> > writing this. Basically, the end result is that when people want to >> > map keys like Tab, Return, or with modifiers, it has many >> > complexities. Many threads asked or discussed these in the past year >> > or two here.... another example comes to mind is that emacs is unable >> > to capture Ctrl+Shift+key combos in terminal. Perhaps historically >> > justifiable... but today's apps that goes thru network don't have this >> > limitation... >> >> I'm not sure what this is all about, I never saw the original post. >> But binding something to shift return doesn't seem to be a big problem. >> Try evaling this: >> >> (define-key global-map [(S-return)] 'compile) >> >> It works for me. >> >> I don't expect it would work in a TTY, but that's an issue with the TTY >> not emacs. For some TTY programs even that can be fixed. > > Yes. That touches the point. > > here's a example to illustarte what i was saying: > > Try: > (define-key global-map (kbd "RET") 'forward-word) I can't find anywhere in the documentation where emacs recommends using KBD to define keys: http://www.gnu.org/software/emacs/manual/html_node/emacs/Init-Rebinding.html#Init-Rebinding "When the key sequence includes function keys or mouse button events, or non-ASCII characters such as C-= or H-a, you must use the more general method of rebinding, which uses a vector to specify the key sequence. The way to write a vector in Emacs Lisp is with square brackets around the vector elements." Which is exactly what I did. I typed C-h k Shift Return and emacs told me I typed "S-return". The process seemed to work perfectly.