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.65k stars 4.89k forks source link

Potential clash in `avy` when package in dotspacemacs-additional-packages depends on it #3729

Closed vkz closed 4 years ago

vkz commented 8 years ago

Adding lispy.el to dotspacemacs-additional-packages results in a weird bug related to avy commands. Since there may potentially be an issue with how dependencies play out for something you install as dotspacemacs-additional-packages I'm raising this issue for someone to review and decide there's something for Spacemacs folk to consider.

Here's the issue as reported in the lispy repo: https://github.com/abo-abo/lispy/issues/139

nixmaniack commented 8 years ago

I hit this issue after updating packages, but didn't know if it was my configuration even though I don't have any lispy specific configs. I can't reproduce consistently though. I also faced hydra bug and had to require it before lispy started working again then this Args out of range error kept popping up inconsistently.

ghost commented 8 years ago

I have a seemingly different issue, that might be the same thing:

Trying to execute M-x lispy-mode I get the error:

autoload-do-load: Symbol's value as variable is void: lh-knight

I have also installed lispy by just putting this in my .spacemacs:

   dotspacemacs-additional-packages '(lispy)

Mine is reproducible (for me at least). Anyone else experiencing the same thing? (I have never gotten lispy to work with spacemacs.)

nixmaniack commented 8 years ago

@endrebak I did experience this then I have following in my configuration which works as of now. It's because of hydra package I think and lispy not being compiled correctly(wild guess). There are still couple of quirks like company mode pops up with "No completion found.." on repeatedly hitting backspace but it works pretty much fine.

Be sure to remove hydra and lispy from your elpa before restarting emacs with following config. Since I use hybrid mode, it's tailored for it which also defines lispy-mark-symbol key at the end since M-m is used by spacemacs.

(use-package lispy
  :init
  (progn
    (spacemacs/load-or-install-package 'hydra)
    (defun turn-on-lispy-mode ()
      (when (member major-mode
                    '(emacs-lisp-mode lisp-interaction-mode clojure-mode racket-mode))
        (require 'hydra)
        (lispy-mode)))
    (defun turn-off-lispy-mode ()
      (when lispy-mode
        (lispy-mode -1)))

    (add-hook 'evil-hybrid-state-entry-hook  'turn-on-lispy-mode)
    (add-hook 'evil-hybrid-state-exit-hook 'turn-off-lispy-mode)
    (define-key evil-hybrid-state-map (kbd "s-m") 'lispy-mark-symbol)))

Edit: Updated turn-off-lispy-mode for future reference which introduced bug in org-cycle

ghost commented 8 years ago

@nixmaniack Thanks! Do you put that in a layer or somewhere in your .spacemacs or what?

nixmaniack commented 8 years ago

@endrebak in user-config section of .spacemacs. Also if either lispy or hydra gets updated, I need to remove both from ~/.emacs.d/elpa to get it working again. I didn't dig deeper what's the cause.

vkz commented 8 years ago

Posted an update in abo-abo/lispy#139

Question to audience: how does one go about bisecting Spacemacs configuration? In my old hand-written configs I would simply comment stuff out.

TheBB commented 8 years ago

You can comment stuff out in Spacemacs too. If it's a package that breaks it, you can start by disabling layers and excluding packages until you find something.

ryepesg commented 8 years ago

The issue "void-variable lh-knight" on installing lispy occurs even with the standard installation of spacemacs. However, reinstalling and choosing just spacemacs-base solves the problem. Related issue: https://github.com/abo-abo/lispy/issues/148

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!