Commit Graph

433 Commits

Author SHA1 Message Date
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
1e2fc4227a
Fix void-variable: package--initialized error 2018-06-10 17:28:17 +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
b207c4040b
Minor, general refactor 2018-06-07 02:51:46 +02:00
Henrik Lissner
4978a64678
Create core directories before checking version
Otherwise the version cache file can't be written to!
2018-06-05 12:09:42 +02:00
Henrik Lissner
c9bfb58369
Minor, general refactor
Remove redundant keybinds, unused letvars, and fix
doom-module-load-path's docstring referencing its former signature.
2018-06-05 12:04:43 +02:00
Henrik Lissner
8124d5a893
Use package-activated-list for package count
Now that this variable is cached, it should always be available.
2018-06-05 12:04:43 +02:00
Henrik Lissner
282e0d6653
Move emacs version check into doom-initialize
Also fixes void-function errors caused by (now removed)
doom-same-emacs-version-p not being defined in all the contexts it was
needed.

Where it was before was clumsy design.
2018-06-05 12:04:43 +02:00
Henrik Lissner
6da8e5b3ab
Add error handling when loading autoloads files 2018-06-04 21:20:13 +02:00
Henrik Lissner
29005d9975
Load quelpa uncompiled to fix arrayp errors #647
Hopefully...
2018-06-04 21:19:46 +02:00
Henrik Lissner
9ba76b60dc
Refactor require! macro 2018-06-04 00:06:01 +02:00
Henrik Lissner
428f1e1d07
Refactor def-setting!/set! implementation
The `doom-settings` variable has been removed. Setting checks are done
with fboundp now, which is simpler.
2018-06-02 16:26:59 +02:00
Henrik Lissner
a0bec84997 Don't complain if no private packages.el 2018-06-02 01:08:23 +02:00
Henrik Lissner
b28d3414bb
Remove load-prefer-newer letvar around private init
Doesn't actually help and only slows things down.
2018-06-01 17:07:53 +02:00
Henrik Lissner
c04bccc68b
Fix disabled packages not being disabled
By loading the private packages.el in two passes. The first time ensures
later modules will know about disabled packages and the second time
ensures overwritten packages are properly overwritten.

Not the most efficient, but efficiency is low priority in noninteractive
sessions (i.e. during package management), the performance loss is
negligible, and packages.el files (should) have no other side effects
anyway.
2018-06-01 17:03:01 +02:00
Henrik Lissner
6bad6d12f3
Remove doom-psuedo-modules-dir
Not needed with now that doom-private-dir has first class support.
2018-06-01 17:01:39 +02:00
Henrik Lissner
bb6b91da9b
Downgrade missing module warnings to messages 2018-05-29 22:44:21 +02:00
Henrik Lissner
debe3e0dd3 Remove unnused letvar doom--inhibit-reload 2018-05-29 19:39:22 +02:00
Henrik Lissner
bd5ecc1aca
Display warning if a non-existent module is in your doom! block 2018-05-29 18:26:39 +02:00
Henrik Lissner
f8b9cff4aa
Get rid of doom-pre-init-hook 2018-05-28 16:07:11 +02:00
Henrik Lissner
2dc1be2ce8
Update load! macro docstring 2018-05-28 12:30:27 +02:00
Henrik Lissner
1a452b6842
💥 Change first arg of load! macro
load!'s first argument is no longer a symbol (that will cause
void-variable errors now) to save on unnecessary interning and simplify
compile-time logic. It accepts any valid form that evaluates to a string
now.

If you use load!, you need to change its argument to a string!

e.g. (load! +my-module) => (load! "+my-module")
2018-05-27 12:52:28 +02:00
Henrik Lissner
dc7488df73
Remove package-initialize hack before package commands
Doesn't appear to be necessary anymore.
2018-05-25 19:26:11 +02:00
Henrik Lissner
644dc17e32
Minor refactor of doom-initialize-packages 2018-05-25 19:25:47 +02:00
Henrik Lissner
5ef1228201
Fix nested length form typos 2018-05-25 19:22:44 +02:00
Henrik Lissner
d7a5f3b997
Fix doom-module-table failing to fetch module list
...because sexp-at-point needs a valid syntax table, and fundamental
mode ain't got one.
2018-05-25 03:07:23 +02:00
Henrik Lissner
2b8efd6783
Error of private init.el doesn't exist (it really should!) 2018-05-25 02:54:16 +02:00
Henrik Lissner
2990d5bd58
Fix hash-table-p and format type errors on blank startup 2018-05-25 01:26:24 +02:00
Henrik Lissner
a390ef8deb
Reduce doom-module-table calls significantly 2018-05-25 01:17:01 +02:00
Henrik Lissner
11705d0920
Fix void-variable error (let -> let*) 2018-05-25 01:13:28 +02:00
Henrik Lissner
59f70c2a87
Soft-fail if doom-module-table can't find your private init.el 2018-05-25 01:11:53 +02:00
Henrik Lissner
d35598520f
Only package-initialize if uninitialized (from package.el API advice) 2018-05-24 21:20:02 +02:00
Henrik Lissner
9e07940b7c
Fix use-package autoload 2018-05-24 21:20:02 +02:00
Henrik Lissner
30893b0ff1
Fix doom-initialize-packages 2018-05-24 21:20:02 +02:00
Henrik Lissner
8282280965
core-packages: revise docstrings & comments 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
1369c51000
Replace :defer HOOK/FN with :after-call keyword 2018-05-21 01:38:17 +02:00
Henrik Lissner
f2c02e32c8
General minor refactor & comment updates 2018-05-21 01:38:17 +02:00
Henrik Lissner
f058505306
New bin/doom (eventual replacement for make)
This commit adds bin/doom, which acts as the middle man that make once
was (and will stay for a while, though the documentation will shift away
from using it). It does everything the previous make interface did, but
is faster and more flexible. bin/doom should eventually replace the
makefile.

bin/doom also makes it easier to run Doom outside of ~/.emacs.d and
~/.doom.d with, for example:

  bin/doom run -p ~/.other.doom.d/ -e ~/.other.emacs.d

bin/doom.cmd is included for Windows users, but I don't recommend using
it yet. It hasn't been tested nor have I ever written a batch script
before.

Also update init.example.el with new defaults.
2018-05-21 01:38:17 +02:00
Henrik Lissner
f984d46a9b
Fix featurep! & load! calls while byte-compiling
The would prioritize load-file-name over byte-compile-current-file
during byte-compiling, which would result featurep! being unable to
resolve the current module and load! from figuring out where "here" was
to build its relative paths from.
2018-05-20 00:57:58 +02:00
Henrik Lissner
a46e7655dc
Move batch commands from core-packages to autoload/modules 2018-05-20 00:57:18 +02:00
Henrik Lissner
85ee9ce459
Refactor doom module API
+ Consolidate the CATEGORY -> MODULE terminology
+ Rename functions to make their function easier to understand
  + Rename doom-module-expand-file => doom-module-path
  + Rename doom-module-find-path => doom-module-locate-path
2018-05-20 00:03:57 +02:00
Henrik Lissner
5abdbaee38
Rewrite docstrings for doom-initialize{,-packages} 2018-05-20 00:01:07 +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
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
7aecb85c34
Reverse order of operations for doom//reload-packages 2018-05-18 01:10:05 +02:00
Henrik Lissner
340aa0449c
Rewrite & optimize autoload generation logic
Now includes package autoloads (which allows us to shed some fat from
various module configs, but that'll come later).
2018-05-18 01:09:14 +02:00
Henrik Lissner
82f9fb7027
Optimize package management commands
Effectively halving run time on package install, update and autoremove
commands.
2018-05-18 01:08:28 +02:00
Henrik Lissner
e2f99a8c24
Load core-lib sooner 2018-05-17 22:44:20 +02:00
Henrik Lissner
9b0dbe20b0
doom//refresh-packages -> doom//reload-packages (consistency) 2018-05-16 18:26:56 +02:00
Henrik Lissner
a1e49d174a
Exclude {packages,doctor}.el from make compile
These two files shouldn't be byte-compiled. Until now it was expected
that you'd include a no-byte-compile: t header in these files. This is
more convenient.
2018-05-16 18:13:07 +02:00
Henrik Lissner
377e8a7b3c
Refactor doom-initialize; error handling for faulty autoloads 2018-05-16 10:50:01 +02:00
Henrik Lissner
3e6d7f174a
Optimize make autoloads & improve path expansion
Make autoloads will expand the include paths of Doom autoload cookies.
This fixes an issue where paths were expanded to include a file
extension, bypassing the benefits of byte-compilation.
2018-05-16 10:50:01 +02:00
Henrik Lissner
980f5e470b
Fix edge case where package autoloads would break startup
Particularly in the case of gh loading eieio and marshal.
2018-05-16 00:57:31 +02:00
Henrik Lissner
595109209a
Fix doom//reload & optimize make all task 2018-05-16 00:11:14 +02:00
Henrik Lissner
9aa346f185
Make packages! accept list of package names (non lists)
This convenience macro lets you specify multiple packages with one
block, e.g.

  (packages! rtags ivy-rtags glsl-mode)

Each entry can be a full recipe.

  (packages! (rtags :disable t) (glsl-mode :recipe (...)))
2018-05-16 00:11:14 +02:00
Henrik Lissner
0dfe1bc3d5
Allow chained package!'s
This allows users to disable one master package, thus disabling all its
children. e.g. Disable irony, then irony-eldoc, flycheck-irony,
company-irony and company-irony-c-headers will be disabled too.
2018-05-16 00:11:14 +02:00
Henrik Lissner
09ecce0073
Fix package! :disable not disabling packages 2018-05-16 00:11:14 +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
12013b4ad4
Cache interpreter-mode-alist in doom-packages-file too 2018-05-15 21:49:51 +02:00
Henrik Lissner
97b8c04dbb
def-package!: specify id for deferred-load transient hooks
Makes them easier to identify in hook lists.
2018-05-15 21:49:51 +02:00
Henrik Lissner
af079e5f6f
Remove unused doom-deferred-packages variable 2018-05-15 21:49:51 +02:00
Henrik Lissner
70d0ce4528
Fix error when def-package-hook! was used anywhere 2018-05-15 11:23:44 +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
bdf6fceb52
Silence deleted *.elc messages if byte-compile fails 2018-05-14 21:09:12 +02:00
Henrik Lissner
bb88411cc9
General minor refactor & docstring fixes 2018-05-14 20:55:55 +02:00
Henrik Lissner
67dab98859
Improve idempotency of Doom config (in case of reloading) 2018-05-14 20:54:58 +02:00
Henrik Lissner
87699f3973
Change doom//reload to only reload private config 2018-05-14 20:37:13 +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
f2eedb44dc
Remove https from package-archives dynamically 2018-05-14 15:57:54 +02:00
Henrik Lissner
0bd88b8414
Add restart-emacs package & commands 2018-05-14 13:05:03 +02:00
Henrik Lissner
d1068723e4
Move doom-packages-file to doom-cache-dir 2018-05-14 13:05:03 +02:00
Henrik Lissner
afdc6a31b5
Move def-setting! macros to core-packages 2018-05-14 13:05:03 +02:00
Henrik Lissner
e3841c4460
Add placement checks for package macros
Doom should complain if these macros are found anywhere they're not
supposed to be.
2018-05-14 13:05:03 +02:00
Henrik Lissner
88082c0dc9
Add doom//reload command (experimental) 2018-05-14 13:05:03 +02:00
Henrik Lissner
9cd2de0ce9
Fix make recompile 2018-05-10 22:39:09 +02:00
Henrik Lissner
4fc990127c
Silence byte-compiler warnings from plugins 2018-04-18 01:08:56 -04:00
Hinckley, Troy J
daa798acfd don't use HTTPS when INSECURE variable is set 2018-04-14 17:46:51 -07:00
Henrik Lissner
a47d76f5f1
Don't error out if no targets for byte-compilation could be found 2018-04-04 08:14:06 -04:00
Henrik Lissner
5282c6c716
Fix default modules being prioritized over private ones 2018-04-03 15:57:51 -04:00
Henrik Lissner
b12d7bde05
Update docstring for package management macros 2018-04-03 15:00:52 -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
4bafe29722
Fix package! :disable not disabling packages
doom-disabled-packages we built either too early or too late, causing
disabled packages to be loaded anyway.
2018-03-28 02:56:24 -04:00
Henrik Lissner
26514e2834
Optimize doom-initialize-packages for cold startup 2018-03-28 00:52:45 -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
fea7c0a661
Minor revision of package!'s docstring 2018-03-26 18:15:03 -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
adf724a6e4
Refactor package!'s docstring & add :ignore to it 2018-03-26 16:44:32 -04:00
Henrik Lissner
dd24578657
Restore :ignore property in package! macro 2018-03-26 16:32:05 -04:00
Henrik Lissner
1282072db3
Correct doom-initialize's docstring 2018-03-26 03:18:28 -04:00
Henrik Lissner
adfd26bbf4
Fix error when doom-packages-file doesn't exist 2018-03-26 03:11:29 -04:00
Henrik Lissner
72eb1422c5
Ensure doom-packages is initialized in doom-initialize 2018-03-26 03:07:28 -04:00
Henrik Lissner
03ed4c39e8
Add package! & disable-packages! convenience macros 2018-03-26 02:59:08 -04:00
Henrik Lissner
f67b4ec743
Add docstring for doom-module-put 2018-03-26 02:58:11 -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
b5db4f1fb6
Debug log missing modules; remove log! macro 2018-03-24 07:25:00 -04:00
Henrik Lissner
3001e59ecc
Don't destroy load-path on reload 2018-03-22 06:28:33 -04:00
Henrik Lissner
dec3ecba6e
package--initialized = nil in doom-initialize; in case of reloads 2018-03-20 21:12:49 -04:00