From d41a1c171b483228fd0618365f7a10cc3e2243e5 Mon Sep 17 00:00:00 2001 From: Armin Friedl Date: Sat, 30 Jan 2021 12:03:00 +0100 Subject: [PATCH] Add straight --- .gitignore | 4 +++- init.el | 41 +++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 init.el diff --git a/.gitignore b/.gitignore index a2f2a41..42af5e8 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,9 @@ dist/ # Flycheck flycheck_*.el +# Straight +straight/ + # server auth directory /server/ @@ -48,7 +51,6 @@ flycheck_*.el # network security /network-security.data - # ---> Linux *~ diff --git a/init.el b/init.el new file mode 100644 index 0000000..6835d51 --- /dev/null +++ b/init.el @@ -0,0 +1,41 @@ +;; -*- 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: