English 中文(简体)
为什么搁置不发挥作用(我期望它这样做)?
原标题:Why does the elisp function not work (as I expect it to)?

我想写出一些东西,把 em的一个窗户移回,并装上<条码>C-x。 S-o

(global-set-key [C-x S-o]  (other-window -1))

当我装满一ema时,便会发生某种中断,我的所有滚动条条条形(以前为残疾)和<代码>C-x S-O完全作为C-x o的功能。

A fix would be nice, but I d also be grateful for an explanation of why it doesn t work.

最佳回答

你们会把主要病媒混为一谈,我认为你必须使用单一功能名称来做这项工作,没有任何理由:

(global-set-key "C-xO"  my-other-window)

(defun my-other-window ()
  (interactive)
  (other-window -1)
  )

manual

(info "(emacs)Init Rebinding")
问题回答

您可以直接引用<条码>中“全球关键中的参数”。 它希望:

(global-set-key [C-x S-o] (lambda() (interactive) (other-window -1)))

以匿名互动方式总结你想要的职能。

贵国法典有两个问题:

  1. You need interactive in the form which you re binding to a key (it s also worth reading the wiki)
  2. It s a good idea to use kbd to read in the key binding you want,
    e.g. (global-set-key (kbd "C-x O") ...)




相关问题
Lisp code called from Java

Long story: I am doing a project for my functional programing class, and I thought of writing an AI controller in Lisp, for the Mario AI competition. I was looking over frameworks/libraries/ways of ...

Emacs, Zen-Coding mode, and Putty

I use emacs via Putty and since Putty doesn t send certain key combinations to the remote console I generally need to re-bind them to other key combinations. After installing the amazing Zen-Coding ...

In Which Cases Is Better To Use Clojure? [closed]

I develop in Lisp and in Scheme, but I was reading about Clojure and then I want to know, in which cases is better to use it than using Lisp or Scheme? Thanks

lambda-gtk negative pointer

I was trying to write my own put-pixel on (Gdk) pixbuf in Lisp. When I finally realized how I can operate on C pointers in CL, new obstacle came along - (gdk:pixbuf-get-pixels pb) returns me negative ...

Is there a common lisp package naming convention?

I have created some of my own user packages and have run into a name clash. In Java, the naming convention is to use your domain name in the package name: e.g. import com.example.somepackage;. Are ...

SOAP request from within an AutoLISP/AutoCAD macro

We have built a webservice for a client that uses AutoCAD. They have a macro that runs in AutoCAD that builds a SOAP request. But they have not figured out how to actually send() the soap request to ...

热门标签