[Gnus] Restructure and simplify configuration

No need to keep those large junks of setq in the :init block of use-package,
moved them to top level.
This commit is contained in:
Daniel - 2019-02-02 18:22:07 +01:00
parent cfda96a070
commit 966807281f
Signed by: dbo
GPG Key ID: 4F63DB96D45AA9C6
1 changed files with 224 additions and 221 deletions

91
init.el
View File

@ -1197,8 +1197,6 @@
;; * Mail
(setq send-mail-function 'smtpmail-send-it)
(use-package db-mail
:commands (db/public-key
db/encryption-possible-p
@ -1225,9 +1223,9 @@
(add-hook 'mail-setup-hook 'bbdb-mail-aliases)
(run-with-timer 0 3600 #'bbdb-save)))
(use-package gnus
:commands (gnus)
:init (setq gnus-init-file (expand-file-name "gnus.el" emacs-d)
;; General Gnus configuration
(setq gnus-init-file (expand-file-name "gnus.el" emacs-d)
gnus-home-directory (expand-file-name "~/Mail/news/")
gnus-directory (expand-file-name "~/Mail/news/")
gnus-kill-files-directory gnus-directory
@ -1235,8 +1233,6 @@
gnus-cache-directory (expand-file-name "cache/" gnus-directory)
gnus-verbose 10
;; General Configuration
message-dont-reply-to-names (regexp-opt (cons user-mail-address
db/additional-mail-addresses)
'words)
@ -1294,9 +1290,17 @@
"X-Jabber-ID:"
"User-Agent:"))
;; Appearence
message-citation-line-function
(lambda ()
(when message-reply-headers
(insert "ghItlhpu' "
(mail-header-from message-reply-headers)
":")
(newline))))
gnus-group-line-format "%S%p%P%5y(%2i):%B%(%s:%G%)\n"
;; Gnus Appearence
(setq gnus-group-line-format "%S%p%P%5y(%2i):%B%(%s:%G%)\n"
gnus-auto-select-first nil
gnus-auto-select-next nil
gnus-summary-line-format "%U%O%R%6k %(%&user-date; %-13,13f %B%s%)\n"
@ -1335,11 +1339,11 @@
gnus-treat-strip-multiple-blank-lines nil
gnus-treat-display-smileys t
gnus-treat-emphasize 'head
gnus-treat-unsplit-urls t
gnus-treat-unsplit-urls t)
;; Adaptive Scoring
gnus-use-scoring nil
(setq gnus-use-scoring nil
gnus-use-adaptive-scoring nil
gnus-adaptive-word-length-limit 5
gnus-adaptive-word-no-group-words t
@ -1365,11 +1369,11 @@
("^nntp.*"
(gnus-use-scoring nil)
(gnus-summary-mark-below -1000)
(gnus-use-adaptive-scoring '(word line))))
(gnus-use-adaptive-scoring '(word line)))))
;; Gnus Registry
gnus-registry-split-strategy 'majority
(setq gnus-registry-split-strategy 'majority
gnus-registry-ignored-groups '(("^nntp" t)
("^nnfolder" t)
("^nnir" t)
@ -1379,28 +1383,22 @@
gnus-registry-track-extra '(sender subject recipient)
gnus-registry-cache-file (expand-file-name "gnus.registry.eioioi"
emacs-d)
gnus-refer-article-method 'current
gnus-refer-article-method 'current)
;; MIME
gnus-ignored-mime-types '("text/x-vcard")
(setq gnus-ignored-mime-types '("text/x-vcard")
message-forward-as-mime t
gnus-inhibit-mime-unbuttonizing nil
gnus-buttonized-mime-types '("multipart/signed" "multipart/encrypted")
gnus-inhibit-images t
gnus-blocked-images "."
message-citation-line-function
(lambda ()
(when message-reply-headers
(insert "ghItlhpu' "
(mail-header-from message-reply-headers)
":")
(newline)))
mm-text-html-renderer 'shr
mm-discouraged-alternatives '("text/richtext" "text/html"))
;; Signing and Encryption
mm-encrypt-option nil
(setq mm-encrypt-option nil
mm-sign-option nil
mm-decrypt-option 'known
mm-verify-option 'known
@ -1410,27 +1408,34 @@
gnus-message-replysign t
gnus-message-replyencrypt t
gnus-message-replysignencrypted t
mml-secure-cache-passphrase nil
mml-secure-cache-passphrase nil)
;; Archiving: we store messages in the current group, so there is
;; Archiving
;; We store messages in the current group, so there is
;; no need to use Gnus archiving method
gnus-message-archive-method nil
(setq gnus-message-archive-method nil
gnus-update-message-archive-method t
gnus-message-archive-group nil
gnus-gcc-mark-as-read t
gnus-gcc-mark-as-read t)
;; Searching
nnir-method-default-engines '((nnimap . imap)
(setq nnir-method-default-engines '((nnimap . imap)
(nnmaildir . notmuch)
(nntp . gmane))
(nntp . gmane)))
;; Agents
gnus-agent-mark-unread-after-downloaded nil
(setq gnus-agent-mark-unread-after-downloaded nil
gnus-agent-synchronize-flags t
gnus-agent-go-online t)
;; Package configuration
(use-package gnus
:commands (gnus)
:config (progn
(require 'db-mail)
@ -1521,13 +1526,12 @@
(use-package mm-decode
:defer t
:init (setq mm-text-html-renderer 'shr
mm-discouraged-alternatives '("text/richtext" "text/html")
mm-automatic-display (-difference mm-automatic-display
:config (progn
(setq mm-automatic-display (-difference mm-automatic-display
'("text/html"
"text/enriched"
"text/richtext")))
:config (progn
;; Automatically show PGP data inline
(add-to-list 'mm-inlined-types "application/pgp$")
(add-to-list 'mm-inline-media-tests
@ -1572,12 +1576,13 @@
(use-package mml
:defer t
:config (advice-add 'mml-attach-file
:around #'db/mml-attach-file--go-to-eob))
:config (progn
;; Move to end of message buffer before attaching a file
(advice-add 'mml-attach-file
:around #'db/mml-attach-file--go-to-eob)))
(use-package notmuch
:defer t
:init (setq notmuch-fcc-dirs nil))
(setq notmuch-fcc-dirs nil
send-mail-function 'smtpmail-send-it)
(use-package smtpmail
:defer t
@ -1599,10 +1604,8 @@
smtpmail-smtp-server))))
(signal (car signals-data) (cdr signals-data)))))))
(use-package starttls
:defer t
:init (setq starttls-use-gnutls t
starttls-extra-arguments '("--strict-tofu")))
(setq starttls-use-gnutls t
starttls-extra-arguments '("--strict-tofu"))
;; * Crypto