1 ;;; init.el --- Amin Bandali's Emacs config -*- lexical-binding: t -*-
3 ;; Copyright (C) 2018-2019 Amin Bandali <bandali@gnu.org>
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.
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.
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/>.
20 ;; Emacs configuration of Amin Bandali, computer scientist, functional
21 ;; programmer, and free software advocate.
23 ;; THIS FILE IS AUTO-GENERATED FROM `init.org'.
27 (defvar a
/byte-compiled-init nil
28 "If non-nil, byte-(re)compile init.el on successful tangles.")
30 (defvar a
/before-user-init-time
(current-time)
31 "Value of `current-time' when Emacs begins loading `user-init-file'.")
32 (message "Loading Emacs...done (%.3fs)"
33 (float-time (time-subtract a
/before-user-init-time
36 (defvar a
/gc-cons-threshold gc-cons-threshold
)
37 (defvar a
/gc-cons-percentage gc-cons-percentage
)
38 (defvar a
/file-name-handler-alist file-name-handler-alist
)
39 (setq gc-cons-threshold
(* 400 1024 1024) ; 400 MiB
40 gc-cons-percentage
0.6
41 file-name-handler-alist nil
42 ;; sidesteps a bug when profiling with esup
43 esup-child-profile-require-level
0)
48 (setq gc-cons-threshold a
/gc-cons-threshold
49 gc-cons-percentage a
/gc-cons-percentage
50 file-name-handler-alist a
/file-name-handler-alist
)))
52 (setq message-log-max
20000)
54 ;; (setq byte-compile-warnings
55 ;; '(not free-vars unresolved noruntime lexical make-local))
57 (setq user-full-name
"Amin Bandali"
58 user-mail-address
"amin@bndl.org")
60 ;; Main engine start...
62 (setq straight-repository-branch
"develop"
63 straight-check-for-modifications
'(check-on-save find-when-checking
))
65 (defun a/bootstrap-straight
()
66 (defvar bootstrap-version
)
68 (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory
))
69 (bootstrap-version 5))
70 (unless (file-exists-p bootstrap-file
)
72 (url-retrieve-synchronously
73 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
74 'silent
'inhibit-cookies
)
75 (goto-char (point-max))
76 (eval-print-last-sexp)))
77 (load bootstrap-file nil
'nomessage
)))
79 ;; Solid rocket booster ignition...
81 (defun a/build-init
()
82 (a/bootstrap-straight
)
83 (byte-compile-file "init.el"))
85 (a/bootstrap-straight
)
89 (setq straight-use-package-by-default t
)
91 (defmacro use-feature
(name &rest args
)
92 "Like `use-package', but with `straight-use-package-by-default' disabled."
93 (declare (indent defun
))
98 (with-eval-after-load 'recentf
99 (add-to-list 'recentf-exclude
100 (expand-file-name "~/.emacs.d/straight/build/")))
102 (defun a/reload-init
()
105 (straight-transaction
106 (straight-mark-transaction-as-init)
107 (load (if a
/byte-compiled-init
108 (concat (file-name-sans-extension user-init-file
) ".elc")
111 (straight-use-package 'use-package
)
112 (if nil
; set to t when need to debug init
114 (setq use-package-verbose t
115 use-package-expand-minimally nil
116 use-package-compute-statistics t
118 (require 'use-package
))
119 (setq use-package-verbose nil
120 use-package-expand-minimally t
))
122 (setq use-package-always-defer t
)
125 (use-package no-littering
129 (add-to-list 'savehist-additional-variables
'kill-ring
)
131 (setq auto-save-file-name-transforms
132 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t
))))
137 (setq custom-file
(no-littering-expand-etc-file-name "custom.el"))
138 (when (file-exists-p custom-file
)
140 (setf custom-safe-themes t
))
143 (load (no-littering-expand-etc-file-name "secrets")))
145 (use-package exec-path-from-shell
148 (setq exec-path-from-shell-arguments nil
149 exec-path-from-shell-check-startup-files nil
)
151 (exec-path-from-shell-initialize)
152 ;; while we're at it, let's fix access to our running ssh-agent
153 (exec-path-from-shell-copy-env "SSH_AGENT_PID")
154 (exec-path-from-shell-copy-env "SSH_AUTH_SOCK"))
158 :config
(or (server-running-p) (server-mode)))
160 (setq text-scale-mode-step
1.05)
162 (setq mouse-autoselect-window t
)
164 (defun a/no-mouse-autoselect-window
()
165 (make-local-variable 'mouse-autoselect-window
)
166 (setq mouse-autoselect-window nil
))
168 (setq ;; scroll-margin 1
169 ;; scroll-conservatively 10000
171 scroll-conservatively
10
172 scroll-preserve-screen-position
1)
177 (setq mouse-wheel-scroll-amount
'(1 ((shift) .
1)) ; one line at a time
178 mouse-wheel-progressive-speed nil
; don't accelerate scrolling
179 mouse-wheel-follow-mouse t
)) ; scroll window under mouse
181 (use-feature pixel-scroll
183 :config
(pixel-scroll-mode 1))
185 (setq epg-pinentry-mode
'loopback
)
190 (defmacro a
/setq-every
(value &rest vars
)
191 "Set all the variables from VARS to value VALUE."
192 (declare (indent defun
) (debug t
))
193 `(progn ,@(mapcar (lambda (x) (list 'setq x value
)) vars
)))
195 (defun a/start-process
(program &rest args
)
196 "Same as `start-process', but doesn't bother about name and buffer."
197 (let ((process-name (concat program
"_process"))
198 (buffer-name (generate-new-buffer-name
199 (concat program
"_output"))))
200 (apply #'start-process
201 process-name buffer-name program args
)))
203 (defun a/dired-start-process
(program &optional args
)
204 "Open current file with a PROGRAM."
205 ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
206 ;; be nil, so remove it).
207 (apply #'a
/start-process
209 (remove nil
(list args
(dired-get-file-for-visit)))))
211 ;; (fringe-mode '(3 . 1))
214 (setq disabled-command-function nil
)
216 (setq save-interprogram-paste-before-kill t
)
218 (setq enable-recursive-minibuffers t
219 resize-mini-windows t
)
221 (defalias 'yes-or-no-p
#'y-or-n-p
)
223 (setq initial-buffer-choice t
)
225 (setq initial-scratch-message nil
)
227 (setq initial-major-mode
'text-mode
)
229 (setq inhibit-startup-buffer-menu t
)
231 (advice-add #'display-startup-echo-area-message
:override
#'ignore
)
232 (setq inhibit-startup-screen t
233 inhibit-startup-echo-area-message user-login-name
)
235 (setq frame-title-format
236 '("" invocation-name
" - "
237 (:eval
(if (buffer-file-name)
238 (abbreviate-file-name (buffer-file-name))
241 (setq backup-by-copying t
243 delete-old-versions t
)
245 (global-auto-revert-mode 1)
246 (setq auto-revert-verbose nil
247 global-auto-revert-non-file-buffers nil
)
251 require-final-newline t
256 (with-eval-after-load 'compile
257 (defun a/compilation-finish-function
(buffer outstr
)
258 (unless (string-match "finished" outstr
)
259 (switch-to-buffer-other-window buffer
))
262 (setq compilation-finish-functions
#'a
/compilation-finish-function
)
266 (defadvice compilation-start
267 (around inhibit-display
268 (command &optional mode name-function highlight-regexp
))
269 (if (not (string-match "^\\(find\\|grep\\)" command
))
270 (cl-letf (((symbol-function 'display-buffer
) #'ignore
))
271 (save-window-excursion ad-do-it
))
273 (ad-activate 'compilation-start
))
275 (setq search-default-mode
#'char-fold-to-regexp
)
277 ;; uncomment to extend this behaviour to query-replace
278 ;; (setq replace-char-fold t)
280 (setq-default cursor-type
'bar
)
282 (setq isearch-allow-scroll t
)
287 ("C-c e b" . eval-buffer
)
288 ("C-c e r" . eval-region
)
290 ("C-c e i" . emacs-init-time
)
291 ("C-c e u" . emacs-uptime
)
293 ("C-c F m" . make-frame-command
)
294 ("C-c F d" . delete-frame
)
295 ("C-c F D" . delete-other-frames
)
297 ("C-c o" . other-window
)
299 ("C-S-h C" . describe-char
)
300 ("C-S-h F" . describe-face
)
302 ("C-x k" . kill-this-buffer
)
303 ("C-x K" . kill-buffer
)
305 ("s-p" . beginning-of-buffer
)
306 ("s-n" . end-of-buffer
))
308 (when (display-graphic-p)
309 (unbind-key "C-z" global-map
))
312 :prefix-map a
/straight-prefix-map
314 ("u" . straight-use-package
)
315 ("f" . straight-freeze-versions
)
316 ("t" . straight-thaw-versions
)
317 ("P" . straight-prune-build
)
318 ("g" . straight-get-recipe
)
319 ("r" . a
/reload-init
)
320 ;; M-x ^straight-.*-all$
321 ("a c" . straight-check-all
)
322 ("a f" . straight-fetch-all
)
323 ("a m" . straight-merge-all
)
324 ("a n" . straight-normalize-all
)
325 ("a F" . straight-pull-all
)
326 ("a P" . straight-push-all
)
327 ("a r" . straight-rebuild-all
)
328 ;; M-x ^straight-.*-package$
329 ("p c" . straight-check-package
)
330 ("p f" . straight-fetch-package
)
331 ("p m" . straight-merge-package
)
332 ("p n" . straight-normalize-package
)
333 ("p F" . straight-pull-package
)
334 ("p P" . straight-push-package
)
335 ("p r" . straight-rebuild-package
))
337 (use-package auto-compile
340 (auto-compile-on-load-mode)
341 (auto-compile-on-save-mode)
342 (setq auto-compile-display-buffer nil
343 auto-compile-mode-line-counter t
344 auto-compile-source-recreate-deletes-dest t
345 auto-compile-toggle-deletes-nonlib-dest t
346 auto-compile-update-autoloads t
)
347 (add-hook 'auto-compile-inhibit-compile-hook
348 'auto-compile-inhibit-compile-detached-git-head
))
350 (straight-use-package 'org-plus-contrib
)
355 (setq org-src-tab-acts-natively t
356 org-src-preserve-indentation nil
357 org-edit-src-content-indentation
0
358 org-link-email-description-format
"Email %c: %s" ; %.30s
359 org-highlight-latex-and-related
'(entities)
360 org-use-speed-commands t
361 org-startup-folded
'content
362 org-catch-invisible-edits
'show-and-error
364 (add-to-list 'org-structure-template-alist
'("L" .
"src emacs-lisp") t
)
366 (("C-c a o a" . org-agenda
)
368 ("M-L" . org-insert-last-stored-link
)
370 :hook
((org-mode . org-indent-mode
)
371 (org-mode . auto-fill-mode
)
372 (org-mode . flyspell-mode
))
374 (org-agenda-files '("~/usr/org/todos/personal.org"
375 "~/usr/org/todos/masters.org"))
376 (org-agenda-start-on-weekday 0)
377 (org-latex-packages-alist '(("" "listings") ("" "color")))
379 '(org-block-begin-line ((t (:foreground
"#5a5b5a" :background
"#1d1f21"))))
380 '(org-block ((t (:background
"#1d1f21"))))
381 '(org-latex-and-related ((t (:foreground
"#b294bb")))))
383 (use-feature ox-latex
386 (setq org-latex-listings
'listings
387 ;; org-latex-prefer-user-labels t
389 (add-to-list 'org-latex-classes
390 '("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
391 ("\\section{%s}" .
"\\section*{%s}")
392 ("\\subsection{%s}" .
"\\subsection*{%s}")
393 ("\\subsubsection{%s}" .
"\\subsubsection*{%s}")
394 ("\\paragraph{%s}" .
"\\paragraph*{%s}")
395 ("\\subparagraph{%s}" .
"\\subparagraph*{%s}"))
397 (require 'ox-beamer
))
399 (use-feature ox-extra
401 (ox-extras-activate '(latex-header-blocks ignore-headlines
)))
403 (with-eval-after-load 'org
404 (defvar a
/show-async-tangle-results nil
405 "Keep *emacs* async buffers around for later inspection.")
407 (defvar a
/show-async-tangle-time nil
408 "Show the time spent tangling the file.")
410 (defvar a
/async-tangle-post-compile
411 (when a
/byte-compiled-init
"make build-init")
412 "If non-nil, pass to `compile' after successful tangle.")
414 ;; TODO: look into why directly byte-compiling init.el causes a
415 ;; number of problems, including magit-status not loading (busy
417 (defvar a
/async-tangle-byte-recompile nil
418 "If non-nil, byte-recompile the file on successful tangle.")
420 (defun a/async-babel-tangle
()
421 "Tangle org file asynchronously."
423 (let* ((file-tangle-start-time (current-time))
424 (file (buffer-file-name))
425 (file-nodir (file-name-nondirectory file
))
426 ;; (async-quiet-switch "-q")
427 (file-noext (file-name-sans-extension file
)))
431 (org-babel-tangle-file ,file
))
432 (unless a
/show-async-tangle-results
436 ;; (setq byte-compile-warnings '(not noruntime unresolved))
437 (message "Tangled %s%s"
439 (if a
/show-async-tangle-time
441 (float-time (time-subtract (current-time)
442 ',file-tangle-start-time
)))
444 (when a
/async-tangle-post-compile
445 (compile a
/async-tangle-post-compile
))
446 (when a
/async-tangle-byte-recompile
447 (byte-recompile-file (concat ,file-noext
".el"))))
448 (message "Tangling %s failed" ,file-nodir
))))))))
451 'safe-local-variable-values
452 '(eval add-hook
'after-save-hook
#'a
/async-babel-tangle
'append
'local
))
456 :bind
(("C-x g" . magit-status
)
457 ("s-g s" . magit-status
)
458 ("s-g l" . magit-log-buffer-file
))
460 (magit-add-section-hook 'magit-status-sections-hook
461 'magit-insert-modules
462 'magit-insert-stashes
464 (setq magit-repository-directories
'(("~/" .
0)
466 (nconc magit-section-initial-visibility-alist
467 '(([unpulled status
] . show
)
468 ([unpushed status
] . show
)))
469 :custom-face
(magit-diff-file-heading ((t (:weight normal
)))))
474 (add-to-list 'recentf-exclude
"^/\\(?:ssh\\|su\\|sudo\\)?:")
475 (setq recentf-max-saved-items
40))
482 (:map ivy-minibuffer-map
483 ([escape] . keyboard-escape-quit)
484 ([S-up] . ivy-previous-history-element)
485 ([S-down] . ivy-next-history-element)
486 ("DEL" . ivy-backward-delete-char))
490 ivy-use-virtual-buffers t
491 ivy-virtual-abbreviate 'abbreviate
492 ivy-count-format "%d/%d ")
495 ;; (ivy-minibuffer-match-face-2 ((t (:background "#e99ce8" :weight semi-bold))))
496 ;; (ivy-minibuffer-match-face-3 ((t (:background "#bbbbff" :weight semi-bold))))
497 ;; (ivy-minibuffer-match-face-4 ((t (:background "#ffbbff" :weight semi-bold))))
502 :bind (("C-s" . swiper-isearch)
504 ("C-S-s" . isearch-forward)))
508 :bind (([remap execute-extended-command] . counsel-M-x)
509 ([remap find-file] . counsel-find-file)
510 ("C-c x" . counsel-M-x)
511 ("C-c f ." . counsel-find-file)
512 ("C-c f l" . counsel-find-library)
513 :map minibuffer-local-map
514 ("C-r" . counsel-minibuffer-history))
517 (defalias 'locate #'counsel-locate))
522 :bind ("C-c a s e" . eshell)
524 (eval-when-compile (defvar eshell-prompt-regexp))
525 (defun a/eshell-quit-or-delete-char (arg)
527 (if (and (eolp) (looking-back eshell-prompt-regexp nil))
528 (eshell-life-is-too-much)
531 (defun a/eshell-clear ()
533 (let ((inhibit-read-only t))
537 (defun a/eshell-setup ()
538 (make-local-variable 'company-idle-delay)
539 (defvar company-idle-delay)
540 (setq company-idle-delay nil)
541 (bind-keys :map eshell-mode-map
542 ("C-d" . a/eshell-quit-or-delete-char)
543 ("C-S-l" . a/eshell-clear)
544 ("M-r" . counsel-esh-history)
545 ([tab] . company-complete)))
547 :hook (eshell-mode . a/eshell-setup)
549 (eshell-hist-ignoredups t)
550 (eshell-input-filter 'eshell-input-filter-initial-space))
554 (("C-x C-b" . ibuffer-other-window)
555 :map ibuffer-mode-map
556 ("P" . ibuffer-backward-filter-group)
557 ("N" . ibuffer-forward-filter-group)
558 ("M-p" . ibuffer-do-print)
559 ("M-n" . ibuffer-do-shell-command-pipe-replace))
561 ;; Use human readable Size column instead of original one
562 (define-ibuffer-column size-h
563 (:name "Size" :inline t)
565 ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
566 ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0)))
567 ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
568 (t (format "%8d" (buffer-size)))))
570 (ibuffer-saved-filter-groups
572 ("dired" (mode . dired-mode))
573 ("org" (mode . org-mode))
576 (mode . gnus-group-mode)
577 (mode . gnus-summary-mode)
578 (mode . gnus-article-mode)
579 ;; not really, but...
580 (mode . message-mode)))
598 (mode . emacs-lisp-mode)
600 (mode . haskell-mode)
602 (mode . alloy-mode)))
606 (mode . latex-mode)))
609 (name . "^\\*scratch\\*$")
610 (name . "^\\*Messages\\*$")))
611 ("erc" (mode . erc-mode)))))
613 '((mark modified read-only locked " "
614 (name 18 18 :left :elide)
618 (mode 16 16 :left :elide)
619 " " filename-and-process)
623 :hook (ibuffer . (lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
626 :hook (prog-mode . outline-minor-mode)
629 outline-minor-mode-map
630 ("<s-tab>" . outline-toggle-children)
631 ("M-p" . outline-previous-visible-heading)
632 ("M-n" . outline-next-visible-heading)
633 :prefix-map a/outline-prefix-map
635 ("TAB" . outline-toggle-children)
636 ("a" . outline-hide-body)
637 ("H" . outline-hide-body)
638 ("S" . outline-show-all)
639 ("h" . outline-hide-subtree)
640 ("s" . outline-show-subtree)))
643 :custom (ls-lisp-dirs-first t))
647 (setq dired-listing-switches "-alh"
648 ls-lisp-use-insert-directory-program nil)
650 ;; easily diff 2 marked files
651 ;; https://oremacs.com/2017/03/18/dired-ediff/
652 (defun dired-ediff-files ()
655 (defvar ediff-after-quit-hook-internal)
656 (let ((files (dired-get-marked-files))
657 (wnd (current-window-configuration)))
658 (if (<= (length files) 2)
659 (let ((file1 (car files))
660 (file2 (if (cdr files)
664 (dired-dwim-target-directory)))))
665 (if (file-newer-than-file-p file1 file2)
666 (ediff-files file2 file1)
667 (ediff-files file1 file2))
668 (add-hook 'ediff-after-quit-hook-internal
670 (setq ediff-after-quit-hook-internal nil)
671 (set-window-configuration wnd))))
672 (error "no more than 2 files should be marked"))))
673 :bind (:map dired-mode-map
674 ("b" . dired-up-directory)
675 ("e" . dired-ediff-files)
676 ("E" . dired-toggle-read-only)
677 ("\\" . dired-hide-details-mode)
680 (a/dired-start-process "zathura"))))
681 :hook (dired-mode . dired-hide-details-mode))
685 (temp-buffer-resize-mode)
686 (setq help-window-select t))
690 (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
691 (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
692 (add-to-list 'tramp-default-proxies-alist
693 (list (regexp-quote (system-name)) nil nil)))
696 :config (dash-enable-font-lock))
698 (use-package doc-view
699 :bind (:map doc-view-mode-map
700 ("M-RET" . image-previous-line)))
704 (setq diff-hl-draw-borders nil)
705 (global-diff-hl-mode)
706 :hook (magit-post-refresh . diff-hl-magit-post-refresh))
709 :when (version< "25" emacs-version)
710 :config (global-eldoc-mode))
714 :config (show-paren-mode))
717 :config (column-number-mode))
719 (use-feature savehist
720 :config (savehist-mode))
722 (use-feature saveplace
723 :when (version< "25" emacs-version)
724 :config (save-place-mode))
726 (use-feature prog-mode
727 :config (global-prettify-symbols-mode)
728 (defun indicate-buffer-boundaries-left ()
729 (setq indicate-buffer-boundaries 'left))
730 (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
732 (use-feature text-mode
733 :hook ((text-mode . indicate-buffer-boundaries-left)
734 (text-mode . abbrev-mode)))
739 (:map company-active-map
740 ([tab] . company-complete-common-or-cycle)
741 ([escape] . company-abort
))
743 (company-minimum-prefix-length 1)
744 (company-selection-wrap-around t
)
745 (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
746 (company-dabbrev-downcase nil
)
747 (company-dabbrev-ignore-case nil
)
749 (global-company-mode t
))
751 (use-package flycheck
753 :hook
(prog-mode . flycheck-mode
)
755 (:map flycheck-mode-map
756 ("M-P" . flycheck-previous-error
)
757 ("M-N" . flycheck-next-error
))
759 ;; Use the load-path from running Emacs when checking elisp files
760 (setq flycheck-emacs-lisp-load-path
'inherit
)
762 ;; Only flycheck when I actually save the buffer
763 (setq flycheck-check-syntax-automatically
'(mode-enabled save
)))
765 ;; http://endlessparentheses.com/ispell-and-apostrophes.html
769 ;; ’ can be part of a word
770 (setq ispell-local-dictionary-alist
771 `((nil "[[:alpha:]]" "[^[:alpha:]]"
772 "['\x2019]" nil
("-B") nil utf-8
)))
773 ;; don't send ’ to the subprocess
774 (defun endless/replace-apostrophe
(args)
775 (cons (replace-regexp-in-string
776 "’" "'" (car args
))
778 (advice-add #'ispell-send-string
:filter-args
779 #'endless
/replace-apostrophe
)
781 ;; convert ' back to ’ from the subprocess
782 (defun endless/replace-quote
(args)
783 (if (not (derived-mode-p 'org-mode
))
785 (cons (replace-regexp-in-string
786 "'" "’" (car args
))
788 (advice-add #'ispell-parse-output
:filter-args
789 #'endless
/replace-quote
))
791 (use-feature lisp-mode
793 (add-hook 'emacs-lisp-mode-hook
'outline-minor-mode
)
794 (add-hook 'emacs-lisp-mode-hook
'reveal-mode
)
795 (defun indent-spaces-mode ()
796 (setq indent-tabs-mode nil
))
797 (add-hook 'lisp-interaction-mode-hook
#'indent-spaces-mode
))
799 (use-package alloy-mode
800 :straight
(:host github
:repo
"dwwmmn/alloy-mode")
802 :config
(setq alloy-basic-offset
2))
804 (use-package proof-site
; Proof General
805 :straight proof-general
)
807 (eval-when-compile (defvar lean-mode-map
))
808 (use-package lean-mode
810 :bind
(:map lean-mode-map
811 ("S-SPC" . company-complete
))
813 (require 'lean-input
)
814 (setq default-input-method
"Lean"
815 lean-input-tweak-all
'(lean-input-compose
816 (lean-input-prepend "/")
817 (lean-input-nonempty))
818 lean-input-user-translations
'(("/" "/")))
821 (use-package haskell-mode
823 (setq haskell-indentation-layout-offset
4
824 haskell-indentation-left-offset
4
825 flycheck-checker
'haskell-hlint
826 flycheck-disabled-checkers
'(haskell-stack-ghc haskell-ghc
)))
831 :hook
(haskell-mode . dante-mode
))
833 (use-package hlint-refactor
835 :bind
(:map hlint-refactor-mode-map
836 ("C-c l b" . hlint-refactor-refactor-buffer
)
837 ("C-c l r" . hlint-refactor-refactor-at-point
))
838 :hook
(haskell-mode . hlint-refactor-mode
))
840 (use-package flycheck-haskell
843 (use-package sgml-mode
845 (setq sgml-basic-offset
2))
847 (use-package css-mode
849 (setq css-indent-offset
2))
851 (use-package web-mode
855 web-mode-code-indent-offset
856 web-mode-css-indent-offset
857 web-mode-markup-indent-offset
))
859 (use-package emmet-mode
860 :after
(:any web-mode css-mode sgml-mode
)
861 :bind
* (("C-)" . emmet-next-edit-point
)
862 ("C-(" . emmet-prev-edit-point
))
864 (unbind-key "C-j" emmet-mode-keymap
)
865 (setq emmet-move-cursor-between-quotes t
)
866 :hook
(web-mode css-mode html-mode sgml-mode
))
870 (use-feature geiser-guile
872 (setq geiser-guile-load-path
"~/src/git/guix"))
877 :config
(setq Man-width
80))
879 (use-package which-key
882 (which-key-add-key-based-replacements
883 ;; prefixes for global prefixes and minor modes
887 "C-c 8 -" "typo/dashes"
888 "C-c 8 <" "typo/left-brackets"
889 "C-c 8 >" "typo/right-brackets"
891 "C-x a" "abbrev/expand"
892 "C-x r" "rectangle/register/bookmark"
893 "C-x v" "version control"
894 ;; prefixes for my personal bindings
895 "C-c a" "applications"
899 "C-c p" "package-management"
900 ;; "C-c p e" "package-management/epkg"
901 "C-c p s" "straight.el"
904 "C-c c" "compile-and-comments"
909 "C-c m" "multiple-cursors"
911 "C-c P s" "projectile/search"
912 "C-c P x" "projectile/execute"
913 "C-c P 4" "projectile/other-window"
919 ;; prefixes for major modes
920 (which-key-add-major-mode-key-based-replacements 'message-mode
922 (which-key-add-major-mode-key-based-replacements 'org-mode
923 "C-c C-v" "org-babel")
924 (which-key-add-major-mode-key-based-replacements 'web-mode
925 "C-c C-a" "web/attributes"
926 "C-c C-b" "web/blocks"
928 "C-c C-e" "web/element"
929 "C-c C-t" "web/tags")
933 (which-key-add-column-padding 5)
934 (which-key-max-description-length 32))
936 (add-to-list 'custom-theme-load-path
"~/.emacs.d/lisp")
937 (load-theme 'tangomod t
)
939 (use-package smart-mode-line
940 :commands
(sml/apply-theme
)
945 (use-package doom-themes
)
947 (defvar a
/org-mode-font-lock-keywords
948 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
949 (1 '(:foreground
"#5a5b5a" :background
"#292b2b") t
) ; directive
950 (3 '(:foreground
"#81a2be" :background
"#292b2b") t
) ; kind
951 (4 '(:foreground
"#c5c8c6") t
)))) ; title
953 (defun a/lights-on
()
954 "Enable my favourite light theme."
956 (mapc #'disable-theme custom-enabled-themes
)
957 (load-theme 'tangomod t
)
958 (sml/apply-theme
'automatic
)
959 (font-lock-remove-keywords
960 'org-mode a
/org-mode-font-lock-keywords
))
962 (defun a/lights-off
()
965 (mapc #'disable-theme custom-enabled-themes
)
966 (load-theme 'doom-tomorrow-night t
)
967 (sml/apply-theme
'automatic
)
968 (font-lock-add-keywords
969 'org-mode a
/org-mode-font-lock-keywords t
))
972 ("s-t d" . a
/lights-off
)
973 ("s-t l" . a
/lights-on
))
975 (use-package crux
; results in Waiting for git... [2 times]
977 :bind
(("C-c b k" . crux-kill-other-buffers
)
978 ("C-c d" . crux-duplicate-current-line-or-region
)
979 ("C-c D" . crux-duplicate-and-comment-current-line-or-region
)
980 ("C-c f c" . crux-copy-file-preserve-attributes
)
981 ("C-c f d" . crux-delete-file-and-buffer
)
982 ("C-c f r" . crux-rename-file-and-buffer
)
983 ("C-c j" . crux-top-join-line
)
984 ("C-S-j" . crux-top-join-line
)))
987 :bind
(("C-a" . mwim-beginning-of-code-or-line
)
988 ("C-e" . mwim-end-of-code-or-line
)
989 ("<home>" . mwim-beginning-of-line-or-code
)
990 ("<end>" . mwim-end-of-line-or-code
)))
992 (use-package projectile
993 :bind-keymap
("C-c P" . projectile-command-map
)
997 (defun my-projectile-invalidate-cache (&rest _args
)
998 ;; ignore the args to `magit-checkout'
999 (projectile-invalidate-cache nil
))
1001 (eval-after-load 'magit-branch
1003 (advice-add 'magit-checkout
1004 :after
#'my-projectile-invalidate-cache
)
1005 (advice-add 'magit-branch-and-checkout
1006 :after
#'my-projectile-invalidate-cache
)))
1007 :custom
(projectile-completion-system 'ivy
))
1009 (use-package helpful
1012 (("C-S-h c" . helpful-command
)
1013 ("C-S-h f" . helpful-callable
) ; helpful-function
1014 ("C-S-h v" . helpful-variable
)
1015 ("C-S-h k" . helpful-key
)
1016 ("C-S-h p" . helpful-at-point
)))
1018 (use-package unkillable-scratch
1021 (unkillable-scratch 1)
1023 (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
1025 (use-package boxquote
1028 (:prefix-map a
/boxquote-prefix-map
1030 ("b" . boxquote-buffer
)
1031 ("B" . boxquote-insert-buffer
)
1032 ("d" . boxquote-defun
)
1033 ("F" . boxquote-insert-file
)
1034 ("hf" . boxquote-describe-function
)
1035 ("hk" . boxquote-describe-key
)
1036 ("hv" . boxquote-describe-variable
)
1037 ("hw" . boxquote-where-is
)
1038 ("k" . boxquote-kill
)
1039 ("p" . boxquote-paragraph
)
1040 ("q" . boxquote-boxquote
)
1041 ("r" . boxquote-region
)
1042 ("s" . boxquote-shell-command
)
1043 ("t" . boxquote-text
)
1044 ("T" . boxquote-title
)
1045 ("u" . boxquote-unbox
)
1046 ("U" . boxquote-unbox-region
)
1047 ("y" . boxquote-yank
)
1048 ("M-q" . boxquote-fill-paragraph
)
1049 ("M-w" . boxquote-kill-ring-save
)))
1051 (use-package orgalist
1054 :hook
(message-mode . orgalist-mode
))
1059 (typo-global-mode 1)
1060 :hook
(text-mode . typo-mode
))
1062 (use-package hl-todo
1065 (global-hl-todo-mode))
1067 (use-package shrink-path
1071 (defvar user-
@-host
(concat (user-login-name) "@" (system-name) " "))
1072 (defun +eshell
/prompt
()
1073 (let ((base/dir
(shrink-path-prompt default-directory
)))
1074 (concat (propertize user-
@-host
'face
'default
)
1075 (propertize (car base
/dir
)
1076 'face
'font-lock-comment-face
)
1077 (propertize (cdr base
/dir
)
1078 'face
'font-lock-constant-face
)
1079 (propertize "> " 'face
'default
))))
1080 (setq eshell-prompt-regexp
(concat user-
@-host
".*> ")
1081 eshell-prompt-function
#'+eshell
/prompt
))
1083 (use-package eshell-up
1085 :commands eshell-up
)
1087 (use-package multi-term
1089 :bind
(("C-c a s m" . multi-term-dedicated-toggle
)
1091 ("C-c C-j" . term-char-mode
)
1093 ("C-c C-j" . term-line-mode
))
1095 (setq multi-term-program
"/bin/screen"
1096 ;; TODO: add separate bindings for connecting to existing
1097 ;; session vs. always creating a new one
1098 multi-term-dedicated-select-after-open-p t
1099 multi-term-dedicated-window-height
20
1100 multi-term-dedicated-max-window-height
30
1102 '(("C-c C-c" . term-interrupt-subjob
)
1103 ("C-c C-e" . term-send-esc
)
1105 ("C-y" . term-paste
)
1106 ("M-f" . term-send-forward-word
)
1107 ("M-b" . term-send-backward-word
)
1108 ("M-p" . term-send-up
)
1109 ("M-n" . term-send-down
)
1110 ("<C-backspace>" . term-send-backward-kill-word
)
1111 ("<M-DEL>" . term-send-backward-kill-word
)
1112 ("M-d" . term-send-delete-word
)
1113 ("M-," . term-send-raw
)
1114 ("M-." . comint-dynamic-complete
))
1115 term-unbind-key-alist
1116 '("C-z" "C-x" "C-c" "C-h" "C-y" "<ESC>")))
1118 (use-package page-break-lines
1120 (global-page-break-lines-mode))
1122 (use-package expand-region
1123 :bind
("C-=" . er
/expand-region
))
1125 (use-package multiple-cursors
1127 (("C-S-<mouse-1>" . mc
/add-cursor-on-click
)
1128 (:prefix-map a
/mc-prefix-map
1130 ("c" . mc
/edit-lines
)
1131 ("n" . mc
/mark-next-like-this
)
1132 ("p" . mc
/mark-previous-like-this
)
1133 ("a" . mc
/mark-all-like-this
))))
1139 (use-package yasnippet
1142 (defconst yas-verbosity-cur yas-verbosity
)
1143 (setq yas-verbosity
2)
1144 (add-to-list 'yas-snippet-dirs
"~/src/git/guix/etc/snippets")
1146 (setq yas-verbosity yas-verbosity-cur
)
1148 (text-mode . yas-minor-mode
))
1150 (use-package debbugs
1153 :repo
"emacs-straight/debbugs"
1154 :files
(:defaults
"Debbugs.wsdl")))
1156 (use-package org-ref
1158 (a/setq-every
'("~/usr/org/references.bib")
1159 reftex-default-bibliography
1160 org-ref-default-bibliography
)
1162 org-ref-bibliography-notes
"~/usr/org/notes.org"
1163 org-ref-pdf-directory
"~/usr/org/bibtex-pdfs/"))
1166 :commands
(slack-start)
1168 (eval-when-compile ; silence the byte-compiler
1169 (defvar url-http-data nil
)
1170 (defvar url-http-extra-headers nil
)
1171 (defvar url-http-method nil
)
1172 (defvar url-callback-function nil
)
1173 (defvar url-callback-arguments nil
)
1174 (defvar oauth--token-data nil
))
1175 (setq slack-buffer-emojify t
1176 slack-prefer-current-team t
)
1178 (slack-register-team
1179 :name
"nday-students"
1181 :token nday-students-token
1182 :subscribed-channels
'(general)
1183 :full-and-display-names t
)
1184 (add-to-list 'swiper-font-lock-exclude
'slack-message-buffer-mode t
)
1185 (setq lui-time-stamp-format
"[%Y-%m-%d %H:%M:%S]"
1186 lui-time-stamp-only-when-changed-p t
1187 lui-time-stamp-position
'right
)
1189 (("C-c s s" . slack-start
)
1190 ("C-c s u" . slack-select-unread-rooms
)
1191 ("C-c s b" . slack-select-rooms
)
1192 ("C-c s t" . slack-change-current-team
)
1193 ("C-c s c" . slack-ws-close
)
1195 ("M-p" . slack-buffer-goto-prev-message
)
1196 ("M-n" . slack-buffer-goto-next-message
)
1197 ("C-c e" . slack-message-edit
)
1198 ("C-c k" . slack-message-delete
)
1199 ("C-c C-k" . slack-channel-leave
)
1200 ("C-c r a" . slack-message-add-reaction
)
1201 ("C-c r r" . slack-message-remove-reaction
)
1202 ("C-c r s" . slack-message-show-reaction-users
)
1203 ("C-c p l" . slack-room-pins-list
)
1204 ("C-c p a" . slack-message-pins-add
)
1205 ("C-c p r" . slack-message-pins-remove
)
1206 ("@" . slack-message-embed-mention
)
1207 ("#" . slack-message-embed-channel
)))
1212 (setq alert-default-style
'notifier
))
1214 (defvar a
/maildir
(expand-file-name "~/mail/"))
1215 (with-eval-after-load 'recentf
1216 (add-to-list 'recentf-exclude a
/maildir
))
1219 a
/gnus-init-file
(no-littering-expand-etc-file-name "gnus")
1220 mail-user-agent
'gnus-user-agent
1221 read-mail-command
'gnus
)
1224 :bind
(("s-m" . gnus
)
1225 ("s-M" . gnus-unplugged
))
1228 gnus-select-method
'(nnnil "")
1229 gnus-secondary-select-methods
1231 (nnimap-stream plain
)
1232 (nnimap-address "127.0.0.1")
1233 (nnimap-server-port 143)
1234 (nnimap-authenticator plain
)
1235 (nnimap-user "amin@bndl.org"))
1237 (nnimap-stream plain
)
1238 (nnimap-address "127.0.0.1")
1239 (nnimap-server-port 143)
1240 (nnimap-authenticator plain
)
1241 (nnimap-user "abandali@uwaterloo.ca"))
1243 (nnimap-stream plain
)
1244 (nnimap-address "127.0.0.1")
1245 (nnimap-server-port 143)
1246 (nnimap-authenticator plain
)
1247 (nnimap-user "abandali@csclub.uw")))
1248 gnus-message-archive-group
"nnimap+amin:Sent"
1251 (to-address .
"deepspec@lists.cs.princeton.edu")
1252 (to-list .
"deepspec@lists.cs.princeton.edu"))
1253 ("gnu\\.emacs-devel"
1254 (to-address .
"emacs-devel@gnu.org")
1255 (to-list .
"emacs-devel@gnu.org"))
1256 ("gnu\\.emacs-orgmode"
1257 (to-address .
"emacs-orgmode@gnu.org")
1258 (to-list .
"emacs-orgmode@gnu.org"))
1259 ("gnu\\.emacsconf-discuss"
1260 (to-address .
"emacsconf-discuss@gnu.org")
1261 (to-list .
"emacsconf-discuss@gnu.org"))
1262 ("gnu\\.fencepost-users"
1263 (to-address .
"fencepost-users@gnu.org")
1264 (to-list .
"fencepost-users@gnu.org"))
1265 ("gnu\\.gnunet-developers"
1266 (to-address .
"gnunet-developers@gnu.org")
1267 (to-list .
"gnunet-developers@gnu.org"))
1268 ("gnu\\.guile-devel"
1269 (to-address .
"guile-devel@gnu.org")
1270 (to-list .
"guile-devel@gnu.org"))
1272 (to-address .
"guix-devel@gnu.org")
1273 (to-list .
"guix-devel@gnu.org"))
1274 ("gnu\\.haskell-art"
1275 (to-address .
"haskell-art@we.lurk.org")
1276 (to-list .
"haskell-art@we.lurk.org"))
1277 ("gnu\\.haskell-cafe"
1278 (to-address .
"haskell-cafe@haskell.org")
1279 (to-list .
"haskell-cafe@haskell.org"))
1280 ("gnu\\.help-gnu-emacs"
1281 (to-address .
"help-gnu-emacs@gnu.org")
1282 (to-list .
"help-gnu-emacs@gnu.org"))
1283 ("gnu\\.info-gnu-emacs"
1284 (to-address .
"info-gnu-emacs@gnu.org")
1285 (to-list .
"info-gnu-emacs@gnu.org"))
1287 (to-address .
"info-guix@gnu.org")
1288 (to-list .
"info-guix@gnu.org"))
1290 (to-address .
"notmuch@notmuchmail.org")
1291 (to-list .
"notmuch@notmuchmail.org"))
1292 ("gnu\\.parabola-dev"
1293 (to-address .
"dev@lists.parabola.nu")
1294 (to-list .
"dev@lists.parabola.nu"))
1296 (to-address .
"webmasters@gnu.org")
1297 (to-list .
"webmasters@gnu.org"))
1298 ("gnu\\.www-commits"
1299 (to-address .
"www-commits@gnu.org")
1300 (to-list .
"www-commits@gnu.org"))
1301 ("gnu\\.www-discuss"
1302 (to-address .
"www-discuss@gnu.org")
1303 (to-list .
"www-discuss@gnu.org"))
1304 ("gnu\\.~bandali\\.public-inbox"
1305 (to-address .
"~bandali/public-inbox@lists.sr.ht")
1306 (to-list .
"~bandali/public-inbox@lists.sr.ht"))
1307 ("gnu\\.~sircmpwn\\.srht-admins"
1308 (to-address .
"~sircmpwn/sr.ht-admins@lists.sr.ht")
1309 (to-list .
"~sircmpwn/sr.ht-admins@lists.sr.ht"))
1310 ("gnu\\.~sircmpwn\\.srht-announce"
1311 (to-address .
"~sircmpwn/sr.ht-announce@lists.sr.ht")
1312 (to-list .
"~sircmpwn/sr.ht-announce@lists.sr.ht"))
1313 ("gnu\\.~sircmpwn\\.srht-dev"
1314 (to-address .
"~sircmpwn/sr.ht-dev@lists.sr.ht")
1315 (to-list .
"~sircmpwn/sr.ht-dev@lists.sr.ht"))
1316 ("gnu\\.~sircmpwn\\.srht-discuss"
1317 (to-address .
"~sircmpwn/sr.ht-discuss@lists.sr.ht")
1318 (to-list .
"~sircmpwn/sr.ht-discuss@lists.sr.ht"))
1323 gnus-large-newsgroup
50
1324 gnus-home-directory
(no-littering-expand-var-file-name "gnus/")
1325 gnus-directory
(concat gnus-home-directory
"news/")
1326 message-directory
(concat gnus-home-directory
"mail/")
1327 nndraft-directory
(concat gnus-home-directory
"drafts/")
1328 gnus-save-newsrc-file nil
1329 gnus-read-newsrc-file nil
1330 gnus-interactive-exit nil
1331 gnus-gcc-mark-as-read t
)
1335 (require 'ebdb-gnus
)
1337 (with-eval-after-load 'recentf
1338 (add-to-list 'recentf-exclude gnus-home-directory
)))
1340 (use-feature gnus-art
1343 gnus-visible-headers
1344 (concat gnus-visible-headers
"\\|^List-Id:\\|^X-RT-Originator:\\|^User-Agent:")
1345 gnus-sorted-header-list
1346 '("^From:" "^Subject:" "^Summary:" "^Keywords:"
1347 "^Followup-To:" "^To:" "^Cc:" "X-RT-Originator"
1348 "^Newsgroups:" "List-Id:" "^Organization:"
1349 "^User-Agent:" "^Date:")
1350 ;; local-lapsed article dates
1351 ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
1352 gnus-article-date-headers
'(user-defined)
1353 gnus-article-time-format
1355 (let* ((date (format-time-string "%a, %d %b %Y %T %z" time
))
1356 (local (article-make-date-line date
'local
))
1357 (combined-lapsed (article-make-date-line date
1360 (string-match " (.+" combined-lapsed
)
1361 (match-string 0 combined-lapsed
))))
1362 (concat local lapsed
))))
1364 :map gnus-article-mode-map
1365 ("M-L" . org-store-link
)))
1367 (use-feature gnus-sum
1368 :bind
(:map gnus-summary-mode-map
1369 :prefix-map a
/gnus-summary-prefix-map
1371 ("r" . gnus-summary-reply
)
1372 ("w" . gnus-summary-wide-reply
)
1373 ("v" . gnus-summary-show-raw-article
))
1376 :map gnus-summary-mode-map
1377 ("M-L" . org-store-link
))
1378 :hook
(gnus-summary-mode . a
/no-mouse-autoselect-window
))
1380 (use-feature gnus-msg
1382 (setq gnus-posting-styles
1384 (address "amin@bndl.org")
1386 (eval (setq a
/message-cite-say-hi t
)))
1388 (address "bandali@gnu.org")
1389 (eval (set (make-local-variable 'message-user-fqdn
) "fencepost.gnu.org")))
1390 ((header "subject" "ThankCRM")
1391 (to "webmasters-comment@gnu.org")
1392 (body "Added to 2019supporters.html.\n\nMoving to campaigns.\n\n-amin\n")
1393 (eval (setq a
/message-cite-say-hi nil
)))
1394 ("nnimap\\+uwaterloo:.*"
1395 (address "abandali@uwaterloo.ca")
1396 (gcc "\"nnimap+uwaterloo:Sent Items\""))
1397 ("nnimap\\+csclub:.*"
1398 (address "abandali@csclub.uwaterloo.ca")
1399 (gcc "nnimap+csclub:Sent")))))
1401 (use-feature gnus-topic
1402 :hook
(gnus-group-mode . gnus-topic-mode
)
1403 :config
(setq gnus-topic-line-format
"%i[ %A: %(%{%n%}%) ]%v\n"))
1405 (use-feature gnus-agent
1407 (setq gnus-agent-synchronize-flags
'ask
)
1408 :hook
(gnus-group-mode . gnus-agent-mode
))
1410 (use-feature gnus-group
1412 (setq gnus-permanently-visible-groups
"\\(:INBOX$\\|:gnu$\\)"))
1414 (use-feature mm-decode
1416 (setq mm-discouraged-alternatives
'("text/html" "text/richtext")))
1418 (use-feature sendmail
1420 (setq sendmail-program
"/usr/bin/msmtp"
1421 ;; message-sendmail-extra-arguments '("-v" "-d")
1422 mail-specify-envelope-from t
1423 mail-envelope-from
'header
))
1425 (use-feature message
1427 ;; redefine for a simplified In-Reply-To header
1428 ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67)
1429 (defun message-make-in-reply-to ()
1430 "Return the In-Reply-To header for this message."
1431 (when message-reply-headers
1432 (let ((from (mail-header-from message-reply-headers
))
1433 (msg-id (mail-header-id message-reply-headers
)))
1437 (defconst a
/message-cite-style-format
"On %Y-%m-%d %l:%M %p, %N wrote:")
1438 (defconst message-cite-style-bandali
1439 '((message-cite-function 'message-cite-original
)
1440 (message-citation-line-function 'message-insert-formatted-citation-line
)
1441 (message-cite-reply-position 'traditional
)
1442 (message-yank-prefix "> ")
1443 (message-yank-cited-prefix ">")
1444 (message-yank-empty-prefix ">")
1445 (message-citation-line-format
1446 (if a
/message-cite-say-hi
1447 (concat "Hi %F,\n\n" a
/message-cite-style-format
)
1448 a
/message-cite-style-format
)))
1449 "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
1450 (setq ;; message-cite-style 'message-cite-style-bandali
1451 message-kill-buffer-on-exit t
1452 message-send-mail-function
'message-send-mail-with-sendmail
1453 message-sendmail-envelope-from
'header
1454 message-subscribed-address-functions
1455 '(gnus-find-subscribed-addresses)
1456 message-dont-reply-to-names
1457 "\\(\\(amin@bndl\\.org\\)\\|\\(.*@\\(aminb\\|amin\\.bndl\\)\\.org\\)\\|\\(\\(bandali\\|aminb?\\|mab\\)@gnu\\.org\\)\\|\\(a\\(min\\.\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
1458 (require 'company-ebdb
)
1459 :hook
(;; (message-setup . mml-secure-message-sign-pgpmime)
1460 (message-mode . flyspell-mode
)
1461 (message-mode .
(lambda ()
1462 ;; (setq fill-column 65
1463 ;; message-fill-column 65)
1464 (make-local-variable 'company-idle-delay
)
1465 (setq company-idle-delay
0.2))))
1467 ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
1468 ;; (message-header-to ((t (:foreground "#111" :weight normal))))
1469 ;; (message-header-cc ((t (:foreground "#333" :weight normal))))
1472 (with-eval-after-load 'mml-sec
1473 (setq mml-secure-openpgp-encrypt-to-self t
1474 mml-secure-openpgp-sign-with-sender t
))
1476 (use-feature footnote
1479 ;; (setq footnote-start-tag ""
1480 ;; footnote-end-tag ""
1481 ;; footnote-style 'unicode)
1483 (:map message-mode-map
1484 :prefix-map a
/footnote-prefix-map
1486 ("a" . footnote-add-footnote
)
1487 ("b" . footnote-back-to-message
)
1488 ("c" . footnote-cycle-style
)
1489 ("d" . footnote-delete-footnote
)
1490 ("g" . footnote-goto-footnote
)
1491 ("r" . footnote-renumber-footnotes
)
1492 ("s" . footnote-set-style
)))
1495 :straight
(:host github
:repo
"girzel/ebdb")
1497 :bind
(:map gnus-group-mode-map
("e" . ebdb
))
1499 (setq ebdb-sources
(no-littering-expand-var-file-name "ebdb"))
1500 (with-eval-after-load 'swiper
1501 (add-to-list 'swiper-font-lock-exclude
'ebdb-mode t
)))
1503 (use-feature ebdb-com
1506 ;; (use-package ebdb-complete
1509 ;; (ebdb-complete-enable))
1511 (use-package company-ebdb
1513 (defun company-ebdb--post-complete (_) nil
))
1515 (use-feature ebdb-gnus
1518 (ebdb-gnus-window-configuration
1521 (summary 0.25 point
)
1524 (ebdb-gnus 0.3))))))
1526 (use-feature ebdb-mua
1528 ;; :custom (ebdb-mua-pop-up nil)
1531 ;; (use-package ebdb-message
1535 ;; (use-package ebdb-vcard
1538 (use-package message-x
)
1541 :straight
(:host nil
:repo
"https://git.bndl.org/amin/znc.el")
1542 :bind
(("C-c a e e" . znc-erc
)
1543 ("C-c a e a" . znc-all
))
1545 (let ((pwd (let ((auth (auth-source-search :host
"znca")))
1547 ((null auth
) (error "Couldn't find znca's authinfo"))
1548 (t (funcall (plist-get (car auth
) :secret
)))))))
1550 `(("znc.bndl.org" 1337 t
1551 ((freenode "amin/freenode" ,pwd
)))
1552 ("znc.bndl.org" 1337 t
1553 ((moznet "amin/moznet" ,pwd
)))))))
1555 (message "Loading %s...done (%.3fs)" user-init-file
1556 (float-time (time-subtract (current-time)
1557 a
/before-user-init-time
)))
1559 ;;; init.el ends here