init: remove broken let() around everything. More to come.

This commit is contained in:
MitchMarq42 2023-01-04 12:04:27 -09:00
parent bafcb8da3a
commit 7e06facbfd

107
init.el
View File

@ -10,96 +10,91 @@
;;; Code: ;;; Code:
;; Speed up loading/finding files ;; Speed up loading/finding files
(let
(
;; (file-name-handler-alist nil) ;; no. Breaks evil for some reason.
)
;; Load the files that I put my settings in... ;; Load the files that I put my settings in...
(defvar mitch-directory (defvar mitch-directory
(directory-file-name (directory-file-name
(concat user-emacs-directory (concat user-emacs-directory
(convert-standard-filename "lisp/")))) (convert-standard-filename "lisp/"))))
(add-to-list 'load-path mitch-directory t) (add-to-list 'load-path mitch-directory t)
(setq custom-theme-directory mitch-directory) (setq custom-theme-directory mitch-directory)
(require 'mitch-defuns) (require 'mitch-defuns)
;; minify yes/no prompts ;; minify yes/no prompts
;; (if (>= (string-to-number emacs-version) 28) ;; (if (>= (string-to-number emacs-version) 28)
;; (defvar use-short-answers t)) ;; doesn't work ;; (defvar use-short-answers t)) ;; doesn't work
(defalias 'yes-or-no-p 'y-or-n-p) (defalias 'yes-or-no-p 'y-or-n-p)
;; do the things ;; do the things
(add-hook 'server-after-make-frame-hook #'mitch/graphical-setup) (add-hook 'server-after-make-frame-hook #'mitch/graphical-setup)
(if (display-graphic-p) (mitch/graphical-setup)) (if (display-graphic-p) (mitch/graphical-setup))
;; Control backups/swapfiles ;; Control backups/swapfiles
(defvar backup-directory (defvar backup-directory
(expand-file-name "emacs-backups" (expand-file-name "emacs-backups"
(or (getenv "XDG_CACHE_HOME") (or (getenv "XDG_CACHE_HOME")
(expand-file-name (expand-file-name
".cache" "~")))) ".cache" "~"))))
(if (not (file-exists-p backup-directory)) (if (not (file-exists-p backup-directory))
(make-directory backup-directory t)) (make-directory backup-directory t))
(setq backup-directory-alist `(("." . ,backup-directory))) (setq backup-directory-alist `(("." . ,backup-directory)))
;; auto-save-mode doesn't create the path automatically! ;; auto-save-mode doesn't create the path automatically!
(defvar auto-save-directory (defvar auto-save-directory
(expand-file-name "tmp/auto-saves/" backup-directory)) (expand-file-name "tmp/auto-saves/" backup-directory))
(make-directory auto-save-directory t) (make-directory auto-save-directory t)
(setq auto-save-list-file-prefix (setq auto-save-list-file-prefix
(expand-file-name "sessions/" auto-save-directory) (expand-file-name "sessions/" auto-save-directory)
auto-save-file-name-transforms auto-save-file-name-transforms
`((".*" ,auto-save-directory t))) `((".*" ,auto-save-directory t)))
(setq create-lockfiles nil) (setq create-lockfiles nil)
;; remove auto-generated bits ;; remove auto-generated bits
(setq custom-file (expand-file-name "custom.el" backup-directory)) (setq custom-file (expand-file-name "custom.el" backup-directory))
(if (not (file-exists-p custom-file)) (if (not (file-exists-p custom-file))
(make-empty-file custom-file t)) (make-empty-file custom-file t))
(load custom-file) (load custom-file)
;; straight.el: the better package manager? ;; straight.el: the better package manager?
;; minified bootstrap (split lines if you want) (or not) ;; minified bootstrap (split lines if you want) (or not)
;; (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (setq straight-use-package-by-default t) ;; (defvar bootstrap-version) (let ((bootstrap-file (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory)) (bootstrap-version 5)) (unless (file-exists-p bootstrap-file) (with-current-buffer (url-retrieve-synchronously "https://raw.githubusercontent.com/radian-software/straight.el/develop/install.el" 'silent 'inhibit-cookies) (goto-char (point-max)) (eval-print-last-sexp))) (load bootstrap-file nil 'nomessage)) (straight-use-package 'use-package) (setq straight-use-package-by-default t)
;; actually, use elpaca instead ;; actually, use elpaca instead
(require 'elpaca-bootstrap) (elpaca use-package (require 'use-package)) (require 'elpaca-bootstrap) (elpaca use-package (require 'use-package))
;; actually, don't because it's broken on Windows ;; actually, don't because it's broken on Windows
(require 'mitch-packages) (require 'mitch-packages)
;; Absolute line numbers. Relative ones are an annoyance to set up, sadly. ;; Absolute line numbers. Relative ones are an annoyance to set up, sadly.
;; (global-display-line-numbers-mode) ;; (global-display-line-numbers-mode)
;; (defvar display-line-numbers-width-start t) ;; (defvar display-line-numbers-width-start t)
;; scroll step stuff ;; scroll step stuff
(setq scroll-margin 2 (setq scroll-margin 2
scroll-conservatively 100 scroll-conservatively 100
scroll-up-aggressively 0.01 scroll-up-aggressively 0.01
scroll-down-aggressively 0.01) scroll-down-aggressively 0.01)
(global-visual-line-mode t) (global-visual-line-mode t)
;; UTF-8 supremacy (Snippet originally from https://github.com/doomemacs/doomemacs/blob/master/early-init.el, but it's not in there anymore) ;; UTF-8 supremacy (Snippet originally from https://github.com/doomemacs/doomemacs/blob/master/early-init.el, but it's not in there anymore)
(set-language-environment "UTF-8") (set-language-environment "UTF-8")
;; Toggle Japanese with `qq' ;; Toggle Japanese with `qq'
;; Sample text: 進撃 の 巨人 ;; Sample text: 進撃 の 巨人
;; (shingeki no kyojin (attack on titan)) ;; (shingeki no kyojin (attack on titan))
(setq default-input-method "japanese") (setq default-input-method "japanese")
;; DISABLED because something broke and I didn't bother figuring out what... ;; DISABLED because something broke and I didn't bother figuring out what...
;; Don't barf out emacs errors as they are encountered ;; Don't barf out emacs errors as they are encountered
(setq debug-on-error nil) (setq debug-on-error nil)
;; Speed up scrolling down (why is this even a thing?) ;; Speed up scrolling down (why is this even a thing?)
(setq auto-window-vscroll nil) (setq auto-window-vscroll nil)
;; Display "labmda" as λ ;; Display "labmda" as λ
(global-prettify-symbols-mode 1) (global-prettify-symbols-mode 1)
)
;; lower gc threshold again ;; lower gc threshold again
(setq gc-cons-threshold (* 2 1000 1000)) (setq gc-cons-threshold (* 2 1000 1000))