Move machine and platform specific code into new files

Move some config out of custom.el for portability
This commit is contained in:
Emma Turner
2026-05-22 15:02:29 -06:00
parent 1fa1c1b89b
commit 373111e0e8
5 changed files with 48 additions and 38 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
custom.el

View File

@@ -9,6 +9,8 @@
;; (setq user-full-name "John Doe"
;; user-mail-address "john@doe.com")
(add-load-path! (expand-file-name "lisp" doom-user-dir))
;; Doom exposes five (optional) variables for controlling fonts in Doom:
;;
;; - `doom-font' -- the primary font to use
@@ -43,11 +45,9 @@
;; (setq display-line-numbers-type t)
(setq display-line-numbers-type 'relative)
;; If you use `org' and don't want your org files in the default location below,
;; change `org-directory'. It must be set before org loads!
(setq!
org-directory
"C:/Users/EmmaTurner/OneDrive - Exponential Technology Group, Inc/Documents/Notes/")
(require (intern (system-name)))
(require (intern (format "%s" system-type)))
;; Whenever you reconfigure a package, make sure to wrap your config in an
;; `after!' block, otherwise Doom's defaults may override your settings. E.g.
@@ -83,6 +83,8 @@
(after!
org (setq org-hide-emphasis-markers t) (setq org-log-done 'time)
(push '("cs" . csharp) org-src-lang-modes)
;; Collect all .org from my Org directory and subdirs
(defun load-org-agenda-files-recursively (dir)
"Find all directories in DIR."
@@ -127,22 +129,6 @@
:commands (elisp-autofmt-mode elisp-autofmt-buffer)
:hook (emacs-lisp-mode . elisp-autofmt-mode))
;; Windows path
(when (eq system-type 'windows-nt)
;; https://emacs.stackexchange.com/a/29949
;; Make sure Unix tools are in front of `exec-path'
;; (let ((bash (executable-find "bash")))
;; (when bash
;; (push (file-name-directory bash) exec-path)))
(push "C:/Program Files/Git/usr/bin/" exec-path)
;; Update PATH from exec-path
(let ((path
(mapcar
'file-truename
(append exec-path (split-string (getenv "PATH") path-separator t)))))
(setenv "PATH" (mapconcat 'identity (delete-dups path) path-separator))))
;; Based off https://github.com/alphapapa/unpackaged.el#ensure-blank-lines-between-headings-and-before-contents
;;;###autoload

View File

@@ -1,17 +0,0 @@
;;; -*- lexical-binding: t -*-
(custom-set-variables
;; custom-set-variables was added by Custom.
;; If you edit it by hand, you could mess it up, so be careful.
;; Your init file should contain only one such instance.
;; If there is more than one, they won't work right.
'(org-src-lang-modes
'(("md" . markdown) ("C" . c) ("C++" . c++) ("asymptote" . asy)
("beamer" . latex) ("calc" . fundamental) ("cpp" . c++) ("ditaa" . artist)
("desktop" . conf-desktop) ("dot" . fundamental) ("elisp" . emacs-lisp)
("ocaml" . tuareg) ("screen" . shell-script) ("sqlite" . sql)
("toml" . conf-toml) ("shell" . sh) ("ash" . sh) ("sh" . sh) ("bash" . sh)
("jsh" . sh) ("bash2" . sh) ("dash" . sh) ("dtksh" . sh) ("ksh" . sh)
("es" . sh) ("rc" . sh) ("itcsh" . sh) ("tcsh" . sh) ("jcsh" . sh)
("csh" . sh) ("ksh88" . sh) ("oash" . sh) ("pdksh" . sh) ("mksh" . sh)
("posix" . sh) ("wksh" . sh) ("wsh" . sh) ("zsh" . sh) ("cs" . csharp)
("rpm" . sh))))

13
lisp/DESKTOP-TPC8GRE.el Normal file
View File

@@ -0,0 +1,13 @@
;;; $DOOMDIR/lsip/DESKTOP-TPC8GRE.el -*- lexical-binding: t; -*-
;; Must be set before org loads
(setopt
org-directory
"C:/Users/EmmaTurner/OneDrive - Exponential Technology Group, Inc/Documents/Notes/")
(provide (intern (system-name)))
;; For elisp-autofmt
;; Local variables:
;; elisp-autofmt-load-packages-local: ("use-package" "use-package-core")
;; end:

27
lisp/windows-nt.el Normal file
View File

@@ -0,0 +1,27 @@
;;; $DOOMDIR/lisp/windows-nt.el -*- lexical-binding: t; -*-
;; Windows path
(when (eq system-type 'windows-nt)
;; https://emacs.stackexchange.com/a/29949
;; Make sure Unix tools are in front of `exec-path`
;; (let ((bash (executable-find "bash")))
;; (when bash
;; (push (file-name-directory bash) exec-path)))
;;
;; version of bash found is incorrect, so just use the system git path instead
(push "C:/Program Files/Git/usr/bin/" exec-path)
;; Update PATH from exec-path
(let ((path
(mapcar
'file-truename
(append exec-path (split-string (getenv "PATH") path-separator t)))))
(setenv "PATH" (mapconcat 'identity (delete-dups path) path-separator))))
(provide (intern (format "%s" system-type)))
;; For elisp-autofmt
;; Local variables:
;; elisp-autofmt-load-packages-local: ("use-package" "use-package-core")
;; end: