Error when reassigning the ESC key in isearch-mode of Emacs

53 Views Asked by At

I follow the instruction of god-mode in Emacs to reassign the ESC key for isearch-mode-map and god-mode-isearch-map but encounter the following error

error: Key sequence <escape> <tab> starts with non-prefix key <escape>

The relevant code in my Emacs init file is:

 (require 'god-mode-isearch)
 (define-key isearch-mode-map (kbd "<escape>") 'god-mode-isearch-activate)
 (define-key god-mode-isearch-map (kbd "<escape>") 'god-mode-isearch-disable)

The problem comes from the second line (define-key isearch-mode-map (kbd "<escape>") 'god-mode-isearch-activate). If this line is commented out, then no error is reported, but I cannot reassign the <escape> key of the isearch-mode

I did try to Google as well as to un-set the <escape> key but haven't been able to resolve it.

Is there anybody know how to fix it?

Thanks for taking your time to look at my question!

0

There are 0 best solutions below