mrkkrp / modalka

Modal editing your way
280 stars 18 forks source link

repeat functionality seems broken #12

Closed sriramkswamy closed 7 years ago

sriramkswamy commented 7 years ago

I have bound the Emacs repeat function to .. Whenever I try to press . more than once, I get Lisp nesting exceeds ‘max-lisp-eval-depth’

mrkkrp commented 7 years ago

I can't reproduce that. Here is how I set up the repeat command:

(define-key modalka-mode-map (kbd ".") #'repeat)

After that if I execute some command and press ., it's repeated. I can press it repeatedly and no problem whatsoever occurs.

sriramkswamy commented 7 years ago

I see. I just bind it to the already existing default Emacs binding.

(modalka-define-kbd "." "C-x z")

Is this not the right thing to do?

mrkkrp commented 7 years ago

Well what is happening in this case is perhaps that Modalka executes that repeat command, but the repeat command does not regard previous command executed as itself (because of wrappings) so next time it thinks “OK, previous command wasn't me, I can repeat it safely then”, and it tries to repeat the previous command that in turn tries to repeat command just before it, etc., sending Emacs into an infinite loop. I didn't check this though and I'm using a number of commands that check this “previous command” variable without problems. No time to dig deeply into this unless it really breaks something.

Please use the method I showed in this case :-)

sriramkswamy commented 7 years ago

Oh, I see. I understand. I'll close this issue, thanks.