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

emacsWithPackages should know its package set #10819

Closed
peti opened this issue Nov 4, 2015 · 6 comments
Closed

emacsWithPackages should know its package set #10819

peti opened this issue Nov 4, 2015 · 6 comments
Assignees
Labels
0.kind: enhancement Add something new

Comments

@peti
Copy link
Member

peti commented Nov 4, 2015

The emacsWithPackages function expects as an argument the list of packages to include in the environment. Now, this means that both emacsWithPackages and the Emacs package set used to construct its argument refers to an Emacs binary, but they don't necessarily refer to the same. This can have weird effects, i.e. suppose that I'd like to have an environment with the Emacs variant that doesn't depend on X11:

(emacsWithPackages.override { emacs = emacs24-nox; }) [ ??? ];

Obviously, I'd like to pass a list of packages from a package set that''s build with emacs24-nox, too, but such a package set doesn't exist and there's no easy way for me to create one. emacsPackagesGen is a recursive function, so I cannot call it in place without a let binding, which is very inconvenient. Furthermore, what happens when I accidentally pass packages to the function above that are, say, compiled with Emacs 23.x? IMHO, the interface shouldn't require its users to deal with that kind of mess.

I would suggest that emacsWithPackages becomes a function that lives inside of the Emacs package set and that takes as an argument a function that maps from an Emacs package set (the one emacsWithPackages lives in) to a list of packages. With that API, I could simply write

(emacsWithPackages.override { emacs = emacs24-nox; }) (ps: [ ps.bbdb ];

and get the expected result without any fuss.

Cc: @ttuegel

@peti peti added the 0.kind: enhancement Add something new label Nov 4, 2015
@ttuegel
Copy link
Member

ttuegel commented Nov 4, 2015

I plan to do this after I merge emacsPackages and emacsPackagesNg. If we did this now, it wouldn't be possible to use packages from both sets, which is still necessary at the moment.

@peti
Copy link
Member Author

peti commented Nov 4, 2015

If we did this now, it wouldn't be possible to use packages from both sets, which is still necessary at the moment.

Why do you think it's impossible to include packages from other sets in the list argument?

@ttuegel
Copy link
Member

ttuegel commented Nov 4, 2015

I guess it's possible, but doesn't that defeat the purpose of making the interface less messy?

@ttuegel
Copy link
Member

ttuegel commented Nov 4, 2015

Sorry, that sounds unintentionally combative. I mean, if this would be helpful to you, I'm happy to do it now because I had planned to do it anyway.

@peti
Copy link
Member Author

peti commented Nov 4, 2015

No worries. I have my own little helper function in config.nix that does what I want, so I'm not dependent on that change being made quickly. Just feel free to progress with this stuff at your own pace; I didn't mean to come across as if I'm trying to rush things.

@peti
Copy link
Member Author

peti commented Nov 20, 2015

Related issues where other people had the same problem: #10811 and #11004.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.kind: enhancement Add something new
Projects
None yet
Development

No branches or pull requests

2 participants