2018-04-03 19:48:20 -04:00
|
|
|
;;; init.el -*- lexical-binding: t; -*-
|
|
|
|
;;
|
|
|
|
;; Author: Henrik Lissner <henrik@lissner.net>
|
|
|
|
;; URL: https://github.com/hlissner/doom-emacs
|
|
|
|
;;
|
|
|
|
;; ================= =============== =============== ======== ========
|
|
|
|
;; \\ . . . . . . .\\ //. . . . . . .\\ //. . . . . . .\\ \\. . .\\// . . //
|
|
|
|
;; ||. . ._____. . .|| ||. . ._____. . .|| ||. . ._____. . .|| || . . .\/ . . .||
|
|
|
|
;; || . .|| ||. . || || . .|| ||. . || || . .|| ||. . || ||. . . . . . . ||
|
|
|
|
;; ||. . || || . .|| ||. . || || . .|| ||. . || || . .|| || . | . . . . .||
|
|
|
|
;; || . .|| ||. _-|| ||-_ .|| ||. . || || . .|| ||. _-|| ||-_.|\ . . . . ||
|
|
|
|
;; ||. . || ||-' || || `-|| || . .|| ||. . || ||-' || || `|\_ . .|. .||
|
|
|
|
;; || . _|| || || || || ||_ . || || . _|| || || || |\ `-_/| . ||
|
|
|
|
;; ||_-' || .|/ || || \|. || `-_|| ||_-' || .|/ || || | \ / |-_.||
|
|
|
|
;; || ||_-' || || `-_|| || || ||_-' || || | \ / | `||
|
|
|
|
;; || `' || || `' || || `' || || | \ / | ||
|
|
|
|
;; || .===' `===. .==='.`===. .===' /==. | \/ | ||
|
|
|
|
;; || .==' \_|-_ `===. .===' _|_ `===. .===' _-|/ `== \/ | ||
|
|
|
|
;; || .==' _-' `-_ `=' _-' `-_ `=' _-' `-_ /| \/ | ||
|
|
|
|
;; || .==' _-' '-__\._-' '-_./__-' `' |. /| | ||
|
|
|
|
;; ||.==' _-' `' | /==.||
|
|
|
|
;; ==' _-' \/ `==
|
|
|
|
;; \ _-' `-_ /
|
|
|
|
;; `'' ``'
|
|
|
|
;;
|
|
|
|
;; These demons are not part of GNU Emacs.
|
|
|
|
;;
|
|
|
|
;;; License: MIT
|
|
|
|
|
2020-12-01 19:33:55 -05:00
|
|
|
(when (< emacs-major-version 26)
|
|
|
|
(error "Detected Emacs v%s. Doom only supports Emacs 26 and newer"
|
|
|
|
emacs-version))
|
|
|
|
|
2019-07-21 03:01:15 +02:00
|
|
|
;; A big contributor to startup times is garbage collection. We up the gc
|
2019-12-16 19:37:57 -05:00
|
|
|
;; threshold to temporarily prevent it from running, then reset it later by
|
|
|
|
;; enabling `gcmh-mode'. Not resetting it will cause stuttering/freezes.
|
2019-07-21 03:01:15 +02:00
|
|
|
(setq gc-cons-threshold most-positive-fixnum)
|
|
|
|
|
2018-09-07 21:43:32 -04:00
|
|
|
;; In noninteractive sessions, prioritize non-byte-compiled source files to
|
2019-07-21 03:01:15 +02:00
|
|
|
;; prevent the use of stale byte-code. Otherwise, it saves us a little IO time
|
2019-12-06 17:16:34 -05:00
|
|
|
;; to skip the mtime checks on every *.elc file.
|
2018-09-02 17:28:04 +02:00
|
|
|
(setq load-prefer-newer noninteractive)
|
2018-08-31 23:40:54 +02:00
|
|
|
|
2020-12-01 19:33:55 -05:00
|
|
|
;; `file-name-handler-alist' is consulted on every `require', `load' and various
|
|
|
|
;; path/io functions. You get a minor speed up by nooping this. However, this
|
|
|
|
;; may cause problems on builds of Emacs where its site lisp files aren't
|
|
|
|
;; byte-compiled and we're forced to load the *.el.gz files (e.g. on Alpine)
|
|
|
|
(unless (daemonp)
|
|
|
|
(defvar doom--initial-file-name-handler-alist file-name-handler-alist)
|
|
|
|
(setq file-name-handler-alist nil)
|
|
|
|
;; Restore `file-name-handler-alist' later, because it is needed for handling
|
|
|
|
;; encrypted or compressed files, among other things.
|
|
|
|
(defun doom-reset-file-handler-alist-h ()
|
|
|
|
;; Re-add rather than `setq', because changes to `file-name-handler-alist'
|
|
|
|
;; since startup ought to be preserved.
|
|
|
|
(dolist (handler file-name-handler-alist)
|
|
|
|
(add-to-list 'doom--initial-file-name-handler-alist handler))
|
|
|
|
(setq file-name-handler-alist doom--initial-file-name-handler-alist))
|
|
|
|
(add-hook 'emacs-startup-hook #'doom-reset-file-handler-alist-h))
|
|
|
|
|
|
|
|
;; Ensure Doom is running out of this file's directory
|
|
|
|
(setq user-emacs-directory (file-name-directory load-file-name))
|
2019-09-03 00:43:25 -04:00
|
|
|
|
2019-08-23 20:33:30 -04:00
|
|
|
;; Load the heart of Doom Emacs
|
2019-09-03 00:43:25 -04:00
|
|
|
(load (concat user-emacs-directory "core/core")
|
|
|
|
nil 'nomessage)
|
2019-08-23 20:33:30 -04:00
|
|
|
|
|
|
|
;; And let 'er rip!
|
2019-11-04 17:20:20 -05:00
|
|
|
(doom-initialize)
|