English 中文(简体)
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 mode I had some trouble with the preview it generated; I couldn t get it to insert the output it was previewing. I got around this with the following keybindings:

(global-set-key "M-
"  zencoding-expand-line)
(global-set-key "M-]"  zencoding-preview-accept)

However, what I d like to do is be able to hit M-RET again when the preview is open and have it insert the output.

My emacs-lisp-fu is extremely weak, however.

Is there a way I can test whether the preview is open and capture/bind another M-RET keypress?

问题回答

You can modify the key that does preview accept in this function at line 585 or so, like this:

(defvar zencoding-preview-keymap
  (let ((map (make-sparse-keymap)))
    (define-key map "M-
"  zencoding-preview-accept)
    (define-key map [(control ?g)]  zencoding-preview-abort)
    map))

You can also use the buffer specific key bindings instead of the global ones.





相关问题
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 ...

热门标签