all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* weird key bindings...
@ 2017-05-28 14:54 Jean-Christophe Helary
  2017-05-29  3:49 ` Jean-Christophe Helary
  0 siblings, 1 reply; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-28 14:54 UTC (permalink / raw)
  To: help-gnu-emacs

I've checked my .emacs.el definitions, the contents of .emacs.d, etc. I've started Emacs.app with -q and I'm not finding what produces the following behavior:

When I'm in org-mode, most of the bindings involving Meta (esc on my Mac) do not produce the expected results. For ex. M-left should do org-do-promote but what it does is forward-word, although I *am* in org-mode.

What am I missing ?

Jean-Christophe 


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

* Re: weird key bindings...
  2017-05-28 14:54 weird key bindings Jean-Christophe Helary
@ 2017-05-29  3:49 ` Jean-Christophe Helary
  2017-05-29  5:54   ` Emanuel Berg
  2017-05-29 14:37   ` Yuri Khan
  0 siblings, 2 replies; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29  3:49 UTC (permalink / raw)
  To: help-gnu-emacs

Ok, it looks like I get expected keybindings (as far as org-mode is concerned at least) when I launch emacs with -nw. When I launch it with a graphical frame, I get a lot of bindings overridden.

It is not my .emacs.el that does that, and as far as I can tell it is nothing in my .emacs.d ... So what would be the cause of that behavior ?

Jean-Christophe 

> On May 28, 2017, at 23:54, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:
> 
> I've checked my .emacs.el definitions, the contents of .emacs.d, etc. I've started Emacs.app with -q and I'm not finding what produces the following behavior:
> 
> When I'm in org-mode, most of the bindings involving Meta (esc on my Mac) do not produce the expected results. For ex. M-left should do org-do-promote but what it does is forward-word, although I *am* in org-mode.
> 
> What am I missing ?
> 
> Jean-Christophe




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

* Re: weird key bindings...
  2017-05-29  3:49 ` Jean-Christophe Helary
@ 2017-05-29  5:54   ` Emanuel Berg
  2017-05-29  6:24     ` Jean-Christophe Helary
  2017-05-29 14:37   ` Yuri Khan
  1 sibling, 1 reply; 31+ messages in thread
From: Emanuel Berg @ 2017-05-29  5:54 UTC (permalink / raw)
  To: help-gnu-emacs

Jean-Christophe Helary
<jean.christophe.helary@gmail.com> writes:

> Ok, it looks like I get expected keybindings (as far
> as org-mode is concerned at least) when I launch
> emacs with -nw. When I launch it with a graphical
> frame, I get a lot of bindings overridden.

It might be your desktop environment and/or
window manager does something else with those keys so
the application within the frame doesn't get it.

Actually, it should be the other way around but in the
accursed Apple world I suppose anything is possible.

> It is not my .emacs.el that does that, and as far as
> I can tell it is nothing in my .emacs.d ... So what
> would be the cause of that behavior ?

You can rule that out with -Q. Try it with and
without -nw.

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




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

* Re: weird key bindings...
  2017-05-29  5:54   ` Emanuel Berg
@ 2017-05-29  6:24     ` Jean-Christophe Helary
  2017-05-29  7:20       ` Emanuel Berg
  0 siblings, 1 reply; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29  6:24 UTC (permalink / raw)
  To: help-gnu-emacs


> On May 29, 2017, at 14:54, Emanuel Berg <embe8573@student.uu.se> wrote:
> 
>> Ok, it looks like I get expected keybindings (as far
>> as org-mode is concerned at least) when I launch
>> emacs with -nw. When I launch it with a graphical
>> frame, I get a lot of bindings overridden.
> 
> It might be your desktop environment and/or
> window manager does something else with those keys so
> the application within the frame doesn't get it.

No, I do get them but they are not bound to the "usual" org functions. They either become navigation functions or end up being "non defined".

> Actually, it should be the other way around but in the
> accursed Apple world I suppose anything is possible.

To me it looks more like Emacs is getting settings from someplace else in graphical frame mode. By the way, I get the exact same behavior with Aquamacs. When launched in -nw I get the org-mode bindings, when in graphical frame, I get "normal" bindings.

Jean-Christophe 


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

* Re: weird key bindings...
  2017-05-29  6:24     ` Jean-Christophe Helary
@ 2017-05-29  7:20       ` Emanuel Berg
       [not found]         ` <87inkkruwb.fsf-trKG1I58N/ZemkTcIkSAvQ@public.gmane.org>
  0 siblings, 1 reply; 31+ messages in thread
From: Emanuel Berg @ 2017-05-29  7:20 UTC (permalink / raw)
  To: help-gnu-emacs

Jean-Christophe Helary
<jean.christophe.helary@gmail.com> writes:

> To me it looks more like Emacs is getting settings
> from someplace else in graphical frame mode. By the
> way, I get the exact same behavior with Aquamacs.
> When launched in -nw I get the org-mode bindings,
> when in graphical frame, I get "normal" bindings.

That's possible, just like X resources in the Unix
world. Again, try -Q!

In the man page for Unix Emacs, it says

  -Q, --quick
          Similar to "-q --no-site-file --no-splash".  Also, avoid processing X resources.

I don't know what documentation system there is on
Finder these days but whatever it is, browse it in
particular for -Q, -nw, the ~equivalent of
X resources, and init files in general, and see what
you can find.

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




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

* Re: weird key bindings...
       [not found]         ` <87inkkruwb.fsf-trKG1I58N/ZemkTcIkSAvQ@public.gmane.org>
@ 2017-05-29  7:38           ` Jean-Christophe Helary
  2017-05-29 15:34             ` Emanuel Berg
  0 siblings, 1 reply; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29  7:38 UTC (permalink / raw)
  To: help-gnu-emacs-mXXj517/zsQ
  Cc: Emacs on Mac OS X Mailing List,
	aquamacs-devel-/JYPxA39Uh5TLH3MbocFFw


> On May 29, 2017, at 16:20, Emanuel Berg <embe8573-oe7qfRrRQfc4M/bo5TPICw@public.gmane.org> wrote:
> 
> Jean-Christophe Helary
> <jean.christophe.helary-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> writes:
> 
>> To me it looks more like Emacs is getting settings
>> from someplace else in graphical frame mode. By the
>> way, I get the exact same behavior with Aquamacs.
>> When launched in -nw I get the org-mode bindings,
>> when in graphical frame, I get "normal" bindings.
> 
> That's possible, just like X resources in the Unix
> world. Again, try -Q!

Sorry if that wasn't clear. But I did that and I get the above results.
Instead of having M-left bound to org-do-promote, it is bound to backward-word.

Only a start with -nw makes those bindings go away.
(Ccing aquamacs-dev since I get the same behavior in Aquamacs too)

Jean-Christophe 

-- 
You received this message because you are subscribed to the Google Groups "aquamacs-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to aquamacs-devel+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org


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

* Re: weird key bindings...
  2017-05-29  3:49 ` Jean-Christophe Helary
  2017-05-29  5:54   ` Emanuel Berg
@ 2017-05-29 14:37   ` Yuri Khan
  2017-05-29 14:49     ` Jean-Christophe Helary
  1 sibling, 1 reply; 31+ messages in thread
From: Yuri Khan @ 2017-05-29 14:37 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: help-gnu-emacs@gnu.org

On Mon, May 29, 2017 at 10:49 AM, Jean-Christophe Helary
<jean.christophe.helary@gmail.com> wrote:

>> When I'm in org-mode, most of the bindings involving Meta (esc on my Mac) do not produce the expected results. For ex. M-left should do org-do-promote but what it does is forward-word, although I *am* in org-mode.

> Ok, it looks like I get expected keybindings (as far as org-mode is concerned at least) when I launch emacs with -nw. When I launch it with a graphical frame, I get a lot of bindings overridden.
>
> It is not my .emacs.el that does that, and as far as I can tell it is nothing in my .emacs.d ... So what would be the cause of that behavior ?

Press C-h k M-<left> when you are in Emacs in terminal. What does it say?

Press C-h k M-<left> when you are in Emacs GUI. What does it say?

After seeing the answers to the above, perhaps someone will tell you
what variables to check.



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

* Re: weird key bindings...
  2017-05-29 14:37   ` Yuri Khan
@ 2017-05-29 14:49     ` Jean-Christophe Helary
  2017-05-29 15:21       ` Jean-Christophe Helary
  2017-05-29 15:38       ` Yuri Khan
  0 siblings, 2 replies; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29 14:49 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org


> On May 29, 2017, at 23:37, Yuri Khan <yuri.v.khan@gmail.com> wrote:
> 
> On Mon, May 29, 2017 at 10:49 AM, Jean-Christophe Helary
> <jean.christophe.helary@gmail.com> wrote:
> 
>>> When I'm in org-mode, most of the bindings involving Meta (esc on my Mac) do not produce the expected results. For ex. M-left should do org-do-promote but what it does is forward-word, although I *am* in org-mode.
> 
>> Ok, it looks like I get expected keybindings (as far as org-mode is concerned at least) when I launch emacs with -nw. When I launch it with a graphical frame, I get a lot of bindings overridden.
>> 
>> It is not my .emacs.el that does that, and as far as I can tell it is nothing in my .emacs.d ... So what would be the cause of that behavior ?
> 
> Press C-h k M-<left> when you are in Emacs in terminal. What does it say?

ESC <left> (translated from ESC M-O D) runs the command org-metaleft                                              
(found in org-mode-map), which is an interactive compiled Lisp                                                    
function in ‘org.el’.   

> Press C-h k M-<left> when you are in Emacs GUI. What does it say?

ESC <left> (translated from <escape> <left>) runs the command
backward-word (found in global-map), which is an interactive compiled
Lisp function in ‘simple.el’.

Jean-Christophe


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

* Re: weird key bindings...
  2017-05-29 14:49     ` Jean-Christophe Helary
@ 2017-05-29 15:21       ` Jean-Christophe Helary
  2017-05-29 15:32         ` Jean-Christophe Helary
  2017-05-29 15:48         ` Joost Kremers
  2017-05-29 15:38       ` Yuri Khan
  1 sibling, 2 replies; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29 15:21 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

After a chat on #emacsfr here is further weirdness:

M-: (lookup-key org-mode-map (kbd "ESC <left>"))
(GUI) nil
(terminal) org-metaleft

Jean-Christophe 

> On May 29, 2017, at 23:49, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:
> 
>> 
>> On May 29, 2017, at 23:37, Yuri Khan <yuri.v.khan@gmail.com> wrote:
>> 
>> On Mon, May 29, 2017 at 10:49 AM, Jean-Christophe Helary
>> <jean.christophe.helary@gmail.com> wrote:
>> 
>>>> When I'm in org-mode, most of the bindings involving Meta (esc on my Mac) do not produce the expected results. For ex. M-left should do org-do-promote but what it does is forward-word, although I *am* in org-mode.
>> 
>>> Ok, it looks like I get expected keybindings (as far as org-mode is concerned at least) when I launch emacs with -nw. When I launch it with a graphical frame, I get a lot of bindings overridden.
>>> 
>>> It is not my .emacs.el that does that, and as far as I can tell it is nothing in my .emacs.d ... So what would be the cause of that behavior ?
>> 
>> Press C-h k M-<left> when you are in Emacs in terminal. What does it say?
> 
> ESC <left> (translated from ESC M-O D) runs the command org-metaleft                           
> (found in org-mode-map), which is an interactive compiled Lisp                                 
> function in ‘org.el’.   
> 
>> Press C-h k M-<left> when you are in Emacs GUI. What does it say?
> 
> ESC <left> (translated from <escape> <left>) runs the command
> backward-word (found in global-map), which is an interactive compiled
> Lisp function in ‘simple.el’.
> 
> Jean-Christophe




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

* Re: weird key bindings...
  2017-05-29 15:21       ` Jean-Christophe Helary
@ 2017-05-29 15:32         ` Jean-Christophe Helary
  2017-05-29 15:48         ` Joost Kremers
  1 sibling, 0 replies; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29 15:32 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org

And org-mode-map is very different depending on the launching mode too.

Jean-Christophe 

> On May 30, 2017, at 0:21, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:
> 
> After a chat on #emacsfr here is further weirdness:
> 
> M-: (lookup-key org-mode-map (kbd "ESC <left>"))
> (GUI) nil
> (terminal) org-metaleft
> 
> Jean-Christophe 
> 
>> On May 29, 2017, at 23:49, Jean-Christophe Helary <jean.christophe.helary@gmail.com> wrote:
>> 
>>> 
>>> On May 29, 2017, at 23:37, Yuri Khan <yuri.v.khan@gmail.com> wrote:
>>> 
>>> On Mon, May 29, 2017 at 10:49 AM, Jean-Christophe Helary
>>> <jean.christophe.helary@gmail.com> wrote:
>>> 
>>>>> When I'm in org-mode, most of the bindings involving Meta (esc on my Mac) do not produce the expected results. For ex. M-left should do org-do-promote but what it does is forward-word, although I *am* in org-mode.
>>> 
>>>> Ok, it looks like I get expected keybindings (as far as org-mode is concerned at least) when I launch emacs with -nw. When I launch it with a graphical frame, I get a lot of bindings overridden.
>>>> 
>>>> It is not my .emacs.el that does that, and as far as I can tell it is nothing in my .emacs.d ... So what would be the cause of that behavior ?
>>> 
>>> Press C-h k M-<left> when you are in Emacs in terminal. What does it say?
>> 
>> ESC <left> (translated from ESC M-O D) runs the command org-metaleft                           
>> (found in org-mode-map), which is an interactive compiled Lisp                                 
>> function in ‘org.el’.   
>> 
>>> Press C-h k M-<left> when you are in Emacs GUI. What does it say?
>> 
>> ESC <left> (translated from <escape> <left>) runs the command
>> backward-word (found in global-map), which is an interactive compiled
>> Lisp function in ‘simple.el’.
>> 
>> Jean-Christophe
> 




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

* Re: weird key bindings...
  2017-05-29  7:38           ` Jean-Christophe Helary
@ 2017-05-29 15:34             ` Emanuel Berg
  0 siblings, 0 replies; 31+ messages in thread
From: Emanuel Berg @ 2017-05-29 15:34 UTC (permalink / raw)
  To: help-gnu-emacs; +Cc: aquamacs-devel, macosx-emacs, help-gnu-emacs

Jean-Christophe Helary
<jean.christophe.helary@gmail.com>
writes:

>> That's possible, just like X resources in the Unix
>> world. Again, try -Q!
>
> Sorry if that wasn't clear. But I did that and I get
> the above results. Instead of having M-left bound to
> org-do-promote, it is bound to backward-word.

OK... What does the documentation say for -nw and -q
and -Q?

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




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

* Re: weird key bindings...
  2017-05-29 14:49     ` Jean-Christophe Helary
  2017-05-29 15:21       ` Jean-Christophe Helary
@ 2017-05-29 15:38       ` Yuri Khan
  2017-05-29 16:02         ` Joost Kremers
                           ` (2 more replies)
  1 sibling, 3 replies; 31+ messages in thread
From: Yuri Khan @ 2017-05-29 15:38 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: help-gnu-emacs@gnu.org

On Mon, May 29, 2017 at 9:49 PM, Jean-Christophe Helary
<jean.christophe.helary@gmail.com> wrote:

>> Press C-h k M-<left> when you are in Emacs in terminal. What does it say?
>
> ESC <left> (translated from ESC M-O D) runs the command org-metaleft
> (found in org-mode-map), which is an interactive compiled Lisp
> function in ‘org.el’.
>
>> Press C-h k M-<left> when you are in Emacs GUI. What does it say?
>
> ESC <left> (translated from <escape> <left>) runs the command
> backward-word (found in global-map), which is an interactive compiled
> Lisp function in ‘simple.el’.


Interesting. It’s not just you and it’s not your Mac. I see this on
GTK+3/GNU/Linux:

$ emacs -Q

M-x org-mode RET

C-h k M-<left>
<M-left> runs the command org-metaleft […]

C-h k ESC <left>
ESC <left> (translated from <escape> <left>) runs the command
backward-word […]

$ emacs -Q -nw

C-h k ESC <left>

M-x org-mode RET
ESC <left> (translated from ESC M-O D) runs the command org-metaleft […]

<M-left> runs the command org-metaleft (found in org-mode-map) […]


Looking into org.el shows that it binds [(meta left)] which seems to
not include the GUI <M-left> key.



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

* Re: weird key bindings...
  2017-05-29 15:21       ` Jean-Christophe Helary
  2017-05-29 15:32         ` Jean-Christophe Helary
@ 2017-05-29 15:48         ` Joost Kremers
  1 sibling, 0 replies; 31+ messages in thread
From: Joost Kremers @ 2017-05-29 15:48 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: help-gnu-emacs@gnu.org


On Mon, May 29 2017, Jean-Christophe Helary wrote:
> After a chat on #emacsfr here is further weirdness:
>
> M-: (lookup-key org-mode-map (kbd "ESC <left>"))
> (GUI) nil
> (terminal) org-metaleft

Interestingly, I get the same thing on Linux, with Emacs 25.2. But

IELM> (lookup-key org-mode-map (kbd "M-<left>"))

returns `org-metaleft' and pressing M-<left> in both instances 
runs `org-metaleft'.

-- 
Joost Kremers
Life has its moments



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

* Re: weird key bindings...
  2017-05-29 15:38       ` Yuri Khan
@ 2017-05-29 16:02         ` Joost Kremers
  2017-05-29 17:52         ` Eli Zaretskii
  2017-05-29 19:50         ` Emanuel Berg
  2 siblings, 0 replies; 31+ messages in thread
From: Joost Kremers @ 2017-05-29 16:02 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs@gnu.org, Jean-Christophe Helary


On Mon, May 29 2017, Yuri Khan wrote:
> On Mon, May 29, 2017 at 9:49 PM, Jean-Christophe Helary
> <jean.christophe.helary@gmail.com> wrote:
>
>>> Press C-h k M-<left> when you are in Emacs in terminal. What 
>>> does it say?
>>
>> ESC <left> (translated from ESC M-O D) runs the command 
>> org-metaleft
>> (found in org-mode-map), which is an interactive compiled Lisp
>> function in ‘org.el’.
>>
>>> Press C-h k M-<left> when you are in Emacs GUI. What does it 
>>> say?
>>
>> ESC <left> (translated from <escape> <left>) runs the command
>> backward-word (found in global-map), which is an interactive 
>> compiled
>> Lisp function in ‘simple.el’.
>
>
> Interesting. It’s not just you and it’s not your Mac. I see this 
> on
> GTK+3/GNU/Linux:
>
> $ emacs -Q
>
> M-x org-mode RET
>
> C-h k M-<left>
> <M-left> runs the command org-metaleft […]
>
> C-h k ESC <left>
> ESC <left> (translated from <escape> <left>) runs the command
> backward-word […]
>
> $ emacs -Q -nw
>
> C-h k ESC <left>
>
> M-x org-mode RET
> ESC <left> (translated from ESC M-O D) runs the command 
> org-metaleft […]
>
> <M-left> runs the command org-metaleft (found in org-mode-map) 
> […]
>
>
> Looking into org.el shows that it binds [(meta left)] which 
> seems to
> not include the GUI <M-left> key.

As I just posted, I get the correct bindings in Org (GNU Emacs: 
25.2, Org: 9.0.7, running on GNU/Linux), both GUI and -nw.

-- 
Joost Kremers
Life has its moments



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

* Re: weird key bindings...
  2017-05-29 15:38       ` Yuri Khan
  2017-05-29 16:02         ` Joost Kremers
@ 2017-05-29 17:52         ` Eli Zaretskii
  2017-05-29 19:31           ` Yuri Khan
  2017-05-29 19:50         ` Emanuel Berg
  2 siblings, 1 reply; 31+ messages in thread
From: Eli Zaretskii @ 2017-05-29 17:52 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Yuri Khan <yuri.v.khan@gmail.com>
> Date: Mon, 29 May 2017 22:38:55 +0700
> Cc: "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> 
> $ emacs -Q
> 
> M-x org-mode RET
> 
> C-h k M-<left>
> <M-left> runs the command org-metaleft […]
> 
> C-h k ESC <left>
> ESC <left> (translated from <escape> <left>) runs the command
> backward-word […]
> 
> $ emacs -Q -nw
> 
> C-h k ESC <left>
> 
> M-x org-mode RET
> ESC <left> (translated from ESC M-O D) runs the command org-metaleft […]
> 
> <M-left> runs the command org-metaleft (found in org-mode-map) […]
> 
> 
> Looking into org.el shows that it binds [(meta left)] which seems to
> not include the GUI <M-left> key.

So isn't the above expected?  There are no function keys on a TTY,
they generate either ASCII characters or sequences of ASCII
characters.




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

* Re: weird key bindings...
  2017-05-29 17:52         ` Eli Zaretskii
@ 2017-05-29 19:31           ` Yuri Khan
  2017-05-29 23:11             ` Jean-Christophe Helary
  0 siblings, 1 reply; 31+ messages in thread
From: Yuri Khan @ 2017-05-29 19:31 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: help-gnu-emacs@gnu.org

On Tue, May 30, 2017 at 12:52 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>> Looking into org.el shows that it binds [(meta left)] which seems to
>> not include the GUI <M-left> key.
>
> So isn't the above expected?  There are no function keys on a TTY,
> they generate either ASCII characters or sequences of ASCII
> characters.

The surprising thing in this particular case is that M-left behaves
differently from ESC left. That is possible on a GUI Emacs, but the
expectation is that Meta and ESC have the same effect.



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

* Re: weird key bindings...
  2017-05-29 15:38       ` Yuri Khan
  2017-05-29 16:02         ` Joost Kremers
  2017-05-29 17:52         ` Eli Zaretskii
@ 2017-05-29 19:50         ` Emanuel Berg
  2 siblings, 0 replies; 31+ messages in thread
From: Emanuel Berg @ 2017-05-29 19:50 UTC (permalink / raw)
  To: help-gnu-emacs

Yuri Khan <yuri.v.khan@gmail.com> writes:

> Interesting. It’s not just you and it’s not your Mac.
> I see this on GTK+3/GNU/Linux [...]
>
> $ emacs -Q -nw

There is a variable `window-system'. I suppose it
reports nil following -nw. Without it, well, here is
what the help says:

    Documentation:
    Name of window system through which the selected frame is displayed.
    The value is a symbol:
     nil for a termcap frame (a character-only terminal),
     'x' for an Emacs frame that is really an X window,
     'w32' for an Emacs frame that is a window on MS-Windows display,
     'ns' for an Emacs frame on a GNUstep or Macintosh Cocoa display,
     'pc' for a direct-write MS-DOS frame.

So perhaps the mode checks that variable and sets up
the keys differently if there is a window system or
not. Note the reference to "Macintosh Cocoa".

So browse the code for that, or `display-graphic-p' as
it apparently is the modern version.

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




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

* Re: weird key bindings...
  2017-05-29 19:31           ` Yuri Khan
@ 2017-05-29 23:11             ` Jean-Christophe Helary
  2017-05-29 23:21               ` Emanuel Berg
                                 ` (2 more replies)
  0 siblings, 3 replies; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29 23:11 UTC (permalink / raw)
  To: Yuri Khan; +Cc: help-gnu-emacs@gnu.org


> On May 30, 2017, at 4:31, Yuri Khan <yuri.v.khan@gmail.com> wrote:
> 
> On Tue, May 30, 2017 at 12:52 AM, Eli Zaretskii <eliz@gnu.org> wrote:
>>> Looking into org.el shows that it binds [(meta left)] which seems to
>>> not include the GUI <M-left> key.
>> 
>> So isn't the above expected?  There are no function keys on a TTY,
>> they generate either ASCII characters or sequences of ASCII
>> characters.
> 
> The surprising thing in this particular case is that M-left behaves
> differently from ESC left. That is possible on a GUI Emacs, but the
> expectation is that Meta and ESC have the same effect.

Is there anything I can do about it ? It's confusing to use GUI emacs (on mac only ?) and not be able to access expected shortcuts out of the box.

Jean-Christophe




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

* Re: weird key bindings...
  2017-05-29 23:11             ` Jean-Christophe Helary
@ 2017-05-29 23:21               ` Emanuel Berg
  2017-05-29 23:29                 ` Jean-Christophe Helary
  2017-05-30  6:01               ` Eli Zaretskii
  2017-05-30  9:32               ` Yuri Khan
  2 siblings, 1 reply; 31+ messages in thread
From: Emanuel Berg @ 2017-05-29 23:21 UTC (permalink / raw)
  To: help-gnu-emacs

Jean-Christophe Helary wrote:

> Is there anything I can do about it ?
> It's confusing to use GUI emacs (on mac only
> ?) and not be able to access expected
> shortcuts out of the box.

What I've understood (?) from you describing
the problem, Emacs intercepts the keys
correctly in terminal (-nw) as well as and GUI
mode, only the bindings vary and it is not
a matter of misconfiguration (-Q) and it isn't
even a local Mac problem, which is the most
surprising thing of all, because Khan had the
problem reproduced on Linux - however be that
as it may, if it is only a matter of
keybindings, what you can do is explicitly
rebind the keys to whatever you want. So just
`require' the mode and rebind the keys in your
.emacs. E.g.,

    (require 'message)

    (let ((the-map message-mode-map))
      ;; misc
      (define-key the-map "\C-ca"    #'goto-replied-to-message)
      (define-key the-map "\C-c\C-c" #'message-send-and-exit-current)
      (define-key the-map "\C-x\C-s" #'message-save-draft)
      ;; iterate headers
      (define-key the-map "\t"       #'next-header)
      (define-key the-map [backtab]  #'prev-header) )

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




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

* Re: weird key bindings...
  2017-05-29 23:21               ` Emanuel Berg
@ 2017-05-29 23:29                 ` Jean-Christophe Helary
  2017-05-30  1:09                   ` Emanuel Berg
  2017-05-30  2:03                   ` Robert Thorpe
  0 siblings, 2 replies; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-29 23:29 UTC (permalink / raw)
  To: help-gnu-emacs


> On May 30, 2017, at 8:21, Emanuel Berg <moasen@zoho.com> wrote:
> 
> What I've understood (?) from you describing
> the problem, Emacs intercepts the keys
> correctly in terminal (-nw) as well as and GUI
> mode, only the bindings vary and it is not
> a matter of misconfiguration (-Q) and it isn't
> even a local Mac problem, which is the most
> surprising thing of all, because Khan had the
> problem reproduced on Linux

That sound correct.

> - however be that
> as it may, if it is only a matter of
> keybindings,

That's what I'd like to know actually. Why does that happen in some versions of Emacs GUI and not in others (Joost reported he had the right bindings in GUI and terminal). It is something related to the build process ?

Jean-Christophe 


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

* Re: weird key bindings...
  2017-05-29 23:29                 ` Jean-Christophe Helary
@ 2017-05-30  1:09                   ` Emanuel Berg
  2017-05-30  2:03                   ` Robert Thorpe
  1 sibling, 0 replies; 31+ messages in thread
From: Emanuel Berg @ 2017-05-30  1:09 UTC (permalink / raw)
  To: help-gnu-emacs

Jean-Christophe Helary wrote:

> That's what I'd like to know actually.
> Why does that happen in some versions of
> Emacs GUI and not in others (Joost reported
> he had the right bindings in GUI and
> terminal). It is something related to the
> build process ?

If it isn't a plain software bug it sounds like
it is some mismatch when putting together
software components. I suppose this can be seen
as the build process but I don't think the
error is in the process itself but in the
components and/or their interaction.

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




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

* Re: weird key bindings...
  2017-05-29 23:29                 ` Jean-Christophe Helary
  2017-05-30  1:09                   ` Emanuel Berg
@ 2017-05-30  2:03                   ` Robert Thorpe
  2017-05-30  2:17                     ` Jean-Christophe Helary
  1 sibling, 1 reply; 31+ messages in thread
From: Robert Thorpe @ 2017-05-30  2:03 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: help-gnu-emacs

Jean-Christophe Helary <jean.christophe.helary@gmail.com> writes:

>> - however be that
>> as it may, if it is only a matter of
>> keybindings,
>
> That's what I'd like to know actually. Why does that happen in some
> versions of Emacs GUI and not in others (Joost reported he had the
> right bindings in GUI and terminal). It is something related to the
> build process ?

I see the same thing on Xubuntu.

I think it's a bug.  Emacs is capable of distinguishing M-left
and M-right in both the Terminal and GUI.  It should do it the same way
in both.

It's odd that the problem occurs in GUI where it's easier for Emacs to
distinguish the keys from each other.

BR,
Robert Thorpe



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

* Re: weird key bindings...
  2017-05-30  2:03                   ` Robert Thorpe
@ 2017-05-30  2:17                     ` Jean-Christophe Helary
  2017-05-30  2:39                       ` Emanuel Berg
  0 siblings, 1 reply; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-30  2:17 UTC (permalink / raw)
  To: help-gnu-emacs

Thank you Robert for checking.

> On May 30, 2017, at 11:03, Robert Thorpe <rt@robertthorpeconsulting.com> wrote:
> 
>> That's what I'd like to know actually. Why does that happen in some
>> versions of Emacs GUI and not in others (Joost reported he had the
>> right bindings in GUI and terminal). It is something related to the
>> build process ?
> 
> I see the same thing on Xubuntu.
> 
> I think it's a bug.  Emacs is capable of distinguishing M-left
> and M-right in both the Terminal and GUI.  It should do it the same way
> in both.
> 
> It's odd that the problem occurs in GUI where it's easier for Emacs to
> distinguish the keys from each other.

And it's odd that somebody complained about that only now :) I'd think that GUI emacs users are very likely to use org-mode too...

I'd like people from emacs-devel to chime in so as to confirm it's a bug and not just a trivial build configuration issue.

Jean-Christophe 


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

* Re: weird key bindings...
  2017-05-30  2:17                     ` Jean-Christophe Helary
@ 2017-05-30  2:39                       ` Emanuel Berg
  2017-05-30  3:08                         ` Jean-Christophe Helary
  0 siblings, 1 reply; 31+ messages in thread
From: Emanuel Berg @ 2017-05-30  2:39 UTC (permalink / raw)
  To: help-gnu-emacs

Jean-Christophe Helary
<jean.christophe.helary@gmail.com> writes:

> I'd think that GUI emacs users are very likely to
> use org-mode too...

Good intuition.

> I'd like people from emacs-devel to chime in so as
> to confirm it's a bug and not just a trivial build
> configuration issue.

Which of those would be more trivial is up for grabs.
But anyway, you don't need anyone to chime in.
Just report it as a bug and refer to this thread on
gmane.emacs.help as beta.

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




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

* Re: weird key bindings...
  2017-05-30  2:39                       ` Emanuel Berg
@ 2017-05-30  3:08                         ` Jean-Christophe Helary
  0 siblings, 0 replies; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-30  3:08 UTC (permalink / raw)
  To: help-gnu-emacs


> On May 30, 2017, at 11:39, Emanuel Berg <embe8573@student.uu.se> wrote:
> 
>> I'd like people from emacs-devel to chime in so as
>> to confirm it's a bug and not just a trivial build
>> configuration issue.
> 
> Which of those would be more trivial is up for grabs.
> But anyway, you don't need anyone to chime in.
> Just report it as a bug and refer to this thread on
> gmane.emacs.help as beta.

Ok, bug#27140. Thank you.

Jean-Christophe 



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

* Re: weird key bindings...
  2017-05-29 23:11             ` Jean-Christophe Helary
  2017-05-29 23:21               ` Emanuel Berg
@ 2017-05-30  6:01               ` Eli Zaretskii
  2017-05-30  9:32               ` Yuri Khan
  2 siblings, 0 replies; 31+ messages in thread
From: Eli Zaretskii @ 2017-05-30  6:01 UTC (permalink / raw)
  To: help-gnu-emacs

> From: Jean-Christophe Helary <jean.christophe.helary@gmail.com>
> Date: Tue, 30 May 2017 08:11:32 +0900
> Cc: Eli Zaretskii <eliz@gnu.org>,
>  "help-gnu-emacs@gnu.org" <help-gnu-emacs@gnu.org>
> 
> >> So isn't the above expected?  There are no function keys on a TTY,
> >> they generate either ASCII characters or sequences of ASCII
> >> characters.
> > 
> > The surprising thing in this particular case is that M-left behaves
> > differently from ESC left. That is possible on a GUI Emacs, but the
> > expectation is that Meta and ESC have the same effect.
> 
> Is there anything I can do about it ? It's confusing to use GUI emacs (on mac only ?) and not be able to access expected shortcuts out of the box.

I think you should report this to Org developers.



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

* Re: weird key bindings...
  2017-05-29 23:11             ` Jean-Christophe Helary
  2017-05-29 23:21               ` Emanuel Berg
  2017-05-30  6:01               ` Eli Zaretskii
@ 2017-05-30  9:32               ` Yuri Khan
  2017-05-30 12:02                 ` Jean-Christophe Helary
  2 siblings, 1 reply; 31+ messages in thread
From: Yuri Khan @ 2017-05-30  9:32 UTC (permalink / raw)
  To: Jean-Christophe Helary; +Cc: help-gnu-emacs@gnu.org

On Tue, May 30, 2017 at 6:11 AM, Jean-Christophe Helary
<jean.christophe.helary@gmail.com> wrote:

> Is there anything I can do about it ? It's confusing to use GUI emacs (on mac only ?) and not be able to access expected shortcuts out of the box.

What you can do immediately is add the bindings you want to your own
init file, e.g.:

(with-eval-after-load 'org
  (define-key org-mode-map (kbd "ESC <left>") 'org-metaleft))



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

* Re: weird key bindings...
  2017-05-30  9:32               ` Yuri Khan
@ 2017-05-30 12:02                 ` Jean-Christophe Helary
  2017-05-30 12:43                   ` Emanuel Berg
  0 siblings, 1 reply; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-30 12:02 UTC (permalink / raw)
  To: help-gnu-emacs@gnu.org


> On May 30, 2017, at 18:32, Yuri Khan <yuri.v.khan@gmail.com> wrote:
> 
> On Tue, May 30, 2017 at 6:11 AM, Jean-Christophe Helary
> <jean.christophe.helary@gmail.com> wrote:
> 
>> Is there anything I can do about it ? It's confusing to use GUI emacs (on mac only ?) and not be able to access expected shortcuts out of the box.
> 
> What you can do immediately is add the bindings you want to your own
> init file, e.g.:
> 
> (with-eval-after-load 'org
>  (define-key org-mode-map (kbd "ESC <left>") 'org-metaleft))

Thank you. That works, obviously.

But that also means that I need to identify all the bindings that don't work and change them one by one, which is not really practical. Until a fix is found I can work in -nw.

Jean-Christophe 


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

* Re: weird key bindings...
  2017-05-30 12:02                 ` Jean-Christophe Helary
@ 2017-05-30 12:43                   ` Emanuel Berg
  2017-05-30 12:54                     ` Jean-Christophe Helary
  0 siblings, 1 reply; 31+ messages in thread
From: Emanuel Berg @ 2017-05-30 12:43 UTC (permalink / raw)
  To: help-gnu-emacs

Jean-Christophe Helary wrote:

> But that also means that I need to identify
> all the bindings that don't work and change
> them one by one, which is not
> really practical.

... why not?

In my Elisp, I have 186 lines with `define-key'
in it!

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




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

* Re: weird key bindings...
  2017-05-30 12:43                   ` Emanuel Berg
@ 2017-05-30 12:54                     ` Jean-Christophe Helary
  2017-05-30 14:54                       ` Emanuel Berg
  0 siblings, 1 reply; 31+ messages in thread
From: Jean-Christophe Helary @ 2017-05-30 12:54 UTC (permalink / raw)
  To: help-gnu-emacs


> On May 30, 2017, at 21:43, Emanuel Berg <moasen@zoho.com> wrote:
> 
> Jean-Christophe Helary wrote:
> 
>> But that also means that I need to identify
>> all the bindings that don't work and change
>> them one by one, which is not
>> really practical.
> 
> ... why not?

1) it's only going to fix things on my machine
2) it ought to work

> In my Elisp, I have 186 lines with `define-key' in it!

How manu related to a bug that nobody was able to fix?

Jean-Christophe



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

* Re: weird key bindings...
  2017-05-30 12:54                     ` Jean-Christophe Helary
@ 2017-05-30 14:54                       ` Emanuel Berg
  0 siblings, 0 replies; 31+ messages in thread
From: Emanuel Berg @ 2017-05-30 14:54 UTC (permalink / raw)
  To: help-gnu-emacs

Jean-Christophe Helary wrote:

> 1) it's only going to fix things on my
>    machine

There is no contradiction between fixing
a problem locally on your machine while other
people hopefully tend to the general problem.
When and if it is done you can remove the local
fix if it bothers you.

> How manu related to a bug that nobody was
> able to fix?

Whose questions are you calling rhetorical?

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




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

end of thread, other threads:[~2017-05-30 14:54 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-05-28 14:54 weird key bindings Jean-Christophe Helary
2017-05-29  3:49 ` Jean-Christophe Helary
2017-05-29  5:54   ` Emanuel Berg
2017-05-29  6:24     ` Jean-Christophe Helary
2017-05-29  7:20       ` Emanuel Berg
     [not found]         ` <87inkkruwb.fsf-trKG1I58N/ZemkTcIkSAvQ@public.gmane.org>
2017-05-29  7:38           ` Jean-Christophe Helary
2017-05-29 15:34             ` Emanuel Berg
2017-05-29 14:37   ` Yuri Khan
2017-05-29 14:49     ` Jean-Christophe Helary
2017-05-29 15:21       ` Jean-Christophe Helary
2017-05-29 15:32         ` Jean-Christophe Helary
2017-05-29 15:48         ` Joost Kremers
2017-05-29 15:38       ` Yuri Khan
2017-05-29 16:02         ` Joost Kremers
2017-05-29 17:52         ` Eli Zaretskii
2017-05-29 19:31           ` Yuri Khan
2017-05-29 23:11             ` Jean-Christophe Helary
2017-05-29 23:21               ` Emanuel Berg
2017-05-29 23:29                 ` Jean-Christophe Helary
2017-05-30  1:09                   ` Emanuel Berg
2017-05-30  2:03                   ` Robert Thorpe
2017-05-30  2:17                     ` Jean-Christophe Helary
2017-05-30  2:39                       ` Emanuel Berg
2017-05-30  3:08                         ` Jean-Christophe Helary
2017-05-30  6:01               ` Eli Zaretskii
2017-05-30  9:32               ` Yuri Khan
2017-05-30 12:02                 ` Jean-Christophe Helary
2017-05-30 12:43                   ` Emanuel Berg
2017-05-30 12:54                     ` Jean-Christophe Helary
2017-05-30 14:54                       ` Emanuel Berg
2017-05-29 19:50         ` Emanuel Berg

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.