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

[Feature Request] Add support for setup.el #395

Open
fuzy112 opened this issue Apr 21, 2024 · 2 comments
Open

[Feature Request] Add support for setup.el #395

fuzy112 opened this issue Apr 21, 2024 · 2 comments

Comments

@fuzy112
Copy link

fuzy112 commented Apr 21, 2024

Currently emacsWithPackagesFromUsePackage supports use-package and leaf. It will be helpful to also support setup.el.

@fbergroth
Copy link
Contributor

I'm using setup.el, and wrote this to parse the package names:

parsePackagesFromSetup = configText: let
  inherit (builtins) head tail;
  recurse = inSetup: item:
    if !(builtins.isList item) || item == []
    then []
    else if !inSetup && head item == "setup"
    then recurse true (tail item)
    else if inSetup && head item == ":package"
    then tail item
    else builtins.concatMap (recurse inSetup) item;
in
  ["setup"] ++ (recurse false (fromElisp configText));

packages = parsePackagesFromSetup (builtins.readFile ./init.el);

@fuzy112
Copy link
Author

fuzy112 commented May 10, 2024 via email

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

2 participants