启动 Spacemacs 时无法通过 persp-load-state-from-file 从指定文件加载 Layouts


#1

以下几种尝试都无法生效,求大大指点:neutral_face:

  ;; (with-eval-after-load 'Persp
  ;;   (persp-load-state-from-file "~/.emacs.d/.cache/layouts/my-persp"))
  ;; (add-hook 'spacemacs-post-user-config-hook
  ;;           (lambda()
  ;;             (persp-load-state-from-file "~/.emacs.d/.cache/layouts/my-persp"))
  ;;           )
  (defun load-my-persp()
    (persp-load-state-from-file "~/.emacs.d/.cache/layouts/my-persp")
    )

  (add-hook 'spacemacs-post-user-config-hook
            'load-my-persp
            )


#2

已解决,犯二了,不好意思哈哈。

   (defun load-my-persp()
    (persp-load-state-from-file "~/.emacs.d/.cache/layouts/my-persp")
    )

  (spacemacs/add-to-hooks 'load-my-persp
            '(persp-mode-hook)
            )