Commit Graph

326 Commits

Author SHA1 Message Date
c8b07f3caa Fail gracefully if incremental load fails
...and continue loading other packages regardless.
2018-09-20 10:42:45 -04:00
ba16dd8954 Resolve symlinks in doom-emacs-dir (and inline it) 2018-09-19 19:41:46 -04:00
cc28aacecb Don't inline DOOMDIR in doom-private-dir
Breaks DOOMDIR when config is byte-compiled, as mentioned in #900
2018-09-19 19:27:49 -04:00
f4e119a642 Couple core-packages to package.el sooner
This way, if the user loads package.el themselves, doom's package.el
settings will take effect immediately.
2018-09-18 15:19:50 -04:00
b96d50b3de history-length = 500 2018-09-18 15:19:50 -04:00
e80f5e4c85 Remove unnecessary optimization in doom-try-run-hook
Hooks run with this should already be run in a gc-deferred state (at
startup), so deferring garbage collection _again_ may just cause
unnecessary consing.
2018-09-18 11:45:13 -04:00
b7be38b2a9 New incremental lazy-loading at startup
This is for loading large packages (like org and magit) quietly in the
background during idle time. It is already set up to incrementally load
org and magit.

This is still experimental, however. the idle timers may need to be
tweaked.
2018-09-18 11:42:35 -04:00
a9fdeefe15 Revert 142d364
Only add doom-private-dir to load-path during autoload generation,
otherwise a $DOOMDIR/autoload.el will shadow the built-in autoload.el
Emacs package.

Note: with `doom-private-dir' in `load-path', Doom autoloads files will
be unable to declare autoloads for the built-in autoload.el Emacs
package, should $DOOMDIR/autoload.el exist. Not sure why they'd want to
though, so it's an acceptable compromise for simpler autoload
declarations.
2018-09-14 09:39:40 -04:00
142d3646ef Add doom-private-dir to load-path
Makes private autoload paths simpler
2018-09-13 19:15:15 -04:00
75036cefb0 Revert max-{specpdl-size,lisp-eval-depth} changes
They were unnecessary and could cause crashing in some cases.
2018-09-10 09:04:27 -04:00
f07ae6a02b max-specpdl-size = 5000, max-lisp-eval-depth = 2500
The defaults were designed for much, much older systems. We can safely
increase this to stave off premature abortion of intentional deeply
nested loops or excessive allocations.
2018-09-09 09:58:20 -04:00
57579b883b Refactor doom core files 2018-09-09 09:58:20 -04:00
7d3ffdff06 Remove third line in section headers
This is truly important stuff. We've saved many lives with this update.
2018-09-09 09:58:19 -04:00
eaa10946f1 Refactor startup optimizations
+ Add doom-gc-cons-upper-limit variable
+ Don't use most-positive-fixnum, in case Emacs somehow wants to
  allocate that much!
+ Don't use startup optimizations in noninteractive sessions
+ Restore gc-cons-threshold on idle timer, instead of hook (to defer the
  possible GC pause and so deferred packages can take advantage of these
  optimizations).
2018-09-03 03:58:43 +02:00
daef19ba64 Defer garbage collection in the minibuffer
This can speed up things that run in or from the minibuffer, like
projectile/helm/ivy commands.
2018-09-02 17:06:12 +02:00
712b775f36 Remove doom*set-indirect-buffer-filename hack
This was done to help the modeline build its file path in indirect
buffers, but this has been fixed by using buffer-base-buffer.

Both ui/modeline and ui/doom-modeline have been refactored to
accommodate this.
2018-09-01 12:39:26 +02:00
300181aba3 Move custom hooks in core.el closer to top
Conform to the Doom/lisp convention of defining customizable elements
close to the top of files.
2018-08-26 00:20:18 +02:00
631c4004ba Load custom-file only once & after user's config
This change facilitates the users that prefer their custom-file
somewhere other than doom-local-dir (e.g. in ~/.doom.d/custom.el).

This change prevents loading both files during startup. Just change
`custom-file` and Doom will load it after your config.el is loaded (but
before doom-post-init-hook runs).
2018-08-25 19:45:23 +02:00
62977247c9 Revert da7f9019 & refactor doom init hooks 2018-08-21 04:27:14 +02:00
da7f9019d1 Run doom-post-init-hook as late as possible
Possibly fixes recursive load errors, to do with
kill-buffer-query-functions and buffer-predicate autoloads loading in a
weird way on Emacs 25 (and especially on MacOS, for some reason).
2018-08-21 04:03:05 +02:00
ee73d6c9af Minor reformatting & comment tweaks 2018-08-21 03:34:39 +02:00
f923ed4341 Add docstrings to doom-inhibit-switch-*-hooks vars 2018-08-17 04:34:43 +02:00
deea5f11b3 Fix enter/exit window/buffer hook names 2018-08-17 04:01:46 +02:00
4a4b012b5d Move custom hooks to core/core.el
Also ensures that the custom hooks aren't fired until as late as
possible, which prevents a few packages from prematurely loading at
startup. Faster startup! Yay!
2018-08-17 01:57:09 +02:00
25d9786edf Add early-init-file support to doom/profile-emacs #788
And fix wrong-type-argument: stringp errors when running esup.

Also ensure that doom|run-all-startup-hooks sets after-init-time.
2018-08-13 03:47:33 +02:00
36044fccc9 defconst -> defvar for global constants
So they can be changed prior to being defined (e.g. for
doom/open-vanilla-sandbox).
2018-08-12 02:45:28 +02:00
6eafdd7c62 Refactor module load process
doom! no longer loads modules, it only sets
doom-modules (incrementally).

Instead, modules are loaded by doom-initialize-modules (which makes more
sense).
2018-08-08 23:37:30 +02:00
f88a97177c Rename doom-ensure-core-directories
Give it a more descriptive name
2018-08-08 23:37:30 +02:00
ea0f46b181 Add 2nd arg to doom-initialize to load core libs
This restores the correct value of noninteractive while core libs are
loading, so packages like recentf can avoid initializing when running
emacs non interactively (thus polluting output or possibly causing
errors).
2018-08-03 16:35:42 +02:00
f16597ec72 Set gamegrid-user-score-file-directory
THIS IS IMPORTANT GUYS
2018-08-02 17:06:30 +02:00
f3a3465c04 history-length = 250
Reduce from 500 to slim savehist data files and general Emacs memory
footprint.
2018-07-29 17:41:59 +02:00
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