Commit Graph

192 Commits

Author SHA1 Message Date
Henrik Lissner
93f7520c79
Refactor Doom core init process (again)
- Eager-load all core autoloaded libraries if autoloads file isn't
  present.
- Renames functions to be more descriptive of their true purpose:
  - doom-initialize-autoloads -> doom-load-autoloads-file
  - doom-load-env-vars -> doom-load-envvars-file
- Use doom-module-p instead of featurep! for backend use (the latter is
  mainly syntax sugar for module use, and evaluates at compile/expansion
  time, which may cause hash-table-p errors early in the startup
  process).
- Reorder plist library to prevent load order race condition with the
  functions using the macros that haven't been defined yet.
2019-07-22 23:22:54 +02:00
Henrik Lissner
ea65f82e4d
Fix void doom-package-list error on first install 2019-07-22 03:48:29 +02:00
Henrik Lissner
060ede0e2e
General, minor reformatting across the board
And an offering of blood to our great lord Byte Compiler-sama.
2019-07-22 02:37:45 +02:00
Henrik Lissner
b90dede1ab
💥 Replace package.el/quelpa with straight #374
There are a few kinks to iron out, but for the most part it's done. Doom
Emacs, powered by straight. Goodbye gnutls and elpa/quelpa issues.

This update doesn't come with rollback or lockfile support yet, but I
will eventually include one with Doom, and packages will be (by default,
anyway) updated in sync with Doom.

Relevant threads: #1577 #1566 #1473
2019-07-22 02:30:40 +02:00
Henrik Lissner
51d3b1b424
💥 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-22 02:27:45 +02:00
Henrik Lissner
8b27d19e0b
Fix "err=[-50]" gnutls error
When updating/installing packages.
2019-07-20 11:05:52 +02:00
Henrik Lissner
84d43643c9
Fix "Bad request" failures during package-refresh
Particular with elpa.gnu.org. This is caused by a known error in Emacs
26.x, which has been fixed in 27, and documented here:
https://debbugs.gnu.org/cgi/bugreport.cgi?bug=34341
2019-07-15 01:00:49 +02:00
Henrik Lissner
b58b5e1d64
Fix auto-removal of builtin-preferred packges 2019-07-07 14:07:41 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
867f94e23a
Refactor doom-get-outdated-packages
May address #1235
2019-03-11 18:46:52 -04:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
31688c921d
Refactor doom-get-outdated-packages
Partitions quelpa packages so there are 4 threads tops.
2019-03-08 02:34:26 -05:00
Henrik Lissner
fbcb4e6973
Minor refactor across the board 2019-03-04 20:47:26 -05:00
Henrik Lissner
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
Henrik Lissner
f0ad9b7585
Ensure explicitly installed pkgs are user-selected 2019-03-04 04:57:07 -05:00
Henrik Lissner
c82faf7f10
General reformatting & minor refactors 2019-02-19 15:53:26 -05:00
Luigy Leon
a3694edb15 Fix doom/update-package 2019-01-24 02:13:16 -05:00
Henrik Lissner
efa577dec2
Improve error-handling in doom/update-package 2019-01-21 17:39:42 -05:00
Henrik Lissner
31a0ad5b95
Move doom--condition-case! to core/cli/packages
The only place it is being used
2019-01-10 15:44:42 -05:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
f7ad520ee0
doom update: prevent GC in async instances
Offers a marginal improved to outdated check times.
2018-09-09 09:58:20 -04:00
Henrik Lissner
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
Henrik Lissner
77d2d84e14
Refactor core-cli
Moved to separate files for better organization.
2018-09-09 09:58:20 -04:00
Henrik Lissner
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
Henrik Lissner
2ee177d588
Don't invoke debugger on "Aborted" messages 2018-08-02 16:41:19 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
adf143a853
Fix void-variable error when installing packages
Caused by a haphazardly refactor in f6dc6ac7.
2018-06-23 20:11:43 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
71f0b3ba10
Minor error handler refactor in package management
Allow debugger to produce better backtraces.
2018-06-20 02:23:55 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
b6f9bc9675 Fix package manager not :ignore'ing packages 2018-06-13 22:15:08 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
85704bea33
Fix void-variable ex2 error while package managing 2018-06-10 19:10:58 +02:00
Henrik Lissner
ee154911ae
Redesign doom-get-package
Now more useful for filtering packages by certain properties.
2018-06-10 17:28:17 +02:00