nex3 / perspective-el

Perspectives for Emacs.
MIT License
880 stars 71 forks source link

persp-mode does not get activated during startup #173

Closed mukundzare closed 2 years ago

mukundzare commented 2 years ago
  1. I have an issue getting persp-mode running during startup. The following is my setup, but the persp-mode variable is always nil after startup and perspective is not available anymore.
 (use-package perspective
    :ensure t
    :bind
    ("C-x k" . persp-kill-buffer*)
    ("C-x C-b" . persp-list-buffers)   ; or use a nicer switcher, see below
    :config
    (setq persp-state-default-file "~/my-emacs-stuff/perspectives")
    (setq persp-sort 'access)
    (persp-mode)
    :hook
    ((kill-emacs-hook . persp-state-save)))
  1. I have to explicitly execute M-x persp-mode twice to get it started. Initially, I had a emacs-startup-hook setup to also have pers-state-load to be called on emacs startup to load the perspective file.

Any ideas why that happens?

gcv commented 2 years ago

Are there any errors when you run M-x persp-mode the first time? Does the *Messages* buffer show anything interesting?

What happens if you change :config to :init in your use-package form?

mukundzare commented 2 years ago

I think changing the :config to :init did the trick for now. I have a few perspectives open and I do not want to restart my emacs right now, but I will try again and report back if it really works.

gcv commented 2 years ago

Please reopen if this is still a problem.