emacs: update packages, disable web-mode's auto indentation
[~bandali/configs] / .emacs.d / init.el
index 7b8cf94..f2d78f8 100644 (file)
 \f
 ;;; Initial setup
 
+(defvar b/exwm-p (string= (system-name) "jirud")
+  "Whether or not we will be using `exwm'.")
+
 ;; keep ~/.emacs.d clean
 (use-package no-littering
   :demand
   (previous-line)
   (insert "\n\f\n;;; "))
 
+(defvar b/fill-column 47
+  "My custom `fill-column'.")
+
+(defconst b/asterism "* * *")
+
+(defun b/insert-asterism ()
+  "Insert a centred asterism."
+  (interactive)
+  (insert
+   (concat
+    "\n\n"
+    (make-string (floor (/ (- b/fill-column (length b/asterism)) 2))
+                 ?\s)
+    b/asterism
+    "\n\n")))
+
 (defun b/no-mouse-autoselect-window ()
   "Conveniently disable `focus-follows-mouse'.
 For disabling the behaviour for certain buffers and/or modes."
@@ -394,7 +413,7 @@ For disabling the behaviour for certain buffers and/or modes."
 
 ;; time and battery in mode-line
 (use-feature time
-  :disabled
+  :if b/exwm-p
   :demand
   :config
   (display-time-mode)
@@ -403,7 +422,7 @@ For disabling the behaviour for certain buffers and/or modes."
   (display-time-format "%a %b %-e, %-l:%M%P"))
 
 (use-feature battery
-  :disabled
+  :if b/exwm-p
   :demand
   :config
   (display-battery-mode)
@@ -465,6 +484,11 @@ For disabling the behaviour for certain buffers and/or modes."
 (use-feature vc
   :bind ("C-x v C-=" . vc-ediff))
 
+(use-feature vc-git
+  :after vc
+  :custom
+  (vc-git-print-log-follow t))
+
 (use-feature ediff
   :config (add-hook 'ediff-after-quit-hook-internal 'winner-undo)
   :custom ((ediff-window-setup-function 'ediff-setup-windows-plain)
@@ -531,12 +555,13 @@ For disabling the behaviour for certain buffers and/or modes."
  ;; for back and forward mouse keys
  ("<XF86Back>"     . previous-buffer)
  ("<mouse-8>"      . previous-buffer)
- ("<drag-mouse-8>" . previous-buffer)
;; ("<drag-mouse-8>" . previous-buffer)
  ("<XF86Forward>"  . next-buffer)
  ("<mouse-9>"      . next-buffer)
- ("<drag-mouse-9>" . next-buffer)
- ("<drag-mouse-2>" . kill-this-buffer)
- ("<drag-mouse-3>" . ivy-switch-buffer))
+ ;; ("<drag-mouse-9>" . next-buffer)
+ ;; ("<drag-mouse-2>" . kill-this-buffer)
+ ;; ("<drag-mouse-3>" . switch-to-buffer)
+ )
 
 (bind-keys
  :prefix-map b/straight-prefix-map
@@ -568,7 +593,7 @@ For disabling the behaviour for certain buffers and/or modes."
 ;;; Essential packages
 
 (use-package exwm
-  :disabled
+  :if b/exwm-p
   :demand
   :config
   ;; make class name the buffer name, truncating beyond 60 characters
@@ -764,18 +789,7 @@ around if needed."
   :config
   (exwm-randr-enable)
   :custom
-  (exwm-randr-workspace-monitor-plist '(1 "VGA-1"))
-  :hook
-  (exwm-randr-screen-change . (lambda ()
-                                (let ((xrandr
-                                       (string-join
-                                        '("xrandr"
-                                          "--output VGA-1"
-                                          "--same-as LVDS-1"
-                                          "--auto")
-                                        " ")))
-                                  (start-process-shell-command
-                                   "xrandr" nil xrandr)))))
+  (exwm-randr-workspace-monitor-plist '(1 "VGA-1")))
 
 (use-feature exwm-systemtray
   :demand
@@ -913,6 +927,7 @@ around if needed."
   :custom
   (magit-diff-refine-hunk t)
   (magit-display-buffer-function #'magit-display-buffer-fullframe-status-v1)
+  ;; (magit-completing-read-function 'magit-ido-completing-read)
   :custom-face (magit-diff-file-heading ((t (:weight normal)))))
 
 ;; recently opened files
@@ -920,11 +935,73 @@ around if needed."
   :defer 0.2
   ;; :config
   ;; (add-to-list 'recentf-exclude "^/\\(?:ssh\\|su\\|sudo\\)?:")
+  :config
+  (recentf-mode)
   :custom
   (recentf-max-saved-items 2000))
 
 ;; smart M-x enhancement (needed by counsel for history)
-(use-package smex)
+;; (use-package smex)
+
+(bind-keys
+ ("C-c f ." . find-file)
+ ("C-c f l" . find-library)
+ ("C-c f r" . recentf-open-files)
+ ("C-c x"   . execute-extended-command))
+
+(comment
+  (use-feature ido
+    :demand
+    :bind
+    (:map ido-common-completion-map
+          ([escape] . minibuffer-keyboard-quit)
+          ("DEL"    . b/ido-backspace))
+    :config
+    (require 'delsel)
+    (defun b/ido-backspace ()
+      "Forward to `backward-delete-char'.  On error (read-only), quit."
+      (interactive)
+      (condition-case nil
+          (backward-delete-char 1)
+        (error
+         (minibuffer-keyboard-quit))))
+    (ido-mode 1)
+    (ido-everywhere 1)
+    :custom
+    (ido-enable-flex-matching t)
+    ;; (ido-enable-regexp t)
+    ;; (ido-enable-prefix t)
+    (ido-max-window-height 10)
+    (ido-use-virtual-buffers t))
+
+  (use-package ido-vertical-mode
+    :defer 0.3
+    :config
+    (ido-vertical-mode 1)
+    :custom
+    (ido-vertical-define-keys 'C-n-C-p-up-and-down)
+    (ido-vertical-show-count t))
+
+  (use-package ido-completing-read+
+    :defer 0.3
+    :after ido
+    :config
+    (ido-ubiquitous-mode 1))
+
+  (use-package crm-custom
+    :defer 0.3
+    :config
+    (crm-custom-mode 1))
+
+  (use-feature icomplete
+    :defer 0.3
+    :config
+    (icomplete-mode 1)))
+
+(use-package amx
+  :defer 0.3
+  :config
+  (amx-mode))
 
 (use-package ivy
   :defer 0.3
@@ -936,7 +1013,7 @@ around if needed."
    ("DEL"    . ivy-backward-delete-char))
   :config
   (setq ivy-wrap t
-        ivy-height 14
+        ;; ivy-height 14
         ivy-use-virtual-buffers t
         ivy-virtual-abbreviate 'abbreviate
         ivy-count-format "%d/%d ")
@@ -954,27 +1031,25 @@ This function is intended for use with `ivy-ignore-buffers'."
   (add-to-list 'ivy-ignore-buffers 'b/ivy-ignore-buffer-p)
 
   (ivy-mode 1)
-  ;; :custom-face
-  ;; (ivy-minibuffer-match-face-2 ((t (:background "#e99ce8" :weight semi-bold))))
-  ;; (ivy-minibuffer-match-face-3 ((t (:background "#bbbbff" :weight semi-bold))))
-  ;; (ivy-minibuffer-match-face-4 ((t (:background "#ffbbff" :weight semi-bold))))
-)
+  :custom-face
+  (ivy-minibuffer-match-face-1 ((t (:background "#eeeeee"))))
+  (ivy-minibuffer-match-face-2 ((t (:background "#e7e7e7" :weight bold))))
+  (ivy-minibuffer-match-face-3 ((t (:background "light goldenrod" :weight semi-bold))))
+  (ivy-minibuffer-match-face-4 ((t (:background "misty rose" :weight semi-bold))))
+  (ivy-current-match ((((class color) (background light))
+                       :background "#d7d7d7" :foreground "black")
+                      (((class color) (background dark))
+                       :background "#65a7e2" :foreground "black"))))
 
 (use-package swiper
+  :demand
   :after ivy
-  :bind (("C-s"   . swiper-isearch)
-         ("C-r"   . swiper)
-         ("C-S-s" . isearch-forward)))
+  :bind (("C-S-s" . swiper-isearch)))
 
 (use-package counsel
+  :demand
   :after ivy
-  :bind (([remap execute-extended-command] . counsel-M-x)
-         ([remap find-file]                . counsel-find-file)
-         ("C-c b b"                        . ivy-switch-buffer)
-         ("C-c f ."                        . counsel-find-file)
-         ("C-c f l"                        . counsel-find-library)
-         ("C-c f r"                        . counsel-recentf)
-         ("C-c x"                          . counsel-M-x)
+  :bind (("C-c f r" . counsel-recentf)
          :map minibuffer-local-map
          ("C-r" . counsel-minibuffer-history))
   :config
@@ -1023,7 +1098,9 @@ This function is intended for use with `ivy-ignore-buffers'."
                ("C-d"   . b/eshell-quit-or-delete-char)
                ("C-S-l" . b/eshell-clear)
                ("M-r"   . counsel-esh-history)
-               ([tab]   . company-complete)))
+               ;; ([tab]   . company-complete)
+               :map eshell-hist-mode-map
+               ("M-r" . counsel-esh-history)))
 
   :hook (eshell-mode . b/eshell-setup)
   :custom
@@ -1248,7 +1325,9 @@ This function is intended for use with `ivy-ignore-buffers'."
   (add-hook 'prog-mode-hook #'indicate-buffer-boundaries-left))
 
 (use-feature text-mode
-  :hook (text-mode . indicate-buffer-boundaries-left))
+  :bind (:map text-mode-map ("C-*" . b/insert-asterism))
+  :hook ((text-mode . indicate-buffer-boundaries-left)
+         (text-mode . flyspell-mode)))
 
 (use-feature conf-mode
   :mode "\\.*rc$")
@@ -1257,19 +1336,21 @@ This function is intended for use with `ivy-ignore-buffers'."
   :mode "\\.bashrc$")
 
 (use-package company
-  :defer 0.6
   :bind
   (:map company-active-map
         ([tab]    . company-complete-common-or-cycle)
-        ([escape] . company-abort))
+        ([escape] . company-abort)
+        ("C-p"    . company-select-previous-or-abort)
+        ("C-n"    . company-select-next-or-abort))
   :custom
   (company-minimum-prefix-length 1)
   (company-selection-wrap-around t)
   (company-dabbrev-char-regexp "\\sw\\|\\s_\\|[-_]")
   (company-dabbrev-downcase nil)
   (company-dabbrev-ignore-case nil)
-  :config
-  (global-company-mode t))
+  ;; :config
+  ;; (global-company-mode t)
+  )
 
 (use-package flycheck
   :defer 0.6
@@ -1394,7 +1475,9 @@ This function is intended for use with `ivy-ignore-buffers'."
   (b/setq-every 2
     web-mode-code-indent-offset
     web-mode-css-indent-offset
-    web-mode-markup-indent-offset))
+    web-mode-markup-indent-offset)
+  :custom
+  (web-mode-enable-auto-indentation nil))
 
 (use-package emmet-mode
   :after (:any web-mode css-mode sgml-mode)
@@ -1572,7 +1655,11 @@ This function is intended for use with `ivy-ignore-buffers'."
   (load-theme 'tangomod t)
   (sml/apply-theme 'tangomod)
   (font-lock-remove-keywords
-   'org-mode b/org-mode-font-lock-keywords))
+   'org-mode b/org-mode-font-lock-keywords)
+  (when (featurep 'erc-hl-nicks)
+    (erc-hl-nicks-reset-face-table))
+  (when (featurep 'exwm-systemtray)
+    (exwm-systemtray--refresh)))
 
 (defun b/lights-off ()
   "Go dark."
@@ -1581,7 +1668,11 @@ This function is intended for use with `ivy-ignore-buffers'."
   (load-theme 'doom-one t)
   (sml/apply-theme 'automatic)
   (font-lock-add-keywords
-   'org-mode b/org-mode-font-lock-keywords t))
+   'org-mode b/org-mode-font-lock-keywords t)
+  (when (featurep 'erc-hl-nicks)
+    (erc-hl-nicks-reset-face-table))
+  (when (featurep 'exwm-systemtray)
+    (exwm-systemtray--refresh)))
 
 (bind-keys
  ("C-c t d" . b/lights-off)
@@ -1600,15 +1691,22 @@ This function is intended for use with `ivy-ignore-buffers'."
     ;; prefixes for global prefixes and minor modes
     "C-c @"   "outline"
     "C-c !"   "flycheck"
-    "C-c 8"   "typo"
-    "C-c 8 -" "typo/dashes"
-    "C-c 8 <" "typo/left-brackets"
-    "C-c 8 >" "typo/right-brackets"
+    ;; "C-c 8"   "typo"
+    ;; "C-c 8 -" "typo/dashes"
+    ;; "C-c 8 <" "typo/left-brackets"
+    ;; "C-c 8 >" "typo/right-brackets"
+    "C-x RET" "coding system"
     "C-x 8"   "unicode"
+    "C-x @"   "event modifiers"
     "C-x a"   "abbrev/expand"
     "C-x r"   "rectangle/register/bookmark"
+    "C-x t"   "tabs"
     "C-x v"   "version control"
+    "C-x X"   "edebug"
+    "C-x C-a" "edebug"
+    "C-x C-k" "kmacro"
     ;; prefixes for my personal bindings
+    "C-c &"   "yasnippet"
     "C-c a"   "applications"
     "C-c a e" "erc"
     "C-c a o" "org"
@@ -1625,6 +1723,10 @@ This function is intended for use with `ivy-ignore-buffers'."
     "C-c P s" "projectile/search"
     "C-c P x" "projectile/execute"
     "C-c P 4" "projectile/other-window"
+    "C-c p"   "package management"
+    "C-c ps"  "straight"
+    "C-c psa" "all"
+    "C-c psp" "package"
     "C-c q"   "boxquote"
     "C-c t"   "themes"
     ;; "s-O"     "outline"
@@ -1650,7 +1752,7 @@ This function is intended for use with `ivy-ignore-buffers'."
 (use-package crux            ; results in Waiting for git... [2 times]
   :defer 0.4
   :bind (("C-c d"   . crux-duplicate-current-line-or-region)
-         ("C-c D"   . crux-duplicate-and-comment-current-line-or-region)
+         ("C-c M-d" . crux-duplicate-and-comment-current-line-or-region)
          ("C-c f C" . crux-copy-file-preserve-attributes)
          ("C-c f D" . crux-delete-file-and-buffer)
          ("C-c f R" . crux-rename-file-and-buffer)
@@ -1747,12 +1849,19 @@ This function is intended for use with `ivy-ignore-buffers'."
 
 ;; easily type pretty quotes & other typography, like ‘’“”-–—«»‹›
 (use-package typo
+  :disabled
   :defer 0.5
   :config
   (typo-global-mode 1)
   :hook (((text-mode erc-mode web-mode) . typo-mode)
          (tex-mode                      . (lambda ()(typo-mode -1)))))
 
+(use-feature electric
+  :disabled
+  :demand
+  :config
+  (electric-quote-mode))
+
 ;; highlight TODOs in buffers
 (use-package hl-todo
   :defer 0.5
@@ -1881,7 +1990,24 @@ This function is intended for use with `ivy-ignore-buffers'."
   :straight (debbugs
              :host github
              :repo "emacs-straight/debbugs"
-             :files (:defaults "Debbugs.wsdl")))
+             :files (:defaults "Debbugs.wsdl"))
+  :bind
+  (("C-c D d" . debbugs-gnu)
+   ("C-c D e" .
+    (lambda ()
+      (interactive)
+      (setq debbugs-gnu-current-suppress t)
+      (debbugs-gnu debbugs-gnu-default-severities '("emacs"))))
+   ("C-c D g" .
+    (lambda ()
+      (interactive)
+      (setq debbugs-gnu-current-suppress t)
+      (debbugs-gnu debbugs-gnu-default-severities '("gnuzilla"))))
+   ("C-c D G" .
+    (lambda ()
+      (interactive)
+      (setq debbugs-gnu-current-suppress t)
+      (debbugs-gnu debbugs-gnu-default-severities '("guix"))))))
 
 (use-package org-ref
   :init
@@ -1904,11 +2030,20 @@ This function is intended for use with `ivy-ignore-buffers'."
 
 (use-feature window
   :bind
-  (("C-c w <right>" . split-window-right)
-   ("C-c w <down>"  . split-window-below)
-   ("C-c w s l"     . split-window-right)
-   ("C-c w s j"     . split-window-below)
-   ("C-c w q"       . quit-window))
+  (("C-c w e"   . (lambda ()
+                    (interactive)
+                    (split-window-right)
+                    (other-window 1)
+                    (erc-switch-to-buffer)))
+   ("C-c w s l" . (lambda ()
+                    (interactive)
+                    (split-window-right)
+                    (other-window 1)))
+   ("C-c w s j" . (lambda ()
+                    (interactive)
+                    (split-window-below)
+                    (other-window 1)))
+   ("C-c w q"   . quit-window))
   :custom
   (split-width-threshold 150))
 
@@ -1938,7 +2073,9 @@ This function is intended for use with `ivy-ignore-buffers'."
               ("<C-XF86Forward>" . pdf-history-forward)
               ("<mouse-9>"       . pdf-history-forward)
               ("<drag-mouse-9>"  . pdf-history-forward)
-              ("M-RET"           . image-previous-line))
+              ("M-RET"           . image-previous-line)
+              ("C-s"             . isearch-forward)
+              ("s s"             . isearch-forward))
   :config (pdf-tools-install nil t)
   :custom (pdf-view-resize-factor 1.05))
 
@@ -1995,6 +2132,35 @@ This function is intended for use with `ivy-ignore-buffers'."
   :custom
   (nnreddit-python-command "python3"))
 
+(use-package hyperbole
+  :disabled
+  :straight (hyperbole
+             :host github :repo "rswgnu/hyperbole"
+             :files ("*.el" ("kotl" "kotl/*.el")
+                     "DEMO" "man/*.info" "man/*.texi")))
+
+(use-package oddmuse-curl
+  :straight (:host github :repo "kensanata/oddmuse-curl")
+  :config
+  (setq
+   oddmuse-wikis
+   (append
+    '(("EmacsConf" "https://emacsconf.org" utf-8 "question" nil)
+      ("EmacsConf 2019" "https://emacsconf.org/2019" utf-8 "question" nil))
+    oddmuse-wikis))
+  :custom
+  (oddmuse-username "bandali"))
+
+(use-package debpaste
+  :custom
+  (debpaste-paste-is-hidden t))
+
+(use-package scpaste
+  :disabled
+  :config
+  (setq scpaste-http-destination "https://p.bndl.org"
+        scpaste-scp-destination "nix:/var/www/p.bndl.org"))
+
 \f
 ;;; Email (with Gnus)
 
@@ -2035,6 +2201,8 @@ This function is intended for use with `ivy-ignore-buffers'."
                                   ;; (: gnus-group-split-fancy "INBOX" t "INBOX")
                                   ;; gnu
                                   (list ".*<\\(.*\\)\\.\\(non\\)?gnu\\.org>.*" "l.\\1")
+                                  ;; gnus
+                                  (list ".*<\\(.*\\)\\.gnus\\.org>.*" "l.\\1")
                                   ;; *.lists.sr.ht, omitting one dot if present
                                   ;;    add more \\.?\\([^.]*\\) if needed
                                   (list ".*<~\\(.*\\)/\\([^.]*\\)\\.?\\([^.]*\\)\\.lists.sr.ht>.*" "l.~\\1.\\2\\3")
@@ -2098,6 +2266,9 @@ This function is intended for use with `ivy-ignore-buffers'."
      ("l\\.emacs-tangents"
       (to-address . "emacs-tangents@gnu.org")
       (to-list    . "emacs-tangents@gnu.org"))
+     ("l\\.emacsconf-committee"
+      (to-address . "emacsconf-committee@gnu.org")
+      (to-list    . "emacsconf-committee@gnu.org"))
      ("l\\.emacsconf-discuss"
       (to-address . "emacsconf-discuss@gnu.org")
       (to-list    . "emacsconf-discuss@gnu.org"))
@@ -2204,7 +2375,7 @@ This function is intended for use with `ivy-ignore-buffers'."
       (to-list    . "webmasters@gnu.org"))
      ("gnu.*"
       (gcc-self . t))
-     ("gnu\\."
+     ("l\\."
       (subscribed . t))
      ("nnimap\\+uw:.*"
       (gcc-self . t)))
@@ -2233,13 +2404,34 @@ This function is intended for use with `ivy-ignore-buffers'."
   :config
   (setq
    gnus-buttonized-mime-types '("multipart/\\(signed\\|encrypted\\)")
-   gnus-visible-headers
-   (concat gnus-visible-headers "\\|^List-Id:\\|^X-RT-Originator:\\|^User-Agent:")
-   gnus-sorted-header-list
-   '("^From:" "^Subject:" "^Summary:" "^Keywords:"
-     "^Followup-To:" "^To:" "^Cc:" "X-RT-Originator"
-     "^Newsgroups:" "List-Id:" "^Organization:"
-     "^User-Agent:" "^Date:")
+   gnus-sorted-header-list '("^From:"
+                             "^X-RT-Originator"
+                             "^Newsgroups:"
+                             "^Subject:"
+                             "^Date:"
+                             "^Envelope-To:"
+                             "^Followup-To:"
+                             "^Reply-To:"
+                             "^Organization:"
+                             "^Summary:"
+                             "^Abstract:"
+                             "^Keywords:"
+                             "^To:"
+                             "^[BGF]?Cc:"
+                             "^Posted-To:"
+                             "^Mail-Copies-To:"
+                             "^Mail-Followup-To:"
+                             "^Apparently-To:"
+                             "^Resent-From:"
+                             "^User-Agent:"
+                             "^X-detected-operating-system:"
+                             "^Message-ID:"
+                             ;; "^References:"
+                             "^List-Id:"
+                             "^Gnus-Warning:")
+   gnus-visible-headers (mapconcat 'identity
+                                   gnus-sorted-header-list
+                                   "\\|")
   ;; local-lapsed article dates
   ;; from https://www.emacswiki.org/emacs/GnusFormatting#toc11
   gnus-article-date-headers '(user-defined)
@@ -2276,14 +2468,12 @@ This function is intended for use with `ivy-ignore-buffers'."
 
 (use-feature gnus-msg
   :config
-  (defvar b/signature "Amin Bandali
-Free Software Activist | GNU Webmaster & Volunteer
-GPG: BE62 7373 8E61 6D6D 1B3A  08E8 A21A 0202 4881 6103
-https://shemshak.org/~amin")
   (defvar b/gnu-signature "Amin Bandali
-Free Software Activist | GNU Webmaster & Volunteer
+Free Software Activist | GNU Maintainer & Webmaster
 GPG: BE62 7373 8E61 6D6D 1B3A  08E8 A21A 0202 4881 6103
 https://bandali.eu.org")
+  (defvar b/shemshak-signature "Amin Bandali
+https://shemshak.org/~amin")
   (defvar b/uw-signature "Amin Bandali, MMath Student
 Cheriton School of Computer Science
 University of Waterloo
@@ -2292,30 +2482,36 @@ https://bandali.eu.org")
 Systems Committee
 Computer Science Club, University of Waterloo
 https://csclub.uwaterloo.ca/~abandali")
-  (setq gnus-posting-styles
+  (setq gnus-message-replysign t
+        gnus-posting-styles
         '((".*"
            (address "bandali@gnu.org")
-           (signature b/gnu-signature)
-           (eval (set (make-local-variable 'message-user-fqdn) "fencepost.gnu.org")))
+           (signature b/gnu-signature))
+          ("nnimap\\+gnu:l\\..*"
+           (signature nil))
+          ((header "subject" "ThankCRM")
+           (to "webmasters-comment@gnu.org")
+           (body "")
+           (eval (setq b/message-cite-say-hi nil)))
           ("nnimap\\+shemshak:.*"
            (address "amin@shemshak.org")
            (body "\nBest,\n")
-           (signature b/signature)
+           (signature b/shemshak-signature)
            (gcc "nnimap+shemshak:Sent")
            (eval (setq b/message-cite-say-hi t)))
-          ((header "subject" "ThankCRM")
-           (to "webmasters-comment@gnu.org")
-           (body "")
-           (eval (setq b/message-cite-say-hi nil)))
           ("nnimap\\+uw:.*"
            (address "bandali@uwaterloo.ca")
+           (body "\nBest,\n")
            (signature b/uw-signature))
           ("nnimap\\+uw:INBOX"
            (gcc "\"nnimap+uw:Sent Items\""))
           ("nnimap\\+csc:.*"
            (address "bandali@csclub.uwaterloo.ca")
            (signature b/csc-signature)
-           (gcc "nnimap+csc:Sent")))))
+           (gcc "nnimap+csc:Sent"))))
+  :hook (gnus-message-setup . (lambda ()
+                                (unless (mml-secure-is-encrypted-p)
+                                  (mml-secure-message-sign)))))
 
 (use-feature gnus-topic
   :hook (gnus-group-mode . gnus-topic-mode)
@@ -2341,6 +2537,11 @@ https://csclub.uwaterloo.ca/~abandali")
   :init
   (add-hook 'dired-mode-hook 'gnus-dired-mode))
 
+(comment
+  (use-feature gnus-utils
+    :custom
+    (gnus-completing-read-function 'gnus-ido-completing-read)))
+
 (use-feature mm-decode
   :config
   (setq mm-discouraged-alternatives '("text/html" "text/richtext")
@@ -2360,6 +2561,7 @@ https://csclub.uwaterloo.ca/~abandali")
         mail-envelope-from 'header))
 
 (use-feature message
+  :bind (:map message-mode-map ("<C-return>" . b/insert-asterism))
   :config
   ;; redefine for a simplified In-Reply-To header
   ;; (see https://todo.sr.ht/~sircmpwn/lists.sr.ht/67)
@@ -2392,12 +2594,12 @@ https://csclub.uwaterloo.ca/~abandali")
         '(gnus-find-subscribed-addresses)
         message-dont-reply-to-names
         "\\(\\(\\(amin\\|mab\\)@shemshak\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a?bandali@\\(csclub\\.\\)?uwaterloo\\.ca\\)\\)")
-  (require 'company-ebdb)
+  ;; (require 'company-ebdb)
   :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
          (message-mode . flyspell-mode)
          (message-mode . (lambda ()
-                           ;; (setq fill-column 65
-                           ;;       message-fill-column 65)
+                           (setq-local fill-column b/fill-column
+                                       message-fill-column b/fill-column)
                            (make-local-variable 'company-idle-delay)
                            (setq company-idle-delay 0.2))))
   ;; :custom-face
@@ -2432,6 +2634,17 @@ https://csclub.uwaterloo.ca/~abandali")
         ("r" . footnote-renumber-footnotes)
         ("s" . footnote-set-style)))
 
+(use-package bbdb
+  :disabled
+  :demand
+  :after gnus
+  :bind (:map gnus-group-mode-map ("e" . bbdb))
+  :config
+  (bbdb-initialize 'gnus 'message)
+  :custom
+  (bbdb-complete-mail-allow-cycling t)
+  (bbdb-user-mail-address-re message-dont-reply-to-names))
+
 (use-package ebdb
   :demand
   :after gnus
@@ -2444,17 +2657,21 @@ https://csclub.uwaterloo.ca/~abandali")
 (use-feature ebdb-com
   :after ebdb)
 
-;; (use-package ebdb-complete
-;;   :after ebdb
-;;   :config
-;;   (ebdb-complete-enable))
-
-(use-package company-ebdb
+(use-feature ebdb-complete
+  :after ebdb
   :config
-  (defun company-ebdb--post-complete (_) nil))
+  ;; (setq ebdb-complete-mail 'capf)
+  (ebdb-complete-enable))
 
-(use-feature ebdb-gnus
+(use-feature ebdb-message
   :demand
+  :after ebdb)
+
+;; (use-package company-ebdb
+;;   :config
+;;   (defun company-ebdb--post-complete (_) nil))
+
+(use-feature ebdb-gnus
   :after ebdb
   :custom
   (ebdb-gnus-window-size 0.3))
@@ -2507,7 +2724,7 @@ https://csclub.uwaterloo.ca/~abandali")
 ;;; IRC (with ERC and ZNC)
 
 (use-feature erc
-  :bind (("C-c b e" . erc-switch-to-buffer)
+  :bind (("C-c b b" . erc-switch-to-buffer)
          :map erc-mode-map
          ("M-a" . erc-track-switch-buffer))
   :custom
@@ -2544,7 +2761,7 @@ https://csclub.uwaterloo.ca/~abandali")
 (use-feature erc-pcomplete
   :after erc
   :custom
-  (erc-pcomplete-nick-postfix ","))
+  (erc-pcomplete-nick-postfix ", "))
 
 (use-feature erc-track
   :after erc