Bind markdown-insert-list-item to M-RET rather than M-<return> #317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
tl;dr This is consistent with org-mode and tex-mode and fixes the binding for terminals.
Description
<return>
refers to the actual function key, which cannot be picked up by Emacs in a terminal. AFAIU this is because terminals translate function keys into character sequences before they tell the application what is going on. So:<return>
is translated into RET ≡\r
≡^M
M-<return>
is translated into M-RET ≡\E\r
≡^[^M
In graphical frames, Emacs knows that
<return>
was pressed, and translates it to RET if there is no binding specifically for<return>
; in terminals, Emacs has no idea that<return>
was pressed.As a side effect, this change also makes C-M-m insert new list items since C-m ≡ RET ≡ "control character 13".
(The first commit message provides additional
gory detailsexplanations)Related Issue
I did not raise an issue. Let me know if you feel this deserves more discussion; I will open one.
Type of Change
⚠ NITPICKING ⚠ Not sure about some checkboxes:
C-M-m
) count as a new feature?M-RET
.Checklist
<return>
in the documentation; I took a look at the guide and it actually mentionsM-RET
, so I guess everything works out?make test
).Originally, the test checked for
M-<return>
unconditionally:This does not pass when run with
make test
, though it does pass when run in a graphical Emacs:I am assuming this is because
--batch
does not load a window system; hence I added(when display-graphic-p …)
before testingM-<return>
.