Re: [O] emacs vs emacs -nw

2017-05-31 Thread Yuri Khan
On Wed, May 31, 2017 at 5:41 PM, Jean-Christophe Helary
 wrote:

> FN-left in a level 2 header in org mode triggers beginning-of-buffer and 
> *not* org-promote-header.

The Fn key is a whole different issue. It’s likely that your system is
reporting a Home key code when you press Fn+Left.



Re: [O] emacs vs emacs -nw

2017-05-31 Thread Jean-Christophe Helary

> On May 31, 2017, at 20:30, Eli Zaretskii  wrote:
> 
>> From: Jean-Christophe Helary 
>> Date: Wed, 31 May 2017 19:41:00 +0900
>> Cc: Org-mode 
>> 
>> Ok, I just tried something else:
>> 
>> (setq  ns-function-modifier 'meta) and what I get is *very* similar to the 
>> issue I have with ESC:
>> 
>> FN-x correctly "calls" M-x
>> FN-left in a level 2 header in org mode triggers beginning-of-buffer and 
>> *not* org-promote-header.
>> 
>> So the problem is not limited to ESC, and maybe not limited to org-mode.
> 
> AFAIR, the remapping of Meta-something to ESC-something happens
> automatically only for characters, not for function keys.  For
> function keys, this remapping must be set somewhere, or it won't
> happen.  You can see in bindings.el how some of these remappings are
> set up.

Yes, I realized after Yuri's comment that the comparison with ESC was a bit 
far-fetched.

Jean-Christophe 


Re: [O] emacs vs emacs -nw

2017-05-31 Thread Eli Zaretskii
> From: Jean-Christophe Helary 
> Date: Wed, 31 May 2017 19:41:00 +0900
> Cc: Org-mode 
> 
> Ok, I just tried something else:
> 
> (setq  ns-function-modifier 'meta) and what I get is *very* similar to the 
> issue I have with ESC:
> 
> FN-x correctly "calls" M-x
> FN-left in a level 2 header in org mode triggers beginning-of-buffer and 
> *not* org-promote-header.
> 
> So the problem is not limited to ESC, and maybe not limited to org-mode.

AFAIR, the remapping of Meta-something to ESC-something happens
automatically only for characters, not for function keys.  For
function keys, this remapping must be set somewhere, or it won't
happen.  You can see in bindings.el how some of these remappings are
set up.



Re: [O] emacs vs emacs -nw

2017-05-31 Thread Eric S Fraga
On Wednesday, 31 May 2017 at 10:04, Jean-Christophe Helary wrote:

[...]

> And I get the expected behavior in GUI emacs. So it's really an issue
> about ESC that is not recognized in GUI mode for *some* bindings in
> org-mode.

I can actually confirm this on quite recent org (as well as 8.2.10 as
bundled with emacs 26.x) on Linux as well.

Comparing Alt-left with the ESC key followed by left arrow gives this
using C-h c:

:  runs the command org-metaleft
: ESC  (translated from  ) runs the command backward-word

with emacs -Q in GUI mode.  Have not tried terminal mode.

As Jean-Christophe has said, this seems to be independent of the window
manager.  For completeness, I am using ratpoison.

-- 
: Eric S Fraga (0xFFFCF67D), Emacs 26.0.50, Org release_9.0.6-425-gf4fca1


signature.asc
Description: PGP signature


Re: [O] emacs vs emacs -nw

2017-05-31 Thread Jean-Christophe Helary

> On May 31, 2017, at 19:04, Jean-Christophe Helary 
>  wrote:

>> On X11/GNU/Linux, I get header promotion with Alt+Left but word
>> navigation on Esc Left.
> 
> Now that I think about it, I just tried this:
> 
> (setq  ns-right-command-modifier 'meta)
> 
> And I get the expected behavior in GUI emacs. So it's really an issue about 
> ESC that is not recognized in GUI mode for *some* bindings in org-mode.

Ok, I just tried something else:

(setq  ns-function-modifier 'meta) and what I get is *very* similar to the 
issue I have with ESC:

FN-x correctly "calls" M-x
FN-left in a level 2 header in org mode triggers beginning-of-buffer and *not* 
org-promote-header.

So the problem is not limited to ESC, and maybe not limited to org-mode.

Jean-Christophe



Re: [O] emacs vs emacs -nw

2017-05-31 Thread Jean-Christophe Helary

> On May 31, 2017, at 18:41, Yuri Khan  wrote:
> 
> On Wed, May 31, 2017 at 3:58 PM, Jean-Christophe Helary
>  wrote:
> 
>>> Could you provide an example and/or a recipe to demonstrate the issue?
>> 
>> • Open an org file with a few headers and different header levels.
>> • Select a lower level header
>> • Hit M-left
> 
> I believe this last step may be a bit unclear and misleading. Today,
> Meta is not a real key. You only get it via emulation from ESC or a
> modifier key, normally Alt on PCs. I don’t know the convention on Mac.

Ooops, you're right. Indeed.

On my machine I *systematically* use ESC for META.

> On X11/GNU/Linux, I get header promotion with Alt+Left but word
> navigation on Esc Left.

Now that I think about it, I just tried this:

(setq  ns-right-command-modifier 'meta)

And I get the expected behavior in GUI emacs. So it's really an issue about ESC 
that is not recognized in GUI mode for *some* bindings in org-mode.

Jean-Christophe 

> 
>> Expected result:
>> • the header is promoted
>> 
>> Result in GUI Emacs (Aquamacs too)
>> • The cursor jumps to the beginning of the previous word