Commit Graph

185 Commits

Author SHA1 Message Date
b58b5e1d64 Fix auto-removal of builtin-preferred packges 2019-07-07 14:07:41 +02:00
d8e7a2003b Fix custom.el writing to DOOMDIR/init.el too early
This would cause ~/.doom.d/init.el to exist before `doom quickstart` can
copy ~/.emacs.d/init.example.el into it, causing some newcomers to
experience a wrong-type-argument: hash-table-p error at startup (and no
modules being enabled).
2019-07-02 23:17:20 +02:00
5e9c020c21 doom-files-in: replace NOSORT w/ SORT; change default MATCH
- SORT defaults to t
- MATCH's new default regexp excludes files that start with underscore.
2019-06-16 19:16:23 +02:00
6641e26283 Refactor package management API
Sets out to solve a number of issues with the package management
process. Namely:

- To-be-removed packages that are simply being removed are no longer
  incorrectly labeled "quelpa->elpa", but "removed" instead.
- A backend (elpa vs quelpa) column was added to the package listing
  confirmation when running `doom update`.
- Doom now correctly recognizes that packages installed with a psuedonym
  are installed, and will not endlessly attempt to uninstall and
  reinstall them on every `doom refresh`.
- Packages declared with :built-in will no longer lose their built-in
  marking if said package is not actually present in Emacs' site load
  paths. i.e. if you say it's built in, Doom won't question it.
- package!'s :ignore property is now treated as a form whose evaluated
  result will be used as its value.
2019-06-11 08:01:42 +02:00
9860cebe9f Don't save package-selected-packages to custom-file
It's already saved in doom-package-autoload-file
2019-05-28 23:47:52 -04:00
cb172becd9 Make doom-get-outdated-packages synchronous
Concurrency doesn't speed this up enough to justify its problems. It
swallows errors emitted from the child processes and a child process can
block indefinitely.
2019-04-24 18:16:06 -04:00
fa7f7042b0 Add and expand doom/help* commands
Adds the following commands:

- doom/help (opens the Doom manual)
- doom/help-search (for searching through org headlines in Doom's
  documentation)
- doom/help-faq (for searching the FAQ)
- doom/help-news (for browsing the Doom newsletters)
- doom/help-autodefs (renamed from doom/describe-autodef -- for looking
  up documentation on autodef function/macros, like
  `set-lookup-handler!`)
- doom/help-modules (renamed from doom/describe-module, for jumping to a
  Doom module's documentation)
- doom/help-packages (renamed from doom/describe-package and recently
  fixed -- looks up information about installed packages, including what
  Doom module(s) install it and where it is configured)
- doom/help-package-config (for searching and jumping to any block where
  a package is configured in Doom Emacs)

Also adds the SPC h d (or C-h d) prefix for Doom-specific help commands.
SPC h D will invoke doom/help.

However, the documentation itself hasn't been committed yet, so some of
these commands may be useless atm. Sorry!
2019-04-24 18:16:06 -04:00
82622c2d8f Fix package.el command substitutions
doom//autoremove and doom//install are more appropriate replacements for
package-autoremove and package-install-selected-packages, respectively.
2019-03-14 17:59:24 -04:00
bca814cb7c Fix listp error when updating #1235
The async process wasn't mapping through doom-package-outdated-p, only
filtered.

Also ensure no less than two packages per thread are checked.
2019-03-12 11:50:27 -04:00
867f94e23a Refactor doom-get-outdated-packages
May address #1235
2019-03-11 18:46:52 -04:00
c3a9828fa3 Allow doom-package-list to scrape *all* packages
Even ones that are conditional. This does mean its plist is unevaluated,
however.
2019-03-10 08:10:59 -04:00
a443d9ab07 Refactor doom-initialize-packages & package API
- Packages are initialized once, when package.el is first loaded, and
  must be updated manually via doom/reload-packages.
- Package->module association is now stored in the package's PLIST under
  :modules. This is an internal property and cannot be explicitly set
  through `package!'
- Add doom-package-list function
- Rename doom-get-packages to doom-find-packages
- Updated doom-find-packages' docstring
- Added the :core filter to doom-find-packages
- Simplified doom-initialize-packages
- doom/reload calls doom/reload-packages if necessary.
- Fix redundant properties in doom-packages
- Remove tracking of after!, def-package! and def-package-hook! blocks.
  Replaced with doom-package-list being able to see all packages, even
  in disabled modules.
- Add :built-in property to package! for dummy packages. This is
  important so that doom/describe-package can see built-in packages.
2019-03-08 04:25:44 -05:00
31688c921d Refactor doom-get-outdated-packages
Partitions quelpa packages so there are 4 threads tops.
2019-03-08 02:34:26 -05:00
fbcb4e6973 Minor refactor across the board 2019-03-04 20:47:26 -05:00
f6cc2644b0 New doom-log macro for debug-time logging
doom-log won't interfere with the minibuffer if it's in use, and will
report the originating module.

Addresses #1215
2019-03-04 18:38:25 -05:00
f0ad9b7585 Ensure explicitly installed pkgs are user-selected 2019-03-04 04:57:07 -05:00
c82faf7f10 General reformatting & minor refactors 2019-02-19 15:53:26 -05:00
a3694edb15 Fix doom/update-package 2019-01-24 02:13:16 -05:00
efa577dec2 Improve error-handling in doom/update-package 2019-01-21 17:39:42 -05:00
31a0ad5b95 Move doom--condition-case! to core/cli/packages
The only place it is being used
2019-01-10 15:44:42 -05:00
377dbae3fc Install/compile packages in order of declaration
This should fix an issue where a package A, which uses macros from a
package B, is installed before package B, causing void-function errors.

The currently known and affected packages are neotree, parinfer, and
evil-collection.
2018-09-25 11:00:30 -04:00
4d10c28c37 Change doom-ansi-apply, print! & format!
Color let-functions no longer take format string arguments. e.g.

  (format! (red "Hello %s" "world"))

Becomes

  (format! (red "Hello %s") "world")

The same goes for print!. Also, doom-ansi-apply now takes two arguments
instead of three.

Also merges doom-message-{fg,bg,fx} into doom-ansi-alist, and reduces
backtrace noise when errors originate from inside these macros.
2018-09-09 09:58:20 -04:00
f7ad520ee0 doom update: prevent GC in async instances
Offers a marginal improved to outdated check times.
2018-09-09 09:58:20 -04:00
309fd767d6 Add :deps property to doom-get-packages
Also fixes an issue where doom install wouldn't catch missing
dependnecies of desired packages.

If :dep is non-nil, doom-get-packages will include package dependencies
in the resulting package list.
2018-09-09 09:58:20 -04:00
77d2d84e14 Refactor core-cli
Moved to separate files for better organization.
2018-09-09 09:58:20 -04:00
7d3ffdff06 Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
2ee177d588 Don't invoke debugger on "Aborted" messages 2018-08-02 16:41:19 +02:00
196638bf47 Improve handling for arbitrary package errors
e.g. if the package doesn't exist, it shouldn't simply die.
2018-06-24 22:23:09 +02:00
e99ae5382c Refactor package! macro
And have :ignore and :freeze be evaluated during package management,
rather than during macro expansion/compile time.

Also gives doom-package-prop a third, boolean argument. If non-nil,
`eval' the return value.
2018-06-24 22:23:08 +02:00
adf143a853 Fix void-variable error when installing packages
Caused by a haphazardly refactor in f6dc6ac7.
2018-06-23 20:11:43 +02:00
f6dc6ac74e Refactor out map.el usage
After some profiling, it turns out map-put and map-delete are 5-7x
slower (more on Emacs 25) than delq, setf/alist-get and add-to-list for
small lists (under 250 items), which is exactly how I've been using
them.

The only caveat is alist-get's signature is different on Emacs 25, thus
a polyfill is necessary in core-lib.
2018-06-23 19:53:54 +02:00
d4ba03791f Don't async refresh package contents
The performance benefit is minor and the loss of feedback is major in
case of errors.
2018-06-20 12:45:03 +02:00
71f0b3ba10 Minor error handler refactor in package management
Allow debugger to produce better backtraces.
2018-06-20 02:23:55 +02:00
03022d09f9 Remove doom//x naming convention
This naming convention was meant to be for batch commands, but it grew
to include "commands that were helpful with managing Doom", but many of
these commands shouldn't be interactive in the first place!
2018-06-17 21:35:58 +02:00
36992037d1 Update package dir mtimes for stale checks
This helps doom//reload-package-autoloads detect if packages have
changed.
2018-06-17 14:45:07 +02:00
69c6e0b8fb Add doom-get-package-alist
New function returns a list of (NAME . DESC) cons cells in the order
they were declared (in module packages.el files).

Fixes a load-order issue where autoloads from one package would depend
on the autoloads of another package, but was inserted into
doom-package-autoload-file *before* the depended package, causing
void-variable errors.

Also allows for a big refactor of the :plugins byte-compile target.
2018-06-14 03:36:46 +02:00
b6f9bc9675 Fix package manager not :ignore'ing packages 2018-06-13 22:15:08 +02:00
1c3183b298 Remove space in backend labels during install
Minor reformatting. To be consistent with the backend transition labels
in doom//packages-autoremove.
2018-06-12 00:02:04 +02:00
72201fead5 Major refactor of package management API
Fixes issues where:

+ package!'s :disable property was ignored and def-package! wouldn't
  ignore disabled packages.
+ Certain quelpa packages were being removed/reinstalled infinitely
+ Improved flexibility of doom-get-packages (its docstring needs to be
  updated!)
2018-06-12 00:02:04 +02:00
0741c8851a Split core-packages into two (packages & modules)
+ Move doom-initialize et co into core.el
+ Lazy load core-packages
+ load! has been moved into core-lib
+ Added FILE! and DIR! macros
+ Fix package! not returning correct value when package is disabled
+ Remove :disabled support for def-package-hook! officially
2018-06-12 00:02:04 +02:00
2d5ac8a164 Fix void-variable package--builtins error
Occurs while running make install because package.el wasn't loaded in
time.
2018-06-10 19:15:39 +02:00
85704bea33 Fix void-variable ex2 error while package managing 2018-06-10 19:10:58 +02:00
ee154911ae Redesign doom-get-package
Now more useful for filtering packages by certain properties.
2018-06-10 17:28:17 +02:00
99d6927e56 Improve error-handling for quelpa packages 2018-06-08 13:08:38 +02:00
ee262e7737 Refactor error handling in package management API
I am hoping this will improve the ambiguous errors that originate from
package.el or quelpa.el.
2018-06-08 13:08:34 +02:00
1a1d74afa3 Refactor package management API
To make backtraces a little less cluttered, in case of the notorious
arrayp error, which I am yet unable to reproduce or understand.
2018-06-02 21:31:14 +02:00
1a452b6842 💥 Change first arg of load! macro
load!'s first argument is no longer a symbol (that will cause
void-variable errors now) to save on unnecessary interning and simplify
compile-time logic. It accepts any valid form that evaluates to a string
now.

If you use load!, you need to change its argument to a string!

e.g. (load! +my-module) => (load! "+my-module")
2018-05-27 12:52:28 +02:00
7f31f4a1bd Adjust package state initialization strategies 2018-05-25 02:53:48 +02:00
0368e8f84b Ensure package state is initialized before package management 2018-05-25 02:41:23 +02:00
d9894f0b74 Fix package install not retrying after a 'bad request' error 2018-05-25 02:16:19 +02:00