justbur / emacs-which-key

Emacs package that displays available keybindings in popup
GNU General Public License v3.0
1.74k stars 87 forks source link

Error running timer which-key--update #311

Closed Randy1Burrell closed 3 years ago

Randy1Burrell commented 3 years ago

I'm getting this error after an update of which key today:

Error running timer ‘which-key--update’: (wrong-type-argument sequencep closure)

Here the output after I have toggle-debug-on-error turned on:

Debugger entered--Lisp error: (wrong-type-argument sequencep closure)
  #f(compiled-function (ev def) #<bytecode 0x1fe67d8123d9>)(50 (closure ((split-function . split-window-vertically) t) (&optional arg) "Split this window and switch to the new window unl..." (interactive "P") (funcall split-function) (let ((target-window (next-window))) (set-window-buffer target-window (other-buffer)) (if arg nil (select-window target-window)))))
  map-keymap(#f(compiled-function (ev def) #<bytecode 0x1fe67d8123d9>) Control-X-prefix)
  which-key--get-keymap-bindings-1((keymap #^[nil nil keymap 
#^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline-and-indent next-line sanityinc/open-line-with-reindent previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank sanityinc/maybe-suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] #^^[1 0 #^^[2 0 
#^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline-and-indent next-line sanityinc/open-line-with-reindent previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank sanityinc/maybe-suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (f12 . yankpad-expand) (f9 . yankpad-map) (C-S-down . windswap-down) (C-S-up . windswap-up) (C-S-right . windswap-right) (C-S-left . windswap-left) (escape . keyboard-escape-quit) (8388665 . emmet-next-edit-point) (8388664 . emmet-prev-edit-point) (C-return . emmet-expand-line) (f6 . recompile) (M-f12 . magit-status) (M-S-down . md-move-lines-down) (M-S-up . md-move-lines-up) (M-down . md-move-lines-down) (M-up . md-move-lines-up) (C-M-backspace . kill-back-to-indentation) (67108926 . mc/mark-next-like-this) (67108924 . mc/mark-previous-like-this) (67108923 . avy-goto-char-timer) (67108910 . set-mark-command) (S-return . sanityinc/newline-at-end-of-line) (s-return . sanityinc/newline-at-start-of-line) (f7 . sanityinc/split-window) (remap keymap (describe-key . helpful-key) (describe-command . helpful-command) (describe-variable . helpful-variable) (describe-function . helpful-function) (eval-expression . pp-eval-expression) (just-one-space . cycle-spacing) (backward-up-list . sanityinc/backward-up-sexp) (goto-line . goto-line-preview) (execute-extended-command . smex) (query-replace . anzu-query-replace) (query-replace-regexp . anzu-query-replace-regexp)) (triple-wheel-left . ignore) (triple-wheel-right . ignore) (double-wheel-left . ignore) (double-wheel-right . ignore) (mouse-5 closure (t) nil (interactive) (scroll-up 1)) (mouse-4 closure (t) nil (interactive) (scroll-down 1)) (67108907 . mc/mark-next-like-this) (8388700 . evilnc-comment-or-uncomment-lines) (8388722 closure (t) nil (interactive) (kill-this-buffer) (delete-window)) (8388657 closure (t) nil (interactive) (kill-this-buffer)) (8388706 . persp-counsel-switch-buffer) ...) (("C-x u" . "undo-tree-visualize") ("C-x r" . "prefix") ("C-x x" . "prefix")) [24] nil nil (self-insert-command ignore ignore-event company-ignore))
  which-key--get-keymap-bindings((keymap #^[nil nil keymap 
#^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline-and-indent next-line sanityinc/open-line-with-reindent previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank sanityinc/maybe-suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] #^^[1 0 #^^[2 0 
#^^[3 0 set-mark-command move-beginning-of-line backward-char mode-specific-command-prefix delete-char move-end-of-line forward-char keyboard-quit help-command indent-for-tab-command electric-newline-and-maybe-indent kill-line recenter-top-bottom newline-and-indent next-line sanityinc/open-line-with-reindent previous-line quoted-insert isearch-backward isearch-forward transpose-chars universal-argument scroll-up-command kill-region Control-X-prefix yank sanityinc/maybe-suspend-frame ESC-prefix toggle-input-method abort-recursive-edit nil undo self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command] self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command self-insert-command ...] (f12 . yankpad-expand) (f9 . yankpad-map) (C-S-down . windswap-down) (C-S-up . windswap-up) (C-S-right . windswap-right) (C-S-left . windswap-left) (escape . keyboard-escape-quit) (8388665 . emmet-next-edit-point) (8388664 . emmet-prev-edit-point) (C-return . emmet-expand-line) (f6 . recompile) (M-f12 . magit-status) (M-S-down . md-move-lines-down) (M-S-up . md-move-lines-up) (M-down . md-move-lines-down) (M-up . md-move-lines-up) (C-M-backspace . kill-back-to-indentation) (67108926 . mc/mark-next-like-this) (67108924 . mc/mark-previous-like-this) (67108923 . avy-goto-char-timer) (67108910 . set-mark-command) (S-return . sanityinc/newline-at-end-of-line) (s-return . sanityinc/newline-at-start-of-line) (f7 . sanityinc/split-window) (remap keymap (describe-key . helpful-key) (describe-command . helpful-command) (describe-variable . helpful-variable) (describe-function . helpful-function) (eval-expression . pp-eval-expression) (just-one-space . cycle-spacing) (backward-up-list . sanityinc/backward-up-sexp) (goto-line . goto-line-preview) (execute-extended-command . smex) (query-replace . anzu-query-replace) (query-replace-regexp . anzu-query-replace-regexp)) (triple-wheel-left . ignore) (triple-wheel-right . ignore) (double-wheel-left . ignore) (double-wheel-right . ignore) (mouse-5 closure (t) nil (interactive) (scroll-up 1)) (mouse-4 closure (t) nil (interactive) (scroll-down 1)) (67108907 . mc/mark-next-like-this) (8388700 . evilnc-comment-or-uncomment-lines) (8388722 closure (t) nil (interactive) (kill-this-buffer) (delete-window)) (8388657 closure (t) nil (interactive) (kill-this-buffer)) (8388706 . persp-counsel-switch-buffer) ...) (("C-x u" . "undo-tree-visualize") ("C-x r" . "prefix") ("C-x x" . "prefix")) [24] nil)
  which-key--get-current-bindings([24] nil)
  which-key--get-bindings([24] nil nil)
  which-key--create-buffer-and-show([24])
  which-key--update()
  apply(which-key--update nil)
  timer-event-handler([t 0 0 0 t which-key--update nil idle 0])

Can anyone help me fix this? Much appreciated.

justbur commented 3 years ago

Thanks, should be fixed with 7abe54f

Randy1Burrell commented 3 years ago

Hey @justbur, thanks for your speedy response. This still isn't fixed for me though, and it only happens whenever I invoke C-x.

Randy1Burrell commented 3 years ago

@justbur for context, here's my configuration for which-key:

(require-package 'which-key)
(add-hook 'after-init-hook 'which-key-mode)
(setq-default which-key-idle-delay 0)
(with-eval-after-load 'which-key
  (diminish 'which-key-mode))

I'm also running lsp-mode with which-key-integration

(use-package lsp-mode
  :commands (lsp lsp-deferred)
  :hook (lsp-mode . efs/lsp-mode-setup)
  :init
  (setq lsp-keymap-prefix "s-8"
        lsp-idle-delay 0.1
        lsp-headerline-breadcrumb-enable t)
  :config
  (lsp-enable-which-key-integration t))
justbur commented 3 years ago

Hm, I'm pretty sure I identified the problem. Are you sure you updated which-key?

Randy1Burrell commented 3 years ago

Yes, I'm pretty sure. These are the steps I took:

Still the same problem in each case.

justbur commented 3 years ago

ok, that seems like it should work. To be certain it's not an issue with an old version being loaded, can you clone this repo, execute M-x eval-buffer in the which-key.el file in the repo, and then see if you get the same error? If so, please post the backtrace again, so I can check to see if you're getting the same error or a new one. Thanks

Randy1Burrell commented 3 years ago

@justbur it works when I do what you suggested. So the error seems to be fixed that way, but not the best solution when it comes to auto-updates. Any suggestion(s) here?

image
justbur commented 3 years ago

It's hard to say exactly from what you've told me, but it seems that somehow you were stuck on the older version. Here are some possibilities:

  1. You updated from melpa before melpa grabbed the update from GitHub. I just checked that the current melpa version (not melpa-stable) is the correct one.
  2. The package was updated but not recompiled, so the old file was still being loaded.
  3. The package was not actually updated at all (seems unlikely).
  4. You're pulling from another repository that is not updating as frequently.
Randy1Burrell commented 3 years ago

The package did recompile so that's not it. It's unlikely that it wasn't updated because I looked into that. I'm pulling from Melpa so that's not it either. Maybe I updated from Melpa before they grabbed the update from Github. The current versioned date on the package I'm using right now is 20210622.1720, which is a few days ago, so I will try reinstalling and let you know.

image
Randy1Burrell commented 3 years ago

Yeah, it's working now

image

Thanks, @justbur for your help. Much appreciated.