如何在终端中将 S-RET 发送到 Emacs?
在org-mode
中,按MS-RET
(meta-shift-return)将在新行上创建一个新的TODO
。此按键序列通过我的终端将 M-RET
发送到 emacs。我已经用 Ch c ESC-S-RET 进行了检查,它在迷你缓冲区中返回 M-RET is undefined 。
我正在使用 Snow Leopard 和在 Terminal.app 中运行的 Emacs 23.2.1。终端键盘首选项中没有定义 RET 序列的选项。
知道是什么原因导致 SHIFT
缺失吗?解决方法?
In org-mode
, pressing M-S-RET
(meta-shift-return) will create a new TODO
on a new line. This key sequence sends M-RET
to emacs through my terminal. I've checked this with C-h c ESC-S-RET
, which returns M-RET is undefined
in the mini-buffer.
I'm using Snow Leopard with Emacs 23.2.1 running in Terminal.app. There is no option to define a RET
sequence in the terminal keyboard preferences.
Any idea what's causing the missing SHIFT
? Workarounds?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
您可以让 Emacs 假装它使用
Cx @ S RET
(注意大写的S
)获得了S-RET
。这也适用于添加 control、meta、alt、hyper 或 super 修饰符;输入
Cx @ Ch
以获取绑定列表。 Emacs 手册中的修饰键部分提到这也是。You can get Emacs to pretend that it got
S-RET
withC-x @ S RET
(note uppercaseS
).This also works for adding control, meta, alt, hyper or super modifiers; type
C-x @ C-h
for the list of bindings. The Modifier Keys section in the Emacs manual mentions this as well.一般来说,大量击键根本不可能通过终端发送,因为终端模拟旧协议,只允许 256 个单独的按键(或者可能只允许 128 个)。
有可能,当您按 S-RET 时,Terminal.app 所做的事情完全与您按 RET 时相同。因此 Emacs 无法区分这两种情况。
In general, lots of keystrokes are simply impossible to send via a terminal, since terminals emulate an old protocol that only allowed 256 separate keys (or maybe only 128).
Chances are, when you press S-RET, Terminal.app does exactly the same thing as if you'd pressed RET. Thus Emacs has no way to distinguish those two cases.
交叉链接到其他问答:
如果您使用 xterm,则
modifyOtherKeys
选项可能会促进该绑定。有关详细信息,请参阅以下内容:发送 " C-(" 到 VT100/xterm 终端(Mac OS X 的终端)中的 Emacs?
我怀疑 Emacs 默认情况下会识别这些代码,但如果不能识别,也请参阅
input-decode-map
作为此处描述: 绑定 M-< Emacs 23.1.1 中的向上> / M-<向下>Cross-linking to other Q&As:
If you are using an xterm, then the
modifyOtherKeys
option may facilitate that binding. See the following for details:Send "C-(" to Emacs in VT100/xterm terminal (Mac OS X's Terminal)?
I suspect Emacs recognises those codes by default, but if not then also see
input-decode-map
as described here: Binding M-<up> / M-<down> in Emacs 23.1.1请在此处查看 TTY 的说明和替代快捷方式。
其中一些在 Ubuntu Linux 的终端(本地和通过 SSH)中对我有用,但并非所有这些似乎都能工作。例如,为
S-RET
提供的替代方案(我希望运行org-table-copy-down
)似乎运行org-clone-subtree -with-time-shift 由于某种原因。然而,我发现替代品列表很有用,特别是那些带有
M-
前缀的替代品。例如,ESC UP
用于M-UP
在表格中移动文本。See explanation and alternative shortcuts for TTY here.
Some of these have worked for me in a terminal in Ubuntu Linux (both locally and over SSH), but not all of them seem to work. For example, the alternative provided for
S-RET
(which I expected to runorg-table-copy-down
) instead seems to runorg-clone-subtree-with-time-shift
for some reason. However, I have found the list of alternatives useful, particularly those with theM-
prefix. For exampleESC UP
forM-UP
to move text around in tables.尽管需要按很多额外的按键,但事实证明 org-mode 有一个替代方案:
Cc Cxm
即
Cc Cx M
https: //orgmode.org/manual/TTY-Keys.html#TTY-keys
Though it's a lot of extra key presses, it turns out that
org-mode
has an alternative:C-c C-x <shift> m
i.e.
C-c C-x M
https://orgmode.org/manual/TTY-Keys.html#TTY-keys