translate SPC to APPS in some modes only

Alan Schmitt alan.schmitt at
Thu Feb 11 09:56:37 CET 2016


I’m trying the following, to translate the space key to an apps key in
motion, normal, and visual modes:

#+begin_src emacs-lisp
(define-key input-decode-map (kbd "SPC")
  (lambda (prompt)
    (if (and (not (evil-operator-state-p))
             (or (evil-motion-state-p) (evil-normal-state-p) (evil-visual-state-p)))
        (kbd "<apps>")
      (kbd "SPC"))))

It works well, with one exception: the part that checks if the current
state is the operator state does not seem to work. For instance, if
I type r <SPC> in normal mode the current character is not replaced, and
I see in the minibuffer that further input is needed (apps is a prefix
key here).

Is this way to detect operator state incorrect?



OpenPGP Key ID : 040D0A3B4ED2E5C7
Monthly Athmospheric CO₂ (2016-01, Mauna Loa Obs.): 402.52
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 472 bytes
Desc: not available
Url : 

More information about the implementations-list mailing list