guix: switch to us basic layout instead of us altgr-intl
[~bandali/configs] / .emacs.d / init.el
index 535e7c5..4998cd8 100644 (file)
@@ -1,6 +1,6 @@
 ;;; init.el --- Amin Bandali's Emacs config -*- lexical-binding: t -*-
 
-;; Copyright (C) 2018-2019  Amin Bandali <mab@gnu.org>
+;; Copyright (C) 2018-2019  Amin Bandali <bandali@gnu.org>
 
 ;; This program is free software: you can redistribute it and/or modify
 ;; it under the terms of the GNU General Public License as published by
@@ -18,7 +18,7 @@
 ;;; Commentary:
 
 ;; Emacs configuration of Amin Bandali, computer scientist, functional
-;; programmer, and free software advocate.  Uses straight.el for
+;; programmer, and free software activist.  Uses straight.el for
 ;; purely functional and fully reproducible package management.
 
 ;; Over the years, I've taken inspiration from configurations of many
@@ -295,7 +295,19 @@ For disabling the behaviour for certain buffers and/or modes."
   :config (pixel-scroll-mode 1))
 
 ;; ask for GPG passphrase in minibuffer
-(setq epg-pinentry-mode 'loopback)
+(use-feature epg-config
+  :defer 0.4
+  :custom
+  ((epg-gpg-program (executable-find "gpg"))
+   (epg-pinentry-mode 'loopback)))
+(use-feature epg
+  :after epg-config)
+(use-package pinentry
+  :demand
+  :after (epg server)
+  :config
+  (setq pinentry--socket-dir server-socket-dir)
+  (pinentry-start))
 
 ;; useful libraries
 (require 'cl-lib)
@@ -557,6 +569,7 @@ For disabling the behaviour for certain buffers and/or modes."
         org-catch-invisible-edits 'show-and-error
         org-log-done 'time)
   (add-to-list 'org-structure-template-alist '("L" . "src emacs-lisp") t)
+  (add-to-list 'org-modules 'org-habit)
   :bind
   (("C-c a o a" . org-agenda)
    :map org-mode-map
@@ -568,8 +581,11 @@ For disabling the behaviour for certain buffers and/or modes."
          (org-mode . flyspell-mode))
   :custom
   (org-agenda-files '("~/usr/org/todos/personal.org"
+                      "~/usr/org/todos/habits.org"
                       "~/usr/org/todos/masters.org"))
   (org-agenda-start-on-weekday 0)
+  (org-agenda-time-leading-zero t)
+  (org-habit-graph-column 44)
   (org-latex-packages-alist '(("" "listings") ("" "color")))
   :custom-face
   '(org-block-begin-line ((t (:foreground "#5a5b5a" :background "#1d1f21"))))
@@ -1213,6 +1229,10 @@ For disabling the behaviour for certain buffers and/or modes."
 
 (use-package go-mode)
 
+(use-package po-mode
+  :hook
+  (po-mode . (lambda () (run-with-timer 0.1 nil 'View-exit))))
+
 \f
 ;;; Theme
 
@@ -1655,7 +1675,7 @@ For disabling the behaviour for certain buffers and/or modes."
   (setq
    gnus-select-method '(nnnil "")
    gnus-secondary-select-methods
-   '((nnimap "amin"
+   '((nnimap "shemshak"
             (nnimap-stream plain)
             (nnimap-address "127.0.0.1")
             (nnimap-server-port 143)
@@ -1679,6 +1699,8 @@ For disabling the behaviour for certain buffers and/or modes."
                                  (list ".*emacs-orgmode.gnu.org" "l.gnu.emacs.orgmode")
                                  (list ".*emacs-tangents.gnu.org" "l.gnu.emacs.tangents")
                                  (list ".*emacsconf-discuss.gnu.org" "l.gnu.emacsconf.discuss")
+                                 (list ".*emacsconf-register.gnu.org" "l.gnu.emacsconf.register")
+                                 (list ".*emacsconf-submit.gnu.org" "l.gnu.emacsconf.submit")
                                  (list ".*fencepost-users.gnu.org" "l.gnu.fencepost.users")
                                  (list ".*gnunet-developers.gnu.org" "l.gnu.gnunet.developers")
                                  (list ".*help-gnunet.gnu.org" "l.gnu.gnunet.help")
@@ -1699,11 +1721,13 @@ For disabling the behaviour for certain buffers and/or modes."
                                  (list ".*haskell-art.we.lurk.org" "l.haskell.art")
                                  (list ".*haskell-cafe.haskell.org" "l.haskell.cafe")
                                  ;; other
+                                 (list ".*atreus.freelists.org" "l.atreus")
                                  (list ".*deepspec.lists.cs.princeton.edu" "l.deepspec")
                                  (list ".*notmuch.notmuchmail.org" "l.notmuch")
                                  (list ".*dev.lists.parabola.nu" "l.parabola.dev")
                                  ;; *@lists.sr.ht
                                  (list ".*~bandali/public-inbox@lists.sr.ht" "l.~bandali.public-inbox")
+                                 (list ".*~sircmpwn/free-writers-club@lists.sr.ht" "l.~sircmpwn.free-writers-club")
                                  (list ".*~sircmpwn/sr.ht-admins@lists.sr.ht" "l.~sircmpwn.srht.admins")
                                  (list ".*~sircmpwn/sr.ht-announce@lists.sr.ht" "l.~sircmpwn.srht.announce")
                                  (list ".*~sircmpwn/sr.ht-dev@lists.sr.ht" "l.~sircmpwn.srht.dev")
@@ -1730,9 +1754,12 @@ For disabling the behaviour for certain buffers and/or modes."
              (nnimap-server-port 143)
              (nnimap-authenticator plain)
              (nnimap-user "abandali@csc.uw.local")))
-   gnus-message-archive-group "nnimap+amin:Sent"
+   gnus-message-archive-group "nnimap+shemshak:Sent"
    gnus-parameters
-   '(("l\\.deepspec"
+   '(("l\\.atreus"
+      (to-address . "atreus@freelists.org")
+      (to-list    . "atreus@freelists.org"))
+     ("l\\.deepspec"
       (to-address . "deepspec@lists.cs.princeton.edu")
       (to-list    . "deepspec@lists.cs.princeton.edu")
       (list-identifier . "\\[deepspec\\]"))
@@ -1755,6 +1782,12 @@ For disabling the behaviour for certain buffers and/or modes."
      ("l\\.gnu\\.emacsconf\\.discuss"
       (to-address . "emacsconf-discuss@gnu.org")
       (to-list    . "emacsconf-discuss@gnu.org"))
+     ("l\\.gnu\\.emacsconf\\.register"
+      (to-address . "emacsconf-register@gnu.org")
+      (to-list    . "emacsconf-register@gnu.org"))
+     ("l\\.gnu\\.emacsconf\\.submit"
+      (to-address . "emacsconf-submit@gnu.org")
+      (to-list    . "emacsconf-submit@gnu.org"))
      ("l\\.gnu\\.fencepost\\.users"
       (to-address . "fencepost-users@gnu.org")
       (to-list    . "fencepost-users@gnu.org")
@@ -1820,6 +1853,9 @@ For disabling the behaviour for certain buffers and/or modes."
      ("l\\.~bandali\\.public-inbox"
       (to-address . "~bandali/public-inbox@lists.sr.ht")
       (to-list    . "~bandali/public-inbox@lists.sr.ht"))
+     ("l\\.~sircmpwn\\.free-writers-club"
+      (to-address . "~sircmpwn/free-writers-club@lists.sr.ht")
+      (to-list    . "~sircmpwn/free-writers-club@lists.sr.ht"))
      ("l\\.~sircmpwn\\.srht\\.admins"
       (to-address . "~sircmpwn/sr.ht-admins@lists.sr.ht")
       (to-list    . "~sircmpwn/sr.ht-admins@lists.sr.ht"))
@@ -1863,6 +1899,7 @@ For disabling the behaviour for certain buffers and/or modes."
 (use-feature gnus-art
   :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
@@ -1905,15 +1942,19 @@ For disabling the behaviour for certain buffers and/or modes."
   (defvar mab/signature "Amin Bandali
 Free Software Activist | GNU Webmaster & Volunteer
 GPG: BE62 7373 8E61 6D6D 1B3A  08E8 A21A 0202 4881 6103
-https://shemshak.org/~amin/")
+https://shemshak.org/~amin")
+  (defvar mab/gnu-signature "Amin Bandali
+Free Software Activist | GNU Webmaster & Volunteer
+GPG: BE62 7373 8E61 6D6D 1B3A  08E8 A21A 0202 4881 6103
+https://bandalis.org")
   (defvar mab/uw-signature "Amin Bandali, MMath Student
 Cheriton School of Computer Science
 University of Waterloo
-https://shemshak.org/~amin/")
+https://bandalis.org")
   (defvar mab/csc-signature "Amin Bandali
 Termcom, Computer Science Club
 University of Waterloo
-https://shemshak.org/~amin/")
+https://bandalis.org")
   (setq gnus-posting-styles
         '((".*"
            (address "amin@shemshak.org")
@@ -1921,8 +1962,8 @@ https://shemshak.org/~amin/")
            (signature mab/signature)
            (eval (setq mab/message-cite-say-hi t)))
           ("nnimap\\+gnu:.*"
-           (address "mab@gnu.org")
-           (organization "GNU Project")
+           (address "bandali@gnu.org")
+           (signature mab/gnu-signature)
            (eval (set (make-local-variable 'message-user-fqdn) "fencepost.gnu.org")))
           ((header "subject" "ThankCRM")
            (to "webmasters-comment@gnu.org")
@@ -1930,13 +1971,11 @@ https://shemshak.org/~amin/")
            (eval (setq mab/message-cite-say-hi nil)))
           ("nnimap\\+uw:.*"
            (address "abandali@uwaterloo.ca")
-           (organization "University of Waterloo")
            (signature mab/uw-signature))
           ("nnimap\\+uw:INBOX"
            (gcc "\"nnimap+uw:Sent Items\""))
           ("nnimap\\+csc:.*"
            (address "abandali@csclub.uwaterloo.ca")
-           (organization "Computer Science Club, University of Waterloo")
            (signature mab/csc-signature)
            (gcc "nnimap+csc:Sent")))))
 
@@ -1966,7 +2005,9 @@ https://shemshak.org/~amin/")
 
 (use-feature mm-decode
   :config
-  (setq mm-discouraged-alternatives '("text/html" "text/richtext")))
+  (setq mm-discouraged-alternatives '("text/html" "text/richtext")
+        mm-decrypt-option 'known
+        mm-verify-option 'known))
 
 (use-feature sendmail
   :config
@@ -2007,7 +2048,7 @@ https://shemshak.org/~amin/")
         message-subscribed-address-functions
         '(gnus-find-subscribed-addresses)
         message-dont-reply-to-names
-        "\\(\\(amin@\\(shemshak\\|bndl\\)\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(mab\\|bandali\\|aminb?\\)@gnu\\.org\\)\\|\\(a\\(min\\.\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
+        "\\(\\(\\(amin\\|mab\\)@shemshak\\.org\\)\\|\\(amin@bndl\\.org\\)\\|\\(.*@aminb\\.org\\)\\|\\(\\(bandali\\|mab\\|aminb?\\)@gnu\\.org\\)\\|\\(a\\(min\\.\\)?bandali@uwaterloo\\.ca\\)\\|\\(abandali@csclub\\.uwaterloo\\.ca\\)\\)")
   (require 'company-ebdb)
   :hook (;; (message-setup . mml-secure-message-sign-pgpmime)
          (message-mode . flyspell-mode)
@@ -2126,6 +2167,7 @@ https://shemshak.org/~amin/")
   (erc-join-buffer 'bury)
   (erc-lurker-hide-list '("JOIN" "PART" "QUIT"))
   (erc-nick "bandali")
+  (erc-prompt "erc>")
   (erc-rename-buffers t)
   (erc-server-reconnect-attempts 5)
   (erc-server-reconnect-timeout 3)