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

Error when creating new layout #5567

Closed iliabv closed 8 years ago

iliabv commented 8 years ago

Description

Hi! After recent changes in layouts logic it's impossible (for me) to create new layouts (SPC-l-number). At every attempt to do that I get an error message.

Reproduction guide

Observed behaviour: New layout isn't created. Instead you get this error message:

apply: Wrong number of arguments: (lambda (_new-persp-name) "Update and save current frame's eyebrowse workspace to its perspective.
Parameter _NEW-PERSP-NAME is ignored, and exists only for compatibility with
`persp-before-switch-functions'." (let* ((current-slot (eyebrowse--get (quote current-slot))) (current-tag (nth 2 (assoc current-slot (eyebrowse--get (quote window-configs)))))) (eyebrowse--update-window-config-element (eyebrowse--current-window-config current-slot current-tag))) (spacemacs/save-eyebrowse-for-perspective)), 2

Expected behaviour: No errors, new layout is created.

My investigation: It seems that problem with spacemacs/update-eyebrowse-for-perspective function. It is used as a hook for persp-before-switch-functions. But, according to this code in persp-mode repository, this hook is always called with two arguments, not one. And indeed - after adding second argument to spacemacs/update-eyebrowse-for-perspective everything is OK.

System Info

(osx spacemacs-helm spacemacs-layouts
     (auto-completion :variables auto-completion-enable-sort-by-usage t)
     version-control git spell-checking
     (syntax-checking :variables syntax-checking-enable-tooltips nil)
     (shell :variables shell-default-term-shell "/usr/local/bin/zsh" shell-default-height 60)
     org go csv html markdown javascript python ipython-notebook scheme racket clojure emacs-lisp common-lisp
     (haskell :variables haskell-enable-hindent-style "johan-tibell" haskell-enable-ghc-mod-support t)
     (ranger :variables ranger-parent-depth 3 ranger-cleanup-on-disable t ranger-show-dotfiles t ranger-show-preview t)
     (elfeed :variables url-queue-timeout 10 rmh-elfeed-org-files
             '("~/.emacs.d/private/core/elfeed.org"))
     core)
TheBB commented 8 years ago

We don't use the official persp-mode package, but a fork. In this fork, that function is called with just one argument:

https://github.com/syl20bnr/persp-mode.el/blob/master/persp-mode.el#L1146

I can't reproduce your problem.

iliabv commented 8 years ago

Apparently I've had an official persp-mode package. I've deleted it from elpa directory and after restart spacemacs found that this package is missing and installed a new one. With newly installed package I can't reproduce this problem too. I don't know why I've had an official persp-mode, but it's probably because of my own actions, not spacemacs. Thanks!

TheBB commented 8 years ago

Great, I'm closing this then.

JorisE commented 8 years ago

I know this is close, but I just ran in to the same problem after a freshly installed head of develop (f1247c8d189e5637b6c128f97fe4fb008b718940) so it may be good to keep this as reference. Could it be that persp-mode is pulled by another package?