Commit Graph

226 Commits

Author SHA1 Message Date
7a7b89ded1 Init packages from init.el in noninteractive sessions
This allows users to load init.el for their batch scripts, rather than
some monstrosity involving loading core/core.el and doom-initialize.
2019-11-17 01:17:34 -05:00
17ad5594cf Don't force init in noninteractive sessions
This allows batch scripts to load $EMACSDIR/init.el to use Doom's API.
Howevever, it puts the onus on the user to run `doom refresh` before
trying to use it.

This also indirectly addresses #2010
2019-11-04 17:20:59 -05:00
b00f403fda Don't init all of core in noninteractive sessions
You can therefore load ~/.emacs.d/init.el directly to bootstrap Doom for
your own batch scripts.
2019-11-01 14:12:50 -04:00
323e0adf45 Minor refactors & reformatting across the board 2019-10-17 01:47:58 -04:00
ea936d90c8 Handle --restore unconditionally #1893 2019-10-14 03:00:37 -04:00
da7aef9a4c Move --restore handler to init.el #1893 2019-10-14 02:54:29 -04:00
fa051797f2 Move --restore handler to autoload/sessions 2019-10-07 12:56:53 -04:00
58567b1345 Minor optimization for init.el
The lazy-loaded version library and file-name-directory calls end up
consulting file-name-handler-alist, and can trigger the GC, so we ensure
these things happen after the other optimizations.
2019-09-03 00:59:46 -04:00
aecf3e4e63 Remove unnecessary interactive check in init.el
init.el should never be sourced non-interactively.
2019-08-28 22:08:13 -04:00
8ac1e1a781 Refactor doom init process
- Refactors doom-initialize
- Moves doom-initialize-modules call to init.el, to more easily isolate
  it during unit testing.
2019-08-27 00:05:12 -04:00
81ab3dbc5d Simplify and decouple init files
The two doom-gc-* variables in init.el couples the rest of the config to
these two files. The bulk of GC/file-handler optimization was moved into
core.el and simplified (all that idle-timer voodoo was overkill).

Also adds (setq frame-inhibit-implied-reize t) to early-init, which
speeds up startup a fair bit in some edge cases with larger fonts.

squash! Simplify and decouple init files
2019-07-22 02:30:38 +02:00
149b2617b0 💥 revise hook/var fns naming convention (2/2)
This is second of three big naming convention changes. In this commit,
we change the naming conventions for hook functions and variable
functions:

1. Replace the bar | to indicate a hook function with a -h suffix, e.g.

     doom|init-ui -> doom-init-ui-h
     doom|run-local-var-hooks -> doom-run-local-var-hooks-h

2. And add a -fn suffix for functions meant to be set on variables,
   e.g.

     (setq magit-display-buffer-function #'+magit-display-buffer-fn)

See ccf327f8 for the reasoning behind these changes.
2019-07-22 02:30:38 +02:00
2525822791 Move GC optimization to init.el
And reformat core.el
2019-05-15 18:30:20 -04:00
20596cd41f Reformat gc optimization & gc on focus-out
Also raises the gc upper limit to 512mb
2019-05-13 19:34:44 -04:00
c6fc47cc8d Suppress 'void-variable: after-init-time' error #1358
Old versions of Emacs complain about after-init-time being undefined.
This happens before Doom's version guard is triggered (which emits a
more helpful message).
2019-04-24 18:16:06 -04:00
6bd7b72281 Restore startup optimizations on after-init-hook
Fixes an issue where tramp file handlers were overwritten because they
were added to file-name-handler-alist at the end of after-init-hook.
2018-12-06 17:45:50 -05:00
1f839b4423 Revise & update comments
Fix reference to old name of a hook function.
2018-10-01 18:53:34 -04:00
57579b883b Refactor doom core files 2018-09-09 09:58:20 -04:00
937f118e6a Reset gc-cons-threshold on idle timer
And remove reset from doom-reload-hook, as it is no longer necessary
anymore. ~/.emacs.d/init.el is no longer re-evaluated at any point.
2018-09-09 09:58:18 -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
31bcac9a1e Refactor gc optimizations on startup
Slightly smaller default gc-cons-threshold (and default
gc-cons-percentage), for less stuttering, and use most-postive-fixnum as
a ceiling.
2018-09-02 17:28:04 +02:00
96f2208995 Move early-init.el to init.el (for now)
Calling tool-bar-mode, menu-bar-mode or scroll-bar-mode from
early-init.el seems to cause a 15-30% slowdown in startup time, possibly
for loading the UI libraries early.

Also, loading early-init.el eagerly from init.el causes a GC hit for
Emacs 25/26 users. It's too early to use this optimization.
2018-08-31 23:44:11 +02:00
26896fd8bb Announce DOOM envvar to sub-processes 2018-08-26 00:20:18 +02:00
58b723bc54 Load early-init.el if early-init-file is not bound *and* true
For Emacs 27, the symbol is still bound when using -Q, which means it
won't be loaded from bin/doom.
2018-07-12 16:38:58 -07:00
f3b42a73b3 Silence early-init.el load at startup 2018-06-19 19:18:27 +02:00
b656e68bc3 Move startup optimization to early-init
Also load early-init from init if early-init-file isn't bound. This
improves startup a modest 3-5% for Emacs 27 users.
2018-06-16 11:38:19 +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
41f4a31096 Refactor init.el (minor) 2018-05-26 22:27:52 +02:00
33e478cf33 Revert "Seriously. Don't prioritize *.elc files in noninteractive sessions!"
This reverts commit 1d54ba4a37
2018-05-26 21:09:10 +02:00
1d54ba4a37 Seriously. Don't prioritize *.elc files in noninteractive sessions! 2018-05-25 19:22:44 +02:00
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
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
c7e2b38368 Move core/debug.el => ./debug.el
"debug.el" conflicts with built-in debug package
2018-04-22 17:22:14 -04:00
f3facdf642 Add simple vanilla-emacs test ground 2018-04-21 21:05:31 -04:00
2933142d40 💥 add default init.el
Doom is moving away from supporting direct modification of its source
files, or private modules within Doom's source tree. Instead,
customizations should be relegated to ~/.doom.d/ (or ~/.config/doom/,
doom will respect XDG conventions if it sees this directory).

As suchm a default init.el is now supplied, which will break your custom
~/.emacs.d/init.el!

The quick fix:

  mkdir ~/.doom.d
  mv ~/.emacs.d/init.el ~/.doom.d/init.el

~/.doom.d/early-init.el is also available if you need to change crucial
settings before Doom loads anything. init.el will still be loaded before
any other module is.
2018-04-03 19:50:34 -04:00
62ce9115e5 init.el => init.example.el 2017-02-20 00:23:03 -05:00
0470a6fa0c New init.el 2017-02-20 00:23:03 -05:00
c7a9697259 v1.3.1 bump 2017-01-07 03:03:11 -05:00
dbacc26e11 org-mode: major rewrite + refactor 2017-01-03 22:50:52 -05:00
4c25eaac48 Load core-ui first 2016-10-24 02:46:24 +02:00
d187e6c044 v1.3.0 bump 2016-10-06 20:18:32 +02:00
f39cb13583 Init core-os sooner 2016-10-06 17:28:27 +02:00
a658d46927 Change theme/font selection; it's .emacs.local.d's responsibility 2016-10-04 22:52:43 +02:00
4e3e624242 v1.2.9 bump 2016-10-02 23:34:54 +02:00
ceece44fec Use (emacs-init-time) instead of manual benchmark 2016-10-02 23:34:54 +02:00
809d5fe681 v1.2.8 bump 2016-09-23 16:14:12 +02:00
c36dad154c General cleanup 2016-09-19 17:48:12 +02:00
3256102b31 v1.2.7 bump 2016-09-08 12:33:42 +02:00
84448c77fa Add module-asm.el 2016-09-08 01:03:39 +02:00
a2349cf8ff Extract mode-line config into core/core-modeline.el 2016-09-08 00:15:24 +02:00