I'm trying to be able to draw ascii art in emacs picture-mode
by moving left, down, up, and right with the j,h,k,l
keys in evil-normal-mode
.
To do this I used these bindings:
(nmap :keymaps 'picture-mode-map
"k" (lambda ()
(picture-movement-up)
(picture-self-insert (string-to-char ".")))
"j" (lambda ()
(picture-movement-down)
(picture-self-insert (string-to-char ".")))
"h" (lambda ()
(picture-movement-left)
(picture-self-insert (string-to-char ".")))
"l" (lambda ()
(picture-movement-right)
(picture-self-insert (string-to-char "."))))
What I expect is a single insertion of the .
and for the motion to be changed with the corresponding picture-movement
function.
However when I tried out these bindings the direction of text being inserted was right but 46 characters were inserted at once. And the character was they key I pressed, not the period.
For example when I pressed l
I'd get llllllllllllllllllllllllllllllllllllllllllllll
immediately instead of just a gradual succession of periods as I continued presssing l
.
Why am I getting this behavior and how could I achieve my expected behavior?