emacsorphanage / key-chord

Map pairs of simultaneously pressed keys to commands
http://emacswiki.org/emacs/download/key-chord.el
115 stars 23 forks source link

reponse slow on emacs 29 #7

Closed sawyerzheng closed 1 year ago

sawyerzheng commented 1 year ago

on emacs 29, key-chord calls comand will delay about one second, however normal key bindings like define-key has no delay.

Flinner commented 1 year ago

happens to me too :(

choltz commented 1 year ago

Same on Emacs 28.2

rmolinari commented 1 year ago

I also see this on 29.1, but it was fine for me on 28.2.

Actually, I also see the slowness when I go back to 28.2. My guess is that an update to some other package is causing this. I will see if I can find out more.

I'm on a Mac using the railwaycat port of Emacs

rthewitt commented 1 year ago

The slowdown occurred for me without updating Emacs or the package itself. I deleted (and backed up) my .emacs.d directory when updating other packages. Afterward I found my key-chords very slow even though a diff showed that the package contents had not changed at all. Same version, same files.

I'm on Emacs 29.0.60

For me the solution was to customize the variables

key-chord-two-keys-delay and key-chord-safety-interval-forward. It was the latter that was causing the delay.

I use key-chord to remap ESC in Evil mode. Here is my use-package config as an example. Hopefully it helps someone.

(use-package key-chord
  :after evil
  :custom
  (key-chord-two-keys-delay 0.05)
  (key-chord-safety-interval-forward 0.1)
  :config
  (key-chord-mode 1)
  (key-chord-define evil-insert-state-map  "jk" 'evil-normal-state)
  (key-chord-define evil-replace-state-map  "jk" 'evil-normal-state))
Flinner commented 1 year ago

Thanks @rthewitt , I can confirm it solves my issue. Was an annoying two weeks without key-chord

sawyerzheng commented 1 year ago

It's also works for me on emacs 29.1.50. Thank you @rthewitt .

tarsius commented 8 months ago

I've reverted the commit that caused this.