超级键绑定在emacs [英] Super key binding in emacs

查看:164
本文介绍了超级键绑定在emacs的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

(global-set-key (kbd "<s-d>") 'duplicate-line)

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ECB MODE;;;;;;;;;;;;;;;;;;;;;
(global-set-key (kbd "<s-left>") 'ecb-goto-window-methods)
(global-set-key (kbd "<s-right>") 'ecb-goto-window-edit1)
(global-set-key (kbd "<s-down>") 'ecb-goto-window-history)
(global-set-key (kbd "<s-up>") 'ecb-goto-window-sources)
(global-set-key (kbd "<s-home>") 'ecb-goto-window-directories)

这是我的.emacs文件的一部分。绑定包含超级键的组合键时,我面临着一个奇怪的问题。每当我将函数绑定到超级键+< alphanumberic value> 时,它拒绝工作。

在上述文件中,所有绑定除< s-d> 正常工作。

我在fedora 13上使用emacs 24.3

This is part of my .emacs file. I am facing a strange problem while binding a key combination containing super key. Whenever I bind a function to super-key + <alphanumberic value> it refuses to work.
In the above file all the bindings except <s-d> are working fine.
I am using emacs 24.3 on fedora 13

推荐答案

kbd 宏的原因很方便,您传递的参数与Emacs告诉您的是一样的询问一个关键的绑定。您在参数中猜测,但您不需要这样做。

The reason the kbd macro is so convenient is that the argument you pass it is exactly the same thing that Emacs tells you when you ask about a key binding. You're guessing at the argument, but you never need to do that.

当您键入 Ch < kbd> k (或 Ch c ),然后关键序列,Emacs将显示描述绑定的消息。在这种情况下,它会将超级键+ d描述为 sd

When you type C-hk (or C-hc) and then the key sequence in question, Emacs will display a message describing that binding. In this instance it will describe super-key + d as s-d.

因此,您可以使用(kbdsd)来引用它。

Therefore you can use (kbd "s-d") to refer to it.


  • 请求Emacs来描述一个关键序列

  • 将答案插入 kbd

  • Ask Emacs to describe a key sequence
  • Plug the answer into kbd

这篇关于超级键绑定在emacs的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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