Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All perspectives gone after restart #134

Closed
ghost opened this issue Aug 27, 2022 · 4 comments
Closed

All perspectives gone after restart #134

ghost opened this issue Aug 27, 2022 · 4 comments

Comments

@ghost
Copy link

ghost commented Aug 27, 2022

I restarted Emacs and met with this error:

[persp-mode] Error: Can not autoresume perspectives -- (error "Specified root is not an ancestor of specified window")

Now all my perspectives are gone. Please help!

@Bad-ptr
Copy link
Owner

Bad-ptr commented Aug 27, 2022

hmm.... How did this happen? Did it happen after recent update of persp-mode? If not, try to update.

Anyway, looks like the problem with restoring a window configuration.
You can try to open a persp-auto-save[n] file in ~/.emacs.d/persp-confs/. See which file contains all needed buffers(search for def-buffer).
Then find def-wconf, put cursor on opening bracket >cursor here<(def-wconf,, press Ctrl+Space(start selection), then Ctrl+Alt+f this will select full (def-wconf ...) sexp, replace it with nil. Repeat this for all def-wconfs if needed.
After that save file in safe place and load it with Ctrl+c p l (or call persp-load-state-from-file). It will load all your perspectives, only window configurations will be lost.

@ghost
Copy link
Author

ghost commented Aug 27, 2022

I will try and restore tomorrow and revert.

@Bad-ptr
Copy link
Owner

Bad-ptr commented Aug 28, 2022

Another workaround to try is to redefine the persp-delete-other-windows(paste this into *scratch*, select, and M-x eval-region):

(defun persp-delete-other-windows ()
  (let ((win (selected-window)))
    (when (or (window-parameter win 'window-side)
              (window-minibuffer-p win))
      (setq win (cl-loop
                 for win in (window-list nil 1)
                 unless (window-parameter win 'window-side)
                 return win)))
    (when win
      (let ((ignore-window-parameters t))
        (condition-case-unless-debug err
            (delete-other-windows win)
          (error
           (message "[persp-mode] Warning: Can not delete-other-windows -- %S" err)))))))

Then try to load perspectives from file.

@Bad-ptr
Copy link
Owner

Bad-ptr commented Sep 9, 2022

redefine the persp-delete-other-windows

It's now in master fc129b7

@Bad-ptr Bad-ptr closed this as completed Aug 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant