emacs: remove outdated doc about package initialization

Since Emacs 27[1], there is no need to call package-initialize in the
init file.

[1]: https://git.savannah.gnu.org/cgit/emacs.git/tree/etc/NEWS.27?id=cae528457cb862dc886a34240c9d4c73035b6659#n227
This commit is contained in:
Lin Jian 2023-08-25 11:13:47 +08:00 committed by Anderson Torres
parent 71a8753134
commit 665651c736
3 changed files with 2 additions and 27 deletions

View File

@ -26,10 +26,6 @@ You can install it like any other packages via `nix-env -iA myEmacs`. However, t
{
packageOverrides = pkgs: with pkgs; rec {
myEmacsConfig = writeText "default.el" ''
;; initialize package
(require 'package)
(package-initialize 'noactivate)
(eval-when-compile
(require 'use-package))

View File

@ -339,22 +339,8 @@ This will add the symlink
## Configuring Emacs {#module-services-emacs-configuring}
The Emacs init file should be changed to load the extension packages at
startup:
::: {.example #module-services-emacs-package-initialisation}
### Package initialization in `.emacs`
```
(require 'package)
;; optional. makes unpure packages archives unavailable
(setq package-archives nil)
(setq package-enable-at-startup nil)
(package-initialize)
```
:::
If you want to only use extension packages from Nixpkgs, you can add
`(setq package-archives nil)` to your init file.
After the declarative Emacs package configuration has been tested,
previously downloaded packages can be cleaned up by removing

View File

@ -7,18 +7,11 @@
# Alternative: use `emacs`, install everything to a system or user profile
# and then add this at the start your `init.el`:
/*
(require 'package)
;; optional. makes unpure packages archives unavailable
(setq package-archives nil)
;; optional. use this if you install emacs packages to the system profile
(add-to-list 'package-directory-list "/run/current-system/sw/share/emacs/site-lisp/elpa")
;; optional. use this if you install emacs packages to user profiles (with nix-env)
(add-to-list 'package-directory-list "~/.nix-profile/share/emacs/site-lisp/elpa")
(package-initialize)
*/
{ pkgs'