zoliky · 2022-07-27 21:36
Hello, I have the following package settings in my init.el
(require 'package)
(setq package-archives '(("melpa" . "https://melpa.org/packages/")
("org" . "https://orgmode.org/elpa/")
("gnu" . "https://elpa.gnu.org/packages/")))
(package-initialize)
Do I need to add anything else to enable the NonGNU ELPA Packages introduced in Emacs 28.1? I heard the NonGNU ELPA is enabled by default in Emacs but I guess my config excludes it. Right?
7890yuiop · 2022-07-28 00:04
I suggest using `add-to-list` to add only the non-default things, rather than clobbering the entire list.
Drack37 · 2022-07-28 05:13
Your configuration is excluding it, as you redefine the variable, which indeed includes it by default. You need to use `add-to-list` to not override the variable, or redefined it with all package archives. Here's mine:
(setq package-archives
'(("MELPA" . "https://melpa.org/packages/")
("MELPA Stable" . "https://stable.melpa.org/packages/")
("GNU ELPA" . "https://elpa.gnu.org/packages/")
("NonGNU ELPA" . "https://elpa.nongnu.org/nongnu/"))
package-archive-priorities
'(("MELPA" . 8)
("MELPA Stable" . 6)
("GNU ELPA" . 4)
("NonGNU ELPA" . 10)))
As you can see, you need to add the [`https://elpa.nongnu.org/nongnu/`](https://elpa.nongnu.org/nongnu/) URL for having the NonGNU ELPA archive. Please, note that the [Org ELPA](https://orgmode.org/elpa.html) (with URL [`https://orgmode.org/elpa/`](https://orgmode.org/elpa/)) is [deprecated since Org-Mode v9.5](https://orgmode.org/Changes.html).
zoliky · 2022-07-28 13:46
Is there anything wrong in using the `package-archives`? If I use `add-to-list` as you suggested, then I need to use a conditional for Emacs 27 to add the non gnu repo to the list. However, if I use the variable to define all the repos as I did above, they will be applied to both Emacs 27 and 28.
zoliky · 2022-07-28 13:54
Thank you! Isn't it better to install from GNU first, then Non GNU? and leave the Melpas at the end?
Phil-Hudson · 2022-07-28 15:02
`add-to-list` will not add duplicate entries.
[deleted] · 2022-07-28 15:04
[deleted]
zoliky · 2022-07-28 15:06
The chance of getting duplicate entries is little to zero. I only have a list of 4 repos which is not going to be altered once set.
Phil-Hudson · 2022-07-28 15:19
Sorry, I think I misunderstood your issue with using `add-to-list`.
Drack37 · 2022-07-28 20:01
I think it depends on what do you expect, it's a matter of choice. Note that it will not change anything for packages that are available in only one of the archives. For packages present in at least 2 archives, MELPA seems to be more up-to-date, and GNU more stable for old versions of Emacs. Acceptance criteria also differ between different archives.
7890yuiop · 2022-07-28 22:14
The point being you *don't* "need to use a conditional" for Emacs 27, *because* `add-to-list` won't add duplicates; and if some future version of Emacs adds yet another default archive, your config won't then be clobbering that by default. But it's up to you; my suggestion was merely a suggestion.