From 3db66f9be62c9142f6b4f4ff7b55db291ead0b1d Mon Sep 17 00:00:00 2001 From: Case Duckworth Date: Tue, 4 Jan 2022 21:10:07 -0600 Subject: System-itize --- init.el | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/init.el b/init.el index 06f92ba..d9d8c00 100644 --- a/init.el +++ b/init.el @@ -21,8 +21,6 @@ private)) (require (or (car-safe feature) feature) (cdr-safe feature) :noerror)) -(setq debug-on-error (memq system-type '(msdos windows-nt))) - (setup (:require +casing) (with-eval-after-load '+key (define-key +key-mode-map (kbd "C-c c") +casing-map)) @@ -218,10 +216,10 @@ #'hl-line-mode) (:+key "C-x C-j" #'dired-jump) (with-eval-after-load 'dired - (pcase system-type - ((or 'ms-dos 'windows-nt) + (pcase system-system + ('windows (:straight w32-browser)) - ((or 'gnu/linux) + ('linux (:straight dired-open) (:option dired-listing-switches (concat dired-listing-switches " -F"))))) @@ -907,14 +905,19 @@ See also `crux-reopen-as-root-mode'." (:hook-into eshell-mode)) (setup (:straight-when exec-path-from-shell - (eq system-type 'gnu/linux)) - (when (daemonp) - (exec-path-from-shell-initialize)) - (exec-path-from-shell-copy-envs '("XDG_CONFIG_HOME" - "XDG_CONFIG_DIRS" - "XDG_DATA_HOME" - "XDG_DATA_DIRS" - "XDG_CACHE_HOME"))) + (eq system-system 'linux)) + (dolist (var '("SSH_AUTH_SOCK" + "SSH_AGENT_PID" + "GPG_AGENT_INFO" + "LANG" + "LC_CTYPE" + "XDG_CONFIG_HOME" + "XDG_CONFIG_DIRS" + "XDG_DATA_HOME" + "XDG_DATA_DIRS" + "XDG_CACHE_HOME")) + (add-to-list 'exec-path-from-shell-variables var)) + (exec-path-from-shell-initialize)) (setup (:straight expand-region) (:+key "C-=" #'er/expand-region)) @@ -931,7 +934,7 @@ See also `crux-reopen-as-root-mode'." (setup (:straight-when (forge :host github :repo "magit/forge") - (eq system-type 'gnu/linux)) + (eq system-system 'linux)) (require 'forge) (add-to-list 'forge-alist '("tildegit.org" "tildegit.org/api/v1" "tildegit.org" @@ -1124,7 +1127,9 @@ See also `crux-reopen-as-root-mode'." scheme-mode)) (setup (:straight-when pdf-tools - (eq system-type 'gnu/linux)) + ;; Ensure we can build `pdf-tools' + (or (executable-find "gcc") + (executable-find "g++"))) (pdf-tools-install t)) (setup (:straight (shell-command+ @@ -1235,7 +1240,7 @@ See also `crux-reopen-as-root-mode'." (:option undo-fu-session-incompatible-files '("/COMMIT_EDITMSG\\'" "/git-rebase-todo\\'") undo-fu-session-directory (.etc "undo/" t) - undo-fu-session-compression (eq system-type 'gnu/linux)) + undo-fu-session-compression (executable-find "gzip")) (global-undo-fu-session-mode +1)) (setup (:straight (vertico -- cgit 1.4.1-21-gabe81