Open fuzy112 opened 6 months ago
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);
Fredrik Bergroth @.***> writes:
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);
Hi Fredrik,
Thanks for sharing the snippet. It works like a charm!!! 👍👍
Currently
emacsWithPackagesFromUsePackage
supportsuse-package
andleaf
. It will be helpful to also support setup.el.