branch: elpa/guru-mode commit 3d532767888f40b6a13fcd62f649c9f6311dcf2d Author: Bozhidar Batsov <bozhi...@batsov.com> Commit: Bozhidar Batsov <bozhi...@batsov.com>
[Fix #7] Don't initialize the keymap at load time --- guru-mode.el | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/guru-mode.el b/guru-mode.el index 3553068..22ebebf 100644 --- a/guru-mode.el +++ b/guru-mode.el @@ -86,19 +86,23 @@ ;; use it without interference. (call-interactively current-binding))))) -(dolist (cell guru-affected-bindings-list) +(defun guru-init () + "Initialize the guru keybindings." + (dolist (cell guru-affected-bindings-list) (let ((original-key (car cell)) (recommended-key (car (cdr cell))) (original-binding (car (cdr (cdr cell))))) (define-key guru-mode-map - (read-kbd-macro (car cell)) (guru-rebind original-key recommended-key original-binding)))) + (read-kbd-macro (car cell)) (guru-rebind original-key recommended-key original-binding))))) ;;;###autoload (define-minor-mode guru-mode "A minor mode that teaches you to use Emacs effectively." :lighter " guru" :keymap guru-mode-map - :group 'guru) + :group 'guru + (when guru-mode + (guru-init))) ;; define global minor mode ;;;###autoload