Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possible regression when calling evil-collection-*-setup #750

Open
gagbo opened this issue Aug 31, 2023 · 5 comments
Open

Possible regression when calling evil-collection-*-setup #750

gagbo opened this issue Aug 31, 2023 · 5 comments

Comments

@gagbo
Copy link
Contributor

gagbo commented Aug 31, 2023

It seems that de0b62b brought a regression

I triggered this by requiring 'profiler, which in turn triggered the evil-collection-setup call, which then triggered either the key definition hook or just the normal setup?

This error gets triggered by anything that's handled by evil-collection it seems.

Debugger entered--Lisp error: (cl-no-applicable-method seq-empty-p (normal))
  signal(cl-no-applicable-method (seq-empty-p (normal)))
  cl-no-applicable-method(#s(cl--generic :name seq-empty-p :dispatches nil :method-table nil :options nil) (normal))
  apply(cl-no-applicable-method #s(cl--generic :name seq-empty-p :dispatches nil :method-table nil :options nil) (normal))
  seq-empty-p((normal))
  seq-reduce(#f(compiled-function (acc elt) #<bytecode -0x542a0d6d15ae114>) (normal) nil)
  seq-difference((normal) nil)
  evil-collection--filter-states(normal)
  evil-collection-define-key(normal profiler-report-mode-map " " scroll-up-command [33554464] scroll-down-command [delete] scroll-down-command "j" profiler-report-next-entry "k" profiler-report-previous-entry [tab] profiler-report-toggle-entry "o" profiler-report-ascending-sort "O" profiler-report-descending-sort "c" profiler-report-render-calltree "C" profiler-report-render-reversed-calltree "i" profiler-report-describe-entry "=" profiler-report-compare-profile "\15" profiler-report-find-entry "gr" revert-buffer "q" quit-window "ZQ" evil-quit "ZZ" quit-windw)
  evil-collection-profiler-setup()
  #f(compiled-function () #<bytecode 0x88847b3ea7f1ffb>)()
  eval-after-load(profiler #f(compiled-function () #<bytecode 0x88847b3ea7f1ffb>))
  evil-collection-init((profiler))

In any case, I don't have the issue anymore when I check out 1ad283f so I assume it's a quoting issue in the change to evil-collection-translate-minor-mode-key ? Couldn't dig more into that, I'm just sticking to a commit that works for now.

@jojojames
Copy link
Collaborator

Was there a need for de0b62b @condy0919 ?

Might be worth reverting if it was just a code cleanup-esque change.

@condy0919
Copy link
Collaborator

Was there a need for de0b62b @condy0919 ?

Might be worth reverting if it was just a code cleanup-esque change.

Sorry, my computer is broken on Sept 15. Could you help fix that? The change is to make CI happy as evil-delay is marked obsolete and CI always complains.

@gagbo
Copy link
Contributor Author

gagbo commented Sep 16, 2023

I suppose the issue is on the quoting of the condition somehow? I struggle a bit to see how this commit could be the issue, but so far, reverting to a commit before that seemed to fix my issues.

@condy0919
Copy link
Collaborator

Could you provide a reproducible recipe? I'm using Emacs 30, the latest evil and evil-collection without errors.

@gagbo
Copy link
Contributor Author

gagbo commented Sep 17, 2023

Do you have a setup-hook for evil-collection? It's a bit hard to provide a 100% reproducible recipe because there are a lot of things that can trigger this regression, but maybe just having

(defun layout-foo-rotate-keymaps (_mode mode-keymaps &rest _rest)
  "A setup hook"
    (evil-collection-translate-key '(normal motion visual operator) mode-keymaps
      "p" "h"
      (kbd "C-p") (kbd "C-h")
      :destructive nil))

(add-hook 'evil-collection-setup-hook #'layout-foo-rotate-keymaps)

In your initialization code (+ maybe loading dired) could trigger a void-variable dired-filter-map-mode error – as long as you don't have dired-hacks installed.

It's pretty hard to find a good repro for this because I rely on this setup-hook and translate-key/translate-minor-key in a lot of code; and it seems that the error only triggers if some specific "which packages are already loaded?" conditions that I didn't really investigate too much. At least the PR seems to calm everything down, and removes the deprecation warning by backporting the backwards-compatible macro. Maybe the problem is that all the hook functions in evil-with-delay all share the same name, so that anytime one keymapp condition is true, all the hooks for every package trigger? I don't know, just played with macroexpand-step to understand that something's wrong with the evil-with-delay version, and sticking to evil-delay seems to fix my issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants