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

use private layers to customise layers? #5375

Closed
xiaoxinghu opened this issue Mar 5, 2016 · 6 comments
Closed

use private layers to customise layers? #5375

xiaoxinghu opened this issue Mar 5, 2016 · 6 comments

Comments

@xiaoxinghu
Copy link

I really like the concept of layer. But sometimes it doesn't feel exactly right. E.g. I have tons of customisation on org-mode. You can't expect a "right" config for everyone in terms of org-mode. And it is too big to be in .spacemacs file. So I created my own layer for it. But it is not exactly a new module. It is a big customisation on an existing one -- the org layer. I assume for now the private layer is the best way of doing this. Am I right? I am expecting a mechanism to customise a layer. Maybe it is redundant design since the purpose of layer is to customise. Thoughts?

@StreakyCobra
Copy link
Contributor

User configuration should be called in user-config, but it doesn't have to be in the .spacemacs file, if it is too big you can move related configurations to another file. For instance you can create a my-org-config.el with all you org-related tweaks, and then add this line to your user-config function:

  (load-file "my-org-config.el")

Using a layer is another, but heavier, solution.

@xiaoxinghu
Copy link
Author

@StreakyCobra Excellent! Just what I wanted. One small question though. If I use the load-file method, can I use the existing package management feature for a layer? Like auto install, lazy loading etc. (given that I need to use additional packages). Or should I use dotspacemacs-additional-packages. For example ox-reveal for creating slides from org files.

@sooheon
Copy link

sooheon commented Mar 6, 2016

You can also create more than one private layer, so you can just split it out into xxh-org layer, for example.

@nixmaniack
Copy link
Contributor

I would just add one more point to @StreakyCobra's suggestion. I do use (load-file "my-org-config.el") but I also add with-eval-after-load so I don't load all configs right at startup.

@StreakyCobra
Copy link
Contributor

@xiaoxinghu Using and loading another file is for structuring your code. For the lazy loading part, you can use the same mechanism as used in the layers, i.e. with-eval-after-load for configuring already existing packages without forcing them to load. (as @nixmaniack suggested), or (use-packages … deferring capabilities for installing and lazy loading packages.

@d12frosted
Copy link
Collaborator

Closing this issue for being inactive. Also discussions contain possible solution. Also, there is somewhat outdated answer for exact question.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants
@sooheon @nixmaniack @xiaoxinghu @StreakyCobra @d12frosted and others