refactor: Move user config into modules/

This commit is contained in:
Madeleine Sydney
2025-03-13 11:14:32 -06:00
parent 257f011a99
commit fb3299d89c
85 changed files with 597 additions and 542 deletions

View File

@@ -0,0 +1,44 @@
;;; syd-scratch.el -*- lexical-binding: t; -*-
(require 'syd-prelude)
;; Persist the scratch buffer between sessions. Note that it is not persisted
;; between boots.
;; TODO: This could be better deferred.
(use-package persistent-scratch
:hook (after-init)
:custom (persistent-scratch-save-file
(file-name-concat syd-data-dir "scratch"))
:config
;; The default warning message is a bit too error-looking for my tastes. This
;; is the same function, but with a tamer warning message.
(defun syd--persistent-scratch--auto-restore-a ()
"Automatically restore the scratch buffer once per session."
(unless persistent-scratch--auto-restored
(condition-case err
(persistent-scratch-restore)
(error
(message "No previous scratch buffer to restore")))
(setq persistent-scratch--auto-restored t)))
(advice-add #'persistent-scratch--auto-restore
:override #'syd--persistent-scratch--auto-restore-a)
;; Arrange the activation of autosave and auto-restore (if applicable) on
;; Emacs start.
(persistent-scratch-setup-default))
(use-package emacs
:custom ((initial-scratch-message
(with-temp-buffer
(insert-file-contents "/persist/vault/crumb/cool-deer.org")
(buffer-string)))
;; Initial major mode for scratch buffer.
(initial-major-mode 'fundamental-mode)
;; Disable the initial "help" screen, in favour of starting off in
;; the scratch buffer.
(inhibit-splash-screen t)
(inhibit-startup-screen t)
(inhibit-startup-message t)))
(provide 'syd-scratch)
;;; syd-scratch.el ends here