help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: key map entry for shift-return?


From: despen
Subject: Re: key map entry for shift-return?
Date: Thu, 09 Jul 2009 20:48:06 GMT
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.3 (gnu/linux)

Xah Lee <xahlee@gmail.com> writes:

> On Jul 9, 10:21 am, des...@verizon.net wrote:
>> Xah Lee <xah...@gmail.com> writes:
>> > On Jul 9, 7:27 am, Miles Bader <mi...@gnu.org> wrote:
>> >> Alan Mackenzie <a...@muc.de> 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.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]