Emacs/elisp:全局设置键绑定对于Meta-down不生效.或-< up&gt ;? [英] Emacs/elisp: global-set-key bindings not taking effect for Meta-<down> or -<up>?

查看:92
本文介绍了Emacs/elisp:全局设置键绑定对于Meta-down不生效.或-< up&gt ;?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试将M-<up>M-<down>分别绑定到scroll-down-linescroll-up-line,如下所示: https: //stackoverflow.com/a/16229080/562139 .

I am trying to bind M-<up> and M-<down> to scroll-down-line and scroll-up-line respectively as indicated here: https://stackoverflow.com/a/16229080/562139.

这就是我的.emacs中的内容:

;; Key bindings
(global-set-key (kbd "M-g") 'goto-line)
;; Scroll line by line
(global-set-key (kbd "M-<down>") 'scroll-up-line)
(global-set-key (kbd "M-<up>") 'scroll-down-line)

问题: 滚动键绑定没有生效,而goto-line的滚动键绑定却有效.

Problem: The scroll key bindings are not taking effect, while the one for goto-line does.

但是,当我运行M-x scroll-down-line时,emacs会提示我并说

When I run M-x scroll-down-line however, emacs prompts me and says

您可以通过< M-down>运行命令"

"you can run the command with <M-down>"

注意: 当我直接在迷你缓冲区中运行global-set-key (kbd "M-<down>") 'scroll-up-line)(global-set-key (kbd "M-<up>") 'scroll-down-line)时,绑定生效!但是,当我做眼角操作时,似乎似乎已经注意到,按M-<up>键实际上会发送类似ESC ESC-<up>的信息.

Note: When I run global-set-key (kbd "M-<down>") 'scroll-up-line) or (global-set-key (kbd "M-<up>") 'scroll-down-line) directly in the mini-buffer, the bindings take effect! However, I seem to have noticed through the corner of my eye when I do the latter, that pressing M-<up> actually sends something like ESC ESC-<up>.

我被骗了.有什么作用?

I'm foxed. What gives?

注意:我正在终端上运行emacs 24.3(通过OSX上的iTerm,选项键映射到ESC +)通过SSH到RHEL5虚拟机.

Note: I am running emacs 24.3 in a terminal (via iTerm on OSX with Option key mapped to ESC+) over SSH to a RHEL5 virtual machine.)

更新

我遵循了此答案中的建议,并发现按M- 结果完全不同:

I followed the suggestion in this answer and found that pressing M-<up> results in something completely different:

ESC <up> (translated from ESC M-[ A) runs the command
scroll-down-line, which is an interactive compiled Lisp function.

It is bound to <M-up>, ESC <up>.

(scroll-down-line &optional ARG)

我将尝试将该键序列绑定到该函数并检查结果.

I'm going to try binding that key sequence to the function and check the result.

推荐答案

似乎键在翻译中丢失了.

Seems key got lost in translation.

以这种方式在openSuse处放置了forward-paragraph:

Planted a forward-paragraph at openSuse that way:

(global-set-key [(meta down)] 'forward-paragraph)

这篇关于Emacs/elisp:全局设置键绑定对于Meta-down不生效.或-&lt; up&gt ;?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆