emacs: smart-mode-line: don't make fixed-width fills
[~bandali/configs] / .emacs.d / init.el
CommitLineData
6283c91e 1;;; init.el --- mab's emacs configuration -*- lexical-binding: t -*-
41d290a2 2
6283c91e 3;; Copyright (C) 2018-2019 Amin Bandali <mab@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
b5d27509 20;; Emacs configuration of Amin Bandali, computer scientist, free
47904cb7
AB
21;; software activist, GNU maintainer & webmaster. Packages are
22;; installed from GNU Guix, for purely functional and fully
23;; reproducible package management. Before switching to GNU Guix,
24;; I used straight.el for package management, and before that, Borg.
b57457b2
AB
25
26;; Over the years, I've taken inspiration from configurations of many
27;; great people. Some that I can remember off the top of my head are:
28;;
29;; - https://github.com/dieggsy/dotfiles
30;; - https://github.com/dakra/dmacs
31;; - http://pages.sachachua.com/.emacs.d/Sacha.html
32;; - https://github.com/dakrone/eos
33;; - http://doc.rix.si/cce/cce.html
34;; - https://github.com/jwiegley/dot-emacs
35;; - https://github.com/wasamasa/dotemacs
36;; - https://github.com/hlissner/doom-emacs
41d290a2 37
49e9503b
AB
38;;; Code:
39
b57457b2
AB
40;;; Emacs initialization
41
dca50cf5 42(defvar b/before-user-init-time (current-time)
41d290a2 43 "Value of `current-time' when Emacs begins loading `user-init-file'.")
83364e5b
AB
44(defvar b/emacs-initialized nil
45 "Whether Emacs has been initialized.")
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)
41d290a2
AB
58(setq gc-cons-threshold (* 400 1024 1024) ; 400 MiB
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
dca50cf5
AB
70 file-name-handler-alist b/file-name-handler-alist))
71(add-hook 'after-init-hook #'b/post-init)
41d290a2 72
b57457b2 73;; increase number of lines kept in *Messages* log
41d290a2
AB
74(setq message-log-max 20000)
75
b57457b2
AB
76;; optionally, uncomment to supress some byte-compiler warnings
77;; (see C-h v byte-compile-warnings RET for more info)
41d290a2
AB
78;; (setq byte-compile-warnings
79;; '(not free-vars unresolved noruntime lexical make-local))
80
b57457b2
AB
81\f
82;;; whoami
83
41d290a2 84(setq user-full-name "Amin Bandali"
6283c91e 85 user-mail-address "mab@gnu.org")
41d290a2 86
b57457b2
AB
87\f
88;;; comment macro
89
90;; useful for commenting out multiple sexps at a time
91(defmacro comment (&rest _)
92 "Comment out one or more s-expressions."
93 (declare (indent defun))
94 nil)
95
96\f
33273849
AB
97;;; Package management
98
47904cb7
AB
99;; No package.el (for emacs 26 and before)
100(when (version< emacs-version "27")
33273849
AB
101 (setq package-enable-at-startup nil)
102 ;; (package-initialize)
103 )
33273849
AB
104;; for emacs 27 and later, we use early-init.el. see
105;; https://git.savannah.gnu.org/cgit/emacs.git/commit/?id=24acb31c04b4048b85311d794e600ecd7ce60d3b
106
33273849
AB
107
108;; use-package
41d290a2
AB
109(if nil ; set to t when need to debug init
110 (progn
111 (setq use-package-verbose t
112 use-package-expand-minimally nil
113 use-package-compute-statistics t
114 debug-on-error t)
115 (require 'use-package))
116 (setq use-package-verbose nil
117 use-package-expand-minimally t))
118
119(setq use-package-always-defer t)
120(require 'bind-key)
121
b57457b2
AB
122\f
123;;; Initial setup
124
c21be729 125(defvar b/exwm-p (string= (system-name) "chaman")
e6c67861
AB
126 "Whether or not we will be using `exwm'.")
127
b57457b2 128;; keep ~/.emacs.d clean
1060413b
AB
129(use-package no-littering
130 :demand
131 :config
132 (defalias 'b/etc 'no-littering-expand-etc-file-name)
133 (defalias 'b/var 'no-littering-expand-var-file-name))
41d290a2 134
b57457b2 135;; separate custom file (don't want it mixing with init.el)
47904cb7 136(use-package custom
60ff805e 137 :no-require
41d290a2 138 :config
dca50cf5 139 (setq custom-file (b/etc "custom.el"))
41d290a2
AB
140 (when (file-exists-p custom-file)
141 (load custom-file))
b57457b2 142 ;; while at it, treat themes as safe
60ff805e
AB
143 (setf custom-safe-themes t)
144 ;; only one custom theme at a time
145 (comment
146 (defadvice load-theme (before clear-previous-themes activate)
147 "Clear existing theme settings instead of layering them"
148 (mapc #'disable-theme custom-enabled-themes))))
41d290a2 149
b57457b2 150;; load the secrets file if it exists, otherwise show a warning
dca50cf5
AB
151(comment
152 (with-demoted-errors
153 (load (b/etc "secrets"))))
41d290a2 154
b57457b2 155;; better $PATH (and other environment variable) handling
41d290a2
AB
156(use-package exec-path-from-shell
157 :defer 0.4
158 :init
159 (setq exec-path-from-shell-arguments nil
160 exec-path-from-shell-check-startup-files nil)
161 :config
162 (exec-path-from-shell-initialize)
163 ;; while we're at it, let's fix access to our running ssh-agent
164 (exec-path-from-shell-copy-env "SSH_AGENT_PID")
9ed5410e
AB
165 (exec-path-from-shell-copy-env "SSH_AUTH_SOCK")
166 (exec-path-from-shell-copy-env "XDG_DOWNLOAD_DIR"))
41d290a2 167
b57457b2
AB
168;; start up emacs server. see
169;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server
47904cb7 170(use-package server
41d290a2
AB
171 :defer 0.4
172 :config (or (server-running-p) (server-mode)))
173
60ff805e
AB
174\f
175;;; Useful utilities
176
177;; useful libraries
178(require 'cl-lib)
179(require 'subr-x)
180
181(defmacro b/setq-every (value &rest vars)
182 "Set all the variables from VARS to value VALUE."
183 (declare (indent defun) (debug t))
184 `(progn ,@(mapcar (lambda (x) (list 'setq x value)) vars)))
185
186(defun b/start-process (program &rest args)
187 "Same as `start-process', but doesn't bother about name and buffer."
188 (let ((process-name (concat program "_process"))
189 (buffer-name (generate-new-buffer-name
190 (concat program "_output"))))
191 (apply #'start-process
192 process-name buffer-name program args)))
193
194(defun b/dired-start-process (program &optional args)
195 "Open current file with a PROGRAM."
196 ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
197 ;; be nil, so remove it).
198 (apply #'b/start-process
199 program
200 (remove nil (list args (dired-get-file-for-visit)))))
201
202(defun b/add-elisp-section ()
203 (interactive)
204 (insert "\n")
205 (previous-line)
206 (insert "\n\f\n;;; "))
207
a1e77a3d
AB
208;; (defvar b/fill-column 47
209;; "My custom `fill-column'.")
3214b7ca
AB
210
211(defconst b/asterism "* * *")
212
bc2f85e1 213(defun b/insert-asterism ()
3214b7ca 214 "Insert a centred asterism."
bc2f85e1 215 (interactive)
3214b7ca
AB
216 (insert
217 (concat
218 "\n\n"
a1e77a3d 219 (make-string (floor (/ (- fill-column (length b/asterism)) 2))
3214b7ca
AB
220 ?\s)
221 b/asterism
222 "\n\n")))
bc2f85e1 223
60ff805e
AB
224(defun b/no-mouse-autoselect-window ()
225 "Conveniently disable `focus-follows-mouse'.
226For disabling the behaviour for certain buffers and/or modes."
227 (make-local-variable 'mouse-autoselect-window)
228 (setq mouse-autoselect-window nil))
229
a5cc22f4
AB
230(defun b/kill-current-buffer ()
231 "Kill the current buffer."
232 ;; also see https://redd.it/64xb3q
233 (interactive)
234 (kill-buffer (current-buffer)))
235
60ff805e
AB
236\f
237;;; Defaults
238
239;;;; C-level customizations
240
241(setq
242 ;; minibuffer
243 enable-recursive-minibuffers t
244 resize-mini-windows t
245 ;; more useful frame titles
246 frame-title-format '("" invocation-name " - "
247 (:eval
248 (if (buffer-file-name)
249 (abbreviate-file-name (buffer-file-name))
250 "%b")))
251 ;; i don't feel like jumping out of my chair every now and again; so
252 ;; don't BEEP! at me, emacs
253 ring-bell-function 'ignore
254 ;; better scrolling
255 ;; scroll-margin 1
256 ;; scroll-conservatively 10000
257 scroll-step 1
258 scroll-conservatively 10
259 scroll-preserve-screen-position 1
260 ;; focus follows mouse
39cc9c96 261 mouse-autoselect-window t)
60ff805e
AB
262
263(setq-default
264 ;; always use space for indentation
265 indent-tabs-mode nil
266 tab-width 4
267 ;; cursor shape
268 cursor-type 'bar)
269
b57457b2
AB
270;; unicode support
271(comment
272 (dolist (ft (fontset-list))
273 (set-fontset-font
274 ft
275 'unicode
276 (font-spec :name "Source Code Pro" :size 14))
277 (set-fontset-font
278 ft
279 'unicode
280 (font-spec :name "DejaVu Sans Mono")
281 nil
282 'append)
283 ;; (set-fontset-font
284 ;; ft
285 ;; 'unicode
286 ;; (font-spec
287 ;; :name "Symbola monospacified for DejaVu Sans Mono")
288 ;; nil
289 ;; 'append)
290 ;; (set-fontset-font
291 ;; ft
292 ;; #x2115 ; ℕ
293 ;; (font-spec :name "DejaVu Sans Mono")
294 ;; nil
295 ;; 'append)
296 (set-fontset-font
297 ft
298 (cons ?Α ?ω)
299 (font-spec :name "DejaVu Sans Mono" :size 14)
300 nil
301 'prepend)))
302
60ff805e 303;;;; Elisp-level customizations
41d290a2 304
47904cb7 305(use-package startup
60ff805e
AB
306 :no-require
307 :demand
41d290a2 308 :config
60ff805e
AB
309 ;; don't need to see the startup echo area message
310 (advice-add #'display-startup-echo-area-message :override #'ignore)
311 :custom
312 ;; i want *scratch* as my startup buffer
313 (initial-buffer-choice t)
314 ;; i don't need the default hint
315 (initial-scratch-message nil)
316 ;; use customizable text-mode as major mode for *scratch*
2568a634 317 ;; (initial-major-mode 'text-mode)
60ff805e
AB
318 ;; inhibit buffer list when more than 2 files are loaded
319 (inhibit-startup-buffer-menu t)
320 ;; don't need to see the startup screen or echo area message
321 (inhibit-startup-screen t)
322 (inhibit-startup-echo-area-message user-login-name))
41d290a2 323
47904cb7 324(use-package files
60ff805e
AB
325 :no-require
326 :demand
9fc30d4c 327 :custom
60ff805e
AB
328 ;; backups (C-h v make-backup-files RET)
329 (backup-by-copying t)
330 (version-control t)
331 (delete-old-versions t)
41d290a2 332
60ff805e
AB
333 ;; auto-save
334 (auto-save-file-name-transforms
335 `((".*" ,(b/var "auto-save/") t)))
41d290a2 336
60ff805e
AB
337 ;; insert newline at the end of files
338 (require-final-newline t)
b57457b2 339
60ff805e
AB
340 ;; open read-only file buffers in view-mode
341 ;; (enables niceties like `q' for quit)
342 (view-read-only t))
41d290a2 343
60ff805e
AB
344;; disable disabled commands
345(setq disabled-command-function nil)
41d290a2 346
60ff805e
AB
347;; lazy-person-friendly yes/no prompts
348(defalias 'yes-or-no-p #'y-or-n-p)
b57457b2 349
60ff805e 350;; enable automatic reloading of changed buffers and files
47904cb7 351(use-package autorevert
60ff805e
AB
352 :demand
353 :config
354 (global-auto-revert-mode 1)
355 :custom
356 (auto-revert-verbose nil)
357 (global-auto-revert-non-file-buffers nil))
b57457b2
AB
358
359;; time and battery in mode-line
47904cb7 360(use-package time
e6c67861 361 :if b/exwm-p
e4902e0b 362 :demand
64938292
AB
363 :config
364 (display-time-mode)
365 :custom
366 (display-time-default-load-average nil)
ad61316b
AB
367 (display-time-format "%a %b %-e, %-l:%M%P")
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
e6c67861 372 :if b/exwm-p
e4902e0b 373 :demand
64938292
AB
374 :config
375 (display-battery-mode)
376 :custom
9dcd3cfe 377 (battery-mode-line-format " %p%% %t"))
b57457b2 378
47904cb7 379(use-package fringe
60ff805e
AB
380 :demand
381 :config
382 ;; smaller fringe
383 ;; (fringe-mode '(3 . 1))
384 (fringe-mode nil))
41d290a2 385
47904cb7 386(use-package winner
60ff805e
AB
387 :demand
388 :config
389 ;; enable winner-mode (C-h f winner-mode RET)
390 (winner-mode 1))
41d290a2 391
47904cb7 392(use-package compile
60ff805e
AB
393 :config
394 ;; don't display *compilation* buffer on success. based on
395 ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
396 ;; instead of the now obsolete `flet'.
dca50cf5 397 (defun b/compilation-finish-function (buffer outstr)
41d290a2
AB
398 (unless (string-match "finished" outstr)
399 (switch-to-buffer-other-window buffer))
400 t)
401
dca50cf5 402 (setq compilation-finish-functions #'b/compilation-finish-function)
41d290a2
AB
403
404 (require 'cl-macs)
405
406 (defadvice compilation-start
407 (around inhibit-display
408 (command &optional mode name-function highlight-regexp))
409 (if (not (string-match "^\\(find\\|grep\\)" command))
410 (cl-letf (((symbol-function 'display-buffer) #'ignore))
411 (save-window-excursion ad-do-it))
412 ad-do-it))
413 (ad-activate 'compilation-start))
414
47904cb7 415(use-package isearch
60ff805e
AB
416 :custom
417 ;; allow scrolling in Isearch
418 (isearch-allow-scroll t)
419 ;; search for non-ASCII characters: i’d like non-ASCII characters such
420 ;; as ‘’“”«»‹›áⓐ𝒶 to be selected when i search for their ASCII
421 ;; counterpart. shoutout to
422 ;; http://endlessparentheses.com/new-in-emacs-25-1-easily-search-non-ascii-characters.html
423 (search-default-mode #'char-fold-to-regexp))
424
425;; uncomment to extend the above behaviour to query-replace
426(comment
47904cb7 427 (use-package replace
60ff805e
AB
428 :custom
429 (replace-char-fold t)))
b9901074 430
47904cb7 431(use-package vc
b1a5d811
AB
432 :bind ("C-x v C-=" . vc-ediff))
433
47904cb7 434(use-package vc-git
e59c8878
AB
435 :after vc
436 :custom
437 (vc-git-print-log-follow t))
438
47904cb7 439(use-package ediff
b1a5d811
AB
440 :config (add-hook 'ediff-after-quit-hook-internal 'winner-undo)
441 :custom ((ediff-window-setup-function 'ediff-setup-windows-plain)
442 (ediff-split-window-function 'split-window-horizontally)))
443
47904cb7 444(use-package face-remap
60ff805e
AB
445 :custom
446 ;; gentler font resizing
447 (text-scale-mode-step 1.05))
448
47904cb7 449(use-package mwheel
60ff805e
AB
450 :defer 0.4
451 :config
452 (setq mouse-wheel-scroll-amount '(1 ((shift) . 1)) ; one line at a time
453 mouse-wheel-progressive-speed nil ; don't accelerate scrolling
454 mouse-wheel-follow-mouse t)) ; scroll window under mouse
455
47904cb7 456(use-package pixel-scroll
60ff805e
AB
457 :defer 0.4
458 :config (pixel-scroll-mode 1))
459
47904cb7 460(use-package epg-config
a89c8bd8
AB
461 :config
462 ;; ask for GPG passphrase in minibuffer
463 ;; this will fail if gpg>=2.1 is not available
464 (if (version< "27" emacs-version)
465 (setq epg-pinentry-mode 'loopback)
466 (setq epa-pinentry-mode 'loopback))
60ff805e 467 :custom
47904cb7 468 (epg-gpg-program (executable-find "gpg")))
1d405cde 469
47904cb7
AB
470(use-package epg
471 :after epg-config)
472
a89c8bd8
AB
473(use-package pinentry
474 :demand
475 :after (epa epg server)
476 :config
477 ;; workaround for systemd-based distros:
478 ;; (setq pinentry--socket-dir server-socket-dir)
479 (pinentry-start))
480
47904cb7 481(use-package auth-source
b98dbb3d
AB
482 :custom
483 (auth-sources '("~/.authinfo.gpg"))
484 (authinfo-hidden (regexp-opt '("password" "client-secret" "token"))))
485
b57457b2
AB
486\f
487;;; General bindings
488
41d290a2
AB
489(bind-keys
490 ("C-c a i" . ielm)
491
492 ("C-c e b" . eval-buffer)
2a816b71 493 ("C-c e e" . eval-last-sexp)
41d290a2
AB
494 ("C-c e r" . eval-region)
495
496 ("C-c e i" . emacs-init-time)
497 ("C-c e u" . emacs-uptime)
dca50cf5 498 ("C-c e v" . emacs-version)
41d290a2
AB
499
500 ("C-c F m" . make-frame-command)
501 ("C-c F d" . delete-frame)
435306f6 502 ("C-c F D" . server-edit)
41d290a2 503
41d290a2
AB
504 ("C-S-h C" . describe-char)
505 ("C-S-h F" . describe-face)
506
a5cc22f4 507 ("C-x k" . b/kill-current-buffer)
41d290a2 508 ("C-x K" . kill-buffer)
2a816b71
AB
509 ("C-x s" . save-buffer)
510 ("C-x S" . save-some-buffers)
41d290a2 511
b57457b2 512 :map emacs-lisp-mode-map
dca50cf5 513 ("<C-return>" . b/add-elisp-section))
41d290a2
AB
514
515(when (display-graphic-p)
516 (unbind-key "C-z" global-map))
517
500004f4
AB
518(bind-keys
519 ;; for back and forward mouse keys
0365678c 520 ("<XF86Back>" . previous-buffer)
500004f4 521 ("<mouse-8>" . previous-buffer)
4bdfe6ab 522 ;; ("<drag-mouse-8>" . previous-buffer)
0365678c 523 ("<XF86Forward>" . next-buffer)
500004f4 524 ("<mouse-9>" . next-buffer)
4bdfe6ab
AB
525 ;; ("<drag-mouse-9>" . next-buffer)
526 ;; ("<drag-mouse-2>" . kill-this-buffer)
527 ;; ("<drag-mouse-3>" . switch-to-buffer)
528 )
500004f4 529
b57457b2
AB
530\f
531;;; Essential packages
532
fcd29183 533(use-package exwm
e6c67861 534 :if b/exwm-p
fcd29183
AB
535 :demand
536 :config
1bfeb417
AB
537 ;; make class name the buffer name, truncating beyond 60 characters
538 (defun b/exwm-rename-buffer ()
fcd29183
AB
539 (interactive)
540 (exwm-workspace-rename-buffer
541 (concat exwm-class-name ":"
319c6483
AB
542 (if (<= (length exwm-title) 60) exwm-title
543 (concat (substring exwm-title 0 59) "...")))))
1bfeb417
AB
544 ;; Enable EXWM
545 (exwm-enable)
546 :hook ((exwm-update-class . b/exwm-rename-buffer)
547 (exwm-update-title . b/exwm-rename-buffer)))
fcd29183 548
47904cb7 549(use-package exwm-config
1bfeb417
AB
550 :demand
551 :after exwm
552 :hook (exwm-init . exwm-config--fix/ido-buffer-window-other-frame))
553
47904cb7 554(use-package exwm-input
1bfeb417 555 :demand
bff00f78 556 :after exwm
1bfeb417 557 :config
212feb20
AB
558 (defun b/exwm-ws-prev-index ()
559 "Return the index for the previous EXWM workspace, wrapping
560around if needed."
561 (if (= exwm-workspace-current-index 0)
562 (1- exwm-workspace-number)
563 (1- exwm-workspace-current-index)))
564
565 (defun b/exwm-ws-next-index ()
566 "Return the index for the next EXWM workspace, wrapping
567around if needed."
568 (if (= exwm-workspace-current-index
569 (1- exwm-workspace-number))
570 0
571 (1+ exwm-workspace-current-index)))
572
1bfeb417 573 ;; shorten 'C-c C-q' to 'C-q'
24e1e73e
AB
574 (define-key exwm-mode-map [?\C-q] #'exwm-input-send-next-key)
575
bff00f78
AB
576 (setq exwm-workspace-number 4
577 exwm-input-global-keys
1bfeb417
AB
578 `(([?\s-R] . exwm-reset)
579 ([?\s-\\] . exwm-workspace-switch)
63ed1869
AB
580 ([?\s-\s] . dmenu)
581 ([?\S-\s-\s] . (lambda (command)
582 (interactive
583 (list (read-shell-command "➜ ")))
584 (start-process-shell-command
585 command nil command)))
1bfeb417
AB
586 ([s-return] . (lambda ()
587 (interactive)
588 (start-process "" nil "urxvt")))
589 ([?\C-\s-\s] . counsel-linux-app)
590 ([?\M-\s-\s] . (lambda ()
591 (interactive)
592 (start-process-shell-command
593 "rofi-pass" nil "rofi-pass")))
d7b88f06
AB
594 ([?\s-h] . windmove-left)
595 ([?\s-j] . windmove-down)
596 ([?\s-k] . windmove-up)
597 ([?\s-l] . windmove-right)
598 ([?\s-H] . windmove-swap-states-left)
599 ([?\s-J] . windmove-swap-states-down)
600 ([?\s-K] . windmove-swap-states-up)
601 ([?\s-L] . windmove-swap-states-right)
602 ([?\M-\s-h] . shrink-window-horizontally)
603 ([?\M-\s-l] . enlarge-window-horizontally)
604 ([?\M-\s-k] . shrink-window)
605 ([?\M-\s-j] . enlarge-window)
1bfeb417
AB
606 ([?\s-\[] . (lambda ()
607 (interactive)
608 (exwm-workspace-switch-create
609 (b/exwm-ws-prev-index))))
610 ([?\s-\]] . (lambda ()
611 (interactive)
612 (exwm-workspace-switch-create
613 (b/exwm-ws-next-index))))
614 ([?\s-{] . (lambda ()
615 (interactive)
616 (exwm-workspace-move-window
617 (b/exwm-ws-prev-index))))
618 ([?\s-}] . (lambda ()
619 (interactive)
620 (exwm-workspace-move-window
621 (b/exwm-ws-next-index))))
622 ,@(mapcar (lambda (i)
623 `(,(kbd (format "s-%d" i)) .
624 (lambda ()
625 (interactive)
626 (exwm-workspace-switch-create ,i))))
627 (number-sequence 0 (1- exwm-workspace-number)))
628 ([?\s-t] . exwm-floating-toggle-floating)
629 ([?\s-f] . exwm-layout-toggle-fullscreen)
e587ce78 630 ([?\s-W] . (lambda ()
1bfeb417
AB
631 (interactive)
632 (kill-buffer (current-buffer))))
e587ce78 633 ([?\s-Q] . (lambda ()
1bfeb417
AB
634 (interactive)
635 (exwm-manage--kill-client)))
636 ([?\s-\'] . (lambda ()
637 (interactive)
638 (start-process-shell-command
639 "rofi-light" nil "rofi-light")))
640 ([XF86AudioMute] .
641 (lambda ()
642 (interactive)
36cc7643 643 (start-process "" nil "amixer" "set" "'Master',0" "toggle")))
1bfeb417
AB
644 ([XF86AudioLowerVolume] .
645 (lambda ()
646 (interactive)
647 (start-process
36cc7643 648 "" nil "amixer" "set" "'Master',0" "5%-")))
1bfeb417
AB
649 ([XF86AudioRaiseVolume] .
650 (lambda ()
651 (interactive)
652 (start-process
36cc7643 653 "" nil "amixer" "set" "'Master',0" "5%+")))
1bfeb417
AB
654 ([XF86AudioPlay] .
655 (lambda ()
656 (interactive)
657 (start-process "" nil "mpc" "toggle")))
658 ([XF86AudioPrev] .
659 (lambda ()
660 (interactive)
661 (start-process "" nil "mpc" "prev")))
662 ([XF86AudioNext] .
663 (lambda ()
664 (interactive)
665 (start-process "" nil "mpc" "next")))
666 ([XF86ScreenSaver] .
667 (lambda ()
668 (interactive)
b94c0e47
AB
669 (start-process "" nil "dm-tool" "lock")))
670 ([\s-XF86Back] . previous-buffer)
671 ([\s-XF86Forward] . next-buffer)))
1bfeb417 672
24e1e73e
AB
673 ;; Line-editing shortcuts
674 (setq exwm-input-simulation-keys
675 '(;; movement
676 ([?\C-b] . [left])
677 ([?\M-b] . [C-left])
678 ([?\C-f] . [right])
679 ([?\M-f] . [C-right])
680 ([?\C-p] . [up])
681 ([?\C-n] . [down])
682 ([?\C-a] . [home])
683 ([?\C-e] . [end])
684 ([?\M-v] . [prior])
685 ([?\C-v] . [next])
686 ([?\C-d] . [delete])
687 ([?\C-k] . [S-end ?\C-x])
1bfeb417
AB
688 ([?\M-<] . C-home)
689 ([?\M->] . C-end)
24e1e73e
AB
690 ;; cut/copy/paste
691 ([?\C-w] . [?\C-x])
692 ([?\M-w] . [?\C-c])
693 ([?\C-y] . [?\C-v])
694 ([?\M-d] . [C-S-right ?\C-x])
695 ([?\M-\d] . [C-S-left ?\C-x])
e587ce78
AB
696 ;; window
697 ([?\s-w] . [?\C-w])
c86b6e8b
AB
698 ([?\s-q] . [?\C-q])
699 ;; misc
700 ([?\C-s] . [?\C-f])
701 ([?\s-s] . [?\C-s])
702 ([?\C-g] . [escape]))))
24e1e73e 703
47904cb7 704(use-package exwm-manage
305e08d6
AB
705 :demand
706 :after exwm
707 :hook
708 (exwm-manage-finish . (lambda ()
709 (when exwm-class-name
710 (cond
0a190676 711 ((string= exwm-class-name "IceCat")
305e08d6
AB
712 (exwm-input-set-local-simulation-keys
713 `(,@exwm-input-simulation-keys
e587ce78 714 ([?\C-\S-d] . [?\C-d]))))
cbe95dea
AB
715 ((string= exwm-class-name "URxvt")
716 (exwm-input-set-local-simulation-keys
717 '(([?\C-c ?\C-c] . [?\C-c])
718 ([?\C-c ?\C-u] . [?\C-u]))))
719 ((string= exwm-class-name "Zathura")
720 (exwm-input-set-local-simulation-keys
721 '(([?\C-p] . [C-up])
722 ([?\C-n] . [C-down])))))))))
305e08d6 723
47904cb7 724(use-package exwm-randr
1bfeb417
AB
725 :demand
726 :after exwm
727 :config
256cef15
AB
728 (exwm-randr-enable)
729 :custom
e6c67861 730 (exwm-randr-workspace-monitor-plist '(1 "VGA-1")))
24e1e73e 731
47904cb7 732(use-package exwm-systemtray
1bfeb417
AB
733 :demand
734 :after exwm
735 :config
736 (exwm-systemtray-enable))
24e1e73e 737
47904cb7 738(use-package exwm-workspace)
fcd29183 739
5a92b319
AB
740(use-package exwm-edit
741 :demand
742 :after exwm)
743
33273849
AB
744;; use the org-plus-contrib package to get the whole deal
745(use-package org-plus-contrib)
746
47904cb7 747(use-package org
41d290a2
AB
748 :defer 0.5
749 :config
750 (setq org-src-tab-acts-natively t
751 org-src-preserve-indentation nil
752 org-edit-src-content-indentation 0
753 org-link-email-description-format "Email %c: %s" ; %.30s
754 org-highlight-latex-and-related '(entities)
755 org-use-speed-commands t
756 org-startup-folded 'content
757 org-catch-invisible-edits 'show-and-error
758 org-log-done 'time)
66ec16e4
AB
759 (when (version< org-version "9.3")
760 (setq org-email-link-description-format
761 org-link-email-description-format))
41d290a2 762 (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t)
506ba717 763 (add-to-list 'org-modules 'org-habit)
41d290a2
AB
764 :bind
765 (("C-c a o a" . org-agenda)
766 :map org-mode-map
767 ("M-L" . org-insert-last-stored-link)
2e81c51a 768 ("M-O" . org-toggle-link-display))
41d290a2
AB
769 :hook ((org-mode . org-indent-mode)
770 (org-mode . auto-fill-mode)
771 (org-mode . flyspell-mode))
772 :custom
561b2e77 773 (org-pretty-entities t)
41d290a2 774 (org-agenda-files '("~/usr/org/todos/personal.org"
506ba717 775 "~/usr/org/todos/habits.org"
561b2e77 776 "~/src/git/masters-thesis/todo.org"))
41d290a2 777 (org-agenda-start-on-weekday 0)
506ba717
AB
778 (org-agenda-time-leading-zero t)
779 (org-habit-graph-column 44)
41d290a2
AB
780 (org-latex-packages-alist '(("" "listings") ("" "color")))
781 :custom-face
782 '(org-block-begin-line ((t (:foreground "#5a5b5a" :background "#1d1f21"))))
783 '(org-block ((t (:background "#1d1f21"))))
784 '(org-latex-and-related ((t (:foreground "#b294bb")))))
785
47904cb7 786(use-package ox-latex
41d290a2
AB
787 :after ox
788 :config
789 (setq org-latex-listings 'listings
790 ;; org-latex-prefer-user-labels t
791 )
792 (add-to-list 'org-latex-classes
793 '("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
794 ("\\section{%s}" . "\\section*{%s}")
795 ("\\subsection{%s}" . "\\subsection*{%s}")
796 ("\\subsubsection{%s}" . "\\subsubsection*{%s}")
797 ("\\paragraph{%s}" . "\\paragraph*{%s}")
798 ("\\subparagraph{%s}" . "\\subparagraph*{%s}"))
799 t)
800 (require 'ox-beamer))
801
47904cb7 802(use-package ox-extra
41d290a2
AB
803 :config
804 (ox-extras-activate '(latex-header-blocks ignore-headlines)))
805
b57457b2
AB
806;; asynchronous tangle, using emacs-async to asynchronously tangle an
807;; org file. closely inspired by
808;; https://github.com/dieggsy/dotfiles/tree/cc10edf7701958eff1cd94d4081da544d882a28c/emacs.d#dotfiles
41d290a2 809(with-eval-after-load 'org
dca50cf5 810 (defvar b/show-async-tangle-results nil
41d290a2
AB
811 "Keep *emacs* async buffers around for later inspection.")
812
dca50cf5 813 (defvar b/show-async-tangle-time nil
41d290a2
AB
814 "Show the time spent tangling the file.")
815
dca50cf5 816 (defun b/async-babel-tangle ()
41d290a2
AB
817 "Tangle org file asynchronously."
818 (interactive)
819 (let* ((file-tangle-start-time (current-time))
820 (file (buffer-file-name))
821 (file-nodir (file-name-nondirectory file))
822 ;; (async-quiet-switch "-q")
823 (file-noext (file-name-sans-extension file)))
824 (async-start
825 `(lambda ()
826 (require 'org)
827 (org-babel-tangle-file ,file))
dca50cf5 828 (unless b/show-async-tangle-results
41d290a2
AB
829 `(lambda (result)
830 (if result
29ea9439
AB
831 (message "Tangled %s%s"
832 ,file-nodir
dca50cf5 833 (if b/show-async-tangle-time
29ea9439
AB
834 (format " (%.3fs)"
835 (float-time (time-subtract (current-time)
836 ',file-tangle-start-time)))
837 ""))
41d290a2
AB
838 (message "Tangling %s failed" ,file-nodir))))))))
839
840(add-to-list
841 'safe-local-variable-values
dca50cf5 842 '(eval add-hook 'after-save-hook #'b/async-babel-tangle 'append 'local))
41d290a2 843
b57457b2 844;; *the* right way to do git
41d290a2
AB
845(use-package magit
846 :defer 0.5
2a816b71
AB
847 :bind (("C-x g" . magit-status)
848 ("C-c g g" . magit-status)
ef6c487c
AB
849 ("C-c g b" . magit-blame-addition)
850 ("C-c g l" . magit-log-buffer-file))
41d290a2
AB
851 :config
852 (magit-add-section-hook 'magit-status-sections-hook
853 'magit-insert-modules
854 'magit-insert-stashes
855 'append)
3b3615f5
AB
856 ;; (magit-add-section-hook 'magit-status-sections-hook
857 ;; 'magit-insert-ignored-files
858 ;; 'magit-insert-untracked-files
859 ;; 'append)
41d290a2 860 (setq magit-repository-directories '(("~/" . 0)
81ea6e55 861 ("~/src/git/" . 2)))
41d290a2
AB
862 (nconc magit-section-initial-visibility-alist
863 '(([unpulled status] . show)
864 ([unpushed status] . show)))
3fffeb0a
AB
865 :custom
866 (magit-diff-refine-hunk t)
867 (magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1)
6ca3a7b1 868 ;; (magit-completing-read-function 'magit-ido-completing-read)
41d290a2
AB
869 :custom-face (magit-diff-file-heading ((t (:weight normal)))))
870
b57457b2 871;; recently opened files
47904cb7 872(use-package recentf
41d290a2 873 :defer 0.2
dca50cf5 874 ;; :config
9424b3d6 875 ;; (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
6eb104ff
AB
876 :config
877 (recentf-mode)
dca50cf5 878 :custom
1060413b 879 (recentf-max-saved-items 2000))
41d290a2 880
b57457b2 881;; smart M-x enhancement (needed by counsel for history)
6eb104ff
AB
882;; (use-package smex)
883
884(bind-keys
885 ("C-c f ." . find-file)
886 ("C-c f l" . find-library)
887 ("C-c f r" . recentf-open-files)
888 ("C-c x" . execute-extended-command))
889
6ca3a7b1 890(comment
47904cb7 891 (use-package ido
6ca3a7b1
AB
892 :demand
893 :bind
894 (:map ido-common-completion-map
895 ([escape] . minibuffer-keyboard-quit)
896 ("DEL" . b/ido-backspace))
897 :config
898 (require 'delsel)
899 (defun b/ido-backspace ()
900 "Forward to `backward-delete-char'. On error (read-only), quit."
901 (interactive)
902 (condition-case nil
903 (backward-delete-char 1)
904 (error
905 (minibuffer-keyboard-quit))))
906 (ido-mode 1)
907 (ido-everywhere 1)
908 :custom
909 (ido-enable-flex-matching t)
910 ;; (ido-enable-regexp t)
911 ;; (ido-enable-prefix t)
912 (ido-max-window-height 10)
913 (ido-use-virtual-buffers t))
914
915 (use-package ido-vertical-mode
916 :defer 0.3
917 :config
918 (ido-vertical-mode 1)
919 :custom
920 (ido-vertical-define-keys 'C-n-C-p-up-and-down)
921 (ido-vertical-show-count t))
6eb104ff 922
6ca3a7b1
AB
923 (use-package ido-completing-read+
924 :defer 0.3
925 :after ido
926 :config
927 (ido-ubiquitous-mode 1))
6eb104ff 928
6ca3a7b1
AB
929 (use-package crm-custom
930 :defer 0.3
931 :config
932 (crm-custom-mode 1))
933
47904cb7 934 (use-package icomplete
6ca3a7b1
AB
935 :defer 0.3
936 :config
937 (icomplete-mode 1)))
6eb104ff
AB
938
939(use-package amx
940 :defer 0.3
941 :config
942 (amx-mode))
943
41d290a2
AB
944(use-package ivy
945 :defer 0.3
946 :bind
947 (:map ivy-minibuffer-map
948 ([escape] . keyboard-escape-quit)
949 ([S-up] . ivy-previous-history-element)
950 ([S-down] . ivy-next-history-element)
951 ("DEL" . ivy-backward-delete-char))
952 :config
953 (setq ivy-wrap t
6ca3a7b1 954 ;; ivy-height 14
41d290a2
AB
955 ivy-use-virtual-buffers t
956 ivy-virtual-abbreviate 'abbreviate
957 ivy-count-format "%d/%d ")
fcd36528
AB
958
959 (defvar b/ivy-ignore-buffer-modes '(magit-mode erc-mode dired-mode))
960 (defun b/ivy-ignore-buffer-p (str)
961 "Return non-nil if str names a buffer with a major mode
962derived from one of `b/ivy-ignore-buffer-modes'.
963
964This function is intended for use with `ivy-ignore-buffers'."
965 (let* ((buf (get-buffer str))
966 (mode (and buf (buffer-local-value 'major-mode buf))))
967 (and mode
968 (apply #'provided-mode-derived-p mode b/ivy-ignore-buffer-modes))))
969 (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
970
41d290a2 971 (ivy-mode 1)
27113bb8 972 :custom-face
295b1b10 973 (ivy-minibuffer-match-face-1 ((t (:background "#eeeeee"))))
27113bb8 974 (ivy-minibuffer-match-face-2 ((t (:background "#e7e7e7" :weight bold))))
295b1b10
AB
975 (ivy-minibuffer-match-face-3 ((t (:background "light goldenrod" :weight semi-bold))))
976 (ivy-minibuffer-match-face-4 ((t (:background "misty rose" :weight semi-bold))))
27113bb8
AB
977 (ivy-current-match ((((class color) (background light))
978 :background "#d7d7d7" :foreground "black")
979 (((class color) (background dark))
980 :background "#65a7e2" :foreground "black"))))
41d290a2
AB
981
982(use-package swiper
6ca3a7b1
AB
983 :demand
984 :after ivy
ab1f4969 985 :bind (("C-S-s" . swiper-isearch)))
41d290a2
AB
986
987(use-package counsel
ab1f4969
AB
988 :demand
989 :after ivy
990 :bind (("C-c f r" . counsel-recentf)
6ca3a7b1 991 :map minibuffer-local-map
ab1f4969 992 ("C-r" . counsel-minibuffer-history))
6ca3a7b1
AB
993 :config
994 (counsel-mode 1)
995 (defalias 'locate #'counsel-locate))
41d290a2 996
b57457b2
AB
997(comment
998 (use-package helm
999 :commands (helm-M-x helm-mini helm-resume)
1000 :bind (("M-x" . helm-M-x)
1001 ("M-y" . helm-show-kill-ring)
1002 ("C-x b" . helm-mini)
1003 ("C-x C-b" . helm-buffers-list)
1004 ("C-x C-f" . helm-find-files)
1005 ("C-h r" . helm-info-emacs)
b57457b2
AB
1006 ("C-s-r" . helm-resume)
1007 :map helm-map
1008 ("<tab>" . helm-execute-persistent-action)
1009 ("C-i" . helm-execute-persistent-action) ; Make TAB work in terminals
1010 ("C-z" . helm-select-action)) ; List actions
1011 :config (helm-mode 1)))
1012
47904cb7 1013(use-package eshell
41d290a2
AB
1014 :defer 0.5
1015 :commands eshell
1016 :bind ("C-c a s e" . eshell)
1017 :config
1018 (eval-when-compile (defvar eshell-prompt-regexp))
dca50cf5 1019 (defun b/eshell-quit-or-delete-char (arg)
41d290a2
AB
1020 (interactive "p")
1021 (if (and (eolp) (looking-back eshell-prompt-regexp nil))
1022 (eshell-life-is-too-much)
1023 (delete-char arg)))
1024
dca50cf5 1025 (defun b/eshell-clear ()
41d290a2
AB
1026 (interactive)
1027 (let ((inhibit-read-only t))
1028 (erase-buffer))
1029 (eshell-send-input))
1030
dca50cf5 1031 (defun b/eshell-setup ()
41d290a2
AB
1032 (make-local-variable 'company-idle-delay)
1033 (defvar company-idle-delay)
1034 (setq company-idle-delay nil)
1035 (bind-keys :map eshell-mode-map
dca50cf5
AB
1036 ("C-d" . b/eshell-quit-or-delete-char)
1037 ("C-S-l" . b/eshell-clear)
41d290a2 1038 ("M-r" . counsel-esh-history)
6eb104ff 1039 ;; ([tab] . company-complete)
946188e1
AB
1040 )
1041 (if (version< "27" emacs-version)
1042 (bind-keys :map eshell-hist-mode-map
1043 ("M-r" . counsel-esh-history))
1044 (bind-keys :map eshell-mode-map
1045 ("M-r" . counsel-esh-history))))
41d290a2 1046
dca50cf5 1047 :hook (eshell-mode . b/eshell-setup)
41d290a2
AB
1048 :custom
1049 (eshell-hist-ignoredups t)
1050 (eshell-input-filter 'eshell-input-filter-initial-space))
1051
47904cb7 1052(use-package ibuffer
41d290a2 1053 :bind
92df6c4f 1054 (("C-x C-b" . ibuffer)
41d290a2
AB
1055 :map ibuffer-mode-map
1056 ("P" . ibuffer-backward-filter-group)
1057 ("N" . ibuffer-forward-filter-group)
1058 ("M-p" . ibuffer-do-print)
1059 ("M-n" . ibuffer-do-shell-command-pipe-replace))
1060 :config
1061 ;; Use human readable Size column instead of original one
1062 (define-ibuffer-column size-h
1063 (:name "Size" :inline t)
1064 (cond
1065 ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
1066 ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0)))
1067 ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
1068 (t (format "%8d" (buffer-size)))))
1069 :custom
1070 (ibuffer-saved-filter-groups
1071 '(("default"
1072 ("dired" (mode . dired-mode))
1073 ("org" (mode . org-mode))
1074 ("gnus"
1075 (or
1076 (mode . gnus-group-mode)
1077 (mode . gnus-summary-mode)
1078 (mode . gnus-article-mode)
1079 ;; not really, but...
1080 (mode . message-mode)))
1081 ("web"
1082 (or
1083 (mode . web-mode)
1084 (mode . css-mode)
1085 (mode . scss-mode)
1086 (mode . js2-mode)))
1087 ("shell"
1088 (or
1089 (mode . eshell-mode)
1090 (mode . shell-mode)
1091 (mode . term-mode)))
1092 ("programming"
1093 (or
1094 (mode . python-mode)
1095 (mode . c-mode)
1096 (mode . c++-mode)
1097 (mode . java-mode)
1098 (mode . emacs-lisp-mode)
1099 (mode . scheme-mode)
1100 (mode . haskell-mode)
1101 (mode . lean-mode)
47904cb7 1102 ;; (mode . go-mode)
41d290a2
AB
1103 (mode . alloy-mode)))
1104 ("tex"
1105 (or
1106 (mode . bibtex-mode)
1107 (mode . latex-mode)))
1108 ("emacs"
1109 (or
1110 (name . "^\\*scratch\\*$")
1111 (name . "^\\*Messages\\*$")))
319c6483 1112 ("exwm" (mode . exwm-mode))
41d290a2
AB
1113 ("erc" (mode . erc-mode)))))
1114 (ibuffer-formats
1115 '((mark modified read-only locked " "
319c6483 1116 (name 72 72 :left :elide)
41d290a2
AB
1117 " "
1118 (size-h 9 -1 :right)
1119 " "
1120 (mode 16 16 :left :elide)
1121 " " filename-and-process)
1122 (mark " "
1123 (name 16 -1)
1124 " " filename)))
1125 :hook (ibuffer . (lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
1126
47904cb7 1127(use-package outline
2e81c51a 1128 :disabled
41d290a2
AB
1129 :hook (prog-mode . outline-minor-mode)
1130 :bind
1131 (:map
1132 outline-minor-mode-map
1133 ("<s-tab>" . outline-toggle-children)
1134 ("M-p" . outline-previous-visible-heading)
1135 ("M-n" . outline-next-visible-heading)
dca50cf5 1136 :prefix-map b/outline-prefix-map
ed8c4fa9 1137 :prefix "s-O"
41d290a2
AB
1138 ("TAB" . outline-toggle-children)
1139 ("a" . outline-hide-body)
1140 ("H" . outline-hide-body)
1141 ("S" . outline-show-all)
1142 ("h" . outline-hide-subtree)
1143 ("s" . outline-show-subtree)))
1144
47904cb7 1145(use-package ls-lisp
41d290a2
AB
1146 :custom (ls-lisp-dirs-first t))
1147
47904cb7 1148(use-package dired
41d290a2 1149 :config
14bd6398
AB
1150 (setq dired-dwim-target t
1151 dired-listing-switches "-alh"
41d290a2
AB
1152 ls-lisp-use-insert-directory-program nil)
1153
1154 ;; easily diff 2 marked files
1155 ;; https://oremacs.com/2017/03/18/dired-ediff/
1156 (defun dired-ediff-files ()
1157 (interactive)
1158 (require 'dired-aux)
1159 (defvar ediff-after-quit-hook-internal)
1160 (let ((files (dired-get-marked-files))
1161 (wnd (current-window-configuration)))
1162 (if (<= (length files) 2)
1163 (let ((file1 (car files))
1164 (file2 (if (cdr files)
1165 (cadr files)
1166 (read-file-name
1167 "file: "
1168 (dired-dwim-target-directory)))))
1169 (if (file-newer-than-file-p file1 file2)
1170 (ediff-files file2 file1)
1171 (ediff-files file1 file2))
1172 (add-hook 'ediff-after-quit-hook-internal
1173 (lambda ()
1174 (setq ediff-after-quit-hook-internal nil)
1175 (set-window-configuration wnd))))
1176 (error "no more than 2 files should be marked"))))
06ee5a00
AB
1177
1178 (require 'dired-x)
1179 (setq dired-guess-shell-alist-user
1180 '(("\\.pdf\\'" "evince" "zathura" "okular")
1181 ("\\.doc\\'" "libreoffice")
1182 ("\\.docx\\'" "libreoffice")
1183 ("\\.ppt\\'" "libreoffice")
1184 ("\\.pptx\\'" "libreoffice")
1185 ("\\.xls\\'" "libreoffice")
1186 ("\\.xlsx\\'" "libreoffice")
1187 ("\\.flac\\'" "mpv")))
41d290a2
AB
1188 :bind (:map dired-mode-map
1189 ("b" . dired-up-directory)
b1ed18e4
AB
1190 ("E" . dired-ediff-files)
1191 ("e" . dired-toggle-read-only)
41d290a2
AB
1192 ("\\" . dired-hide-details-mode)
1193 ("z" . (lambda ()
1194 (interactive)
dca50cf5 1195 (b/dired-start-process "zathura"))))
41d290a2
AB
1196 :hook (dired-mode . dired-hide-details-mode))
1197
47904cb7 1198(use-package help
41d290a2
AB
1199 :config
1200 (temp-buffer-resize-mode)
1201 (setq help-window-select t))
1202
47904cb7 1203(use-package tramp
41d290a2
AB
1204 :config
1205 (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
1206 (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
1207 (add-to-list 'tramp-default-proxies-alist
1208 (list (regexp-quote (system-name)) nil nil)))
1209
1210(use-package dash
1211 :config (dash-enable-font-lock))
1212
47904cb7 1213(use-package doc-view
41d290a2
AB
1214 :bind (:map doc-view-mode-map
1215 ("M-RET" . image-previous-line)))
1216
b57457b2
AB
1217\f
1218;;; Editing
1219
1220;; highlight uncommitted changes in the left fringe
41d290a2 1221(use-package diff-hl
df1c9bc8 1222 :defer 0.6
41d290a2
AB
1223 :config
1224 (setq diff-hl-draw-borders nil)
1225 (global-diff-hl-mode)
1226 :hook (magit-post-refresh . diff-hl-magit-post-refresh))
1227
b57457b2 1228;; display Lisp objects at point in the echo area
47904cb7 1229(use-package eldoc
41d290a2
AB
1230 :when (version< "25" emacs-version)
1231 :config (global-eldoc-mode))
1232
b57457b2 1233;; highlight matching parens
47904cb7 1234(use-package paren
41d290a2
AB
1235 :demand
1236 :config (show-paren-mode))
1237
47904cb7 1238(use-package elec-pair
40eddfea
AB
1239 :demand
1240 :config (electric-pair-mode))
1241
47904cb7 1242(use-package simple
60ff805e
AB
1243 :config (column-number-mode)
1244 :custom
1245 ;; Save what I copy into clipboard from other applications into Emacs'
1246 ;; kill-ring, which would allow me to still be able to easily access
1247 ;; it in case I kill (cut or copy) something else inside Emacs before
1248 ;; yanking (pasting) what I'd originally intended to.
1249 (save-interprogram-paste-before-kill t))
41d290a2 1250
b57457b2 1251;; save minibuffer history
47904cb7 1252(use-package savehist
1060413b 1253 :demand
dca50cf5
AB
1254 :config
1255 (savehist-mode)
1060413b 1256 (add-to-list 'savehist-additional-variables 'kill-ring))
41d290a2 1257
b57457b2 1258;; automatically save place in files
47904cb7 1259(use-package saveplace
41d290a2 1260 :when (version< "25" emacs-version)
1060413b 1261 :config (save-place-mode))
41d290a2 1262
47904cb7 1263(use-package prog-mode
41d290a2
AB
1264 :config (global-prettify-symbols-mode)
1265 (defun indicate-buffer-boundaries-left ()
1266 (setq indicate-buffer-boundaries 'left))
1267 (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
1268
47904cb7 1269(use-package text-mode
bc2f85e1 1270 :bind (:map text-mode-map ("C-*" . b/insert-asterism))
93a86536
AB
1271 :hook ((text-mode . indicate-buffer-boundaries-left)
1272 (text-mode . flyspell-mode)))
41d290a2 1273
47904cb7 1274(use-package conf-mode
300b7363
AB
1275 :mode "\\.*rc$")
1276
47904cb7 1277(use-package sh-mode
300b7363
AB
1278 :mode "\\.bashrc$")
1279
41d290a2 1280(use-package company
41d290a2
AB
1281 :bind
1282 (:map company-active-map
1283 ([tab] . company-complete-common-or-cycle)
d39234b9
AB
1284 ([escape] . company-abort)
1285 ("C-p" . company-select-previous-or-abort)
1286 ("C-n" . company-select-next-or-abort))
41d290a2
AB
1287 :custom
1288 (company-minimum-prefix-length 1)
1289 (company-selection-wrap-around t)
1290 (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
1291 (company-dabbrev-downcase nil)
1292 (company-dabbrev-ignore-case nil)
6eb104ff
AB
1293 ;; :config
1294 ;; (global-company-mode t)
1295 )
41d290a2
AB
1296
1297(use-package flycheck
1298 :defer 0.6
1299 :hook (prog-mode . flycheck-mode)
1300 :bind
1301 (:map flycheck-mode-map
1302 ("M-P" . flycheck-previous-error)
1303 ("M-N" . flycheck-next-error))
1304 :config
1305 ;; Use the load-path from running Emacs when checking elisp files
1306 (setq flycheck-emacs-lisp-load-path 'inherit)
1307
1308 ;; Only flycheck when I actually save the buffer
54209e74
AB
1309 (setq flycheck-check-syntax-automatically '(mode-enabled save))
1310 :custom (flycheck-mode-line-prefix "flyc"))
1311
47904cb7 1312(use-package flyspell)
41d290a2
AB
1313
1314;; http://endlessparentheses.com/ispell-and-apostrophes.html
47904cb7 1315(use-package ispell
41d290a2
AB
1316 :defer 0.6
1317 :config
1318 ;; ’ can be part of a word
1319 (setq ispell-local-dictionary-alist
1320 `((nil "[[:alpha:]]" "[^[:alpha:]]"
b1ed9ee8
AB
1321 "['\x2019]" nil ("-B") nil utf-8))
1322 ispell-program-name (executable-find "hunspell"))
41d290a2
AB
1323 ;; don't send ’ to the subprocess
1324 (defun endless/replace-apostrophe (args)
1325 (cons (replace-regexp-in-string
1326 "’" "'" (car args))
1327 (cdr args)))
1328 (advice-add #'ispell-send-string :filter-args
1329 #'endless/replace-apostrophe)
1330
1331 ;; convert ' back to ’ from the subprocess
1332 (defun endless/replace-quote (args)
1333 (if (not (derived-mode-p 'org-mode))
1334 args
1335 (cons (replace-regexp-in-string
1336 "'" "’" (car args))
1337 (cdr args))))
1338 (advice-add #'ispell-parse-output :filter-args
1339 #'endless/replace-quote))
1340
47904cb7 1341(use-package abbrev
1060413b 1342 :hook (text-mode . abbrev-mode))
54209e74 1343
b57457b2
AB
1344\f
1345;;; Programming modes
1346
47904cb7 1347(use-package lisp-mode
41d290a2 1348 :config
41d290a2
AB
1349 (defun indent-spaces-mode ()
1350 (setq indent-tabs-mode nil))
1351 (add-hook 'lisp-interaction-mode-hook #'indent-spaces-mode))
1352
47904cb7 1353(use-package reveal
54209e74
AB
1354 :hook (emacs-lisp-mode . reveal-mode))
1355
47904cb7
AB
1356(use-package elisp-mode)
1357
1358;; (use-package alloy-mode
1359;; :straight (:host github :repo "dwwmmn/alloy-mode")
1360;; :mode "\\.\\(als\\|dsh\\)\\'"
1361;; :config
1362;; (setq alloy-basic-offset 2)
1363;; ;; (defun b/alloy-simple-indent (start end)
1364;; ;; (interactive "r")
1365;; ;; ;; (if (region-active-p)
1366;; ;; ;; (indent-rigidly start end alloy-basic-offset)
1367;; ;; ;; (if (bolp)
1368;; ;; ;; (indent-rigidly (line-beginning-position)
1369;; ;; ;; (line-end-position)
1370;; ;; ;; alloy-basic-offset)))
1371;; ;; (indent-to (+ (current-column) alloy-basic-offset)))
1372;; :bind (:map alloy-mode-map
1373;; ("RET" . electric-newline-and-maybe-indent)
1374;; ;; ("TAB" . b/alloy-simple-indent)
1375;; ("TAB" . indent-for-tab-command))
1376;; :hook (alloy-mode . (lambda () (setq-local indent-tabs-mode nil))))
33273849
AB
1377
1378(eval-when-compile (defvar lean-mode-map))
1379(use-package lean-mode
33273849
AB
1380 :defer 0.4
1381 :bind (:map lean-mode-map
1382 ("S-SPC" . company-complete))
1383 :config
1384 (require 'lean-input)
1385 (setq default-input-method "Lean"
1386 lean-input-tweak-all '(lean-input-compose
1387 (lean-input-prepend "/")
1388 (lean-input-nonempty))
1389 lean-input-user-translations '(("/" "/")))
1390 (lean-input-setup))
1391
1392(comment
dca50cf5
AB
1393 (use-package proof-site ; for Coq
1394 :straight proof-general)
1395
dca50cf5
AB
1396 (use-package haskell-mode
1397 :config
1398 (setq haskell-indentation-layout-offset 4
1399 haskell-indentation-left-offset 4
1400 flycheck-checker 'haskell-hlint
1401 flycheck-disabled-checkers '(haskell-stack-ghc haskell-ghc)))
1402
1403 (use-package dante
1404 :after haskell-mode
1405 :commands dante-mode
1406 :hook (haskell-mode . dante-mode))
1407
1408 (use-package hlint-refactor
1409 :after haskell-mode
1410 :bind (:map hlint-refactor-mode-map
1411 ("C-c l b" . hlint-refactor-refactor-buffer)
1412 ("C-c l r" . hlint-refactor-refactor-at-point))
1413 :hook (haskell-mode . hlint-refactor-mode))
1414
1415 (use-package flycheck-haskell
1416 :after haskell-mode)
1417 ;; alternative: hs-lint https://github.com/ndmitchell/hlint/blob/20e116a043f2073c57b17b24ae6364b5e433ba7e/data/hs-lint.el
1418 )
41d290a2 1419
47904cb7 1420(use-package sgml-mode
41d290a2
AB
1421 :config
1422 (setq sgml-basic-offset 2))
1423
47904cb7 1424(use-package css-mode
41d290a2
AB
1425 :config
1426 (setq css-indent-offset 2))
1427
1428(use-package web-mode
1429 :mode "\\.html\\'"
1430 :config
dca50cf5 1431 (b/setq-every 2
41d290a2
AB
1432 web-mode-code-indent-offset
1433 web-mode-css-indent-offset
440013b1
AB
1434 web-mode-markup-indent-offset)
1435 :custom
1436 (web-mode-enable-auto-indentation nil))
41d290a2
AB
1437
1438(use-package emmet-mode
1439 :after (:any web-mode css-mode sgml-mode)
1440 :bind* (("C-)" . emmet-next-edit-point)
1441 ("C-(" . emmet-prev-edit-point))
1442 :config
1443 (unbind-key "C-j" emmet-mode-keymap)
1444 (setq emmet-move-cursor-between-quotes t)
1445 :hook (web-mode css-mode html-mode sgml-mode))
1446
b57457b2
AB
1447(comment
1448 (use-package meghanada
1449 :bind
1450 (:map meghanada-mode-map
1451 (("C-M-o" . meghanada-optimize-import)
1452 ("C-M-t" . meghanada-import-all)))
1453 :hook (java-mode . meghanada-mode)))
1454
1455(comment
1456 (use-package treemacs
1457 :config (setq treemacs-never-persist t))
1458
1459 (use-package yasnippet
1460 :config
1461 ;; (yas-global-mode)
1462 )
1463
1464 (use-package lsp-mode
1465 :init (setq lsp-eldoc-render-all nil
1466 lsp-highlight-symbol-at-point nil)
1467 )
1468
1469 (use-package hydra)
1470
1471 (use-package company-lsp
1472 :after company
1473 :config
1474 (setq company-lsp-cache-candidates t
1475 company-lsp-async t))
1476
1477 (use-package lsp-ui
1478 :config
1479 (setq lsp-ui-sideline-update-mode 'point))
1480
1481 (use-package lsp-java
1482 :config
1483 (add-hook 'java-mode-hook
63102057
AB
1484 (lambda ()
1485 (setq-local company-backends (list 'company-lsp))))
b57457b2
AB
1486
1487 (add-hook 'java-mode-hook 'lsp-java-enable)
1488 (add-hook 'java-mode-hook 'flycheck-mode)
1489 (add-hook 'java-mode-hook 'company-mode)
1490 (add-hook 'java-mode-hook 'lsp-ui-mode))
1491
1492 (use-package dap-mode
1493 :after lsp-mode
1494 :config
1495 (dap-mode t)
1496 (dap-ui-mode t))
1497
1498 (use-package dap-java
1499 :after (lsp-java))
1500
1501 (use-package lsp-java-treemacs
1502 :after (treemacs)))
1503
1504(comment
1505 (use-package eclim
1506 :bind (:map eclim-mode-map ("S-SPC" . company-complete))
1507 :hook ((java-mode . eclim-mode)
1508 (eclim-mode . (lambda ()
1509 (make-local-variable 'company-idle-delay)
1510 (defvar company-idle-delay)
1511 ;; (setq company-idle-delay 0.7)
1512 (setq company-idle-delay nil))))
1513 :custom
1514 (eclim-auto-save nil)
1515 ;; (eclimd-default-workspace "~/src/eclipse-workspace-exp")
1516 (eclim-executable "~/.p2/pool/plugins/org.eclim_2.8.0/bin/eclim")
1517 (eclim-eclipse-dirs '("~/usr/eclipse/dsl-2018-09/eclipse"))))
1518
1060413b 1519(use-package geiser)
41d290a2 1520
47904cb7 1521(use-package geiser-guile
41d290a2
AB
1522 :config
1523 (setq geiser-guile-load-path "~/src/git/guix"))
1524
1525(use-package guix)
1526
b57457b2
AB
1527(comment
1528 (use-package auctex
1529 :custom
1530 (font-latex-fontify-sectioning 'color)))
1531
47904cb7
AB
1532(use-package go-mode
1533 :disabled)
99473567 1534
f704f564
AB
1535(use-package po-mode
1536 :hook
1537 (po-mode . (lambda () (run-with-timer 0.1 nil 'View-exit))))
1538
47904cb7 1539(use-package tex-mode
748bd8ac
AB
1540 :config
1541 (cl-delete-if
1542 (lambda (p) (string-match "^---?" (car p)))
0758ec38
AB
1543 tex--prettify-symbols-alist)
1544 :hook ((tex-mode . auto-fill-mode)
3457307b 1545 (tex-mode . flyspell-mode)))
748bd8ac 1546
47904cb7
AB
1547;; (use-package george-mode
1548;; :straight (:host nil :repo "https://git.shemshak.org/amin/george-mode")
1549;; :mode "\\.grg\\'")
1d01c927 1550
b57457b2
AB
1551\f
1552;;; Theme
1553
dca50cf5
AB
1554(add-to-list 'custom-theme-load-path
1555 (expand-file-name
1556 (convert-standard-filename "lisp") user-emacs-directory))
b57457b2
AB
1557(load-theme 'tangomod t)
1558
1559(use-package smart-mode-line
1560 :commands (sml/apply-theme)
1561 :demand
1562 :config
8f2b3cb6
AB
1563 ;; thanks, but no thnaks; don't make fixed-width fills.
1564 (defun sml/fill-for-buffer-identification () "")
0f4b61b6 1565 (setq sml/theme 'tangomod)
26906e22
AB
1566 (sml/setup)
1567 (smart-mode-line-enable))
b57457b2 1568
cce35aca
AB
1569(use-package doom-modeline
1570 :disabled
1571 :demand
1572 :hook (after-init . doom-modeline-init)
1573 :custom
1574 (doom-modeline-buffer-file-name-style 'relative-to-project))
1575
96611976 1576(use-package doom-themes)
eb42934e
AB
1577
1578(use-package solarized-theme
96611976
AB
1579 :disabled
1580 :config
1581 (load-theme 'solarized-light t))
1582
1583(use-package moody
d4afaf1b 1584 :disabled
eb42934e
AB
1585 :demand
1586 :config
96611976 1587 (setq x-underline-at-descent-line t)
eb42934e
AB
1588 (let ((line (face-attribute 'mode-line :underline)))
1589 (set-face-attribute 'mode-line nil :overline line)
1590 (set-face-attribute 'mode-line-inactive nil :overline line)
1591 (set-face-attribute 'mode-line-inactive nil :underline line)
1592 (set-face-attribute 'mode-line nil :box nil)
1593 (set-face-attribute 'mode-line-inactive nil :box nil)
958286c5 1594 (set-face-attribute 'mode-line-inactive nil :background "#e1e1e1")) ; d3d7cf
eb42934e
AB
1595 (moody-replace-mode-line-buffer-identification)
1596 (moody-replace-vc-mode))
b57457b2 1597
0b085e06
AB
1598(use-package mini-modeline
1599 :disabled
1600 :demand
1601 :config (mini-modeline-mode))
1602
dca50cf5 1603(defvar b/org-mode-font-lock-keywords
b57457b2
AB
1604 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
1605 (1 '(:foreground "#5a5b5a" :background "#292b2b") t) ; directive
1606 (3 '(:foreground "#81a2be" :background "#292b2b") t) ; kind
96611976
AB
1607 (4 '(:foreground "#c5c8c6") t))) ; title
1608 "For use with the `doom-tomorrow-night' theme.")
b57457b2 1609
dca50cf5 1610(defun b/lights-on ()
b57457b2
AB
1611 "Enable my favourite light theme."
1612 (interactive)
1613 (mapc #'disable-theme custom-enabled-themes)
96611976 1614 (load-theme 'tangomod t)
22fff83b
AB
1615 (when (featurep 'smart-mode-line)
1616 (sml/apply-theme 'tangomod))
96611976 1617 (font-lock-remove-keywords
e6c67861 1618 'org-mode b/org-mode-font-lock-keywords)
d7e02391
AB
1619 (when (featurep 'erc-hl-nicks)
1620 (erc-hl-nicks-reset-face-table))
e6c67861
AB
1621 (when (featurep 'exwm-systemtray)
1622 (exwm-systemtray--refresh)))
b57457b2 1623
dca50cf5 1624(defun b/lights-off ()
b57457b2
AB
1625 "Go dark."
1626 (interactive)
1627 (mapc #'disable-theme custom-enabled-themes)
96611976 1628 (load-theme 'doom-one t)
22fff83b
AB
1629 (when (featurep 'smart-mode-line)
1630 (sml/apply-theme 'automatic))
96611976 1631 (font-lock-add-keywords
e6c67861 1632 'org-mode b/org-mode-font-lock-keywords t)
d7e02391
AB
1633 (when (featurep 'erc-hl-nicks)
1634 (erc-hl-nicks-reset-face-table))
e6c67861
AB
1635 (when (featurep 'exwm-systemtray)
1636 (exwm-systemtray--refresh)))
b57457b2
AB
1637
1638(bind-keys
2e81c51a
AB
1639 ("C-c t d" . b/lights-off)
1640 ("C-c t l" . b/lights-on))
b57457b2
AB
1641
1642\f
1643;;; Emacs enhancements & auxiliary packages
1644
dca50cf5 1645(use-package man
41d290a2
AB
1646 :config (setq Man-width 80))
1647
1648(use-package which-key
1649 :defer 0.4
1650 :config
1651 (which-key-add-key-based-replacements
1652 ;; prefixes for global prefixes and minor modes
1653 "C-c @" "outline"
1654 "C-c !" "flycheck"
b549b760 1655 "C-x RET" "coding system"
41d290a2 1656 "C-x 8" "unicode"
b549b760 1657 "C-x @" "event modifiers"
41d290a2
AB
1658 "C-x a" "abbrev/expand"
1659 "C-x r" "rectangle/register/bookmark"
b549b760 1660 "C-x t" "tabs"
41d290a2 1661 "C-x v" "version control"
b549b760
AB
1662 "C-x X" "edebug"
1663 "C-x C-a" "edebug"
1664 "C-x C-k" "kmacro"
41d290a2 1665 ;; prefixes for my personal bindings
b549b760 1666 "C-c &" "yasnippet"
41d290a2
AB
1667 "C-c a" "applications"
1668 "C-c a e" "erc"
1669 "C-c a o" "org"
1670 "C-c a s" "shells"
2e81c51a 1671 "C-c b" "buffers"
41d290a2
AB
1672 "C-c c" "compile-and-comments"
1673 "C-c e" "eval"
1674 "C-c f" "files"
1675 "C-c F" "frames"
ef6c487c 1676 "C-c g" "magit"
41d290a2
AB
1677 "C-S-h" "help(ful)"
1678 "C-c m" "multiple-cursors"
47904cb7
AB
1679 "C-c p" "projectile"
1680 "C-c p s" "projectile/search"
1681 "C-c p x" "projectile/execute"
1682 "C-c p 4" "projectile/other-window"
41d290a2 1683 "C-c q" "boxquote"
2e81c51a
AB
1684 "C-c t" "themes"
1685 ;; "s-O" "outline"
ef6c487c 1686 )
41d290a2
AB
1687
1688 ;; prefixes for major modes
1689 (which-key-add-major-mode-key-based-replacements 'message-mode
7cc51891 1690 "C-c f n" "footnote")
41d290a2
AB
1691 (which-key-add-major-mode-key-based-replacements 'org-mode
1692 "C-c C-v" "org-babel")
1693 (which-key-add-major-mode-key-based-replacements 'web-mode
1694 "C-c C-a" "web/attributes"
1695 "C-c C-b" "web/blocks"
1696 "C-c C-d" "web/dom"
1697 "C-c C-e" "web/element"
1698 "C-c C-t" "web/tags")
1699
1700 (which-key-mode)
1701 :custom
1702 (which-key-add-column-padding 5)
1703 (which-key-max-description-length 32))
1704
b57457b2 1705(use-package crux ; results in Waiting for git... [2 times]
41d290a2 1706 :defer 0.4
2a816b71 1707 :bind (("C-c d" . crux-duplicate-current-line-or-region)
ba45b932 1708 ("C-c M-d" . crux-duplicate-and-comment-current-line-or-region)
205870c7
AB
1709 ("C-c f C" . crux-copy-file-preserve-attributes)
1710 ("C-c f D" . crux-delete-file-and-buffer)
1711 ("C-c f R" . crux-rename-file-and-buffer)
41d290a2
AB
1712 ("C-c j" . crux-top-join-line)
1713 ("C-S-j" . crux-top-join-line)))
1714
5b10d879
AB
1715(use-package mwim
1716 :bind (("C-a" . mwim-beginning-of-code-or-line)
1717 ("C-e" . mwim-end-of-code-or-line)
1718 ("<home>" . mwim-beginning-of-line-or-code)
1719 ("<end>" . mwim-end-of-line-or-code)))
41d290a2
AB
1720
1721(use-package projectile
26906e22 1722 :defer 0.5
47904cb7 1723 :bind-keymap ("C-c p" . projectile-command-map)
41d290a2
AB
1724 :config
1725 (projectile-mode)
1726
dca50cf5 1727 (defun b/projectile-mode-line-fun ()
26906e22
AB
1728 "Report project name and type in the modeline."
1729 (let ((project-name (projectile-project-name))
1730 (project-type (projectile-project-type)))
1731 (format "%s%s"
1732 projectile-mode-line-prefix
1733 (if project-type
1734 (format ":%s" project-type)
1735 ""))))
dca50cf5 1736 (setq projectile-mode-line-function 'b/projectile-mode-line-fun)
26906e22 1737
41d290a2
AB
1738 (defun my-projectile-invalidate-cache (&rest _args)
1739 ;; ignore the args to `magit-checkout'
1740 (projectile-invalidate-cache nil))
1741
1742 (eval-after-load 'magit-branch
1743 '(progn
1744 (advice-add 'magit-checkout
1745 :after #'my-projectile-invalidate-cache)
1746 (advice-add 'magit-branch-and-checkout
1747 :after #'my-projectile-invalidate-cache)))
54209e74 1748 :custom
295b1b10 1749 (projectile-completion-system 'ivy)
54209e74 1750 (projectile-mode-line-prefix " proj"))
41d290a2
AB
1751
1752(use-package helpful
1753 :defer 0.6
1754 :bind
1755 (("C-S-h c" . helpful-command)
1756 ("C-S-h f" . helpful-callable) ; helpful-function
1757 ("C-S-h v" . helpful-variable)
1758 ("C-S-h k" . helpful-key)
1759 ("C-S-h p" . helpful-at-point)))
1760
5b10d879
AB
1761(use-package unkillable-scratch
1762 :defer 0.6
1763 :config
1764 (unkillable-scratch 1)
1765 :custom
1766 (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
41d290a2 1767
5b10d879
AB
1768;; ,----
1769;; | make pretty boxed quotes like this
1770;; `----
1771(use-package boxquote
1772 :defer 0.6
1773 :bind
1774 (:prefix-map b/boxquote-prefix-map
1775 :prefix "C-c q"
1776 ("b" . boxquote-buffer)
1777 ("B" . boxquote-insert-buffer)
1778 ("d" . boxquote-defun)
1779 ("F" . boxquote-insert-file)
1780 ("hf" . boxquote-describe-function)
1781 ("hk" . boxquote-describe-key)
1782 ("hv" . boxquote-describe-variable)
1783 ("hw" . boxquote-where-is)
1784 ("k" . boxquote-kill)
1785 ("p" . boxquote-paragraph)
1786 ("q" . boxquote-boxquote)
1787 ("r" . boxquote-region)
1788 ("s" . boxquote-shell-command)
1789 ("t" . boxquote-text)
1790 ("T" . boxquote-title)
1791 ("u" . boxquote-unbox)
1792 ("U" . boxquote-unbox-region)
1793 ("y" . boxquote-yank)
1794 ("M-q" . boxquote-fill-paragraph)
1795 ("M-w" . boxquote-kill-ring-save)))
41d290a2
AB
1796
1797(use-package orgalist
3619fcff
AB
1798 ;; breaks auto-fill-mode, showing this error:
1799 ;; orgalist--boundaries: Lisp nesting exceeds ‘max-lisp-eval-depth’
1800 :disabled
41d290a2
AB
1801 :after message
1802 :hook (message-mode . orgalist-mode))
1803
b57457b2 1804;; easily type pretty quotes & other typography, like ‘’“”-–—«»‹›
41d290a2
AB
1805(use-package typo
1806 :defer 0.5
1807 :config
d41aeafc 1808 :hook (((text-mode erc-mode web-mode) . typo-mode)
5a0a67b4 1809 ((tex-mode git-commit-mode) . (lambda ()(typo-mode -1)))))
41d290a2 1810
47904cb7 1811(use-package electric
7c4bf72a
AB
1812 :disabled
1813 :demand
1814 :config
1815 (electric-quote-mode))
1816
b57457b2 1817;; highlight TODOs in buffers
41d290a2
AB
1818(use-package hl-todo
1819 :defer 0.5
1820 :config
1821 (global-hl-todo-mode))
1822
5b10d879
AB
1823(use-package shrink-path
1824 :defer 0.5
1825 :after eshell
1826 :config
92bbb7aa 1827 (defvar user-@-host (concat (user-login-name) "@" (system-name) ":"))
5b10d879 1828 (defun +eshell/prompt ()
92bbb7aa
AB
1829 (concat (propertize user-@-host 'face 'default)
1830 (propertize (abbreviate-file-name default-directory)
1831 'face 'font-lock-comment-face)
1832 (propertize "\n" 'face 'default)
1833 (if (= (user-uid) 0)
1834 (propertize "#" 'face 'red)
1835 (propertize "$" 'face 'default))
1836 (propertize " " 'face 'default)))
1837 (setq eshell-prompt-regexp "\\(.*\n\\)*[$#] "
5b10d879 1838 eshell-prompt-function #'+eshell/prompt))
41d290a2
AB
1839
1840(use-package eshell-up
1841 :after eshell
1842 :commands eshell-up)
1843
1844(use-package multi-term
cce35aca 1845 :disabled
41d290a2 1846 :defer 0.6
fb078e63
AB
1847 :bind (("C-c a s m m" . multi-term)
1848 ("C-c a s m d" . multi-term-dedicated-toggle)
1849 ("C-c a s m p" . multi-term-prev)
1850 ("C-c a s m n" . multi-term-next)
41d290a2 1851 :map term-mode-map
0af1e91a 1852 ("C-c C-j" . term-char-mode))
41d290a2 1853 :config
96c704d7
AB
1854 (setq multi-term-program "screen"
1855 multi-term-program-switches (concat "-c"
1856 (getenv "XDG_CONFIG_HOME")
1857 "/screen/screenrc")
41d290a2
AB
1858 ;; TODO: add separate bindings for connecting to existing
1859 ;; session vs. always creating a new one
1860 multi-term-dedicated-select-after-open-p t
1861 multi-term-dedicated-window-height 20
1862 multi-term-dedicated-max-window-height 30
1863 term-bind-key-alist
1864 '(("C-c C-c" . term-interrupt-subjob)
1865 ("C-c C-e" . term-send-esc)
0af1e91a 1866 ("C-c C-j" . term-line-mode)
41d290a2 1867 ("C-k" . kill-line)
fb078e63
AB
1868 ;; ("C-y" . term-paste)
1869 ("C-y" . term-send-raw)
41d290a2
AB
1870 ("M-f" . term-send-forward-word)
1871 ("M-b" . term-send-backward-word)
1872 ("M-p" . term-send-up)
1873 ("M-n" . term-send-down)
fb078e63
AB
1874 ("M-j" . term-send-raw-meta)
1875 ("M-y" . term-send-raw-meta)
1876 ("M-/" . term-send-raw-meta)
1877 ("M-0" . term-send-raw-meta)
1878 ("M-1" . term-send-raw-meta)
1879 ("M-2" . term-send-raw-meta)
1880 ("M-3" . term-send-raw-meta)
1881 ("M-4" . term-send-raw-meta)
1882 ("M-5" . term-send-raw-meta)
1883 ("M-6" . term-send-raw-meta)
1884 ("M-7" . term-send-raw-meta)
1885 ("M-8" . term-send-raw-meta)
1886 ("M-9" . term-send-raw-meta)
41d290a2
AB
1887 ("<C-backspace>" . term-send-backward-kill-word)
1888 ("<M-DEL>" . term-send-backward-kill-word)
1889 ("M-d" . term-send-delete-word)
1890 ("M-," . term-send-raw)
1891 ("M-." . comint-dynamic-complete))
1892 term-unbind-key-alist
fb078e63
AB
1893 '("C-z" "C-x" "C-c" "C-h"
1894 ;; "C-y"
1895 "<ESC>")))
41d290a2
AB
1896
1897(use-package page-break-lines
b57457b2 1898 :defer 0.5
2f5d8190
AB
1899 :custom
1900 (page-break-lines-max-width fill-column)
41d290a2
AB
1901 :config
1902 (global-page-break-lines-mode))
1903
1904(use-package expand-region
1905 :bind ("C-=" . er/expand-region))
1906
1907(use-package multiple-cursors
1908 :bind
1909 (("C-S-<mouse-1>" . mc/add-cursor-on-click)
dca50cf5 1910 (:prefix-map b/mc-prefix-map
41d290a2
AB
1911 :prefix "C-c m"
1912 ("c" . mc/edit-lines)
1913 ("n" . mc/mark-next-like-this)
1914 ("p" . mc/mark-previous-like-this)
1060413b 1915 ("a" . mc/mark-all-like-this))))
41d290a2 1916
fa9943dc 1917(use-package forge
47904cb7 1918 :disabled
fa9943dc
AB
1919 :demand
1920 :after magit)
41d290a2
AB
1921
1922(use-package yasnippet
1923 :defer 0.6
1924 :config
1925 (defconst yas-verbosity-cur yas-verbosity)
1926 (setq yas-verbosity 2)
476f6228 1927 (add-to-list 'yas-snippet-dirs "~/src/git/guix/etc/snippets" t)
41d290a2
AB
1928 (yas-reload-all)
1929 (setq yas-verbosity yas-verbosity-cur)
5b185efa
AB
1930
1931 (defun b/yas--maybe-expand-key-filter (cmd)
1932 (when (and (yas--maybe-expand-key-filter cmd)
1933 (not (bound-and-true-p git-commit-mode)))
1934 cmd))
1935 (defconst b/yas-maybe-expand
1936 '(menu-item "" yas-expand :filter b/yas--maybe-expand-key-filter))
1937 (define-key yas-minor-mode-map
1938 (kbd "SPC") b/yas-maybe-expand)
1939
476f6228 1940 (yas-global-mode))
41d290a2 1941
33273849 1942(use-package debbugs
ba45b932
AB
1943 :bind
1944 (("C-c D d" . debbugs-gnu)
8cee0db4 1945 ("C-c D b" . debbugs-gnu-bugs)
ba45b932
AB
1946 ("C-c D e" .
1947 (lambda ()
1948 (interactive)
1949 (setq debbugs-gnu-current-suppress t)
1950 (debbugs-gnu debbugs-gnu-default-severities '("emacs"))))
1951 ("C-c D g" .
1952 (lambda ()
1953 (interactive)
1954 (setq debbugs-gnu-current-suppress t)
64b53575
AB
1955 (debbugs-gnu debbugs-gnu-default-severities '("gnuzilla"))))
1956 ("C-c D G" .
1957 (lambda ()
1958 (interactive)
1959 (setq debbugs-gnu-current-suppress t)
1960 (debbugs-gnu debbugs-gnu-default-severities '("guix"))))))
41d290a2
AB
1961
1962(use-package org-ref
1963 :init
dca50cf5 1964 (b/setq-every '("~/usr/org/references.bib")
41d290a2
AB
1965 reftex-default-bibliography
1966 org-ref-default-bibliography)
1967 (setq
1968 org-ref-bibliography-notes "~/usr/org/notes.org"
1969 org-ref-pdf-directory "~/usr/org/bibtex-pdfs/"))
1970
41d290a2
AB
1971(use-package alert
1972 :commands (alert)
83a17ce5 1973 :init (setq alert-default-style 'notifications))
41d290a2 1974
2f5d8190
AB
1975;; (use-package fill-column-indicator)
1976
b46ed2ba 1977(use-package emojify
b29aa20f 1978 :disabled
b46ed2ba
AB
1979 :hook (erc-mode . emojify-mode))
1980
47904cb7 1981(use-package window
ed8c4fa9 1982 :bind
edb03389
AB
1983 (("C-c w e" . (lambda ()
1984 (interactive)
1985 (split-window-right)
1986 (other-window 1)
1987 (erc-switch-to-buffer)))
1988 ("C-c w s l" . (lambda ()
1989 (interactive)
1990 (split-window-right)
1991 (other-window 1)))
1992 ("C-c w s j" . (lambda ()
1993 (interactive)
1994 (split-window-below)
1995 (other-window 1)))
446cb096 1996 ("C-c w q" . quit-window))
92df6c4f
AB
1997 :custom
1998 (split-width-threshold 150))
ed8c4fa9 1999
47904cb7 2000(use-package windmove
ed8c4fa9
AB
2001 :defer 0.6
2002 :bind
2e81c51a
AB
2003 (("C-c w h" . windmove-left)
2004 ("C-c w j" . windmove-down)
2005 ("C-c w k" . windmove-up)
2006 ("C-c w l" . windmove-right)
2007 ("C-c w H" . windmove-swap-states-left)
2008 ("C-c w J" . windmove-swap-states-down)
2009 ("C-c w K" . windmove-swap-states-up)
2010 ("C-c w L" . windmove-swap-states-right)))
ed8c4fa9 2011
05068e71
AB
2012(use-package pass
2013 :commands pass
2014 :bind ("C-c a p" . pass)
2015 :hook (pass-mode . View-exit))
2016
b188e798
AB
2017(use-package pdf-tools
2018 :defer 0.5
2019 :bind (:map pdf-view-mode-map
0365678c
AB
2020 ("<C-XF86Back>" . pdf-history-backward)
2021 ("<mouse-8>" . pdf-history-backward)
2022 ("<drag-mouse-8>" . pdf-history-backward)
2023 ("<C-XF86Forward>" . pdf-history-forward)
2024 ("<mouse-9>" . pdf-history-forward)
2025 ("<drag-mouse-9>" . pdf-history-forward)
4fa43cd8
AB
2026 ("M-RET" . image-previous-line)
2027 ("C-s" . isearch-forward)
2028 ("s s" . isearch-forward))
822ac360
AB
2029 :config (pdf-tools-install nil t)
2030 :custom (pdf-view-resize-factor 1.05))
b188e798 2031
62a2088e 2032(use-package org-pdftools
47904cb7 2033 :disabled
62a2088e
AB
2034 :straight (:host github :repo "fuxialexander/org-pdftools")
2035 :demand
2036 :after org
2037 :config
2038 (with-eval-after-load 'org
2039 (require 'org-pdftools)))
2040
9de75957
AB
2041(use-package biblio)
2042
47904cb7 2043(use-package reftex
9a5ffb33
AB
2044 :hook (latex-mode . reftex-mode))
2045
47904cb7 2046(use-package reftex-cite
9a5ffb33
AB
2047 :after reftex
2048 :disabled ; enable to disable
2049 ; reftex-cite's default choice
2050 ; of previous word
2051 :config
2052 (defun reftex-get-bibkey-default ()
2053 "If the cursor is in a citation macro, return the word before the macro."
2054 (let* ((macro (reftex-what-macro 1)))
2055 (save-excursion
2056 (when (and macro (string-match "cite" (car macro)))
2057 (goto-char (cdr macro)))
2058 (reftex-this-word)))))
2059
d141ce11
AB
2060(use-package minions
2061 :demand
2062 :config (minions-mode))
2063
fa9943dc 2064(use-package dmenu
fa9943dc 2065 :custom
fa9943dc
AB
2066 (dmenu-prompt-string "run: ")
2067 (dmenu-save-file (b/var "dmenu-items")))
2068
996bebf6
AB
2069(use-package eosd
2070 ;; TODO: fix build by properly building the eosd-pixbuf.c module
2071 ;; e.g. see https://github.com/raxod502/straight.el/issues/386
2072 :disabled
2073 :straight (:host github :repo "clarete/eosd")
2074 :demand
2075 :after exwm
2076 :config
2077 (eosd-start))
2078
926d8456
AB
2079(use-package nnreddit
2080 :disabled
2081 :demand
2082 :after gnus
2083 :custom
2084 (nnreddit-python-command "python3"))
2085
fcd4c603
AB
2086(use-package hyperbole
2087 :disabled
2088 :straight (hyperbole
2089 :host github :repo "rswgnu/hyperbole"
2090 :files ("*.el" ("kotl" "kotl/*.el")
2091 "DEMO" "man/*.info" "man/*.texi")))
2092
47904cb7
AB
2093;; (use-package oddmuse-curl
2094;; :straight (:host github :repo "kensanata/oddmuse-curl")
2095;; :config
2096;; (setq
2097;; oddmuse-wikis
2098;; (append
2099;; '(("EmacsConf" "https://emacsconf.org" utf-8 "question" nil)
2100;; ("EmacsConf 2019" "https://emacsconf.org/2019" utf-8 "question" nil))
2101;; oddmuse-wikis))
2102;; :custom
2103;; (oddmuse-username "bandali"))
9bacd1c8 2104
bfbda9c5
AB
2105(use-package debpaste
2106 :custom
2107 (debpaste-paste-is-hidden t))
2108
3280b75e
AB
2109(use-package scpaste
2110 :disabled
2111 :config
2112 (setq scpaste-http-destination "https://p.bndl.org"
2113 scpaste-scp-destination "nix:/var/www/p.bndl.org"))
2114
9ed5410e
AB
2115(use-package eww
2116 :custom
2117 (eww-download-directory (file-name-as-directory
2118 (getenv "XDG_DOWNLOAD_DIR"))))
2119
b57457b2
AB
2120\f
2121;;; Email (with Gnus)
2122
dca50cf5 2123(defvar b/maildir (expand-file-name "~/mail/"))
41d290a2 2124(with-eval-after-load 'recentf
dca50cf5 2125 (add-to-list 'recentf-exclude b/maildir))
41d290a2
AB
2126
2127(setq
dca50cf5 2128 b/gnus-init-file (b/etc "gnus")
41d290a2
AB
2129 mail-user-agent 'gnus-user-agent
2130 read-mail-command 'gnus)
2131
47904cb7 2132(use-package gnus
b1ed18e4 2133 :bind (("s-m" . gnus-plugged)
2e81c51a 2134 ("s-M" . gnus-unplugged)
b1ed18e4 2135 ("C-c a m" . gnus-plugged)
2e81c51a 2136 ("C-c a M" . gnus-unplugged))
41d290a2
AB
2137 :init
2138 (setq
2139 gnus-select-method '(nnnil "")
2140 gnus-secondary-select-methods
d4cc5497 2141 '((nnimap "shemshak"
14bd6398
AB
2142 (nnimap-stream plain)
2143 (nnimap-address "127.0.0.1")
2144 (nnimap-server-port 143)
2145 (nnimap-authenticator plain)
2146 (nnimap-user "amin@shemshak.local"))
2e9074a4 2147 (nnimap "gnu"
14bd6398
AB
2148 (nnimap-stream plain)
2149 (nnimap-address "127.0.0.1")
2150 (nnimap-server-port 143)
2151 (nnimap-authenticator plain)
6283c91e 2152 (nnimap-user "mab@gnu.local")
14bd6398
AB
2153 (nnimap-inbox "INBOX")
2154 (nnimap-split-methods 'nnimap-split-fancy)
2155 (nnimap-split-fancy (|
2156 ;; (: gnus-registry-split-fancy-with-parent)
2157 ;; (: gnus-group-split-fancy "INBOX" t "INBOX")
2158 ;; gnu
2159 (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1")
46d707ed
AB
2160 ;; gnus
2161 (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1")
4319a2ff
AB
2162 ;; libreplanet
2163 (list ".*<\\(.*\\)\\.libreplanet\\.org>.*" "l.\\1")
14bd6398
AB
2164 ;; *.lists.sr.ht, omitting one dot if present
2165 ;; add more \\.?\\([^.]*\\) if needed
2166 (list ".*<~\\(.*\\)/\\([^.]*\\)\\.?\\([^.]*\\)\\.lists.sr.ht>.*" "l.~\\1.\\2\\3")
2167 ;; webmasters
2168 (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters")
2169 ;; other
2170 (list ".*atreus.freelists.org" "l.atreus")
2171 (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec")
2172 ;; (list ".*haskell-art.we.lurk.org" "l.haskell.art") ;d
2173 (list ".*haskell-cafe.haskell.org" "l.haskell-cafe")
2174 ;; (list ".*notmuch.notmuchmail.org" "l.notmuch") ;u
2175 ;; (list ".*dev.lists.parabola.nu" "l.parabola-dev") ;u
2176 ;; ----------------------------------
2177 ;; legend: (u)nsubscribed | (d)ead
2178 ;; ----------------------------------
2179 ;; otherwise, leave mail in INBOX
2180 "INBOX")))
727d14d3 2181 (nnimap "uw"
41d290a2
AB
2182 (nnimap-stream plain)
2183 (nnimap-address "127.0.0.1")
2184 (nnimap-server-port 143)
2185 (nnimap-authenticator plain)
f0d99991
AB
2186 (nnimap-user "abandali@uw.local")
2187 (nnimap-inbox "INBOX")
2188 (nnimap-split-methods 'nnimap-split-fancy)
2189 (nnimap-split-fancy (|
29e42dc1 2190 ;; (: gnus-registry-split-fancy-with-parent)
5b8a18a4 2191 ;; se212-f19
90dc3a58
AB
2192 ("subject" "SE\\s-?212" "course.se212-f19")
2193 (from "SE\\s-?212" "course.se212-f19")
f0d99991
AB
2194 ;; catch-all
2195 "INBOX")))
727d14d3 2196 (nnimap "csc"
41d290a2
AB
2197 (nnimap-stream plain)
2198 (nnimap-address "127.0.0.1")
2199 (nnimap-server-port 143)
2200 (nnimap-authenticator plain)
727d14d3 2201 (nnimap-user "abandali@csc.uw.local")))
95ec8c25 2202 gnus-message-archive-group "nnimap+gnu:INBOX"
41d290a2 2203 gnus-parameters
859ba2a0
AB
2204 '(("l\\.atreus"
2205 (to-address . "atreus@freelists.org")
2206 (to-list . "atreus@freelists.org"))
2207 ("l\\.deepspec"
41d290a2 2208 (to-address . "deepspec@lists.cs.princeton.edu")
778202b8
AB
2209 (to-list . "deepspec@lists.cs.princeton.edu")
2210 (list-identifier . "\\[deepspec\\]"))
cb4015f6 2211 ("l\\.emacs-devel"
74fd778e
AB
2212 (to-address . "emacs-devel@gnu.org")
2213 (to-list . "emacs-devel@gnu.org"))
cb4015f6 2214 ("l\\.help-gnu-emacs"
74fd778e
AB
2215 (to-address . "help-gnu-emacs@gnu.org")
2216 (to-list . "help-gnu-emacs@gnu.org"))
cb4015f6 2217 ("l\\.info-gnu-emacs"
74fd778e
AB
2218 (to-address . "info-gnu-emacs@gnu.org")
2219 (to-list . "info-gnu-emacs@gnu.org"))
cb4015f6 2220 ("l\\.emacs-orgmode"
41d290a2 2221 (to-address . "emacs-orgmode@gnu.org")
778202b8
AB
2222 (to-list . "emacs-orgmode@gnu.org")
2223 (list-identifier . "\\[O\\]"))
cb4015f6 2224 ("l\\.emacs-tangents"
40b9eac1
AB
2225 (to-address . "emacs-tangents@gnu.org")
2226 (to-list . "emacs-tangents@gnu.org"))
69e4b016
AB
2227 ("l\\.emacsconf-committee"
2228 (to-address . "emacsconf-committee@gnu.org")
2229 (to-list . "emacsconf-committee@gnu.org"))
cb4015f6 2230 ("l\\.emacsconf-discuss"
41d290a2
AB
2231 (to-address . "emacsconf-discuss@gnu.org")
2232 (to-list . "emacsconf-discuss@gnu.org"))
cb4015f6 2233 ("l\\.emacsconf-register"
690a977d
AB
2234 (to-address . "emacsconf-register@gnu.org")
2235 (to-list . "emacsconf-register@gnu.org"))
cb4015f6 2236 ("l\\.emacsconf-submit"
690a977d
AB
2237 (to-address . "emacsconf-submit@gnu.org")
2238 (to-list . "emacsconf-submit@gnu.org"))
cb4015f6 2239 ("l\\.fencepost-users"
41d290a2 2240 (to-address . "fencepost-users@gnu.org")
778202b8
AB
2241 (to-list . "fencepost-users@gnu.org")
2242 (list-identifier . "\\[Fencepost-users\\]"))
e7a169d1
AB
2243 ("l\\.gnewsense-art"
2244 (to-address . "gnewsense-art@nongnu.org")
2245 (to-list . "gnewsense-art@nongnu.org")
2246 (list-identifier . "\\[gNewSense-art\\]"))
2247 ("l\\.gnewsense-dev"
2248 (to-address . "gnewsense-dev@nongnu.org")
2249 (to-list . "gnewsense-dev@nongnu.org")
2250 (list-identifier . "\\[Gnewsense-dev\\]"))
7f3d862f 2251 ("l\\.gnewsense-users"
e7a169d1
AB
2252 (to-address . "gnewsense-users@nongnu.org")
2253 (to-list . "gnewsense-users@nongnu.org")
2254 (list-identifier . "\\[gNewSense-users\\]"))
cb4015f6 2255 ("l\\.gnunet-developers"
41d290a2 2256 (to-address . "gnunet-developers@gnu.org")
778202b8
AB
2257 (to-list . "gnunet-developers@gnu.org")
2258 (list-identifier . "\\[GNUnet-developers\\]"))
cb4015f6 2259 ("l\\.help-gnunet"
74fd778e
AB
2260 (to-address . "help-gnunet@gnu.org")
2261 (to-list . "help-gnunet@gnu.org")
2262 (list-identifier . "\\[Help-gnunet\\]"))
cb4015f6 2263 ("l\\.bug-gnuzilla"
74fd778e
AB
2264 (to-address . "bug-gnuzilla@gnu.org")
2265 (to-list . "bug-gnuzilla@gnu.org")
2266 (list-identifier . "\\[Bug-gnuzilla\\]"))
cb4015f6 2267 ("l\\.gnuzilla-dev"
74fd778e
AB
2268 (to-address . "gnuzilla-dev@gnu.org")
2269 (to-list . "gnuzilla-dev@gnu.org")
2270 (list-identifier . "\\[Gnuzilla-dev\\]"))
cb4015f6 2271 ("l\\.guile-devel"
41d290a2
AB
2272 (to-address . "guile-devel@gnu.org")
2273 (to-list . "guile-devel@gnu.org"))
cb4015f6 2274 ("l\\.guile-user"
29e42dc1
AB
2275 (to-address . "guile-user@gnu.org")
2276 (to-list . "guile-user@gnu.org"))
cb4015f6 2277 ("l\\.guix-devel"
41d290a2
AB
2278 (to-address . "guix-devel@gnu.org")
2279 (to-list . "guix-devel@gnu.org"))
cb4015f6 2280 ("l\\.help-guix"
837a23a5
AB
2281 (to-address . "help-guix@gnu.org")
2282 (to-list . "help-guix@gnu.org"))
cb4015f6 2283 ("l\\.info-guix"
74fd778e
AB
2284 (to-address . "info-guix@gnu.org")
2285 (to-list . "info-guix@gnu.org"))
cb4015f6 2286 ("l\\.savannah-hackers-public"
6f25cef1
AB
2287 (to-address . "savannah-hackers-public@gnu.org")
2288 (to-list . "savannah-hackers-public@gnu.org"))
cb4015f6 2289 ("l\\.savannah-users"
6f25cef1
AB
2290 (to-address . "savannah-users@gnu.org")
2291 (to-list . "savannah-users@gnu.org"))
cb4015f6 2292 ("l\\.www-commits"
74fd778e
AB
2293 (to-address . "www-commits@gnu.org")
2294 (to-list . "www-commits@gnu.org"))
cb4015f6 2295 ("l\\.www-discuss"
74fd778e
AB
2296 (to-address . "www-discuss@gnu.org")
2297 (to-list . "www-discuss@gnu.org"))
cb4015f6 2298 ("l\\.haskell-art"
41d290a2 2299 (to-address . "haskell-art@we.lurk.org")
778202b8
AB
2300 (to-list . "haskell-art@we.lurk.org")
2301 (list-identifier . "\\[haskell-art\\]"))
cb4015f6 2302 ("l\\.haskell-cafe"
41d290a2 2303 (to-address . "haskell-cafe@haskell.org")
778202b8
AB
2304 (to-list . "haskell-cafe@haskell.org")
2305 (list-identifier . "\\[Haskell-cafe\\]"))
74fd778e 2306 ("l\\.notmuch"
41d290a2
AB
2307 (to-address . "notmuch@notmuchmail.org")
2308 (to-list . "notmuch@notmuchmail.org"))
cb4015f6 2309 ("l\\.parabola-dev"
41d290a2 2310 (to-address . "dev@lists.parabola.nu")
778202b8
AB
2311 (to-list . "dev@lists.parabola.nu")
2312 (list-identifier . "\\[Dev\\]"))
74fd778e 2313 ("l\\.~bandali\\.public-inbox"
41d290a2
AB
2314 (to-address . "~bandali/public-inbox@lists.sr.ht")
2315 (to-list . "~bandali/public-inbox@lists.sr.ht"))
7c281dfc
AB
2316 ("l\\.~sircmpwn\\.free-writers-club"
2317 (to-address . "~sircmpwn/free-writers-club@lists.sr.ht")
2318 (to-list . "~sircmpwn/free-writers-club@lists.sr.ht"))
cb4015f6 2319 ("l\\.~sircmpwn\\.srht-admins"
41d290a2
AB
2320 (to-address . "~sircmpwn/sr.ht-admins@lists.sr.ht")
2321 (to-list . "~sircmpwn/sr.ht-admins@lists.sr.ht"))
cb4015f6 2322 ("l\\.~sircmpwn\\.srht-announce"
41d290a2
AB
2323 (to-address . "~sircmpwn/sr.ht-announce@lists.sr.ht")
2324 (to-list . "~sircmpwn/sr.ht-announce@lists.sr.ht"))
cb4015f6 2325 ("l\\.~sircmpwn\\.srht-dev"
41d290a2
AB
2326 (to-address . "~sircmpwn/sr.ht-dev@lists.sr.ht")
2327 (to-list . "~sircmpwn/sr.ht-dev@lists.sr.ht"))
cb4015f6 2328 ("l\\.~sircmpwn\\.srht-discuss"
41d290a2
AB
2329 (to-address . "~sircmpwn/sr.ht-discuss@lists.sr.ht")
2330 (to-list . "~sircmpwn/sr.ht-discuss@lists.sr.ht"))
74fd778e
AB
2331 ("webmasters"
2332 (to-address . "webmasters@gnu.org")
2333 (to-list . "webmasters@gnu.org"))
41d290a2
AB
2334 ("gnu.*"
2335 (gcc-self . t))
205cc04b 2336 ("l\\."
262483ba
AB
2337 (subscribed . t))
2338 ("nnimap\\+uw:.*"
2339 (gcc-self . t)))
41d290a2 2340 gnus-large-newsgroup 50
dca50cf5 2341 gnus-home-directory (b/var "gnus/")
41d290a2
AB
2342 gnus-directory (concat gnus-home-directory "news/")
2343 message-directory (concat gnus-home-directory "mail/")
2344 nndraft-directory (concat gnus-home-directory "drafts/")
2345 gnus-save-newsrc-file nil
2346 gnus-read-newsrc-file nil
2347 gnus-interactive-exit nil
2348 gnus-gcc-mark-as-read t)
2349 :config
f02d2b28 2350 (when (version< emacs-version "27")
47904cb7
AB
2351 (with-eval-after-load 'nnmail
2352 (add-to-list
2353 'nnmail-split-abbrev-alist
2354 '(list . "list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop")
2355 t)))
f02d2b28 2356
29e42dc1 2357 ;; (gnus-registry-initialize)
7f88c321 2358
41d290a2
AB
2359 (with-eval-after-load 'recentf
2360 (add-to-list 'recentf-exclude gnus-home-directory)))
2361
47904cb7 2362(use-package gnus-art
41d290a2
AB
2363 :config
2364 (setq
7e1cad06 2365 gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)")
e1f6f6a2
AB
2366 gnus-sorted-header-list '("^From:"
2367 "^X-RT-Originator"
2368 "^Newsgroups:"
2369 "^Subject:"
2370 "^Date:"
2371 "^Envelope-To:"
2372 "^Followup-To:"
2373 "^Reply-To:"
2374 "^Organization:"
2375 "^Summary:"
2376 "^Abstract:"
2377 "^Keywords:"
2378 "^To:"
2379 "^[BGF]?Cc:"
2380 "^Posted-To:"
2381 "^Mail-Copies-To:"
2382 "^Mail-Followup-To:"
2383 "^Apparently-To:"
2384 "^Resent-From:"
2385 "^User-Agent:"
2386 "^X-detected-operating-system:"
2387 "^Message-ID:"
c247fbc8 2388 ;; "^References:"
e1f6f6a2
AB
2389 "^List-Id:"
2390 "^Gnus-Warning:")
2391 gnus-visible-headers (mapconcat 'identity
2392 gnus-sorted-header-list
2393 "\\|")
41d290a2
AB
2394 ;; local-lapsed article dates
2395 ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
2396 gnus-article-date-headers '(user-defined)
2397 gnus-article-time-format
2398 (lambda (time)
2399 (let* ((date (format-time-string "%a, %d %b %Y %T %z" time))
2400 (local (article-make-date-line date 'local))
2401 (combined-lapsed (article-make-date-line date
2402 'combined-lapsed))
2403 (lapsed (progn
2404 (string-match " (.+" combined-lapsed)
2405 (match-string 0 combined-lapsed))))
2406 (concat local lapsed))))
2407 (bind-keys
2408 :map gnus-article-mode-map
2409 ("M-L" . org-store-link)))
2410
47904cb7 2411(use-package gnus-sum
41d290a2 2412 :bind (:map gnus-summary-mode-map
dca50cf5 2413 :prefix-map b/gnus-summary-prefix-map
41d290a2
AB
2414 :prefix "v"
2415 ("r" . gnus-summary-reply)
2416 ("w" . gnus-summary-wide-reply)
2417 ("v" . gnus-summary-show-raw-article))
2418 :config
2419 (bind-keys
2420 :map gnus-summary-mode-map
2421 ("M-L" . org-store-link))
1bd1c701
AB
2422 :hook (gnus-summary-mode . b/no-mouse-autoselect-window)
2423 :custom
2424 (gnus-thread-sort-functions '(gnus-thread-sort-by-number
2425 gnus-thread-sort-by-subject
2426 gnus-thread-sort-by-date)))
41d290a2 2427
47904cb7 2428(use-package gnus-msg
41d290a2 2429 :config
639bdc53
AB
2430 (defvar b/shemshak-signature "Amin Bandali
2431https://shemshak.org/~amin")
dca50cf5 2432 (defvar b/uw-signature "Amin Bandali, MMath Student
4d19e255 2433Cheriton School of Computer Science
e0e5275d 2434University of Waterloo
5b740018 2435https://bandali.eu.org")
dca50cf5 2436 (defvar b/csc-signature "Amin Bandali
7f8a1011 2437System Administrator, Systems Committee
dc12958b
AB
2438Computer Science Club, University of Waterloo
2439https://csclub.uwaterloo.ca/~abandali")
e9abd82c
AB
2440 (setq gnus-message-replysign t
2441 gnus-posting-styles
41d290a2 2442 '((".*"
6283c91e 2443 (address "mab@gnu.org"))
639bdc53
AB
2444 ("nnimap\\+gnu:l\\..*"
2445 (signature nil))
466bb3e0
AB
2446 ("nnimap\\+gnu:.*"
2447 (organization "GNU"))
639bdc53
AB
2448 ((header "subject" "ThankCRM")
2449 (to "webmasters-comment@gnu.org")
2450 (body "")
2451 (eval (setq b/message-cite-say-hi nil)))
95ec8c25 2452 ("nnimap\\+shemshak:.*"
4ed3a945 2453 (address "amin@shemshak.org")
41d290a2 2454 (body "\nBest,\n")
639bdc53 2455 (signature b/shemshak-signature)
95ec8c25 2456 (gcc "nnimap+shemshak:Sent")
dca50cf5 2457 (eval (setq b/message-cite-say-hi t)))
63c1969d 2458 ("nnimap\\+uw:.*"
e7125caf 2459 (address "bandali@uwaterloo.ca")
639bdc53 2460 (body "\nBest,\n")
dca50cf5 2461 (signature b/uw-signature))
262483ba 2462 ("nnimap\\+uw:INBOX"
63c1969d
AB
2463 (gcc "\"nnimap+uw:Sent Items\""))
2464 ("nnimap\\+csc:.*"
e93437ba 2465 (address "bandali@csclub.uwaterloo.ca")
dca50cf5 2466 (signature b/csc-signature)
0567bcba 2467 (gcc "nnimap+csc:Sent"))))
bfda730d
AB
2468 :hook (gnus-message-setup . (lambda ()
2469 (unless (mml-secure-is-encrypted-p)
2470 (mml-secure-message-sign)))))
41d290a2 2471
47904cb7 2472(use-package gnus-topic
41d290a2
AB
2473 :hook (gnus-group-mode . gnus-topic-mode)
2474 :config (setq gnus-topic-line-format "%i[ %A: %(%{%n%}%) ]%v\n"))
2475
47904cb7 2476(use-package gnus-agent
41d290a2
AB
2477 :config
2478 (setq gnus-agent-synchronize-flags 'ask)
2479 :hook (gnus-group-mode . gnus-agent-mode))
2480
47904cb7 2481(use-package gnus-group
41d290a2
AB
2482 :config
2483 (setq gnus-permanently-visible-groups "\\(:INBOX$\\|:gnu$\\)"))
2484
082360a8
AB
2485(comment
2486 ;; problematic with ebdb's popup, *EBDB-Gnus*
47904cb7 2487 (use-package gnus-win
082360a8
AB
2488 :config
2489 (setq gnus-use-full-window nil)))
f485f78e 2490
47904cb7 2491(use-package gnus-dired
348511ef
AB
2492 :commands gnus-dired-mode
2493 :init
2494 (add-hook 'dired-mode-hook 'gnus-dired-mode))
2495
6ca3a7b1 2496(comment
47904cb7 2497 (use-package gnus-utils
6ca3a7b1
AB
2498 :custom
2499 (gnus-completing-read-function 'gnus-ido-completing-read)))
6eb104ff 2500
47904cb7 2501(use-package mm-decode
41d290a2 2502 :config
7e1cad06
AB
2503 (setq mm-discouraged-alternatives '("text/html" "text/richtext")
2504 mm-decrypt-option 'known
2505 mm-verify-option 'known))
41d290a2 2506
47904cb7 2507(use-package mm-uu
bb00c3f9 2508 :config
946188e1
AB
2509 (when (version< "27" emacs-version)
2510 (set-face-attribute 'mm-uu-extract nil :extend t))
1fe01703
AB
2511 :custom
2512 (mm-uu-diff-groups-regexp
2513 "\\(gmane\\|gnu\\|l\\)\\..*\\(diff\\|commit\\|cvs\\|bug\\|dev\\)"))
2514
47904cb7 2515(use-package sendmail
41d290a2 2516 :config
8f8d4c32 2517 (setq sendmail-program (executable-find "msmtp")
41d290a2
AB
2518 ;; message-sendmail-extra-arguments '("-v" "-d")
2519 mail-specify-envelope-from t
2520 mail-envelope-from 'header))
2521
47904cb7 2522(use-package message
bc2f85e1 2523 :bind (:map message-mode-map ("<C-return>" . b/insert-asterism))
41d290a2
AB
2524 :config
2525 ;; redefine for a simplified In-Reply-To header
2526 ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67)
2527 (defun message-make-in-reply-to ()
2528 "Return the In-Reply-To header for this message."
2529 (when message-reply-headers
2530 (let ((from (mail-header-from message-reply-headers))
63102057 2531 (msg-id (mail-header-id message-reply-headers)))
41d290a2
AB
2532 (when from
2533 msg-id))))
2534
dca50cf5 2535 (defconst b/message-cite-style-format "On %Y-%m-%d %l:%M %p, %N wrote:")
41d290a2
AB
2536 (defconst message-cite-style-bandali
2537 '((message-cite-function 'message-cite-original)
2538 (message-citation-line-function 'message-insert-formatted-citation-line)
2539 (message-cite-reply-position 'traditional)
2540 (message-yank-prefix "> ")
2541 (message-yank-cited-prefix ">")
2542 (message-yank-empty-prefix ">")
2543 (message-citation-line-format
dca50cf5
AB
2544 (if b/message-cite-say-hi
2545 (concat "Hi %F,\n\n" b/message-cite-style-format)
2546 b/message-cite-style-format)))
41d290a2
AB
2547 "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
2548 (setq ;; message-cite-style 'message-cite-style-bandali
2549 message-kill-buffer-on-exit t
2550 message-send-mail-function 'message-send-mail-with-sendmail
2551 message-sendmail-envelope-from 'header
2552 message-subscribed-address-functions
2553 '(gnus-find-subscribed-addresses)
2554 message-dont-reply-to-names
6283c91e 2555 "\\(\\(\\(amin\\|mab\\)@shemshak\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(mab\\|bandali\\|aminb?\\)@gnu\\.org\\)\\|\\(a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca\\)\\)")
6eb104ff 2556 ;; (require 'company-ebdb)
41d290a2
AB
2557 :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
2558 (message-mode . flyspell-mode)
2559 (message-mode . (lambda ()
a1e77a3d
AB
2560 ;; (setq-local fill-column b/fill-column
2561 ;; message-fill-column b/fill-column)
41d290a2
AB
2562 (make-local-variable 'company-idle-delay)
2563 (setq company-idle-delay 0.2))))
2564 ;; :custom-face
2565 ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
2566 ;; (message-header-to ((t (:foreground "#111" :weight normal))))
2567 ;; (message-header-cc ((t (:foreground "#333" :weight normal))))
db1cc59c
AB
2568 :custom
2569 (message-elide-ellipsis "[...]\n"))
41d290a2 2570
47904cb7 2571(use-package mml)
54209e74 2572
47904cb7 2573(use-package mml-sec
54209e74
AB
2574 :custom
2575 (mml-secure-openpgp-encrypt-to-self t)
2576 (mml-secure-openpgp-sign-with-sender t))
41d290a2 2577
47904cb7 2578(use-package footnote
41d290a2
AB
2579 :after message
2580 ;; :config
2581 ;; (setq footnote-start-tag ""
2582 ;; footnote-end-tag ""
2583 ;; footnote-style 'unicode)
2584 :bind
2585 (:map message-mode-map
dca50cf5 2586 :prefix-map b/footnote-prefix-map
7cc51891 2587 :prefix "C-c f n"
41d290a2
AB
2588 ("a" . footnote-add-footnote)
2589 ("b" . footnote-back-to-message)
2590 ("c" . footnote-cycle-style)
2591 ("d" . footnote-delete-footnote)
2592 ("g" . footnote-goto-footnote)
2593 ("r" . footnote-renumber-footnotes)
2594 ("s" . footnote-set-style)))
2595
fa3741c7 2596(use-package bbdb
d6cdd1fd 2597 :disabled
24a42bb2 2598 :demand
5b10d879 2599 :after gnus
fa3741c7 2600 :bind (:map gnus-group-mode-map ("e" . bbdb))
5b10d879 2601 :config
fa3741c7
AB
2602 (bbdb-initialize 'gnus 'message)
2603 :custom
2604 (bbdb-complete-mail-allow-cycling t)
2605 (bbdb-user-mail-address-re message-dont-reply-to-names))
41d290a2 2606
d6cdd1fd
AB
2607(use-package ebdb
2608 :demand
2609 :after gnus
2610 :bind (:map gnus-group-mode-map ("e" . ebdb))
2611 :config
2612 (setq ebdb-sources (b/var "ebdb"))
2613 (with-eval-after-load 'swiper
2614 (add-to-list 'swiper-font-lock-exclude 'ebdb-mode t)))
41d290a2 2615
47904cb7 2616(use-package ebdb-com
d6cdd1fd 2617 :after ebdb)
6eb104ff 2618
47904cb7 2619(use-package ebdb-complete
d6cdd1fd
AB
2620 :after ebdb
2621 :config
2622 ;; (setq ebdb-complete-mail 'capf)
2623 (ebdb-complete-enable))
6eb104ff 2624
47904cb7 2625(use-package ebdb-message
d6cdd1fd
AB
2626 :demand
2627 :after ebdb)
41d290a2 2628
d6cdd1fd
AB
2629;; (use-package company-ebdb
2630;; :config
2631;; (defun company-ebdb--post-complete (_) nil))
5b10d879 2632
47904cb7 2633(use-package ebdb-gnus
d6cdd1fd
AB
2634 :after ebdb
2635 :custom
2636 (ebdb-gnus-window-size 0.3))
41d290a2 2637
47904cb7 2638(use-package ebdb-mua
d6cdd1fd
AB
2639 :demand
2640 :after ebdb
2641 :custom (ebdb-mua-pop-up t))
fa3741c7 2642
d6cdd1fd
AB
2643;; (use-package ebdb-message
2644;; :after ebdb)
41d290a2 2645
d6cdd1fd
AB
2646;; (use-package ebdb-vcard
2647;; :after ebdb)
41d290a2 2648
5b10d879 2649(use-package message-x)
41d290a2 2650
b57457b2
AB
2651(comment
2652 (use-package message-x
2653 :custom
2654 (message-x-completion-alist
2655 (quote
2656 (("\\([rR]esent-\\|[rR]eply-\\)?[tT]o:\\|[bB]?[cC][cC]:" . gnus-harvest-find-address)
2657 ((if
2658 (boundp
2659 (quote message-newgroups-header-regexp))
2660 message-newgroups-header-regexp message-newsgroups-header-regexp)
2661 . message-expand-group))))))
2662
2663(comment
2664 (use-package gnus-harvest
2665 :commands gnus-harvest-install
2666 :demand t
2667 :config
2668 (if (featurep 'message-x)
2669 (gnus-harvest-install 'message-x)
2670 (gnus-harvest-install))))
2671
47904cb7 2672(use-package gnus-article-treat-patch
a5cf4300
AB
2673 :disabled
2674 :demand
2675 :load-path "lisp/"
2676 :config
35684c66
AB
2677 ;; note: be sure to customize faces with `:foreground "white"' when
2678 ;; using a theme with a white/light background :)
a5cf4300
AB
2679 (setq ft/gnus-article-patch-conditions
2680 '("^@@ -[0-9]+,[0-9]+ \\+[0-9]+,[0-9]+ @@")))
2681
b57457b2 2682\f
e3e5e846 2683;;; IRC (with ERC and ZNC)
b57457b2 2684
47904cb7 2685(use-package erc
e38333d9 2686 :bind (("C-c b b" . erc-switch-to-buffer)
96840c88
AB
2687 :map erc-mode-map
2688 ("M-a" . erc-track-switch-buffer))
2689 :custom
96840c88
AB
2690 (erc-join-buffer 'bury)
2691 (erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
2692 (erc-nick "bandali")
4d5a11b3 2693 (erc-prompt "erc>")
96840c88
AB
2694 (erc-rename-buffers t)
2695 (erc-server-reconnect-attempts 5)
2696 (erc-server-reconnect-timeout 3)
96840c88 2697 :config
96840c88
AB
2698 (defun erc-cmd-OPME ()
2699 "Request chanserv to op me."
2700 (erc-message "PRIVMSG"
2701 (format "chanserv op %s %s"
2702 (erc-default-target)
2703 (erc-current-nick)) nil))
2704 (defun erc-cmd-DEOPME ()
2705 "Deop myself from current channel."
2706 (erc-cmd-DEOP (format "%s" (erc-current-nick))))
2707 (add-to-list 'erc-modules 'keep-place)
2708 (add-to-list 'erc-modules 'notifications)
b7d4b4b3 2709 (add-to-list 'erc-modules 'smiley)
96840c88 2710 (add-to-list 'erc-modules 'spelling)
5b10d879 2711 (add-to-list 'erc-modules 'scrolltoplace)
cb058d21 2712 (erc-update-modules))
96840c88 2713
47904cb7 2714(use-package erc-fill
e3e5e846
AB
2715 :after erc
2716 :custom
92df6c4f 2717 (erc-fill-column 77)
e3e5e846
AB
2718 (erc-fill-function 'erc-fill-static)
2719 (erc-fill-static-center 18))
2720
47904cb7 2721(use-package erc-pcomplete
e3e5e846
AB
2722 :after erc
2723 :custom
0562e97e 2724 (erc-pcomplete-nick-postfix ", "))
e3e5e846 2725
47904cb7 2726(use-package erc-track
e3e5e846 2727 :after erc
2e81c51a
AB
2728 :bind (("C-c a e t d" . erc-track-disable)
2729 ("C-c a e t e" . erc-track-enable))
e3e5e846 2730 :custom
2384d161 2731 (erc-track-enable-keybindings nil)
e3e5e846
AB
2732 (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
2733 "324" "329" "332" "333" "353" "477"))
7ac2eb50 2734 (erc-track-position-in-mode-line t)
e3e5e846
AB
2735 (erc-track-priority-faces-only 'all)
2736 (erc-track-shorten-function nil))
2737
96840c88
AB
2738(use-package erc-hl-nicks
2739 :after erc)
2740
5b10d879
AB
2741(use-package erc-scrolltoplace
2742 :after erc)
96840c88 2743
925481f2
AB
2744(use-package znc
2745 :bind (("C-c a e e" . znc-erc)
2746 ("C-c a e a" . znc-all))
2747 :config
2748 (let ((pwd (let ((auth (auth-source-search :host "znca")))
2749 (cond
2750 ((null auth) (error "Couldn't find znca's authinfo"))
2751 (t (funcall (plist-get (car auth) :secret)))))))
2752 (setq znc-servers
2753 `(("znc.shemshak.org" 1337 t
2754 ((freenode "amin/freenode" ,pwd)))
2755 ("znc.shemshak.org" 1337 t
2756 ((moznet "amin/moznet" ,pwd)))
2757 ("znc.shemshak.org" 1337 t
2758 ((oftc "amin/oftc" ,pwd)))))))
41d290a2 2759
b57457b2
AB
2760\f
2761;;; Post initialization
2762
41d290a2
AB
2763(message "Loading %s...done (%.3fs)" user-init-file
2764 (float-time (time-subtract (current-time)
dca50cf5 2765 b/before-user-init-time)))
41d290a2
AB
2766
2767;;; init.el ends here