2022-07-30 21:49:00 +02:00
|
|
|
;;; lisp/doom-packages.el -*- lexical-binding: t; -*-
|
2022-09-12 18:05:14 +02:00
|
|
|
;;; Commentary:
|
|
|
|
;;
|
2019-07-22 22:25:53 +02:00
|
|
|
;; Emacs package management is opinionated, and so is Doom. Doom uses `straight'
|
2022-09-12 18:05:14 +02:00
|
|
|
;; to create a declarative, lazy-loaded, and (nominally) reproducible package
|
2019-07-22 22:25:53 +02:00
|
|
|
;; management system. We use `straight' over `package' because the latter is
|
2020-04-08 15:29:29 -04:00
|
|
|
;; tempermental. ELPA sources suffer downtime occasionally and often fail to
|
|
|
|
;; build packages when GNU Tar is unavailable (e.g. MacOS users start with BSD
|
|
|
|
;; tar). Known gnutls errors plague the current stable release of Emacs (26.x)
|
|
|
|
;; which bork TLS handshakes with ELPA repos (mainly gnu.elpa.org). See
|
|
|
|
;; https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3434.
|
2017-02-11 06:00:08 -05:00
|
|
|
;;
|
2019-07-22 22:25:53 +02:00
|
|
|
;; What's worse, you can only get the latest version of packages through ELPA.
|
|
|
|
;; In an ecosystem that is constantly changing, this is more frustrating than
|
2020-04-08 15:29:29 -04:00
|
|
|
;; convenient. Straight (and Doom) can do rolling release, but it is opt-in.
|
2017-07-14 15:23:12 +02:00
|
|
|
;;
|
2020-04-08 15:29:29 -04:00
|
|
|
;; Interacting with this package management system is done through Doom's
|
|
|
|
;; bin/doom script. Find out more about it by running 'doom help' (I highly
|
|
|
|
;; recommend you add the script to your PATH). Here are some highlights:
|
2017-07-14 15:23:12 +02:00
|
|
|
;;
|
2022-09-12 18:05:14 +02:00
|
|
|
;; - `doom install`: a wizard that guides you through setting up Doom and your
|
|
|
|
;; private config for the first time.
|
|
|
|
;; - `doom sync`: your go-to command for making sure Doom is in optimal
|
2019-07-22 22:25:53 +02:00
|
|
|
;; condition. It ensures all unneeded packages are removed, all needed ones
|
|
|
|
;; are installed, and all metadata associated with them is generated.
|
2022-09-12 18:05:14 +02:00
|
|
|
;; - `doom upgrade`: upgrades Doom Emacs and your packages to the latest
|
2021-06-03 16:17:17 +02:00
|
|
|
;; versions. There's also 'bin/doom sync -u' for updating only your packages.
|
2017-02-06 00:13:24 -05:00
|
|
|
;;
|
2019-07-22 22:25:53 +02:00
|
|
|
;; How this works is: the system reads packages.el files located in each
|
2022-09-12 18:05:14 +02:00
|
|
|
;; activated module, your private config (`doom-user-dir'), and one in
|
2019-07-22 22:25:53 +02:00
|
|
|
;; `doom-core-dir'. These contain `package!' declarations that tell DOOM what
|
2022-09-12 18:05:14 +02:00
|
|
|
;; packages to install and where from.
|
|
|
|
;;
|
|
|
|
;; All that said, you can still use package.el's commands, but 'doom sync' will
|
|
|
|
;; purge ELPA packages.
|
2017-02-06 00:13:24 -05:00
|
|
|
;;
|
2022-09-12 18:05:14 +02:00
|
|
|
;;; Code:
|
2019-07-21 15:39:45 +02:00
|
|
|
|
2017-06-05 14:21:52 +02:00
|
|
|
(defvar doom-packages ()
|
2017-02-11 06:00:08 -05:00
|
|
|
"A list of enabled packages. Each element is a sublist, whose CAR is the
|
|
|
|
package's name as a symbol, and whose CDR is the plist supplied to its
|
2017-02-23 00:06:12 -05:00
|
|
|
`package!' declaration. Set by `doom-initialize-packages'.")
|
2017-02-11 06:00:08 -05:00
|
|
|
|
2017-06-05 16:45:42 +02:00
|
|
|
(defvar doom-disabled-packages ()
|
2019-07-23 12:44:03 +02:00
|
|
|
"A list of packages that should be ignored by `use-package!' and `after!'.")
|
2017-06-05 16:45:42 +02:00
|
|
|
|
2020-05-25 03:15:23 -04:00
|
|
|
(defvar doom-packages-file "packages"
|
|
|
|
"The basename of packages file for modules.
|
|
|
|
|
|
|
|
Package files are read whenever Doom's package manager wants a manifest of all
|
|
|
|
desired packages. They are rarely read in interactive sessions (unless the user
|
|
|
|
uses a straight or package.el command directly).")
|
|
|
|
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
;;
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
;;; package.el
|
2019-07-21 15:39:45 +02:00
|
|
|
|
|
|
|
;; Ensure that, if we do need package.el, it is configured correctly. You really
|
2021-10-09 19:55:47 +02:00
|
|
|
;; shouldn't be using it, but it may be convenient for quickly testing packages.
|
2019-12-27 01:41:14 -05:00
|
|
|
(setq package-enable-at-startup nil
|
2019-09-24 20:49:24 -04:00
|
|
|
package-user-dir (concat doom-local-dir "elpa/")
|
2021-10-09 19:55:47 +02:00
|
|
|
package-gnupghome-dir (expand-file-name "gpg" package-user-dir))
|
|
|
|
|
|
|
|
(after! package
|
|
|
|
(let ((s (if gnutls-verify-error "s" "")))
|
|
|
|
(prependq! package-archives
|
|
|
|
;; I omit Marmalade because its packages are manually submitted
|
|
|
|
;; rather than pulled, and so often out of date.
|
|
|
|
`(("melpa" . ,(format "http%s://melpa.org/packages/" s))
|
|
|
|
("org" . ,(format "http%s://orgmode.org/elpa/" s))))))
|
2019-12-27 01:41:14 -05:00
|
|
|
|
2020-04-08 15:29:29 -04:00
|
|
|
;; Refresh package.el the first time you call `package-install', so it can still
|
|
|
|
;; be used (e.g. to temporarily test packages). Remember to run 'doom sync' to
|
|
|
|
;; purge them; they can conflict with packages installed via straight!
|
2019-11-02 21:55:01 -04:00
|
|
|
(add-transient-hook! 'package-install (package-refresh-contents))
|
|
|
|
|
2020-04-08 15:29:29 -04:00
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Straight
|
|
|
|
|
2021-02-11 22:48:58 -05:00
|
|
|
(setq straight-base-dir (file-truename doom-local-dir)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
straight-repository-branch "develop"
|
2020-10-28 05:13:04 -04:00
|
|
|
;; Since byte-code is rarely compatible across different versions of
|
|
|
|
;; Emacs, it's best we build them in separate directories, per emacs
|
|
|
|
;; version.
|
|
|
|
straight-build-dir (format "build-%s" emacs-version)
|
2019-08-21 00:09:28 -04:00
|
|
|
straight-cache-autoloads nil ; we already do this, and better.
|
2019-07-21 15:39:45 +02:00
|
|
|
;; Doom doesn't encourage you to modify packages in place. Disabling this
|
2020-04-08 15:29:29 -04:00
|
|
|
;; makes 'doom sync' instant (once everything set up), which is much nicer
|
|
|
|
;; UX than the several seconds modification checks.
|
2019-07-21 15:39:45 +02:00
|
|
|
straight-check-for-modifications nil
|
2019-07-23 17:30:32 +02:00
|
|
|
;; We handle package.el ourselves (and a little more comprehensively)
|
2019-07-21 15:39:45 +02:00
|
|
|
straight-enable-package-integration nil
|
|
|
|
;; Before switching to straight, `doom-local-dir' would average out at
|
2019-07-23 17:30:32 +02:00
|
|
|
;; around 100mb with half Doom's modules at ~230 packages. Afterwards, at
|
2020-04-08 15:29:29 -04:00
|
|
|
;; around 1gb. With shallow cloning, that is reduced to ~400mb. This has
|
|
|
|
;; no affect on packages that are pinned, however (run 'doom purge' to
|
|
|
|
;; compact those after-the-fact). Some packages break when shallow cloned
|
|
|
|
;; (like magit and org), but we'll deal with that elsewhere.
|
2021-05-24 13:33:32 -04:00
|
|
|
straight-vc-git-default-clone-depth '(1 single-branch))
|
2019-07-25 17:20:53 +02:00
|
|
|
|
2020-08-16 21:12:56 -04:00
|
|
|
(with-eval-after-load 'straight
|
2022-09-12 18:05:14 +02:00
|
|
|
;; HACK: Doom relies on deferred compilation, which spares the user 20-50min
|
|
|
|
;; of compilation at install time, but subjects them to ~50% CPU activity
|
|
|
|
;; when starting Emacs for the first time. To complete this, straight.el
|
|
|
|
;; needs to be told not to do native-compilation, but it won't obey
|
2022-09-06 19:26:33 +02:00
|
|
|
;; `straight-disable-native-compile'.
|
|
|
|
;;
|
|
|
|
;; It *will* obey `straight--native-comp-available', though. Trouble is:
|
|
|
|
;; it's a constant; it resets itself when straight is loaded, so it must be
|
|
|
|
;; changed afterwards.
|
|
|
|
(setq straight--native-comp-available nil)
|
2020-08-16 21:12:56 -04:00
|
|
|
;; `let-alist' is built into Emacs 26 and onwards
|
|
|
|
(add-to-list 'straight-built-in-pseudo-packages 'let-alist))
|
|
|
|
|
2021-08-04 01:18:06 -04:00
|
|
|
(defadvice! doom--read-pinned-packages-a (fn &rest args)
|
2020-05-25 02:20:26 -04:00
|
|
|
"Read `:pin's in `doom-packages' on top of straight's lockfiles."
|
2020-01-25 03:49:42 -05:00
|
|
|
:around #'straight--lockfile-read-all
|
2021-08-04 01:18:06 -04:00
|
|
|
(append (apply fn args) ; lockfiles still take priority
|
2020-01-28 17:54:51 -05:00
|
|
|
(doom-package-pinned-list)))
|
2020-01-25 03:49:42 -05:00
|
|
|
|
2022-09-10 12:38:53 +02:00
|
|
|
;; HACK: This fixes an issue present in recent builds of Emacs 29. See
|
|
|
|
;; emacs-mirror/emacs@0d383b592c2f. Straight.el uses `loaddefs-generate' if it
|
|
|
|
;; is available, which activates `emacs-lisp-mode' to read autoloads files,
|
|
|
|
;; but does so without suppressing its hooks. Some packages (like overseer)
|
|
|
|
;; add hooks to `emacs-lisp-mode-hook' in their autoloads, and once triggered,
|
|
|
|
;; they will try to load their dependencies (like dash or pkg-info), causing
|
|
|
|
;; file errors.
|
|
|
|
;; REVIEW: Report this upstream.
|
|
|
|
(defadvice! doom--fix-loaddefs-generate--parse-file-a (fn &rest args)
|
|
|
|
:around #'loaddefs-generate--parse-file
|
|
|
|
(let (emacs-lisp-mode-hook)
|
|
|
|
(apply fn args)))
|
|
|
|
|
2020-01-01 14:29:40 -05:00
|
|
|
|
2022-08-10 14:13:46 +02:00
|
|
|
;;
|
|
|
|
;;; native-comp
|
|
|
|
|
2022-08-12 20:07:08 +02:00
|
|
|
(when (featurep 'native-compile)
|
2022-08-10 14:13:46 +02:00
|
|
|
(after! comp
|
|
|
|
;; HACK Disable native-compilation for some troublesome packages
|
|
|
|
(mapc (doom-partial #'add-to-list 'native-comp-deferred-compilation-deny-list)
|
2022-08-13 21:27:11 +02:00
|
|
|
(list "/emacs-jupyter.*\\.el\\'"
|
|
|
|
"/evil-collection-vterm\\.el\\'"
|
|
|
|
"/vterm\\.el\\'"
|
2022-09-16 16:25:48 +02:00
|
|
|
"/with-editor\\.el\\'"))))
|
2022-08-10 14:13:46 +02:00
|
|
|
|
|
|
|
|
2018-05-14 15:57:54 +02:00
|
|
|
;;
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
;;; Bootstrappers
|
|
|
|
|
2020-06-04 20:02:46 -04:00
|
|
|
(defun doom--ensure-straight (recipe pin)
|
2022-05-02 02:11:52 +02:00
|
|
|
(letenv! (("GIT_CONFIG" nil)
|
|
|
|
("GIT_CONFIG_NOSYSTEM" "1")
|
|
|
|
("GIT_CONFIG_GLOBAL" (or (getenv "DOOMGITCONFIG")
|
|
|
|
"/dev/null")))
|
|
|
|
(let ((repo-dir (doom-path straight-base-dir "straight/repos/straight.el"))
|
|
|
|
(repo-url (concat "http" (if gnutls-verify-error "s")
|
|
|
|
"://github.com/"
|
2022-06-18 15:08:25 +02:00
|
|
|
(or (plist-get recipe :repo) "radian-software/straight.el")))
|
2022-05-02 02:11:52 +02:00
|
|
|
(branch (or (plist-get recipe :branch) straight-repository-branch))
|
2022-06-24 21:15:31 +02:00
|
|
|
(call (if init-file-debug
|
2022-05-02 02:11:52 +02:00
|
|
|
(lambda (&rest args)
|
|
|
|
(print! "%s" (cdr (apply #'doom-call-process args))))
|
2021-05-24 14:33:12 -04:00
|
|
|
(lambda (&rest args)
|
2022-05-02 02:11:52 +02:00
|
|
|
(apply #'doom-call-process args)))))
|
|
|
|
(unless (file-directory-p repo-dir)
|
|
|
|
(save-match-data
|
|
|
|
(unless (executable-find "git")
|
|
|
|
(user-error "Git isn't present on your system. Cannot proceed."))
|
|
|
|
(let* ((version (cdr (doom-call-process "git" "version")))
|
|
|
|
(version
|
|
|
|
(and (string-match "\\_<[0-9]+\\.[0-9]+\\(\\.[0-9]+\\)\\_>" version)
|
|
|
|
(match-string 0 version))))
|
|
|
|
(if version
|
|
|
|
(when (version< version "2.23")
|
|
|
|
(user-error "Git %s detected! Doom requires git 2.23 or newer!"
|
|
|
|
version)))))
|
|
|
|
(print! (start "Installing straight..."))
|
|
|
|
(print-group!
|
|
|
|
(cl-destructuring-bind (depth . options)
|
2022-08-07 12:24:14 +02:00
|
|
|
(ensure-list straight-vc-git-default-clone-depth)
|
2022-05-02 02:11:52 +02:00
|
|
|
(let ((branch-switch (if (memq 'single-branch options)
|
|
|
|
"--single-branch"
|
|
|
|
"--no-single-branch")))
|
|
|
|
(cond
|
|
|
|
((eq 'full depth)
|
|
|
|
(funcall call "git" "clone" "--origin" "origin"
|
|
|
|
branch-switch repo-url repo-dir))
|
|
|
|
((integerp depth)
|
|
|
|
(if (null pin)
|
|
|
|
(progn
|
|
|
|
(when (file-directory-p repo-dir)
|
|
|
|
(delete-directory repo-dir 'recursive))
|
|
|
|
(funcall call "git" "clone" "--origin" "origin" repo-url
|
|
|
|
"--no-checkout" repo-dir
|
|
|
|
"--depth" (number-to-string depth)
|
|
|
|
branch-switch
|
|
|
|
"--no-tags"
|
|
|
|
"--branch" straight-repository-branch))
|
|
|
|
(make-directory repo-dir 'recursive)
|
|
|
|
(let ((default-directory repo-dir))
|
|
|
|
(funcall call "git" "init")
|
|
|
|
(funcall call "git" "branch" "-m" straight-repository-branch)
|
|
|
|
(funcall call "git" "remote" "add" "origin" repo-url
|
|
|
|
"--master" straight-repository-branch)
|
|
|
|
(funcall call "git" "fetch" "origin" pin
|
2021-05-24 14:33:12 -04:00
|
|
|
"--depth" (number-to-string depth)
|
2022-05-02 02:11:52 +02:00
|
|
|
"--no-tags")
|
|
|
|
(funcall call "git" "reset" "--hard" pin)))))))))
|
|
|
|
(require 'straight (concat repo-dir "/straight.el"))
|
|
|
|
(doom-log "Initializing recipes")
|
|
|
|
(mapc #'straight-use-recipes
|
|
|
|
'((org-elpa :local-repo nil)
|
|
|
|
(melpa :type git :host github
|
|
|
|
:repo "melpa/melpa"
|
|
|
|
:build nil)
|
2022-09-06 19:14:24 +02:00
|
|
|
(nongnu-elpa :type git
|
|
|
|
:repo "https://git.savannah.gnu.org/git/emacs/nongnu.git"
|
|
|
|
:local-repo "nongnu-elpa"
|
|
|
|
:build nil)
|
2022-05-02 02:11:52 +02:00
|
|
|
(gnu-elpa-mirror :type git :host github
|
|
|
|
:repo "emacs-straight/gnu-elpa-mirror"
|
|
|
|
:build nil)
|
|
|
|
(el-get :type git :host github
|
|
|
|
:repo "dimitri/el-get"
|
|
|
|
:build nil)
|
|
|
|
(emacsmirror-mirror :type git :host github
|
|
|
|
:repo "emacs-straight/emacsmirror-mirror"
|
|
|
|
:build nil))))))
|
2020-06-04 20:02:46 -04:00
|
|
|
|
|
|
|
(defun doom--ensure-core-packages (packages)
|
2020-05-25 15:52:39 -04:00
|
|
|
(doom-log "Installing core packages")
|
2020-06-04 20:02:46 -04:00
|
|
|
(dolist (package packages)
|
2021-05-23 21:48:38 -04:00
|
|
|
(let* ((name (car package))
|
|
|
|
(repo (symbol-name name)))
|
2020-05-25 15:52:39 -04:00
|
|
|
(when-let (recipe (plist-get (cdr package) :recipe))
|
2021-05-23 21:48:38 -04:00
|
|
|
(straight-override-recipe (cons name recipe))
|
|
|
|
(when-let (local-repo (plist-get recipe :local-repo))
|
|
|
|
(setq repo local-repo)))
|
2021-05-25 14:16:18 -04:00
|
|
|
(print-group!
|
|
|
|
;; Only clone the package, don't build them. Straight hasn't been fully
|
|
|
|
;; configured by this point.
|
|
|
|
(straight-use-package name nil t))
|
2021-05-23 21:48:38 -04:00
|
|
|
;; In case the package hasn't been built yet.
|
2021-05-25 14:16:18 -04:00
|
|
|
(or (member (directory-file-name (straight--build-dir (symbol-name name)))
|
2021-05-23 21:48:38 -04:00
|
|
|
load-path)
|
|
|
|
(add-to-list 'load-path (directory-file-name (straight--repos-dir repo)))))))
|
2020-05-25 15:52:39 -04:00
|
|
|
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(defun doom-initialize-core-packages (&optional force-p)
|
|
|
|
"Ensure `straight' is installed and was compiled with this version of Emacs."
|
|
|
|
(when (or force-p (null (bound-and-true-p straight-recipe-repositories)))
|
|
|
|
(doom-log "Initializing straight")
|
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
(let ((packages (doom-package-list '((:core)))))
|
2020-06-04 20:02:46 -04:00
|
|
|
(cl-destructuring-bind (&key recipe pin &allow-other-keys)
|
|
|
|
(alist-get 'straight packages)
|
|
|
|
(doom--ensure-straight recipe pin))
|
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
(doom--ensure-core-packages
|
|
|
|
(seq-filter (fn! (eq (plist-get % :type) 'core))
|
|
|
|
packages)))))
|
2018-05-14 15:57:54 +02:00
|
|
|
|
2018-03-02 17:45:15 -05:00
|
|
|
(defun doom-initialize-packages (&optional force-p)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
"Process all packages, essential and otherwise, if they haven't already been.
|
2018-03-02 17:45:15 -05:00
|
|
|
|
2018-05-20 00:01:07 +02:00
|
|
|
If FORCE-P is non-nil, do it anyway.
|
2018-03-02 17:45:15 -05:00
|
|
|
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
This ensures `doom-packages' is populated and `straight' recipes are properly
|
|
|
|
processed."
|
|
|
|
(doom-initialize-core-packages force-p)
|
2019-08-15 19:52:43 -04:00
|
|
|
(when (or force-p (not (bound-and-true-p package--initialized)))
|
2019-08-23 20:33:30 -04:00
|
|
|
(doom-log "Initializing package.el")
|
2019-08-15 19:52:43 -04:00
|
|
|
(require 'package)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(package-initialize)
|
|
|
|
(unless package--initialized
|
|
|
|
(error "Failed to initialize package.el")))
|
|
|
|
(when (or force-p (null doom-packages))
|
|
|
|
(doom-log "Initializing straight.el")
|
2020-12-11 02:12:56 -05:00
|
|
|
(setq doom-disabled-packages nil
|
|
|
|
doom-packages (doom-package-list))
|
2020-12-12 15:10:53 -05:00
|
|
|
(let (packages)
|
2020-12-11 02:12:56 -05:00
|
|
|
(dolist (package doom-packages)
|
|
|
|
(cl-destructuring-bind
|
2021-05-04 16:05:09 -04:00
|
|
|
(name &key recipe disable ignore &allow-other-keys) package
|
2021-01-04 08:42:57 +09:00
|
|
|
(if ignore
|
|
|
|
(straight-override-recipe (cons name '(:type built-in)))
|
2020-12-11 02:12:56 -05:00
|
|
|
(if disable
|
|
|
|
(cl-pushnew name doom-disabled-packages)
|
|
|
|
(when recipe
|
|
|
|
(straight-override-recipe (cons name recipe)))
|
2020-12-12 15:10:53 -05:00
|
|
|
(appendq! packages (cons name (straight--get-dependencies name)))))))
|
|
|
|
(dolist (package (cl-delete-duplicates packages :test #'equal))
|
|
|
|
(straight-register-package package)
|
|
|
|
(let ((name (symbol-name package)))
|
|
|
|
(add-to-list 'load-path (directory-file-name (straight--build-dir name)))
|
|
|
|
(straight--load-package-autoloads name))))))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
|
|
|
|
|
|
|
|
;;
|
|
|
|
;;; Package management API
|
|
|
|
|
|
|
|
(defun doom-package-get (package &optional prop nil-value)
|
|
|
|
"Returns PACKAGE's `package!' recipe from `doom-packages'."
|
|
|
|
(let ((plist (cdr (assq package doom-packages))))
|
|
|
|
(if prop
|
|
|
|
(if (plist-member plist prop)
|
|
|
|
(plist-get plist prop)
|
|
|
|
nil-value)
|
|
|
|
plist)))
|
|
|
|
|
|
|
|
(defun doom-package-set (package prop value)
|
|
|
|
"Set PROPERTY in PACKAGE's recipe to VALUE."
|
|
|
|
(setf (alist-get package doom-packages)
|
|
|
|
(plist-put (alist-get package doom-packages)
|
|
|
|
prop value)))
|
|
|
|
|
|
|
|
(defun doom-package-recipe (package &optional prop nil-value)
|
|
|
|
"Returns the `straight' recipe PACKAGE was registered with."
|
2021-01-08 23:56:27 -05:00
|
|
|
(let* ((recipe (straight-recipes-retrieve package))
|
|
|
|
(plist (doom-plist-merge
|
|
|
|
(plist-get (alist-get package doom-packages) :recipe)
|
|
|
|
(cdr (if (memq (car recipe) '(quote \`))
|
|
|
|
(eval recipe t)
|
|
|
|
recipe)))))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(if prop
|
|
|
|
(if (plist-member plist prop)
|
|
|
|
(plist-get plist prop)
|
|
|
|
nil-value)
|
|
|
|
plist)))
|
|
|
|
|
|
|
|
(defun doom-package-recipe-repo (package)
|
|
|
|
"Resolve and return PACKAGE's (symbol) local-repo property."
|
2021-01-08 23:56:27 -05:00
|
|
|
(if-let* ((recipe (copy-sequence (doom-package-recipe package)))
|
|
|
|
(recipe (if (and (not (plist-member recipe :type))
|
|
|
|
(memq (plist-get recipe :host) '(github gitlab bitbucket)))
|
|
|
|
(plist-put recipe :type 'git)
|
|
|
|
recipe))
|
|
|
|
(repo (if-let (local-repo (plist-get recipe :local-repo))
|
2021-03-04 14:09:40 -05:00
|
|
|
(directory-file-name local-repo)
|
2021-01-08 23:56:27 -05:00
|
|
|
(ignore-errors (straight-vc-local-repo-name recipe)))))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
repo
|
|
|
|
(symbol-name package)))
|
|
|
|
|
|
|
|
(defun doom-package-build-recipe (package &optional prop nil-value)
|
|
|
|
"Returns the `straight' recipe PACKAGE was installed with."
|
|
|
|
(let ((plist (nth 2 (gethash (symbol-name package) straight--build-cache))))
|
|
|
|
(if prop
|
|
|
|
(if (plist-member plist prop)
|
|
|
|
(plist-get plist prop)
|
|
|
|
nil-value)
|
|
|
|
plist)))
|
|
|
|
|
2021-10-09 19:37:03 +02:00
|
|
|
(defun doom-package-dependencies (package &optional recursive noerror)
|
|
|
|
"Return a list of dependencies for a package.
|
|
|
|
|
|
|
|
If RECURSIVE is `tree', return a tree of dependencies.
|
|
|
|
If RECURSIVE is nil, only return PACKAGE's immediate dependencies.
|
|
|
|
If NOERROR, return nil in case of error."
|
|
|
|
(cl-check-type package symbol)
|
|
|
|
(let ((deps (straight-dependencies (symbol-name package))))
|
|
|
|
(pcase recursive
|
|
|
|
(`tree deps)
|
|
|
|
(`t (flatten-list deps))
|
|
|
|
(`nil (cl-remove-if #'listp deps)))))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
|
|
|
|
(defun doom-package-depending-on (package &optional noerror)
|
2021-01-26 18:30:16 -05:00
|
|
|
"Return a list of packages that depend on PACKAGE.
|
|
|
|
|
|
|
|
If PACKAGE (a symbol) isn't installed, throw an error, unless NOERROR is
|
|
|
|
non-nil."
|
|
|
|
(cl-check-type package symbol)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
;; can't get dependencies for built-in packages
|
2021-01-26 18:30:16 -05:00
|
|
|
(unless (or (doom-package-build-recipe package)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
noerror)
|
2021-01-26 18:30:16 -05:00
|
|
|
(error "Couldn't find %s, is it installed?" package))
|
2021-10-09 19:37:03 +02:00
|
|
|
(straight-dependents (symbol-name package)))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
|
|
|
|
;;; Predicate functions
|
|
|
|
(defun doom-package-built-in-p (package)
|
|
|
|
"Return non-nil if PACKAGE (a symbol) is built-in."
|
|
|
|
(eq (doom-package-build-recipe package :type)
|
|
|
|
'built-in))
|
|
|
|
|
|
|
|
(defun doom-package-installed-p (package)
|
|
|
|
"Return non-nil if PACKAGE (a symbol) is installed."
|
|
|
|
(file-directory-p (straight--build-dir (symbol-name package))))
|
|
|
|
|
|
|
|
(defun doom-package-is-type-p (package type)
|
|
|
|
"TODO"
|
2022-08-07 12:24:14 +02:00
|
|
|
(memq type (ensure-list (doom-package-get package :type))))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
|
|
|
|
(defun doom-package-in-module-p (package category &optional module)
|
|
|
|
"Return non-nil if PACKAGE was installed by the user's private config."
|
|
|
|
(when-let (modules (doom-package-get package :modules))
|
2022-08-13 21:27:11 +02:00
|
|
|
(or (and (not module) (assq :user modules))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(member (cons category module) modules))))
|
|
|
|
|
|
|
|
(defun doom-package-backend (package)
|
|
|
|
"Return 'straight, 'builtin, 'elpa or 'other, depending on how PACKAGE is
|
|
|
|
installed."
|
|
|
|
(cond ((gethash (symbol-name package) straight--build-cache)
|
|
|
|
'straight)
|
|
|
|
((or (doom-package-built-in-p package)
|
|
|
|
(assq package package--builtins))
|
|
|
|
'builtin)
|
|
|
|
((assq package package-alist)
|
|
|
|
'elpa)
|
|
|
|
((locate-library (symbol-name package))
|
|
|
|
'other)))
|
|
|
|
|
|
|
|
|
|
|
|
;;; Package getters
|
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
(defun doom-packages--read (file &optional noeval noerror)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(condition-case-unless-debug e
|
|
|
|
(with-temp-buffer ; prevent buffer-local state from propagating
|
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
(let* ((doom--current-module (doom-module-from-path file))
|
|
|
|
(doom--current-flags
|
|
|
|
(doom-module-get (car doom--current-module)
|
|
|
|
(cdr doom--current-module)
|
|
|
|
:flags)))
|
|
|
|
(if (not noeval)
|
|
|
|
(load file noerror 'nomessage 'nosuffix)
|
|
|
|
(when (file-exists-p file)
|
|
|
|
(insert-file-contents file)
|
|
|
|
(let (emacs-lisp-mode) (emacs-lisp-mode))
|
|
|
|
;; Scrape `package!' blocks from FILE for a comprehensive listing of
|
|
|
|
;; packages used by this module.
|
|
|
|
(while (search-forward "(package!" nil t)
|
|
|
|
(let ((ppss (save-excursion (syntax-ppss))))
|
|
|
|
;; Don't collect packages in comments or strings
|
|
|
|
(unless (or (nth 3 ppss)
|
|
|
|
(nth 4 ppss))
|
|
|
|
(goto-char (match-beginning 0))
|
|
|
|
(cl-destructuring-bind (_ name . plist)
|
|
|
|
(read (current-buffer))
|
|
|
|
(push (cons
|
|
|
|
name (plist-put
|
|
|
|
plist :modules
|
|
|
|
(list doom--current-module)))
|
|
|
|
doom-packages)))))))))
|
2021-05-06 15:54:10 -04:00
|
|
|
(user-error
|
|
|
|
(user-error (error-message-string e)))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(error
|
|
|
|
(signal 'doom-package-error
|
|
|
|
(list (doom-module-from-path file)
|
|
|
|
file e)))))
|
|
|
|
|
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
(defun doom-package-list (&optional module-list)
|
|
|
|
"Retrieve a list of explicitly declared packages from MODULE-LIST.
|
|
|
|
|
|
|
|
If MODULE-LIST is omitted, read enabled module list in configdepth order (see
|
|
|
|
`doom-module-set'). Otherwise, MODULE-LIST may be any symbol (or t) to mean read
|
|
|
|
all modules in `doom-modules-dir', including :core and :user. MODULE-LIST may
|
|
|
|
also be a list of module keys."
|
|
|
|
(let ((module-list (cond ((null module-list) (doom-module-list))
|
|
|
|
((symbolp module-list) (doom-module-list 'all))
|
|
|
|
(module-list)))
|
|
|
|
;; TODO: doom-module-context + doom-context
|
2022-09-24 10:45:50 +02:00
|
|
|
(packages-file doom-module-packages-file)
|
2020-08-18 17:16:06 -04:00
|
|
|
doom-disabled-packages
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
doom-packages)
|
fix: add :depth field to modules
This introduces a depth field for modules so that they may dictate their
load order explicitly, it also treats depths <= -100 or >= 100 as
special depths, which will be loaded early, before their respective
doom-{before,after}-module-{init,config}-hook. This permits psuedo
modules like :core and :user modules to be treated as normal modules
without too many special cases.
This also fixes a module load order issue on Emacs 29 (#6813), caused by
emacs-mirror/emacs@4311bd0bd73c, which changed the return value order of
hash-table-{keys,values} causing modules to be loaded in reverse order;
resulting in the loss of evil keybinds, among other things.
Other notable changes:
- Changes the data structure for module data caches from a list to a
vector. Uses less memory and permits faster lookups. Also adds two
depth fields to the front of it.
- Changes the signature of doom-module-list and doom-package-list.
- Renames doom--read-packages -> doom-packages--read for consistency
with naming convention.
- Add doom-module-depth function.
- Adds a temporary doom-core-dir/init.el file, which is responsible for
loading doom-*.el.
Fix: #6813
Ref: emacs-mirror/emacs@4311bd0bd73c
2022-09-23 18:55:20 +02:00
|
|
|
(when (assq :user module-list)
|
|
|
|
;; We load the private packages file twice to populate
|
|
|
|
;; `doom-disabled-packages' disabled packages are seen ASAP, and a
|
|
|
|
;; second time to ensure privately overridden packages are properly
|
|
|
|
;; overwritten.
|
|
|
|
(let (doom-packages)
|
|
|
|
(doom-packages--read (doom-module-expand-path :user nil packages-file)
|
|
|
|
nil 'noerror)))
|
|
|
|
(cl-loop for (cat . mod) in module-list
|
|
|
|
if (doom-module-locate-path cat mod packages-file)
|
|
|
|
do (doom-packages--read it nil 'noerror))
|
|
|
|
(nreverse doom-packages)))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
|
|
|
|
(defun doom-package-pinned-list ()
|
|
|
|
"Return an alist mapping package names (strings) to pinned commits (strings)."
|
|
|
|
(let (alist)
|
|
|
|
(dolist (package doom-packages alist)
|
|
|
|
(cl-destructuring-bind (name &key disable ignore pin unpin &allow-other-keys)
|
|
|
|
package
|
|
|
|
(when (and (not ignore)
|
|
|
|
(not disable)
|
|
|
|
(or pin unpin))
|
2021-03-04 14:09:40 -05:00
|
|
|
(setf (alist-get (file-name-nondirectory (doom-package-recipe-repo name))
|
|
|
|
alist nil 'remove #'equal)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(unless unpin pin)))))))
|
|
|
|
|
|
|
|
(defun doom-package-recipe-list ()
|
|
|
|
"Return straight recipes for non-builtin packages with a local-repo."
|
|
|
|
(let (recipes)
|
|
|
|
(dolist (recipe (hash-table-values straight--recipe-cache))
|
2020-05-25 15:58:28 -04:00
|
|
|
(cl-destructuring-bind (&key local-repo type &allow-other-keys)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
recipe
|
|
|
|
(unless (or (null local-repo)
|
2020-05-25 15:58:28 -04:00
|
|
|
(eq type 'built-in))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(push recipe recipes))))
|
|
|
|
(nreverse recipes)))
|
|
|
|
|
2017-02-06 00:13:24 -05:00
|
|
|
|
2017-02-11 00:46:42 -05:00
|
|
|
;;
|
2019-07-21 15:39:45 +02:00
|
|
|
;;; Module package macros
|
2017-01-16 23:15:48 -05:00
|
|
|
|
2019-07-22 22:30:35 +02:00
|
|
|
(cl-defmacro package!
|
2021-05-04 16:05:09 -04:00
|
|
|
(name &rest plist &key built-in recipe ignore _type _pin _disable)
|
2017-07-02 16:47:02 +02:00
|
|
|
"Declares a package and how to install it (if applicable).
|
|
|
|
|
|
|
|
This macro is declarative and does not load nor install packages. It is used to
|
|
|
|
populate `doom-packages' with metadata about the packages Doom needs to keep
|
|
|
|
track of.
|
|
|
|
|
2018-04-03 15:00:52 -04:00
|
|
|
Only use this macro in a module's packages.el file.
|
2017-02-04 21:07:54 -05:00
|
|
|
|
2017-02-11 00:46:42 -05:00
|
|
|
Accepts the following properties:
|
2017-02-03 20:10:40 -05:00
|
|
|
|
2020-05-15 05:32:11 -04:00
|
|
|
:type core|local|built-in|virtual
|
|
|
|
Specifies what kind of package this is. Can be a symbol or a list thereof.
|
|
|
|
`core' = this is a protected package and cannot be disabled!
|
|
|
|
`local' = this package is being modified in-place. This package's repo is
|
|
|
|
unshallowed and will be skipped when you update packages.
|
|
|
|
`built-in' = this package is already built-in (otherwise, will be
|
|
|
|
installed)
|
|
|
|
`virtual' = this package is not tracked by Doom's package manager. It won't
|
|
|
|
be installed or uninstalled. Use this to pin 2nd order dependencies.
|
2018-03-26 16:44:24 -04:00
|
|
|
:recipe RECIPE
|
2019-12-24 00:01:17 -05:00
|
|
|
Specifies a straight.el recipe to allow you to acquire packages from external
|
2022-06-17 15:42:15 +02:00
|
|
|
sources. See https://github.com/radian-software/straight.el#the-recipe-format
|
|
|
|
for details on this recipe.
|
2018-03-26 16:44:24 -04:00
|
|
|
:disable BOOL
|
2019-09-13 13:58:43 -04:00
|
|
|
Do not install or update this package AND disable all of its `use-package!'
|
2019-12-24 00:01:17 -05:00
|
|
|
and `after!' blocks.
|
2018-03-26 16:44:24 -04:00
|
|
|
:ignore FORM
|
2018-03-26 18:15:03 -04:00
|
|
|
Do not install this package.
|
2019-12-24 00:01:17 -05:00
|
|
|
:pin STR|nil
|
|
|
|
Pin this package to commit hash STR. Setting this to nil will unpin this
|
|
|
|
package if previously pinned.
|
|
|
|
:built-in BOOL|'prefer
|
|
|
|
Same as :ignore if the package is a built-in Emacs package. This is more to
|
|
|
|
inform help commands like `doom/help-packages' that this is a built-in
|
|
|
|
package. If set to 'prefer, the package will not be installed if it is
|
|
|
|
already provided by Emacs.
|
2018-05-15 23:11:48 +02:00
|
|
|
|
|
|
|
Returns t if package is successfully registered, and nil if it was disabled
|
|
|
|
elsewhere."
|
2017-01-16 23:15:48 -05:00
|
|
|
(declare (indent defun))
|
2019-11-17 16:43:23 -05:00
|
|
|
(when (and recipe (keywordp (car-safe recipe)))
|
2022-06-14 20:25:39 +02:00
|
|
|
(cl-callf plist-put plist :recipe `(quote ,recipe)))
|
2019-12-24 02:35:07 -05:00
|
|
|
;; :built-in t is basically an alias for :ignore (locate-library NAME)
|
2019-11-17 16:43:23 -05:00
|
|
|
(when built-in
|
2019-12-24 02:35:07 -05:00
|
|
|
(when (and (not ignore)
|
|
|
|
(equal built-in '(quote prefer)))
|
2021-05-05 15:55:44 -04:00
|
|
|
(setq built-in `(locate-library ,(symbol-name name) nil (get 'load-path 'initial-value))))
|
2022-06-17 14:28:41 +02:00
|
|
|
(cl-callf map-delete plist :built-in)
|
2022-06-14 20:25:39 +02:00
|
|
|
(cl-callf plist-put plist :ignore built-in))
|
2019-10-25 02:36:02 -04:00
|
|
|
`(let* ((name ',name)
|
2022-09-10 20:41:21 +02:00
|
|
|
(plist (cdr (assq name doom-packages)))
|
|
|
|
(dir (dir!)))
|
2019-12-24 02:35:07 -05:00
|
|
|
;; Record what module this declaration was found in
|
2022-09-10 20:41:21 +02:00
|
|
|
(let ((module-list (plist-get plist :modules))
|
|
|
|
(module (doom-module-from-path dir)))
|
2019-10-25 02:36:02 -04:00
|
|
|
(unless (member module module-list)
|
2022-06-14 20:25:39 +02:00
|
|
|
(cl-callf plist-put plist :modules
|
|
|
|
(append module-list
|
|
|
|
(list module)
|
2022-09-10 18:59:02 +02:00
|
|
|
(when (file-in-directory-p dir doom-user-dir)
|
2022-08-13 21:27:11 +02:00
|
|
|
'((:user . modules)))
|
2022-06-14 20:25:39 +02:00
|
|
|
nil))))
|
2019-12-24 02:35:07 -05:00
|
|
|
;; Merge given plist with pre-existing one
|
2022-06-17 18:58:36 +02:00
|
|
|
(cl-loop for (key value) on (list ,@plist) by 'cddr
|
|
|
|
when value
|
|
|
|
do (cl-callf plist-put plist key value))
|
2020-04-08 15:29:29 -04:00
|
|
|
;; Some basic key validation; throws an error on invalid properties
|
2019-11-17 16:43:23 -05:00
|
|
|
(condition-case e
|
2019-12-26 02:40:56 -05:00
|
|
|
(when-let (recipe (plist-get plist :recipe))
|
|
|
|
(cl-destructuring-bind
|
2022-07-23 16:39:30 +02:00
|
|
|
(&key local-repo _files _flavor _build _pre-build _post-build
|
|
|
|
_includes _type _repo _host _branch _protocol _remote
|
|
|
|
_nonrecursive _fork _depth _source _inherit)
|
2019-12-26 02:40:56 -05:00
|
|
|
recipe
|
|
|
|
;; Expand :local-repo from current directory
|
|
|
|
(when local-repo
|
2022-06-14 20:25:39 +02:00
|
|
|
(cl-callf plist-put plist :recipe
|
|
|
|
(plist-put recipe :local-repo
|
2022-09-10 20:41:21 +02:00
|
|
|
(let ((local-path (expand-file-name local-repo dir)))
|
2022-06-14 20:25:39 +02:00
|
|
|
(if (file-directory-p local-path)
|
|
|
|
local-path
|
|
|
|
local-repo)))))))
|
2019-11-17 16:43:23 -05:00
|
|
|
(error
|
|
|
|
(signal 'doom-package-error
|
|
|
|
(cons ,(symbol-name name)
|
|
|
|
(error-message-string e)))))
|
2020-08-18 17:16:06 -04:00
|
|
|
;; These are the only side-effects of this macro!
|
2019-10-25 02:36:02 -04:00
|
|
|
(setf (alist-get name doom-packages) plist)
|
2020-08-18 17:16:06 -04:00
|
|
|
(if (plist-get plist :disable)
|
|
|
|
(add-to-list 'doom-disabled-packages name)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(with-no-warnings
|
|
|
|
(cons name plist)))))
|
2017-01-28 02:02:16 -05:00
|
|
|
|
2018-03-26 02:58:22 -04:00
|
|
|
(defmacro disable-packages! (&rest packages)
|
:boom: revise advice naming convention (1/2)
This is first of three big naming convention updates that have been a
long time coming. With 2.1 on the horizon, all the breaking updates will
batched together in preparation for the long haul.
In this commit, we do away with the asterix to communicate that a
function is an advice function, and we replace it with the '-a' suffix.
e.g.
doom*shut-up -> doom-shut-up-a
doom*recenter -> doom-recenter-a
+evil*static-reindent -> +evil--static-reindent-a
The rationale behind this change is:
1. Elisp's own formatting/indenting tools would occasionally struggle
with | and * (particularly pp and cl-prettyprint). They have no
problem with / and :, fortunately.
2. External syntax highlighters (like pygmentize, discord markdown or
github markdown) struggle with it, sometimes refusing to highlight
code beyond these symbols.
3. * and | are less expressive than - and -- in communicating the
intended visibility, versatility and stability of a function.
4. It complicated the regexps we must use to search for them.
5. They were arbitrary and over-complicated to begin with, decided
on haphazardly way back when Doom was simply "my private config".
Anyhow, like how predicate functions have the -p suffix, we'll adopt the
-a suffix for advice functions, -h for hook functions and -fn for
variable functions.
Other noteable changes:
- Replaces advice-{add,remove}! macro with new def-advice!
macro. The old pair weren't as useful. The new def-advice! saves on a
lot of space.
- Removed "stage" assertions to make sure you were using the right
macros in the right place. Turned out to not be necessary, we'll
employ better checks later.
2019-07-18 15:42:52 +02:00
|
|
|
"A convenience macro for disabling packages in bulk.
|
|
|
|
Only use this macro in a module's (or your private) packages.el file."
|
2019-01-02 13:17:26 -05:00
|
|
|
(macroexp-progn
|
2020-04-08 15:29:29 -04:00
|
|
|
(mapcar (lambda (p) `(package! ,p :disable t))
|
|
|
|
packages)))
|
2018-03-26 02:58:22 -04:00
|
|
|
|
2020-01-14 21:39:19 -05:00
|
|
|
(defmacro unpin! (&rest targets)
|
|
|
|
"Unpin packages in TARGETS.
|
|
|
|
|
2020-01-14 23:05:17 -05:00
|
|
|
This unpins packages, so that 'doom upgrade' downloads their latest version. It
|
|
|
|
can be used one of five ways:
|
2020-01-14 21:39:19 -05:00
|
|
|
|
2021-10-09 19:55:47 +02:00
|
|
|
- To disable pinning wholesale: (unpin! t)
|
|
|
|
- To unpin individual packages: (unpin! packageA packageB ...)
|
|
|
|
- To unpin all packages in a group of modules: (unpin! :lang :tools ...)
|
|
|
|
- To unpin packages in individual modules:
|
2020-01-15 00:45:43 -05:00
|
|
|
(unpin! (:lang python javascript) (:tools docker))
|
2020-01-14 23:05:17 -05:00
|
|
|
|
2020-01-28 17:54:51 -05:00
|
|
|
Or any combination of the above.
|
|
|
|
|
|
|
|
This macro should only be used from the user's private packages.el. No module
|
|
|
|
should use it!"
|
|
|
|
(if (memq t targets)
|
|
|
|
`(mapc (doom-rpartial #'doom-package-set :unpin t)
|
|
|
|
(mapcar #'car doom-packages))
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
(macroexp-progn
|
|
|
|
(mapcar
|
|
|
|
(lambda (target)
|
|
|
|
(when target
|
|
|
|
`(doom-package-set ',target :unpin t)))
|
|
|
|
(cl-loop for target in targets
|
|
|
|
if (or (keywordp target) (listp target))
|
|
|
|
append
|
2022-08-07 12:24:14 +02:00
|
|
|
(cl-loop with (category . modules) = (ensure-list target)
|
Backport bits of CLI rewrite
The rewrite for Doom's CLI is taking a while, so I've backported a few
important changes in order to ease the transition and fix a couple bugs
sooner.
Fixes #2802, #2737, #2386
The big highlights are:
- Fix #2802: We now update recipe repos *before* updating/installing any
new packages. No more "Could not find package X in recipe repositories".
- Fix #2737: An edge case where straight couldn't reach a pinned
commit (particularly with agda).
- Doom is now smarter about what option it recommends when straight
prompts you to make a choice.
- Introduces a new init path for Doom. The old way:
- Launch in "minimal" CLI mode in non-interactive sessions
- Launch a "full" interactive mode otherwise.
The new way
- Launch in "minimal" CLI mode *only* for bin/doom
- Launch is a simple mode for non-interactive sessions that still need
access to your interactive config (like async org export/babel).
- Launch a "full" interactive mode otherwise.
This should fix compatibility issues with plugins that use the
async.el library or spawn child Emacs processes to fake
parallelization (like org's async export and babel functionality).
- Your private init.el is now loaded more reliably when running any
bin/doom command. This gives you an opportunity to configure its
settings.
- Added doom-first-{input,buffer,file}-hook hooks, which we use to queue
deferred activation of a number of packages. Users can remove these
modes from these hooks; altogether preventing them from loading,
rather than waiting for them to load to then disable them,
e.g. (after! smartparens (smartparens-global-mode -1)) -> (remove-hook
'doom-first-buffer #'smartparens-global-mode)
Hooks added to doom-first-*-hook variables will be removed once they
run.
This should also indirectly fix #2386, by preventing interactive modes
from running in non-interactive session.
- Added `doom/bump-*` commands to make bumping modules and packages
easier, and `doom/bumpify-*` commands for converting package!
statements into user/repo@sha1hash format for bump commits.
- straight.el is now commit-pinned, like all other packages. We also
more reliably install straight.el by cloning it ourselves, rather than
relying on its bootstrap.el.
This should prevent infinite "straight has diverged from master"
prompts whenever we change branches (though, you might have to put up
with it one more after this update -- see #2937 for workaround).
All the other minor changes:
- Moved core/autoload/cli.el to core/autoload/process.el
- The package manager will log attempts to check out pinned commits
- If package state is incomplete while rebuilding packages, emit a
simpler error message instead of an obscure one!
- Added -u switch to 'doom sync' to make it run 'doom update' afterwards
- Added -p switch to 'doom sync' to make it run 'doom purge' afterwards
- Replace doom-modules function with doom-modules-list
- The `with-plist!` macro was removed, since `cl-destructuring-bind`
already serves that purpose well enough.
- core/autoload/packages.el was moved into core-packages.el
- bin/doom will no longer die if DOOMDIR or DOOMLOCALDIR don't have a
trailing slash
- Introduces doom-debug-variables; a list of variables to toggle on
doom/toggle-debug-mode.
- The sandbox has been updated to reflect the above changes, also:
1. Child instances will no longer inherit the process environment of
the host instance,
2. It will no longer produce an auto-save-list directory in ~/.emacs.d
2020-05-14 15:00:23 -04:00
|
|
|
for (name . plist) in doom-packages
|
|
|
|
for pkg-modules = (plist-get plist :modules)
|
|
|
|
if (and (assq category pkg-modules)
|
|
|
|
(or (null modules)
|
|
|
|
(cl-loop for module in modules
|
|
|
|
if (member (cons category module) pkg-modules)
|
|
|
|
return t))
|
|
|
|
name)
|
|
|
|
collect it)
|
|
|
|
else if (symbolp target)
|
|
|
|
collect target)))))
|
2020-01-14 21:39:19 -05:00
|
|
|
|
2022-07-30 21:49:00 +02:00
|
|
|
(provide 'doom-packages)
|
|
|
|
;;; doom-packages.el ends here
|