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

New layer format #4980

Closed
darkfeline opened this issue Feb 6, 2016 · 13 comments
Closed

New layer format #4980

darkfeline opened this issue Feb 6, 2016 · 13 comments
Labels

Comments

@darkfeline
Copy link
Contributor

I'd like clarification on the new layer format. Relevant links:

Layers documentation: https://github.com/syl20bnr/spacemacs/blob/develop/doc/LAYERS.org
Relevant commit: 09af605

Old format

  • packages.el: Set layer packages and configure packages (init-<package>).
  • funcs.el: Function definitions, including named functions that are used in init-<package>.
  • keybindings.el: Any keybindings that don't go into init-<package> (not package specific).
  • config.el: All remaining configuration that don't go into init-<package> (not package specific).

New format

  • packages.el: Set layer packages.
  • packages-config.el: Configure packages (init-<package>).
  • packages-funcs.el: Function definitions, only named functions that are used in init-<package> (package related).
  • funcs.el: Remaining function definitions (not package specific).
  • keybindings.el: Any keybindings that don't go into init-<package> (not package specific).
  • config.el: All remaining configuration that don't go into init-<package> (not package specific).

Questions

  1. Is my understanding correct?
  2. Migrating existing layers involves: moving init functions packages.el -> packages-config.el, moving some definitions funcs.el -> packages-funcs.el?
  3. Is having a separate keybindings.el necessary? I believe these will be things like calls to spacemacs/set-leader-keys, evil-define-key, etc. Can these not simply go into config.el?
  4. Regarding where to put functions, say a function my-layer-foo-function gets used in init-foo as (setq foo-function 'my-layer-foo-function), then it goes into packages-funcs.el. An interactive command my-layer-frob-paragraph goes into funcs.el. Does this sound right?
  5. Is the new layer format "final"? Should existing layers be migrated?
  6. What's the motivation behind the change?
@StreakyCobra
Copy link
Contributor

@syl20bnr is the best person to answer all this :-) But I can give some indications about what I know:

What's the motivation behind the change?

It has to do with lazy layers installation. It seems it could also help solving #3430.

Should existing layers be migrated?

Quoting a discussion with @syl20bnr: I’ll do the refactor for each layer after all PRs for each have been merged.

@robbyoconnor
Copy link
Contributor

I been doing my PRs against it. I updated the docs when I saw he did it. The wizard is updated here -- he hasn't merged it yet.

@darkfeline
Copy link
Contributor Author

Should the layer/init-package functions go into packages.el or packages-config.el? The wizard PR implies the former, the documentation implies the latter.

@robbyoconnor
Copy link
Contributor

Yes. It should go in package.el

package-config just defines the packages

--Rob
Sent from my cell, please excuse any typos.
On Feb 6, 2016 6:49 PM, "darkfeline" notifications@github.com wrote:

Should the layer/init-package functions go into packages.el or
packages-config.el`? The wizard PR implies the former, the documentation
implies the latter.


Reply to this email directly or view it on GitHub
#4980 (comment)
.

@robbyoconnor
Copy link
Contributor

For examples see the plantuml layer

--Rob
Sent from my cell, please excuse any typos.
On Feb 6, 2016 6:51 PM, "Robby O'Connor" robby.oconnor@gmail.com wrote:

Yes. It should go in package.el

package-config just defines the packages

--Rob
Sent from my cell, please excuse any typos.
On Feb 6, 2016 6:49 PM, "darkfeline" notifications@github.com wrote:

Should the layer/init-package functions go into packages.el or
packages-config.el`? The wizard PR implies the former, the documentation
implies the latter.


Reply to this email directly or view it on GitHub
#4980 (comment)
.

@darkfeline
Copy link
Contributor Author

In that case, the following documentation fix is needed? #4986

@syl20bnr
Copy link
Owner

Sorry for being late on this.

Should the layer/init-package functions go into packages.el or packages-config.el?

init functions go in packages-config.el.
Additional functions go to packages-funcs.el.
packages.el defines only the list of packages <layer>-packages.

@darkfeline So your New format section in OP looks quite accurate to me.

@darkfeline
Copy link
Contributor Author

Given that, the following need fixing:

  • plantuml layer
  • create-layer wizard

@robbyoconnor
Copy link
Contributor

@darkfeline what's wrong with the plantuml layer I followed the template when I saw it? The create-layer wizard has an open PR (See #4906)

@darkfeline
Copy link
Contributor Author

As @syl20bnr says, you swapped what was supposed to go in packages.el and packages-config.el. Thus both plantuml and the wizard PR #4906 is wrong.

@syl20bnr
Copy link
Owner

My bad, I overlooked it when merging, thank you @darkfeline.

@emberian
Copy link

@darkfeline do you have any further questions here?

@darkfeline
Copy link
Contributor Author

No, this is out of date anyway.

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

No branches or pull requests

5 participants