diff options
| author | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2024-03-24 18:58:08 +0100 |
|---|---|---|
| committer | Kévin Le Gouguec <kevin.legouguec@gmail.com> | 2024-03-24 18:58:08 +0100 |
| commit | 89d55ba2eb0ad172dc6aae81ce5d1cb340a632d2 (patch) | |
| tree | 3ca24f6e6e33a10168cfee0524ae67a3245a23e9 | |
| parent | 013e38985db1d093c5c8c9af1c1cc3380b9bbdd9 (diff) | |
| download | dotfiles-89d55ba2eb0ad172dc6aae81ce5d1cb340a632d2.tar.xz | |
Refresh .emacs prologue
The stuff about package-initialize is flat out wrong:
(a) package-initialize is _not_ called automatically at startup;
(b) for all that, customizations seem none the worse for wear.
'(elisp) Packaging Basics' suggests that Emacs does automatically call
'package-activate-all' (unless asked otherwise in the early init file)
so it's really not clear what that business with package-initialize
was about 🤷
Add some more up-to-date commentary regarding other topics.
| -rw-r--r-- | .emacs | 32 |
1 files changed, 14 insertions, 18 deletions
@@ -1,21 +1,14 @@ ;;; -*- lexical-binding: t -*- -;;; Packages and Custom initialization. - -;; Letting Custom run *before* initializing packages seems to result -;; in packages resetting some of their variables, eg page-break-lines -;; resets global-page-break-lines-mode to nil. Cue Custom shrugging, -;; "changed outside Customize". - -;; Emacs≥27 automatically calls package-initialize before loading the -;; user's init file, unless package-enable-at-startup is set to nil in -;; the early init file. -(unless (>= emacs-major-version 27) - (package-initialize)) +;;; "Custom"ization & theming. +;; Trying to migrate to use-package instead of Custom's serialized +;; forms. It's a long-term project; until that's done, start by +;; setting and loading the `custom-file'. (setq custom-file "~/.emacs-custom.el") (load custom-file) +;; Compatibility shim for setopt. (if (fboundp 'setopt) (defalias 'my/setopt 'setopt) (defmacro my/setopt (&rest pairs) @@ -23,12 +16,15 @@ (while pairs (customize-set-variable (pop pairs) (pop pairs)))))) -;; Some list variables I don't set via Custom. I can't tell Custom -;; "add this element, take those two away": I need to "set in stone" -;; an exhaustive list that will make me (1) scratch my head a few -;; months later when I try to remember which of those items I added, -;; and which were part of the default list (2) miss out on additions -;; to the default list, unless I cautiously audit every release. +;; Helper for customizing list options. +;; +;; None of Emacs's customization tools (Custom, setopt, use-package) +;; can be told "add this element, take those two away": I need to "set +;; in stone" an exhaustive list that will make me (1) scratch my head +;; a few months later when I try to remember which of those items I +;; deliberately added vs which were part of the default list (2) miss +;; out on additions to the default list, unless I cautiously audit +;; every release of every package. ;; ;; Examples: erc-modules, git-commit-setup-hook, package-archives. (defmacro my/setopt-update-list (l to-add &optional to-remove) |
