reddit / emacs

evil problem with key sequence contain no complete binding

ntrysii · 2022-11-24 18:31
Hi guys, hope you all doing fine. I'm trying to make an operator in evil that does the following: 1. takes a motion for object to keep 2. takes another motion to delete so for example if i have a string with | as the cursor `"testing |with a string"` and i use the operator in it with `iw` then `i"` this would leave the string as `"with"` . the problem here is that I have some motion keys that are not standard evil motion keys those functions when used with this operator they produce this error **evil-extract-count: Key sequence contains no complete binding.** an example of the motion functions is: (evil-define-motion my-backward-sexp-or-pyblock ( count args) :jump nil :type 'word (if (eq major-mode 'python-mode) (if (python-info-end-of-block-p) (python-nav-backward-sexp count t t) (python-nav-backward-sexp count t) ) (sp-backward-sexp count) ) ) any ideas on how to solve this problem?
tom_dl · 2022-11-25 10:42
Can you share the code for your operator? It's difficult to diagnose without it. I'm guessing you'll need a double `<R>` or similar in your `interactive` call at least
ntrysii · 2022-11-25 22:05
Thanks for your answer, but i solved it by using a an operator and a function instead: the new code is : (evil-define-operator evil-keep-selected (beg end) :move-point nil :type word (buffer-substring-no-properties beg end) ) (defun evil-keep () (interactive ) (let (tmp) (setq tmp (call-interactively 'evil-keep-selected )) (call-interactively 'evil-delete ) (insert tmp) ) ) the other code i was doing `(evil-operator-range)` and then delete the region instead of `evil-delete` . this works fine with the the motion keys, raises the same error when trying to bind the operator key to a key-chord.