syl20bnr / spacemacs

A community-driven Emacs distribution - The best editor is neither Emacs nor Vim, it's Emacs *and* Vim!
http://spacemacs.org
GNU General Public License v3.0
23.7k stars 4.9k forks source link

keyboard-layout bepo leads to error with helm and git-gutter+ #7264

Closed letheed closed 4 years ago

letheed commented 8 years ago

Description :octocat:

Emacs opens a Warning frame on startup saying Error (use-package): helm :config: Wrong type argument: keymapp, nil

Reproduction guide :beetle:

((auto-completion :variables auto-completion-enable-sort-by-usage t auto-completion-enable-snippets-in-popup t)
 better-defaults
 (c-c   :variables c-c  -enable-clang-support t)
 colors emacs-lisp emoji git
 (haskell :variables haskell-completion-backend 'intero)
 helm
 (keyboard-layout :variables kl-layout 'bepo)
 markdown rust
 (shell :variables shell-default-height 30 shell-default-position 'bottom)
 shell-scripts syntax-checking
 (version-control :variables version-control-diff-tool 'git-gutter version-control-global-margin t)
 yaml)
NJBS commented 8 years ago

Can you restart spacemacs using --debug-init and provide the backtrace it returns?

letheed commented 8 years ago

Here's the log: MSG.TXT

letheed commented 8 years ago

I just noticed that if version-control-diff-tool is set to git-gutter+, the warning is:

Error (use-package): git-gutter+ :init: Wrong type argument: keymapp, nil
Error (use-package): helm :config: Wrong type argument: keymapp, nil

git-gutter and diff-hl don't produce the first line. Is it a different bug or related?

NJBS commented 8 years ago

I'm not sure if it's related or not. All three options don't cause any errors for me. --debug-init should have caused a backtrace buffer to appear on the first error that it encountered while starting up. Did no such buffer appear for you during startup? Note that you can also use SPC t D to toggle debugging on errors after startup if you're able to consistently cause that error to appear (maybe see if it appears when SPC f e R is called for example).

Additionally, can you try commenting out any personal configuration in your .spacemacs file to help narrow down the error's origins?

letheed commented 8 years ago

After some more investigation, turns out (keyboard-layout :variables kl-layout 'bepo) is the culprit. Both errors go away if I disable the layer. The bepo layer used to work properly, so I didn't suspect it.

bersace commented 7 years ago

Any update on this ? I too hit this error messages since I activated keyboard-layout with bepo.

Debugger entered--Lisp error: (wrong-type-argument keymapp nil)
  lookup-key(nil "")
  (define-key map key1 (lookup-key map-original key2))
  (let ((key1 (kbd (car binding))) (key2 (kbd (cdr binding)))) (define-key map key1 (lookup-key map-original key2)))
  (while --dolist-tail-- (setq binding (car --dolist-tail--)) (let ((key1 (kbd (car binding))) (key2 (kbd (cdr binding)))) (define-key map key1 (lookup-key map-original key2))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- bindings) binding) (while --dolist-tail-- (setq binding (car --dolist-tail--)) (let ((key1 (kbd (car binding))) (key2 (kbd (cdr binding)))) (define-key map key1 (lookup-key map-original key2))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (let ((map-original (copy-tree map))) (let ((--dolist-tail-- bindings) binding) (while --dolist-tail-- (setq binding (car --dolist-tail--)) (let ((key1 (kbd (car binding))) (key2 (kbd (cdr binding)))) (define-key map key1 (lookup-key map-original key2))) (setq --dolist-tail-- (cdr --dolist-tail--)))))
  kl//remap-key-as(nil (("C-j" . "C-t") ("C-t" . "C-j") ("C-k" . "C-s") ("C-s" . "C-k")))
  (let ((bindings (mapcan (function kl//guess-rebindings) keys))) (kl//remap-key-as map (remove-if (function null) bindings)))
  kl/correct-keys(nil "C-j" "C-k")
  apply(kl/correct-keys nil ("C-j" "C-k"))
  kl/evil-correct-keys(insert (keymap (normal-state keymap (19 . comint-previous-input) (20 . comint-next-input) "Auxiliary keymap for Normal state" (10) (11)) (override-state . all) (menu-bar keymap (signals "Signals" keymap (break "BREAK" . comint-interrupt-subjob) (stop "STOP" . comint-stop-subjob) (cont "CONT" . comint-continue-subjob) (quit "QUIT" . comint-quit-subjob) (kill "KILL" . comint-kill-subjob) (eof "EOF" . comint-send-eof) "Signals") (inout "In/Out" keymap (expand-history "Expand History Before Point" . comint-replace-by-expanded-history) (list-history "List Input History" . comint-dynamic-list-input-ring) (previous-history "Previous Input" . comint-previous-input) (next-history "Next Input" . comint-next-input) (previous-matching-history-from-input "Previous Matching Current Input" . comint-previous-matching-input-from-input) (next-matching-history-from-input "Next Matching Current Input" . comint-next-matching-input-from-input) (previous-matching-history "Previous Matching Input..." . comint-previous-matching-input) (next-matching-history "Next Matching Input..." . comint-next-matching-input) (backward-matching-history "Backward Matching Input..." . comint-backward-matching-input) (forward-matching-history "Forward Matching Input..." . comint-forward-matching-input) (history-isearch-backward "Isearch Input String Backward..." . comint-history-isearch-backward) (history-isearch-backward-regexp "Isearch Input Regexp Backward..." . comint-history-isearch-backward-regexp) (copy-input "Copy Old Input" . comint-copy-old-input) (kill-input "Kill Current Input" . comint-kill-input) (show-output "Show Current Output Group" . comint-show-output) (show-maximum-output "Show Maximum Output" . comint-show-maximum-output) (previous-prompt "Backward Output Group" . comint-previous-prompt) (next-prompt "Forward Output Group" . comint-next-prompt) (write-output "Write Current Output Group to File" . comint-write-output) (append-output-to-file "Append Current Output Group to File" . comint-append-output-to-file) (delete-output "Delete Current Output Group" . comint-delete-output) "In/Out") (completion "Complete" keymap (complete "Complete at Point" . completion-at-point) (complete-file "Complete File Name" . comint-dynamic-complete-filename) (complete-listing "File Completion Listing" . comint-dynamic-list-filename-completions) (complete-expand "Expand File Name" . comint-replace-by-expanded-filename) "Complete")) (mouse-2 . comint-insert-input) (kp-delete . delete-forward-char) (delete . delete-forward-char) (4) (13 . comint-send-input) (3 keymap (46 . comint-insert-previous-argument) (19 . comint-write-output) (4 . comint-send-eof) (16 . comint-previous-prompt) (14 . comint-next-prompt) (12 . comint-dynamic-list-input-ring) (5 . comint-show-maximum-output) (18 . comint-show-output) (15 . comint-delete-output) (13 . comint-copy-old-input) (28 . comint-quit-subjob) (26 . comint-stop-subjob) (3 . comint-interrupt-subjob) (23 . backward-kill-word) (21 . comint-kill-input) (1 . comint-bol-or-process-mark) (24 . comint-get-next-from-history) (32 . comint-accumulate) (27 keymap (111 . comint-clear-buffer) (115 . comint-next-matching-input-from-input) (114 . comint-previous-matching-input-from-input))) (C-down . comint-next-input) (C-up . comint-previous-input) (27 keymap (12 . comint-show-output) (114 . comint-history-isearch-backward-regexp) (110 . comint-next-input) (112 . comint-previous-input))) "C-j" "C-k")
  eval((kl/evil-correct-keys (\` (\, m)) comint-mode-map "C-j" "C-k"))
  (while --dolist-tail-- (setq m (car --dolist-tail--)) (eval (quote (kl/evil-correct-keys (\` (\, m)) comint-mode-map "C-j" "C-k"))) (setq --dolist-tail-- (cdr --dolist-tail--)))
  (let ((--dolist-tail-- (quote (normal insert))) m) (while --dolist-tail-- (setq m (car --dolist-tail--)) (eval (quote (kl/evil-correct-keys (\` (\, m)) comint-mode-map "C-j" "C-k"))) (setq --dolist-tail-- (cdr --dolist-tail--))))
  (progn (when (fboundp (quote kl/pre-config-comint-mode)) (funcall (quote kl/pre-config-comint-mode))) (let ((--dolist-tail-- (quote (normal insert))) m) (while --dolist-tail-- (setq m (car --dolist-tail--)) (eval (quote (kl/evil-correct-keys (\` (\, m)) comint-mode-map "C-j" "C-k"))) (setq --dolist-tail-- (cdr --dolist-tail--)))) nil (when (fboundp (quote kl/post-config-comint-mode)) (funcall (quote kl/post-config-comint-mode))))
  (lambda nil (progn (when (fboundp (quote kl/pre-config-comint-mode)) (funcall (quote kl/pre-config-comint-mode))) (let ((--dolist-tail-- (quote (normal insert))) m) (while --dolist-tail-- (setq m (car --dolist-tail--)) (eval (quote (kl/evil-correct-keys (\` ...) comint-mode-map "C-j" "C-k"))) (setq --dolist-tail-- (cdr --dolist-tail--)))) nil (when (fboundp (quote kl/post-config-comint-mode)) (funcall (quote kl/post-config-comint-mode)))))()
  eval-after-load-helper("/usr/share/emacs/25.1/lisp/shell.elc")
  run-hook-with-args(eval-after-load-helper "/usr/share/emacs/25.1/lisp/shell.elc")
  do-after-load-evaluation("/usr/share/emacs/25.1/lisp/shell.elc")
  require(shell)
  byte-code("\302\303!\204
emacs18 commented 5 years ago

I would like to share a similar problem which may shed light on this issue as well.

https://github.com/emacs-helm/helm-org/issues/5 is regarding "wrong-type-argument keymapp" error while spacemacs starts up. This error is caused by the following line within helm-org-autoloads.el:

(easy-menu-add-item nil '("Tools" "Helm")  ...)

Spacemacs seems to activate all packages one by one in a loop before going onto other follow-on steps, i.e., all autoload files are loaded for all packages. It has activated helm package prior to activating helm-org package. However merely activating, i.e., loading helm autoload file, is not sufficient to define helm keymaps. It appears that one must also do (require 'helm-config) to define helm keymaps to be able to call easy-menu-add-item for helm-org. At least this is my understanding of helm-org issue number 5 whose url I shared before.

If there is a way to tell spacemacs that when we activate helm package, that we also must evaluate (require 'helm-config) prior to activating helm-org, then I think the helm-org issue can be resolved.

emacs18 commented 5 years ago

I submitted https://github.com/syl20bnr/spacemacs/pull/12713 to fix helm-org activation problem.

github-actions[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Please let us know if this issue is still valid!

emacs18 commented 4 years ago

This can be closed as far as I'm concerned. I have not noticed this issue in a long time.