Commit Graph

409 Commits

Author SHA1 Message Date
Henrik Lissner
b054190820
New doom/describe-packages command
Replaces describe-packages and adds Doom module awareness to package
documentation.
2019-03-04 20:47:25 -05:00
Henrik Lissner
3923760c7c
Adjust compile-time state in package helper macros 2019-01-02 14:11:02 -05:00
Henrik Lissner
9628a74718
Fix disable-packages! macro
Now rolls out package! calls, rather than adjusting state directly.
2019-01-02 13:17:26 -05:00
Henrik Lissner
15991b5639 Refactor quiet! to be less destructive
It's possible for the debugger to be invoked from inside code wrapped in
a (quiet! ...) call. The debugger pauses Emacs in a broken state where
the functions locally rebound by quiet! (e.g. message, load-file,
write-region, etc) are never returned to their original definitions.

This attempts to reduce that probabilityby changing how quiet! silences
code. Rather than silencing them completely, they will be logged
to *Messages* but not displayed in the echo area.

Also, quiet! is now used less, where it isn't strictly needed (or where
inhibit-message is sufficient).
2018-09-28 21:13:27 -04: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
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
80ddf2122b
Fix doom-initialize-packages messing up load-path
This fixes issues with the doctor not being able to find certain
packages (like evil-collection), and an issue where using the package
management API (which calls doom-initialize-packages) breaks the current
session by breaking the load-path.
2018-06-26 18:58:06 +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
be44b1ae8a
Fix package!'s :disable being read unconditionally
Because the package was added to doom-disabled-packages at macro
expansion time, rather than at run time. This meant that, even if you
did:

  (when nil
    (package! x :disable t))

x would still be disabled.

Reported by @ar1a
2018-06-24 12:08:55 +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
643c64c19f
Prevent creation of ~/.emacs.d/elpa
Due o package-gnupghome-dir not being set properly.
2018-06-20 12:45:51 +02:00
Henrik Lissner
151858a8dc
Redesign Doom error handling
Another refactor, again to improve the locality of doom errors and make
the data that accompanies them more useful in determining the origin and
source of issues. Also, bin/doom is now a little more informative about
how to debug errors.
2018-06-20 02:07:12 +02:00
Henrik Lissner
4685eddb66
Don't eat stacks in backtraces in debug mode
The error handlers were a little too effective. They obscured a large
chunk of the stacktrace after errors, even in debug mode. This fixes
that and ensures backtraces in debug mode are more helpful.
2018-06-18 17:14:17 +02:00
Henrik Lissner
ab07e07352
Improve general error handling at startup
This will hopefully reveal more information as to the cause and origin
of errors at startup. It should also make doom-debug-mode more likely to
produce a backtrace in non-interactive sessions.
2018-06-18 14:47:36 +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
04ec62c8f2
General, minor refactor & feedback revision 2018-06-14 19:49:03 +02:00
Henrik Lissner
77ac164651
Fix core libraries not loading
Caused because the load-path is reset to doom-site-load-path in
doom-initialize-packages, which was initialized before doom-core-dir was
added to it, so core-* libraries couldn't be found.
2018-06-12 12:18:21 +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
6f98aeebfb
Don't set doom-init-modules-p from doom-modules
Causes user config to not be loaded if doom-modules is used earlier.
2018-06-10 20:58:00 +02:00
Henrik Lissner
f02156286b
Error if autoloads are missing interactively
Trying to regenerate them greatly complicates doom-initialize's
potential use-cases. Keep it simple stupid!
2018-06-10 20:57:14 +02:00
Henrik Lissner
19deb4b926
Fix buffer-read-only: autoloads.el error 2018-06-10 20:55:42 +02:00
Henrik Lissner
f144691157
Don't delete autoloads file
Turns out to be more error prone. Better to just ignore the existing one
when force-initializing Doom.
2018-06-10 19:07:37 +02:00
Henrik Lissner
a87641635f
load-prefer-newer = nil for private config
load-prefer-newer = t makes debugging harder and reduces the
predictability of your config.
2018-06-10 17:28:17 +02:00
Henrik Lissner
b079db8ec3
Refactor unneeded arg out of local function _load
In doom-initialize-packages.
2018-06-10 17:28:17 +02:00
Henrik Lissner
edb6fd1964
Change how private & disabled packages are marked
They are now included in doom-packages, but with :private t or :disabled
t properties. This allows us to search for them if we wish (e.g. for
doom info).
2018-06-10 17:28:17 +02:00
Henrik Lissner
88f1ae3797
Refactor autoloads init in doom-initialize
Simplify doom-initialize-autoloads
2018-06-10 17:28:17 +02:00
Henrik Lissner
01d1a814f9
Refactor doom-initialize functions
Removes doom-module-table; which was inflexible (though more stable). It
prevented you from putting your doom! block in anywhere but
~/.doom.d/init.el.

It is replaced (somewhat) by (doom-modules).
2018-06-10 17:30:26 +02:00
Henrik Lissner
1e2fc4227a
Fix void-variable: package--initialized error 2018-06-10 17:28:17 +02:00
Henrik Lissner
81c465a545
Move OS constants to core/core.el
So it is universally available to all of Doom, rather than excluding
sessions that haven't called doom-initialize interactively.
2018-06-08 13:31:45 +02:00
Henrik Lissner
b207c4040b
Minor, general refactor 2018-06-07 02:51:46 +02:00
Henrik Lissner
4978a64678
Create core directories before checking version
Otherwise the version cache file can't be written to!
2018-06-05 12:09:42 +02:00
Henrik Lissner
c9bfb58369
Minor, general refactor
Remove redundant keybinds, unused letvars, and fix
doom-module-load-path's docstring referencing its former signature.
2018-06-05 12:04:43 +02:00
Henrik Lissner
8124d5a893
Use package-activated-list for package count
Now that this variable is cached, it should always be available.
2018-06-05 12:04:43 +02:00
Henrik Lissner
282e0d6653
Move emacs version check into doom-initialize
Also fixes void-function errors caused by (now removed)
doom-same-emacs-version-p not being defined in all the contexts it was
needed.

Where it was before was clumsy design.
2018-06-05 12:04:43 +02:00
Henrik Lissner
6da8e5b3ab
Add error handling when loading autoloads files 2018-06-04 21:20:13 +02:00
Henrik Lissner
29005d9975
Load quelpa uncompiled to fix arrayp errors #647
Hopefully...
2018-06-04 21:19:46 +02:00
Henrik Lissner
9ba76b60dc
Refactor require! macro 2018-06-04 00:06:01 +02:00
Henrik Lissner
428f1e1d07
Refactor def-setting!/set! implementation
The `doom-settings` variable has been removed. Setting checks are done
with fboundp now, which is simpler.
2018-06-02 16:26:59 +02:00
Henrik Lissner
a0bec84997 Don't complain if no private packages.el 2018-06-02 01:08:23 +02:00
Henrik Lissner
b28d3414bb
Remove load-prefer-newer letvar around private init
Doesn't actually help and only slows things down.
2018-06-01 17:07:53 +02:00
Henrik Lissner
c04bccc68b
Fix disabled packages not being disabled
By loading the private packages.el in two passes. The first time ensures
later modules will know about disabled packages and the second time
ensures overwritten packages are properly overwritten.

Not the most efficient, but efficiency is low priority in noninteractive
sessions (i.e. during package management), the performance loss is
negligible, and packages.el files (should) have no other side effects
anyway.
2018-06-01 17:03:01 +02:00
Henrik Lissner
6bad6d12f3
Remove doom-psuedo-modules-dir
Not needed with now that doom-private-dir has first class support.
2018-06-01 17:01:39 +02:00
Henrik Lissner
bb6b91da9b
Downgrade missing module warnings to messages 2018-05-29 22:44:21 +02:00
Henrik Lissner
debe3e0dd3 Remove unnused letvar doom--inhibit-reload 2018-05-29 19:39:22 +02:00
Henrik Lissner
bd5ecc1aca
Display warning if a non-existent module is in your doom! block 2018-05-29 18:26:39 +02:00
Henrik Lissner
f8b9cff4aa
Get rid of doom-pre-init-hook 2018-05-28 16:07:11 +02:00
Henrik Lissner
2dc1be2ce8
Update load! macro docstring 2018-05-28 12:30:27 +02:00
Henrik Lissner
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
Henrik Lissner
dc7488df73
Remove package-initialize hack before package commands
Doesn't appear to be necessary anymore.
2018-05-25 19:26:11 +02:00
Henrik Lissner
644dc17e32
Minor refactor of doom-initialize-packages 2018-05-25 19:25:47 +02:00