Fall back to standard use of =package.el=
This commit is contained in:
parent
4eaeaa43b3
commit
60b197c0b8
2
.gitignore
vendored
2
.gitignore
vendored
@ -19,6 +19,6 @@ org-store-link
|
|||||||
|
|
||||||
/_minted-README
|
/_minted-README
|
||||||
/eln-cache
|
/eln-cache
|
||||||
/elpa-*
|
/elpa
|
||||||
/quelpa
|
/quelpa
|
||||||
/var
|
/var
|
||||||
|
89
README.org
89
README.org
@ -112,16 +112,16 @@ Here follows a list of interesting Emacs configurations:
|
|||||||
:CUSTOM_ID: sec:early-init-file
|
:CUSTOM_ID: sec:early-init-file
|
||||||
:END:
|
:END:
|
||||||
|
|
||||||
The configuration inhibits enabling of [[info:emacs#Packages][Emacs' package management system]] at
|
Note: src_emacs-lisp[:exports code]{(find-function #'hack-local-variables)}
|
||||||
startup in order to get more control in the [[#sec:package-bootstrapping][Package Bootstrapping]] section.
|
|
||||||
|
|
||||||
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
||||||
#+begin_src emacs-lisp :tangle early-init.el
|
#+begin_src emacs-lisp :tangle early-init.el
|
||||||
;;; early-init.el --- user early-init file -*- lexical-binding: t -*-
|
;;; early-init.el --- user early-init file -*- lexical-binding: t -*-
|
||||||
;;; Commentary:
|
;;; Commentary:
|
||||||
;;; Code:
|
;;; Code:
|
||||||
(setq package-enable-at-startup nil)
|
(setq load-prefer-newer t)
|
||||||
(setq-default load-prefer-newer t)
|
|
||||||
|
(require 'no-littering nil 'noerror)
|
||||||
|
|
||||||
(provide 'early-init)
|
(provide 'early-init)
|
||||||
;; Emacs looks for "Local variables:" after the last "?\n?\f".
|
;; Emacs looks for "Local variables:" after the last "?\n?\f".
|
||||||
@ -140,7 +140,7 @@ startup in order to get more control in the [[#sec:package-bootstrapping][Packag
|
|||||||
The [[info:elisp#Quoting][quoting (info)]] and the [[info:elisp#Backquote][backquote (info)]] pages explain how to understand the
|
The [[info:elisp#Quoting][quoting (info)]] and the [[info:elisp#Backquote][backquote (info)]] pages explain how to understand the
|
||||||
reader macros ~'~ (quote), ~`~ (backquote), ~,~ (substitute) and ~@,~ (splice)
|
reader macros ~'~ (quote), ~`~ (backquote), ~,~ (substitute) and ~@,~ (splice)
|
||||||
in the ~custom-set-variable~ function call below. A tutorial of how to use those
|
in the ~custom-set-variable~ function call below. A tutorial of how to use those
|
||||||
reader macro's is the [[https://mullikine.github.io/posts/macro-tutorial/][didactic emacs-lisp macro example]].
|
reader macros is the [[https://mullikine.github.io/posts/macro-tutorial/][didactic emacs-lisp macro example]].
|
||||||
|
|
||||||
Because of the ~custom-set-variable~ function call, the [[info:emacs#Init File][init file (info)]] does
|
Because of the ~custom-set-variable~ function call, the [[info:emacs#Init File][init file (info)]] does
|
||||||
not load the ~custom-file~ as [[info:emacs#Saving Customizations][saving customizations (info)]] recommends.
|
not load the ~custom-file~ as [[info:emacs#Saving Customizations][saving customizations (info)]] recommends.
|
||||||
@ -156,9 +156,7 @@ not load the ~custom-file~ as [[info:emacs#Saving Customizations][saving customi
|
|||||||
'(after-save-hook #'executable-make-buffer-file-executable-if-script-p)
|
'(after-save-hook #'executable-make-buffer-file-executable-if-script-p)
|
||||||
'(column-number-mode t)
|
'(column-number-mode t)
|
||||||
'(cursor-type 'box)
|
'(cursor-type 'box)
|
||||||
`(custom-file
|
`(custom-file ,(make-temp-file "emacs-custom-"))
|
||||||
,(locate-user-emacs-file
|
|
||||||
(format "custom-%s.%s.el" emacs-major-version emacs-minor-version)))
|
|
||||||
'(epg-pinentry-mode 'loopback)
|
'(epg-pinentry-mode 'loopback)
|
||||||
'(global-hl-line-mode t)
|
'(global-hl-line-mode t)
|
||||||
'(global-hl-line-sticky-flag t)
|
'(global-hl-line-sticky-flag t)
|
||||||
@ -175,9 +173,27 @@ not load the ~custom-file~ as [[info:emacs#Saving Customizations][saving customi
|
|||||||
'(package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
|
'(package-archives '(("gnu" . "https://elpa.gnu.org/packages/")
|
||||||
("nongnu" . "https://elpa.nongnu.org/nongnu/")
|
("nongnu" . "https://elpa.nongnu.org/nongnu/")
|
||||||
("melpa" . "https://melpa.org/packages/")))
|
("melpa" . "https://melpa.org/packages/")))
|
||||||
`(package-user-dir
|
`(package-selected-packages
|
||||||
,(locate-user-emacs-file
|
`(
|
||||||
(format "elpa-%s.%s" emacs-major-version emacs-minor-version)))
|
,@(when (version< emacs-version "28.0")
|
||||||
|
'(org)) ; plain text thought organizer
|
||||||
|
anaconda-mode ; strangles python-mode
|
||||||
|
auctex ; Aalborg University Center TeX
|
||||||
|
blacken ; Black Python-code formatter client
|
||||||
|
citar ; bibliography handling
|
||||||
|
citeproc ; bibliography handling
|
||||||
|
company-anaconda ; complete anything in anaconda-mode
|
||||||
|
consult ; consult completing-read
|
||||||
|
eglot ; Emacs polyGLOT LSP client
|
||||||
|
embark ; act on any buffer selection
|
||||||
|
htmlize ; convert buffer contents to HTML
|
||||||
|
leuven-theme ; beautiful color theme
|
||||||
|
marginalia ; minibuffer margin notes
|
||||||
|
orderless ; Emacs completion style
|
||||||
|
pdf-tools ; interactive docview replacement
|
||||||
|
pyenv-mode ; Python environment selector
|
||||||
|
quelpa ; install Emacs packages from source
|
||||||
|
vertico)) ; VERTical Interactive Completion
|
||||||
'(python-indent-guess-indent-offset nil)
|
'(python-indent-guess-indent-offset nil)
|
||||||
'(recentf-mode t)
|
'(recentf-mode t)
|
||||||
'(save-place-mode t)
|
'(save-place-mode t)
|
||||||
@ -223,13 +239,8 @@ archives:
|
|||||||
Finally, the [[https://github.com/quelpa/quelpa][quelpa]] tool allows to fetch code from any source and build a
|
Finally, the [[https://github.com/quelpa/quelpa][quelpa]] tool allows to fetch code from any source and build a
|
||||||
package on your computer before installation.
|
package on your computer before installation.
|
||||||
|
|
||||||
The output of the byte-compiler may change with each new Emacs release.
|
The order of the next two package-bootstrapping blocks matters
|
||||||
Therefore, in order to prevent collisions between different Emacs versions, the
|
because first block prepares Emacs for the second block.
|
||||||
package-user-directory has a suffix containing the major- and minor-version
|
|
||||||
numbers of Emacs.
|
|
||||||
|
|
||||||
The order of the next 1nd, 2nd, and 3rd package-bootstrapping blocks matters
|
|
||||||
because each of those blocks prepares Emacs for the next block.
|
|
||||||
|
|
||||||
If present, the package [[https://github.com/emacscollective/no-littering][no-littering]] helps to keep =~/.emacs.d= clean.
|
If present, the package [[https://github.com/emacscollective/no-littering][no-littering]] helps to keep =~/.emacs.d= clean.
|
||||||
|
|
||||||
@ -247,14 +258,13 @@ list of packages.
|
|||||||
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; The is the 1st package bootstrapping block.
|
;; The is the 1st package bootstrapping block.
|
||||||
(require 'package)
|
|
||||||
(package-initialize)
|
|
||||||
|
|
||||||
(unless (require 'no-littering nil 'noerror)
|
(unless (require 'no-littering nil 'noerror)
|
||||||
(package-refresh-contents)
|
(package-refresh-contents)
|
||||||
(package-install 'no-littering)
|
(package-install 'no-littering)
|
||||||
(require 'no-littering))
|
(require 'no-littering))
|
||||||
|
|
||||||
|
(package-install-selected-packages)
|
||||||
|
|
||||||
(defun my-install-packages (packages)
|
(defun my-install-packages (packages)
|
||||||
"Ensure installation of all packages in PACKAGES."
|
"Ensure installation of all packages in PACKAGES."
|
||||||
(dolist (package packages)
|
(dolist (package packages)
|
||||||
@ -262,46 +272,11 @@ list of packages.
|
|||||||
(package-install package))))
|
(package-install package))))
|
||||||
#+end_src
|
#+end_src
|
||||||
|
|
||||||
Install the basic packages and in case this is Emacs-27.2, upgrade [[https://orgmode.org/][Org Mode]] for
|
|
||||||
compatibility with Emacs-28.1. The [[info:elisp#Quoting][quoting (info)]] and the [[info:elisp#Backquote][backquote (info)]]
|
|
||||||
pages explain how to understand the reader macros ~'~ (quote), ~`~ (backquote),
|
|
||||||
~,~ (substitute) and ~@,~ (splice) in the definition of ~my-packages~ variable
|
|
||||||
below.
|
|
||||||
|
|
||||||
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
|
||||||
#+begin_src emacs-lisp
|
|
||||||
;; The is the 2nd package bootstrapping block.
|
|
||||||
(defvar my-packages
|
|
||||||
`(
|
|
||||||
,@(when (version< emacs-version "28.0")
|
|
||||||
'(org)) ; plain text thought organizer
|
|
||||||
anaconda-mode ; strangles python-mode
|
|
||||||
auctex ; Aalborg University Center TeX
|
|
||||||
blacken ; Black Python-code formatter client
|
|
||||||
citar ; bibliography handling
|
|
||||||
citeproc ; bibliography handling
|
|
||||||
company-anaconda ; complete anything in anaconda-mode
|
|
||||||
consult ; consult completing-read
|
|
||||||
eglot ; Emacs polyGLOT LSP client
|
|
||||||
embark ; act on any buffer selection
|
|
||||||
htmlize ; convert buffer contents to HTML
|
|
||||||
leuven-theme ; beautiful color theme
|
|
||||||
marginalia ; minibuffer margin notes
|
|
||||||
orderless ; Emacs completion style
|
|
||||||
pdf-tools ; interactive docview replacement
|
|
||||||
pyenv-mode ; Python environment selector
|
|
||||||
quelpa ; install Emacs packages from source
|
|
||||||
vertico) ; VERTical Interactive Completion
|
|
||||||
"List of packages required packages.")
|
|
||||||
|
|
||||||
(my-install-packages my-packages)
|
|
||||||
#+end_src
|
|
||||||
|
|
||||||
Facilitate installlation of the optional packages.
|
Facilitate installlation of the optional packages.
|
||||||
|
|
||||||
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
#+attr_latex: :options bgcolor=LightGoldenrodYellow
|
||||||
#+begin_src emacs-lisp
|
#+begin_src emacs-lisp
|
||||||
;; The is the 3rd package bootstrapping block.
|
;; The is the 2nd package bootstrapping block.
|
||||||
(defvar my-optional-packages
|
(defvar my-optional-packages
|
||||||
`(
|
`(
|
||||||
,@(when (version< emacs-version "28.0")
|
,@(when (version< emacs-version "28.0")
|
||||||
|
Loading…
Reference in New Issue
Block a user