Update `eaf-bind-key` to allow binding regular emacs commands

master
Clemens Radermacher 6 years ago
parent 915dc4cd5b
commit 9858e1e563
No known key found for this signature in database
GPG Key ID: ADEDCAC15E317EA0
  1. 19
      eaf.el

@ -681,15 +681,22 @@ Use it as (eaf-setq var val)"
(defmacro eaf-bind-key (command key eaf-app-keybinding)
"This function binds COMMAND to KEY in EAF-APP-KEYBINDING list.
COMMAND is a command with `eaf-proxy-' prefix found by calling
`eaf-describe-bindings' in an EAF buffer, but dropping the prefix.
Use this to bind keys for EAF applications.
KEY is a string representing a sequence of keystrokes and events.
COMMAND is a symbol of a regular Emacs command or a python app
command. You can see a list of available commands by calling
`eaf-describe-bindings' in an EAF buffer. The `eaf-proxy-' prefix
should be dropped for the COMMAND symbol.
EAF-APP-KEYBINDING is one of the eaf-.*-keybinding variables.
KEY is a string representing a sequence of keystrokes and events.
This is used to bind key to EAF Python applications."
`(map-put ,eaf-app-keybinding ,key ,(symbol-name command)))
EAF-APP-KEYBINDING is one of the `eaf-<app-name>-keybinding'
variables, where <app-name> can be obtained by checking the value
of `eaf--buffer-app-name' inside the EAF buffer."
`(map-put ,eaf-app-keybinding ,key
,(if (string-match "_" (symbol-name command))
(symbol-name command)
`(quote ,command))))
(defun eaf-focus-buffer (msg)
(let* ((coordinate-list (split-string msg ","))

Loading…
Cancel
Save