Comments (5)
(persp-state-load "/path/to/persp-state-file.el")
should work from a startup file. There was a PR for giving persp-state-load
default argument values which would make it work from a hook (#120), but it was never taken over the finish line.
from perspective-el.
I tried (persp-state-load persp-state-default-file)
in my init.el
, but it doesn't seem to load the saved perspectives. It also doesn't seem to error at all, so it's hard for me to tell what's wrong. Loading the perspectives with keybinds still works in either case.
Also, as far as I can tell from the code here in the repo, persp-state-load
does take a default value similar to persp-state-save
, but I'm not very good at elisp so that might not be correct
from perspective-el.
persp-state-load
only takes a default when called interactively (i.e. with a keybinding or from M-x). The PR I linked above was an attempt to have it also take a default when called non-interactively (i.e. from Lisp code).
I wonder if (persp-state-load persp-state-default-file)
failed for you in init.el
because you called it before loading and initializing perspective.el
? Please try the code from eval-expression
(M-: in vanilla Emacs) after startup. That works for me.
from perspective-el.
running it through eval-expression
does indeed work - however, from my understanding, perspective.el
would already be loaded by the time it tries to run that line in my init.el
, since I can succesfully add the save hook on the previous line, like so:
(use-package perspective
:bind
("C-x C-b" . persp-list-buffers)
:custom
(persp-mode-prefix-key (kbd "C-z"))
:init
(persp-mode))
(add-hook 'kill-emacs-hook #'persp-state-save)
(persp-state-load persp-state-default-file)
from perspective-el.
After some more testing I found out that I can auto-load the stored perspectives on startup in this way:
(add-hook 'after-init-hook
(lambda ()
(persp-state-load persp-state-default-file)))
It appears simply putting the line (persp-state-load persp-state-default-file)
at the end of the init.el
file also works; however, I didn't notice because the default splash screen kept popping up. After I disabled the splash both of these options seem to behave the same. Two differences with desktop.el
seem to be that perspective.el
doesn't circumvent the splash and doesn't seem to save the emacs window size. The former is easily fixed, and the latter is not really a problem to me personally.
from perspective-el.
Related Issues (20)
- Marginalia annotation not working with `persp-switch-to-buffer*` HOT 4
- persp-mode does not get activated during startup HOT 3
- helm mini frame errors saying no such buffer HOT 5
- Recently released Emacs 28.1 uses `C-x x` for buffer actions, thus conflicting with the prefix for perspective-el HOT 10
- [feature request] - Option to not save modes for buffers HOT 1
- Creating pipe: Too many open files HOT 5
- Can't setup perspective layout at startup HOT 4
- Perspective breaks after enable-theme HOT 5
- Perspective hides buffers when running Emacs as server HOT 4
- Current perspective name not being propertized in the mode-line HOT 5
- Display perspective in frame title HOT 7
- `C-x 5 2 ` different behaviour when running perspective with daemon HOT 2
- Perspective.el wipes out perspectives when a emacsclient frame is closed. HOT 2
- `persp-delete-frame` alters windows of other frames when killing frame with dedicated window HOT 1
- Issue with using ediff and perspective [sorted] HOT 6
- Compare to tabspaces? HOT 2
- Support eshell state save and restore
- Would it support different themes per frame? HOT 2
- ibuf-ext.el not loaded HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from perspective-el.