Commit | Line | Data |
---|---|---|
33b1a7ea | 1 | ;;; init.el --- bandali's emacs configuration -*- lexical-binding: t -*- |
41d290a2 | 2 | |
33b1a7ea | 3 | ;; Copyright (C) 2018-2019 Amin Bandali <bandali@gnu.org> |
41d290a2 AB |
4 | |
5 | ;; This program is free software: you can redistribute it and/or modify | |
6 | ;; it under the terms of the GNU General Public License as published by | |
7 | ;; the Free Software Foundation, either version 3 of the License, or | |
8 | ;; (at your option) any later version. | |
9 | ||
10 | ;; This program is distributed in the hope that it will be useful, | |
11 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | ;; GNU General Public License for more details. | |
14 | ||
15 | ;; You should have received a copy of the GNU General Public License | |
16 | ;; along with this program. If not, see <https://www.gnu.org/licenses/>. | |
17 | ||
18 | ;;; Commentary: | |
19 | ||
33b1a7ea | 20 | ;; GNU Emacs configuration of Amin Bandali, computer scientist, |
92ad9675 | 21 | ;; Free Software activist, and GNU maintainer & webmaster. Packages |
f7910e3d | 22 | ;; are installed through using Borg for a fully reproducible setup. |
b57457b2 AB |
23 | |
24 | ;; Over the years, I've taken inspiration from configurations of many | |
25 | ;; great people. Some that I can remember off the top of my head are: | |
26 | ;; | |
27 | ;; - https://github.com/dieggsy/dotfiles | |
28 | ;; - https://github.com/dakra/dmacs | |
29 | ;; - http://pages.sachachua.com/.emacs.d/Sacha.html | |
30 | ;; - https://github.com/dakrone/eos | |
31 | ;; - http://doc.rix.si/cce/cce.html | |
32 | ;; - https://github.com/jwiegley/dot-emacs | |
33 | ;; - https://github.com/wasamasa/dotemacs | |
34 | ;; - https://github.com/hlissner/doom-emacs | |
41d290a2 | 35 | |
49e9503b AB |
36 | ;;; Code: |
37 | ||
b57457b2 AB |
38 | ;;; Emacs initialization |
39 | ||
dca50cf5 | 40 | (defvar b/before-user-init-time (current-time) |
41d290a2 | 41 | "Value of `current-time' when Emacs begins loading `user-init-file'.") |
83364e5b AB |
42 | (defvar b/emacs-initialized nil |
43 | "Whether Emacs has been initialized.") | |
8b1a2f32 AB |
44 | (defvar b/exwm-p (string= (system-name) "chaman") |
45 | "Whether or not we will be using `exwm'.") | |
83364e5b AB |
46 | |
47 | (when (not (bound-and-true-p b/emacs-initialized)) | |
48 | (message "Loading Emacs...done (%.3fs)" | |
49 | (float-time (time-subtract b/before-user-init-time | |
50 | before-init-time)))) | |
41d290a2 | 51 | |
b57457b2 AB |
52 | ;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage' |
53 | ;; during startup to reduce garbage collection frequency. clearing | |
54 | ;; `file-name-handler-alist' seems to help reduce startup time too. | |
dca50cf5 AB |
55 | (defvar b/gc-cons-threshold gc-cons-threshold) |
56 | (defvar b/gc-cons-percentage gc-cons-percentage) | |
57 | (defvar b/file-name-handler-alist file-name-handler-alist) | |
bc58e70a | 58 | (setq gc-cons-threshold (* 30 1024 1024) ; 30 MiB |
41d290a2 AB |
59 | gc-cons-percentage 0.6 |
60 | file-name-handler-alist nil | |
61 | ;; sidesteps a bug when profiling with esup | |
62 | esup-child-profile-require-level 0) | |
63 | ||
b57457b2 | 64 | ;; set them back to their defaults once we're done initializing |
dca50cf5 | 65 | (defun b/post-init () |
83364e5b AB |
66 | "My post-initialize function, run after loading `user-init-file'." |
67 | (setq b/emacs-initialized t | |
68 | gc-cons-threshold b/gc-cons-threshold | |
69 | gc-cons-percentage b/gc-cons-percentage | |
e8a3b8f7 | 70 | file-name-handler-alist b/file-name-handler-alist) |
8b1a2f32 AB |
71 | (when b/exwm-p |
72 | (with-eval-after-load 'exwm-workspace | |
73 | (setq-default | |
74 | mode-line-format | |
75 | (append | |
76 | mode-line-format | |
77 | '((:eval | |
78 | (format | |
79 | "[%s]" (number-to-string | |
80 | exwm-workspace-current-index))))))))) | |
dca50cf5 | 81 | (add-hook 'after-init-hook #'b/post-init) |
41d290a2 | 82 | |
b57457b2 | 83 | ;; increase number of lines kept in *Messages* log |
41d290a2 AB |
84 | (setq message-log-max 20000) |
85 | ||
b57457b2 AB |
86 | ;; optionally, uncomment to supress some byte-compiler warnings |
87 | ;; (see C-h v byte-compile-warnings RET for more info) | |
41d290a2 AB |
88 | ;; (setq byte-compile-warnings |
89 | ;; '(not free-vars unresolved noruntime lexical make-local)) | |
90 | ||
b57457b2 AB |
91 | \f |
92 | ;;; whoami | |
93 | ||
41d290a2 | 94 | (setq user-full-name "Amin Bandali" |
33b1a7ea | 95 | user-mail-address "bandali@gnu.org") |
41d290a2 | 96 | |
b57457b2 AB |
97 | \f |
98 | ;;; comment macro | |
99 | ||
100 | ;; useful for commenting out multiple sexps at a time | |
101 | (defmacro comment (&rest _) | |
102 | "Comment out one or more s-expressions." | |
103 | (declare (indent defun)) | |
104 | nil) | |
105 | ||
106 | \f | |
33273849 AB |
107 | ;;; Package management |
108 | ||
032726b6 AB |
109 | (progn ; `borg' |
110 | (add-to-list 'load-path | |
111 | (expand-file-name "lib/borg" user-emacs-directory)) | |
112 | (require 'borg) | |
113 | (borg-initialize) | |
114 | (setq borg-rewrite-urls-alist | |
115 | '(("git@github.com:" . "https://github.com/") | |
116 | ("git@gitlab.com:" . "https://gitlab.com/")))) | |
33273849 AB |
117 | |
118 | ;; use-package | |
41d290a2 AB |
119 | (if nil ; set to t when need to debug init |
120 | (progn | |
121 | (setq use-package-verbose t | |
122 | use-package-expand-minimally nil | |
123 | use-package-compute-statistics t | |
124 | debug-on-error t) | |
125 | (require 'use-package)) | |
126 | (setq use-package-verbose nil | |
127 | use-package-expand-minimally t)) | |
128 | ||
129 | (setq use-package-always-defer t) | |
130 | (require 'bind-key) | |
131 | ||
b57457b2 AB |
132 | \f |
133 | ;;; Initial setup | |
134 | ||
135 | ;; keep ~/.emacs.d clean | |
1060413b AB |
136 | (use-package no-littering |
137 | :demand | |
138 | :config | |
139 | (defalias 'b/etc 'no-littering-expand-etc-file-name) | |
140 | (defalias 'b/var 'no-littering-expand-var-file-name)) | |
41d290a2 | 141 | |
032726b6 AB |
142 | (use-package auto-compile |
143 | :demand | |
144 | :config | |
145 | (auto-compile-on-load-mode) | |
146 | (auto-compile-on-save-mode) | |
147 | (setq auto-compile-display-buffer nil) | |
148 | (setq auto-compile-mode-line-counter t) | |
149 | (setq auto-compile-source-recreate-deletes-dest t) | |
150 | (setq auto-compile-toggle-deletes-nonlib-dest t) | |
151 | (setq auto-compile-update-autoloads t)) | |
152 | ||
b57457b2 | 153 | ;; separate custom file (don't want it mixing with init.el) |
47904cb7 | 154 | (use-package custom |
60ff805e | 155 | :no-require |
41d290a2 | 156 | :config |
dca50cf5 | 157 | (setq custom-file (b/etc "custom.el")) |
41d290a2 AB |
158 | (when (file-exists-p custom-file) |
159 | (load custom-file)) | |
b57457b2 | 160 | ;; while at it, treat themes as safe |
60ff805e AB |
161 | (setf custom-safe-themes t) |
162 | ;; only one custom theme at a time | |
163 | (comment | |
164 | (defadvice load-theme (before clear-previous-themes activate) | |
165 | "Clear existing theme settings instead of layering them" | |
166 | (mapc #'disable-theme custom-enabled-themes)))) | |
41d290a2 | 167 | |
b57457b2 | 168 | ;; load the secrets file if it exists, otherwise show a warning |
dca50cf5 AB |
169 | (comment |
170 | (with-demoted-errors | |
171 | (load (b/etc "secrets")))) | |
41d290a2 | 172 | |
b57457b2 AB |
173 | ;; start up emacs server. see |
174 | ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server | |
47904cb7 | 175 | (use-package server |
f7910e3d | 176 | :defer 0.5 |
41d290a2 AB |
177 | :config (or (server-running-p) (server-mode))) |
178 | ||
60ff805e AB |
179 | \f |
180 | ;;; Useful utilities | |
181 | ||
60ff805e AB |
182 | (defmacro b/setq-every (value &rest vars) |
183 | "Set all the variables from VARS to value VALUE." | |
184 | (declare (indent defun) (debug t)) | |
185 | `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars))) | |
186 | ||
187 | (defun b/start-process (program &rest args) | |
188 | "Same as `start-process', but doesn't bother about name and buffer." | |
189 | (let ((process-name (concat program "_process")) | |
190 | (buffer-name (generate-new-buffer-name | |
191 | (concat program "_output")))) | |
192 | (apply #'start-process | |
193 | process-name buffer-name program args))) | |
194 | ||
195 | (defun b/dired-start-process (program &optional args) | |
196 | "Open current file with a PROGRAM." | |
197 | ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can | |
198 | ;; be nil, so remove it). | |
199 | (apply #'b/start-process | |
200 | program | |
201 | (remove nil (list args (dired-get-file-for-visit))))) | |
202 | ||
203 | (defun b/add-elisp-section () | |
204 | (interactive) | |
205 | (insert "\n") | |
97141042 | 206 | (forward-line -1) |
60ff805e AB |
207 | (insert "\n\f\n;;; ")) |
208 | ||
a1e77a3d AB |
209 | ;; (defvar b/fill-column 47 |
210 | ;; "My custom `fill-column'.") | |
3214b7ca AB |
211 | |
212 | (defconst b/asterism "* * *") | |
213 | ||
bc2f85e1 | 214 | (defun b/insert-asterism () |
3214b7ca | 215 | "Insert a centred asterism." |
bc2f85e1 | 216 | (interactive) |
3214b7ca AB |
217 | (insert |
218 | (concat | |
219 | "\n\n" | |
a1e77a3d | 220 | (make-string (floor (/ (- fill-column (length b/asterism)) 2)) |
3214b7ca AB |
221 | ?\s) |
222 | b/asterism | |
223 | "\n\n"))) | |
bc2f85e1 | 224 | |
60ff805e AB |
225 | (defun b/no-mouse-autoselect-window () |
226 | "Conveniently disable `focus-follows-mouse'. | |
227 | For disabling the behaviour for certain buffers and/or modes." | |
228 | (make-local-variable 'mouse-autoselect-window) | |
229 | (setq mouse-autoselect-window nil)) | |
230 | ||
a5cc22f4 AB |
231 | (defun b/kill-current-buffer () |
232 | "Kill the current buffer." | |
233 | ;; also see https://redd.it/64xb3q | |
234 | (interactive) | |
235 | (kill-buffer (current-buffer))) | |
236 | ||
60ff805e AB |
237 | \f |
238 | ;;; Defaults | |
239 | ||
240 | ;;;; C-level customizations | |
241 | ||
242 | (setq | |
243 | ;; minibuffer | |
244 | enable-recursive-minibuffers t | |
245 | resize-mini-windows t | |
246 | ;; more useful frame titles | |
247 | frame-title-format '("" invocation-name " - " | |
248 | (:eval | |
249 | (if (buffer-file-name) | |
250 | (abbreviate-file-name (buffer-file-name)) | |
251 | "%b"))) | |
252 | ;; i don't feel like jumping out of my chair every now and again; so | |
253 | ;; don't BEEP! at me, emacs | |
254 | ring-bell-function 'ignore | |
255 | ;; better scrolling | |
256 | ;; scroll-margin 1 | |
257 | ;; scroll-conservatively 10000 | |
258 | scroll-step 1 | |
259 | scroll-conservatively 10 | |
260 | scroll-preserve-screen-position 1 | |
261 | ;; focus follows mouse | |
39cc9c96 | 262 | mouse-autoselect-window t) |
60ff805e AB |
263 | |
264 | (setq-default | |
265 | ;; always use space for indentation | |
266 | indent-tabs-mode nil | |
267 | tab-width 4 | |
268 | ;; cursor shape | |
567440fa | 269 | cursor-type t) |
60ff805e | 270 | |
b57457b2 AB |
271 | ;; unicode support |
272 | (comment | |
273 | (dolist (ft (fontset-list)) | |
274 | (set-fontset-font | |
275 | ft | |
276 | 'unicode | |
277 | (font-spec :name "Source Code Pro" :size 14)) | |
278 | (set-fontset-font | |
279 | ft | |
280 | 'unicode | |
281 | (font-spec :name "DejaVu Sans Mono") | |
282 | nil | |
283 | 'append) | |
284 | ;; (set-fontset-font | |
285 | ;; ft | |
286 | ;; 'unicode | |
287 | ;; (font-spec | |
288 | ;; :name "Symbola monospacified for DejaVu Sans Mono") | |
289 | ;; nil | |
290 | ;; 'append) | |
291 | ;; (set-fontset-font | |
292 | ;; ft | |
293 | ;; #x2115 ; ℕ | |
294 | ;; (font-spec :name "DejaVu Sans Mono") | |
295 | ;; nil | |
296 | ;; 'append) | |
297 | (set-fontset-font | |
298 | ft | |
299 | (cons ?Α ?ω) | |
300 | (font-spec :name "DejaVu Sans Mono" :size 14) | |
301 | nil | |
302 | 'prepend))) | |
303 | ||
60ff805e | 304 | ;;;; Elisp-level customizations |
41d290a2 | 305 | |
47904cb7 | 306 | (use-package startup |
60ff805e AB |
307 | :no-require |
308 | :demand | |
41d290a2 | 309 | :config |
60ff805e AB |
310 | ;; don't need to see the startup echo area message |
311 | (advice-add #'display-startup-echo-area-message :override #'ignore) | |
312 | :custom | |
313 | ;; i want *scratch* as my startup buffer | |
314 | (initial-buffer-choice t) | |
315 | ;; i don't need the default hint | |
316 | (initial-scratch-message nil) | |
317 | ;; use customizable text-mode as major mode for *scratch* | |
2568a634 | 318 | ;; (initial-major-mode 'text-mode) |
60ff805e AB |
319 | ;; inhibit buffer list when more than 2 files are loaded |
320 | (inhibit-startup-buffer-menu t) | |
321 | ;; don't need to see the startup screen or echo area message | |
322 | (inhibit-startup-screen t) | |
323 | (inhibit-startup-echo-area-message user-login-name)) | |
41d290a2 | 324 | |
47904cb7 | 325 | (use-package files |
60ff805e AB |
326 | :no-require |
327 | :demand | |
9fc30d4c | 328 | :custom |
60ff805e AB |
329 | ;; backups (C-h v make-backup-files RET) |
330 | (backup-by-copying t) | |
331 | (version-control t) | |
332 | (delete-old-versions t) | |
41d290a2 | 333 | |
60ff805e AB |
334 | ;; auto-save |
335 | (auto-save-file-name-transforms | |
336 | `((".*" ,(b/var "auto-save/") t))) | |
41d290a2 | 337 | |
60ff805e AB |
338 | ;; insert newline at the end of files |
339 | (require-final-newline t) | |
b57457b2 | 340 | |
60ff805e AB |
341 | ;; open read-only file buffers in view-mode |
342 | ;; (enables niceties like `q' for quit) | |
343 | (view-read-only t)) | |
41d290a2 | 344 | |
60ff805e AB |
345 | ;; disable disabled commands |
346 | (setq disabled-command-function nil) | |
41d290a2 | 347 | |
60ff805e AB |
348 | ;; lazy-person-friendly yes/no prompts |
349 | (defalias 'yes-or-no-p #'y-or-n-p) | |
b57457b2 | 350 | |
60ff805e | 351 | ;; enable automatic reloading of changed buffers and files |
47904cb7 | 352 | (use-package autorevert |
60ff805e AB |
353 | :demand |
354 | :config | |
355 | (global-auto-revert-mode 1) | |
356 | :custom | |
357 | (auto-revert-verbose nil) | |
358 | (global-auto-revert-non-file-buffers nil)) | |
b57457b2 AB |
359 | |
360 | ;; time and battery in mode-line | |
47904cb7 | 361 | (use-package time |
e4902e0b | 362 | :demand |
64938292 AB |
363 | :config |
364 | (display-time-mode) | |
365 | :custom | |
366 | (display-time-default-load-average nil) | |
f7910e3d | 367 | (display-time-format " %a %b %-e %-l:%M%P") |
ad61316b AB |
368 | (display-time-mail-icon '(image :type xpm :file "gnus/gnus-pointer.xpm" :ascent center)) |
369 | (display-time-use-mail-icon t)) | |
64938292 | 370 | |
47904cb7 | 371 | (use-package battery |
e4902e0b | 372 | :demand |
64938292 AB |
373 | :config |
374 | (display-battery-mode) | |
375 | :custom | |
f7910e3d | 376 | (battery-mode-line-format "%p%% %t")) |
b57457b2 | 377 | |
47904cb7 | 378 | (use-package fringe |
60ff805e AB |
379 | :demand |
380 | :config | |
381 | ;; smaller fringe | |
382 | ;; (fringe-mode '(3 . 1)) | |
383 | (fringe-mode nil)) | |
41d290a2 | 384 | |
47904cb7 | 385 | (use-package winner |
60ff805e AB |
386 | :demand |
387 | :config | |
388 | ;; enable winner-mode (C-h f winner-mode RET) | |
389 | (winner-mode 1)) | |
41d290a2 | 390 | |
47904cb7 | 391 | (use-package compile |
60ff805e AB |
392 | :config |
393 | ;; don't display *compilation* buffer on success. based on | |
394 | ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf' | |
395 | ;; instead of the now obsolete `flet'. | |
dca50cf5 | 396 | (defun b/compilation-finish-function (buffer outstr) |
41d290a2 AB |
397 | (unless (string-match "finished" outstr) |
398 | (switch-to-buffer-other-window buffer)) | |
399 | t) | |
400 | ||
dca50cf5 | 401 | (setq compilation-finish-functions #'b/compilation-finish-function) |
41d290a2 AB |
402 | |
403 | (require 'cl-macs) | |
404 | ||
405 | (defadvice compilation-start | |
406 | (around inhibit-display | |
407 | (command &optional mode name-function highlight-regexp)) | |
408 | (if (not (string-match "^\\(find\\|grep\\)" command)) | |
409 | (cl-letf (((symbol-function 'display-buffer) #'ignore)) | |
410 | (save-window-excursion ad-do-it)) | |
411 | ad-do-it)) | |
412 | (ad-activate 'compilation-start)) | |
413 | ||
47904cb7 | 414 | (use-package isearch |
60ff805e AB |
415 | :custom |
416 | ;; allow scrolling in Isearch | |
417 | (isearch-allow-scroll t) | |
418 | ;; search for non-ASCII characters: i’d like non-ASCII characters such | |
419 | ;; as ‘’“”«»‹›áⓐ𝒶 to be selected when i search for their ASCII | |
420 | ;; counterpart. shoutout to | |
421 | ;; http://endlessparentheses.com/new-in-emacs-25-1-easily-search-non-ascii-characters.html | |
422 | (search-default-mode #'char-fold-to-regexp)) | |
423 | ||
424 | ;; uncomment to extend the above behaviour to query-replace | |
425 | (comment | |
47904cb7 | 426 | (use-package replace |
60ff805e AB |
427 | :custom |
428 | (replace-char-fold t))) | |
b9901074 | 429 | |
47904cb7 | 430 | (use-package vc |
b1a5d811 AB |
431 | :bind ("C-x v C-=" . vc-ediff)) |
432 | ||
47904cb7 | 433 | (use-package vc-git |
e59c8878 AB |
434 | :after vc |
435 | :custom | |
436 | (vc-git-print-log-follow t)) | |
437 | ||
47904cb7 | 438 | (use-package ediff |
b1a5d811 AB |
439 | :config (add-hook 'ediff-after-quit-hook-internal 'winner-undo) |
440 | :custom ((ediff-window-setup-function 'ediff-setup-windows-plain) | |
441 | (ediff-split-window-function 'split-window-horizontally))) | |
442 | ||
47904cb7 | 443 | (use-package face-remap |
60ff805e AB |
444 | :custom |
445 | ;; gentler font resizing | |
446 | (text-scale-mode-step 1.05)) | |
447 | ||
47904cb7 | 448 | (use-package mwheel |
60ff805e AB |
449 | :defer 0.4 |
450 | :config | |
451 | (setq mouse-wheel-scroll-amount '(1 ((shift) . 1)) ; one line at a time | |
452 | mouse-wheel-progressive-speed nil ; don't accelerate scrolling | |
453 | mouse-wheel-follow-mouse t)) ; scroll window under mouse | |
454 | ||
47904cb7 | 455 | (use-package pixel-scroll |
60ff805e AB |
456 | :defer 0.4 |
457 | :config (pixel-scroll-mode 1)) | |
458 | ||
47904cb7 | 459 | (use-package epg-config |
a89c8bd8 AB |
460 | :config |
461 | ;; ask for GPG passphrase in minibuffer | |
462 | ;; this will fail if gpg>=2.1 is not available | |
97141042 | 463 | (setq epg-pinentry-mode 'loopback) |
60ff805e | 464 | :custom |
47904cb7 | 465 | (epg-gpg-program (executable-find "gpg"))) |
1d405cde | 466 | |
47904cb7 AB |
467 | (use-package epg |
468 | :after epg-config) | |
469 | ||
a89c8bd8 | 470 | (use-package pinentry |
8b1a2f32 | 471 | :disabled |
a89c8bd8 AB |
472 | :demand |
473 | :after (epa epg server) | |
474 | :config | |
475 | ;; workaround for systemd-based distros: | |
476 | ;; (setq pinentry--socket-dir server-socket-dir) | |
477 | (pinentry-start)) | |
478 | ||
47904cb7 | 479 | (use-package auth-source |
b98dbb3d AB |
480 | :custom |
481 | (auth-sources '("~/.authinfo.gpg")) | |
482 | (authinfo-hidden (regexp-opt '("password" "client-secret" "token")))) | |
483 | ||
b57457b2 AB |
484 | \f |
485 | ;;; General bindings | |
486 | ||
41d290a2 AB |
487 | (bind-keys |
488 | ("C-c a i" . ielm) | |
489 | ||
490 | ("C-c e b" . eval-buffer) | |
2a816b71 | 491 | ("C-c e e" . eval-last-sexp) |
41d290a2 AB |
492 | ("C-c e r" . eval-region) |
493 | ||
494 | ("C-c e i" . emacs-init-time) | |
495 | ("C-c e u" . emacs-uptime) | |
dca50cf5 | 496 | ("C-c e v" . emacs-version) |
41d290a2 | 497 | |
567440fa AB |
498 | ("C-c f ." . find-file) |
499 | ("C-c f d" . find-name-dired) | |
500 | ("C-c f l" . find-library) | |
501 | ||
41d290a2 AB |
502 | ("C-c F m" . make-frame-command) |
503 | ("C-c F d" . delete-frame) | |
435306f6 | 504 | ("C-c F D" . server-edit) |
41d290a2 | 505 | |
41d290a2 AB |
506 | ("C-S-h C" . describe-char) |
507 | ("C-S-h F" . describe-face) | |
508 | ||
567440fa AB |
509 | ("C-c x" . execute-extended-command) |
510 | ||
a5cc22f4 | 511 | ("C-x k" . b/kill-current-buffer) |
41d290a2 | 512 | ("C-x K" . kill-buffer) |
2a816b71 AB |
513 | ("C-x s" . save-buffer) |
514 | ("C-x S" . save-some-buffers) | |
41d290a2 | 515 | |
b57457b2 | 516 | :map emacs-lisp-mode-map |
dca50cf5 | 517 | ("<C-return>" . b/add-elisp-section)) |
41d290a2 AB |
518 | |
519 | (when (display-graphic-p) | |
520 | (unbind-key "C-z" global-map)) | |
521 | ||
500004f4 AB |
522 | (bind-keys |
523 | ;; for back and forward mouse keys | |
0365678c | 524 | ("<XF86Back>" . previous-buffer) |
500004f4 | 525 | ("<mouse-8>" . previous-buffer) |
4bdfe6ab | 526 | ;; ("<drag-mouse-8>" . previous-buffer) |
0365678c | 527 | ("<XF86Forward>" . next-buffer) |
500004f4 | 528 | ("<mouse-9>" . next-buffer) |
4bdfe6ab AB |
529 | ;; ("<drag-mouse-9>" . next-buffer) |
530 | ;; ("<drag-mouse-2>" . kill-this-buffer) | |
531 | ;; ("<drag-mouse-3>" . switch-to-buffer) | |
532 | ) | |
500004f4 | 533 | |
b57457b2 AB |
534 | \f |
535 | ;;; Essential packages | |
536 | ||
f7910e3d AB |
537 | (add-to-list |
538 | 'load-path | |
539 | (expand-file-name | |
540 | (convert-standard-filename "lisp") user-emacs-directory)) | |
541 | ||
8b1a2f32 AB |
542 | (when b/exwm-p |
543 | (require 'bandali-exwm)) | |
33273849 | 544 | |
f7910e3d | 545 | (require 'bandali-org) |
41d290a2 | 546 | |
b57457b2 | 547 | ;; *the* right way to do git |
41d290a2 | 548 | (use-package magit |
2a816b71 AB |
549 | :bind (("C-x g" . magit-status) |
550 | ("C-c g g" . magit-status) | |
ef6c487c AB |
551 | ("C-c g b" . magit-blame-addition) |
552 | ("C-c g l" . magit-log-buffer-file)) | |
41d290a2 AB |
553 | :config |
554 | (magit-add-section-hook 'magit-status-sections-hook | |
555 | 'magit-insert-modules | |
556 | 'magit-insert-stashes | |
557 | 'append) | |
3b3615f5 AB |
558 | ;; (magit-add-section-hook 'magit-status-sections-hook |
559 | ;; 'magit-insert-ignored-files | |
560 | ;; 'magit-insert-untracked-files | |
561 | ;; 'append) | |
8a2e0eef | 562 | (setq magit-repository-directories '(("~/.emacs.d/" . 0) |
81ea6e55 | 563 | ("~/src/git/" . 2))) |
41d290a2 AB |
564 | (nconc magit-section-initial-visibility-alist |
565 | '(([unpulled status] . show) | |
566 | ([unpushed status] . show))) | |
3fffeb0a AB |
567 | :custom |
568 | (magit-diff-refine-hunk t) | |
569 | (magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1) | |
6ca3a7b1 | 570 | ;; (magit-completing-read-function 'magit-ido-completing-read) |
41d290a2 AB |
571 | :custom-face (magit-diff-file-heading ((t (:weight normal))))) |
572 | ||
b57457b2 | 573 | ;; recently opened files |
47904cb7 | 574 | (use-package recentf |
41d290a2 | 575 | :defer 0.2 |
dca50cf5 | 576 | ;; :config |
9424b3d6 | 577 | ;; (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:") |
6eb104ff AB |
578 | :config |
579 | (recentf-mode) | |
dca50cf5 | 580 | :custom |
1060413b | 581 | (recentf-max-saved-items 2000)) |
41d290a2 | 582 | |
679463c6 | 583 | ;; needed for history for counsel |
6eb104ff AB |
584 | (use-package amx |
585 | :defer 0.3 | |
586 | :config | |
587 | (amx-mode)) | |
588 | ||
679463c6 AB |
589 | ;; (require 'bandali-ido) |
590 | (require 'bandali-ivy) | |
41d290a2 | 591 | |
679463c6 | 592 | (require 'bandali-eshell) |
41d290a2 | 593 | |
679463c6 | 594 | (require 'bandali-ibuffer) |
41d290a2 | 595 | |
47904cb7 | 596 | (use-package outline |
2e81c51a | 597 | :disabled |
41d290a2 AB |
598 | :hook (prog-mode . outline-minor-mode) |
599 | :bind | |
600 | (:map | |
601 | outline-minor-mode-map | |
602 | ("<s-tab>" . outline-toggle-children) | |
603 | ("M-p" . outline-previous-visible-heading) | |
604 | ("M-n" . outline-next-visible-heading) | |
dca50cf5 | 605 | :prefix-map b/outline-prefix-map |
ed8c4fa9 | 606 | :prefix "s-O" |
41d290a2 AB |
607 | ("TAB" . outline-toggle-children) |
608 | ("a" . outline-hide-body) | |
609 | ("H" . outline-hide-body) | |
610 | ("S" . outline-show-all) | |
611 | ("h" . outline-hide-subtree) | |
612 | ("s" . outline-show-subtree))) | |
613 | ||
679463c6 | 614 | (comment |
47904cb7 | 615 | (use-package ls-lisp |
41d290a2 AB |
616 | :custom (ls-lisp-dirs-first t)) |
617 | ||
679463c6 | 618 | (require 'bandali-dired) |
41d290a2 | 619 | |
47904cb7 | 620 | (use-package help |
41d290a2 AB |
621 | :config |
622 | (temp-buffer-resize-mode) | |
623 | (setq help-window-select t)) | |
624 | ||
47904cb7 | 625 | (use-package tramp |
41d290a2 AB |
626 | :config |
627 | (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:")) | |
628 | (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil)) | |
629 | (add-to-list 'tramp-default-proxies-alist | |
630 | (list (regexp-quote (system-name)) nil nil))) | |
631 | ||
47904cb7 | 632 | (use-package doc-view |
41d290a2 AB |
633 | :bind (:map doc-view-mode-map |
634 | ("M-RET" . image-previous-line))) | |
635 | ||
b57457b2 AB |
636 | \f |
637 | ;;; Editing | |
638 | ||
639 | ;; highlight uncommitted changes in the left fringe | |
41d290a2 | 640 | (use-package diff-hl |
df1c9bc8 | 641 | :defer 0.6 |
41d290a2 AB |
642 | :config |
643 | (setq diff-hl-draw-borders nil) | |
644 | (global-diff-hl-mode) | |
645 | :hook (magit-post-refresh . diff-hl-magit-post-refresh)) | |
646 | ||
b57457b2 | 647 | ;; display Lisp objects at point in the echo area |
47904cb7 | 648 | (use-package eldoc |
41d290a2 AB |
649 | :when (version< "25" emacs-version) |
650 | :config (global-eldoc-mode)) | |
651 | ||
b57457b2 | 652 | ;; highlight matching parens |
47904cb7 | 653 | (use-package paren |
41d290a2 AB |
654 | :demand |
655 | :config (show-paren-mode)) | |
656 | ||
47904cb7 | 657 | (use-package elec-pair |
40eddfea AB |
658 | :demand |
659 | :config (electric-pair-mode)) | |
660 | ||
47904cb7 | 661 | (use-package simple |
60ff805e AB |
662 | :config (column-number-mode) |
663 | :custom | |
664 | ;; Save what I copy into clipboard from other applications into Emacs' | |
665 | ;; kill-ring, which would allow me to still be able to easily access | |
666 | ;; it in case I kill (cut or copy) something else inside Emacs before | |
667 | ;; yanking (pasting) what I'd originally intended to. | |
668 | (save-interprogram-paste-before-kill t)) | |
41d290a2 | 669 | |
b57457b2 | 670 | ;; save minibuffer history |
47904cb7 | 671 | (use-package savehist |
1060413b | 672 | :demand |
dca50cf5 AB |
673 | :config |
674 | (savehist-mode) | |
1060413b | 675 | (add-to-list 'savehist-additional-variables 'kill-ring)) |
41d290a2 | 676 | |
b57457b2 | 677 | ;; automatically save place in files |
47904cb7 | 678 | (use-package saveplace |
41d290a2 | 679 | :when (version< "25" emacs-version) |
1060413b | 680 | :config (save-place-mode)) |
41d290a2 | 681 | |
47904cb7 | 682 | (use-package prog-mode |
41d290a2 AB |
683 | :config (global-prettify-symbols-mode) |
684 | (defun indicate-buffer-boundaries-left () | |
685 | (setq indicate-buffer-boundaries 'left)) | |
686 | (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left)) | |
687 | ||
47904cb7 | 688 | (use-package text-mode |
bc2f85e1 | 689 | :bind (:map text-mode-map ("C-*" . b/insert-asterism)) |
93a86536 AB |
690 | :hook ((text-mode . indicate-buffer-boundaries-left) |
691 | (text-mode . flyspell-mode))) | |
41d290a2 | 692 | |
47904cb7 | 693 | (use-package conf-mode |
300b7363 AB |
694 | :mode "\\.*rc$") |
695 | ||
47904cb7 | 696 | (use-package sh-mode |
300b7363 AB |
697 | :mode "\\.bashrc$") |
698 | ||
41d290a2 | 699 | (use-package company |
ccade202 | 700 | :disabled |
41d290a2 AB |
701 | :bind |
702 | (:map company-active-map | |
703 | ([tab] . company-complete-common-or-cycle) | |
d39234b9 AB |
704 | ([escape] . company-abort) |
705 | ("C-p" . company-select-previous-or-abort) | |
706 | ("C-n" . company-select-next-or-abort)) | |
41d290a2 AB |
707 | :custom |
708 | (company-minimum-prefix-length 1) | |
709 | (company-selection-wrap-around t) | |
710 | (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]") | |
711 | (company-dabbrev-downcase nil) | |
712 | (company-dabbrev-ignore-case nil) | |
6eb104ff AB |
713 | ;; :config |
714 | ;; (global-company-mode t) | |
715 | ) | |
41d290a2 AB |
716 | |
717 | (use-package flycheck | |
718 | :defer 0.6 | |
719 | :hook (prog-mode . flycheck-mode) | |
720 | :bind | |
721 | (:map flycheck-mode-map | |
722 | ("M-P" . flycheck-previous-error) | |
723 | ("M-N" . flycheck-next-error)) | |
724 | :config | |
725 | ;; Use the load-path from running Emacs when checking elisp files | |
726 | (setq flycheck-emacs-lisp-load-path 'inherit) | |
727 | ||
728 | ;; Only flycheck when I actually save the buffer | |
54209e74 AB |
729 | (setq flycheck-check-syntax-automatically '(mode-enabled save)) |
730 | :custom (flycheck-mode-line-prefix "flyc")) | |
731 | ||
47904cb7 | 732 | (use-package flyspell) |
41d290a2 AB |
733 | |
734 | ;; http://endlessparentheses.com/ispell-and-apostrophes.html | |
47904cb7 | 735 | (use-package ispell |
41d290a2 AB |
736 | :defer 0.6 |
737 | :config | |
738 | ;; ’ can be part of a word | |
739 | (setq ispell-local-dictionary-alist | |
740 | `((nil "[[:alpha:]]" "[^[:alpha:]]" | |
b1ed9ee8 AB |
741 | "['\x2019]" nil ("-B") nil utf-8)) |
742 | ispell-program-name (executable-find "hunspell")) | |
41d290a2 AB |
743 | ;; don't send ’ to the subprocess |
744 | (defun endless/replace-apostrophe (args) | |
745 | (cons (replace-regexp-in-string | |
746 | "’" "'" (car args)) | |
747 | (cdr args))) | |
748 | (advice-add #'ispell-send-string :filter-args | |
749 | #'endless/replace-apostrophe) | |
750 | ||
751 | ;; convert ' back to ’ from the subprocess | |
752 | (defun endless/replace-quote (args) | |
753 | (if (not (derived-mode-p 'org-mode)) | |
754 | args | |
755 | (cons (replace-regexp-in-string | |
756 | "'" "’" (car args)) | |
757 | (cdr args)))) | |
758 | (advice-add #'ispell-parse-output :filter-args | |
759 | #'endless/replace-quote)) | |
760 | ||
47904cb7 | 761 | (use-package abbrev |
1060413b | 762 | :hook (text-mode . abbrev-mode)) |
54209e74 | 763 | |
b57457b2 AB |
764 | \f |
765 | ;;; Programming modes | |
766 | ||
47904cb7 | 767 | (use-package lisp-mode |
41d290a2 | 768 | :config |
41d290a2 AB |
769 | (defun indent-spaces-mode () |
770 | (setq indent-tabs-mode nil)) | |
771 | (add-hook 'lisp-interaction-mode-hook #'indent-spaces-mode)) | |
772 | ||
47904cb7 | 773 | (use-package reveal |
54209e74 AB |
774 | :hook (emacs-lisp-mode . reveal-mode)) |
775 | ||
47904cb7 AB |
776 | (use-package elisp-mode) |
777 | ||
778 | ;; (use-package alloy-mode | |
779 | ;; :straight (:host github :repo "dwwmmn/alloy-mode") | |
780 | ;; :mode "\\.\\(als\\|dsh\\)\\'" | |
781 | ;; :config | |
782 | ;; (setq alloy-basic-offset 2) | |
783 | ;; ;; (defun b/alloy-simple-indent (start end) | |
784 | ;; ;; (interactive "r") | |
785 | ;; ;; ;; (if (region-active-p) | |
786 | ;; ;; ;; (indent-rigidly start end alloy-basic-offset) | |
787 | ;; ;; ;; (if (bolp) | |
788 | ;; ;; ;; (indent-rigidly (line-beginning-position) | |
789 | ;; ;; ;; (line-end-position) | |
790 | ;; ;; ;; alloy-basic-offset))) | |
791 | ;; ;; (indent-to (+ (current-column) alloy-basic-offset))) | |
792 | ;; :bind (:map alloy-mode-map | |
793 | ;; ("RET" . electric-newline-and-maybe-indent) | |
794 | ;; ;; ("TAB" . b/alloy-simple-indent) | |
795 | ;; ("TAB" . indent-for-tab-command)) | |
796 | ;; :hook (alloy-mode . (lambda () (setq-local indent-tabs-mode nil)))) | |
33273849 AB |
797 | |
798 | (eval-when-compile (defvar lean-mode-map)) | |
799 | (use-package lean-mode | |
33273849 AB |
800 | :defer 0.4 |
801 | :bind (:map lean-mode-map | |
802 | ("S-SPC" . company-complete)) | |
803 | :config | |
804 | (require 'lean-input) | |
805 | (setq default-input-method "Lean" | |
806 | lean-input-tweak-all '(lean-input-compose | |
807 | (lean-input-prepend "/") | |
808 | (lean-input-nonempty)) | |
809 | lean-input-user-translations '(("/" "/"))) | |
810 | (lean-input-setup)) | |
811 | ||
68b2cdaa AB |
812 | (use-package mhtml-mode) |
813 | ||
47904cb7 | 814 | (use-package sgml-mode |
41d290a2 | 815 | :config |
5dfaee4c | 816 | (setq sgml-basic-offset 0)) |
41d290a2 | 817 | |
47904cb7 | 818 | (use-package css-mode |
41d290a2 AB |
819 | :config |
820 | (setq css-indent-offset 2)) | |
821 | ||
41d290a2 | 822 | (use-package emmet-mode |
68b2cdaa | 823 | :after (:any mhtml-mode css-mode sgml-mode) |
41d290a2 AB |
824 | :bind* (("C-)" . emmet-next-edit-point) |
825 | ("C-(" . emmet-prev-edit-point)) | |
826 | :config | |
827 | (unbind-key "C-j" emmet-mode-keymap) | |
828 | (setq emmet-move-cursor-between-quotes t) | |
92ad9675 | 829 | :hook (css-mode html-mode sgml-mode)) |
41d290a2 | 830 | |
1060413b | 831 | (use-package geiser) |
41d290a2 | 832 | |
47904cb7 | 833 | (use-package geiser-guile |
41d290a2 AB |
834 | :config |
835 | (setq geiser-guile-load-path "~/src/git/guix")) | |
836 | ||
837 | (use-package guix) | |
838 | ||
b57457b2 AB |
839 | (comment |
840 | (use-package auctex | |
841 | :custom | |
842 | (font-latex-fontify-sectioning 'color))) | |
843 | ||
47904cb7 AB |
844 | (use-package go-mode |
845 | :disabled) | |
99473567 | 846 | |
f704f564 AB |
847 | (use-package po-mode |
848 | :hook | |
849 | (po-mode . (lambda () (run-with-timer 0.1 nil 'View-exit)))) | |
850 | ||
47904cb7 | 851 | (use-package tex-mode |
748bd8ac AB |
852 | :config |
853 | (cl-delete-if | |
854 | (lambda (p) (string-match "^---?" (car p))) | |
0758ec38 AB |
855 | tex--prettify-symbols-alist) |
856 | :hook ((tex-mode . auto-fill-mode) | |
3457307b | 857 | (tex-mode . flyspell-mode))) |
748bd8ac | 858 | |
47904cb7 AB |
859 | ;; (use-package george-mode |
860 | ;; :straight (:host nil :repo "https://git.shemshak.org/amin/george-mode") | |
861 | ;; :mode "\\.grg\\'") | |
1d01c927 | 862 | |
b57457b2 AB |
863 | \f |
864 | ;;; Theme | |
865 | ||
dca50cf5 AB |
866 | (add-to-list 'custom-theme-load-path |
867 | (expand-file-name | |
868 | (convert-standard-filename "lisp") user-emacs-directory)) | |
b57457b2 AB |
869 | (load-theme 'tangomod t) |
870 | ||
871 | (use-package smart-mode-line | |
872 | :commands (sml/apply-theme) | |
873 | :demand | |
874 | :config | |
8f2b3cb6 AB |
875 | ;; thanks, but no thnaks; don't make fixed-width fills. |
876 | (defun sml/fill-for-buffer-identification () "") | |
0f4b61b6 | 877 | (setq sml/theme 'tangomod) |
26906e22 AB |
878 | (sml/setup) |
879 | (smart-mode-line-enable)) | |
b57457b2 | 880 | |
cce35aca AB |
881 | (use-package doom-modeline |
882 | :disabled | |
883 | :demand | |
884 | :hook (after-init . doom-modeline-init) | |
885 | :custom | |
886 | (doom-modeline-buffer-file-name-style 'relative-to-project)) | |
887 | ||
96611976 | 888 | (use-package doom-themes) |
eb42934e | 889 | |
96611976 | 890 | (use-package moody |
d4afaf1b | 891 | :disabled |
eb42934e AB |
892 | :demand |
893 | :config | |
96611976 | 894 | (setq x-underline-at-descent-line t) |
eb42934e AB |
895 | (let ((line (face-attribute 'mode-line :underline))) |
896 | (set-face-attribute 'mode-line nil :overline line) | |
897 | (set-face-attribute 'mode-line-inactive nil :overline line) | |
898 | (set-face-attribute 'mode-line-inactive nil :underline line) | |
899 | (set-face-attribute 'mode-line nil :box nil) | |
900 | (set-face-attribute 'mode-line-inactive nil :box nil) | |
958286c5 | 901 | (set-face-attribute 'mode-line-inactive nil :background "#e1e1e1")) ; d3d7cf |
eb42934e AB |
902 | (moody-replace-mode-line-buffer-identification) |
903 | (moody-replace-vc-mode)) | |
b57457b2 | 904 | |
0b085e06 AB |
905 | (use-package mini-modeline |
906 | :disabled | |
907 | :demand | |
908 | :config (mini-modeline-mode)) | |
909 | ||
dca50cf5 | 910 | (defvar b/org-mode-font-lock-keywords |
b57457b2 AB |
911 | '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)" |
912 | (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive | |
913 | (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind | |
96611976 AB |
914 | (4 '(:foreground "#c5c8c6") t))) ; title |
915 | "For use with the `doom-tomorrow-night' theme.") | |
b57457b2 | 916 | |
dca50cf5 | 917 | (defun b/lights-on () |
b57457b2 AB |
918 | "Enable my favourite light theme." |
919 | (interactive) | |
920 | (mapc #'disable-theme custom-enabled-themes) | |
96611976 | 921 | (load-theme 'tangomod t) |
22fff83b AB |
922 | (when (featurep 'smart-mode-line) |
923 | (sml/apply-theme 'tangomod)) | |
96611976 | 924 | (font-lock-remove-keywords |
e6c67861 | 925 | 'org-mode b/org-mode-font-lock-keywords) |
d7e02391 AB |
926 | (when (featurep 'erc-hl-nicks) |
927 | (erc-hl-nicks-reset-face-table)) | |
e6c67861 AB |
928 | (when (featurep 'exwm-systemtray) |
929 | (exwm-systemtray--refresh))) | |
b57457b2 | 930 | |
dca50cf5 | 931 | (defun b/lights-off () |
b57457b2 AB |
932 | "Go dark." |
933 | (interactive) | |
934 | (mapc #'disable-theme custom-enabled-themes) | |
96611976 | 935 | (load-theme 'doom-one t) |
22fff83b AB |
936 | (when (featurep 'smart-mode-line) |
937 | (sml/apply-theme 'automatic)) | |
96611976 | 938 | (font-lock-add-keywords |
e6c67861 | 939 | 'org-mode b/org-mode-font-lock-keywords t) |
d7e02391 AB |
940 | (when (featurep 'erc-hl-nicks) |
941 | (erc-hl-nicks-reset-face-table)) | |
e6c67861 AB |
942 | (when (featurep 'exwm-systemtray) |
943 | (exwm-systemtray--refresh))) | |
b57457b2 AB |
944 | |
945 | (bind-keys | |
2e81c51a AB |
946 | ("C-c t d" . b/lights-off) |
947 | ("C-c t l" . b/lights-on)) | |
b57457b2 AB |
948 | |
949 | \f | |
950 | ;;; Emacs enhancements & auxiliary packages | |
951 | ||
dca50cf5 | 952 | (use-package man |
41d290a2 AB |
953 | :config (setq Man-width 80)) |
954 | ||
955 | (use-package which-key | |
956 | :defer 0.4 | |
957 | :config | |
958 | (which-key-add-key-based-replacements | |
959 | ;; prefixes for global prefixes and minor modes | |
960 | "C-c @" "outline" | |
961 | "C-c !" "flycheck" | |
b549b760 | 962 | "C-x RET" "coding system" |
41d290a2 | 963 | "C-x 8" "unicode" |
b549b760 | 964 | "C-x @" "event modifiers" |
41d290a2 AB |
965 | "C-x a" "abbrev/expand" |
966 | "C-x r" "rectangle/register/bookmark" | |
b549b760 | 967 | "C-x t" "tabs" |
41d290a2 | 968 | "C-x v" "version control" |
b549b760 AB |
969 | "C-x X" "edebug" |
970 | "C-x C-a" "edebug" | |
971 | "C-x C-k" "kmacro" | |
41d290a2 | 972 | ;; prefixes for my personal bindings |
b549b760 | 973 | "C-c &" "yasnippet" |
41d290a2 AB |
974 | "C-c a" "applications" |
975 | "C-c a e" "erc" | |
976 | "C-c a o" "org" | |
977 | "C-c a s" "shells" | |
2e81c51a | 978 | "C-c b" "buffers" |
41d290a2 AB |
979 | "C-c c" "compile-and-comments" |
980 | "C-c e" "eval" | |
981 | "C-c f" "files" | |
982 | "C-c F" "frames" | |
ef6c487c | 983 | "C-c g" "magit" |
41d290a2 AB |
984 | "C-S-h" "help(ful)" |
985 | "C-c m" "multiple-cursors" | |
47904cb7 AB |
986 | "C-c p" "projectile" |
987 | "C-c p s" "projectile/search" | |
988 | "C-c p x" "projectile/execute" | |
989 | "C-c p 4" "projectile/other-window" | |
41d290a2 | 990 | "C-c q" "boxquote" |
2e81c51a AB |
991 | "C-c t" "themes" |
992 | ;; "s-O" "outline" | |
ef6c487c | 993 | ) |
41d290a2 AB |
994 | |
995 | ;; prefixes for major modes | |
996 | (which-key-add-major-mode-key-based-replacements 'message-mode | |
7cc51891 | 997 | "C-c f n" "footnote") |
41d290a2 AB |
998 | (which-key-add-major-mode-key-based-replacements 'org-mode |
999 | "C-c C-v" "org-babel") | |
41d290a2 AB |
1000 | |
1001 | (which-key-mode) | |
1002 | :custom | |
1003 | (which-key-add-column-padding 5) | |
1004 | (which-key-max-description-length 32)) | |
1005 | ||
b57457b2 | 1006 | (use-package crux ; results in Waiting for git... [2 times] |
41d290a2 | 1007 | :defer 0.4 |
2a816b71 | 1008 | :bind (("C-c d" . crux-duplicate-current-line-or-region) |
ba45b932 | 1009 | ("C-c M-d" . crux-duplicate-and-comment-current-line-or-region) |
205870c7 AB |
1010 | ("C-c f C" . crux-copy-file-preserve-attributes) |
1011 | ("C-c f D" . crux-delete-file-and-buffer) | |
1012 | ("C-c f R" . crux-rename-file-and-buffer) | |
41d290a2 AB |
1013 | ("C-c j" . crux-top-join-line) |
1014 | ("C-S-j" . crux-top-join-line))) | |
1015 | ||
5b10d879 AB |
1016 | (use-package mwim |
1017 | :bind (("C-a" . mwim-beginning-of-code-or-line) | |
1018 | ("C-e" . mwim-end-of-code-or-line) | |
1019 | ("<home>" . mwim-beginning-of-line-or-code) | |
1020 | ("<end>" . mwim-end-of-line-or-code))) | |
41d290a2 AB |
1021 | |
1022 | (use-package projectile | |
ccade202 | 1023 | :disabled |
26906e22 | 1024 | :defer 0.5 |
47904cb7 | 1025 | :bind-keymap ("C-c p" . projectile-command-map) |
41d290a2 AB |
1026 | :config |
1027 | (projectile-mode) | |
1028 | ||
dca50cf5 | 1029 | (defun b/projectile-mode-line-fun () |
26906e22 AB |
1030 | "Report project name and type in the modeline." |
1031 | (let ((project-name (projectile-project-name)) | |
1032 | (project-type (projectile-project-type))) | |
1033 | (format "%s%s" | |
1034 | projectile-mode-line-prefix | |
1035 | (if project-type | |
1036 | (format ":%s" project-type) | |
1037 | "")))) | |
dca50cf5 | 1038 | (setq projectile-mode-line-function 'b/projectile-mode-line-fun) |
26906e22 | 1039 | |
41d290a2 AB |
1040 | (defun my-projectile-invalidate-cache (&rest _args) |
1041 | ;; ignore the args to `magit-checkout' | |
1042 | (projectile-invalidate-cache nil)) | |
1043 | ||
1044 | (eval-after-load 'magit-branch | |
1045 | '(progn | |
1046 | (advice-add 'magit-checkout | |
1047 | :after #'my-projectile-invalidate-cache) | |
1048 | (advice-add 'magit-branch-and-checkout | |
1049 | :after #'my-projectile-invalidate-cache))) | |
54209e74 | 1050 | :custom |
295b1b10 | 1051 | (projectile-completion-system 'ivy) |
54209e74 | 1052 | (projectile-mode-line-prefix " proj")) |
41d290a2 AB |
1053 | |
1054 | (use-package helpful | |
1055 | :defer 0.6 | |
1056 | :bind | |
1057 | (("C-S-h c" . helpful-command) | |
1058 | ("C-S-h f" . helpful-callable) ; helpful-function | |
1059 | ("C-S-h v" . helpful-variable) | |
1060 | ("C-S-h k" . helpful-key) | |
1061 | ("C-S-h p" . helpful-at-point))) | |
1062 | ||
5b10d879 AB |
1063 | (use-package unkillable-scratch |
1064 | :defer 0.6 | |
1065 | :config | |
1066 | (unkillable-scratch 1) | |
1067 | :custom | |
1068 | (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$"))) | |
41d290a2 | 1069 | |
5b10d879 AB |
1070 | ;; ,---- |
1071 | ;; | make pretty boxed quotes like this | |
1072 | ;; `---- | |
1073 | (use-package boxquote | |
1074 | :defer 0.6 | |
1075 | :bind | |
1076 | (:prefix-map b/boxquote-prefix-map | |
1077 | :prefix "C-c q" | |
1078 | ("b" . boxquote-buffer) | |
1079 | ("B" . boxquote-insert-buffer) | |
1080 | ("d" . boxquote-defun) | |
1081 | ("F" . boxquote-insert-file) | |
1082 | ("hf" . boxquote-describe-function) | |
1083 | ("hk" . boxquote-describe-key) | |
1084 | ("hv" . boxquote-describe-variable) | |
1085 | ("hw" . boxquote-where-is) | |
1086 | ("k" . boxquote-kill) | |
1087 | ("p" . boxquote-paragraph) | |
1088 | ("q" . boxquote-boxquote) | |
1089 | ("r" . boxquote-region) | |
1090 | ("s" . boxquote-shell-command) | |
1091 | ("t" . boxquote-text) | |
1092 | ("T" . boxquote-title) | |
1093 | ("u" . boxquote-unbox) | |
1094 | ("U" . boxquote-unbox-region) | |
1095 | ("y" . boxquote-yank) | |
1096 | ("M-q" . boxquote-fill-paragraph) | |
1097 | ("M-w" . boxquote-kill-ring-save))) | |
41d290a2 AB |
1098 | |
1099 | (use-package orgalist | |
3619fcff AB |
1100 | ;; breaks auto-fill-mode, showing this error: |
1101 | ;; orgalist--boundaries: Lisp nesting exceeds ‘max-lisp-eval-depth’ | |
1102 | :disabled | |
41d290a2 AB |
1103 | :after message |
1104 | :hook (message-mode . orgalist-mode)) | |
1105 | ||
b57457b2 | 1106 | ;; highlight TODOs in buffers |
41d290a2 AB |
1107 | (use-package hl-todo |
1108 | :defer 0.5 | |
1109 | :config | |
1110 | (global-hl-todo-mode)) | |
1111 | ||
41d290a2 | 1112 | (use-package multi-term |
cce35aca | 1113 | :disabled |
41d290a2 | 1114 | :defer 0.6 |
fb078e63 AB |
1115 | :bind (("C-c a s m m" . multi-term) |
1116 | ("C-c a s m d" . multi-term-dedicated-toggle) | |
1117 | ("C-c a s m p" . multi-term-prev) | |
1118 | ("C-c a s m n" . multi-term-next) | |
41d290a2 | 1119 | :map term-mode-map |
0af1e91a | 1120 | ("C-c C-j" . term-char-mode)) |
41d290a2 | 1121 | :config |
96c704d7 AB |
1122 | (setq multi-term-program "screen" |
1123 | multi-term-program-switches (concat "-c" | |
1124 | (getenv "XDG_CONFIG_HOME") | |
1125 | "/screen/screenrc") | |
41d290a2 AB |
1126 | ;; TODO: add separate bindings for connecting to existing |
1127 | ;; session vs. always creating a new one | |
1128 | multi-term-dedicated-select-after-open-p t | |
1129 | multi-term-dedicated-window-height 20 | |
1130 | multi-term-dedicated-max-window-height 30 | |
1131 | term-bind-key-alist | |
1132 | '(("C-c C-c" . term-interrupt-subjob) | |
1133 | ("C-c C-e" . term-send-esc) | |
0af1e91a | 1134 | ("C-c C-j" . term-line-mode) |
41d290a2 | 1135 | ("C-k" . kill-line) |
fb078e63 AB |
1136 | ;; ("C-y" . term-paste) |
1137 | ("C-y" . term-send-raw) | |
41d290a2 AB |
1138 | ("M-f" . term-send-forward-word) |
1139 | ("M-b" . term-send-backward-word) | |
1140 | ("M-p" . term-send-up) | |
1141 | ("M-n" . term-send-down) | |
fb078e63 AB |
1142 | ("M-j" . term-send-raw-meta) |
1143 | ("M-y" . term-send-raw-meta) | |
1144 | ("M-/" . term-send-raw-meta) | |
1145 | ("M-0" . term-send-raw-meta) | |
1146 | ("M-1" . term-send-raw-meta) | |
1147 | ("M-2" . term-send-raw-meta) | |
1148 | ("M-3" . term-send-raw-meta) | |
1149 | ("M-4" . term-send-raw-meta) | |
1150 | ("M-5" . term-send-raw-meta) | |
1151 | ("M-6" . term-send-raw-meta) | |
1152 | ("M-7" . term-send-raw-meta) | |
1153 | ("M-8" . term-send-raw-meta) | |
1154 | ("M-9" . term-send-raw-meta) | |
41d290a2 AB |
1155 | ("<C-backspace>" . term-send-backward-kill-word) |
1156 | ("<M-DEL>" . term-send-backward-kill-word) | |
1157 | ("M-d" . term-send-delete-word) | |
1158 | ("M-," . term-send-raw) | |
1159 | ("M-." . comint-dynamic-complete)) | |
1160 | term-unbind-key-alist | |
fb078e63 AB |
1161 | '("C-z" "C-x" "C-c" "C-h" |
1162 | ;; "C-y" | |
1163 | "<ESC>"))) | |
41d290a2 AB |
1164 | |
1165 | (use-package page-break-lines | |
b57457b2 | 1166 | :defer 0.5 |
2f5d8190 AB |
1167 | :custom |
1168 | (page-break-lines-max-width fill-column) | |
41d290a2 AB |
1169 | :config |
1170 | (global-page-break-lines-mode)) | |
1171 | ||
1172 | (use-package expand-region | |
1173 | :bind ("C-=" . er/expand-region)) | |
1174 | ||
1175 | (use-package multiple-cursors | |
1176 | :bind | |
1177 | (("C-S-<mouse-1>" . mc/add-cursor-on-click) | |
dca50cf5 | 1178 | (:prefix-map b/mc-prefix-map |
41d290a2 AB |
1179 | :prefix "C-c m" |
1180 | ("c" . mc/edit-lines) | |
1181 | ("n" . mc/mark-next-like-this) | |
1182 | ("p" . mc/mark-previous-like-this) | |
1060413b | 1183 | ("a" . mc/mark-all-like-this)))) |
41d290a2 | 1184 | |
41d290a2 AB |
1185 | (use-package yasnippet |
1186 | :defer 0.6 | |
1187 | :config | |
1188 | (defconst yas-verbosity-cur yas-verbosity) | |
1189 | (setq yas-verbosity 2) | |
476f6228 | 1190 | (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t) |
41d290a2 AB |
1191 | (yas-reload-all) |
1192 | (setq yas-verbosity yas-verbosity-cur) | |
5b185efa AB |
1193 | |
1194 | (defun b/yas--maybe-expand-key-filter (cmd) | |
1195 | (when (and (yas--maybe-expand-key-filter cmd) | |
1196 | (not (bound-and-true-p git-commit-mode))) | |
1197 | cmd)) | |
1198 | (defconst b/yas-maybe-expand | |
1199 | '(menu-item "" yas-expand :filter b/yas--maybe-expand-key-filter)) | |
1200 | (define-key yas-minor-mode-map | |
1201 | (kbd "SPC") b/yas-maybe-expand) | |
1202 | ||
476f6228 | 1203 | (yas-global-mode)) |
41d290a2 | 1204 | |
33273849 | 1205 | (use-package debbugs |
ba45b932 AB |
1206 | :bind |
1207 | (("C-c D d" . debbugs-gnu) | |
8cee0db4 | 1208 | ("C-c D b" . debbugs-gnu-bugs) |
ba45b932 AB |
1209 | ("C-c D e" . |
1210 | (lambda () | |
d6c37a13 | 1211 | (interactive) ; bug-gnu-emacs |
ba45b932 AB |
1212 | (setq debbugs-gnu-current-suppress t) |
1213 | (debbugs-gnu debbugs-gnu-default-severities '("emacs")))) | |
d6c37a13 | 1214 | ("C-c D g" . ; bug-gnuzilla |
ba45b932 AB |
1215 | (lambda () |
1216 | (interactive) | |
1217 | (setq debbugs-gnu-current-suppress t) | |
64b53575 | 1218 | (debbugs-gnu debbugs-gnu-default-severities '("gnuzilla")))) |
d6c37a13 AB |
1219 | ("C-c D G b" . ; bug-guix |
1220 | (lambda () | |
1221 | (interactive) | |
1222 | (setq debbugs-gnu-current-suppress t) | |
1223 | (debbugs-gnu debbugs-gnu-default-severities '("guix")))) | |
1224 | ("C-c D G p" . ; guix-patches | |
64b53575 AB |
1225 | (lambda () |
1226 | (interactive) | |
1227 | (setq debbugs-gnu-current-suppress t) | |
d6c37a13 | 1228 | (debbugs-gnu debbugs-gnu-default-severities '("guix-patches")))))) |
41d290a2 AB |
1229 | |
1230 | (use-package org-ref | |
1231 | :init | |
dca50cf5 | 1232 | (b/setq-every '("~/usr/org/references.bib") |
41d290a2 AB |
1233 | reftex-default-bibliography |
1234 | org-ref-default-bibliography) | |
1235 | (setq | |
1236 | org-ref-bibliography-notes "~/usr/org/notes.org" | |
1237 | org-ref-pdf-directory "~/usr/org/bibtex-pdfs/")) | |
1238 | ||
2f5d8190 AB |
1239 | ;; (use-package fill-column-indicator) |
1240 | ||
47904cb7 | 1241 | (use-package window |
ed8c4fa9 | 1242 | :bind |
edb03389 AB |
1243 | (("C-c w e" . (lambda () |
1244 | (interactive) | |
1245 | (split-window-right) | |
1246 | (other-window 1) | |
1247 | (erc-switch-to-buffer))) | |
1248 | ("C-c w s l" . (lambda () | |
1249 | (interactive) | |
1250 | (split-window-right) | |
1251 | (other-window 1))) | |
1252 | ("C-c w s j" . (lambda () | |
1253 | (interactive) | |
1254 | (split-window-below) | |
1255 | (other-window 1))) | |
446cb096 | 1256 | ("C-c w q" . quit-window)) |
92df6c4f AB |
1257 | :custom |
1258 | (split-width-threshold 150)) | |
ed8c4fa9 | 1259 | |
47904cb7 | 1260 | (use-package windmove |
ed8c4fa9 AB |
1261 | :defer 0.6 |
1262 | :bind | |
2e81c51a AB |
1263 | (("C-c w h" . windmove-left) |
1264 | ("C-c w j" . windmove-down) | |
1265 | ("C-c w k" . windmove-up) | |
1266 | ("C-c w l" . windmove-right) | |
1267 | ("C-c w H" . windmove-swap-states-left) | |
1268 | ("C-c w J" . windmove-swap-states-down) | |
1269 | ("C-c w K" . windmove-swap-states-up) | |
1270 | ("C-c w L" . windmove-swap-states-right))) | |
ed8c4fa9 | 1271 | |
05068e71 AB |
1272 | (use-package pass |
1273 | :commands pass | |
1274 | :bind ("C-c a p" . pass) | |
1275 | :hook (pass-mode . View-exit)) | |
1276 | ||
b188e798 AB |
1277 | (use-package pdf-tools |
1278 | :defer 0.5 | |
1279 | :bind (:map pdf-view-mode-map | |
0365678c AB |
1280 | ("<C-XF86Back>" . pdf-history-backward) |
1281 | ("<mouse-8>" . pdf-history-backward) | |
1282 | ("<drag-mouse-8>" . pdf-history-backward) | |
1283 | ("<C-XF86Forward>" . pdf-history-forward) | |
1284 | ("<mouse-9>" . pdf-history-forward) | |
1285 | ("<drag-mouse-9>" . pdf-history-forward) | |
4fa43cd8 AB |
1286 | ("M-RET" . image-previous-line) |
1287 | ("C-s" . isearch-forward) | |
1288 | ("s s" . isearch-forward)) | |
822ac360 AB |
1289 | :config (pdf-tools-install nil t) |
1290 | :custom (pdf-view-resize-factor 1.05)) | |
b188e798 | 1291 | |
62a2088e | 1292 | (use-package org-pdftools |
47904cb7 | 1293 | :disabled |
62a2088e AB |
1294 | :straight (:host github :repo "fuxialexander/org-pdftools") |
1295 | :demand | |
1296 | :after org | |
1297 | :config | |
1298 | (with-eval-after-load 'org | |
1299 | (require 'org-pdftools))) | |
1300 | ||
9de75957 AB |
1301 | (use-package biblio) |
1302 | ||
47904cb7 | 1303 | (use-package reftex |
9a5ffb33 AB |
1304 | :hook (latex-mode . reftex-mode)) |
1305 | ||
47904cb7 | 1306 | (use-package reftex-cite |
9a5ffb33 AB |
1307 | :after reftex |
1308 | :disabled ; enable to disable | |
1309 | ; reftex-cite's default choice | |
1310 | ; of previous word | |
1311 | :config | |
1312 | (defun reftex-get-bibkey-default () | |
1313 | "If the cursor is in a citation macro, return the word before the macro." | |
1314 | (let* ((macro (reftex-what-macro 1))) | |
1315 | (save-excursion | |
1316 | (when (and macro (string-match "cite" (car macro))) | |
1317 | (goto-char (cdr macro))) | |
1318 | (reftex-this-word))))) | |
1319 | ||
d141ce11 AB |
1320 | (use-package minions |
1321 | :demand | |
1322 | :config (minions-mode)) | |
1323 | ||
fa9943dc | 1324 | (use-package dmenu |
fa9943dc | 1325 | :custom |
fa9943dc AB |
1326 | (dmenu-prompt-string "run: ") |
1327 | (dmenu-save-file (b/var "dmenu-items"))) | |
1328 | ||
996bebf6 AB |
1329 | (use-package eosd |
1330 | ;; TODO: fix build by properly building the eosd-pixbuf.c module | |
1331 | ;; e.g. see https://github.com/raxod502/straight.el/issues/386 | |
1332 | :disabled | |
1333 | :straight (:host github :repo "clarete/eosd") | |
1334 | :demand | |
1335 | :after exwm | |
1336 | :config | |
1337 | (eosd-start)) | |
1338 | ||
3280b75e AB |
1339 | (use-package scpaste |
1340 | :disabled | |
1341 | :config | |
1342 | (setq scpaste-http-destination "https://p.bndl.org" | |
1343 | scpaste-scp-destination "nix:/var/www/p.bndl.org")) | |
1344 | ||
9ed5410e | 1345 | (use-package eww |
03745e6e | 1346 | :bind ("C-c a e w" . eww) |
9ed5410e AB |
1347 | :custom |
1348 | (eww-download-directory (file-name-as-directory | |
1349 | (getenv "XDG_DOWNLOAD_DIR")))) | |
1350 | ||
b57457b2 AB |
1351 | \f |
1352 | ;;; Email (with Gnus) | |
1353 | ||
dca50cf5 | 1354 | (defvar b/maildir (expand-file-name "~/mail/")) |
41d290a2 | 1355 | (with-eval-after-load 'recentf |
dca50cf5 | 1356 | (add-to-list 'recentf-exclude b/maildir)) |
41d290a2 AB |
1357 | |
1358 | (setq | |
dca50cf5 | 1359 | b/gnus-init-file (b/etc "gnus") |
41d290a2 AB |
1360 | mail-user-agent 'gnus-user-agent |
1361 | read-mail-command 'gnus) | |
1362 | ||
47904cb7 | 1363 | (use-package gnus |
b1ed18e4 | 1364 | :bind (("s-m" . gnus-plugged) |
2e81c51a | 1365 | ("s-M" . gnus-unplugged) |
b1ed18e4 | 1366 | ("C-c a m" . gnus-plugged) |
2e81c51a | 1367 | ("C-c a M" . gnus-unplugged)) |
41d290a2 AB |
1368 | :init |
1369 | (setq | |
1370 | gnus-select-method '(nnnil "") | |
1371 | gnus-secondary-select-methods | |
d4cc5497 | 1372 | '((nnimap "shemshak" |
14bd6398 AB |
1373 | (nnimap-stream plain) |
1374 | (nnimap-address "127.0.0.1") | |
1375 | (nnimap-server-port 143) | |
1376 | (nnimap-authenticator plain) | |
1377 | (nnimap-user "amin@shemshak.local")) | |
2e9074a4 | 1378 | (nnimap "gnu" |
14bd6398 AB |
1379 | (nnimap-stream plain) |
1380 | (nnimap-address "127.0.0.1") | |
1381 | (nnimap-server-port 143) | |
1382 | (nnimap-authenticator plain) | |
0a929da7 | 1383 | (nnimap-user "bandali@gnu.local") |
14bd6398 AB |
1384 | (nnimap-inbox "INBOX") |
1385 | (nnimap-split-methods 'nnimap-split-fancy) | |
1386 | (nnimap-split-fancy (| | |
1387 | ;; (: gnus-registry-split-fancy-with-parent) | |
1388 | ;; (: gnus-group-split-fancy "INBOX" t "INBOX") | |
1389 | ;; gnu | |
1390 | (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1") | |
46d707ed AB |
1391 | ;; gnus |
1392 | (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1") | |
4319a2ff AB |
1393 | ;; libreplanet |
1394 | (list ".*<\\(.*\\)\\.libreplanet\\.org>.*" "l.\\1") | |
14bd6398 AB |
1395 | ;; *.lists.sr.ht, omitting one dot if present |
1396 | ;; add more \\.?\\([^.]*\\) if needed | |
1397 | (list ".*<~\\(.*\\)/\\([^.]*\\)\\.?\\([^.]*\\)\\.lists.sr.ht>.*" "l.~\\1.\\2\\3") | |
1398 | ;; webmasters | |
1399 | (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters") | |
1400 | ;; other | |
1401 | (list ".*atreus.freelists.org" "l.atreus") | |
1402 | (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec") | |
1403 | ;; (list ".*haskell-art.we.lurk.org" "l.haskell.art") ;d | |
1404 | (list ".*haskell-cafe.haskell.org" "l.haskell-cafe") | |
1405 | ;; (list ".*notmuch.notmuchmail.org" "l.notmuch") ;u | |
1406 | ;; (list ".*dev.lists.parabola.nu" "l.parabola-dev") ;u | |
1407 | ;; ---------------------------------- | |
1408 | ;; legend: (u)nsubscribed | (d)ead | |
1409 | ;; ---------------------------------- | |
1410 | ;; otherwise, leave mail in INBOX | |
1411 | "INBOX"))) | |
727d14d3 | 1412 | (nnimap "uw" |
41d290a2 AB |
1413 | (nnimap-stream plain) |
1414 | (nnimap-address "127.0.0.1") | |
1415 | (nnimap-server-port 143) | |
1416 | (nnimap-authenticator plain) | |
f0d99991 AB |
1417 | (nnimap-user "abandali@uw.local") |
1418 | (nnimap-inbox "INBOX") | |
1419 | (nnimap-split-methods 'nnimap-split-fancy) | |
1420 | (nnimap-split-fancy (| | |
29e42dc1 | 1421 | ;; (: gnus-registry-split-fancy-with-parent) |
5b8a18a4 | 1422 | ;; se212-f19 |
90dc3a58 AB |
1423 | ("subject" "SE\\s-?212" "course.se212-f19") |
1424 | (from "SE\\s-?212" "course.se212-f19") | |
f0d99991 AB |
1425 | ;; catch-all |
1426 | "INBOX"))) | |
727d14d3 | 1427 | (nnimap "csc" |
41d290a2 AB |
1428 | (nnimap-stream plain) |
1429 | (nnimap-address "127.0.0.1") | |
1430 | (nnimap-server-port 143) | |
1431 | (nnimap-authenticator plain) | |
727d14d3 | 1432 | (nnimap-user "abandali@csc.uw.local"))) |
95ec8c25 | 1433 | gnus-message-archive-group "nnimap+gnu:INBOX" |
41d290a2 | 1434 | gnus-parameters |
859ba2a0 AB |
1435 | '(("l\\.atreus" |
1436 | (to-address . "atreus@freelists.org") | |
1437 | (to-list . "atreus@freelists.org")) | |
1438 | ("l\\.deepspec" | |
41d290a2 | 1439 | (to-address . "deepspec@lists.cs.princeton.edu") |
778202b8 AB |
1440 | (to-list . "deepspec@lists.cs.princeton.edu") |
1441 | (list-identifier . "\\[deepspec\\]")) | |
cb4015f6 | 1442 | ("l\\.emacs-devel" |
74fd778e AB |
1443 | (to-address . "emacs-devel@gnu.org") |
1444 | (to-list . "emacs-devel@gnu.org")) | |
cb4015f6 | 1445 | ("l\\.help-gnu-emacs" |
74fd778e AB |
1446 | (to-address . "help-gnu-emacs@gnu.org") |
1447 | (to-list . "help-gnu-emacs@gnu.org")) | |
cb4015f6 | 1448 | ("l\\.info-gnu-emacs" |
74fd778e AB |
1449 | (to-address . "info-gnu-emacs@gnu.org") |
1450 | (to-list . "info-gnu-emacs@gnu.org")) | |
cb4015f6 | 1451 | ("l\\.emacs-orgmode" |
41d290a2 | 1452 | (to-address . "emacs-orgmode@gnu.org") |
778202b8 AB |
1453 | (to-list . "emacs-orgmode@gnu.org") |
1454 | (list-identifier . "\\[O\\]")) | |
cb4015f6 | 1455 | ("l\\.emacs-tangents" |
40b9eac1 AB |
1456 | (to-address . "emacs-tangents@gnu.org") |
1457 | (to-list . "emacs-tangents@gnu.org")) | |
69e4b016 AB |
1458 | ("l\\.emacsconf-committee" |
1459 | (to-address . "emacsconf-committee@gnu.org") | |
1460 | (to-list . "emacsconf-committee@gnu.org")) | |
cb4015f6 | 1461 | ("l\\.emacsconf-discuss" |
41d290a2 AB |
1462 | (to-address . "emacsconf-discuss@gnu.org") |
1463 | (to-list . "emacsconf-discuss@gnu.org")) | |
cb4015f6 | 1464 | ("l\\.emacsconf-register" |
690a977d AB |
1465 | (to-address . "emacsconf-register@gnu.org") |
1466 | (to-list . "emacsconf-register@gnu.org")) | |
cb4015f6 | 1467 | ("l\\.emacsconf-submit" |
690a977d AB |
1468 | (to-address . "emacsconf-submit@gnu.org") |
1469 | (to-list . "emacsconf-submit@gnu.org")) | |
cb4015f6 | 1470 | ("l\\.fencepost-users" |
41d290a2 | 1471 | (to-address . "fencepost-users@gnu.org") |
778202b8 AB |
1472 | (to-list . "fencepost-users@gnu.org") |
1473 | (list-identifier . "\\[Fencepost-users\\]")) | |
e7a169d1 AB |
1474 | ("l\\.gnewsense-art" |
1475 | (to-address . "gnewsense-art@nongnu.org") | |
1476 | (to-list . "gnewsense-art@nongnu.org") | |
1477 | (list-identifier . "\\[gNewSense-art\\]")) | |
1478 | ("l\\.gnewsense-dev" | |
1479 | (to-address . "gnewsense-dev@nongnu.org") | |
1480 | (to-list . "gnewsense-dev@nongnu.org") | |
1481 | (list-identifier . "\\[Gnewsense-dev\\]")) | |
7f3d862f | 1482 | ("l\\.gnewsense-users" |
e7a169d1 AB |
1483 | (to-address . "gnewsense-users@nongnu.org") |
1484 | (to-list . "gnewsense-users@nongnu.org") | |
1485 | (list-identifier . "\\[gNewSense-users\\]")) | |
cb4015f6 | 1486 | ("l\\.gnunet-developers" |
41d290a2 | 1487 | (to-address . "gnunet-developers@gnu.org") |
778202b8 AB |
1488 | (to-list . "gnunet-developers@gnu.org") |
1489 | (list-identifier . "\\[GNUnet-developers\\]")) | |
cb4015f6 | 1490 | ("l\\.help-gnunet" |
74fd778e AB |
1491 | (to-address . "help-gnunet@gnu.org") |
1492 | (to-list . "help-gnunet@gnu.org") | |
1493 | (list-identifier . "\\[Help-gnunet\\]")) | |
cb4015f6 | 1494 | ("l\\.bug-gnuzilla" |
74fd778e AB |
1495 | (to-address . "bug-gnuzilla@gnu.org") |
1496 | (to-list . "bug-gnuzilla@gnu.org") | |
1497 | (list-identifier . "\\[Bug-gnuzilla\\]")) | |
cb4015f6 | 1498 | ("l\\.gnuzilla-dev" |
74fd778e AB |
1499 | (to-address . "gnuzilla-dev@gnu.org") |
1500 | (to-list . "gnuzilla-dev@gnu.org") | |
1501 | (list-identifier . "\\[Gnuzilla-dev\\]")) | |
cb4015f6 | 1502 | ("l\\.guile-devel" |
41d290a2 AB |
1503 | (to-address . "guile-devel@gnu.org") |
1504 | (to-list . "guile-devel@gnu.org")) | |
cb4015f6 | 1505 | ("l\\.guile-user" |
29e42dc1 AB |
1506 | (to-address . "guile-user@gnu.org") |
1507 | (to-list . "guile-user@gnu.org")) | |
cb4015f6 | 1508 | ("l\\.guix-devel" |
41d290a2 AB |
1509 | (to-address . "guix-devel@gnu.org") |
1510 | (to-list . "guix-devel@gnu.org")) | |
cb4015f6 | 1511 | ("l\\.help-guix" |
837a23a5 AB |
1512 | (to-address . "help-guix@gnu.org") |
1513 | (to-list . "help-guix@gnu.org")) | |
cb4015f6 | 1514 | ("l\\.info-guix" |
74fd778e AB |
1515 | (to-address . "info-guix@gnu.org") |
1516 | (to-list . "info-guix@gnu.org")) | |
cb4015f6 | 1517 | ("l\\.savannah-hackers-public" |
6f25cef1 AB |
1518 | (to-address . "savannah-hackers-public@gnu.org") |
1519 | (to-list . "savannah-hackers-public@gnu.org")) | |
cb4015f6 | 1520 | ("l\\.savannah-users" |
6f25cef1 AB |
1521 | (to-address . "savannah-users@gnu.org") |
1522 | (to-list . "savannah-users@gnu.org")) | |
cb4015f6 | 1523 | ("l\\.www-commits" |
74fd778e AB |
1524 | (to-address . "www-commits@gnu.org") |
1525 | (to-list . "www-commits@gnu.org")) | |
cb4015f6 | 1526 | ("l\\.www-discuss" |
74fd778e AB |
1527 | (to-address . "www-discuss@gnu.org") |
1528 | (to-list . "www-discuss@gnu.org")) | |
cb4015f6 | 1529 | ("l\\.haskell-art" |
41d290a2 | 1530 | (to-address . "haskell-art@we.lurk.org") |
778202b8 AB |
1531 | (to-list . "haskell-art@we.lurk.org") |
1532 | (list-identifier . "\\[haskell-art\\]")) | |
cb4015f6 | 1533 | ("l\\.haskell-cafe" |
41d290a2 | 1534 | (to-address . "haskell-cafe@haskell.org") |
778202b8 AB |
1535 | (to-list . "haskell-cafe@haskell.org") |
1536 | (list-identifier . "\\[Haskell-cafe\\]")) | |
74fd778e | 1537 | ("l\\.notmuch" |
41d290a2 AB |
1538 | (to-address . "notmuch@notmuchmail.org") |
1539 | (to-list . "notmuch@notmuchmail.org")) | |
cb4015f6 | 1540 | ("l\\.parabola-dev" |
41d290a2 | 1541 | (to-address . "dev@lists.parabola.nu") |
778202b8 AB |
1542 | (to-list . "dev@lists.parabola.nu") |
1543 | (list-identifier . "\\[Dev\\]")) | |
74fd778e | 1544 | ("l\\.~bandali\\.public-inbox" |
41d290a2 AB |
1545 | (to-address . "~bandali/public-inbox@lists.sr.ht") |
1546 | (to-list . "~bandali/public-inbox@lists.sr.ht")) | |
7c281dfc AB |
1547 | ("l\\.~sircmpwn\\.free-writers-club" |
1548 | (to-address . "~sircmpwn/free-writers-club@lists.sr.ht") | |
1549 | (to-list . "~sircmpwn/free-writers-club@lists.sr.ht")) | |
cb4015f6 | 1550 | ("l\\.~sircmpwn\\.srht-admins" |
41d290a2 AB |
1551 | (to-address . "~sircmpwn/sr.ht-admins@lists.sr.ht") |
1552 | (to-list . "~sircmpwn/sr.ht-admins@lists.sr.ht")) | |
cb4015f6 | 1553 | ("l\\.~sircmpwn\\.srht-announce" |
41d290a2 AB |
1554 | (to-address . "~sircmpwn/sr.ht-announce@lists.sr.ht") |
1555 | (to-list . "~sircmpwn/sr.ht-announce@lists.sr.ht")) | |
cb4015f6 | 1556 | ("l\\.~sircmpwn\\.srht-dev" |
41d290a2 AB |
1557 | (to-address . "~sircmpwn/sr.ht-dev@lists.sr.ht") |
1558 | (to-list . "~sircmpwn/sr.ht-dev@lists.sr.ht")) | |
cb4015f6 | 1559 | ("l\\.~sircmpwn\\.srht-discuss" |
41d290a2 AB |
1560 | (to-address . "~sircmpwn/sr.ht-discuss@lists.sr.ht") |
1561 | (to-list . "~sircmpwn/sr.ht-discuss@lists.sr.ht")) | |
74fd778e AB |
1562 | ("webmasters" |
1563 | (to-address . "webmasters@gnu.org") | |
1564 | (to-list . "webmasters@gnu.org")) | |
41d290a2 AB |
1565 | ("gnu.*" |
1566 | (gcc-self . t)) | |
205cc04b | 1567 | ("l\\." |
262483ba AB |
1568 | (subscribed . t)) |
1569 | ("nnimap\\+uw:.*" | |
1570 | (gcc-self . t))) | |
41d290a2 | 1571 | gnus-large-newsgroup 50 |
dca50cf5 | 1572 | gnus-home-directory (b/var "gnus/") |
41d290a2 AB |
1573 | gnus-directory (concat gnus-home-directory "news/") |
1574 | message-directory (concat gnus-home-directory "mail/") | |
1575 | nndraft-directory (concat gnus-home-directory "drafts/") | |
1576 | gnus-save-newsrc-file nil | |
1577 | gnus-read-newsrc-file nil | |
1578 | gnus-interactive-exit nil | |
1579 | gnus-gcc-mark-as-read t) | |
1580 | :config | |
f02d2b28 | 1581 | (when (version< emacs-version "27") |
47904cb7 AB |
1582 | (with-eval-after-load 'nnmail |
1583 | (add-to-list | |
1584 | 'nnmail-split-abbrev-alist | |
1585 | '(list . "list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop") | |
1586 | t))) | |
f02d2b28 | 1587 | |
29e42dc1 | 1588 | ;; (gnus-registry-initialize) |
7f88c321 | 1589 | |
41d290a2 AB |
1590 | (with-eval-after-load 'recentf |
1591 | (add-to-list 'recentf-exclude gnus-home-directory))) | |
1592 | ||
47904cb7 | 1593 | (use-package gnus-art |
41d290a2 AB |
1594 | :config |
1595 | (setq | |
7e1cad06 | 1596 | gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)") |
e1f6f6a2 AB |
1597 | gnus-sorted-header-list '("^From:" |
1598 | "^X-RT-Originator" | |
1599 | "^Newsgroups:" | |
1600 | "^Subject:" | |
1601 | "^Date:" | |
1602 | "^Envelope-To:" | |
1603 | "^Followup-To:" | |
1604 | "^Reply-To:" | |
1605 | "^Organization:" | |
1606 | "^Summary:" | |
1607 | "^Abstract:" | |
1608 | "^Keywords:" | |
1609 | "^To:" | |
1610 | "^[BGF]?Cc:" | |
1611 | "^Posted-To:" | |
1612 | "^Mail-Copies-To:" | |
1613 | "^Mail-Followup-To:" | |
1614 | "^Apparently-To:" | |
1615 | "^Resent-From:" | |
1616 | "^User-Agent:" | |
1617 | "^X-detected-operating-system:" | |
1618 | "^Message-ID:" | |
c247fbc8 | 1619 | ;; "^References:" |
e1f6f6a2 AB |
1620 | "^List-Id:" |
1621 | "^Gnus-Warning:") | |
1622 | gnus-visible-headers (mapconcat 'identity | |
1623 | gnus-sorted-header-list | |
1624 | "\\|") | |
41d290a2 AB |
1625 | ;; local-lapsed article dates |
1626 | ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11 | |
1627 | gnus-article-date-headers '(user-defined) | |
1628 | gnus-article-time-format | |
1629 | (lambda (time) | |
1630 | (let* ((date (format-time-string "%a, %d %b %Y %T %z" time)) | |
1631 | (local (article-make-date-line date 'local)) | |
1632 | (combined-lapsed (article-make-date-line date | |
1633 | 'combined-lapsed)) | |
1634 | (lapsed (progn | |
1635 | (string-match " (.+" combined-lapsed) | |
1636 | (match-string 0 combined-lapsed)))) | |
1637 | (concat local lapsed)))) | |
1638 | (bind-keys | |
1639 | :map gnus-article-mode-map | |
1640 | ("M-L" . org-store-link))) | |
1641 | ||
47904cb7 | 1642 | (use-package gnus-sum |
41d290a2 | 1643 | :bind (:map gnus-summary-mode-map |
dca50cf5 | 1644 | :prefix-map b/gnus-summary-prefix-map |
41d290a2 AB |
1645 | :prefix "v" |
1646 | ("r" . gnus-summary-reply) | |
1647 | ("w" . gnus-summary-wide-reply) | |
1648 | ("v" . gnus-summary-show-raw-article)) | |
1649 | :config | |
1650 | (bind-keys | |
1651 | :map gnus-summary-mode-map | |
1652 | ("M-L" . org-store-link)) | |
1bd1c701 AB |
1653 | :hook (gnus-summary-mode . b/no-mouse-autoselect-window) |
1654 | :custom | |
1655 | (gnus-thread-sort-functions '(gnus-thread-sort-by-number | |
1656 | gnus-thread-sort-by-subject | |
1657 | gnus-thread-sort-by-date))) | |
41d290a2 | 1658 | |
47904cb7 | 1659 | (use-package gnus-msg |
41d290a2 | 1660 | :config |
639bdc53 AB |
1661 | (defvar b/shemshak-signature "Amin Bandali |
1662 | https://shemshak.org/~amin") | |
dca50cf5 | 1663 | (defvar b/uw-signature "Amin Bandali, MMath Student |
4d19e255 | 1664 | Cheriton School of Computer Science |
e0e5275d | 1665 | University of Waterloo |
5b740018 | 1666 | https://bandali.eu.org") |
dca50cf5 | 1667 | (defvar b/csc-signature "Amin Bandali |
7f8a1011 | 1668 | System Administrator, Systems Committee |
dc12958b AB |
1669 | Computer Science Club, University of Waterloo |
1670 | https://csclub.uwaterloo.ca/~abandali") | |
e9abd82c AB |
1671 | (setq gnus-message-replysign t |
1672 | gnus-posting-styles | |
41d290a2 | 1673 | '((".*" |
33b1a7ea | 1674 | (address "bandali@gnu.org")) |
639bdc53 AB |
1675 | ("nnimap\\+gnu:l\\..*" |
1676 | (signature nil)) | |
466bb3e0 AB |
1677 | ("nnimap\\+gnu:.*" |
1678 | (organization "GNU")) | |
639bdc53 AB |
1679 | ((header "subject" "ThankCRM") |
1680 | (to "webmasters-comment@gnu.org") | |
1681 | (body "") | |
1682 | (eval (setq b/message-cite-say-hi nil))) | |
95ec8c25 | 1683 | ("nnimap\\+shemshak:.*" |
4ed3a945 | 1684 | (address "amin@shemshak.org") |
41d290a2 | 1685 | (body "\nBest,\n") |
639bdc53 | 1686 | (signature b/shemshak-signature) |
95ec8c25 | 1687 | (gcc "nnimap+shemshak:Sent") |
dca50cf5 | 1688 | (eval (setq b/message-cite-say-hi t))) |
63c1969d | 1689 | ("nnimap\\+uw:.*" |
e7125caf | 1690 | (address "bandali@uwaterloo.ca") |
639bdc53 | 1691 | (body "\nBest,\n") |
dca50cf5 | 1692 | (signature b/uw-signature)) |
262483ba | 1693 | ("nnimap\\+uw:INBOX" |
63c1969d AB |
1694 | (gcc "\"nnimap+uw:Sent Items\"")) |
1695 | ("nnimap\\+csc:.*" | |
e93437ba | 1696 | (address "bandali@csclub.uwaterloo.ca") |
dca50cf5 | 1697 | (signature b/csc-signature) |
0567bcba | 1698 | (gcc "nnimap+csc:Sent")))) |
bfda730d AB |
1699 | :hook (gnus-message-setup . (lambda () |
1700 | (unless (mml-secure-is-encrypted-p) | |
1701 | (mml-secure-message-sign))))) | |
41d290a2 | 1702 | |
47904cb7 | 1703 | (use-package gnus-topic |
41d290a2 AB |
1704 | :hook (gnus-group-mode . gnus-topic-mode) |
1705 | :config (setq gnus-topic-line-format "%i[ %A: %(%{%n%}%) ]%v\n")) | |
1706 | ||
47904cb7 | 1707 | (use-package gnus-agent |
41d290a2 AB |
1708 | :config |
1709 | (setq gnus-agent-synchronize-flags 'ask) | |
1710 | :hook (gnus-group-mode . gnus-agent-mode)) | |
1711 | ||
47904cb7 | 1712 | (use-package gnus-group |
41d290a2 AB |
1713 | :config |
1714 | (setq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)")) | |
1715 | ||
082360a8 AB |
1716 | (comment |
1717 | ;; problematic with ebdb's popup, *EBDB-Gnus* | |
47904cb7 | 1718 | (use-package gnus-win |
082360a8 AB |
1719 | :config |
1720 | (setq gnus-use-full-window nil))) | |
f485f78e | 1721 | |
47904cb7 | 1722 | (use-package gnus-dired |
348511ef AB |
1723 | :commands gnus-dired-mode |
1724 | :init | |
1725 | (add-hook 'dired-mode-hook 'gnus-dired-mode)) | |
1726 | ||
6ca3a7b1 | 1727 | (comment |
47904cb7 | 1728 | (use-package gnus-utils |
6ca3a7b1 AB |
1729 | :custom |
1730 | (gnus-completing-read-function 'gnus-ido-completing-read))) | |
6eb104ff | 1731 | |
47904cb7 | 1732 | (use-package mm-decode |
41d290a2 | 1733 | :config |
7e1cad06 AB |
1734 | (setq mm-discouraged-alternatives '("text/html" "text/richtext") |
1735 | mm-decrypt-option 'known | |
1736 | mm-verify-option 'known)) | |
41d290a2 | 1737 | |
47904cb7 | 1738 | (use-package mm-uu |
bb00c3f9 | 1739 | :config |
946188e1 AB |
1740 | (when (version< "27" emacs-version) |
1741 | (set-face-attribute 'mm-uu-extract nil :extend t)) | |
1fe01703 AB |
1742 | :custom |
1743 | (mm-uu-diff-groups-regexp | |
1744 | "\\(gmane\\|gnu\\|l\\)\\..*\\(diff\\|commit\\|cvs\\|bug\\|dev\\)")) | |
1745 | ||
47904cb7 | 1746 | (use-package sendmail |
41d290a2 | 1747 | :config |
8f8d4c32 | 1748 | (setq sendmail-program (executable-find "msmtp") |
41d290a2 AB |
1749 | ;; message-sendmail-extra-arguments '("-v" "-d") |
1750 | mail-specify-envelope-from t | |
1751 | mail-envelope-from 'header)) | |
1752 | ||
47904cb7 | 1753 | (use-package message |
bc2f85e1 | 1754 | :bind (:map message-mode-map ("<C-return>" . b/insert-asterism)) |
41d290a2 AB |
1755 | :config |
1756 | ;; redefine for a simplified In-Reply-To header | |
1757 | ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67) | |
1758 | (defun message-make-in-reply-to () | |
1759 | "Return the In-Reply-To header for this message." | |
1760 | (when message-reply-headers | |
1761 | (let ((from (mail-header-from message-reply-headers)) | |
63102057 | 1762 | (msg-id (mail-header-id message-reply-headers))) |
41d290a2 AB |
1763 | (when from |
1764 | msg-id)))) | |
1765 | ||
dca50cf5 | 1766 | (defconst b/message-cite-style-format "On %Y-%m-%d %l:%M %p, %N wrote:") |
41d290a2 AB |
1767 | (defconst message-cite-style-bandali |
1768 | '((message-cite-function 'message-cite-original) | |
1769 | (message-citation-line-function 'message-insert-formatted-citation-line) | |
1770 | (message-cite-reply-position 'traditional) | |
1771 | (message-yank-prefix "> ") | |
1772 | (message-yank-cited-prefix ">") | |
1773 | (message-yank-empty-prefix ">") | |
1774 | (message-citation-line-format | |
dca50cf5 AB |
1775 | (if b/message-cite-say-hi |
1776 | (concat "Hi %F,\n\n" b/message-cite-style-format) | |
1777 | b/message-cite-style-format))) | |
41d290a2 AB |
1778 | "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.") |
1779 | (setq ;; message-cite-style 'message-cite-style-bandali | |
1780 | message-kill-buffer-on-exit t | |
1781 | message-send-mail-function 'message-send-mail-with-sendmail | |
1782 | message-sendmail-envelope-from 'header | |
1783 | message-subscribed-address-functions | |
1784 | '(gnus-find-subscribed-addresses) | |
1785 | message-dont-reply-to-names | |
0a929da7 | 1786 | "\\(\\(amin@shemshak\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca\\)\\)") |
6eb104ff | 1787 | ;; (require 'company-ebdb) |
41d290a2 AB |
1788 | :hook (;; (message-setup . mml-secure-message-sign-pgpmime) |
1789 | (message-mode . flyspell-mode) | |
1790 | (message-mode . (lambda () | |
a1e77a3d AB |
1791 | ;; (setq-local fill-column b/fill-column |
1792 | ;; message-fill-column b/fill-column) | |
41d290a2 AB |
1793 | (make-local-variable 'company-idle-delay) |
1794 | (setq company-idle-delay 0.2)))) | |
1795 | ;; :custom-face | |
1796 | ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold)))) | |
1797 | ;; (message-header-to ((t (:foreground "#111" :weight normal)))) | |
1798 | ;; (message-header-cc ((t (:foreground "#333" :weight normal)))) | |
db1cc59c AB |
1799 | :custom |
1800 | (message-elide-ellipsis "[...]\n")) | |
41d290a2 | 1801 | |
47904cb7 | 1802 | (use-package mml) |
54209e74 | 1803 | |
47904cb7 | 1804 | (use-package mml-sec |
54209e74 AB |
1805 | :custom |
1806 | (mml-secure-openpgp-encrypt-to-self t) | |
1807 | (mml-secure-openpgp-sign-with-sender t)) | |
41d290a2 | 1808 | |
47904cb7 | 1809 | (use-package footnote |
41d290a2 AB |
1810 | :after message |
1811 | ;; :config | |
1812 | ;; (setq footnote-start-tag "" | |
1813 | ;; footnote-end-tag "" | |
1814 | ;; footnote-style 'unicode) | |
1815 | :bind | |
1816 | (:map message-mode-map | |
dca50cf5 | 1817 | :prefix-map b/footnote-prefix-map |
7cc51891 | 1818 | :prefix "C-c f n" |
41d290a2 AB |
1819 | ("a" . footnote-add-footnote) |
1820 | ("b" . footnote-back-to-message) | |
1821 | ("c" . footnote-cycle-style) | |
1822 | ("d" . footnote-delete-footnote) | |
1823 | ("g" . footnote-goto-footnote) | |
1824 | ("r" . footnote-renumber-footnotes) | |
1825 | ("s" . footnote-set-style))) | |
1826 | ||
d6cdd1fd AB |
1827 | (use-package ebdb |
1828 | :demand | |
1829 | :after gnus | |
1830 | :bind (:map gnus-group-mode-map ("e" . ebdb)) | |
1831 | :config | |
1832 | (setq ebdb-sources (b/var "ebdb")) | |
1833 | (with-eval-after-load 'swiper | |
1834 | (add-to-list 'swiper-font-lock-exclude 'ebdb-mode t))) | |
41d290a2 | 1835 | |
47904cb7 | 1836 | (use-package ebdb-com |
d6cdd1fd | 1837 | :after ebdb) |
6eb104ff | 1838 | |
47904cb7 | 1839 | (use-package ebdb-complete |
d6cdd1fd AB |
1840 | :after ebdb |
1841 | :config | |
1842 | ;; (setq ebdb-complete-mail 'capf) | |
1843 | (ebdb-complete-enable)) | |
6eb104ff | 1844 | |
47904cb7 | 1845 | (use-package ebdb-message |
d6cdd1fd AB |
1846 | :demand |
1847 | :after ebdb) | |
41d290a2 | 1848 | |
d6cdd1fd AB |
1849 | ;; (use-package company-ebdb |
1850 | ;; :config | |
1851 | ;; (defun company-ebdb--post-complete (_) nil)) | |
5b10d879 | 1852 | |
47904cb7 | 1853 | (use-package ebdb-gnus |
d6cdd1fd AB |
1854 | :after ebdb |
1855 | :custom | |
1856 | (ebdb-gnus-window-size 0.3)) | |
41d290a2 | 1857 | |
47904cb7 | 1858 | (use-package ebdb-mua |
d6cdd1fd AB |
1859 | :demand |
1860 | :after ebdb | |
1861 | :custom (ebdb-mua-pop-up t)) | |
fa3741c7 | 1862 | |
d6cdd1fd AB |
1863 | ;; (use-package ebdb-message |
1864 | ;; :after ebdb) | |
41d290a2 | 1865 | |
d6cdd1fd AB |
1866 | ;; (use-package ebdb-vcard |
1867 | ;; :after ebdb) | |
41d290a2 | 1868 | |
5b10d879 | 1869 | (use-package message-x) |
41d290a2 | 1870 | |
b57457b2 AB |
1871 | (comment |
1872 | (use-package message-x | |
1873 | :custom | |
1874 | (message-x-completion-alist | |
1875 | (quote | |
1876 | (("\\([rR]esent-\\|[rR]eply-\\)?[tT]o:\\|[bB]?[cC][cC]:" . gnus-harvest-find-address) | |
1877 | ((if | |
1878 | (boundp | |
1879 | (quote message-newgroups-header-regexp)) | |
1880 | message-newgroups-header-regexp message-newsgroups-header-regexp) | |
1881 | . message-expand-group)))))) | |
1882 | ||
1883 | (comment | |
1884 | (use-package gnus-harvest | |
1885 | :commands gnus-harvest-install | |
1886 | :demand t | |
1887 | :config | |
1888 | (if (featurep 'message-x) | |
1889 | (gnus-harvest-install 'message-x) | |
1890 | (gnus-harvest-install)))) | |
1891 | ||
47904cb7 | 1892 | (use-package gnus-article-treat-patch |
a5cf4300 AB |
1893 | :disabled |
1894 | :demand | |
1895 | :load-path "lisp/" | |
1896 | :config | |
35684c66 AB |
1897 | ;; note: be sure to customize faces with `:foreground "white"' when |
1898 | ;; using a theme with a white/light background :) | |
a5cf4300 AB |
1899 | (setq ft/gnus-article-patch-conditions |
1900 | '("^@@ -[0-9]+,[0-9]+ \\+[0-9]+,[0-9]+ @@"))) | |
1901 | ||
b57457b2 | 1902 | \f |
e3e5e846 | 1903 | ;;; IRC (with ERC and ZNC) |
b57457b2 | 1904 | |
47904cb7 | 1905 | (use-package erc |
e38333d9 | 1906 | :bind (("C-c b b" . erc-switch-to-buffer) |
96840c88 AB |
1907 | :map erc-mode-map |
1908 | ("M-a" . erc-track-switch-buffer)) | |
1909 | :custom | |
96840c88 AB |
1910 | (erc-join-buffer 'bury) |
1911 | (erc-lurker-hide-list '("JOIN" "PART" "QUIT")) | |
1912 | (erc-nick "bandali") | |
4d5a11b3 | 1913 | (erc-prompt "erc>") |
96840c88 AB |
1914 | (erc-rename-buffers t) |
1915 | (erc-server-reconnect-attempts 5) | |
1916 | (erc-server-reconnect-timeout 3) | |
96840c88 | 1917 | :config |
96840c88 AB |
1918 | (defun erc-cmd-OPME () |
1919 | "Request chanserv to op me." | |
1920 | (erc-message "PRIVMSG" | |
1921 | (format "chanserv op %s %s" | |
1922 | (erc-default-target) | |
1923 | (erc-current-nick)) nil)) | |
1924 | (defun erc-cmd-DEOPME () | |
1925 | "Deop myself from current channel." | |
1926 | (erc-cmd-DEOP (format "%s" (erc-current-nick)))) | |
1927 | (add-to-list 'erc-modules 'keep-place) | |
1928 | (add-to-list 'erc-modules 'notifications) | |
b7d4b4b3 | 1929 | (add-to-list 'erc-modules 'smiley) |
96840c88 | 1930 | (add-to-list 'erc-modules 'spelling) |
5b10d879 | 1931 | (add-to-list 'erc-modules 'scrolltoplace) |
cb058d21 | 1932 | (erc-update-modules)) |
96840c88 | 1933 | |
47904cb7 | 1934 | (use-package erc-fill |
e3e5e846 AB |
1935 | :after erc |
1936 | :custom | |
92df6c4f | 1937 | (erc-fill-column 77) |
e3e5e846 AB |
1938 | (erc-fill-function 'erc-fill-static) |
1939 | (erc-fill-static-center 18)) | |
1940 | ||
47904cb7 | 1941 | (use-package erc-pcomplete |
e3e5e846 AB |
1942 | :after erc |
1943 | :custom | |
0562e97e | 1944 | (erc-pcomplete-nick-postfix ", ")) |
e3e5e846 | 1945 | |
47904cb7 | 1946 | (use-package erc-track |
e3e5e846 | 1947 | :after erc |
2e81c51a AB |
1948 | :bind (("C-c a e t d" . erc-track-disable) |
1949 | ("C-c a e t e" . erc-track-enable)) | |
e3e5e846 | 1950 | :custom |
2384d161 | 1951 | (erc-track-enable-keybindings nil) |
e3e5e846 AB |
1952 | (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT" |
1953 | "324" "329" "332" "333" "353" "477")) | |
7ac2eb50 | 1954 | (erc-track-position-in-mode-line t) |
e3e5e846 AB |
1955 | (erc-track-priority-faces-only 'all) |
1956 | (erc-track-shorten-function nil)) | |
1957 | ||
96840c88 AB |
1958 | (use-package erc-hl-nicks |
1959 | :after erc) | |
1960 | ||
5b10d879 AB |
1961 | (use-package erc-scrolltoplace |
1962 | :after erc) | |
96840c88 | 1963 | |
925481f2 AB |
1964 | (use-package znc |
1965 | :bind (("C-c a e e" . znc-erc) | |
1966 | ("C-c a e a" . znc-all)) | |
1967 | :config | |
1968 | (let ((pwd (let ((auth (auth-source-search :host "znca"))) | |
1969 | (cond | |
1970 | ((null auth) (error "Couldn't find znca's authinfo")) | |
1971 | (t (funcall (plist-get (car auth) :secret))))))) | |
1972 | (setq znc-servers | |
1973 | `(("znc.shemshak.org" 1337 t | |
1974 | ((freenode "amin/freenode" ,pwd))) | |
925481f2 AB |
1975 | ("znc.shemshak.org" 1337 t |
1976 | ((oftc "amin/oftc" ,pwd))))))) | |
41d290a2 | 1977 | |
b57457b2 AB |
1978 | \f |
1979 | ;;; Post initialization | |
1980 | ||
8b1a2f32 | 1981 | ) |
41d290a2 AB |
1982 | (message "Loading %s...done (%.3fs)" user-init-file |
1983 | (float-time (time-subtract (current-time) | |
dca50cf5 | 1984 | b/before-user-init-time))) |
41d290a2 AB |
1985 | |
1986 | ;;; init.el ends here |