1 ;;; init.el --- bandali's emacs configuration -*- 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 activist. Used to use straight.el
22 ;; for purely functional and fully reproducible package management.
23 ;; Now I just use Guix.
25 ;; Over the years, I've taken inspiration from configurations of many
26 ;; great people. Some that I can remember off the top of my head are:
28 ;; - https://github.com/dieggsy/dotfiles
29 ;; - https://github.com/dakra/dmacs
30 ;; - http://pages.sachachua.com/.emacs.d/Sacha.html
31 ;; - https://github.com/dakrone/eos
32 ;; - http://doc.rix.si/cce/cce.html
33 ;; - https://github.com/jwiegley/dot-emacs
34 ;; - https://github.com/wasamasa/dotemacs
35 ;; - https://github.com/hlissner/doom-emacs
39 ;;; Emacs initialization
41 (defvar b
/before-user-init-time
(current-time)
42 "Value of `current-time' when Emacs begins loading `user-init-file'.")
43 (message "Loading Emacs...done (%.3fs)"
44 (float-time (time-subtract b
/before-user-init-time
47 ;; temporarily increase `gc-cons-threshhold' and `gc-cons-percentage'
48 ;; during startup to reduce garbage collection frequency. clearing
49 ;; `file-name-handler-alist' seems to help reduce startup time too.
50 (defvar b
/gc-cons-threshold gc-cons-threshold
)
51 (defvar b
/gc-cons-percentage gc-cons-percentage
)
52 (defvar b
/file-name-handler-alist file-name-handler-alist
)
53 (setq gc-cons-threshold
(* 400 1024 1024) ; 400 MiB
54 gc-cons-percentage
0.6
55 file-name-handler-alist nil
56 ;; sidesteps a bug when profiling with esup
57 esup-child-profile-require-level
0)
59 ;; set them back to their defaults once we're done initializing
61 (setq gc-cons-threshold b
/gc-cons-threshold
62 gc-cons-percentage b
/gc-cons-percentage
63 file-name-handler-alist b
/file-name-handler-alist
))
64 (add-hook 'after-init-hook
#'b
/post-init
)
66 ;; increase number of lines kept in *Messages* log
67 (setq message-log-max
20000)
69 ;; optionally, uncomment to supress some byte-compiler warnings
70 ;; (see C-h v byte-compile-warnings RET for more info)
71 ;; (setq byte-compile-warnings
72 ;; '(not free-vars unresolved noruntime lexical make-local))
77 (setq user-full-name
"Amin Bandali"
78 user-mail-address
"bandali@gnu.org")
83 ;; useful for commenting out multiple sexps at a time
84 (defmacro comment
(&rest _
)
85 "Comment out one or more s-expressions."
86 (declare (indent defun
))
91 (if nil
; set to t when need to debug init
93 (setq use-package-verbose t
94 use-package-expand-minimally nil
95 use-package-compute-statistics t
97 (require 'use-package
))
98 (setq use-package-verbose nil
99 use-package-expand-minimally t
))
101 (setq use-package-always-defer t
)
104 (use-package delight
)
109 ;; keep ~/.emacs.d clean
112 (convert-standard-filename "etc/") user-emacs-directory
)
113 "The directory where packages place their configuration files.")
117 (convert-standard-filename "var/") user-emacs-directory
)
118 "The directory where packages place their persistent data files.")
121 "Expand filename FILE relative to `b/etc-dir'."
122 (expand-file-name (convert-standard-filename file
) b
/etc-dir
))
125 "Expand filename FILE relative to `b/var-dir'."
126 (expand-file-name (convert-standard-filename file
) b
/var-dir
))
129 auto-save-list-file-prefix
(b/var
"auto-save/sessions/")
130 nsm-settings-file
(b/var
"nsm-settings.el"))
132 ;; separate custom file (don't want it mixing with init.el)
136 (setq custom-file
(b/etc
"custom.el"))
137 (when (file-exists-p custom-file
)
139 ;; while at it, treat themes as safe
140 (setf custom-safe-themes t
))
142 ;; load the secrets file if it exists, otherwise show a warning
145 (load (b/etc
"secrets"))))
147 ;; better $PATH (and other environment variable) handling
148 (use-package exec-path-from-shell
151 (setq exec-path-from-shell-arguments nil
152 exec-path-from-shell-check-startup-files nil
)
154 (exec-path-from-shell-initialize)
155 ;; while we're at it, let's fix access to our running ssh-agent
156 (exec-path-from-shell-copy-env "SSH_AGENT_PID")
157 (exec-path-from-shell-copy-env "SSH_AUTH_SOCK"))
159 ;; only one custom theme at a time
161 (defadvice load-theme
(before clear-previous-themes activate
)
162 "Clear existing theme settings instead of layering them"
163 (mapc #'disable-theme custom-enabled-themes
)))
165 ;; start up emacs server. see
166 ;; https://www.gnu.org/software/emacs/manual/html_node/emacs/Emacs-Server.html#Emacs-Server
169 :config
(or (server-running-p) (server-mode)))
173 (dolist (ft (fontset-list))
177 (font-spec :name
"Source Code Pro" :size
14))
181 (font-spec :name
"DejaVu Sans Mono")
188 ;; :name "Symbola monospacified for DejaVu Sans Mono")
194 ;; (font-spec :name "DejaVu Sans Mono")
200 (font-spec :name
"DejaVu Sans Mono" :size
14)
204 ;; gentler font resizing
205 (setq text-scale-mode-step
1.05)
207 ;; focus follows mouse
208 (setq mouse-autoselect-window t
)
210 (defun b/no-mouse-autoselect-window
()
211 "Conveniently disable `focus-follows-mouse'.
212 For disabling the behaviour for certain buffers and/or modes."
213 (make-local-variable 'mouse-autoselect-window
)
214 (setq mouse-autoselect-window nil
))
217 (setq ;; scroll-margin 1
218 ;; scroll-conservatively 10000
220 scroll-conservatively
10
221 scroll-preserve-screen-position
1)
226 (setq mouse-wheel-scroll-amount
'(1 ((shift) .
1)) ; one line at a time
227 mouse-wheel-progressive-speed nil
; don't accelerate scrolling
228 mouse-wheel-follow-mouse t
)) ; scroll window under mouse
230 (use-package pixel-scroll
232 :config
(pixel-scroll-mode 1))
234 ;; ask for GPG passphrase in minibuffer
237 ; this will fail if gpg>=2.1 is not available
238 (epa-pinentry-mode 'loopback
))
240 (use-package epg-config
243 ((epg-gpg-program (executable-find "gpg"))
244 (epg-pinentry-mode 'loopback
)))
249 (use-package pinentry
251 :after
(epa epg server
)
253 (setq pinentry--socket-dir server-socket-dir
)
263 (defmacro b
/setq-every
(value &rest vars
)
264 "Set all the variables from VARS to value VALUE."
265 (declare (indent defun
) (debug t
))
266 `(progn ,@(mapcar (lambda (x) (list 'setq x value
)) vars
)))
268 (defun b/start-process
(program &rest args
)
269 "Same as `start-process', but doesn't bother about name and buffer."
270 (let ((process-name (concat program
"_process"))
271 (buffer-name (generate-new-buffer-name
272 (concat program
"_output"))))
273 (apply #'start-process
274 process-name buffer-name program args
)))
276 (defun b/dired-start-process
(program &optional args
)
277 "Open current file with a PROGRAM."
278 ;; Shell command looks like this: "program [ARGS]... FILE" (ARGS can
279 ;; be nil, so remove it).
280 (apply #'b
/start-process
282 (remove nil
(list args
(dired-get-file-for-visit)))))
284 (defun b/add-elisp-section
()
288 (insert "\n\f\n;;; "))
293 ;; time and battery in mode-line
297 (setq display-time-default-load-average nil
)
303 (display-battery-mode)))
306 ;; (fringe-mode '(3 . 1))
309 ;; disable disabled commands
310 (setq disabled-command-function nil
)
312 ;; Save what I copy into clipboard from other applications into Emacs'
313 ;; kill-ring, which would allow me to still be able to easily access
314 ;; it in case I kill (cut or copy) something else inside Emacs before
315 ;; yanking (pasting) what I'd originally intended to.
316 (setq save-interprogram-paste-before-kill t
)
319 (setq enable-recursive-minibuffers t
320 resize-mini-windows t
)
322 ;; lazy-person-friendly yes/no prompts
323 (defalias 'yes-or-no-p
#'y-or-n-p
)
325 ;; i want *scratch* as my startup buffer
326 (setq initial-buffer-choice t
)
328 ;; i don't need the default hint
329 (setq initial-scratch-message nil
)
331 ;; use customizable text-mode as major mode for *scratch*
332 (setq initial-major-mode
'text-mode
)
334 ;; inhibit buffer list when more than 2 files are loaded
335 (setq inhibit-startup-buffer-menu t
)
337 ;; don't need to see the startup screen or the echo area message
338 (advice-add #'display-startup-echo-area-message
:override
#'ignore
)
339 (setq inhibit-startup-screen t
340 inhibit-startup-echo-area-message user-login-name
)
342 ;; more useful frame titles
343 (setq frame-title-format
344 '("" invocation-name
" - "
345 (:eval
(if (buffer-file-name)
346 (abbreviate-file-name (buffer-file-name))
349 ;; backups (C-h v make-backup-files RET)
350 (setq backup-by-copying t
351 backup-directory-alist
(list (cons "." (b/var
"backup/")))
353 delete-old-versions t
)
355 ;; enable automatic reloading of changed buffers and files
356 (global-auto-revert-mode 1)
357 (setq auto-revert-verbose nil
358 global-auto-revert-non-file-buffers nil
)
360 ;; always use space for indentation
363 require-final-newline t
366 ;; enable winner-mode (C-h f winner-mode RET)
369 ;; don't display *compilation* buffer on success. based on
370 ;; https://stackoverflow.com/a/17788551, with changes to use `cl-letf'
371 ;; instead of the now obsolete `flet'.
372 (with-eval-after-load 'compile
373 (defun b/compilation-finish-function
(buffer outstr
)
374 (unless (string-match "finished" outstr
)
375 (switch-to-buffer-other-window buffer
))
378 (setq compilation-finish-functions
#'b
/compilation-finish-function
)
382 (defadvice compilation-start
383 (around inhibit-display
384 (command &optional mode name-function highlight-regexp
))
385 (if (not (string-match "^\\(find\\|grep\\)" command
))
386 (cl-letf (((symbol-function 'display-buffer
) #'ignore
))
387 (save-window-excursion ad-do-it
))
389 (ad-activate 'compilation-start
))
391 ;; search for non-ASCII characters: i’d like non-ASCII characters such
392 ;; as ‘’“”«»‹›áⓐ𝒶 to be selected when i search for their ASCII
393 ;; counterpart. shoutout to
394 ;; http://endlessparentheses.com/new-in-emacs-25-1-easily-search-non-ascii-characters.html
395 (setq search-default-mode
#'char-fold-to-regexp
)
396 ;; uncomment to extend this behaviour to query-replace
397 ;; (setq replace-char-fold t)
400 (setq-default cursor-type
'bar
)
402 ;; allow scrolling in Isearch
403 (setq isearch-allow-scroll t
)
405 ;; open read-only file buffers in view-mode
406 ;; (enables niceties like `q' for quit)
407 (setq view-read-only t
)
410 :bind
("C-x v C-=" . vc-ediff
))
413 :config
(add-hook 'ediff-after-quit-hook-internal
'winner-undo
)
414 :custom
((ediff-window-setup-function 'ediff-setup-windows-plain
)
415 (ediff-split-window-function 'split-window-horizontally
)))
417 ;; i don't feel like jumping out of my chair every now and again; so
418 ;; don't BEEP! at me, emacs
419 (setq ring-bell-function
'ignore
)
427 ("C-c e b" . eval-buffer
)
428 ("C-c e r" . eval-region
)
430 ("C-c e i" . emacs-init-time
)
431 ("C-c e u" . emacs-uptime
)
432 ("C-c e v" . emacs-version
)
434 ("C-c F m" . make-frame-command
)
435 ("C-c F d" . delete-frame
)
436 ("C-c F D" . server-edit
)
438 ("C-S-h C" . describe-char
)
439 ("C-S-h F" . describe-face
)
441 ("C-x k" . kill-this-buffer
)
442 ("C-x K" . kill-buffer
)
444 :map emacs-lisp-mode-map
445 ("<C-return>" . b
/add-elisp-section
))
447 (when (display-graphic-p)
448 (unbind-key "C-z" global-map
))
451 ;; for back and forward mouse keys
452 ("<mouse-8>" . previous-buffer
)
453 ("<drag-mouse-8>" . previous-buffer
)
454 ("<mouse-9>" . next-buffer
)
455 ("<drag-mouse-9>" . next-buffer
)
456 ("<drag-mouse-2>" . kill-this-buffer
)
457 ("<drag-mouse-3>" . ivy-switch-buffer
))
460 ;;; Essential packages
465 (setq org-src-tab-acts-natively t
466 org-src-preserve-indentation nil
467 org-edit-src-content-indentation
0
468 org-link-email-description-format
"Email %c: %s" ; %.30s
469 org-highlight-latex-and-related
'(entities)
470 org-use-speed-commands t
471 org-startup-folded
'content
472 org-catch-invisible-edits
'show-and-error
474 (when (version< org-version
"9.3")
475 (setq org-email-link-description-format
476 org-link-email-description-format
))
477 (add-to-list 'org-structure-template-alist
'("L" .
"src emacs-lisp") t
)
478 (add-to-list 'org-modules
'org-habit
)
480 (("C-c a o a" . org-agenda
)
482 ("M-L" . org-insert-last-stored-link
)
483 ("M-O" . org-toggle-link-display
))
484 :hook
((org-mode . org-indent-mode
)
485 (org-mode . auto-fill-mode
)
486 (org-mode . flyspell-mode
))
488 (org-pretty-entities t
)
489 (org-agenda-files '("~/usr/org/todos/personal.org"
490 "~/usr/org/todos/habits.org"
491 "~/src/git/masters-thesis/todo.org"))
492 (org-agenda-start-on-weekday 0)
493 (org-agenda-time-leading-zero t
)
494 (org-habit-graph-column 44)
495 (org-latex-packages-alist '(("" "listings") ("" "color")))
497 '(org-block-begin-line ((t (:foreground
"#5a5b5a" :background
"#1d1f21"))))
498 '(org-block ((t (:background
"#1d1f21"))))
499 '(org-latex-and-related ((t (:foreground
"#b294bb")))))
501 (use-package ox-latex
504 (setq org-latex-listings
'listings
505 ;; org-latex-prefer-user-labels t
507 (add-to-list 'org-latex-classes
508 '("IEEEtran" "\\documentclass[11pt]{IEEEtran}"
509 ("\\section{%s}" .
"\\section*{%s}")
510 ("\\subsection{%s}" .
"\\subsection*{%s}")
511 ("\\subsubsection{%s}" .
"\\subsubsection*{%s}")
512 ("\\paragraph{%s}" .
"\\paragraph*{%s}")
513 ("\\subparagraph{%s}" .
"\\subparagraph*{%s}"))
515 (require 'ox-beamer
))
517 (use-package ox-extra
519 (ox-extras-activate '(latex-header-blocks ignore-headlines
)))
521 ;; asynchronous tangle, using emacs-async to asynchronously tangle an
522 ;; org file. closely inspired by
523 ;; https://github.com/dieggsy/dotfiles/tree/cc10edf7701958eff1cd94d4081da544d882a28c/emacs.d#dotfiles
524 (with-eval-after-load 'org
525 (defvar b
/show-async-tangle-results nil
526 "Keep *emacs* async buffers around for later inspection.")
528 (defvar b
/show-async-tangle-time nil
529 "Show the time spent tangling the file.")
531 (defun b/async-babel-tangle
()
532 "Tangle org file asynchronously."
534 (let* ((file-tangle-start-time (current-time))
535 (file (buffer-file-name))
536 (file-nodir (file-name-nondirectory file
))
537 ;; (async-quiet-switch "-q")
538 (file-noext (file-name-sans-extension file
)))
542 (org-babel-tangle-file ,file
))
543 (unless b
/show-async-tangle-results
546 (message "Tangled %s%s"
548 (if b
/show-async-tangle-time
550 (float-time (time-subtract (current-time)
551 ',file-tangle-start-time
)))
553 (message "Tangling %s failed" ,file-nodir
))))))))
556 'safe-local-variable-values
557 '(eval add-hook
'after-save-hook
#'b
/async-babel-tangle
'append
'local
))
559 ;; *the* right way to do git
562 :bind
(("C-c g g" . magit-status
)
563 ("C-c g s" . magit-status
)
564 ("C-c g b" . magit-blame-addition
)
565 ("C-c g l" . magit-log-buffer-file
))
567 (magit-add-section-hook 'magit-status-sections-hook
568 'magit-insert-modules
569 'magit-insert-stashes
571 ;; (magit-add-section-hook 'magit-status-sections-hook
572 ;; 'magit-insert-ignored-files
573 ;; 'magit-insert-untracked-files
575 (setq magit-repository-directories
'(("~/" .
0)
577 (nconc magit-section-initial-visibility-alist
578 '(([unpulled status
] . show
)
579 ([unpushed status
] . show
)))
580 (setq transient-history-file
(b/var
"transient/history.el")
581 transient-levels-file
(b/etc
"transient/levels.el")
582 transient-values-file
(b/etc
"transient/values.el"))
583 :custom
(magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1
)
584 :custom-face
(magit-diff-file-heading ((t (:weight normal
)))))
586 ;; recently opened files
590 ;; (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
592 (recentf-max-saved-items 2000)
593 (recentf-save-file (b/var
"recentf-save.el")))
595 ;; smart M-x enhancement (needed by counsel for history)
598 (setq smex-save-file
(b/var
"smex-save.el")))
604 (:map ivy-minibuffer-map
605 ([escape] . keyboard-escape-quit)
606 ([S-up] . ivy-previous-history-element)
607 ([S-down] . ivy-next-history-element)
608 ("DEL" . ivy-backward-delete-char))
612 ivy-use-virtual-buffers t
613 ivy-virtual-abbreviate 'abbreviate
614 ivy-count-format "%d/%d ")
616 (defvar b/ivy-ignore-buffer-modes '(magit-mode erc-mode dired-mode))
617 (defun b/ivy-ignore-buffer-p (str)
618 "Return non-nil if str names a buffer with a major mode
619 derived from one of `b/ivy-ignore-buffer-modes'.
621 This function is intended for use with `ivy-ignore-buffers'."
622 (let* ((buf (get-buffer str))
623 (mode (and buf (buffer-local-value 'major-mode buf))))
625 (apply #'provided-mode-derived-p mode b/ivy-ignore-buffer-modes))))
626 (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
630 ;; (ivy-minibuffer-match-face-2 ((t (:background "#e99ce8" :weight semi-bold))))
631 ;; (ivy-minibuffer-match-face-3 ((t (:background "#bbbbff" :weight semi-bold))))
632 ;; (ivy-minibuffer-match-face-4 ((t (:background "#ffbbff" :weight semi-bold))))
637 :bind (("C-s" . swiper-isearch)
639 ("C-S-s" . isearch-forward)))
644 :bind (([remap execute-extended-command] . counsel-M-x)
645 ([remap find-file] . counsel-find-file)
646 ("C-c b b" . ivy-switch-buffer)
647 ("C-c f ." . counsel-find-file)
648 ("C-c f l" . counsel-find-library)
649 ("C-c f r" . counsel-recentf)
650 ("C-c x" . counsel-M-x)
651 :map minibuffer-local-map
652 ("C-r" . counsel-minibuffer-history))
655 (defalias 'locate #'counsel-locate))
659 :commands (helm-M-x helm-mini helm-resume)
660 :bind (("M-x" . helm-M-x)
661 ("M-y" . helm-show-kill-ring)
662 ("C-x b" . helm-mini)
663 ("C-x C-b" . helm-buffers-list)
664 ("C-x C-f" . helm-find-files)
665 ("C-h r" . helm-info-emacs)
666 ("C-s-r" . helm-resume)
668 ("<tab>" . helm-execute-persistent-action)
669 ("C-i" . helm-execute-persistent-action) ; Make TAB work in terminals
670 ("C-z" . helm-select-action)) ; List actions
671 :config (helm-mode 1)))
676 :bind ("C-c a s e" . eshell)
678 (eval-when-compile (defvar eshell-prompt-regexp))
679 (defun b/eshell-quit-or-delete-char (arg)
681 (if (and (eolp) (looking-back eshell-prompt-regexp nil))
682 (eshell-life-is-too-much)
685 (defun b/eshell-clear ()
687 (let ((inhibit-read-only t))
691 (defun b/eshell-setup ()
692 (make-local-variable 'company-idle-delay)
693 (defvar company-idle-delay)
694 (setq company-idle-delay nil)
695 (bind-keys :map eshell-mode-map
696 ("C-d" . b/eshell-quit-or-delete-char)
697 ("C-S-l" . b/eshell-clear)
698 ("M-r" . counsel-esh-history)
699 ([tab] . company-complete)))
701 :hook (eshell-mode . b/eshell-setup)
703 (eshell-directory-name (b/var "eshell/"))
704 (eshell-hist-ignoredups t)
705 (eshell-input-filter 'eshell-input-filter-initial-space))
709 (("C-x C-b" . ibuffer)
710 :map ibuffer-mode-map
711 ("P" . ibuffer-backward-filter-group)
712 ("N" . ibuffer-forward-filter-group)
713 ("M-p" . ibuffer-do-print)
714 ("M-n" . ibuffer-do-shell-command-pipe-replace))
716 ;; Use human readable Size column instead of original one
717 (define-ibuffer-column size-h
718 (:name "Size" :inline t)
720 ((> (buffer-size) 1000000) (format "%7.1fM" (/ (buffer-size) 1000000.0)))
721 ((> (buffer-size) 100000) (format "%7.0fk" (/ (buffer-size) 1000.0)))
722 ((> (buffer-size) 1000) (format "%7.1fk" (/ (buffer-size) 1000.0)))
723 (t (format "%8d" (buffer-size)))))
725 (ibuffer-saved-filter-groups
727 ("dired" (mode . dired-mode))
728 ("org" (mode . org-mode))
731 (mode . gnus-group-mode)
732 (mode . gnus-summary-mode)
733 (mode . gnus-article-mode)
734 ;; not really, but...
735 (mode . message-mode)))
753 (mode . emacs-lisp-mode)
755 (mode . haskell-mode)
758 (mode . alloy-mode)))
762 (mode . latex-mode)))
765 (name . "^\\*scratch\\*$")
766 (name . "^\\*Messages\\*$")))
767 ("erc" (mode . erc-mode)))))
769 '((mark modified read-only locked " "
770 (name 18 18 :left :elide)
774 (mode 16 16 :left :elide)
775 " " filename-and-process)
779 :hook (ibuffer . (lambda () (ibuffer-switch-to-saved-filter-groups "default"))))
783 :hook (prog-mode . outline-minor-mode)
784 :delight (outline-minor-mode " outl")
787 outline-minor-mode-map
788 ("<s-tab>" . outline-toggle-children)
789 ("M-p" . outline-previous-visible-heading)
790 ("M-n" . outline-next-visible-heading)
791 :prefix-map b/outline-prefix-map
793 ("TAB" . outline-toggle-children)
794 ("a" . outline-hide-body)
795 ("H" . outline-hide-body)
796 ("S" . outline-show-all)
797 ("h" . outline-hide-subtree)
798 ("s" . outline-show-subtree)))
801 :custom (ls-lisp-dirs-first t))
805 (setq dired-listing-switches "-alh"
806 ls-lisp-use-insert-directory-program nil)
808 ;; easily diff 2 marked files
809 ;; https://oremacs.com/2017/03/18/dired-ediff/
810 (defun dired-ediff-files ()
813 (defvar ediff-after-quit-hook-internal)
814 (let ((files (dired-get-marked-files))
815 (wnd (current-window-configuration)))
816 (if (<= (length files) 2)
817 (let ((file1 (car files))
818 (file2 (if (cdr files)
822 (dired-dwim-target-directory)))))
823 (if (file-newer-than-file-p file1 file2)
824 (ediff-files file2 file1)
825 (ediff-files file1 file2))
826 (add-hook 'ediff-after-quit-hook-internal
828 (setq ediff-after-quit-hook-internal nil)
829 (set-window-configuration wnd))))
830 (error "no more than 2 files should be marked"))))
833 (setq dired-guess-shell-alist-user
834 '(("\\.pdf\\'" "evince" "zathura" "okular")
835 ("\\.doc\\'" "libreoffice")
836 ("\\.docx\\'" "libreoffice")
837 ("\\.ppt\\'" "libreoffice")
838 ("\\.pptx\\'" "libreoffice")
839 ("\\.xls\\'" "libreoffice")
840 ("\\.xlsx\\'" "libreoffice")
841 ("\\.flac\\'" "mpv")))
842 :bind (:map dired-mode-map
843 ("b" . dired-up-directory)
844 ("e" . dired-ediff-files)
845 ("E" . dired-toggle-read-only)
846 ("\\" . dired-hide-details-mode)
849 (b/dired-start-process "zathura"))))
850 :hook (dired-mode . dired-hide-details-mode))
854 (temp-buffer-resize-mode)
855 (setq help-window-select t))
859 (add-to-list 'tramp-default-proxies-alist '(nil "\\`root\\'" "/ssh:%h:"))
860 (add-to-list 'tramp-default-proxies-alist '("localhost" nil nil))
861 (add-to-list 'tramp-default-proxies-alist
862 (list (regexp-quote (system-name)) nil nil)))
865 :config (dash-enable-font-lock))
867 (use-package doc-view
868 :bind (:map doc-view-mode-map
869 ("M-RET" . image-previous-line)))
874 ;; highlight uncommitted changes in the left fringe
878 (setq diff-hl-draw-borders nil)
879 (global-diff-hl-mode)
880 :hook (magit-post-refresh . diff-hl-magit-post-refresh))
882 ;; display Lisp objects at point in the echo area
884 :when (version< "25" emacs-version)
886 :config (global-eldoc-mode))
888 ;; highlight matching parens
891 :config (show-paren-mode))
893 (use-package elec-pair
895 :config (electric-pair-mode))
898 :delight (auto-fill-function " fill")
899 :config (column-number-mode))
901 ;; save minibuffer history
902 (use-package savehist
906 (savehist-file (b/var "savehist.el")))
908 ;; automatically save place in files
909 (use-package saveplace
910 :when (version< "25" emacs-version)
911 :config (save-place-mode)
913 (save-place-file (b/var "save-place.el")))
915 (use-package prog-mode
916 :config (global-prettify-symbols-mode)
917 (defun indicate-buffer-boundaries-left ()
918 (setq indicate-buffer-boundaries 'left))
919 (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
921 (use-package text-mode
922 :hook (text-mode . indicate-buffer-boundaries-left))
924 (use-package conf-mode
934 (:map company-active-map
935 ([tab] . company-complete-common-or-cycle)
936 ([escape] . company-abort
))
938 (company-minimum-prefix-length 1)
939 (company-selection-wrap-around t
)
940 (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
941 (company-dabbrev-downcase nil
)
942 (company-dabbrev-ignore-case nil
)
944 (global-company-mode t
))
946 (use-package flycheck
948 :hook
(prog-mode . flycheck-mode
)
950 (:map flycheck-mode-map
951 ("M-P" . flycheck-previous-error
)
952 ("M-N" . flycheck-next-error
))
954 ;; Use the load-path from running Emacs when checking elisp files
955 (setq flycheck-emacs-lisp-load-path
'inherit
)
957 ;; Only flycheck when I actually save the buffer
958 (setq flycheck-check-syntax-automatically
'(mode-enabled save
))
959 :custom
(flycheck-mode-line-prefix "flyc"))
961 (use-package flyspell
964 ;; http://endlessparentheses.com/ispell-and-apostrophes.html
968 ;; ’ can be part of a word
969 (setq ispell-local-dictionary-alist
970 `((nil "[[:alpha:]]" "[^[:alpha:]]"
971 "['\x2019]" nil
("-B") nil utf-8
))
972 ispell-program-name
(executable-find "hunspell"))
973 ;; don't send ’ to the subprocess
974 (defun endless/replace-apostrophe
(args)
975 (cons (replace-regexp-in-string
978 (advice-add #'ispell-send-string
:filter-args
979 #'endless
/replace-apostrophe
)
981 ;; convert ' back to ’ from the subprocess
982 (defun endless/replace-quote
(args)
983 (if (not (derived-mode-p 'org-mode
))
985 (cons (replace-regexp-in-string
988 (advice-add #'ispell-parse-output
:filter-args
989 #'endless
/replace-quote
))
993 :hook
(text-mode . abbrev-mode
)
995 (abbrev-file-name (b/var
"abbrev.el")))
998 ;;; Programming modes
1000 (use-package lisp-mode
1002 (defun indent-spaces-mode ()
1003 (setq indent-tabs-mode nil
))
1004 (add-hook 'lisp-interaction-mode-hook
#'indent-spaces-mode
))
1007 :delight
(reveal-mode " reveal")
1008 :hook
(emacs-lisp-mode . reveal-mode
))
1010 (use-package elisp-mode
1011 :delight
(emacs-lisp-mode "Elisp" :major
))
1015 (use-package alloy-mode
1016 :straight
(:host github
:repo
"dwwmmn/alloy-mode")
1018 :config
(setq alloy-basic-offset
2))
1020 (use-package proof-site
; for Coq
1021 :straight proof-general
)
1023 (eval-when-compile (defvar lean-mode-map
))
1024 (use-package lean-mode
1026 :bind
(:map lean-mode-map
1027 ("S-SPC" . company-complete
))
1029 (require 'lean-input
)
1030 (setq default-input-method
"Lean"
1031 lean-input-tweak-all
'(lean-input-compose
1032 (lean-input-prepend "/")
1033 (lean-input-nonempty))
1034 lean-input-user-translations
'(("/" "/")))
1037 (use-package haskell-mode
1039 (setq haskell-indentation-layout-offset
4
1040 haskell-indentation-left-offset
4
1041 flycheck-checker
'haskell-hlint
1042 flycheck-disabled-checkers
'(haskell-stack-ghc haskell-ghc
)))
1046 :commands dante-mode
1047 :hook
(haskell-mode . dante-mode
))
1049 (use-package hlint-refactor
1051 :bind
(:map hlint-refactor-mode-map
1052 ("C-c l b" . hlint-refactor-refactor-buffer
)
1053 ("C-c l r" . hlint-refactor-refactor-at-point
))
1054 :hook
(haskell-mode . hlint-refactor-mode
))
1056 (use-package flycheck-haskell
1057 :after haskell-mode
)
1058 ;; alternative: hs-lint https://github.com/ndmitchell/hlint/blob/20e116a043f2073c57b17b24ae6364b5e433ba7e/data/hs-lint.el
1061 (use-package sgml-mode
1063 (setq sgml-basic-offset
2))
1065 (use-package css-mode
1067 (setq css-indent-offset
2))
1069 (use-package web-mode
1073 web-mode-code-indent-offset
1074 web-mode-css-indent-offset
1075 web-mode-markup-indent-offset
))
1077 (use-package emmet-mode
1078 :after
(:any web-mode css-mode sgml-mode
)
1079 :bind
* (("C-)" . emmet-next-edit-point
)
1080 ("C-(" . emmet-prev-edit-point
))
1082 (unbind-key "C-j" emmet-mode-keymap
)
1083 (setq emmet-move-cursor-between-quotes t
)
1084 :hook
(web-mode css-mode html-mode sgml-mode
))
1087 (use-package meghanada
1089 (:map meghanada-mode-map
1090 (("C-M-o" . meghanada-optimize-import
)
1091 ("C-M-t" . meghanada-import-all
)))
1092 :hook
(java-mode . meghanada-mode
)))
1095 (use-package treemacs
1096 :config
(setq treemacs-never-persist t
))
1098 (use-package yasnippet
1100 ;; (yas-global-mode)
1103 (use-package lsp-mode
1104 :init
(setq lsp-eldoc-render-all nil
1105 lsp-highlight-symbol-at-point nil
)
1110 (use-package company-lsp
1113 (setq company-lsp-cache-candidates t
1114 company-lsp-async t
))
1118 (setq lsp-ui-sideline-update-mode
'point
))
1120 (use-package lsp-java
1122 (add-hook 'java-mode-hook
1124 (setq-local company-backends
(list 'company-lsp
))))
1126 (add-hook 'java-mode-hook
'lsp-java-enable
)
1127 (add-hook 'java-mode-hook
'flycheck-mode
)
1128 (add-hook 'java-mode-hook
'company-mode
)
1129 (add-hook 'java-mode-hook
'lsp-ui-mode
))
1131 (use-package dap-mode
1137 (use-package dap-java
1140 (use-package lsp-java-treemacs
1145 :bind
(:map eclim-mode-map
("S-SPC" . company-complete
))
1146 :hook
((java-mode . eclim-mode
)
1147 (eclim-mode .
(lambda ()
1148 (make-local-variable 'company-idle-delay
)
1149 (defvar company-idle-delay
)
1150 ;; (setq company-idle-delay 0.7)
1151 (setq company-idle-delay nil
))))
1153 (eclim-auto-save nil
)
1154 ;; (eclimd-default-workspace "~/src/eclipse-workspace-exp")
1155 (eclim-executable "~/.p2/pool/plugins/org.eclim_2.8.0/bin/eclim")
1156 (eclim-eclipse-dirs '("~/usr/eclipse/dsl-2018-09/eclipse"))))
1160 (make-directory (b/var
"geiser/") t
)
1161 (setq geiser-repl-history-filename
(b/var
"geiser/repl-history")))
1163 (use-package geiser-guile
1165 (setq geiser-guile-load-path
"~/src/git/guix"))
1172 (font-latex-fontify-sectioning 'color
)))
1174 (use-package go-mode
)
1176 (use-package po-mode
1178 (po-mode .
(lambda () (run-with-timer 0.1 nil
'View-exit
))))
1180 (use-package tex-mode
1183 (lambda (p) (string-match "^---?" (car p
)))
1184 tex--prettify-symbols-alist
))
1189 (add-to-list 'custom-theme-load-path
1191 (convert-standard-filename "lisp") user-emacs-directory
))
1192 (load-theme 'tangomod t
)
1194 (use-package smart-mode-line
1195 :commands
(sml/apply-theme
)
1199 (smart-mode-line-enable))
1203 (use-package doom-themes
))
1205 (defvar b
/org-mode-font-lock-keywords
1206 '(("[ \t]*\\(#\\+\\(BEGIN\\|END\\|begin\\|end\\)_\\(\\S-+\\)\\)[ \t]*\\([^\n:]*\\)"
1207 (1 '(:foreground
"#5a5b5a" :background
"#292b2b") t
) ; directive
1208 (3 '(:foreground
"#81a2be" :background
"#292b2b") t
) ; kind
1209 (4 '(:foreground
"#c5c8c6") t
)))) ; title
1211 (defun b/lights-on
()
1212 "Enable my favourite light theme."
1214 (mapc #'disable-theme custom-enabled-themes
)
1215 (load-theme 'tangomod t
)
1216 (sml/apply-theme
'automatic
)
1217 (font-lock-remove-keywords
1218 'org-mode b
/org-mode-font-lock-keywords
))
1220 (defun b/lights-off
()
1223 (mapc #'disable-theme custom-enabled-themes
)
1224 ;; (load-theme 'doom-tomorrow-night t)
1225 (sml/apply-theme
'automatic
)
1226 (font-lock-add-keywords
1227 'org-mode b
/org-mode-font-lock-keywords t
))
1230 ("C-c t d" . b
/lights-off
)
1231 ("C-c t l" . b
/lights-on
))
1234 ;;; Emacs enhancements & auxiliary packages
1237 :config
(setq Man-width
80))
1239 (use-package which-key
1243 (which-key-add-key-based-replacements
1244 ;; prefixes for global prefixes and minor modes
1248 "C-c 8 -" "typo/dashes"
1249 "C-c 8 <" "typo/left-brackets"
1250 "C-c 8 >" "typo/right-brackets"
1252 "C-x a" "abbrev/expand"
1253 "C-x r" "rectangle/register/bookmark"
1254 "C-x v" "version control"
1255 ;; prefixes for my personal bindings
1256 "C-c a" "applications"
1261 "C-c c" "compile-and-comments"
1267 "C-c m" "multiple-cursors"
1268 "C-c P" "projectile"
1269 "C-c P s" "projectile/search"
1270 "C-c P x" "projectile/execute"
1271 "C-c P 4" "projectile/other-window"
1277 ;; prefixes for major modes
1278 (which-key-add-major-mode-key-based-replacements 'message-mode
1280 (which-key-add-major-mode-key-based-replacements 'org-mode
1281 "C-c C-v" "org-babel")
1282 (which-key-add-major-mode-key-based-replacements 'web-mode
1283 "C-c C-a" "web/attributes"
1284 "C-c C-b" "web/blocks"
1286 "C-c C-e" "web/element"
1287 "C-c C-t" "web/tags")
1291 (which-key-add-column-padding 5)
1292 (which-key-max-description-length 32))
1294 (use-package crux
; results in Waiting for git... [2 times]
1296 :bind
(("C-c b k" . crux-kill-other-buffers
)
1297 ("C-c d" . crux-duplicate-current-line-or-region
)
1298 ("C-c D" . crux-duplicate-and-comment-current-line-or-region
)
1299 ("C-c f c" . crux-copy-file-preserve-attributes
)
1300 ("C-c f d" . crux-delete-file-and-buffer
)
1301 ("C-c f r" . crux-rename-file-and-buffer
)
1302 ("C-c j" . crux-top-join-line
)
1303 ("C-S-j" . crux-top-join-line
)))
1306 :bind
(("C-a" . mwim-beginning-of-code-or-line
)
1307 ("C-e" . mwim-end-of-code-or-line
)
1308 ("<home>" . mwim-beginning-of-line-or-code
)
1309 ("<end>" . mwim-end-of-line-or-code
)))
1311 (use-package projectile
1313 :bind-keymap
("C-c P" . projectile-command-map
)
1315 (make-directory (b/var
"projectile/") t
)
1318 (defun b/projectile-mode-line-fun
()
1319 "Report project name and type in the modeline."
1320 (let ((project-name (projectile-project-name))
1321 (project-type (projectile-project-type)))
1323 projectile-mode-line-prefix
1325 (format ":%s" project-type
)
1327 (setq projectile-mode-line-function
'b
/projectile-mode-line-fun
)
1329 (defun my-projectile-invalidate-cache (&rest _args
)
1330 ;; ignore the args to `magit-checkout'
1331 (projectile-invalidate-cache nil
))
1333 (eval-after-load 'magit-branch
1335 (advice-add 'magit-checkout
1336 :after
#'my-projectile-invalidate-cache
)
1337 (advice-add 'magit-branch-and-checkout
1338 :after
#'my-projectile-invalidate-cache
)))
1340 (projectile-cache-file (b/var
"projectile/cache.el"))
1341 (projectile-completion-system 'ivy
)
1342 (projectile-known-projects-file (b/var
"projectile/known-projects.el"))
1343 (projectile-mode-line-prefix " proj"))
1345 (use-package helpful
1348 (("C-S-h c" . helpful-command
)
1349 ("C-S-h f" . helpful-callable
) ; helpful-function
1350 ("C-S-h v" . helpful-variable
)
1351 ("C-S-h k" . helpful-key
)
1352 ("C-S-h p" . helpful-at-point
)))
1354 (use-package unkillable-scratch
1357 (unkillable-scratch 1)
1359 (unkillable-buffers '("^\\*scratch\\*$" "^\\*Messages\\*$")))
1362 ;; | make pretty boxed quotes like this
1364 (use-package boxquote
1367 (:prefix-map b
/boxquote-prefix-map
1369 ("b" . boxquote-buffer
)
1370 ("B" . boxquote-insert-buffer
)
1371 ("d" . boxquote-defun
)
1372 ("F" . boxquote-insert-file
)
1373 ("hf" . boxquote-describe-function
)
1374 ("hk" . boxquote-describe-key
)
1375 ("hv" . boxquote-describe-variable
)
1376 ("hw" . boxquote-where-is
)
1377 ("k" . boxquote-kill
)
1378 ("p" . boxquote-paragraph
)
1379 ("q" . boxquote-boxquote
)
1380 ("r" . boxquote-region
)
1381 ("s" . boxquote-shell-command
)
1382 ("t" . boxquote-text
)
1383 ("T" . boxquote-title
)
1384 ("u" . boxquote-unbox
)
1385 ("U" . boxquote-unbox-region
)
1386 ("y" . boxquote-yank
)
1387 ("M-q" . boxquote-fill-paragraph
)
1388 ("M-w" . boxquote-kill-ring-save
)))
1390 (use-package orgalist
1391 ;; http://lists.gnu.org/archive/html/emacs-orgmode/2019-04/msg00007.html
1394 :hook
(message-mode . orgalist-mode
))
1396 ;; easily type pretty quotes & other typography, like ‘’“”-–—«»‹›
1401 (typo-global-mode 1)
1402 :hook
(((text-mode erc-mode
) . typo-mode
)
1403 (tex-mode .
(lambda ()(typo-mode -
1)))))
1405 ;; highlight TODOs in buffers
1406 (use-package hl-todo
1409 (global-hl-todo-mode))
1411 (use-package shrink-path
1415 (defvar user-
@-host
(concat (user-login-name) "@" (system-name) " "))
1416 (defun +eshell
/prompt
()
1417 (let ((base/dir
(shrink-path-prompt default-directory
)))
1418 (concat (propertize user-
@-host
'face
'default
)
1419 (propertize (car base
/dir
)
1420 'face
'font-lock-comment-face
)
1421 (propertize (cdr base
/dir
)
1422 'face
'font-lock-constant-face
)
1423 (propertize "> " 'face
'default
))))
1424 (setq eshell-prompt-regexp
(concat user-
@-host
".*> ")
1425 eshell-prompt-function
#'+eshell
/prompt
))
1427 (use-package eshell-up
1429 :commands eshell-up
)
1431 (use-package multi-term
1433 :bind
(("C-c a s m m" . multi-term
)
1434 ("C-c a s m d" . multi-term-dedicated-toggle
)
1435 ("C-c a s m p" . multi-term-prev
)
1436 ("C-c a s m n" . multi-term-next
)
1438 ("C-c C-j" . term-char-mode
))
1440 (setq multi-term-program
"screen"
1441 multi-term-program-switches
(concat "-c"
1442 (getenv "XDG_CONFIG_HOME")
1444 ;; TODO: add separate bindings for connecting to existing
1445 ;; session vs. always creating a new one
1446 multi-term-dedicated-select-after-open-p t
1447 multi-term-dedicated-window-height
20
1448 multi-term-dedicated-max-window-height
30
1450 '(("C-c C-c" . term-interrupt-subjob
)
1451 ("C-c C-e" . term-send-esc
)
1452 ("C-c C-j" . term-line-mode
)
1454 ;; ("C-y" . term-paste)
1455 ("C-y" . term-send-raw
)
1456 ("M-f" . term-send-forward-word
)
1457 ("M-b" . term-send-backward-word
)
1458 ("M-p" . term-send-up
)
1459 ("M-n" . term-send-down
)
1460 ("M-j" . term-send-raw-meta
)
1461 ("M-y" . term-send-raw-meta
)
1462 ("M-/" . term-send-raw-meta
)
1463 ("M-0" . term-send-raw-meta
)
1464 ("M-1" . term-send-raw-meta
)
1465 ("M-2" . term-send-raw-meta
)
1466 ("M-3" . term-send-raw-meta
)
1467 ("M-4" . term-send-raw-meta
)
1468 ("M-5" . term-send-raw-meta
)
1469 ("M-6" . term-send-raw-meta
)
1470 ("M-7" . term-send-raw-meta
)
1471 ("M-8" . term-send-raw-meta
)
1472 ("M-9" . term-send-raw-meta
)
1473 ("<C-backspace>" . term-send-backward-kill-word
)
1474 ("<M-DEL>" . term-send-backward-kill-word
)
1475 ("M-d" . term-send-delete-word
)
1476 ("M-," . term-send-raw
)
1477 ("M-." . comint-dynamic-complete
))
1478 term-unbind-key-alist
1479 '("C-z" "C-x" "C-c" "C-h"
1483 (use-package page-break-lines
1487 (page-break-lines-max-width fill-column
)
1489 (global-page-break-lines-mode))
1491 (use-package expand-region
1492 :bind
("C-=" . er
/expand-region
))
1494 (use-package multiple-cursors
1496 (("C-S-<mouse-1>" . mc
/add-cursor-on-click
)
1497 (:prefix-map b
/mc-prefix-map
1499 ("c" . mc
/edit-lines
)
1500 ("n" . mc
/mark-next-like-this
)
1501 ("p" . mc
/mark-previous-like-this
)
1502 ("a" . mc
/mark-all-like-this
)))
1504 (setq mc
/list-file
(b/var
"mc-list.el")))
1512 (use-package yasnippet
1515 (defconst yas-verbosity-cur yas-verbosity
)
1516 (setq yas-verbosity
2)
1517 (setq yas-snippet-dirs
(list (b/etc
"yasnippet/snippets/")))
1518 (add-to-list 'yas-snippet-dirs
"~/src/git/guix/etc/snippets" t
)
1520 (setq yas-verbosity yas-verbosity-cur
)
1521 (define-key yas-minor-mode-map
(kbd "SPC") yas-maybe-expand
)
1524 (use-package debbugs
)
1526 (use-package org-ref
1528 (b/setq-every
'("~/usr/org/references.bib")
1529 reftex-default-bibliography
1530 org-ref-default-bibliography
)
1532 org-ref-bibliography-notes
"~/usr/org/notes.org"
1533 org-ref-pdf-directory
"~/usr/org/bibtex-pdfs/"))
1537 :init
(setq alert-default-style
'notifications
))
1539 ;; (use-package fill-column-indicator)
1541 (use-package emojify
1543 (make-directory (b/var
"emojify/") t
)
1544 (setq emojify-emojis-dir
(b/var
"emojify/"))
1545 :hook
(erc-mode . emojify-mode
))
1549 (("C-c w <right>" . split-window-right
)
1550 ("C-c w <down>" . split-window-below
)
1551 ("C-c w s l" . split-window-right
)
1552 ("C-c w s j" . split-window-below
)
1553 ("C-c w q" . quit-window
))
1555 (split-width-threshold 150))
1557 (use-package windmove
1560 (("C-c w h" . windmove-left
)
1561 ("C-c w j" . windmove-down
)
1562 ("C-c w k" . windmove-up
)
1563 ("C-c w l" . windmove-right
)
1564 ("C-c w H" . windmove-swap-states-left
)
1565 ("C-c w J" . windmove-swap-states-down
)
1566 ("C-c w K" . windmove-swap-states-up
)
1567 ("C-c w L" . windmove-swap-states-right
)))
1571 :bind
("C-c a p" . pass
)
1572 :hook
(pass-mode . View-exit
))
1574 (use-package pdf-tools
1576 :bind
(:map pdf-view-mode-map
1577 ("M-RET" . image-previous-line
))
1578 :config
(pdf-tools-install nil t
))
1580 (use-package biblio
)
1583 :hook
(latex-mode . reftex-mode
))
1585 (use-package reftex-cite
1587 :disabled
; enable to disable
1588 ; reftex-cite's default choice
1591 (defun reftex-get-bibkey-default ()
1592 "If the cursor is in a citation macro, return the word before the macro."
1593 (let* ((macro (reftex-what-macro 1)))
1595 (when (and macro
(string-match "cite" (car macro
)))
1596 (goto-char (cdr macro
)))
1597 (reftex-this-word)))))
1600 ;;; Email (with Gnus)
1602 (defvar b
/maildir
(expand-file-name "~/mail/"))
1603 (with-eval-after-load 'recentf
1604 (add-to-list 'recentf-exclude b
/maildir
))
1607 b
/gnus-init-file
(b/etc
"gnus")
1608 mail-user-agent
'gnus-user-agent
1609 read-mail-command
'gnus
)
1612 :bind
(("s-m" . gnus
)
1613 ("s-M" . gnus-unplugged
)
1615 ("C-c a M" . gnus-unplugged
))
1618 gnus-select-method
'(nnnil "")
1619 gnus-secondary-select-methods
1620 '((nnimap "shemshak"
1621 (nnimap-stream plain
)
1622 (nnimap-address "127.0.0.1")
1623 (nnimap-server-port 143)
1624 (nnimap-authenticator plain
)
1625 (nnimap-user "amin@shemshak.local"))
1627 (nnimap-stream plain
)
1628 (nnimap-address "127.0.0.1")
1629 (nnimap-server-port 143)
1630 (nnimap-authenticator plain
)
1631 (nnimap-user "bandali@gnu.local")
1632 (nnimap-inbox "INBOX")
1633 (nnimap-split-methods 'nnimap-split-fancy
)
1634 (nnimap-split-fancy (|
1635 ;; (: gnus-registry-split-fancy-with-parent)
1636 ;; (: gnus-group-split-fancy "INBOX" t "INBOX")
1638 (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1")
1639 ;; *@lists.sr.ht, omitting one dot if present
1640 ;; add more \\.?\\([^.@]*\\) if needed
1641 (list ".*<~\\(.*\\)/\\([^.@]*\\)\\.?\\([^.@]*\\)@lists.sr.ht>.*" "l.~\\1.\\2\\3")
1643 (from "webmasters\\(-comment\\)?@gnu\\.org" "webmasters")
1645 (list ".*atreus.freelists.org" "l.atreus")
1646 (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec")
1647 ;; (list ".*haskell-art.we.lurk.org" "l.haskell.art") ;d
1648 (list ".*haskell-cafe.haskell.org" "l.haskell-cafe")
1649 ;; (list ".*notmuch.notmuchmail.org" "l.notmuch") ;u
1650 ;; (list ".*dev.lists.parabola.nu" "l.parabola-dev") ;u
1651 ;; ----------------------------------
1652 ;; legend: (u)nsubscribed | (d)ead
1653 ;; ----------------------------------
1654 ;; otherwise, leave mail in INBOX
1657 (nnimap-stream plain
)
1658 (nnimap-address "127.0.0.1")
1659 (nnimap-server-port 143)
1660 (nnimap-authenticator plain
)
1661 (nnimap-user "abandali@uw.local")
1662 (nnimap-inbox "INBOX")
1663 (nnimap-split-methods 'nnimap-split-fancy
)
1664 (nnimap-split-fancy (|
1665 ;; (: gnus-registry-split-fancy-with-parent)
1667 ("subject" "SE\\s-?212" "course.se212-f19")
1668 (from "SE\\s-?212" "course.se212-f19")
1672 (nnimap-stream plain
)
1673 (nnimap-address "127.0.0.1")
1674 (nnimap-server-port 143)
1675 (nnimap-authenticator plain
)
1676 (nnimap-user "abandali@csc.uw.local")))
1677 gnus-message-archive-group
"nnimap+shemshak:Sent"
1680 (to-address .
"atreus@freelists.org")
1681 (to-list .
"atreus@freelists.org"))
1683 (to-address .
"deepspec@lists.cs.princeton.edu")
1684 (to-list .
"deepspec@lists.cs.princeton.edu")
1685 (list-identifier .
"\\[deepspec\\]"))
1687 (to-address .
"emacs-devel@gnu.org")
1688 (to-list .
"emacs-devel@gnu.org"))
1689 ("l\\.help-gnu-emacs"
1690 (to-address .
"help-gnu-emacs@gnu.org")
1691 (to-list .
"help-gnu-emacs@gnu.org"))
1692 ("l\\.info-gnu-emacs"
1693 (to-address .
"info-gnu-emacs@gnu.org")
1694 (to-list .
"info-gnu-emacs@gnu.org"))
1695 ("l\\.emacs-orgmode"
1696 (to-address .
"emacs-orgmode@gnu.org")
1697 (to-list .
"emacs-orgmode@gnu.org")
1698 (list-identifier .
"\\[O\\]"))
1699 ("l\\.emacs-tangents"
1700 (to-address .
"emacs-tangents@gnu.org")
1701 (to-list .
"emacs-tangents@gnu.org"))
1702 ("l\\.emacsconf-discuss"
1703 (to-address .
"emacsconf-discuss@gnu.org")
1704 (to-list .
"emacsconf-discuss@gnu.org"))
1705 ("l\\.emacsconf-register"
1706 (to-address .
"emacsconf-register@gnu.org")
1707 (to-list .
"emacsconf-register@gnu.org"))
1708 ("l\\.emacsconf-submit"
1709 (to-address .
"emacsconf-submit@gnu.org")
1710 (to-list .
"emacsconf-submit@gnu.org"))
1711 ("l\\.fencepost-users"
1712 (to-address .
"fencepost-users@gnu.org")
1713 (to-list .
"fencepost-users@gnu.org")
1714 (list-identifier .
"\\[Fencepost-users\\]"))
1715 ("l\\.gnewsense-art"
1716 (to-address .
"gnewsense-art@nongnu.org")
1717 (to-list .
"gnewsense-art@nongnu.org")
1718 (list-identifier .
"\\[gNewSense-art\\]"))
1719 ("l\\.gnewsense-dev"
1720 (to-address .
"gnewsense-dev@nongnu.org")
1721 (to-list .
"gnewsense-dev@nongnu.org")
1722 (list-identifier .
"\\[Gnewsense-dev\\]"))
1723 ("l\\.gnewsense-users"
1724 (to-address .
"gnewsense-users@nongnu.org")
1725 (to-list .
"gnewsense-users@nongnu.org")
1726 (list-identifier .
"\\[gNewSense-users\\]"))
1727 ("l\\.gnunet-developers"
1728 (to-address .
"gnunet-developers@gnu.org")
1729 (to-list .
"gnunet-developers@gnu.org")
1730 (list-identifier .
"\\[GNUnet-developers\\]"))
1732 (to-address .
"help-gnunet@gnu.org")
1733 (to-list .
"help-gnunet@gnu.org")
1734 (list-identifier .
"\\[Help-gnunet\\]"))
1736 (to-address .
"bug-gnuzilla@gnu.org")
1737 (to-list .
"bug-gnuzilla@gnu.org")
1738 (list-identifier .
"\\[Bug-gnuzilla\\]"))
1740 (to-address .
"gnuzilla-dev@gnu.org")
1741 (to-list .
"gnuzilla-dev@gnu.org")
1742 (list-identifier .
"\\[Gnuzilla-dev\\]"))
1744 (to-address .
"guile-devel@gnu.org")
1745 (to-list .
"guile-devel@gnu.org"))
1747 (to-address .
"guile-user@gnu.org")
1748 (to-list .
"guile-user@gnu.org"))
1750 (to-address .
"guix-devel@gnu.org")
1751 (to-list .
"guix-devel@gnu.org"))
1753 (to-address .
"help-guix@gnu.org")
1754 (to-list .
"help-guix@gnu.org"))
1756 (to-address .
"info-guix@gnu.org")
1757 (to-list .
"info-guix@gnu.org"))
1758 ("l\\.savannah-hackers-public"
1759 (to-address .
"savannah-hackers-public@gnu.org")
1760 (to-list .
"savannah-hackers-public@gnu.org"))
1761 ("l\\.savannah-users"
1762 (to-address .
"savannah-users@gnu.org")
1763 (to-list .
"savannah-users@gnu.org"))
1765 (to-address .
"www-commits@gnu.org")
1766 (to-list .
"www-commits@gnu.org"))
1768 (to-address .
"www-discuss@gnu.org")
1769 (to-list .
"www-discuss@gnu.org"))
1771 (to-address .
"haskell-art@we.lurk.org")
1772 (to-list .
"haskell-art@we.lurk.org")
1773 (list-identifier .
"\\[haskell-art\\]"))
1775 (to-address .
"haskell-cafe@haskell.org")
1776 (to-list .
"haskell-cafe@haskell.org")
1777 (list-identifier .
"\\[Haskell-cafe\\]"))
1779 (to-address .
"notmuch@notmuchmail.org")
1780 (to-list .
"notmuch@notmuchmail.org"))
1782 (to-address .
"dev@lists.parabola.nu")
1783 (to-list .
"dev@lists.parabola.nu")
1784 (list-identifier .
"\\[Dev\\]"))
1785 ("l\\.~bandali\\.public-inbox"
1786 (to-address .
"~bandali/public-inbox@lists.sr.ht")
1787 (to-list .
"~bandali/public-inbox@lists.sr.ht"))
1788 ("l\\.~sircmpwn\\.free-writers-club"
1789 (to-address .
"~sircmpwn/free-writers-club@lists.sr.ht")
1790 (to-list .
"~sircmpwn/free-writers-club@lists.sr.ht"))
1791 ("l\\.~sircmpwn\\.srht-admins"
1792 (to-address .
"~sircmpwn/sr.ht-admins@lists.sr.ht")
1793 (to-list .
"~sircmpwn/sr.ht-admins@lists.sr.ht"))
1794 ("l\\.~sircmpwn\\.srht-announce"
1795 (to-address .
"~sircmpwn/sr.ht-announce@lists.sr.ht")
1796 (to-list .
"~sircmpwn/sr.ht-announce@lists.sr.ht"))
1797 ("l\\.~sircmpwn\\.srht-dev"
1798 (to-address .
"~sircmpwn/sr.ht-dev@lists.sr.ht")
1799 (to-list .
"~sircmpwn/sr.ht-dev@lists.sr.ht"))
1800 ("l\\.~sircmpwn\\.srht-discuss"
1801 (to-address .
"~sircmpwn/sr.ht-discuss@lists.sr.ht")
1802 (to-list .
"~sircmpwn/sr.ht-discuss@lists.sr.ht"))
1804 (to-address .
"webmasters@gnu.org")
1805 (to-list .
"webmasters@gnu.org"))
1812 gnus-large-newsgroup
50
1813 gnus-home-directory
(b/var
"gnus/")
1814 gnus-directory
(concat gnus-home-directory
"news/")
1815 message-directory
(concat gnus-home-directory
"mail/")
1816 nndraft-directory
(concat gnus-home-directory
"drafts/")
1817 gnus-save-newsrc-file nil
1818 gnus-read-newsrc-file nil
1819 gnus-interactive-exit nil
1820 gnus-gcc-mark-as-read t
)
1824 (require 'ebdb-gnus
)
1826 (when (version< emacs-version
"27")
1828 'nnmail-split-abbrev-alist
1829 '(list .
"list-id\\|list-post\\|x-mailing-list\\|x-beenthere\\|x-loop")
1832 ;; (gnus-registry-initialize)
1834 (with-eval-after-load 'recentf
1835 (add-to-list 'recentf-exclude gnus-home-directory
)))
1837 (use-package gnus-art
1840 gnus-buttonized-mime-types
'("multipart/\\(signed\\|encrypted\\)")
1841 gnus-visible-headers
1842 (concat gnus-visible-headers
"\\|^List-Id:\\|^X-RT-Originator:\\|^User-Agent:")
1843 gnus-sorted-header-list
1844 '("^From:" "^Subject:" "^Summary:" "^Keywords:"
1845 "^Followup-To:" "^To:" "^Cc:" "X-RT-Originator"
1846 "^Newsgroups:" "List-Id:" "^Organization:"
1847 "^User-Agent:" "^Date:")
1848 ;; local-lapsed article dates
1849 ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
1850 gnus-article-date-headers
'(user-defined)
1851 gnus-article-time-format
1853 (let* ((date (format-time-string "%a, %d %b %Y %T %z" time
))
1854 (local (article-make-date-line date
'local
))
1855 (combined-lapsed (article-make-date-line date
1858 (string-match " (.+" combined-lapsed
)
1859 (match-string 0 combined-lapsed
))))
1860 (concat local lapsed
))))
1862 :map gnus-article-mode-map
1863 ("M-L" . org-store-link
)))
1865 (use-package gnus-sum
1866 :bind
(:map gnus-summary-mode-map
1867 :prefix-map b
/gnus-summary-prefix-map
1869 ("r" . gnus-summary-reply
)
1870 ("w" . gnus-summary-wide-reply
)
1871 ("v" . gnus-summary-show-raw-article
))
1874 :map gnus-summary-mode-map
1875 ("M-L" . org-store-link
))
1876 :hook
(gnus-summary-mode . b
/no-mouse-autoselect-window
))
1878 (use-package gnus-msg
1880 (defvar b
/signature
"Amin Bandali
1881 Free Software Activist | GNU Webmaster & Volunteer
1882 GPG: BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103
1883 https://shemshak.org/~amin")
1884 (defvar b
/gnu-signature
"Amin Bandali
1885 Free Software Activist | GNU Webmaster & Volunteer
1886 GPG: BE62 7373 8E61 6D6D 1B3A 08E8 A21A 0202 4881 6103
1887 https://bandali.eu.org")
1888 (defvar b
/uw-signature
"Amin Bandali, MMath Student
1889 Cheriton School of Computer Science
1890 University of Waterloo
1891 https://bandali.eu.org")
1892 (defvar b
/csc-signature
"Amin Bandali
1894 Computer Science Club, University of Waterloo
1895 https://csclub.uwaterloo.ca/~abandali")
1896 (setq gnus-posting-styles
1898 (address "amin@shemshak.org")
1900 (signature b
/signature
)
1901 (eval (setq b
/message-cite-say-hi t
)))
1903 (address "bandali@gnu.org")
1904 (signature b
/gnu-signature
)
1905 (eval (set (make-local-variable 'message-user-fqdn
) "fencepost.gnu.org")))
1906 ((header "subject" "ThankCRM")
1907 (to "webmasters-comment@gnu.org")
1909 (eval (setq b
/message-cite-say-hi nil
)))
1911 (address "abandali@uwaterloo.ca")
1912 (signature b
/uw-signature
))
1913 ("nnimap\\+uw:INBOX"
1914 (gcc "\"nnimap+uw:Sent Items\""))
1916 (address "abandali@csclub.uwaterloo.ca")
1917 (signature b
/csc-signature
)
1918 (gcc "nnimap+csc:Sent")))))
1920 (use-package gnus-topic
1921 :hook
(gnus-group-mode . gnus-topic-mode
)
1922 :config
(setq gnus-topic-line-format
"%i[ %A: %(%{%n%}%) ]%v\n"))
1924 (use-package gnus-agent
1926 (setq gnus-agent-synchronize-flags
'ask
)
1927 :hook
(gnus-group-mode . gnus-agent-mode
))
1929 (use-package gnus-group
1931 (setq gnus-permanently-visible-groups
"\\(:INBOX$\\|:gnu$\\)"))
1934 ;; problematic with ebdb's popup, *EBDB-Gnus*
1935 (use-package gnus-win
1937 (setq gnus-use-full-window nil
)))
1939 (use-package gnus-dired
1940 :commands gnus-dired-mode
1942 (add-hook 'dired-mode-hook
'gnus-dired-mode
))
1944 (use-package mm-decode
1946 (setq mm-discouraged-alternatives
'("text/html" "text/richtext")
1947 mm-decrypt-option
'known
1948 mm-verify-option
'known
))
1950 (use-package sendmail
1952 (setq sendmail-program
(executable-find "msmtp")
1953 ;; message-sendmail-extra-arguments '("-v" "-d")
1954 mail-specify-envelope-from t
1955 mail-envelope-from
'header
))
1957 (use-package message
1959 ;; redefine for a simplified In-Reply-To header
1960 ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67)
1961 (defun message-make-in-reply-to ()
1962 "Return the In-Reply-To header for this message."
1963 (when message-reply-headers
1964 (let ((from (mail-header-from message-reply-headers
))
1965 (msg-id (mail-header-id message-reply-headers
)))
1969 (defconst b
/message-cite-style-format
"On %Y-%m-%d %l:%M %p, %N wrote:")
1970 (defconst message-cite-style-bandali
1971 '((message-cite-function 'message-cite-original
)
1972 (message-citation-line-function 'message-insert-formatted-citation-line
)
1973 (message-cite-reply-position 'traditional
)
1974 (message-yank-prefix "> ")
1975 (message-yank-cited-prefix ">")
1976 (message-yank-empty-prefix ">")
1977 (message-citation-line-format
1978 (if b
/message-cite-say-hi
1979 (concat "Hi %F,\n\n" b
/message-cite-style-format
)
1980 b
/message-cite-style-format
)))
1981 "Citation style based on Mozilla Thunderbird's. Use with message-cite-style.")
1982 (setq ;; message-cite-style 'message-cite-style-bandali
1983 message-kill-buffer-on-exit t
1984 message-send-mail-function
'message-send-mail-with-sendmail
1985 message-sendmail-envelope-from
'header
1986 message-subscribed-address-functions
1987 '(gnus-find-subscribed-addresses)
1988 message-dont-reply-to-names
1989 "\\(\\(\\(amin\\|mab\\)@shemshak\\.org\\)\\|\\(amin@bndl\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a\\(min\\.\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
1990 (require 'company-ebdb
)
1991 :hook
(;; (message-setup . mml-secure-message-sign-pgpmime)
1992 (message-mode . flyspell-mode
)
1993 (message-mode .
(lambda ()
1994 ;; (setq fill-column 65
1995 ;; message-fill-column 65)
1996 (make-local-variable 'company-idle-delay
)
1997 (setq company-idle-delay
0.2))))
1999 ;; (message-header-subject ((t (:foreground "#111" :weight semi-bold))))
2000 ;; (message-header-to ((t (:foreground "#111" :weight normal))))
2001 ;; (message-header-cc ((t (:foreground "#333" :weight normal))))
2007 (use-package mml-sec
2009 (mml-secure-openpgp-encrypt-to-self t
)
2010 (mml-secure-openpgp-sign-with-sender t
))
2012 (use-package footnote
2015 ;; (setq footnote-start-tag ""
2016 ;; footnote-end-tag ""
2017 ;; footnote-style 'unicode)
2019 (:map message-mode-map
2020 :prefix-map b
/footnote-prefix-map
2022 ("a" . footnote-add-footnote
)
2023 ("b" . footnote-back-to-message
)
2024 ("c" . footnote-cycle-style
)
2025 ("d" . footnote-delete-footnote
)
2026 ("g" . footnote-goto-footnote
)
2027 ("r" . footnote-renumber-footnotes
)
2028 ("s" . footnote-set-style
)))
2032 :bind
(:map gnus-group-mode-map
("e" . ebdb
))
2034 (setq ebdb-sources
(b/var
"ebdb"))
2035 (with-eval-after-load 'swiper
2036 (add-to-list 'swiper-font-lock-exclude
'ebdb-mode t
)))
2038 (use-package ebdb-com
2041 ;; (use-package ebdb-complete
2044 ;; (ebdb-complete-enable))
2046 (use-package company-ebdb
2048 (defun company-ebdb--post-complete (_) nil
))
2050 (use-package ebdb-gnus
2053 (ebdb-gnus-window-configuration
2056 (summary 0.25 point
)
2059 (ebdb-gnus 0.3))))))
2061 (use-package ebdb-mua
2063 ;; :custom (ebdb-mua-pop-up nil)
2066 ;; (use-package ebdb-message
2069 ;; (use-package ebdb-vcard
2072 (use-package message-x
)
2075 (use-package message-x
2077 (message-x-completion-alist
2079 (("\\([rR]esent-\\|[rR]eply-\\)?[tT]o:\\|[bB]?[cC][cC]:" . gnus-harvest-find-address
)
2082 (quote message-newgroups-header-regexp
))
2083 message-newgroups-header-regexp message-newsgroups-header-regexp
)
2084 . message-expand-group
))))))
2087 (use-package gnus-harvest
2088 :commands gnus-harvest-install
2091 (if (featurep 'message-x
)
2092 (gnus-harvest-install 'message-x
)
2093 (gnus-harvest-install))))
2096 ;;; IRC (with ERC and ZNC)
2099 :bind
(("C-c b e" . erc-switch-to-buffer
)
2101 ("M-a" . erc-track-switch-buffer
))
2103 (erc-join-buffer 'bury
)
2104 (erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
2105 (erc-nick "bandali")
2107 (erc-rename-buffers t
)
2108 (erc-server-reconnect-attempts 5)
2109 (erc-server-reconnect-timeout 3)
2111 (defun erc-cmd-OPME ()
2112 "Request chanserv to op me."
2113 (erc-message "PRIVMSG"
2114 (format "chanserv op %s %s"
2115 (erc-default-target)
2116 (erc-current-nick)) nil
))
2117 (defun erc-cmd-DEOPME ()
2118 "Deop myself from current channel."
2119 (erc-cmd-DEOP (format "%s" (erc-current-nick))))
2120 (add-to-list 'erc-modules
'keep-place
)
2121 (add-to-list 'erc-modules
'notifications
)
2122 (add-to-list 'erc-modules
'spelling
)
2123 (add-to-list 'erc-modules
'scrolltoplace
)
2124 (erc-update-modules)
2126 (when (and (version<= "24.4" emacs-version
)
2127 (version< emacs-version
"27"))
2128 ;; fix erc-lurker bug
2129 ;; patch submitted: https://bugs.gnu.org/36843#10
2130 ;; TODO: remove when patch is merged and emacs 27 is released
2131 (defvar erc-message-parsed
)
2132 (defun erc-display-message (parsed type buffer msg
&rest args
)
2133 "Display MSG in BUFFER.
2135 ARGS, PARSED, and TYPE are used to format MSG sensibly.
2137 See also `erc-format-message' and `erc-display-line'."
2138 (let ((string (if (symbolp msg
)
2139 (apply #'erc-format-message msg args
)
2141 (erc-message-parsed parsed
))
2147 (mapc (lambda (type)
2149 (erc-display-message-highlight type string
)))
2153 (erc-display-message-highlight type string
))))
2155 (if (not (erc-response-p parsed
))
2156 (erc-display-line string buffer
)
2157 (unless (erc-hide-current-message-p parsed
)
2158 (erc-put-text-property 0 (length string
) 'erc-parsed parsed string
)
2159 (erc-put-text-property 0 (length string
) 'rear-sticky t string
)
2160 (when (erc-response.tags parsed
)
2161 (erc-put-text-property 0 (length string
) 'tags
(erc-response.tags parsed
)
2163 (erc-display-line string buffer
)))))
2165 (defun erc-lurker-update-status (_message)
2166 "Update `erc-lurker-state' if necessary.
2168 This function is called from `erc-insert-pre-hook'. If the
2169 current message is a PRIVMSG, update `erc-lurker-state' to
2170 reflect the fact that its sender has issued a PRIVMSG at the
2171 current time. Otherwise, take no action.
2173 This function depends on the fact that `erc-display-message'
2174 lexically binds `erc-message-parsed', which is used to check if
2175 the current message is a PRIVMSG and to determine its sender.
2176 See also `erc-lurker-trim-nicks' and `erc-lurker-ignore-chars'.
2178 In order to limit memory consumption, this function also calls
2179 `erc-lurker-cleanup' once every `erc-lurker-cleanup-interval'
2180 updates of `erc-lurker-state'."
2181 (when (and (boundp 'erc-message-parsed
)
2182 (erc-response-p erc-message-parsed
))
2183 (let* ((command (erc-response.command erc-message-parsed
))
2185 (erc-lurker-maybe-trim
2186 (car (erc-parse-user (erc-response.sender erc-message-parsed
)))))
2188 (erc-canonicalize-server-name erc-server-announced-name
)))
2189 (when (equal command
"PRIVMSG")
2190 (when (>= (cl-incf erc-lurker-cleanup-count
)
2191 erc-lurker-cleanup-interval
)
2192 (setq erc-lurker-cleanup-count
0)
2193 (erc-lurker-cleanup))
2194 (unless (gethash server erc-lurker-state
)
2195 (puthash server
(make-hash-table :test
'equal
) erc-lurker-state
))
2196 (puthash sender
(current-time)
2197 (gethash server erc-lurker-state
))))))))
2199 (use-package erc-fill
2202 (erc-fill-column 77)
2203 (erc-fill-function 'erc-fill-static
)
2204 (erc-fill-static-center 18))
2206 (use-package erc-pcomplete
2209 (erc-pcomplete-nick-postfix ","))
2211 (use-package erc-track
2213 :bind
(("C-c a e t d" . erc-track-disable
)
2214 ("C-c a e t e" . erc-track-enable
))
2216 (erc-track-enable-keybindings nil
)
2217 (erc-track-exclude-types '("JOIN" "MODE" "NICK" "PART" "QUIT"
2218 "324" "329" "332" "333" "353" "477"))
2219 (erc-track-priority-faces-only 'all
)
2220 (erc-track-shorten-function nil
))
2222 (use-package erc-hl-nicks
2225 (use-package erc-scrolltoplace
2229 :load-path
"lisp/znc.el/"
2230 :bind
(("C-c a e e" . znc-erc
)
2231 ("C-c a e a" . znc-all
))
2233 (let ((pwd (let ((auth (auth-source-search :host
"znca")))
2235 ((null auth
) (error "Couldn't find znca's authinfo"))
2236 (t (funcall (plist-get (car auth
) :secret
)))))))
2238 `(("znc.shemshak.org" 1337 t
2239 ((freenode "amin/freenode" ,pwd
)))
2240 ("znc.shemshak.org" 1337 t
2241 ((moznet "amin/moznet" ,pwd
)))
2242 ("znc.shemshak.org" 1337 t
2243 ((oftc "amin/oftc" ,pwd
)))))))
2246 ;;; Post initialization
2248 (message "Loading %s...done (%.3fs)" user-init-file
2249 (float-time (time-subtract (current-time)
2250 b
/before-user-init-time
)))
2252 ;;; init.el ends here