41 lines
1.3 KiB
EmacsLisp
41 lines
1.3 KiB
EmacsLisp
;; -*- coding: utf-8; lexical-binding: t; -*-
|
|
|
|
;;; Prolog
|
|
|
|
(let ((minver "26.1"))
|
|
(when (version< emacs-version minver)
|
|
(error "Emacs v%s or higher is required." minver)))
|
|
|
|
;; don't GC during startup to save time
|
|
(setq gc-cons-percentage 0.6)
|
|
(setq gc-cons-threshold most-positive-fixnum)
|
|
|
|
;;; straight and use-package setup
|
|
|
|
(defconst straight-use-package-by-default 't)
|
|
(defconst bootstrap-version 5)
|
|
(let ((bootstrap-file
|
|
(expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)))
|
|
(unless (file-exists-p bootstrap-file)
|
|
(with-current-buffer
|
|
(url-retrieve-synchronously
|
|
"https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
|
|
'silent 'inhibit-cookies)
|
|
(goto-char (point-max))
|
|
(eval-print-last-sexp)))
|
|
(load bootstrap-file nil 'nomessage))
|
|
|
|
|
|
;;; Epilog
|
|
|
|
;; Set some more modern defaults for gc
|
|
;; https://www.reddit.com/r/emacs/comments/55ork0/is_emacs_251_noticeably_slower_than_245_on_windows/
|
|
;; https://github.com/emacs-lsp/lsp-mode#performance
|
|
(setq gc-cons-threshold (* 100 1024 1024))
|
|
(setq gc-cons-percentage 0.1) ; original value
|
|
;; (setq garbage-collection-messages t)) ; gc debugging
|
|
(run-with-idle-timer 5 nil #'garbage-collect)
|
|
|
|
;;; Local Variables:
|
|
;;; no-byte-compile: t
|
|
;;; End:
|