1 ;;; init.el --- Amin Bandali's Emacs config -*- lexical-binding: t; eval: (view-mode 1) -*-
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'.
25 (defvar a
/byte-compiled-init nil
26 "If non-nil, byte-(re)compile init.el on successful tangles.")
28 (defvar a
/before-user-init-time
(current-time)
29 "Value of `current-time' when Emacs begins loading `user-init-file'.")
30 (message "Loading Emacs...done (%.3fs)"
31 (float-time (time-subtract a
/before-user-init-time
34 (defvar a
/gc-cons-threshold gc-cons-threshold
)
35 (defvar a
/gc-cons-percentage gc-cons-percentage
)
36 (defvar a
/file-name-handler-alist file-name-handler-alist
)
37 (setq gc-cons-threshold
(* 400 1024 1024) ; 400 MiB
38 gc-cons-percentage
0.6
39 file-name-handler-alist nil
40 ;; sidesteps a bug when profiling with esup
41 esup-child-profile-require-level
0)
46 (setq gc-cons-threshold a
/gc-cons-threshold
47 gc-cons-percentage a
/gc-cons-percentage
48 file-name-handler-alist a
/file-name-handler-alist
)))
50 (setq message-log-max
20000)
52 ;; (setq byte-compile-warnings
53 ;; '(not free-vars unresolved noruntime lexical make-local))
55 (setq user-full-name
"Amin Bandali"
56 user-mail-address
"amin@bndl.org")
58 ;; Main engine start...
60 (setq straight-repository-branch
"develop"
61 straight-check-for-modifications
'(check-on-save find-when-checking
))
63 (defun a/bootstrap-straight
()
64 (defvar bootstrap-version
)
66 (expand-file-name "straight/repos/straight.el/bootstrap.el" user-emacs-directory
))
67 (bootstrap-version 5))
68 (unless (file-exists-p bootstrap-file
)
70 (url-retrieve-synchronously
71 "https://raw.githubusercontent.com/raxod502/straight.el/develop/install.el"
72 'silent
'inhibit-cookies
)
73 (goto-char (point-max))
74 (eval-print-last-sexp)))
75 (load bootstrap-file nil
'nomessage
)))
77 ;; Solid rocket booster ignition...
79 (defun a/build-init
()
80 (a/bootstrap-straight
)
81 (byte-compile-file "init.el"))
83 (a/bootstrap-straight
)
87 (setq straight-use-package-by-default t
)
89 (defmacro use-feature
(name &rest args
)
90 "Like `use-package', but with `straight-use-package-by-default' disabled."
91 (declare (indent defun
))
96 (with-eval-after-load 'recentf
97 (add-to-list 'recentf-exclude
98 (expand-file-name "~/.emacs.d/straight/build/")))
100 (defun a/reload-init
()
103 (straight-transaction
104 (straight-mark-transaction-as-init)
105 (load (if a
/byte-compiled-init
106 (concat (file-name-sans-extension user-init-file
) ".elc")
109 (straight-use-package 'use-package
)
110 (if nil
; set to t when need to debug init
112 (setq use-package-verbose t
113 use-package-expand-minimally nil
114 use-package-compute-statistics t
116 (require 'use-package
))
117 (setq use-package-verbose nil
118 use-package-expand-minimally t
))
120 (setq use-package-always-defer t
)
123 (use-package no-littering
127 (add-to-list 'savehist-additional-variables
'kill-ring
)
129 (setq auto-save-file-name-transforms
130 `((".*" ,(no-littering-expand-var-file-name "auto-save/") t
))))
135 (setq custom-file
(no-littering-expand-etc-file-name "custom.el"))
136 (when (file-exists-p custom-file
)
138 (setf custom-safe-themes t
))
141 (load (no-littering-expand-etc-file-name "secrets")))
143 (use-package exec-path-from-shell
146 (setq exec-path-from-shell-arguments nil
147 exec-path-from-shell-check-startup-files nil
)
149 (exec-path-from-shell-initialize)
150 ;; while we're at it, let's fix access to our running ssh-agent
151 (exec-path-from-shell-copy-env "SSH_AGENT_PID")
152 (exec-path-from-shell-copy-env "SSH_AUTH_SOCK"))
156 :config
(or (server-running-p) (server-mode)))
158 (setq text-scale-mode-step
1.05)
160 (setq mouse-autoselect-window t
)
162 (defun a/no-mouse-autoselect-window
()
163 (make-local-variable 'mouse-autoselect-window
)
164 (setq mouse-autoselect-window nil
))
166 (setq ;; scroll-margin 1
167 ;; scroll-conservatively 10000
169 scroll-conservatively
10
170 scroll-preserve-screen-position
1)
175 (setq mouse-wheel-scroll-amount
'(1 ((shift) .
1)) ; one line at a time
176 mouse-wheel-progressive-speed nil
; don't accelerate scrolling
177 mouse-wheel-follow-mouse t
)) ; scroll window under mouse
179 (use-feature pixel-scroll
181 :config
(pixel-scroll-mode 1))
183 (setq epg-pinentry-mode
'loopback
)
188 (defmacro a
/setq-every
(value &rest vars
)
189 "Set all the variables from VARS to value VALUE."
190 (declare (indent defun
) (debug t
))
191 `(progn ,@(mapcar (lambda (x) (list 'setq x value
)) vars
)))
193 (defun a/start-process
(program &rest args
)
194 "Same as `start-process', but doesn't bother about name and buffer."
195 (let ((process-name (concat program
"_process"))
196 (buffer-name (generate-new-buffer-name
197 (concat program
"_output"))))
198 (apply #'start-process
199 process-name buffer-name program args
)))
201 (defun a/dired-start-process
(program &optional args
)
202 "Open current file with a PROGRAM."
203 ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
204 ;; be nil, so remove it).
205 (apply #'a
/start-process
207 (remove nil
(list args
(dired-get-file-for-visit)))))
209 ;; (fringe-mode '(3 . 1))
212 (setq disabled-command-function nil
)
214 (setq save-interprogram-paste-before-kill t
)
216 (setq enable-recursive-minibuffers t
217 resize-mini-windows t
)
219 (defalias 'yes-or-no-p
#'y-or-n-p
)
221 (setq initial-buffer-choice t
)
223 (setq initial-scratch-message nil
)
225 (setq initial-major-mode
'text-mode
)
227 (setq inhibit-startup-buffer-menu t
)
229 (advice-add #'display-startup-echo-area-message
:override
#'ignore
)
230 (setq inhibit-startup-screen t
231 inhibit-startup-echo-area-message user-login-name
)
233 (setq frame-title-format
234 '("" invocation-name
" - "
235 (:eval
(if (buffer-file-name)
236 (abbreviate-file-name (buffer-file-name))
239 (setq backup-by-copying t
241 delete-old-versions t
)
243 (global-auto-revert-mode 1)
244 (setq auto-revert-verbose nil
245 global-auto-revert-non-file-buffers nil
)
249 require-final-newline t
254 (with-eval-after-load 'compile
255 (defun a/compilation-finish-function
(buffer outstr
)
256 (unless (string-match "finished" outstr
)
257 (switch-to-buffer-other-window buffer
))
260 (setq compilation-finish-functions
#'a
/compilation-finish-function
)
264 (defadvice compilation-start
265 (around inhibit-display
266 (command &optional mode name-function highlight-regexp
))
267 (if (not (string-match "^\\(find\\|grep\\)" command
))
268 (cl-letf (((symbol-function 'display-buffer
) #'ignore
))
269 (save-window-excursion ad-do-it
))
271 (ad-activate 'compilation-start
))
273 (setq search-default-mode
#'char-fold-to-regexp
)
275 ;; uncomment to extend this behaviour to query-replace
276 ;; (setq replace-char-fold t)
278 (setq-default cursor-type
'bar
)
280 (setq isearch-allow-scroll t
)
285 ("C-c e b" . eval-buffer
)
286 ("C-c e r" . eval-region
)
288 ("C-c e i" . emacs-init-time
)
289 ("C-c e u" . emacs-uptime
)
291 ("C-c F m" . make-frame-command
)
292 ("C-c F d" . delete-frame
)
293 ("C-c F D" . delete-other-frames
)
295 ("C-c o" . other-window
)
297 ("C-S-h C" . describe-char
)
298 ("C-S-h F" . describe-face
)
300 ("C-x k" . kill-this-buffer
)
301 ("C-x K" . kill-buffer
)
303 ("s-p" . beginning-of-buffer
)
304 ("s-n" . end-of-buffer
))
306 (when (display-graphic-p)
307 (unbind-key "C-z" global-map
))
310 :prefix-map a
/straight-prefix-map
312 ("u" . straight-use-package
)
313 ("f" . straight-freeze-versions
)
314 ("t" . straight-thaw-versions
)
315 ("P" . straight-prune-build
)
316 ("g" . straight-get-recipe
)
317 ("r" . a
/reload-init
)
318 ;; M-x ^straight-.*-all$
319 ("a c" . straight-check-all
)
320 ("a f" . straight-fetch-all
)
321 ("a m" . straight-merge-all
)
322 ("a n" . straight-normalize-all
)
323 ("a F" . straight-pull-all
)
324 ("a P" . straight-push-all
)
325 ("a r" . straight-rebuild-all
)
326 ;; M-x ^straight-.*-package$
327 ("p c" . straight-check-package
)
328 ("p f" . straight-fetch-package
)
329 ("p m" . straight-merge-package
)
330 ("p n" . straight-normalize-package
)
331 ("p F" . straight-pull-package
)
332 ("p P" . straight-push-package
)
333 ("p r" . straight-rebuild-package
))
335 (use-package auto-compile
338 (auto-compile-on-load-mode)
339 (auto-compile-on-save-mode)
340 (setq auto-compile-display-buffer nil
341 auto-compile-mode-line-counter t
342 auto-compile-source-recreate-deletes-dest t
343 auto-compile-toggle-deletes-nonlib-dest t
344 auto-compile-update-autoloads t
)
345 (add-hook 'auto-compile-inhibit-compile-hook
346 'auto-compile-inhibit-compile-detached-git-head
))
348 (straight-use-package 'org-plus-contrib
)
353 (setq org-src-tab-acts-natively t
354 org-src-preserve-indentation nil
355 org-edit-src-content-indentation
0
356 org-link-email-description-format
"Email %c: %s" ; %.30s
357 org-highlight-latex-and-related
'(entities)
358 org-use-speed-commands t
359 org-startup-folded
'content
360 org-catch-invisible-edits
'show-and-error
362 (add-to-list 'org-structure-template-alist
'("L" .
"src emacs-lisp") t
)
364 (("C-c a o a" . org-agenda
)
366 ("M-L" . org-insert-last-stored-link
)
368 :hook
((org-mode . org-indent-mode
)
369 (org-mode . auto-fill-mode
)
370 (org-mode . flyspell-mode
))
372 (org-agenda-files '("~/usr/org/todos/personal.org"
373 "~/usr/org/todos/masters.org"))
374 (org-agenda-start-on-weekday 0)
375 (org-latex-packages-alist '(("" "listings") ("" "color")))
377 '(org-block-begin-line ((t (:foreground
"#5a5b5a" :background
"#1d1f21"))))
378 '(org-block ((t (:background
"#1d1f21"))))
379 '(org-latex-and-related ((t (:foreground
"#b294bb")))))
381 (use-feature ox-latex
384 (setq org-latex-listings
'listings
385 ;; org-latex-prefer-user-labels t
387 (add-to-list 'org-latex-classes
388 '("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
389 ("\\section{%s}" .
"\\section*{%s}")
390 ("\\subsection{%s}" .
"\\subsection*{%s}")
391 ("\\subsubsection{%s}" .
"\\subsubsection*{%s}")
392 ("\\paragraph{%s}" .
"\\paragraph*{%s}")
393 ("\\subparagraph{%s}" .
"\\subparagraph*{%s}"))
395 (require 'ox-beamer
))
397 (use-feature ox-extra
399 (ox-extras-activate '(latex-header-blocks ignore-headlines
)))
401 (with-eval-after-load 'org
402 (defvar a
/show-async-tangle-results nil
403 "Keep *emacs* async buffers around for later inspection.")
405 (defvar a
/show-async-tangle-time nil
406 "Show the time spent tangling the file.")
408 (defvar a
/async-tangle-post-compile
409 (when a
/byte-compiled-init
"make build-init")
410 "If non-nil, pass to `compile' after successful tangle.")
412 ;; TODO: look into why directly byte-compiling init.el causes a
413 ;; number of problems, including magit-status not loading (busy
415 (defvar a
/async-tangle-byte-recompile nil
416 "If non-nil, byte-recompile the file on successful tangle.")
418 (defun a/async-babel-tangle
()
419 "Tangle org file asynchronously."
421 (let* ((file-tangle-start-time (current-time))
422 (file (buffer-file-name))
423 (file-nodir (file-name-nondirectory file
))
424 ;; (async-quiet-switch "-q")
425 (file-noext (file-name-sans-extension file
)))
429 (org-babel-tangle-file ,file
))
430 (unless a
/show-async-tangle-results
434 ;; (setq byte-compile-warnings '(not noruntime unresolved))
435 (message "Tangled %s%s"
437 (if a
/show-async-tangle-time
439 (float-time (time-subtract (current-time)
440 ',file-tangle-start-time
)))
442 (when a
/async-tangle-post-compile
443 (compile a
/async-tangle-post-compile
))
444 (when a
/async-tangle-byte-recompile
445 (byte-recompile-file (concat ,file-noext
".el"))))
446 (message "Tangling %s failed" ,file-nodir
))))))))
449 'safe-local-variable-values
450 '(eval add-hook
'after-save-hook
#'a
/async-babel-tangle
'append
'local
))
454 :bind
(("C-x g" . magit-status
)
455 ("s-g s" . magit-status
)
456 ("s-g l" . magit-log-buffer-file
))
458 (magit-add-section-hook 'magit-status-sections-hook
459 'magit-insert-modules
460 'magit-insert-stashes
462 (setq magit-repository-directories
'(("~/" .
0)
464 (nconc magit-section-initial-visibility-alist
465 '(([unpulled status
] . show
)
466 ([unpushed status
] . show
)))
467 :custom-face
(magit-diff-file-heading ((t (:weight normal
)))))
472 (add-to-list 'recentf-exclude
"^/\\(?:ssh\\|su\\|sudo\\)?:")
473 (setq recentf-max-saved-items
40))
480 (:map ivy-minibuffer-map
481 ([escape] . keyboard-escape-quit)
482 ([S-up] . ivy-previous-history-element)
483 ([S-down] . ivy-next-history-element)
484 ("DEL" . ivy-backward-delete-char))
488 ivy-use-virtual-buffers t
489 ivy-virtual-abbreviate 'abbreviate
490 ivy-count-format "%d/%d ")
493 ;; (ivy-minibuffer-match-face-2 ((t (:background "#e99ce8" :weight semi-bold))))
494 ;; (ivy-minibuffer-match-face-3 ((t (:background "#bbbbff" :weight semi-bold))))
495 ;; (ivy-minibuffer-match-face-4 ((t (:background "#ffbbff" :weight semi-bold))))
500 :bind (("C-s" . swiper-isearch)
502 ("C-S-s" . isearch-forward)))
506 :bind (([remap execute-extended-command] . counsel-M-x)
507 ([remap find-file] . counsel-find-file)
508 ("C-c x" . counsel-M-x)
509 ("C-c f ." . counsel-find-file)
510 ("C-c f l" . counsel-find-library)
511 :map minibuffer-local-map
512 ("C-r" . counsel-minibuffer-history))
515 (defalias 'locate #'counsel-locate))
520 :bind ("C-c a s e" . eshell)
522 (eval-when-compile (defvar eshell-prompt-regexp))
523 (defun a/eshell-quit-or-delete-char (arg)
525 (if (and (eolp) (looking-back eshell-prompt-regexp nil))
526 (eshell-life-is-too-much)
529 (defun a/eshell-clear ()
531 (let ((inhibit-read-only t))
535 (defun a/eshell-setup ()
536 (make-local-variable 'company-idle-delay)
537 (defvar company-idle-delay)
538 (setq company-idle-delay nil)
539 (bind-keys :map eshell-mode-map
540 ("C-d" . a/eshell-quit-or-delete-char)
541 ("C-S-l" . a/eshell-clear)
542 ("M-r" . counsel-esh-history)
543 ([tab] . company-complete)))
545 :hook (eshell-mode . a/eshell-setup)
547 (eshell-hist-ignoredups t)
548 (eshell-input-filter 'eshell-input-filter-initial-space))
552 (("C-x C-b" . ibuffer-other-window)
553 :map ibuffer-mode-map
554 ("P" . ibuffer-backward-filter-group)
555 ("N" . ibuffer-forward-filter-group)
556 ("M-p" . ibuffer-do-print)
557 ("M-n" . ibuffer-do-shell-command-pipe-replace))
559 ;; Use human readable Size column instead of original one
560 (define-ibuffer-column size-h
561 (:name "Size" :inline t)
563 ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
564 ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0)))
565 ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
566 (t (format "%8d" (buffer-size)))))
568 (ibuffer-saved-filter-groups
570 ("dired" (mode . dired-mode))
571 ("org" (mode . org-mode))
574 (mode . gnus-group-mode)
575 (mode . gnus-summary-mode)
576 (mode . gnus-article-mode)
577 ;; not really, but...
578 (mode . message-mode)))
596 (mode . emacs-lisp-mode)
598 (mode . haskell-mode)
600 (mode . alloy-mode)))
604 (mode . latex-mode)))
607 (name . "^\\*scratch\\*$")
608 (name . "^\\*Messages\\*$")))
609 ("erc" (mode . erc-mode)))))
611 '((mark modified read-only locked " "
612 (name 18 18 :left :elide)
616 (mode 16 16 :left :elide)
617 " " filename-and-process)
621 :hook (ibuffer . (lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
624 :hook (prog-mode . outline-minor-mode)
627 outline-minor-mode-map
628 ("<s-tab>" . outline-toggle-children)
629 ("M-p" . outline-previous-visible-heading)
630 ("M-n" . outline-next-visible-heading)
631 :prefix-map a/outline-prefix-map
633 ("TAB" . outline-toggle-children)
634 ("a" . outline-hide-body)
635 ("H" . outline-hide-body)
636 ("S" . outline-show-all)
637 ("h" . outline-hide-subtree)
638 ("s" . outline-show-subtree)))
641 :custom (ls-lisp-dirs-first t))
645 (setq dired-listing-switches "-alh"
646 ls-lisp-use-insert-directory-program nil)
648 ;; easily diff 2 marked files
649 ;; https://oremacs.com/2017/03/18/dired-ediff/
650 (defun dired-ediff-files ()
653 (defvar ediff-after-quit-hook-internal)
654 (let ((files (dired-get-marked-files))
655 (wnd (current-window-configuration)))
656 (if (<= (length files) 2)
657 (let ((file1 (car files))
658 (file2 (if (cdr files)
662 (dired-dwim-target-directory)))))
663 (if (file-newer-than-file-p file1 file2)
664 (ediff-files file2 file1)
665 (ediff-files file1 file2))
666 (add-hook 'ediff-after-quit-hook-internal
668 (setq ediff-after-quit-hook-internal nil)
669 (set-window-configuration wnd))))
670 (error "no more than 2 files should be marked"))))
671 :bind (:map dired-mode-map
672 ("b" . dired-up-directory)
673 ("e" . dired-ediff-files)
674 ("E" . dired-toggle-read-only)
675 ("\\" . dired-hide-details-mode)
678 (a/dired-start-process "zathura"))))
679 :hook (dired-mode . dired-hide-details-mode))
683 (temp-buffer-resize-mode)
684 (setq help-window-select t))
688 (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
689 (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
690 (add-to-list 'tramp-default-proxies-alist
691 (list (regexp-quote (system-name)) nil nil)))
694 :config (dash-enable-font-lock))
696 (use-package doc-view
697 :bind (:map doc-view-mode-map
698 ("M-RET" . image-previous-line)))
702 (setq diff-hl-draw-borders nil)
703 (global-diff-hl-mode)
704 :hook (magit-post-refresh . diff-hl-magit-post-refresh))
707 :when (version< "25" emacs-version)
708 :config (global-eldoc-mode))
712 :config (show-paren-mode))
715 :config (column-number-mode))
717 (use-feature savehist
718 :config (savehist-mode))
720 (use-feature saveplace
721 :when (version< "25" emacs-version)
722 :config (save-place-mode))
724 (use-feature prog-mode
725 :config (global-prettify-symbols-mode)
726 (defun indicate-buffer-boundaries-left ()
727 (setq indicate-buffer-boundaries 'left))
728 (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
730 (use-feature text-mode
731 :hook ((text-mode . indicate-buffer-boundaries-left)
732 (text-mode . abbrev-mode)))
737 (:map company-active-map
738 ([tab] . company-complete-common-or-cycle)
739 ([escape] . company-abort
))
741 (company-minimum-prefix-length 1)
742 (company-selection-wrap-around t
)
743 (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
744 (company-dabbrev-downcase nil
)
745 (company-dabbrev-ignore-case nil
)
747 (global-company-mode t
))
749 (use-package flycheck
751 :hook
(prog-mode . flycheck-mode
)
753 (:map flycheck-mode-map
754 ("M-P" . flycheck-previous-error
)
755 ("M-N" . flycheck-next-error
))
757 ;; Use the load-path from running Emacs when checking elisp files
758 (setq flycheck-emacs-lisp-load-path
'inherit
)
760 ;; Only flycheck when I actually save the buffer
761 (setq flycheck-check-syntax-automatically
'(mode-enabled save
)))
763 ;; http://endlessparentheses.com/ispell-and-apostrophes.html
767 ;; ’ can be part of a word
768 (setq ispell-local-dictionary-alist
769 `((nil "[[:alpha:]]" "[^[:alpha:]]"
770 "['\x2019]" nil
("-B") nil utf-8
)))
771 ;; don't send ’ to the subprocess
772 (defun endless/replace-apostrophe
(args)
773 (cons (replace-regexp-in-string
774 "’" "'" (car args
))
776 (advice-add #'ispell-send-string
:filter-args
777 #'endless
/replace-apostrophe
)
779 ;; convert ' back to ’ from the subprocess
780 (defun endless/replace-quote
(args)
781 (if (not (derived-mode-p 'org-mode
))
783 (cons (replace-regexp-in-string
784 "'" "’" (car args
))
786 (advice-add #'ispell-parse-output
:filter-args
787 #'endless
/replace-quote
))
789 (use-feature lisp-mode
791 (add-hook 'emacs-lisp-mode-hook
'outline-minor-mode
)
792 (add-hook 'emacs-lisp-mode-hook
'reveal-mode
)
793 (defun indent-spaces-mode ()
794 (setq indent-tabs-mode nil
))
795 (add-hook 'lisp-interaction-mode-hook
#'indent-spaces-mode
))
797 (use-package alloy-mode
798 :straight
(:host github
:repo
"dwwmmn/alloy-mode")
800 :config
(setq alloy-basic-offset
2))
802 (use-package proof-site
; Proof General
803 :straight proof-general
)
805 (eval-when-compile (defvar lean-mode-map
))
806 (use-package lean-mode
808 :bind
(:map lean-mode-map
809 ("S-SPC" . company-complete
))
811 (require 'lean-input
)
812 (setq default-input-method
"Lean"
813 lean-input-tweak-all
'(lean-input-compose
814 (lean-input-prepend "/")
815 (lean-input-nonempty))
816 lean-input-user-translations
'(("/" "/")))
819 (use-package haskell-mode
821 (setq haskell-indentation-layout-offset
4
822 haskell-indentation-left-offset
4
823 flycheck-checker
'haskell-hlint
824 flycheck-disabled-checkers
'(haskell-stack-ghc haskell-ghc
)))
829 :hook
(haskell-mode . dante-mode
))
831 (use-package hlint-refactor
833 :bind
(:map hlint-refactor-mode-map
834 ("C-c l b" . hlint-refactor-refactor-buffer
)
835 ("C-c l r" . hlint-refactor-refactor-at-point
))
836 :hook
(haskell-mode . hlint-refactor-mode
))
838 (use-package flycheck-haskell
841 (use-package sgml-mode
843 (setq sgml-basic-offset
2))
845 (use-package css-mode
847 (setq css-indent-offset
2))
849 (use-package web-mode
853 web-mode-code-indent-offset
854 web-mode-css-indent-offset
855 web-mode-markup-indent-offset
))
857 (use-package emmet-mode
858 :after
(:any web-mode css-mode sgml-mode
)
859 :bind
* (("C-)" . emmet-next-edit-point
)
860 ("C-(" . emmet-prev-edit-point
))
862 (unbind-key "C-j" emmet-mode-keymap
)
863 (setq emmet-move-cursor-between-quotes t
)
864 :hook
(web-mode css-mode html-mode sgml-mode
))
868 (use-feature geiser-guile
870 (setq geiser-guile-load-path
"~/src/git/guix"))
875 :config
(setq Man-width
80))
877 (use-package which-key
880 (which-key-add-key-based-replacements
881 ;; prefixes for global prefixes and minor modes
885 "C-c 8 -" "typo/dashes"
886 "C-c 8 <" "typo/left-brackets"
887 "C-c 8 >" "typo/right-brackets"
889 "C-x a" "abbrev/expand"
890 "C-x r" "rectangle/register/bookmark"
891 "C-x v" "version control"
892 ;; prefixes for my personal bindings
893 "C-c a" "applications"
897 "C-c p" "package-management"
898 ;; "C-c p e" "package-management/epkg"
899 "C-c p s" "straight.el"
902 "C-c c" "compile-and-comments"
907 "C-c m" "multiple-cursors"
909 "C-c P s" "projectile/search"
910 "C-c P x" "projectile/execute"
911 "C-c P 4" "projectile/other-window"
917 ;; prefixes for major modes
918 (which-key-add-major-mode-key-based-replacements 'message-mode
920 (which-key-add-major-mode-key-based-replacements 'org-mode
921 "C-c C-v" "org-babel")
922 (which-key-add-major-mode-key-based-replacements 'web-mode
923 "C-c C-a" "web/attributes"
924 "C-c C-b" "web/blocks"
926 "C-c C-e" "web/element"
927 "C-c C-t" "web/tags")
931 (which-key-add-column-padding 5)
932 (which-key-max-description-length 32))
934 (add-to-list 'custom-theme-load-path
"~/.emacs.d/lisp")
935 (load-theme 'tangomod t
)
937 (use-package smart-mode-line
938 :commands
(sml/apply-theme
)
943 (use-package doom-themes
)
945 (defvar a
/org-mode-font-lock-keywords
946 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
947 (1 '(:foreground
"#5a5b5a" :background
"#292b2b") t
) ; directive
948 (3 '(:foreground
"#81a2be" :background
"#292b2b") t
) ; kind
949 (4 '(:foreground
"#c5c8c6") t
)))) ; title
951 (defun a/lights-on
()
952 "Enable my favourite light theme."
954 (mapc #'disable-theme custom-enabled-themes
)
955 (load-theme 'tangomod t
)
956 (sml/apply-theme
'automatic
)
957 (font-lock-remove-keywords
958 'org-mode a
/org-mode-font-lock-keywords
))
960 (defun a/lights-off
()
963 (mapc #'disable-theme custom-enabled-themes
)
964 (load-theme 'doom-tomorrow-night t
)
965 (sml/apply-theme
'automatic
)
966 (font-lock-add-keywords
967 'org-mode a
/org-mode-font-lock-keywords t
))
970 ("s-t d" . a
/lights-off
)
971 ("s-t l" . a
/lights-on
))
973 (use-package crux
; results in Waiting for git... [2 times]
975 :bind
(("C-c b k" . crux-kill-other-buffers
)
976 ("C-c d" . crux-duplicate-current-line-or-region
)
977 ("C-c D" . crux-duplicate-and-comment-current-line-or-region
)
978 ("C-c f c" . crux-copy-file-preserve-attributes
)
979 ("C-c f d" . crux-delete-file-and-buffer
)
980 ("C-c f r" . crux-rename-file-and-buffer
)
981 ("C-c j" . crux-top-join-line
)
982 ("C-S-j" . crux-top-join-line
)))
985 :bind
(("C-a" . mwim-beginning-of-code-or-line
)
986 ("C-e" . mwim-end-of-code-or-line
)
987 ("<home>" . mwim-beginning-of-line-or-code
)
988 ("<end>" . mwim-end-of-line-or-code
)))
990 (use-package projectile
991 :bind-keymap
("C-c P" . projectile-command-map
)
995 (defun my-projectile-invalidate-cache (&rest _args
)
996 ;; ignore the args to `magit-checkout'
997 (projectile-invalidate-cache nil
))
999 (eval-after-load 'magit-branch
1001 (advice-add 'magit-checkout
1002 :after
#'my-projectile-invalidate-cache
)
1003 (advice-add 'magit-branch-and-checkout
1004 :after
#'my-projectile-invalidate-cache
)))
1005 :custom
(projectile-completion-system 'ivy
))
1007 (use-package helpful
1010 (("C-S-h c" . helpful-command
)
1011 ("C-S-h f" . helpful-callable
) ; helpful-function
1012 ("C-S-h v" . helpful-variable
)
1013 ("C-S-h k" . helpful-key
)
1014 ("C-S-h p" . helpful-at-point
)))
1016 (use-package unkillable-scratch
1019 (unkillable-scratch 1)
1021 (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
1023 (use-package boxquote
1026 (:prefix-map a
/boxquote-prefix-map
1028 ("b" . boxquote-buffer
)
1029 ("B" . boxquote-insert-buffer
)
1030 ("d" . boxquote-defun
)
1031 ("F" . boxquote-insert-file
)
1032 ("hf" . boxquote-describe-function
)
1033 ("hk" . boxquote-describe-key
)
1034 ("hv" . boxquote-describe-variable
)
1035 ("hw" . boxquote-where-is
)
1036 ("k" . boxquote-kill
)
1037 ("p" . boxquote-paragraph
)
1038 ("q" . boxquote-boxquote
)
1039 ("r" . boxquote-region
)
1040 ("s" . boxquote-shell-command
)
1041 ("t" . boxquote-text
)
1042 ("T" . boxquote-title
)
1043 ("u" . boxquote-unbox
)
1044 ("U" . boxquote-unbox-region
)
1045 ("y" . boxquote-yank
)
1046 ("M-q" . boxquote-fill-paragraph
)
1047 ("M-w" . boxquote-kill-ring-save
)))
1049 (use-package orgalist
1052 :hook
(message-mode . orgalist-mode
))
1057 (typo-global-mode 1)
1058 :hook
(text-mode . typo-mode
))
1060 (use-package hl-todo
1063 (global-hl-todo-mode))
1065 (use-package shrink-path
1069 (defvar user-
@-host
(concat (user-login-name) "@" (system-name) " "))
1070 (defun +eshell
/prompt
()
1071 (let ((base/dir
(shrink-path-prompt default-directory
)))
1072 (concat (propertize user-
@-host
'face
'default
)
1073 (propertize (car base
/dir
)
1074 'face
'font-lock-comment-face
)
1075 (propertize (cdr base
/dir
)
1076 'face
'font-lock-constant-face
)
1077 (propertize "> " 'face
'default
))))
1078 (setq eshell-prompt-regexp
(concat user-
@-host
".*> ")
1079 eshell-prompt-function
#'+eshell
/prompt
))
1081 (use-package eshell-up
1083 :commands eshell-up
)
1085 (use-package multi-term
1087 :bind
(("C-c a s m" . multi-term-dedicated-toggle
)
1089 ("C-c C-j" . term-char-mode
)
1091 ("C-c C-j" . term-line-mode
))
1093 (setq multi-term-program
"/bin/screen"
1094 ;; TODO: add separate bindings for connecting to existing
1095 ;; session vs. always creating a new one
1096 multi-term-dedicated-select-after-open-p t
1097 multi-term-dedicated-window-height
20
1098 multi-term-dedicated-max-window-height
30
1100 '(("C-c C-c" . term-interrupt-subjob
)
1101 ("C-c C-e" . term-send-esc
)
1103 ("C-y" . term-paste
)
1104 ("M-f" . term-send-forward-word
)
1105 ("M-b" . term-send-backward-word
)
1106 ("M-p" . term-send-up
)
1107 ("M-n" . term-send-down
)
1108 ("<C-backspace>" . term-send-backward-kill-word
)
1109 ("<M-DEL>" . term-send-backward-kill-word
)
1110 ("M-d" . term-send-delete-word
)
1111 ("M-," . term-send-raw
)
1112 ("M-." . comint-dynamic-complete
))
1113 term-unbind-key-alist
1114 '("C-z" "C-x" "C-c" "C-h" "C-y" "<ESC>")))
1116 (use-package page-break-lines
1118 (global-page-break-lines-mode))
1120 (use-package expand-region
1121 :bind
("C-=" . er
/expand-region
))
1123 (use-package multiple-cursors
1125 (("C-S-<mouse-1>" . mc
/add-cursor-on-click
)
1126 (:prefix-map a
/mc-prefix-map
1128 ("c" . mc
/edit-lines
)
1129 ("n" . mc
/mark-next-like-this
)
1130 ("p" . mc
/mark-previous-like-this
)
1131 ("a" . mc
/mark-all-like-this
))))
1137 (use-package yasnippet
1140 (defconst yas-verbosity-cur yas-verbosity
)
1141 (setq yas-verbosity
2)
1142 (add-to-list 'yas-snippet-dirs
"~/src/git/guix/etc/snippets")
1144 (setq yas-verbosity yas-verbosity-cur
)
1146 (text-mode . yas-minor-mode
))
1148 (use-package debbugs
1151 :repo
"emacs-straight/debbugs"
1152 :files
(:defaults
"Debbugs.wsdl")))
1154 (use-package org-ref
1156 (a/setq-every
'("~/usr/org/references.bib")
1157 reftex-default-bibliography
1158 org-ref-default-bibliography
)
1160 org-ref-bibliography-notes
"~/usr/org/notes.org"
1161 org-ref-pdf-directory
"~/usr/org/bibtex-pdfs/"))
1164 :commands
(slack-start)
1166 (eval-when-compile ; silence the byte-compiler
1167 (defvar url-http-data nil
)
1168 (defvar url-http-extra-headers nil
)
1169 (defvar url-http-method nil
)
1170 (defvar url-callback-function nil
)
1171 (defvar url-callback-arguments nil
)
1172 (defvar oauth--token-data nil
))
1173 (setq slack-buffer-emojify t
1174 slack-prefer-current-team t
)
1176 (slack-register-team
1177 :name
"nday-students"
1179 :token nday-students-token
1180 :subscribed-channels
'(general)
1181 :full-and-display-names t
)
1182 (add-to-list 'swiper-font-lock-exclude
'slack-message-buffer-mode t
)
1183 (setq lui-time-stamp-format
"[%Y-%m-%d %H:%M:%S]"
1184 lui-time-stamp-only-when-changed-p t
1185 lui-time-stamp-position
'right
)
1187 (("C-c s s" . slack-start
)
1188 ("C-c s u" . slack-select-unread-rooms
)
1189 ("C-c s b" . slack-select-rooms
)
1190 ("C-c s t" . slack-change-current-team
)
1191 ("C-c s c" . slack-ws-close
)
1193 ("M-p" . slack-buffer-goto-prev-message
)
1194 ("M-n" . slack-buffer-goto-next-message
)
1195 ("C-c e" . slack-message-edit
)
1196 ("C-c k" . slack-message-delete
)
1197 ("C-c C-k" . slack-channel-leave
)
1198 ("C-c r a" . slack-message-add-reaction
)
1199 ("C-c r r" . slack-message-remove-reaction
)
1200 ("C-c r s" . slack-message-show-reaction-users
)
1201 ("C-c p l" . slack-room-pins-list
)
1202 ("C-c p a" . slack-message-pins-add
)
1203 ("C-c p r" . slack-message-pins-remove
)
1204 ("@" . slack-message-embed-mention
)
1205 ("#" . slack-message-embed-channel
)))
1210 (setq alert-default-style
'notifier
))
1212 (defvar a
/maildir
(expand-file-name "~/mail/"))
1213 (with-eval-after-load 'recentf
1214 (add-to-list 'recentf-exclude a
/maildir
))
1217 a
/gnus-init-file
(no-littering-expand-etc-file-name "gnus")
1218 mail-user-agent
'gnus-user-agent
1219 read-mail-command
'gnus
)
1222 :bind
(("s-m" . gnus
)
1223 ("s-M" . gnus-unplugged
))
1226 gnus-select-method
'(nnnil "")
1227 gnus-secondary-select-methods
1229 (nnimap-stream plain
)
1230 (nnimap-address "127.0.0.1")
1231 (nnimap-server-port 143)
1232 (nnimap-authenticator plain
)
1233 (nnimap-user "amin@bndl.org"))
1235 (nnimap-stream plain
)
1236 (nnimap-address "127.0.0.1")
1237 (nnimap-server-port 143)
1238 (nnimap-authenticator plain
)
1239 (nnimap-user "abandali@uwaterloo.ca"))
1241 (nnimap-stream plain
)
1242 (nnimap-address "127.0.0.1")
1243 (nnimap-server-port 143)
1244 (nnimap-authenticator plain
)
1245 (nnimap-user "abandali@csclub.uw")))
1246 gnus-message-archive-group
"nnimap+amin:Sent"
1249 (to-address .
"deepspec@lists.cs.princeton.edu")
1250 (to-list .
"deepspec@lists.cs.princeton.edu"))
1251 ("gnu\\.emacs-devel"
1252 (to-address .
"emacs-devel@gnu.org")
1253 (to-list .
"emacs-devel@gnu.org"))
1254 ("gnu\\.emacs-orgmode"
1255 (to-address .
"emacs-orgmode@gnu.org")
1256 (to-list .
"emacs-orgmode@gnu.org"))
1257 ("gnu\\.emacsconf-discuss"
1258 (to-address .
"emacsconf-discuss@gnu.org")
1259 (to-list .
"emacsconf-discuss@gnu.org"))
1260 ("gnu\\.fencepost-users"
1261 (to-address .
"fencepost-users@gnu.org")
1262 (to-list .
"fencepost-users@gnu.org"))
1263 ("gnu\\.gnunet-developers"
1264 (to-address .
"gnunet-developers@gnu.org")
1265 (to-list .
"gnunet-developers@gnu.org"))
1266 ("gnu\\.guile-devel"
1267 (to-address .
"guile-devel@gnu.org")
1268 (to-list .
"guile-devel@gnu.org"))
1270 (to-address .
"guix-devel@gnu.org")
1271 (to-list .
"guix-devel@gnu.org"))
1272 ("gnu\\.haskell-art"
1273 (to-address .
"haskell-art@we.lurk.org")
1274 (to-list .
"haskell-art@we.lurk.org"))
1275 ("gnu\\.haskell-cafe"
1276 (to-address .
"haskell-cafe@haskell.org")
1277 (to-list .
"haskell-cafe@haskell.org"))
1278 ("gnu\\.help-gnu-emacs"
1279 (to-address .
"help-gnu-emacs@gnu.org")
1280 (to-list .
"help-gnu-emacs@gnu.org"))
1281 ("gnu\\.info-gnu-emacs"
1282 (to-address .
"info-gnu-emacs@gnu.org")
1283 (to-list .
"info-gnu-emacs@gnu.org"))
1285 (to-address .
"info-guix@gnu.org")
1286 (to-list .
"info-guix@gnu.org"))
1288 (to-address .
"notmuch@notmuchmail.org")
1289 (to-list .
"notmuch@notmuchmail.org"))
1290 ("gnu\\.parabola-dev"
1291 (to-address .
"dev@lists.parabola.nu")
1292 (to-list .
"dev@lists.parabola.nu"))
1294 (to-address .
"webmasters@gnu.org")
1295 (to-list .
"webmasters@gnu.org"))
1296 ("gnu\\.www-commits"
1297 (to-address .
"www-commits@gnu.org")
1298 (to-list .
"www-commits@gnu.org"))
1299 ("gnu\\.www-discuss"
1300 (to-address .
"www-discuss@gnu.org")
1301 (to-list .
"www-discuss@gnu.org"))
1302 ("gnu\\.~bandali\\.public-inbox"
1303 (to-address .
"~bandali/public-inbox@lists.sr.ht")
1304 (to-list .
"~bandali/public-inbox@lists.sr.ht"))
1305 ("gnu\\.~sircmpwn\\.srht-admins"
1306 (to-address .
"~sircmpwn/sr.ht-admins@lists.sr.ht")
1307 (to-list .
"~sircmpwn/sr.ht-admins@lists.sr.ht"))
1308 ("gnu\\.~sircmpwn\\.srht-announce"
1309 (to-address .
"~sircmpwn/sr.ht-announce@lists.sr.ht")
1310 (to-list .
"~sircmpwn/sr.ht-announce@lists.sr.ht"))
1311 ("gnu\\.~sircmpwn\\.srht-dev"
1312 (to-address .
"~sircmpwn/sr.ht-dev@lists.sr.ht")
1313 (to-list .
"~sircmpwn/sr.ht-dev@lists.sr.ht"))
1314 ("gnu\\.~sircmpwn\\.srht-discuss"
1315 (to-address .
"~sircmpwn/sr.ht-discuss@lists.sr.ht")
1316 (to-list .
"~sircmpwn/sr.ht-discuss@lists.sr.ht"))
1321 gnus-large-newsgroup
50
1322 gnus-home-directory
(no-littering-expand-var-file-name "gnus/")
1323 gnus-directory
(concat gnus-home-directory
"news/")
1324 message-directory
(concat gnus-home-directory
"mail/")
1325 nndraft-directory
(concat gnus-home-directory
"drafts/")
1326 gnus-save-newsrc-file nil
1327 gnus-read-newsrc-file nil
1328 gnus-interactive-exit nil
1329 gnus-gcc-mark-as-read t
)
1333 (require 'ebdb-gnus
)
1335 (with-eval-after-load 'recentf
1336 (add-to-list 'recentf-exclude gnus-home-directory
)))
1338 (use-feature gnus-art
1341 gnus-visible-headers
1342 (concat gnus-visible-headers
"\\|^List-Id:\\|^X-RT-Originator:\\|^User-Agent:")
1343 gnus-sorted-header-list
1344 '("^From:" "^Subject:" "^Summary:" "^Keywords:"
1345 "^Followup-To:" "^To:" "^Cc:" "X-RT-Originator"
1346 "^Newsgroups:" "List-Id:" "^Organization:"
1347 "^User-Agent:" "^Date:")
1348 ;; local-lapsed article dates
1349 ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
1350 gnus-article-date-headers
'(user-defined)
1351 gnus-article-time-format
1353 (let* ((date (format-time-string "%a, %d %b %Y %T %z" time
))
1354 (local (article-make-date-line date
'local
))
1355 (combined-lapsed (article-make-date-line date
1358 (string-match " (.+" combined-lapsed
)
1359 (match-string 0 combined-lapsed
))))
1360 (concat local lapsed
))))
1362 :map gnus-article-mode-map
1363 ("M-L" . org-store-link
)))
1365 (use-feature gnus-sum
1366 :bind
(:map gnus-summary-mode-map
1367 :prefix-map a
/gnus-summary-prefix-map
1369 ("r" . gnus-summary-reply
)
1370 ("w" . gnus-summary-wide-reply
)
1371 ("v" . gnus-summary-show-raw-article
))
1374 :map gnus-summary-mode-map
1375 ("M-L" . org-store-link
))
1376 :hook
(gnus-summary-mode . a
/no-mouse-autoselect-window
))
1378 (use-feature gnus-msg
1380 (setq gnus-posting-styles
1382 (address "amin@bndl.org")
1384 (eval (setq a
/message-cite-say-hi t
)))
1386 (address "bandali@gnu.org")
1387 (eval (set (make-local-variable 'message-user-fqdn
) "fencepost.gnu.org")))
1388 ((header "subject" "ThankCRM")
1389 (to "webmasters-comment@gnu.org")
1390 (body "Added to 2019supporters.html.\n\nMoving to campaigns.\n\n-amin\n")
1391 (eval (setq a
/message-cite-say-hi nil
)))
1392 ("nnimap\\+uwaterloo:.*"
1393 (address "abandali@uwaterloo.ca")
1394 (gcc "\"nnimap+uwaterloo:Sent Items\""))
1395 ("nnimap\\+csclub:.*"
1396 (address "abandali@csclub.uwaterloo.ca")
1397 (gcc "nnimap+csclub:Sent")))))
1399 (use-feature gnus-topic
1400 :hook
(gnus-group-mode . gnus-topic-mode
)
1401 :config
(setq gnus-topic-line-format
"%i[ %A: %(%{%n%}%) ]%v\n"))
1403 (use-feature gnus-agent
1405 (setq gnus-agent-synchronize-flags
'ask
)
1406 :hook
(gnus-group-mode . gnus-agent-mode
))
1408 (use-feature gnus-group
1410 (setq gnus-permanently-visible-groups
"\\(:INBOX$\\|:gnu$\\)"))
1412 (use-feature mm-decode
1414 (setq mm-discouraged-alternatives
'("text/html" "text/richtext")))
1416 (use-feature sendmail
1418 (setq sendmail-program
"/usr/bin/msmtp"
1419 ;; message-sendmail-extra-arguments '("-v" "-d")
1420 mail-specify-envelope-from t
1421 mail-envelope-from
'header
))
1423 (use-feature message
1425 ;; redefine for a simplified In-Reply-To header
1426 ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67)
1427 (defun message-make-in-reply-to ()
1428 "Return the In-Reply-To header for this message."
1429 (when message-reply-headers
1430 (let ((from (mail-header-from message-reply-headers
))
1431 (msg-id (mail-header-id message-reply-headers
)))
1435 (defconst a
/message-cite-style-format
"On %Y-%m-%d %l:%M %p, %N wrote:")
1436 (defconst message-cite-style-bandali
1437 '((message-cite-function 'message-cite-original
)
1438 (message-citation-line-function 'message-insert-formatted-citation-line
)
1439 (message-cite-reply-position 'traditional
)
1440 (message-yank-prefix "> ")
1441 (message-yank-cited-prefix ">")
1442 (message-yank-empty-prefix ">")
1443 (message-citation-line-format
1444 (if a
/message-cite-say-hi
1445 (concat "Hi %F,\n\n" a
/message-cite-style-format
)
1446 a
/message-cite-style-format
)))
1447 "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
1448 (setq ;; message-cite-style 'message-cite-style-bandali
1449 message-kill-buffer-on-exit t
1450 message-send-mail-function
'message-send-mail-with-sendmail
1451 message-sendmail-envelope-from
'header
1452 message-subscribed-address-functions
1453 '(gnus-find-subscribed-addresses)
1454 message-dont-reply-to-names
1455 "\\(\\(amin@bndl\\.org\\)\\|\\(.*@\\(aminb\\|amin\\.bndl\\)\\.org\\)\\|\\(\\(bandali\\|aminb?\\|mab\\)@gnu\\.org\\)\\|\\(a\\(min\\.\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
1456 (require 'company-ebdb
)
1457 :hook
(;; (message-setup . mml-secure-message-sign-pgpmime)
1458 (message-mode . flyspell-mode
)
1459 (message-mode .
(lambda ()
1460 ;; (setq fill-column 65
1461 ;; message-fill-column 65)
1462 (make-local-variable 'company-idle-delay
)
1463 (setq company-idle-delay
0.2))))
1465 ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
1466 ;; (message-header-to ((t (:foreground "#111" :weight normal))))
1467 ;; (message-header-cc ((t (:foreground "#333" :weight normal))))
1470 (with-eval-after-load 'mml-sec
1471 (setq mml-secure-openpgp-encrypt-to-self t
1472 mml-secure-openpgp-sign-with-sender t
))
1474 (use-feature footnote
1477 ;; (setq footnote-start-tag ""
1478 ;; footnote-end-tag ""
1479 ;; footnote-style 'unicode)
1481 (:map message-mode-map
1482 :prefix-map a
/footnote-prefix-map
1484 ("a" . footnote-add-footnote
)
1485 ("b" . footnote-back-to-message
)
1486 ("c" . footnote-cycle-style
)
1487 ("d" . footnote-delete-footnote
)
1488 ("g" . footnote-goto-footnote
)
1489 ("r" . footnote-renumber-footnotes
)
1490 ("s" . footnote-set-style
)))
1493 :straight
(:host github
:repo
"girzel/ebdb")
1495 :bind
(:map gnus-group-mode-map
("e" . ebdb
))
1497 (setq ebdb-sources
(no-littering-expand-var-file-name "ebdb"))
1498 (with-eval-after-load 'swiper
1499 (add-to-list 'swiper-font-lock-exclude
'ebdb-mode t
)))
1501 (use-feature ebdb-com
1504 ;; (use-package ebdb-complete
1507 ;; (ebdb-complete-enable))
1509 (use-package company-ebdb
1511 (defun company-ebdb--post-complete (_) nil
))
1513 (use-feature ebdb-gnus
1516 (ebdb-gnus-window-configuration
1519 (summary 0.25 point
)
1522 (ebdb-gnus 0.3))))))
1524 (use-feature ebdb-mua
1526 ;; :custom (ebdb-mua-pop-up nil)
1529 ;; (use-package ebdb-message
1533 ;; (use-package ebdb-vcard
1536 (use-package message-x
)
1539 :straight
(:host nil
:repo
"https://git.bndl.org/amin/znc.el")
1540 :bind
(("C-c a e e" . znc-erc
)
1541 ("C-c a e a" . znc-all
))
1543 (let ((pwd (let ((auth (auth-source-search :host
"znca")))
1545 ((null auth
) (error "Couldn't find znca's authinfo"))
1546 (t (funcall (plist-get (car auth
) :secret
)))))))
1548 `(("znc.bndl.org" 1337 t
1549 ((freenode "amin/freenode" ,pwd
)))
1550 ("znc.bndl.org" 1337 t
1551 ((moznet "amin/moznet" ,pwd
)))))))
1553 (message "Loading %s...done (%.3fs)" user-init-file
1554 (float-time (time-subtract (current-time)
1555 a
/before-user-init-time
)))
1557 ;;; init.el ends here