chore(emacs): clean up unused configs bf273232
Steve · 2026-10-13 07:08 8 file(s) · +6 −423
emacs/early-init.el +0 −1
1 1
;;; early-init.el -*- lexical-binding: t; -*-
2 2
3 -
;; Faster startup: defer GC, restore after init
4 3
(setq gc-cons-threshold most-positive-fixnum
5 4
      gc-cons-percentage 1.0)
6 5
(add-hook 'emacs-startup-hook
emacs/init.el +2 −5
1 1
;;; init.el -*- lexical-binding: t; -*-
2 2
3 -
(defvar my/cache-dir (expand-file-name "emacs/" "~/.cache/")
4 -
  "Where state, backups and custom settings live (outside the dotfiles repo).")
3 +
(defvar my/cache-dir (expand-file-name "emacs/" "~/.cache/"))
5 4
(make-directory my/cache-dir t)
6 5
7 6
(add-to-list 'load-path (expand-file-name "lisp" user-emacs-directory))
9 8
(setq custom-file (expand-file-name "custom.el" my/cache-dir))
10 9
(load custom-file 'noerror 'nomessage)
11 10
12 -
;;; Packages
13 11
(require 'package)
14 12
(setq package-archives '(("gnu"    . "https://elpa.gnu.org/packages/")
15 13
                         ("nongnu" . "https://elpa.nongnu.org/nongnu/")
16 14
                         ("melpa"  . "https://melpa.org/packages/")))
17 -
;; No refresh here: use-package :ensure refreshes on its own when a package is missing.
15 +
18 16
(setq use-package-always-ensure t)
19 17
20 18
(require 'init-defaults)
22 20
(require 'init-ui)
23 21
(require 'init-erc)
24 22
(require 'init-jabber)
25 -
(require 'init-mail)
26 23
(require 'init-lang)
27 24
(require 'init-tools)
28 25
(require 'init-term)
emacs/lisp/init-defaults.el +2 −2
43 43
      tooltip-delay 0.3
44 44
      tooltip-short-delay 0.08)
45 45
46 -
;; Built-in minor modes worth having
46 +
;; Built-in minor modes
47 47
(delete-selection-mode 1)
48 48
(electric-pair-mode 1)
49 49
(show-paren-mode 1)
67 67
      read-buffer-completion-ignore-case t)
68 68
(fido-vertical-mode 1)
69 69
70 -
;; Line numbers in code/text, relative like Doom config
70 +
;; Line numbers in code/text
71 71
(setq display-line-numbers-type 'relative)
72 72
(add-hook 'prog-mode-hook #'display-line-numbers-mode)
73 73
(add-hook 'text-mode-hook #'display-line-numbers-mode)
emacs/lisp/init-jabber.el +2 −4
4 4
;; make and pkg-config on PATH (4.x dropped mbedtls/aes.h).
5 5
(use-package jabber
6 6
  :vc (:url "https://git.thanosapollo.org/emacs-jabber"
7 -
       :lisp-dir "lisp"
8 -
       :shell-command "MBED_STATIC=1 make module")
7 +
            :lisp-dir "lisp"
8 +
            :shell-command "MBED_STATIC=1 make module")
9 9
  :defer t
10 10
  :init
11 -
  ;; `jabber-roster' autoloads from jabber-roster-menu, which never loads
12 -
  ;; jabber.el, so :config (account list) would never run. Pull it in.
13 11
  (with-eval-after-load 'jabber-roster-menu (require 'jabber))
14 12
  :config
15 13
  (setq jabber-account-list
emacs/lisp/init-mail.el (deleted) +0 −82
1 -
;;; init-mail.el -*- lexical-binding: t; -*-
2 -
3 -
;; mu4e ships with Guix's `mu' package (on EMACSLOADPATH via the profile), not ELPA.
4 -
(use-package mu4e
5 -
  :ensure nil
6 -
  :commands (mu4e mu4e-compose-new)
7 -
  :config
8 -
  (setq user-mail-address "contact@stevedylan.dev"
9 -
10 -
        ;; Fetching
11 -
        mu4e-get-mail-command "mbsync -a"
12 -
        mu4e-update-interval 300
13 -
        mu4e-change-filenames-when-moving t   ; required with mbsync
14 -
15 -
        ;; Folders (adjust to match `mbsync -l local`)
16 -
        mu4e-sent-folder   "/local/Sent"
17 -
        mu4e-drafts-folder "/local/Drafts"
18 -
        mu4e-trash-folder  "/local/Trash"
19 -
        mu4e-refile-folder "/local/Archive"
20 -
21 -
        ;; Sending via msmtp
22 -
        sendmail-program (executable-find "msmtp")
23 -
        send-mail-function #'sendmail-send-it
24 -
        message-send-mail-function #'message-send-mail-with-sendmail
25 -
        message-sendmail-envelope-from 'header
26 -
        message-kill-buffer-on-exit t
27 -
28 -
        ;; GPG
29 -
        mml-secure-openpgp-sign-with-sender t   ; pick key by From address
30 -
        mml-secure-openpgp-encrypt-to-self t    ; keep Sent copies readable
31 -
        mm-verify-option 'always                ; verify signatures on view
32 -
        mm-decrypt-option 'always               ; auto-decrypt on view
33 -
34 -
        mu4e-maildir-shortcuts
35 -
        '((:maildir "/local/Inbox"   :key ?i)
36 -
          (:maildir "/local/Sent"    :key ?s)
37 -
          (:maildir "/local/Drafts"  :key ?d)
38 -
          (:maildir "/local/Archive" :key ?a)
39 -
          (:maildir "/local/Trash"   :key ?t))))
40 -
41 -
;; Proton Bridge rewrites PGP/MIME into multipart/mixed with the armored
42 -
;; block as an attachment, so Emacs won't auto-decrypt. Pull the block out
43 -
;; of the raw message and decrypt it by hand.
44 -
(require 'cl-lib)                       ; cl-labels, expanded at load time
45 -
46 -
(defun my/mail--pgp-blocks (path)
47 -
  "Return armored PGP message strings found in the parts of PATH."
48 -
  (require 'mm-decode)
49 -
  (with-temp-buffer
50 -
    (insert-file-contents-literally path)
51 -
    (let (blocks)
52 -
      (cl-labels ((walk (h)
53 -
                    (cond ((and (consp h) (stringp (car h)))
54 -
                           (mapc #'walk (cdr h)))
55 -
                          ((and (consp h) (bufferp (car h)))
56 -
                           (let ((s (mm-get-part h)))
57 -
                             (when (string-match "-----BEGIN PGP MESSAGE-----" s)
58 -
                               (push (substring s (match-beginning 0)) blocks)))))))
59 -
        (walk (mm-dissect-buffer t t)))
60 -
      (nreverse blocks))))
61 -
62 -
(defun my/mail-decrypt-bridge ()
63 -
  "Decrypt the PGP block of the mu4e message at point into a buffer."
64 -
  (interactive)
65 -
  (require 'epg)
66 -
  (let* ((msg (mu4e-message-at-point))
67 -
         (blocks (or (my/mail--pgp-blocks (mu4e-message-field msg :path))
68 -
                     (user-error "No PGP block in message")))
69 -
         (ctx (epg-make-context 'OpenPGP))
70 -
         (buf (get-buffer-create "*mail-decrypted*")))
71 -
    (with-current-buffer buf
72 -
      (let ((inhibit-read-only t))
73 -
        (erase-buffer)
74 -
        (dolist (b blocks)
75 -
          (insert (decode-coding-string
76 -
                   (epg-decrypt-string ctx b) 'utf-8)
77 -
                  "\n"))
78 -
        (goto-char (point-min))
79 -
        (special-mode)))
80 -
    (pop-to-buffer buf)))
81 -
82 -
(provide 'init-mail)
emacs/lisp/init-term.el +0 −1
12 12
  :hook (ghostel-mode . evil-ghostel-mode))
13 13
14 14
;; Terminal perf tweaks, adapted from James Cherti (MIT):
15 -
;; https://www.jamescherti.com/emacs-terminal-performance-vterm-eat-ansi-term-ghostel/
16 15
(defun my/speed-up-terminal-buffer ()
17 16
  "Reduce unnecessary Emacs features in terminal buffers."
18 17
  (let ((ghostel-buffer (derived-mode-p 'ghostel-mode)))
emacs/lisp/init-tools.el +0 −28
54 54
      (error (message "elfeed: feed refresh failed (%s), keeping existing list"
55 55
                      (error-message-string err)))))
56 56
57 -
  ;; Fresh list before every update (`G' / `elfeed-update')
58 57
  (advice-add 'elfeed-update :before #'my/elfeed-refresh-feeds)
59 58
60 59
  (defun my/elfeed-show-font ()
62 61
    (face-remap-add-relative 'default :family "BerkeleyMono Nerd Font Mono" :height 140))
63 62
  (add-hook 'elfeed-show-mode-hook #'my/elfeed-show-font))
64 63
65 -
;; ob-go isn't bundled with org; required in org's :config below
66 64
(use-package ob-go
67 65
  :defer t)
68 66
89 87
          ("b" "Bookmark" entry (file "bookmarks.org")
90 88
           "* [[%^{URL}][%^{Title}]] %^g\n:PROPERTIES:\n:ADDED: %U\n:END:\n%?"
91 89
           :empty-lines 1))))
92 -
93 -
;; HTML export: darkmatter CSS from org.css, inlined so exports are self-contained
94 -
(use-package ox-html
95 -
  :ensure nil
96 -
  :after org
97 -
  :config
98 -
  (defun my/org-html-head ()
99 -
    "Return `org-html-head' contents with org.css inlined."
100 -
    (let ((css (expand-file-name "org.css" user-emacs-directory)))
101 -
      (concat "<meta name=\"theme-color\" content=\"#121113\" />\n"
102 -
              "<style>\n"
103 -
              (with-temp-buffer
104 -
                (insert-file-contents css)
105 -
                (buffer-string))
106 -
              "</style>")))
107 -
  (setq org-html-head-include-default-style nil
108 -
        org-html-head-include-scripts nil
109 -
        org-html-validation-link nil
110 -
        org-html-postamble nil
111 -
        org-html-htmlize-output-type 'css
112 -
        org-html-head (my/org-html-head))
113 -
  ;; Re-read org.css on each export so edits apply without restarting
114 -
  (advice-add 'org-html-export-as-html :before
115 -
              (lambda (&rest _) (setq org-html-head (my/org-html-head))))
116 -
  (advice-add 'org-html-export-to-html :before
117 -
              (lambda (&rest _) (setq org-html-head (my/org-html-head)))))
118 90
119 91
(use-package dired
120 92
  :ensure nil
emacs/org.css (deleted) +0 −300
1 -
/* Darkmatter theme for org HTML export (inlined by init-tools.el) */
2 -
3 -
@font-face {
4 -
  font-family: "Commit Mono";
5 -
  src: local("Commit Mono"), local("CommitMono-400-Regular");
6 -
  font-weight: 400;
7 -
  font-style: normal;
8 -
}
9 -
10 -
@font-face {
11 -
  font-family: "Commit Mono";
12 -
  src: local("Commit Mono Bold"), local("CommitMono-700-Regular");
13 -
  font-weight: 700;
14 -
  font-style: normal;
15 -
}
16 -
17 -
* {
18 -
  padding: 0;
19 -
  margin: 0;
20 -
  box-sizing: border-box;
21 -
  font-family: "Commit Mono", monospace, sans-serif;
22 -
  scrollbar-width: none;
23 -
  -ms-overflow-style: none;
24 -
}
25 -
26 -
html {
27 -
  background: #121113;
28 -
  color: #ffffff;
29 -
  font-size: 14px;
30 -
  line-height: 1.6;
31 -
}
32 -
33 -
html::-webkit-scrollbar {
34 -
  display: none;
35 -
}
36 -
37 -
body {
38 -
  max-width: 700px;
39 -
  margin: auto;
40 -
  padding: 0 1rem 4rem;
41 -
}
42 -
43 -
@media (max-width: 480px) {
44 -
  body {
45 -
    padding: 1rem;
46 -
  }
47 -
}
48 -
49 -
a {
50 -
  color: #ffffff;
51 -
  text-decoration: none;
52 -
}
53 -
54 -
a:hover {
55 -
  opacity: 0.7;
56 -
}
57 -
58 -
#content {
59 -
  display: flex;
60 -
  flex-direction: column;
61 -
  gap: 1rem;
62 -
}
63 -
64 -
/* Title */
65 -
.title {
66 -
  margin-top: 2rem;
67 -
  padding-bottom: 1rem;
68 -
  border-bottom: 1px solid #333;
69 -
  font-size: 28px;
70 -
  font-weight: 700;
71 -
  text-transform: uppercase;
72 -
  text-align: left;
73 -
}
74 -
75 -
.subtitle {
76 -
  font-size: 12px;
77 -
  opacity: 0.5;
78 -
}
79 -
80 -
/* Headings */
81 -
h1, h2, h3, h4, h5, h6 {
82 -
  font-weight: 700;
83 -
}
84 -
85 -
h1 { font-size: 18px; }
86 -
h2 { font-size: 16px; margin-top: 1rem; }
87 -
h3 { font-size: 15px; }
88 -
h4, h5, h6 { font-size: 14px; }
89 -
90 -
.section-number-2,
91 -
.section-number-3,
92 -
.section-number-4 {
93 -
  opacity: 0.5;
94 -
}
95 -
96 -
.outline-2, .outline-3, .outline-4, .outline-text-2, .outline-text-3, .outline-text-4 {
97 -
  display: flex;
98 -
  flex-direction: column;
99 -
  gap: 0.75rem;
100 -
}
101 -
102 -
/* Text */
103 -
p, li {
104 -
  font-size: 14px;
105 -
}
106 -
107 -
ul, ol {
108 -
  padding-left: 1.5rem;
109 -
}
110 -
111 -
li + li {
112 -
  margin-top: 0.25rem;
113 -
}
114 -
115 -
b, strong { font-weight: 700; }
116 -
i, em { font-style: italic; }
117 -
del { opacity: 0.5; }
118 -
119 -
.timestamp, .timestamp-kwd, .timestamp-wrapper {
120 -
  font-size: 12px;
121 -
  opacity: 0.5;
122 -
}
123 -
124 -
.tag {
125 -
  font-size: 12px;
126 -
  opacity: 0.5;
127 -
  float: right;
128 -
}
129 -
130 -
.tag span {
131 -
  background: none;
132 -
  font-weight: 400;
133 -
}
134 -
135 -
/* TODO keywords: no color, weight/opacity only */
136 -
.todo, .done {
137 -
  font-size: 12px;
138 -
  font-weight: 700;
139 -
  text-transform: uppercase;
140 -
}
141 -
142 -
.done {
143 -
  opacity: 0.5;
144 -
}
145 -
146 -
/* Code */
147 -
code {
148 -
  background: #1e1c1f;
149 -
  padding: 0.1rem 0.3rem;
150 -
  font-size: 13px;
151 -
}
152 -
153 -
pre {
154 -
  background: #1e1c1f;
155 -
  color: #ffffff;
156 -
  border: none;
157 -
  border-radius: 0;
158 -
  box-shadow: none;
159 -
  padding: 0.75rem 1rem;
160 -
  font-size: 13px;
161 -
  overflow-x: auto;
162 -
  white-space: pre;
163 -
}
164 -
165 -
pre code {
166 -
  background: none;
167 -
  padding: 0;
168 -
}
169 -
170 -
pre.src:before {
171 -
  display: none;
172 -
}
173 -
174 -
/* htmlize classes (needs org-html-htmlize-output-type 'css) */
175 -
pre span[class^="org-"] {
176 -
  color: #ffffff;
177 -
  background: none;
178 -
  font-weight: 400;
179 -
  font-style: normal;
180 -
}
181 -
182 -
pre span.org-comment,
183 -
pre span.org-comment-delimiter,
184 -
pre span.org-doc {
185 -
  opacity: 0.5;
186 -
  font-style: italic;
187 -
}
188 -
189 -
pre span.org-keyword,
190 -
pre span.org-function-name,
191 -
pre span.org-type {
192 -
  font-weight: 700;
193 -
}
194 -
195 -
pre span.org-string {
196 -
  opacity: 0.7;
197 -
}
198 -
199 -
/* Blockquote */
200 -
blockquote {
201 -
  border-left: 2px solid #555;
202 -
  padding-left: 0.75rem;
203 -
  opacity: 0.7;
204 -
}
205 -
206 -
blockquote p {
207 -
  margin: 0;
208 -
}
209 -
210 -
/* Tables */
211 -
table {
212 -
  border-collapse: collapse;
213 -
  width: 100%;
214 -
  border: none;
215 -
}
216 -
217 -
table caption {
218 -
  font-size: 12px;
219 -
  opacity: 0.5;
220 -
  text-align: left;
221 -
  margin-bottom: 0.25rem;
222 -
}
223 -
224 -
th, td {
225 -
  padding: 0.4rem 0.75rem 0.4rem 0;
226 -
  border: none;
227 -
  border-bottom: 1px solid #333;
228 -
  text-align: left;
229 -
}
230 -
231 -
th {
232 -
  opacity: 0.5;
233 -
  font-weight: 400;
234 -
  font-size: 12px;
235 -
  text-transform: uppercase;
236 -
}
237 -
238 -
/* Misc */
239 -
hr {
240 -
  border: none;
241 -
  border-top: 1px solid #333;
242 -
}
243 -
244 -
img {
245 -
  max-width: 100%;
246 -
  border-radius: 0;
247 -
}
248 -
249 -
figure {
250 -
  display: flex;
251 -
  flex-direction: column;
252 -
  gap: 0.25rem;
253 -
}
254 -
255 -
figcaption, .figure-number {
256 -
  font-size: 12px;
257 -
  opacity: 0.5;
258 -
}
259 -
260 -
.footnotes, #footnotes {
261 -
  border-top: 1px solid #333;
262 -
  padding-top: 0.75rem;
263 -
  font-size: 12px;
264 -
}
265 -
266 -
.footdef {
267 -
  opacity: 0.7;
268 -
}
269 -
270 -
sup a, .footref {
271 -
  font-size: 12px;
272 -
}
273 -
274 -
/* TOC */
275 -
#table-of-contents {
276 -
  border-bottom: 1px solid #333;
277 -
  padding-bottom: 1rem;
278 -
}
279 -
280 -
#table-of-contents h2 {
281 -
  font-size: 12px;
282 -
  text-transform: uppercase;
283 -
  opacity: 0.5;
284 -
  margin-top: 0;
285 -
}
286 -
287 -
#text-table-of-contents ul {
288 -
  list-style: none;
289 -
  padding-left: 1rem;
290 -
}
291 -
292 -
#text-table-of-contents > ul {
293 -
  padding-left: 0;
294 -
}
295 -
296 -
/* Postamble */
297 -
#postamble, .postamble {
298 -
  font-size: 12px;
299 -
  opacity: 0.5;
300 -
}