I'm having a hell of a time with getting Org Mode's key bindings to work.
I thought that maybe the difficulties I was having had to do with what this page describes, since I was using Emacs text-mode via Terminal.app
(on a Mac).
So I decided to try Emacs for Mac, which (presumably) I could use as a free-standing application, thereby circumventing whatever problems Terminal.app
may be causing.
But it turns out that, with Emacs for Mac I can type even fewer Org Mode key-bound commands!
(In this post, I will abbreviate Emacs for Mac as McE, and Emacs via Terminal.app
as TME, short for "text-mode Emacs".)
Let me start with the case of <M-right>
, by way of example.
According to describe-bindings
(C-h b
) for Org Mode, <M-right>
should be bound to org-metaright
. This is not terribly informative, but the documentation for org-metaright
says:
org-metaright is an interactive compiled Lisp function in `org.el'.
(org-metaright &optional ARG)
Demote a subtree, a list item or move table column to right. In front of a drawer or a block keyword, indent it correctly. With no specific context, calls the Emacs default `forward-word'. See the individual commands for more information.
Now, suppose that org-mode
is the buffer's major mode, point is at a subtree's heading, and I type the key sequence I'd use for <M-right>
, namely, esc followed by →.
If I do this in TME, the subtree is demoted, exactly as the documentation says, but if I do it in McE, all I get is that point advances forward by one word.
Indeed, in McE, if I type the same sequence (esc , →) into describe-key
(C-h k
), I don't get the documentation for org-metaright
, but rather the one for forward-word
:
ESC <right> (translated from <escape> <right>) runs the command forward-word, which is an interactive built-in function in `C source code'.
It is bound to M-f, ESC <right>.
(forward-word &optional ARG)
Move point forward ARG words (backward if ARG is negative). If ARG is omitted or nil, move point forward one word. Normally returns t. If an edge of the buffer or a field boundary is reached, point is left there and the function returns nil. Field boundaries are not noticed if `inhibit-field-text-motion' is non-nil.
It gets worse.
<M-right>
at least works correctly in TME, but <M-S-right>
I can't get to work anywhere.
According to describe-bindings
, <M-S-right>
is supposed to be bound to (you guessed it) org-shiftmetaright
. In McE, however, if I type into describe-key
the sequence for <M-S-right>
(namely, esc, shift + →, where I'm pressing the last two keys simultaneously), I again get the docs for forward-word
pretty much as shown earlier, except for a small change in the first line:
ESC <right> (translated from <escape> <S-right>) runs the command forward-word, which is an interactive built-in function in `C source code'.
...
The silver lining is the mention of <escape> <S-right> in this first line, because it shows that McE is at least detecting the shift press (which is the reason I bothered to install McE in the first place). Unfortunately, it is discarding that piece information, and mistranslating what's left (after all ESC <right> should be bound to org-metaright
, not to forward-word
).
Doing the same thing in TME produces:
ESC <right> (translated from ESC M-O C) runs the command
org-metaright, which is an interactive compiled Lisp function in `org.el'.It is bound to <M-right>, ESC <right>, C-c C-x r, <menu-bar> <Org>
<Edit Structure> <Demote Heading>, <menu-bar> <Tbl> <Column> <Move
Column Right>.(org-metaright &optional ARG)
Demote a subtree, a list item or move table column to right. In front of a drawer or a block keyword, indent it correctly. With no specific context, calls the Emacs default `forward-word'. See the individual commands for more information.
...which sounds a bit better (it's the documentation for some Org Mode command at least!), but it seems that the shift is not getting through at all. I can't figure out what the M-O C
in the first line is referring to.
What can I do to get these key bindings to work properly?