[emacs] assimilate and use gnus-alias instead of gnus-posting-styles
[~bandali/configs] / init.org
index 0a9434c..8de259e 100644 (file)
--- a/init.org
+++ b/init.org
@@ -1756,7 +1756,7 @@ Hopefully temporary.
 
 ** Gnus
 
 
 ** Gnus
 
-#+begin_src emacs-lisp :tangle yes
+#+begin_src emacs-lisp
 (setq amin-gnus-init-file (no-littering-expand-etc-file-name "gnus"))
 
 (use-package gnus
 (setq amin-gnus-init-file (no-littering-expand-etc-file-name "gnus"))
 
 (use-package gnus
@@ -1780,18 +1780,9 @@ Hopefully temporary.
    gnus-message-archive-group "nnimap:Sent"
    gnus-parameters
    '(("amin"
    gnus-message-archive-group "nnimap:Sent"
    gnus-parameters
    '(("amin"
-      (display . 20)
-      (posting-style
-       ((header "to" "amin@aminb.org")
-        (address "amin@aminb.org"))
-       ((header "delivered-to" "gnu@aminb.org")
-        (address "bandali@gnu.org"))))
+      (display . 20))
      ("uwaterloo"
      ("uwaterloo"
-      (display . 20)
-      (posting-style
-       (address "abandali@uwaterloo.ca")
-       (gcc "\"nnimap+uwaterloo:Sent Items\""))))
-   ;; gnus-init-file        amin-gnus-init-file
+      (display . 20)))
    gnus-home-directory   (no-littering-expand-var-file-name "gnus/")
    gnus-directory        (no-littering-expand-var-file-name "gnus/News/")
    message-directory     amin-maildir
    gnus-home-directory   (no-littering-expand-var-file-name "gnus/")
    gnus-directory        (no-littering-expand-var-file-name "gnus/News/")
    message-directory     amin-maildir
@@ -1822,23 +1813,81 @@ Hopefully temporary.
            (lapsed (progn
                      (string-match " (.+" combined-lapsed)
                      (match-string 0 combined-lapsed))))
            (lapsed (progn
                      (string-match " (.+" combined-lapsed)
                      (match-string 0 combined-lapsed))))
-      (concat local lapsed)))))
+      (concat local lapsed))))
+  (bind-keys
+   :map gnus-article-mode-map
+   ("r" . gnus-article-reply-with-original)
+   ("R" . gnus-article-wide-reply-with-original)))
 
 (use-package gnus-sum
 
 (use-package gnus-sum
+  :bind (:map gnus-summary-mode-map
+              :prefix-map amin--gnus-summary-prefix-map
+              :prefix "v"
+              ("r" . gnus-summary-reply)
+              ("w" . gnus-summary-wide-reply)
+              ("v" . gnus-summary-show-raw-article))
   :config
   (setq gnus-extra-headers (append gnus-extra-headers
   :config
   (setq gnus-extra-headers (append gnus-extra-headers
-                                   '(List-Id X-RT-Originator))))
+                                   '(List-Id X-RT-Originator)))
+  (bind-keys
+   :map gnus-summary-mode-map
+   ("r" . gnus-summary-reply-with-original)
+   ("R" . gnus-summary-wide-reply-with-original)))
 
 (use-package nnmail
   :config
   (setq nnmail-extra-headers (append nnmail-extra-headers
                                      '(List-Id X-RT-Originator))))
 
 
 (use-package nnmail
   :config
   (setq nnmail-extra-headers (append nnmail-extra-headers
                                      '(List-Id X-RT-Originator))))
 
+(use-package gnus-group
+  :hook (gnus-group-mode . gnus-topic-mode))
+
 (use-package mm-decode
   :config
   (setq mm-discouraged-alternatives '("text/html" "text/richtext")))
 #+end_src
 
 (use-package mm-decode
   :config
   (setq mm-discouraged-alternatives '("text/html" "text/richtext")))
 #+end_src
 
+** gnus-alias
+
+#+begin_src emacs-lisp
+(use-package gnus-alias
+  :commands (gnus-alias-determine-identity
+             gnus-alias-select-identity)
+  :bind (:map  message-mode-map
+               ("s-i" . gnus-alias-select-identity))
+  :config
+  (setq
+   gnus-alias-default-identity "amin"
+   gnus-alias-identity-alist
+   '(("amin"
+      nil   ;; Does not refer to any other identity
+      "Amin Bandali <amin@aminb.org>"
+      nil   ;; Organization
+      nil   ;; extra headers
+      nil   ;; extra body text
+      nil)  ;; signature file
+     ("gnu"
+      nil
+      "Amin Bandali <bandali@gnu.org>"
+      nil
+      nil
+      nil
+      nil)
+     ("uw"
+      nil
+      "Amin Bandali <abandali@uwaterloo.ca>"
+      nil
+      (("Gcc" . "\"nnimap+uwaterloo:Sent Items\""))
+      nil
+      nil))
+   gnus-alias-identity-rules
+   '(("amin" ("Delivered-To" "<amin\\@aminb\\.org" both) "amin")
+     ("gnu" ("Delivered-To" "<gnu\\@aminb\\.org" both) "gnu")
+     ("uw" ("any" "<\\(.+\\)\\@uwaterloo\\.ca" both) "uw"))
+   gnus-alias-override-user-mail-address t)
+  :hook (message-setup . gnus-alias-determine-identity))
+#+end_src
+
 ** sendmail
 
 #+begin_src emacs-lisp
 ** sendmail
 
 #+begin_src emacs-lisp