Commit Graph

517 Commits

Author SHA1 Message Date
Henrik Lissner
0b2548f7b1 Fix module load order (delay config.el load) #441 2018-02-28 17:57:30 -05:00
Henrik Lissner
56c7d7fdcf doom//byte-recompile-plugins: use non-interactive session
May indirectly solve #428
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
b1bf67f630 Refactor package init process
quelpa is now initialized by doom-initialize-packages.
2018-02-20 17:54:10 -05:00
Henrik Lissner
6f1b96bc9a Fix void-function error in doom//reload-autoloads
Don't use a third party library in a function that could potentially run
before packages are installed, ya big silly!
2018-02-19 01:31:31 -05:00
Henrik Lissner
a967aa051a Force autoloads to use absolute paths
Autoload paths used to be relative to arbitrary roots (usually
doom-modules-dir). This commit changes doom//reload-autoloads to iterate
over autoloads in doom-autoloads-file and replace their file paths with
an absolute one.

Theoretically this should make Emacs feel marginally faster, but we
*probably* get more of a benefit from a shorter load-path (because we no
longer need doom-modules-dirs, doom-core-dir or doom-psuedo-module-paths
in the load-path).

This is highly experimental however!
2018-02-19 01:25:37 -05:00
Henrik Lissner
1a20c49ef3 Refactor cl-loop => cl-member in doom//byte-compile 2018-02-19 01:20:53 -05:00
Henrik Lissner
7ac29bbd27 Refactor require! macro 2018-02-17 19:09:15 -05:00
Henrik Lissner
8efd5d1eae Fix make clean not catching all *.elc files 2018-02-16 23:28:18 -05:00
Henrik Lissner
d91481a9a0 Add private module to load-path
This fixes autoload cookies in private autoload files (e.g.
~/.doom.d/autoload/file.el).
2018-02-16 23:26:44 -05:00
Henrik Lissner
e7c9f5c08f Fix over-zealous path resolution
This issue made it impossible enable default modules from private doom!
blocks.
2018-02-16 05:33:27 -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
d04a1fa940 Remove doom-module-pairs 2018-02-16 04:47:02 -05:00
Henrik Lissner
f864931643 Fix gibberish (char codes) in load-path 2018-02-16 03:11:28 -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
0e6540fb8f Fix featurep! in private submodules
You'll have to use the full form to use featurep! in the private module
root, but now the short form will work in the nested submodules.
2018-02-15 03:36:32 -05:00
Henrik Lissner
b3dcba54eb Add config/private; for ~/.doom.d & ~/.config/doom support #406
A modules/ submodule will be symlinked to ~/.emacs.d/modules/private.
2018-02-14 23:36:35 -05:00
Henrik Lissner
3355378480 Fix doom//reload-load-path infinite recursion with daemon emacs 2018-02-08 02:15:41 -05:00
Henrik Lissner
14080a1781 Update core-packages docstrings; rename doom-module-get => doom-module-flags 2018-01-30 21:26:02 -05:00
Henrik Lissner
1fda25ce9a Force make commands to traverse symlinks too 2018-01-29 23:23:48 -05:00
Henrik Lissner
e55e798048 Fix doom! not loading modules after byte-compile 2018-01-29 21:22:55 -05:00
Henrik Lissner
a3e3909368 Set doom-modules sooner
Fixes module lookups within modules (like featurep!).
2018-01-29 18:06:59 -05:00
Henrik Lissner
3a31949483 Refactor doom! to support nested calls #352
Isolates doom! a little more to allow for nested doom! calls.
2018-01-29 17:01:02 -05:00
Henrik Lissner
47d15fdf8a Make startup benchmark a little more accurate #353
Also sets doom-init-time first thing in doom-post-init-hook.
2018-01-13 15:11:28 -05:00
Henrik Lissner
987805de5f Fix recursive load errors with multiple doom! calls #352 2018-01-12 14:40:34 -05:00
Henrik Lissner
2b98e550e8 Reverse load-path to fix precedence issues
Originally, I built the load-path with site-lisp paths first, then
packages. There was a modest ~10% startup boost doing this, because
there were considerably more site packages loaded at startup than
plugins.

However, this meant built-in packages would get precedence over plugins,
which is undesirable. In org's case, I simply modified the load-path
in lang/org/init.el. However, this issue has cropped up again in #340.

Evidently, that 10% boost may not be worth the risk it imposes, so I've
rearranged the load-path with packages first.
2018-01-10 22:47:35 -05:00
Henrik Lissner
42f4d10d6d Fix doom//reload-autoloads not reloading autoloads file
doom-packages--async-run doesn't return anything. Whoops!
2018-01-08 22:47:38 -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
392f04446f General refactor (use map.el more)
+ map-delete is shorter and faster than assq-delete-all
+ map-put is simpler than the delete-then-set workflow
+ map-merge is great for merging default and user settings
2018-01-07 00:15:58 -05:00
Henrik Lissner
379914ccd7 doom-initialize: letbind load-path to site load-path instead
PREMATURE OPTIMIZATION DETECTED.

EXTERMINATE. EXTERMINATE. EXTERMINATE.
2018-01-07 00:15:57 -05:00
Henrik Lissner
e894c07453 Load module init.el too from require! macro 2018-01-06 04:14:44 -05:00
Henrik Lissner
a568f95004 Fix doom//reload-autoloads #328
`get-file-buffer` returns nil if no buffer for that file already exists.
In an edge case on Windows, `update-file-autoloads` doesn't leave
a hanging buffer, possibly ignoring its SAVE-AFTER argument. Using
`find-file-noselect` fixes this, which will open a buffer if one doesn't
already exist.
2018-01-05 13:43:17 -05:00
Henrik Lissner
2598d48bba Add org elpa archive + update lang/org #327
Now that the org ELPA archive has https support, we can add it to
package-archives. This fixes some 'org is unavailable' errors when
installing org packages that have declared earlier versions of org as
a dependency.

This also makes installing a newer version of org-mode much simpler.
Woo!
2018-01-04 16:16:45 -05:00
Henrik Lissner
eef6ed3d11 Minor, general refactor & comment updates 2018-01-01 13:21:52 -05:00
Henrik Lissner
79ca2b2911 Fix interactive usage of doom//byte-compile-core 2017-12-31 18:28:42 -05:00
Henrik Lissner
9628b21d22 Fix async package functions not running from right cwd 2017-12-31 18:28:26 -05:00
Henrik Lissner
a811c7ff12 core-packages: minor refactor of load! & def-package! 2017-12-28 19:15:50 -05:00
Henrik Lissner
5789fb4511 Don't rerun doom init hooks on doom-reload-hook 2017-12-28 01:02:32 -05:00
Henrik Lissner
89f07f88c5 General & minor refactor 2017-12-23 22:13:48 -05:00
Henrik Lissner
6a0e4bd0db doom-initialize-packages: reinit packages after modules 2017-12-23 16:24:43 -05:00
Henrik Lissner
9924a43506 Fix doom-module-pairs returning pairs in arbitrary order
This causes errors because of arbitrary module load order.  This happens
in Emacs 25.x, because hash-table-keys there uses maphash, while in
Emacs 26+ it uses cl-loop.
2017-12-23 03:26:32 -05:00
Henrik Lissner
3bbb78f779 doom//byte-compile: better error handling (revert on error) 2017-12-22 17:05:01 -05:00
Henrik Lissner
9a9f2ce036 Fix make clean printing long, relative paths in output 2017-12-22 16:26:08 -05:00
Henrik Lissner
efc7ec38ae core-packages: general, minor refactor 2017-12-22 16:26:08 -05:00
Henrik Lissner
6922fe11fe Refactor doom-initialize-packages 2017-12-22 16:26:08 -05:00
Henrik Lissner
02c14f560d Refactor bootstrap process + add doom-initialize-load-path 2017-12-22 16:26:05 -05:00
Henrik Lissner
6343e8ad85 (BREAKING) Don't host-namespace local files
Local cache and data files were stored in a parent folder named after
your host, because I'd symlink the same config across computers via
dropbox. This would cause byte-compile issues in packages, so I stopped
doing this.

Now that each computer gets its own clone, host-namespaced local
directories are unnecessary. There's no other benefit to having them.
2017-12-22 14:48:13 -05:00
Henrik Lissner
a5596c8923 Ensure doom-autoload-file directory exists first 2017-12-22 14:30:31 -05:00