Commit Graph

98 Commits

Author SHA1 Message Date
Henrik Lissner
33f2d5d321 Upload load-order in doom!'s docstring 2018-12-05 22:11:54 -05:00
Henrik Lissner
9afc61e57e
Refactor & optimize doom! + module API 2018-09-25 23:52:20 -04:00
Henrik Lissner
75ad188e01
Fix :defer-incrementally t
Should be the same as :defer-incrementally (<package-name>)
2018-09-21 22:43:52 -04:00
Henrik Lissner
b653039535
Add :defer-incrementally use-package keyword 2018-09-20 10:42:45 -04:00
Henrik Lissner
82651be909
Remove sharp-quote on make-hash-table :test
The function isn't really expecting a function, but the 'eq, 'eql or
'equal symbols. User supplied test/hash functions must be defined with
define-hash-table-test.
2018-09-13 19:15:12 -04:00
Henrik Lissner
57579b883b
Refactor doom core files 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
631c4004ba
Load custom-file only once & after user's config
This change facilitates the users that prefer their custom-file
somewhere other than doom-local-dir (e.g. in ~/.doom.d/custom.el).

This change prevents loading both files during startup. Just change
`custom-file` and Doom will load it after your config.el is loaded (but
before doom-post-init-hook runs).
2018-08-25 19:45:23 +02:00
Henrik Lissner
62977247c9
Revert da7f9019 & refactor doom init hooks 2018-08-21 04:27:14 +02:00
Henrik Lissner
da7f9019d1
Run doom-post-init-hook as late as possible
Possibly fixes recursive load errors, to do with
kill-buffer-query-functions and buffer-predicate autoloads loading in a
weird way on Emacs 25 (and especially on MacOS, for some reason).
2018-08-21 04:03:05 +02:00
Henrik Lissner
cbad18bf95
Fix wrong-type-arg hash-table-p error
In the rare case your private init.el has no doom! block.
2018-08-12 02:46:06 +02:00
Henrik Lissner
6eafdd7c62
Refactor module load process
doom! no longer loads modules, it only sets
doom-modules (incrementally).

Instead, modules are loaded by doom-initialize-modules (which makes more
sense).
2018-08-08 23:37:30 +02:00
Henrik Lissner
9570670eb1
featurep!: refactor & fix three-arg usecase
Now (featurep! :category module +flag) will work properly check for
+flag rather than just returning t if :category module were enabled.

Also update variables to match category-module nomenclature.
2018-07-30 23:53:05 +02:00
Henrik Lissner
db8ed4aac6
lang/php: add +hack support 2018-07-29 17:42:00 +02:00
Henrik Lissner
0f0f5f6584
Optimize featurep! macro
If we can use doom--current-module and evaluate membership at
compile-time, we same a little time, but a fair bit more if
we byte-compile.
2018-06-27 23:17:17 +02:00
Henrik Lissner
e91af20003
Optimize core-lib & pure module functions
And confer module membership check to run-time, rather than compile
time.
2018-06-24 22:23:08 +02:00
Henrik Lissner
d874f628bb
Prefix non-existent module message with Warning:
Because it's a warning, not an error, and life goes on.
2018-06-24 22:23:08 +02:00
Henrik Lissner
e4b23d78da
Refactor require!
Defer its compile-time segments to run-time, which would cause many
issues in conditions wrapped around it.

In any case, avoid using require!, it was a poor choice to implement it
and should only be used for unit tests.
2018-06-23 22:23:35 +02:00
Henrik Lissner
4c4a35ae86
Minor reformatting
It's no big deal. Really.
2018-06-23 22:22:42 +02:00
Henrik Lissner
16d3f75f1d
Minor refactor of use-package-handler/:after-call
+ Duplicate hooks aren't a problem
+ letbind `fn` only when we need it
2018-06-23 19:53:58 +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
3a3eb92087
Move :tools rotate-text to :editor rotate-text
This change was a long time coming.
2018-06-22 01:49:20 +02:00
Henrik Lissner
ff7823bfc9
Refactor module deprecation checks in doom!
Also changes the structure of doom-obsolete-modules, and adds :feature
version-control to it.
2018-06-22 01:49:20 +02:00
Henrik Lissner
1dd023cda1
Fix error if private config.el doesn't exist 2018-06-22 01:49:19 +02:00
Henrik Lissner
3d3d04b21c
Move use-package config to core-modules 2018-06-20 12:48:59 +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
600d7bcb4f
core: minor refactor/reformat
+ Prefer cl-loop over cl-mapcan for performance reasons.
+ Remove unnecessary let form
+ Log doom-try-run-hook when doom-debug-mode is on.
2018-06-19 20:55:44 +02:00
Henrik Lissner
adf9b7d26f
Log & error-handle in :after-call hooks
A load error no longer leaves Emacs in a broken state, but will report
errors. These errors can still be investigated with debug-on-error on.
2018-06-19 20:54:09 +02:00
Henrik Lissner
0fefc43d39
Refactor autoloads init & error handling
Also reduces byte-compiled forms in the backtrace of a
doom-autoload-error.
2018-06-19 17:19:11 +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
32954ecb69
Move compile-time fix for disabled packages
This fix prevented the byte-compiler from trying to load packages that
were disabled or failed their :when/:unless/:if predicates. This commit
moves it into doom-byte-compile, so the :no-require predicate doesn't
have to run on every package in an interactive session, eating MY
PRECIOUS cpu cycles.

I do love my cpu cycles, yessiree.
2018-06-18 14:52:24 +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
08f01edafd
Mark settings obsolete (properly)
And make set! noisy about settings that don't exist anymore, when
evaling it interactively.
2018-06-18 13:38:27 +02:00
Henrik Lissner
194bcf4c60
Silence byte-compiler warning: unused lexical arg 2018-06-17 02:21:46 +02:00
Henrik Lissner
a1278f3dff
Refactor def-package!
Rely on use-package mechanisms. def-package! should be as thin a wrapper
as possible. Ideally, we should simply be an alias, but there is no way
to inject :disabled into a use-package declaration, because it is
treated especially.
2018-06-16 00:36:27 +02:00
Henrik Lissner
f81a0e6f41
Remove redundant def-setting! docstrings
def-setting! will now grab the autodef's docstring if it has an
:obsolete property defined.
2018-06-15 16:54:39 +02:00
Henrik Lissner
98632fe086
Fix doom-module-from-path on module directories
Allow PATH to be an exact path to a module.
2018-06-15 16:20:20 +02:00
Henrik Lissner
c22b3da9f9
Move emacs/electric-indent to emacs/electric
This module will later be expanded to customize more of electric's
functionality.
2018-06-15 16:20:20 +02:00
Henrik Lissner
715167bec8
Add ability to mark modules as obsolete or moved
Better way to communicate to users that modules have moved without
breaking their config.
2018-06-15 16:20:20 +02:00
Henrik Lissner
d8b1e469bc
Introduce autodefs to replace some settings
+ :popup -> set-popup-rule!
+ :popups -> set-popup-rules!
+ :company-backend -> set-company-backend!
+ :evil-state -> set-evil-initial-state!

I am slowly phasing out the setting system (def-setting! and set!),
starting with these.

What are autodefs? These are functions that are always defined, whether
or not their respective modules are enabled. However, when their modules
are disabled, they are replaced with macros that no-op and don't
waste time evaluating their arguments.

The old set! function will still work, for a while.
2018-06-15 03:42:01 +02:00
Henrik Lissner
04ec62c8f2
General, minor refactor & feedback revision 2018-06-14 19:49:03 +02:00
Henrik Lissner
cc3fd3126a
Fix "Failed to parse X" errors from use-package
use-package-handler/:after-call was (accidentally) relying on the
dynamic value of `name`, but now that use-package uses lexical binding,
this isn't possible anymore, causes errors.
2018-06-14 11:53:52 +02:00
Henrik Lissner
08a4701774
Fix case where private init.el has no doom! block
This shouldn't error out. It's better if Doom ran normally, just without
any of its modules activated.

Addresses issue mentioned in #681
2018-06-14 00:45:57 +02:00
Henrik Lissner
4c2107d595
Refactor doom-module-from-path
If PATH is omitted, use (FILE!); also use doom-keyword-intern.
2018-06-12 21:07:34 +02:00
Henrik Lissner
acbad5ca01
Add ALL-P parameter to doom-module-load-path
Allowing it to return path to *all* modules, whether or not they are
activated.
2018-06-12 21:07:34 +02:00
Henrik Lissner
9ec0461162
Revert "Refactor def-package!"
This reverts commit f7a86ae281.

Turns out it's still needed when byte-compiling!
2018-06-12 01:58:06 +02:00
Henrik Lissner
f7a86ae281
Refactor def-package!
It is no longer necessary to gate use-package calls with
:if/:when/:unless checks during byte-compilation. This was fixed
somewhere along the way.
2018-06-12 00:26:28 +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