2009-07-09

emacs, problem with Return shortcut

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...
>
> -Miles

Thanks Miles. ^^

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...

Xah
∑ http://xahlee.org/



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)

now press Ctrl+m, you see that it also does forward-word.

To a emacs geek, perhaps this is natural, however, to any average programer or logically, pressing Return key certainly is not the same as pressing Ctrl+m.

This is what i was saying about keybindings involving Return, Tab (and few others) has some rather unexpected complexities in emacs, and, i was saying, these complexities has to do with how emacs implemented the key capture, and i was saying that in modern apps, usually they don't have this problem.

emacs being a old app, is what it is. I'm trying to communicate a few facts here as mentioned by this thread.

This emacs issue, certainly is not optimal. I don't know if it is worthy a fix. But i feel it should be known.

Xah
∑ http://xahlee.org/

No comments:

Post a Comment