unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* ESC vs Meta for shifted keys
@ 2018-04-10 13:28 Robert Pluim
  2018-04-10 13:42 ` Stefan Monnier
  0 siblings, 1 reply; 26+ messages in thread
From: Robert Pluim @ 2018-04-10 13:28 UTC (permalink / raw)
  To: help-gnu-emacs

So Iʼve (finally) got an actual Meta key configured on my
keyboard. Iʼve always believed that Esc-as-prefix and Meta were
interchangable, but that doesnʼt seem to be the case:

C-h k ESC SHIFT <left>
=> ESC <left> (translated from <escape> <S-left>) runs the command
backward-word
C-h k ESC <left>
=> ESC <left> (translated from <escape> <left>) runs the command
backward-word
C-h k M-S-<left>
=>
<M-left> (translated from <M-S-left>) runs the command left-word

So this looks like emacs is not taking into account the SHIFT modifier
here? Or is there some default keyboard translation going on that I
need to disable?

Robert




^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-10 13:28 ESC vs Meta for shifted keys Robert Pluim
@ 2018-04-10 13:42 ` Stefan Monnier
  2018-04-10 13:57   ` Robert Pluim
  2018-04-10 23:11   ` Bob Proulx
  0 siblings, 2 replies; 26+ messages in thread
From: Stefan Monnier @ 2018-04-10 13:42 UTC (permalink / raw)
  To: help-gnu-emacs

> So Iʼve (finally) got an actual Meta key configured on my
> keyboard. Iʼve always believed that Esc-as-prefix and Meta were
> interchangable, but that doesnʼt seem to be the case:

The ESC <-> Meta equivalence only holds for characters, not for
"special keys" such as `left`, indeed.  Not sure why.

> So this looks like Emacs is not taking into account the SHIFT modifier
> here?

What makes you think so?  The "translated from" clearly shows that Emacs
saw the shift just fine.

> Or is there some default keyboard translation going on that I
> need to disable?

Why would you need to disable it?
IOW which part of "running left-word when I hit M-S-<left>" annoys you?


        Stefan




^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-10 13:42 ` Stefan Monnier
@ 2018-04-10 13:57   ` Robert Pluim
  2018-04-10 23:11   ` Bob Proulx
  1 sibling, 0 replies; 26+ messages in thread
From: Robert Pluim @ 2018-04-10 13:57 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: help-gnu-emacs

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> So Iʼve (finally) got an actual Meta key configured on my
>> keyboard. Iʼve always believed that Esc-as-prefix and Meta were
>> interchangable, but that doesnʼt seem to be the case:
>
> The ESC <-> Meta equivalence only holds for characters, not for
> "special keys" such as `left`, indeed.  Not sure why.

OK.

>> So this looks like Emacs is not taking into account the SHIFT modifier
>> here?
>
> What makes you think so?  The "translated from" clearly shows that Emacs
> saw the shift just fine.

You're right, I misinterpreted the results. It looks like emacs
ignores the shift if thereʼs no separate binding for the shifted
version, and runs whatever's bound to the unshifted version.

>> Or is there some default keyboard translation going on that I
>> need to disable?
>
> Why would you need to disable it?
> IOW which part of "running left-word when I hit M-S-<left>" annoys you?

This came up when running org, inside a table, where M-S-<left> and
M-<left> do different things, and neither are the same as
ESC-S-<left>. If the Esc <-> Meta were true here they would be easier
for me to type, although I can always rebind the ESC versions (or
retrain my fingers)

Robert



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-10 13:42 ` Stefan Monnier
  2018-04-10 13:57   ` Robert Pluim
@ 2018-04-10 23:11   ` Bob Proulx
  2018-04-11 12:34     ` Stefan Monnier
  1 sibling, 1 reply; 26+ messages in thread
From: Bob Proulx @ 2018-04-10 23:11 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier wrote:
> The ESC <-> Meta equivalence only holds for characters, not for
> "special keys" such as `left`, indeed.  Not sure why.

It seems to work for me.  Using C-h c to describe keys in both a
terminal and a graphical emacs shows:

  ESC <left> (translated from ESC M-O D) runs the command backward-word
  <M-left> runs the command left-word

left-word		      <M-left>, <C-left>
   Move point N words to the left (to the right if N is negative).
backward-word		      ESC <left>, M-b
   Move backward until encountering the beginning of a word.

I presume this is to support:

    11.6 Shift Selection
    ====================

    If you hold down the shift key while typing a cursor motion command,
    this sets the mark before moving point, so that the region extends from
    the original position of point to its new position.  This feature is
    referred to as "shift-selection".  It is similar to the way text is
    selected in other editors.
    ...

I imagine that the keybinding ESC <left> mapping to backward-word
instead of left-word is the root cause of the difference.  WDYT?

Bob



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
       [not found] ` <86tvsiaoe3.fsf@zoho.com>
@ 2018-04-10 23:26   ` Bob Proulx
  2018-04-10 23:40     ` Bob Proulx
  2018-04-15  0:30   ` Tim Johnson
                     ` (2 subsequent siblings)
  3 siblings, 1 reply; 26+ messages in thread
From: Bob Proulx @ 2018-04-10 23:26 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg wrote:
> Does anyone use the actual ESC key instead of
> Meta ("Alt" or whatever the keyboard
> manufacturer puts on the key) these days?

I use both interchangeably all of the time.  And so does anyone using
an XTerm with "Meta sends ESC" configured even if they never hit the
ESC key themselves.  Because there is no character sent for a meta key
event, just escape sequences for the subsequent key.  Therefore Meta
with that setting on XTerm sends ESC and it all works mostly seemlessly.

> I've heard, and seen picture of how the
> keyboards once looked, and then it made more
> sense to use it.

I think you mean more sense to use meta-key using such keyboards?
Because it certainly makes sense to use Alt-f for example for M-f
forward-word and the rest of the meta characters.  Current popular
keyboards all have an Alt key.

> Perhaps those keyboards didn't have the arrow
> keys, and that's why it doesn't work :)

The symbolics keyboard actually had a *different* arrow set than has
become standard.  The current "standard" comes from the ADM-3a.

  https://deskthority.net/keyboards-f2/lear-siegler-adm3a-terminal-keyboard-t11780.html

Compare the arrow keys on the h, j, k, l on the ADM-3a to the
Symbolics Space Cadet keyboard and you can see that the ADM-3a is the
one that set the standard and the space cadet keyboard has been
forgotten.

> Monnier knows what to Google Image to find such
> a keyboard image. If he does, I promise not to
> lose it :$

How about this one?

  https://en.wikipedia.org/wiki/Space-cadet_keyboard

Bob



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-10 23:26   ` Bob Proulx
@ 2018-04-10 23:40     ` Bob Proulx
  0 siblings, 0 replies; 26+ messages in thread
From: Bob Proulx @ 2018-04-10 23:40 UTC (permalink / raw)
  To: help-gnu-emacs

Bob Proulx wrote:
>   https://deskthority.net/keyboards-f2/lear-siegler-adm3a-terminal-keyboard-t11780.html
> 
> Compare the arrow keys on the h, j, k, l on the ADM-3a to the ...

I will also add to this to look at the position of the control key.
That is the position where I got used to it being.  When IBM came out
with their keyboard and put capslock there it was a tragedy!  This is
why I remap capslock to control and find it hard to use control in any
other position.  I am rather happy with the other changes such as
Return and so forth though.  (shrug)

In the ADM-3a one also sees the relationship between HOME and ~ too.
It was really quite the trend setter. :-)

  https://jbcrawford.us/history/computers/adm3a

Bob



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-10 23:11   ` Bob Proulx
@ 2018-04-11 12:34     ` Stefan Monnier
  2018-04-11 19:54       ` Bob Proulx
  0 siblings, 1 reply; 26+ messages in thread
From: Stefan Monnier @ 2018-04-11 12:34 UTC (permalink / raw)
  To: help-gnu-emacs

>> The ESC <-> Meta equivalence only holds for characters, not for
>> "special keys" such as `left`, indeed.  Not sure why.
> It seems to work for me.  Using C-h c to describe keys in both a
> terminal and a graphical emacs shows:
>
>   ESC <left> (translated from ESC M-O D) runs the command backward-word
>   <M-left> runs the command left-word

In which sense does it work for you?  The above shows clearly that
`M-left` and `ESC left` aren't treated identically.


        Stefan




^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-11 12:34     ` Stefan Monnier
@ 2018-04-11 19:54       ` Bob Proulx
  2018-04-11 21:10         ` Stefan Monnier
  0 siblings, 1 reply; 26+ messages in thread
From: Bob Proulx @ 2018-04-11 19:54 UTC (permalink / raw)
  To: help-gnu-emacs

Stefan Monnier wrote:
> >> The ESC <-> Meta equivalence only holds for characters, not for
> >> "special keys" such as `left`, indeed.  Not sure why.
>
> > It seems to work for me.  Using C-h c to describe keys in both a
> > terminal and a graphical emacs shows:
> >
> >   ESC <left> (translated from ESC M-O D) runs the command backward-word
> >   <M-left> runs the command left-word
>
> In which sense does it work for you?  The above shows clearly that
> `M-left` and `ESC left` aren't treated identically.

It works for me because they perform the same result.  M-left and ESC
left both move the point left a word.  M-right and ESC right both move
the point right a word.  I also pointed out that they were bound to
different function but I think I adequately explained why they were
bound to slightly different functions.  That is in order to support
Shift Selection.  (A feature that I never use by the way...)

Bob



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-11 19:54       ` Bob Proulx
@ 2018-04-11 21:10         ` Stefan Monnier
  2018-04-11 21:58           ` Drew Adams
  0 siblings, 1 reply; 26+ messages in thread
From: Stefan Monnier @ 2018-04-11 21:10 UTC (permalink / raw)
  To: help-gnu-emacs

> It works for me because they perform the same result.  M-left and ESC
> left both move the point left a word.  M-right and ESC right both move
> the point right a word.

Try them in a R2L paragraph to see if you still think they "perform the
same result".

> I also pointed out that they were bound to different function but
> I think I adequately explained why they were bound to slightly
> different functions.  That is in order to support Shift Selection.
> (A feature that I never use by the way...)

I don't see what shift-selection has to do with it.
I think it's just a bug: when left-word and right-word were introduced
only one pair of bindings was updated and not the other.


        Stefan




^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: ESC vs Meta for shifted keys
  2018-04-11 21:10         ` Stefan Monnier
@ 2018-04-11 21:58           ` Drew Adams
  2018-04-12  8:49             ` Robert Pluim
  2018-04-12 11:31             ` Eli Zaretskii
  0 siblings, 2 replies; 26+ messages in thread
From: Drew Adams @ 2018-04-11 21:58 UTC (permalink / raw)
  To: Stefan Monnier, help-gnu-emacs

> I think it's just a bug: when left-word and right-word were introduced
> only one pair of bindings was updated and not the other.

I'm not sure it's a bug.  My guess is that it was by design
(for whatever reason).  Perhaps Eli or someone else can
enlighten us.

I kinda doubt it was an oversight.  All of those bindings
are together, and the person who changed the Meta bindings
likely searched for `forward-word', not "[M-right]" or
"(kbd "M-<right>")"...

In `bindings.el':

 (global-set-key [M-right]  'right-word)
 (define-key esc-map [right] 'forward-word)
 (global-set-key [M-left]   'left-word)
 (define-key esc-map [left] 'backward-word)



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-11 21:58           ` Drew Adams
@ 2018-04-12  8:49             ` Robert Pluim
  2018-04-12 14:52               ` Drew Adams
  2018-04-12 11:31             ` Eli Zaretskii
  1 sibling, 1 reply; 26+ messages in thread
From: Robert Pluim @ 2018-04-12  8:49 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Stefan Monnier

Drew Adams <drew.adams@oracle.com> writes:

>> I think it's just a bug: when left-word and right-word were introduced
>> only one pair of bindings was updated and not the other.
>
> I'm not sure it's a bug.  My guess is that it was by design
> (for whatever reason).  Perhaps Eli or someone else can
> enlighten us.
>
> I kinda doubt it was an oversight.  All of those bindings
> are together, and the person who changed the Meta bindings
> likely searched for `forward-word', not "[M-right]" or
> "(kbd "M-<right>")"...
>
> In `bindings.el':
>
>  (global-set-key [M-right]  'right-word)
>  (define-key esc-map [right] 'forward-word)
>  (global-set-key [M-left]   'left-word)
>  (define-key esc-map [left] 'backward-word)

They both used to be bound to {forward,backward}-word, and were
updated at the same time. They're only different in R2L text.

Robert



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-11 21:58           ` Drew Adams
  2018-04-12  8:49             ` Robert Pluim
@ 2018-04-12 11:31             ` Eli Zaretskii
  1 sibling, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2018-04-12 11:31 UTC (permalink / raw)
  To: help-gnu-emacs

> Date: Wed, 11 Apr 2018 14:58:23 -0700 (PDT)
> From: Drew Adams <drew.adams@oracle.com>
> 
> > I think it's just a bug: when left-word and right-word were introduced
> > only one pair of bindings was updated and not the other.
> 
> I'm not sure it's a bug.  My guess is that it was by design
> (for whatever reason).  Perhaps Eli or someone else can
> enlighten us.
> 
> I kinda doubt it was an oversight.  All of those bindings
> are together, and the person who changed the Meta bindings
> likely searched for `forward-word', not "[M-right]" or
> "(kbd "M-<right>")"...

I don't remember why I bypassed ESC <right> etc.  Maybe I wanted to
change as few bindings as possible.  Maybe I thought users of R2L
script are unlikely to invoke these commands via ESC.  Maybe I just
made a mistake.

If someone is annoyed by the difference (which should only be visible
in bidirectional text), feel free to make ESC do the same as Meta in
this case.



^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: ESC vs Meta for shifted keys
  2018-04-12  8:49             ` Robert Pluim
@ 2018-04-12 14:52               ` Drew Adams
  2018-04-12 14:57                 ` Robert Pluim
  0 siblings, 1 reply; 26+ messages in thread
From: Drew Adams @ 2018-04-12 14:52 UTC (permalink / raw)
  To: Robert Pluim; +Cc: help-gnu-emacs, Stefan Monnier

> >> I think it's just a bug: when left-word and right-word were introduced
> >> only one pair of bindings was updated and not the other.
> >
> > I'm not sure it's a bug.  My guess is that it was by design
> > (for whatever reason).  Perhaps Eli or someone else can
> > enlighten us.
> >
> > I kinda doubt it was an oversight.  All of those bindings
> > are together, and the person who changed the Meta bindings
> > likely searched for `forward-word', not "[M-right]" or
> > "(kbd "M-<right>")"...
> >
> > In `bindings.el':
> >  (global-set-key [M-right]  'right-word)
> >  (define-key esc-map [right] 'forward-word)
> >  (global-set-key [M-left]   'left-word)
> >  (define-key esc-map [left] 'backward-word)
> 
> They both used to be bound to {forward,backward}-word, and were
> updated at the same time. They're only different in R2L text.

The question raised was whether the apparent
non-update of the esc-map bindings was deliberate
or an oversight.

When you say "they" were bound ... and "they" were
updated at the same time, is it the same "they"?
Does "they" refer to the global and esc-map keys
for the update, as well as for the old bindings?

Are you saying that the esc-map bindings used to
be bound to (forward|backward)-*, and they were
"updated" (at the same time as the global-map
keys) to the same keys: (forward|backward)-*?



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-12 14:52               ` Drew Adams
@ 2018-04-12 14:57                 ` Robert Pluim
  2018-04-12 16:02                   ` Drew Adams
  0 siblings, 1 reply; 26+ messages in thread
From: Robert Pluim @ 2018-04-12 14:57 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Stefan Monnier

Drew Adams <drew.adams@oracle.com> writes:

>> >> I think it's just a bug: when left-word and right-word were introduced
>> >> only one pair of bindings was updated and not the other.
>> >
>> > I'm not sure it's a bug.  My guess is that it was by design
>> > (for whatever reason).  Perhaps Eli or someone else can
>> > enlighten us.
>> >
>> > I kinda doubt it was an oversight.  All of those bindings
>> > are together, and the person who changed the Meta bindings
>> > likely searched for `forward-word', not "[M-right]" or
>> > "(kbd "M-<right>")"...
>> >
>> > In `bindings.el':
>> >  (global-set-key [M-right]  'right-word)
>> >  (define-key esc-map [right] 'forward-word)
>> >  (global-set-key [M-left]   'left-word)
>> >  (define-key esc-map [left] 'backward-word)
>> 
>> They both used to be bound to {forward,backward}-word, and were
>> updated at the same time. They're only different in R2L text.
>
> The question raised was whether the apparent
> non-update of the esc-map bindings was deliberate
> or an oversight.

It looks deliberate to me (and sensible).

> When you say "they" were bound ... and "they" were
> updated at the same time, is it the same "they"?
> Does "they" refer to the global and esc-map keys
> for the update, as well as for the old bindings?
>
> Are you saying that the esc-map bindings used to
> be bound to (forward|backward)-*, and they were
> "updated" (at the same time as the global-map
> keys) to the same keys: (forward|backward)-*?

Only the global bindings were changed:

--- a/lisp/bindings.el
+++ b/lisp/bindings.el
@@ -1103,9 +1103,9 @@ mode-specific-map
   "Keymap for characters following C-c.")
 (define-key global-map "\C-c" 'mode-specific-command-prefix)
 
-(global-set-key [M-right]  'forward-word)
+(global-set-key [M-right]  'right-word)
 (define-key esc-map [right] 'forward-word)
-(global-set-key [M-left]   'backward-word)
+(global-set-key [M-left]   'left-word)
 (define-key esc-map [left] 'backward-word)
 ;; ilya@math.ohio-state.edu says these bindings are standard on PC editors.
 (global-set-key [C-right]  'right-word)



^ permalink raw reply	[flat|nested] 26+ messages in thread

* RE: ESC vs Meta for shifted keys
  2018-04-12 14:57                 ` Robert Pluim
@ 2018-04-12 16:02                   ` Drew Adams
  2018-04-12 16:16                     ` Robert Pluim
  0 siblings, 1 reply; 26+ messages in thread
From: Drew Adams @ 2018-04-12 16:02 UTC (permalink / raw)
  To: Robert Pluim; +Cc: help-gnu-emacs, Stefan Monnier

> It looks deliberate to me (and sensible).
> Only the global bindings were changed:
>  
> -(global-set-key [M-right]  'forward-word)
> +(global-set-key [M-right]  'right-word)
>  (define-key esc-map [right] 'forward-word)
> -(global-set-key [M-left]   'backward-word)
> +(global-set-key [M-left]   'left-word)
>  (define-key esc-map [left] 'backward-word)

Right, and that's I expected too.

And Eli basically confirms that it was deliberate,
but doesn't recall just why it was done.  (Depending
on what "mistake" might mean, he perhaps also allowed
for it to have just been an oversight.)

The bottom line is that it's not clear why it
was done, and it's not clear what the right
behavior/choice would be now.

These are only default bindings, so whatever
choice is made it's not the end of the world.



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-12 16:02                   ` Drew Adams
@ 2018-04-12 16:16                     ` Robert Pluim
  2018-04-12 16:35                       ` Yuri Khan
  2018-04-12 16:48                       ` Eli Zaretskii
  0 siblings, 2 replies; 26+ messages in thread
From: Robert Pluim @ 2018-04-12 16:16 UTC (permalink / raw)
  To: Drew Adams; +Cc: help-gnu-emacs, Stefan Monnier

Drew Adams <drew.adams@oracle.com> writes:

>> It looks deliberate to me (and sensible).
>> Only the global bindings were changed:
>>  
>> -(global-set-key [M-right]  'forward-word)
>> +(global-set-key [M-right]  'right-word)
>>  (define-key esc-map [right] 'forward-word)
>> -(global-set-key [M-left]   'backward-word)
>> +(global-set-key [M-left]   'left-word)
>>  (define-key esc-map [left] 'backward-word)
>
> Right, and that's I expected too.
>
> And Eli basically confirms that it was deliberate,
> but doesn't recall just why it was done.  (Depending
> on what "mistake" might mean, he perhaps also allowed
> for it to have just been an oversight.)
>
> The bottom line is that it's not clear why it
> was done, and it's not clear what the right
> behavior/choice would be now.

Itʼs pretty clear to me: the current situation allows users of R2L
text to choose visual or logical moving without impacting L2R users at
all, so I see no need to change anything.

> These are only default bindings, so whatever
> choice is made it's not the end of the world.

This is emacs, after all :-)



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-12 16:16                     ` Robert Pluim
@ 2018-04-12 16:35                       ` Yuri Khan
  2018-04-12 16:53                         ` Eli Zaretskii
  2018-04-12 16:48                       ` Eli Zaretskii
  1 sibling, 1 reply; 26+ messages in thread
From: Yuri Khan @ 2018-04-12 16:35 UTC (permalink / raw)
  To: Robert Pluim; +Cc: help-gnu-emacs, Stefan Monnier

On Thu, Apr 12, 2018 at 11:16 PM, Robert Pluim <rpluim@gmail.com> wrote:

> Itʼs pretty clear to me: the current situation allows users of R2L
> text to choose visual or logical moving without impacting L2R users at
> all, so I see no need to change anything.

On the other hand, the same choice is available with M-b and M-f for
logical order, M-left and M-right for visual order. And it makes
intuitive sense for direction keys to move point in their
corresponding directions.



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-12 16:16                     ` Robert Pluim
  2018-04-12 16:35                       ` Yuri Khan
@ 2018-04-12 16:48                       ` Eli Zaretskii
  1 sibling, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2018-04-12 16:48 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Robert Pluim <rpluim@gmail.com>
> Date: Thu, 12 Apr 2018 18:16:43 +0200
> Cc: help-gnu-emacs@gnu.org, Stefan Monnier <monnier@iro.umontreal.ca>
> 
> the current situation allows users of R2L text to choose visual or
> logical moving

Nitpicking: both forward-word and right-word move in the logical order
by default, they just might move in opposite directions of buffer
positions.  If you want to have right-word move in visual order, you
need to set visual-order-cursor-movement to a non-nil value.



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-12 16:35                       ` Yuri Khan
@ 2018-04-12 16:53                         ` Eli Zaretskii
  0 siblings, 0 replies; 26+ messages in thread
From: Eli Zaretskii @ 2018-04-12 16:53 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Yuri Khan <yuri.v.khan@gmail.com>
> Date: Thu, 12 Apr 2018 23:35:31 +0700
> Cc: help-gnu-emacs <help-gnu-emacs@gnu.org>,
> 	Stefan Monnier <monnier@iro.umontreal.ca>
> 
> it makes intuitive sense for direction keys to move point in their
> corresponding directions.

Except that they don't, at least not always.  (Yes, bidirectional text
is tricky and confusing.)



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
       [not found] ` <86tvsiaoe3.fsf@zoho.com>
  2018-04-10 23:26   ` Bob Proulx
@ 2018-04-15  0:30   ` Tim Johnson
       [not found]   ` <mailman.12411.1523752244.27995.help-gnu-emacs@gnu.org>
       [not found]   ` <mailman.11999.1523402811.27995.help-gnu-emacs@gnu.org>
  3 siblings, 0 replies; 26+ messages in thread
From: Tim Johnson @ 2018-04-15  0:30 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg <moasen@zoho.com> [180410 10:59]:
> Does anyone use the actual ESC key instead of
> Meta ("Alt" or whatever the keyboard
> manufacturer puts on the key) these days?

  I use the ESC key instead of the Alt key in many, but not all
  cases of key combinations.
  
  I have some ergonomic issues with hands and fingers. Often, using
  ESC cuts down on stretching.

> I've heard, and seen picture of how the
> keyboards once looked, and then it made more
> sense to use it.
> 
> Perhaps those keyboards didn't have the arrow
> keys, and that's why it doesn't work :)
> 
> Monnier knows what to Google Image to find such
> a keyboard image. If he does, I promise not to
> lose it :$
> 
> -- 
> underground experts united
> http://user.it.uu.se/~embe8573

-- 
Tim Johnson
http://www.akwebsoft.com, http://www.tj49.com



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
       [not found]   ` <mailman.12411.1523752244.27995.help-gnu-emacs@gnu.org>
@ 2018-04-15  0:50     ` Emanuel Berg
  2018-04-15 15:50       ` Tim Johnson
  0 siblings, 1 reply; 26+ messages in thread
From: Emanuel Berg @ 2018-04-15  0:50 UTC (permalink / raw)
  To: help-gnu-emacs

Tim Johnson wrote:

> I have some ergonomic issues with hands and
> fingers. Often, using ESC cuts down
> on stretching.

You have some different keyboard than
mine then.

My Meta key, which is the Alt key according to
the keyboard manufacturer, involves some 2 cm
horizontal movement with the thumb, from right
to left (perhaps I should estimate it to one
"inch" instead :))

To hit the Esc key OTOH involves a huge leap of
hand over several keys, and this movement also
dislocates the hand from typing
"asdf" position.

-- 
underground experts united
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
       [not found]   ` <mailman.11999.1523402811.27995.help-gnu-emacs@gnu.org>
@ 2018-04-15  1:06     ` Emanuel Berg
  2018-04-15  4:13       ` Bob Proulx
       [not found]       ` <mailman.12416.1523765608.27995.help-gnu-emacs@gnu.org>
  0 siblings, 2 replies; 26+ messages in thread
From: Emanuel Berg @ 2018-04-15  1:06 UTC (permalink / raw)
  To: help-gnu-emacs

Bob Proulx wrote:

> I use both interchangeably all of the time.
> And so does anyone using an XTerm with "Meta
> sends ESC" configured even if they never hit
> the ESC key themselves. Because there is no
> character sent for a meta key event, just
> escape sequences for the subsequent key.
> Therefore Meta with that setting on XTerm
> sends ESC and it all works mostly seemlessly.

Yes, but that's more of an issue with the
terminal emulator. I mean use Escape instead of
Meta in the physical, keyboard sense.

    xterm*metaSendsEscape: true

Here is how to disable caps and do something
else with it in X:

    setxkbmap -option caps:none  # disable caps lock
    xmodmap -e 'keycode 66=a'    # rebind CAPS (66)

> I think you mean more sense to use meta-key
> using such keyboards? Because it certainly
> makes sense to use Alt-f for example for M-f
> forward-word and the rest of the meta
> characters. Current popular keyboards all
> have an Alt key.

Right, it is a good pick for Meta.

> The symbolics keyboard actually had
> a *different* arrow set than has become
> standard. The current "standard" comes from
> the ADM-3a.
>
>   https://deskthority.net/keyboards-f2/lear-siegler-adm3a-terminal-keyboard-t11780.html

The current standard for what? The Escape key
on that keyboard isn't current, it is much
closer which is probably why it was more
popular for this purpose on those keyboards.
The arrow set (h, j, k, l) is close to there
right hand, but somewhat unintuitive with ups
and downs, or at least not as intuitive as it
could be.

I think the arrow keys are best placed as:

          i = up
j = left  k = down  l = right

My first computer was a Mac Plus and the games
there, like Lode Runner, this was used - for
Dark Castle it was correspondingly w, a, s,
d because with the right hand, one aimed the
rock throwing arm with the mouse.
This reappeared much later in 3D games such as
Quake btw.

Anyway I think the i, j, k, l set is the best
at is is close and intuitive. In many
applications, e.g. for viewing images and PDF
documents, I have implemented it, and in Emacs
I use it for Emacs-w3m, scrolling [1], and
so on.

> https://en.wikipedia.org/wiki/Space-cadet_keyboard

Ha! I can't see anything on that photo.
Where are the Escape and arrow keys?!

[1] http://user.it.uu.se/~embe8573/emacs-init/scroll.el

-- 
underground experts united
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-15  1:06     ` Emanuel Berg
@ 2018-04-15  4:13       ` Bob Proulx
       [not found]       ` <mailman.12416.1523765608.27995.help-gnu-emacs@gnu.org>
  1 sibling, 0 replies; 26+ messages in thread
From: Bob Proulx @ 2018-04-15  4:13 UTC (permalink / raw)
  To: help-gnu-emacs

Emanuel Berg wrote:
> Bob Proulx wrote:
> > I use both interchangeably all of the time.
> > And so does anyone using an XTerm with "Meta
> > sends ESC" configured even if they never hit

I should emphasize that that first sentence.  I do so interchangeably
all of the time.

Because Control should be the key left of the A key I always remap
the Capslock to be Control.  This makes control as convenient as
possible.  I sometimes use Alt for meta.  I sometimes use ESC before
the key for meta.  I sometimes use C-[ (both pinky fingers in action)
to easily produce an ESC.  I use all three at different times.

> Here is how to disable caps and do something
> else with it in X:
> 
>     setxkbmap -option caps:none  # disable caps lock
>     xmodmap -e 'keycode 66=a'    # rebind CAPS (66)

I don't want to disable the key.  I simply remap capslock into a
control key.

> > The symbolics keyboard actually had
> > a *different* arrow set than has become
> > standard. The current "standard" comes from
> > the ADM-3a.

I shouldn't have mentioned that part.  It was extra information as "an
aside".  Because I thought it was interesting information.  But I see
it has just sent this discussion thread "off into the weeds".

> >   https://deskthority.net/keyboards-f2/lear-siegler-adm3a-terminal-keyboard-t11780.html
> 
> ... The Escape key
> on that keyboard isn't current, it is much
> closer which is probably why it was more
> popular for this purpose on those keyboards.

Yes.  That was the point I was making.

> The arrow set (h, j, k, l) is close to there
> right hand, but somewhat unintuitive with ups
> and downs, or at least not as intuitive as it
> could be.

During that era different terminal vendors produced different keyboard
layouts.  They were all different.  That was annoying.

> I think the arrow keys are best placed as:
> 
>           i = up
> j = left  k = down  l = right

Or a=left, s=down, d=right, w=up as has been common in other software.
(This will be immediately recognizable to many.  You mention that
pattern further down.)  Or perhaps C-s=left, C-d=right, C-w=up,
C-x=down.  (Others will recognize that set immediately too.)

However because of vi/vim and less and other software the most popular
combinations of keys has been h, j, k, l however.

> My first computer was a Mac Plus and the games
> there, like Lode Runner, this was used - for
> Dark Castle it was correspondingly w, a, s,
> d because with the right hand, one aimed the
> rock throwing arm with the mouse.
> This reappeared much later in 3D games such as
> Quake btw.

Yes.  Designed for left hand on keyboard and right hand on mouse.
That was also a common pattern for many CAD/EDA drawing programs I
have used over the years.

> Anyway I think the i, j, k, l set is the best
> at is is close and intuitive. In many
> applications, e.g. for viewing images and PDF
> documents, I have implemented it, and in Emacs
> I use it for Emacs-w3m, scrolling [1], and
> so on.

Awesome.  I don't think I will convert though.  And just to throw some
more random info into here I will note that the i3 window manager
default keys are j, k, l, ;, which are the same as h, j, k, l but
shifted to the right one key because the i3 author feels that the home
row of keys without moving the hand should be used.  Same logic but a
different result.  It doesn't convert me either. :-)

> > https://en.wikipedia.org/wiki/Space-cadet_keyboard
> 
> Ha! I can't see anything on that photo.
> Where are the Escape and arrow keys?!

In case others can't pick it out the image is here:

  https://upload.wikimedia.org/wikipedia/commons/4/47/Space-cadet.jpg

I never used this keyboard in real life and so only have the photo to
go upon.  The arrow keys are g=up, h=down, j=left, k=right.  I don't
see an Escape key anywhere on it.  Perhaps someone who used it might
know and comment.  That would be awesome.  It's quite the keyboard.


Bob



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-15  0:50     ` Emanuel Berg
@ 2018-04-15 15:50       ` Tim Johnson
  2018-04-16 12:52         ` Robert Pluim
  0 siblings, 1 reply; 26+ messages in thread
From: Tim Johnson @ 2018-04-15 15:50 UTC (permalink / raw)
  To: help-gnu-emacs

* Emanuel Berg <moasen@zoho.com> [180414 17:01]:
> Tim Johnson wrote:
> 
> > I have some ergonomic issues with hands and
> > fingers. Often, using ESC cuts down
> > on stretching.
> 
> You have some different keyboard than
> mine then.
 
  Probably. I've used compact keyboards for years. Started with
  small-key 80% (tenkeyless), then graduated to a Happy Hacker Lite2
  which is a 60% with standard-size keys. On such a footprint, ESC
  is a row closer. 
  
  I now use a Z-88 compact mechanical, where I swap the ESC so it is
  closer (and on mechanicals, it is also easier to physically swap
  the key). I alternate the z-88 with a qisan magicforce 60% which
  I've xmodmap'ped the heck out of. 

  Since I use vim and MC for my system work and have used it as such
  for as long as I have used emacs, ESC is a natural. And of course,
  C-[ is a very easy reach when one has the control key right next
  to one's pinky (as God intended the control key to be located).

  I suffer from basal joint arthritis on both hands which makes
  using my thumbs problematic.

  Furthermore, one may map ESC - <somechar> differently than 
  Alt - <somechar>. Whooppee more key combos!

  And lastly, using ESC means that one need not press all chars at
  once, but can do so sequentially. IOWS, ESC is a leader, not a
  modifier, or so that's how I think of it.

  "Each to his own and each's own is different"
    -- Alaskus Curmudgeous

> My Meta key, which is the Alt key according to
> the keyboard manufacturer, involves some 2 cm
> horizontal movement with the thumb, from right
> to left (perhaps I should estimate it to one
> "inch" instead :))
> 
> To hit the Esc key OTOH involves a huge leap of
> hand over several keys, and this movement also
> dislocates the hand from typing
> "asdf" position.
> 
> -- 
> underground experts united
> http://user.it.uu.se/~embe8573

-- 
Tim Johnson
http://www.akwebsoft.com, http://www.tj49.com



^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
       [not found]       ` <mailman.12416.1523765608.27995.help-gnu-emacs@gnu.org>
@ 2018-04-15 20:04         ` Emanuel Berg
  0 siblings, 0 replies; 26+ messages in thread
From: Emanuel Berg @ 2018-04-15 20:04 UTC (permalink / raw)
  To: help-gnu-emacs

Bob Proulx wrote:

>> Here is how to disable caps and do something
>> else with it in X:
>> 
>>     setxkbmap -option caps:none  # disable caps lock
>>     xmodmap -e 'keycode 66=a'    # rebind CAPS (66)
>
> I don't want to disable the key. I simply
> remap capslock into a control key.

I mean, you can disable the CAPS function and
do something else with it. Here, it outputs 'a'
but you can put your shell do do something,
execute a function for example, based on the
key that is outputted. But then 'a' is probably
a poor choise as you'd want that for normal use
still :)

> I never used this keyboard in real life and
> so only have the photo to go upon. The arrow
> keys are g=up, h=down, j=left, k=right.
> I don't see an Escape key anywhere on it.
> Perhaps someone who used it might know and
> comment. That would be awesome. It's quite
> the keyboard.

I once had I Sun keyboard with a whole extra
set of keys to the left of the Ctrl, Shift,
Caps Lock, Tab, '`', and Esc keys' column.
At first I was excited about them, and
I programmed them to do various things.
But soon I realized it was meaningless because
it was better to just use shortcuts instead of
moving your hand that "far" to hit a single
key. At that point, disappointed, I used my
angle grinder to dispose of that part of
the keyboard.

-- 
underground experts united
http://user.it.uu.se/~embe8573


^ permalink raw reply	[flat|nested] 26+ messages in thread

* Re: ESC vs Meta for shifted keys
  2018-04-15 15:50       ` Tim Johnson
@ 2018-04-16 12:52         ` Robert Pluim
  0 siblings, 0 replies; 26+ messages in thread
From: Robert Pluim @ 2018-04-16 12:52 UTC (permalink / raw)
  To: help-gnu-emacs

Tim Johnson <tim@akwebsoft.com> writes:

>   And lastly, using ESC means that one need not press all chars at
>   once, but can do so sequentially. IOWS, ESC is a leader, not a
>   modifier, or so that's how I think of it.
>

XEmacs has/had a feature where all the modifier keys worked like
prefix keys, so you could type C-M-S as three distinct keystrokes. I
suspect various accessibility functions allow you to achieve the same
these days.

>   "Each to his own and each's own is different"
>     -- Alaskus Curmudgeous

Indeed.



^ permalink raw reply	[flat|nested] 26+ messages in thread

end of thread, other threads:[~2018-04-16 12:52 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-10 13:28 ESC vs Meta for shifted keys Robert Pluim
2018-04-10 13:42 ` Stefan Monnier
2018-04-10 13:57   ` Robert Pluim
2018-04-10 23:11   ` Bob Proulx
2018-04-11 12:34     ` Stefan Monnier
2018-04-11 19:54       ` Bob Proulx
2018-04-11 21:10         ` Stefan Monnier
2018-04-11 21:58           ` Drew Adams
2018-04-12  8:49             ` Robert Pluim
2018-04-12 14:52               ` Drew Adams
2018-04-12 14:57                 ` Robert Pluim
2018-04-12 16:02                   ` Drew Adams
2018-04-12 16:16                     ` Robert Pluim
2018-04-12 16:35                       ` Yuri Khan
2018-04-12 16:53                         ` Eli Zaretskii
2018-04-12 16:48                       ` Eli Zaretskii
2018-04-12 11:31             ` Eli Zaretskii
     [not found] <mailman.11969.1523366938.27995.help-gnu-emacs@gnu.org>
     [not found] ` <86tvsiaoe3.fsf@zoho.com>
2018-04-10 23:26   ` Bob Proulx
2018-04-10 23:40     ` Bob Proulx
2018-04-15  0:30   ` Tim Johnson
     [not found]   ` <mailman.12411.1523752244.27995.help-gnu-emacs@gnu.org>
2018-04-15  0:50     ` Emanuel Berg
2018-04-15 15:50       ` Tim Johnson
2018-04-16 12:52         ` Robert Pluim
     [not found]   ` <mailman.11999.1523402811.27995.help-gnu-emacs@gnu.org>
2018-04-15  1:06     ` Emanuel Berg
2018-04-15  4:13       ` Bob Proulx
     [not found]       ` <mailman.12416.1523765608.27995.help-gnu-emacs@gnu.org>
2018-04-15 20:04         ` Emanuel Berg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).