Commit Graph

295 Commits

Author SHA1 Message Date
4941e327f4 General refactor for readability
+ Removes redundant/unhelpful comments
+ Renames functions, hooks and variables to be self-documenting
+ Use add-to-list to ensure idempotency (and is more performant)
2018-07-09 15:33:31 +02:00
3d3d04b21c Move use-package config to core-modules 2018-06-20 12:48:59 +02:00
1efb0a8298 Rename core-dispatcher -> core-cli
The file's role is easier to guess at a glance.
2018-06-20 12:04:11 +02:00
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
84756b33a0 Fix closure symbolp errors blocking stacktraces
Caused because of symbol-file advice assuming SYMBOL would always be a
symbol.

This would prevent backtraces from happening, making debugging
impossibly obtuse.

This may indirectly fix #701
2018-06-20 01:59:07 +02:00
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
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
2c1b0ccaf8 Fix doom|run-all-startup-hooks
Wasn't using doom-try-run-hook correctly.
2018-06-19 12:01:51 +02:00
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
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
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
0d925cda5e Load core-os sooner & in all sessions
Indirectly fixes set-env! errors when using it from your init files.
2018-06-18 12:04:30 +02:00
26caea7f2b Move doom-docs-dir to core.el 2018-06-17 21:39:40 +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
1184967531 Advise symbol-file to return doom-file property
...if it exists. Otherwise fall back on original functionality. This
allows certain symbols to overwrite where Emacs thinks they were
defined.

Warning: only use this for autodefs! It may have unintended side-effects
for other symbols.
2018-06-15 16:20:20 +02:00
bbda434365 Move startup optimizations into init.el
Doesn't really belong in core.el and only applies to interactive
sessions.
2018-06-15 16:20:20 +02:00
db8b4091dd Fix bin/doom ignoring -d flag
defconst -> defvar
2018-06-15 00:25:39 +02:00
04ec62c8f2 General, minor refactor & feedback revision 2018-06-14 19:49:03 +02:00
933023d779 Minor reformatting & docstring revision in core.el 2018-06-13 22:16:08 +02:00
85591ca296 Move custom-file into local-dir (not etc-dir)
Makes more sense to put more vital files in local than etc or cache.
2018-06-12 12:17:33 +02:00
4425fdfca4 defvar -> defconst for dir vars 2018-06-12 01:48:09 +02:00
4c40195d40 Slightly better version check error 2018-06-12 01:47:43 +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
2605a3938e Initialize modules conditionally
doom-modules will be initialized on demand in non-interactive sessions.
2018-06-10 17:28:17 +02:00
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
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
b26bbd4762 Fix args-out-of-range in enable-minor-mode-maybe
Caused by trying to use out-of-scope match data.
2018-06-07 02:51:03 +02:00
dd3872dd32 Add DOOMDIR envvar
So doom-private-dir can be customized via shell dotfiles (or chemacs).
2018-06-05 17:20:20 +02:00
1d9ae834f2 Minor refactors & docstring revision
These are not the refactors you are looking for.
2018-06-04 21:17:49 +02:00
8b7888d58f Increase GC threshold from 8 to 16mb 2018-05-30 19:15:43 +02:00
3f6bfee027 Remember customized settings (load custom-file) 2018-05-30 19:15:29 +02:00
f8b9cff4aa Get rid of doom-pre-init-hook 2018-05-28 16:07:11 +02:00
a55e2251e6 auto-mode-case-fold = nil
This disables the case insensitive second pass through auto-mode-alist
on case sensitive systems.
2018-05-24 21:20:02 +02:00
8746c12fae Redesign Doom bootstrap, caching & autoload generation logic
The autoloads file has been split into doom-autoload-file and
doom-package-autoload-file. The former is for Doom's modules and
standard library; the latter is for compiling all package autoloads like
load-path and auto-mode-alist (among other things).

This reduced my startup speed from ~1s to ~0.5s
2018-05-24 21:20:02 +02:00
5d42b1512b Fix naive path concatenation for doom-private-dir #513 2018-05-24 11:49:01 +02:00
b452aded76 Mention doom-emacs-dir must end with a slash 2018-05-24 11:44:17 +02:00
ac5eaf0fb3 Load core-lib before core-package
So that core-package may use the Doom standard library.
2018-05-21 01:38:17 +02:00
6f5e710d98 Refactor startup process, hooks, doom-initialize & doom!
+ Brings back doom-pre-init-hook and doom-post-init-hook hooks.
+ Extracts autoload file loading logic into doom-initialize-autoloads
  function.
2018-05-19 23:59:55 +02:00
17d5721102 Minor reformatting of core startup config 2018-05-19 23:49:25 +02:00
a19a64b16b Complain if using Emacs <25
More helpful than advice-add errors.
2018-05-19 18:01:54 +02:00
fa37d7b05e Refactor core initialization process
A vastly simpler bootstrap process.

Also load core libs in core-lib (duh)
2018-05-19 16:42:48 +02:00
80adb9c1f6 General refactor for consistency & idempotency
Also updated comments
2018-05-18 01:26:41 +02:00
18e6a6b1db Include package autoloads in doom-autoloads-file
This offloads some of the work Doom has to do creating
`doom-packages-file` onto `make autoloads`. This closely mimics the
package-quickstart-refresh functionality in Emacs 27+, but is more
specialized.

This means package autoloads are now loaded on every startup.

Many :mode, :interpreter, and :commands declarations in def-package!
blocks are made redundant by this and will be cleaned up soon.
2018-05-15 22:17:43 +02:00
94f9e43f25 Rewrite :defer semantics
:defer now supports a hook, a cons cell with (SYMBOL . INTEGER) where
SYMBOL is a hook and INTEGER is a number of idle seconds before the
package is autoloaded, or just the integer (as per the default behavior
of :defer).

Also fixes an issue where switch-buffer-deffered packages (like
smartparens) wouldn't load.
2018-05-15 10:54:45 +02:00
bec79a3d4c Major refactor of Doom bootstrap process
+ New `input` and `buffer` support for :defer in def-package! can now
  defer packages until the first command invoked after startup or first
  interactive buffer switch, respectively
+ Exploit these new :defer techniques to lazy-load many core packages,
  netting Doom a 20-30% decrease in startup time
+ Various userland macros (like package!, def-package-hook!, packages!,
  and disable-packages!) will now throw an error if used incorrectly
  (i.e. outside of their intended files; e.g. package! should be used in
  packages.el files)
+ Removed support for multiple/nested doom! calls. There should only be
  THE ONE in ~/.doom.d/init.el (or ~/.config/doom/init.el)
+ Fix an issue where load-path and auto-mode-list modifications would
  not persist because doom-packages-file was cached too late.
+ Added package-activated-list to cached variables in
  doom-packages-file, thus we no longer need custom-file.
+ Load Doom core files from doom-initialize. Now doom-initialize can be
  called from state-dependent non-interactive functions, instead of
  reloading core/core.el, which was clumsy
+ Removed the doom-post-init-hook hook. There was no reason for it to
  exist when doom-init-hook can simply be appended to
2018-05-14 20:37:13 +02:00
bb4a8e98e6 load-prefer-newer = noninteractive 2018-05-14 18:34:34 +02:00
a1b385a23d eval-when-compile EMACS2*+ consts 2018-05-14 13:05:33 +02:00
b1ddcf1787 Fix locality of makefile commands 2018-04-04 00:01:11 -04:00
6aac8666f3 Ensure after-init hooks are available from private init.el 2018-04-03 22:36:23 -04:00
b6fab5da8d Fix core not loading byte-compiled private config files 2018-04-03 19:46:47 -04:00