I've been using Emacs for a couple of years, slowly learning and tuning up my config. I was trying to fix a bug using `emacs -Q` and then evaluating a minimal elisp block to load the locations of installed packages, but I found I was getting an error when evaluating `(package-initialize)`.
I'm now on Emacs 27.2, and I've found out that apparently `(package-initialize)` isn't required for `v>27.0`. If that's the case, my first `config.org` block for packages must be a little incorrect. Here it is:
(require 'package)
(let* ((no-ssl (and (memq system-type '(windows-nt ms-dos))
(not (gnutls-available-p))))
(proto (if no-ssl "http" "https")))
(when no-ssl
(warn "\
Your version of Emacs does not support SSL connections,
which is unsafe because it allows man-in-the-middle attacks.
There are two things you can do about this warning:
1. Install an Emacs version that does support SSL and be safe.
2. Remove this warning from your init file so you won't see it again."))
;; Comment/uncomment these two lines to enable/disable MELPA and MELPA Stable as desired
(add-to-list 'package-archives (cons "melpa" (concat proto "://melpa.org/packages/")) t)
(add-to-list 'package-archives (cons "melpa-stable" (concat proto "://stable.melpa.org/packages/")) t)
(when (< emacs-major-version 24)
;; For important compatibility libraries like cl-lib
(add-to-list 'package-archives (cons "gnu" (concat proto "://elpa.gnu.org/packages/")))))
(setq gnutls-algorithm-priority "NORMAL:-VERS-TLS1.3")
(package-initialize)
;; Load paths to various packages and themes
(add-to-list 'load-path "~/.emacs.d/org-9.1.14/lisp/")
(add-to-list 'load-path "~/.emacs.d/org-9.1.14/contrib/lisp" t)
(add-to-list 'custom-theme-load-path "~/.emacs.d/themes/")
(add-to-list 'load-path "~/.emacs.d/vendor/emacs-powerline")
Is the `(package-initialize)` redundant here? Is the rest more-or-less appropriate?
I actually handle almost all my packages with `use-package`, but I don't have a `(require 'use-package)` line, presumably because it isn't mentioned on the [github README](https://github.com/jwiegley/use-package#installing-use-package).