Commit 07dc62025e29
Changed files (4)
pkgs/scripts/bin/e
@@ -0,0 +1,2 @@
+#!/usr/bin/env bash
+emacs --dump-file=${HOME}/.config/emacs/emacs.pdmp
\ No newline at end of file
tools/emacs/dump.el
@@ -0,0 +1,18 @@
+;; -*- lexical-binding: t -*-
+(add-to-list 'load-path (expand-file-name "lisp/" user-emacs-directory))
+(require 'package)
+;; load autoload files and populate load-path’s
+(setq sbr-dumped-load-path load-path
+ sbr-dumped t)
+(package-initialize)
+;; (package-initialize) doens’t require each package, we need to load
+;; those we want manually
+(dolist (package '(use-package company recentf moody helpful undo-tree cus-edit pinentry hardhat diff
+ use-package aggressive-indent savehist minions expand-region time uniquify isearch
+ minibuffer icomplete dired delsel direnv auth-source simple epa-file message
+ vc vc-dir vc-git region-bindings-mode
+ shortbrain-light-theme shortbrain-theme))
+ (require package))
+(load-theme 'shortbrain-light t t)
+;; dump image
+(dump-emacs-portable (expand-file-name "emacs.pdmp" user-emacs-directory))
tools/emacs/init.el
@@ -2,6 +2,25 @@
;;; Commentary:
;;; init configuration file for GNU Emacs
;;; Code:
+
+(defvar sbr-dumped nil
+ "non-nil when a dump file is loaded (because dump.el sets this variable).")
+
+(defmacro sbr-if-dump (then &rest else)
+ "Evaluate IF if running with a dump file, else evaluate ELSE."
+ (declare (indent 1))
+ `(if sbr-dumped
+ ,then
+ ,@else))
+
+(sbr-if-dump
+ (progn
+ (setq load-path sbr-dumped-load-path)
+ (global-font-lock-mode)
+ (transient-mark-mode))
+ ;; add load-path’s and load autoload files
+ (package-initialize))
+
;; +CheckVer
(let ((minver 26))
(unless (>= emacs-major-version minver)
.gitignore
@@ -3,4 +3,6 @@ result
hostname
*.retry
assets/machines.nix
-docs/sitemap.org
\ No newline at end of file
+docs/sitemap.org
+tools/emacs/emacs.pdmp
+tools/emacs/recentf
\ No newline at end of file