Commit Graph

263 Commits

Author SHA1 Message Date
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
Henrik Lissner
5eadfdc880
Add EMACS26+ & EMACS27+ constants 2018-03-24 07:25:00 -04:00
Henrik Lissner
23fda88b2f
Detach doom-modules-dirs from doom! macro
Formerly, you were required to have a doom! call (even a blank one) in
~/.doom.d/init.el if you wanted to have private sub-modules in
~/.doom.d/modules/.

No more. It is no longer doom!'s responsibility to affect
`doom-modules-dirs`. This is now done by :config private, while the
Doom modules directory is now the initial entry in doom-modules-dirs.
2018-03-12 13:32:00 -04:00
Henrik Lissner
e6aad90db5
Don't display benchmark on doom//reload-load-path 2018-03-02 23:48:35 -05:00
Henrik Lissner
0425724571
Major rewrite of doom module API
+ Fix #446, where the .local/packages.el cache was generated with
  a faulty load-path.
+ Entries in the doom-modules hash table are now plists, containing
  :flags and :path, at least.
+ Add doom-initialize-modules for loading module config.el files.
+ Add doom-module-get for accessing this plist, e.g.

    (doom-module-get :some module)         ; returns plist
    (doom-module-get :some module :flags)  ; return specific property

+ Replace doom-module-enable with doom-module-set, e.g.

    (doom-module-set :some module :flags '(+a +b +c))

+ Remove doom-module-flags (use doom-module-get instead)
+ Rename doom-module-enabled-p with doom-module-p
+ Replace doom-module-path with doom-module-find-path and
  doom-module-expand-file. The former will search for an existing module
  or file in doom-modules-dirs. The latter will expand the path from
  whatever path is stored in doom-modules.
+ Replace doom-module-paths with doom-module-load-path
+ Changed doom! to allow for nested doom! calls by delaying the loading
  of module config.el files until as late as possible.
+ Refactor doom-initialize-packages to only ihitialize package state
  (i.e. doom-packages, package-alist, and quelpa-cache), rather than its
  previous behavior of loading all Doom files (and sometimes all module
  files). This is faster and more predictable.
2018-03-02 19:14:45 -05:00
Henrik Lissner
0b2548f7b1
Fix module load order (delay config.el load) #441 2018-02-28 17:57:30 -05:00
Henrik Lissner
606b4695cc
Add NOSUFFIX flag to (load custom-file) 2018-02-28 17:57:30 -05:00
Henrik Lissner
c2fd538261
Refactor doom startup benchmark 2018-02-28 17:57:29 -05:00
Henrik Lissner
047ed6c9ea
Rethink doom-initialize & use package-initalize
Doom saves a lot of startup time by avoiding package-initialize, because
it loads every packages' autoloads file, which is expensive.
Unfortunately, these autoloads files are necessary for some plugins with
abnormal file structures (such as ESS). Previously, I was content with
loading them myself, but these occurrences have become more frequent, so
it would be safest if I relied on package-initialize more.

So doom-initialize will now do so. However, it will cache the load-path
(and Info-directory-list, fixing the lost info buffers) on first run.
This makes byte-compiling Doom almost useless, but it makes startup just
as fast as Doom would be if you had.

This needs more testing.
2018-02-28 17:57:29 -05:00
Henrik Lissner
7707aec28a
Remove doom group
Not really useful, and Doom doesn't encourage using the Emacs Customize
interface.
2018-02-18 03:04:58 -05:00
Henrik Lissner
b05ccbb98e
Move some UI vars from core.el to core-ui.el 2018-02-18 02:59:11 -05:00
Henrik Lissner
bae226b94f
Refactor to revolve module tree roots around doom! calls
Any module can now use a doom! call to declare a module tree root.

This means that if you have a doom! block in
~/.emacs.d/modules/lang/org/init.el, then you can have submodules in
~/.emacs.d/modules/lang/org/modules/MODULE/SUBMODULE if you wanted to
for some reason.

This is only really truly useful for private modules. A doom! block in
~/.doom.d/init.el will recognize and enable modules in
~/.doom.d/modules/.
2018-02-16 05:07:46 -05:00
Henrik Lissner
d2436650a3
Move server+benchmark code into doom|finalize 2018-02-16 02:11:41 -05:00
Henrik Lissner
2b1c323dbf
💥 Redesign private sub-module system
~/.doom.d/modules is now a full module tree, like ~/.emacs.d/modules.
Symlinks are no longer involved.

Private modules can now shadow Doom modules. e.g.
~/.doom.d/modules/lang/org will take precendence over
~/.emacs.d/modules/lang/org.

Also, made doom--*-load-path variables public (e.g. doom--site-load-path
=> doom-site-load-path), and rearranged the load-path for a 10-15%
startup boost.
2018-02-16 02:11:10 -05:00
Henrik Lissner
324a644002
Refactor; compilation-scroll-output=first-error; ffap-machine-p-known=reject 2018-02-01 19:58:44 -05:00
Henrik Lissner
735d129f92
Truly prevent unstyled mode-line flash at startup 2018-01-29 17:06:20 -05:00
Henrik Lissner
25619908a2
Narrow down the purpose of init & post-init hooks
Essential hooks should be added to doom-init-hook. Non-essential and
extra hooks should be added to doom-psot-init-hook.
2018-01-07 00:15:58 -05:00
Henrik Lissner
31a4244686
Rethink what Doom loads at startup and manually
Better to simply load what we need, when we need it, rather than set up
autoloads for every litte thing.
2018-01-07 00:15:57 -05:00
Henrik Lissner
91357a3e5d
💥 Replace core-popup with new feature/popup module
This is a breaking change! Update your :popup settings. Old ones will
throw errors!

Doom's new popup management system casts off its shackles (hur hur) and
replaces them with the monster that is `display-buffer-alist`, and
window parameters.

However, this is highly experimental! Expect edge cases.  Particularly
with org-mode and magit (or anything that does its own window
management).

Relevant to #261, #263, #325
2018-01-06 02:17:43 -05:00
Henrik Lissner
df37f987fb
Delete autoloads file on error + simpler error code
This should prevent getting locked out of Doom due to a little errant
code sneaking into your autoloads file.
2018-01-04 22:01:43 -05:00
Henrik Lissner
b3b31e4bd4
Display *Warnings* buffer in main workspace after startup #319
The creation of the main workspace would swallow the Warnings buffer, so
we forcibly display it (if it exists) on startup.
2018-01-04 16:58:21 -05:00
Henrik Lissner
9f884bf998
Move delayed-warnings deferral to core.el
Possibly addresses #319
2018-01-03 12:54:30 -05:00