diff --git a/README.org b/README.org index 6f838d0..6bbcbf6 100755 --- a/README.org +++ b/README.org @@ -91,9 +91,6 @@ On boot, ... - =/persist/vault/«user»= :: Persistent files belonging to specific users. This differs from the persistent home directories in that files are not necessarily linked anywhere. -* ~sydnix-cli~ - -sydnix-cli is a command-line utility written in Clojure wrapping various sydnix-related scripts. ** Deferring Emacs packages @@ -137,24 +134,86 @@ As with the rest of the config, these are largely adapted from Doom's ([cite:@li - ~«NAME»-h~ :: Procedure defined specifically to be added to a hook. +* ~sydnix-cli~ + +sydnix-cli is a command-line utility written in Clojure wrapping various sydnix-related scripts. + * Tasks -** Begin setting up doomless Emacs +** Emacs from scratch *** DONE Daemon CLOSED: [2025-01-03 Fri 20:00] +*** DONE Encryption + *** DONE Mutable config CLOSED: [2025-01-03 Fri 20:01] Path is currently hardcoded to =/persist/dots/users/crumb/programs/emacs=. An immutable file (created by home-manager's =programs.emacs.extraConfig=) loads =init.el= from the hardcoded path. -*** DONE Packages via Nixpkgs +*** KILL Packages via Nixpkgs CLOSED: [2025-01-03 Fri 20:40] -*** TODO =map!= macro +*** TODO Org-mode -*** TODO Module system? +**** TODO Roam + +***** TODO Dailies + +**** TODO Capture templates + +*** TODO project.el + +*** TODO Prose minor mode + +**** TODO Grammar-checking + +**** TODO Spell-checking + +*** TODO Sexp editing + +*** TODO Lookup handlers + +*** TODO Comint + +*** TODO Eshell + +*** TODO Snippets + +**** TODO File templates + +**** TODO Project templates + +*** TODO Magit + +**** TODO Forges + +*** TODO Dired/Dirvish + +*** TODO [[kbd:][SPC i]] + +*** TODO [[kbd:][SPC o]] + +*** TODO [[kbd:][SPC t]] + +*** TODO Vertico repeat + +*** Language support + +**** TODO Clojure + +**** TODO Haskell + +**** TODO Nix + +**** TODO Open repl + +**** TODO Elisp + +*** IDEA =map!= macro + +*** IDEA Module system? ** Emacs config diff --git a/users/crumb/programs/emacs.nix b/users/crumb/programs/emacs.nix index f419591..1d35a79 100644 --- a/users/crumb/programs/emacs.nix +++ b/users/crumb/programs/emacs.nix @@ -52,6 +52,7 @@ in { # Impermanence expects the path to be relative to ~. (lib.removePrefix config.home.homeDirectory straightBaseDir) ]; + home.packages = [ emacsWrapper ]; # TODO: Make sure this is using the right package for Emacs... diff --git a/users/crumb/programs/emacs/.persistent-scratch b/users/crumb/programs/emacs/.persistent-scratch new file mode 100644 index 0000000..b5fa2c8 --- /dev/null +++ b/users/crumb/programs/emacs/.persistent-scratch @@ -0,0 +1 @@ +(["*scratch*" "ahhhii" (6) lisp-interaction-mode nil nil]) \ No newline at end of file diff --git a/users/crumb/programs/emacs/init.el b/users/crumb/programs/emacs/init.el index 88f4043..311f689 100644 --- a/users/crumb/programs/emacs/init.el +++ b/users/crumb/programs/emacs/init.el @@ -17,5 +17,6 @@ (require 'syd-display-startup-time) (require 'syd-evil) (require 'syd-keybinds) +(require 'syd-scratch) (require 'syd-smartparens) (require 'syd-ui) diff --git a/users/crumb/programs/emacs/modules/syd-keybinds.el b/users/crumb/programs/emacs/modules/syd-keybinds.el index 7ec28ce..6ee7346 100644 --- a/users/crumb/programs/emacs/modules/syd-keybinds.el +++ b/users/crumb/programs/emacs/modules/syd-keybinds.el @@ -113,6 +113,7 @@ are active.") (general-def :keymaps 'syd-leader-map "." #'find-file + "x" `("Open scratch buffer" . ,#'scratch-buffer) "b" `("Buffer" . ,syd-leader-buffer-map) "w" `("Window" . ,syd-leader-window-map) "f" `("File" . ,syd-leader-file-map) diff --git a/users/crumb/programs/emacs/modules/syd-scratch.el b/users/crumb/programs/emacs/modules/syd-scratch.el new file mode 100644 index 0000000..445d3f3 --- /dev/null +++ b/users/crumb/programs/emacs/modules/syd-scratch.el @@ -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 deferred better. +(use-package persistent-scratch + :hook (on-first-buffer) + :custom (persistent-scratch-save-file + (file-name-concat syd-data-dir "scratch")) + :config + ;; The default error/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 () + "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) + + ;; 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