Commit Graph

584 Commits

Author SHA1 Message Date
Henrik Lissner
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
Henrik Lissner
26caea7f2b Move doom-docs-dir to core.el 2018-06-17 21:39:40 +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
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
Henrik Lissner
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
Henrik Lissner
db8b4091dd Fix bin/doom ignoring -d flag
defconst -> defvar
2018-06-15 00:25:39 +02:00
Henrik Lissner
04ec62c8f2 General, minor refactor & feedback revision 2018-06-14 19:49:03 +02:00
Henrik Lissner
933023d779 Minor reformatting & docstring revision in core.el 2018-06-13 22:16:08 +02:00
Henrik Lissner
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
Henrik Lissner
4425fdfca4 defvar -> defconst for dir vars 2018-06-12 01:48:09 +02:00
Henrik Lissner
4c40195d40 Slightly better version check error 2018-06-12 01:47:43 +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
2605a3938e Initialize modules conditionally
doom-modules will be initialized on demand in non-interactive sessions.
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
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
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
Henrik Lissner
dd3872dd32 Add DOOMDIR envvar
So doom-private-dir can be customized via shell dotfiles (or chemacs).
2018-06-05 17:20:20 +02:00
Henrik Lissner
1d9ae834f2 Minor refactors & docstring revision
These are not the refactors you are looking for.
2018-06-04 21:17:49 +02:00
Henrik Lissner
8b7888d58f Increase GC threshold from 8 to 16mb 2018-05-30 19:15:43 +02:00
Henrik Lissner
3f6bfee027 Remember customized settings (load custom-file) 2018-05-30 19:15:29 +02:00
Henrik Lissner
f8b9cff4aa Get rid of doom-pre-init-hook 2018-05-28 16:07:11 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
5d42b1512b Fix naive path concatenation for doom-private-dir #513 2018-05-24 11:49:01 +02:00
Henrik Lissner
b452aded76 Mention doom-emacs-dir must end with a slash 2018-05-24 11:44:17 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
17d5721102 Minor reformatting of core startup config 2018-05-19 23:49:25 +02:00
Henrik Lissner
a19a64b16b Complain if using Emacs <25
More helpful than advice-add errors.
2018-05-19 18:01:54 +02:00
Henrik Lissner
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
Henrik Lissner
80adb9c1f6 General refactor for consistency & idempotency
Also updated comments
2018-05-18 01:26:41 +02:00
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
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
Henrik Lissner
bb4a8e98e6 load-prefer-newer = noninteractive 2018-05-14 18:34:34 +02:00
Henrik Lissner
a1b385a23d eval-when-compile EMACS2*+ consts 2018-05-14 13:05:33 +02:00
Henrik Lissner
b1ddcf1787 Fix locality of makefile commands 2018-04-04 00:01:11 -04:00
Henrik Lissner
6aac8666f3 Ensure after-init hooks are available from private init.el 2018-04-03 22:36:23 -04:00
Henrik Lissner
b6fab5da8d Fix core not loading byte-compiled private config files 2018-04-03 19:46:47 -04:00
Henrik Lissner
d85a2a6af0 Refactor noninteractive init; set doom-emacs-dir internally 2018-04-03 19:46:22 -04:00
Henrik Lissner
197631f6a4 Apply doom fixes/hacks before loading private init.el
Fixes void-variable: doom-auto-minor-mode-alist errors
2018-04-03 16:24:19 -04:00
Henrik Lissner
68e0694e29 Load private config.el before doom init hooks
Used to load it too late, after customizations were initialized by
doom-init-hook and doom-post-init-hook hooks.
2018-04-03 15:08:31 -04:00
Henrik Lissner
355b4b1364 💥 Replace config/private w/ first-class support
The config/private module has been removed. ~/.doom.d (or
~/.config/doom; whichever is detected first) is now a first class
citizen of Doom and should just work(tm).

Your init.el only needs to contain:

  (require 'core (concat user-emacs-directory "core/core"))

And you may place your doom! block in ~/.doom.d/init.el (or
~/.config/doom/init.el).
2018-04-03 03:07:30 -04:00
Henrik Lissner
8e7f97167a Minor whitespace/docstring refactor 2018-04-02 06:17:22 -04:00
Henrik Lissner
d39f384198 Fix gc-cons-* & file-name-handler-alist not being reset 2018-03-28 00:53:51 -04:00
Henrik Lissner
67e0575d3d Move doom-modules-dirs to core-packages.el 2018-03-27 19:11:11 -04:00
Henrik Lissner
b685baeb64 Fix the package! macro's :disable property 2018-03-27 02:49:19 -04:00
Henrik Lissner
040fedfeaf Remove defunct tramp advise 2018-03-26 18:14:00 -04:00
Henrik Lissner
fa69e25f87 Fix a pre-init race condition caused by doom-initialize-packages 2018-03-26 16:52:53 -04:00
Henrik Lissner
21a23228f2 Refactor initialization; allow package! to universally disable packages
No need for def-package-hook! for disable packages anymore, you can do
it from package! in packages.el files.
2018-03-26 02:57:37 -04:00