Emacs, Zen Encoding Mode and Putty

I use emacs via Putty, and since Putty does not send certain keyboard shortcuts to the remote console, I usually need to re-bind them to other keyboard shortcuts.

After installing the amazing Zen-Coding mode , I had problems with the preview that it generated; I could not get him to insert the output that he was looking at. I went around this with the following keywords:

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

However, what I would like to do will be able to click again M-RETwhen the preview is open, and add it.

My emacs-lisp -fu is extremely weak.

Is there a way to check if the preview is open and capture / link another click M-RET?

+3
source share
2 answers

You can change the key that accepts the preview in this function on line 585 or so, for example:

(defvar zencoding-preview-keymap
  (let ((map (make-sparse-keymap)))
    (define-key map "\M-\r" 'zencoding-preview-accept)
    (define-key map [(control ?g)] 'zencoding-preview-abort)
    map))
+2
source

You can also use specific buffer bindings, not global ones.

0
source

Source: https://habr.com/ru/post/1724083/


All Articles