bmag / emacs-purpose

Manage Windows and Buffers According to Purposes
GNU General Public License v3.0
494 stars 22 forks source link

purpose-x-persp-setup: Symbol's value as variable is void: persp-curr #78

Open et2010 opened 8 years ago

et2010 commented 8 years ago

Persp-mode is a spacemacs stock mode which is based on perspective, but the perspective extension not working here. When I run purpose-x-persp-setup, emacs just complain about persp-curr being void.

When I M-x purpose-x-persp-setup, I got this error:

purpose-x-persp-setup: Symbol's value as variable is void: persp-curr

Here is the trace back:

Debugger entered--Lisp error: (void-variable persp-curr) purpose-x-persp-activate() purpose-x-persp-setup() call-interactively(purpose-x-persp-setup record nil) command-execute(purpose-x-persp-setup record) execute-extended-command(nil "purpose-x-persp-setup") smex-read-and-run(("purpose-x-persp-setup" "purpose-load-window-layout" "make-frame" "purpose-save-frame-layout" "emacs-lisp-mode" "evil-window-decrease-height" "check-parens" "code-library-save-code" "org-version" "kill-matching-buffers" "customize-group" "purpose-x-code1-setup" "windmove-right" "doc-view-mode" "configuration-layer/create-layer" "tablist-quit" "popwin:select-popup-window" "popwin:popup-last-buffer" "popwin:popup-buffer-tail" "popwin:popup-buffer" "revert-buffer" "describe-keymap" "pdf-tools-help" "pdf-view-mode" "pdf-outline" "pdf-occur" "pdf-tools-enable-minor-modes" "describe-mode" "org-cliplink" "describe-face" "fcitx-isearch-turn-on" "org-download-screenshot" "yas-visit-snippet-file" "yas-new-snippet" "yas-insert-snippet" "ace-pinyin-dwim" "yas-expand" "yas/expand" "yas-tryout-snippet" "yas-about" "describe-char" "byte-compile-file" "yas-abort-snippet" "byte-recompile-file" "fcitx-default-setup" "purpose-x-code1-unset" "fcitx-aggressive-setup" "org-latex-export-to-pdf" "s" "cd" ...)) smex() (let ((smex-prompt-string "Emacs commands: ")) (smex)) spacemacs/smex() call-interactively(spacemacs/smex nil nil) command-execute(spacemacs/smex)

I'm using spacemacs 0.105.9 with emacs 24.5.1.

bmag commented 8 years ago

Thanks for the report.

The Perspective extension (purpose-x-persp-setup) is intended to work with perspective.el, as stated here in the wiki. Spacemacs uses persp-move, not perspective.el, that's why you get an error. I realize now that this distinction isn't mentioned anywhere in the code, only in the wiki. I'm keeping this issue open as a reminder for me to make the distinction clearer.

I assume it's only the extension that causes an error, and that if you don't activate it then the rest of Purpose works as intended.

In the future, could you please elaborate more when reporting issues? For example, include the exact error message. The title also doesn't say what the problem is, only that there's a problem. It's easier to help when I know what exactly isn't working. Usually it also helps to include a reproduction recipe. This time it wasn't necessary, but in the future please keep that in mind ;-)

et2010 commented 8 years ago

Thanks for your advice. I will keep that in mind.

et2010 commented 8 years ago

Sorry for the misoperation

nnicandro commented 5 years ago

This error would still happen with perspective.el now since persp-curr is not defined as a variable anymore, but as a function in newer versions

https://github.com/nex3/perspective-el/blob/2c8cf56d170c3eb1fcc1a8fe41026b780e0ffead/perspective.el#L216

bmag commented 5 years ago

@dzop thanks for the tip, should be fixed by https://github.com/bmag/emacs-purpose/commit/26c8850ca00dca2f777c2b73520676ca7b7fe5b7. Might also work with the other persp-mode now.