From 6f0bcb50ae1e022651f909b758a1c26c0ad4feda Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:36:19 +0200 Subject: Setup fancy imap mail splitting --- emacs-private.el.gpg | Bin 1030 -> 1043 bytes gnus.org | 25 ++++++++++++++++++++----- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/emacs-private.el.gpg b/emacs-private.el.gpg index 6b46930..4b638e1 100644 Binary files a/emacs-private.el.gpg and b/emacs-private.el.gpg differ diff --git a/gnus.org b/gnus.org index d799395..e50097a 100644 --- a/gnus.org +++ b/gnus.org @@ -14,11 +14,19 @@ Load private settings #+begin_src emacs-lisp ;; (add-to-list 'gnus-secondary-select-methods (setq gnus-select-method - `(nnimap ,private/imap-name - (nnimap-address ,private/imap-address) - (nnimap-server-port 993) - (nnimap-stream ssl) - (nnir-search-engine imap))) + `(nnimap ,private/imap-name + (nnimap-address ,private/imap-address) + (nnimap-server-port 993) + (nnimap-stream ssl) + (nnir-search-engine imap) + (nnimap-inbox "INBOX") + (nnimap-split-methods 'nnimap-split-fancy) + (nnimap-split-fancy + (| (: nnmail-split-fancy-with-parent) + ,@private/imap-split-fancy + "INBOX" + )) + )) #+end_src Sort by newest first #+begin_src emacs-lisp @@ -36,6 +44,13 @@ Sending mail smtpmail-smtp-service 587 starttls-use-gnutls t) #+end_src +Setup for fancy mail splitting. Also see the parameters in ~gnus-select-method~. +#+begin_src emacs-lisp +(setq nnmail-split-methods 'nnimap-split-fancy) + +(setq nnmail-cache-accepted-message-ids t) +(setq nnmail-message-id-cache-length 10000) +#+end_src Load only groups with level < 2 for faster startup. #+begin_src emacs-lisp -- cgit v1.2.3 From d36b31f33949e6d02e5f2514d74168cbfe0ff636 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:36:48 +0200 Subject: Add local nntp server I use pnntprss to convert rss and atom feeds to nntp --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index e50097a..91ff202 100644 --- a/gnus.org +++ b/gnus.org @@ -28,6 +28,10 @@ Load private settings )) )) #+end_src +Add local nntp server +#+begin_src emacs-lisp +(add-to-list 'gnus-secondary-select-methods '(nntp "localhost" 4321)) +#+end_src Sort by newest first #+begin_src emacs-lisp (setq gnus-article-sort-functions '((not gnus-thread-sort-by-date)) -- cgit v1.2.3 From 500385ad9ad3bdee632b93f64b4f5b549bc25875 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:37:52 +0200 Subject: Enable message delaying --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index 91ff202..8db3b08 100644 --- a/gnus.org +++ b/gnus.org @@ -73,6 +73,10 @@ Disable indenting a topic. I always do it by accident. #+begin_src emacs-lisp (define-key gnus-topic-mode-map (kbd "") nil) #+end_src +Enable message delaying (scheduling) +#+begin_src emacs-lisp +(gnus-delay-initialize) +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 19fdb00168cc495b25a685d4ea8c6005a18dd2e5 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:38:09 +0200 Subject: Verify signed mail signatures and display results --- gnus.org | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/gnus.org b/gnus.org index 8db3b08..ce6c357 100644 --- a/gnus.org +++ b/gnus.org @@ -77,6 +77,14 @@ Enable message delaying (scheduling) #+begin_src emacs-lisp (gnus-delay-initialize) #+end_src +Verify mail signatures with known protocols. +#+begin_src emacs-lisp +(setq mm-verify-option 'known) +#+end_src +Show buttons for result of signature verification & for multipart mails. To show the message fully buttonized use =K b= in the summary buffer. +#+begin_src emacs-lisp +(setq gnus-buttonized-mime-types '("multipart/signed" "multipart/alternative")) +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 97050ca686a4b0a623e0a1a33f40602e659c61c7 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:41:06 +0200 Subject: Enable use of bbdb mail-alias in message-mode --- gnus.org | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/gnus.org b/gnus.org index ce6c357..4ae2e23 100644 --- a/gnus.org +++ b/gnus.org @@ -85,6 +85,11 @@ Show buttons for result of signature verification & for multipart mails. To show #+begin_src emacs-lisp (setq gnus-buttonized-mime-types '("multipart/signed" "multipart/alternative")) #+end_src +Enable =mail-aliases= and create aliases for all mail adresses if an entry has multiple. +#+begin_src emacs-lisp +(add-hook 'message-setup-hook 'bbdb-mail-aliases) +(setq bbdb-mail-alias 'all) +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 60efcd27d8ab30778bc05ea84daf6f3564fc120a Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:41:29 +0200 Subject: Dont fetch large attachments before text --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index 4ae2e23..4d8d75c 100644 --- a/gnus.org +++ b/gnus.org @@ -90,6 +90,10 @@ Enable =mail-aliases= and create aliases for all mail adresses if an entry has m (add-hook 'message-setup-hook 'bbdb-mail-aliases) (setq bbdb-mail-alias 'all) #+end_src +Don't fetch attachments before showing the message text to avoid long load times with big attachments. +#+begin_src emacs-lisp +(setq nnimap-fetch-partial-articles "text/") +#+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. #+begin_src emacs-lisp -- cgit v1.2.3 From dfe5a0cc71cb8c14aee7003423a53a1f49615f19 Mon Sep 17 00:00:00 2001 From: fpi Date: Sat, 9 May 2020 13:41:46 +0200 Subject: New handlers to fetch level 4 and 5 news --- gnus.org | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gnus.org b/gnus.org index 4d8d75c..39623e2 100644 --- a/gnus.org +++ b/gnus.org @@ -164,11 +164,16 @@ Background fetching for gnus. See the manual and [[https://www.emacswiki.org/ema (gnus-demon-scan-news-level 2 nil)) (defun gnus-demon-scan-news-3 () (gnus-demon-scan-news-level 3 t)) +(defun gnus-demon-scan-news-4 () + (gnus-demon-scan-news-level 4 t)) +(defun gnus-demon-scan-news-5 () + (gnus-demon-scan-news-level 5 t)) (setq gnus-demon-timestep 10) (gnus-demon-add-handler 'gnus-demon-scan-news-2 3 nil) -(gnus-demon-add-handler 'gnus-demon-scan-news-3 360 nil) -(gnus-demon-add-handler 'gnus-demon-scan-news-3 60 1) +(gnus-demon-add-handler 'gnus-demon-scan-news-3 60 t) +(gnus-demon-add-handler 'gnus-demon-scan-news-4 130 1) +(gnus-demon-add-handler 'gnus-demon-scan-news-5 140 1) #+end_src ** Modeline indicator From the [[https://www.emacswiki.org/emacs/GnusNotify][emacswiki Gnus Notify]]. -- cgit v1.2.3 From a650dbf28fb1f624466641e92107edec3ea0c52d Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:34:53 +0200 Subject: Use windows compatible file names --- gnus.org | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gnus.org b/gnus.org index 39623e2..907136e 100644 --- a/gnus.org +++ b/gnus.org @@ -128,6 +128,10 @@ Scoring List for Groups with various From Senders: (gnus-low-score-mark) (gnus-catchup-mark (from -1) (subject -1))) #+end_example +To ensure filenames compatible with Windows and stuff: +#+begin_src emacs-lisp +(setq nnheader-file-name-translation-alist '((?: . ?_) (?[ . ?_) (?] . ?_))) +#+end_src ** Window Layout See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 2148c0f243f9ebbeef41e171e8aea7e7e2d341e6 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:35:42 +0200 Subject: Update adaptive scoring & introduce score decaying --- gnus.org | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/gnus.org b/gnus.org index 907136e..b3f7327 100644 --- a/gnus.org +++ b/gnus.org @@ -95,7 +95,7 @@ Don't fetch attachments before showing the message text to avoid long load times (setq nnimap-fetch-partial-articles "text/") #+end_src ** Adaptive scoring -See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. +See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. #+begin_src emacs-lisp (setq gnus-use-adaptive-scoring '(word line)) (setq gnus-adaptive-word-length-limit 5) @@ -103,16 +103,22 @@ See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]]. (setq gnus-summary-mark-below -300) (setq gnus-default-adaptive-score-alist '((gnus-unread-mark) - (gnus-ticked-mark) - (gnus-dormant-mark) - (gnus-del-mark (subject -1)) - (gnus-read-mark (subject 2)) - (gnus-expirable-mark (subject -1)) - (gnus-killed-mark (subject -3)) - (gnus-kill-file-mark) - (gnus-ancient-mark) - (gnus-low-score-mark) - (gnus-catchup-mark (subject -1)))) + (gnus-ticked-mark) + (gnus-dormant-mark) + (gnus-del-mark (subject -50)) + (gnus-read-mark (from 5) (subject 100)) + (gnus-expirable-mark) + (gnus-killed-mark (subject -300)) + (gnus-kill-file-mark) + (gnus-ancient-mark) + (gnus-low-score-mark) + (gnus-catchup-mark (subject -40)))) +(setq gnus-default-adaptive-word-score-alist + `((,gnus-read-mark . 5) + (,gnus-catchup-mark . -5) + (,gnus-killed-mark . -15) + (,gnus-del-mark . -10))) +(setq gnus-adaptive-word-score-alist gnus-default-adaptive-word-score-alist) #+end_src Scoring List for Groups with various From Senders: #+begin_example @@ -132,6 +138,13 @@ To ensure filenames compatible with Windows and stuff: #+begin_src emacs-lisp (setq nnheader-file-name-translation-alist '((?: . ?_) (?[ . ?_) (?] . ?_))) #+end_src + +Slow scoring decay prevents huge scores from building up. Only run on =.ADAPT= score files and decay each scoring rule by 1 point or 1%, whichever is larger. +#+begin_src emacs-lisp +(setq gnus-decay-scores "\\.ADAPT\\'" + gnus-score-decay-constant 1 + gnus-score-decay-scale 0.01) +#+end_src ** Window Layout See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+begin_src emacs-lisp -- cgit v1.2.3 From 62d7f1af2da4d0e961221756a2d768e336390546 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:36:09 +0200 Subject: Split imap server definition --- gnus.org | 50 +++++++++++++++++++++++++++++++++++--------------- 1 file changed, 35 insertions(+), 15 deletions(-) diff --git a/gnus.org b/gnus.org index b3f7327..e0c0a8a 100644 --- a/gnus.org +++ b/gnus.org @@ -11,22 +11,42 @@ Load private settings (load secret-file) #+end_src * Config -#+begin_src emacs-lisp -;; (add-to-list 'gnus-secondary-select-methods +I use =imap= as my primary server. Setup some generic options: +#+begin_src emacs-lisp :noweb-ref imap :tangle no +nnimap ,private/imap-name +(nnimap-address ,private/imap-address) +(nnimap-server-port 993) +(nnimap-stream ssl) +(nnir-search-engine imap) +#+end_src +Only fetch partial articles. This saves time on opening messages with +large attachments. Load any text based parts and also load any +signature if the message is signed. Unfortunately to correctly verify +the signature the full message needs to be loaded, which is why I +disabled partial fetching for now. +#+begin_src emacs-lisp :noweb-ref imap :tangle no +;; (nnimap-fetch-partial-articles "\\(text/\\|signature\\)") +#+end_src +Set my default inbox folder. This is the folder mail is split out of. +#+begin_src emacs-lisp :noweb-ref imap :tangle no +(nnimap-inbox "INBOX") +#+end_src +Use fancy splitting and setup splitting rules. See [[info:gnus#Fancy Mail Splitting][info:gnus#Fancy Mail Splitting]] for details. +#+begin_src emacs-lisp :noweb-ref imap :tangle no +(nnimap-split-methods nnimap-split-fancy) +(nnimap-split-fancy + (| (: nnmail-split-fancy-with-parent) + ,@private/imap-split-fancy + "INBOX" + )) +#+end_src + +Noweb the primary server settings together. +#+begin_src emacs-lisp :noweb yes (setq gnus-select-method - `(nnimap ,private/imap-name - (nnimap-address ,private/imap-address) - (nnimap-server-port 993) - (nnimap-stream ssl) - (nnir-search-engine imap) - (nnimap-inbox "INBOX") - (nnimap-split-methods 'nnimap-split-fancy) - (nnimap-split-fancy - (| (: nnmail-split-fancy-with-parent) - ,@private/imap-split-fancy - "INBOX" - )) - )) + `( + <> + )) #+end_src Add local nntp server #+begin_src emacs-lisp -- cgit v1.2.3 From 2befd2e7229e9a960bcb904a53c592166cfe0f89 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:36:41 +0200 Subject: Better thread display & topic fixes --- gnus.org | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 56 insertions(+), 2 deletions(-) diff --git a/gnus.org b/gnus.org index e0c0a8a..315e16c 100644 --- a/gnus.org +++ b/gnus.org @@ -57,7 +57,35 @@ Sort by newest first (setq gnus-article-sort-functions '((not gnus-thread-sort-by-date)) gnus-thread-sort-functions '((not gnus-thread-sort-by-date))) #+end_src - +Gathering loose threads, whose parent is currently not displayed. I find the default ~'adopt~ to be too confusing. +#+begin_src emacs-lisp +(setq gnus-summary-make-false-root 'dummy) +(setq gnus-summary-dummy-line-format " %(: :%) %S +") +(setq gnus-summary-make-false-root-always t) +#+end_src +Also try to connect threads by guessing which articles are missing +#+begin_src emacs-lisp +(setq gnus-fetch-old-headers nil) +(setq gnus-build-sparse-threads 'more) +#+end_src +Better thread display (from [[https://www.emacswiki.org/emacs/GnusFormatting][emacswiki/GnusFormatting)]]. +#+begin_src emacs-lisp +(setq + gnus-summary-line-format "%U%R%z %(%&user-date; %-15,15f %B%s%)\n" + gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M")) + gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references + gnus-sum-thread-tree-false-root "" + gnus-sum-thread-tree-indent " " + gnus-sum-thread-tree-leaf-with-other "├► " + gnus-sum-thread-tree-root "" + gnus-sum-thread-tree-single-leaf "╰► " + gnus-sum-thread-tree-vertical "│") +#+end_src +Unicode reply symbol +#+begin_src emacs-lisp +(setq gnus-summary-to-prefix "→ ") +#+end_src Sending mail #+begin_src emacs-lisp :tangle no (setq message-send-mail-function 'smtpmail-send-it @@ -91,7 +119,33 @@ Save sent mails in my imap folder #+end_src Disable indenting a topic. I always do it by accident. #+begin_src emacs-lisp -(define-key gnus-topic-mode-map (kbd "") nil) +(use-package gnus-topic + :config + (defun fpi/gnus-topic-toggle-topic () + "Toggle display of the topic." + (interactive) + (when (gnus-group-topic-p) + (if (equal 'visible + (nth 1 (cadr (gnus-topic-find-topology (gnus-current-topic))))) + (gnus-topic-hide-topic) + (gnus-topic-show-topic)))) + (define-key gnus-topic-mode-map (kbd "") 'fpi/gnus-topic-toggle-topic) + (define-key gnus-topic-mode-map (kbd "TAB") 'fpi/gnus-topic-toggle-topic)) +#+end_src +Function to toggle display of group levels in the group buffer. +#+begin_src emacs-lisp +(defvar gnus-group-line-format-wo-levels nil) +(defun fpi/gnus-group-toggle-levels () + (interactive) + (if gnus-group-line-format-wo-levels + (setq gnus-group-line-format gnus-group-line-format-wo-levels + gnus-group-line-format-wo-levels nil) + (setq gnus-group-line-format-wo-levels gnus-group-line-format + gnus-group-line-format (concat "[%L] " gnus-group-line-format))) + ;; Hack to update display + (gnus-group-get-new-news 0)) +(define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) +#+end_src #+end_src Enable message delaying (scheduling) #+begin_src emacs-lisp -- cgit v1.2.3 From 58b750c90380595ca848c34d3d0e1c9ce63eb329 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:36:58 +0200 Subject: Add icalendar support --- gnus.org | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gnus.org b/gnus.org index 315e16c..94227da 100644 --- a/gnus.org +++ b/gnus.org @@ -146,6 +146,15 @@ Function to toggle display of group levels in the group buffer. (gnus-group-get-new-news 0)) (define-key gnus-topic-mode-map (kbd "T L") 'fpi/gnus-group-toggle-levels) #+end_src +Enable responding to meeting invites. +#+begin_src emacs-lisp +(use-package gnus-icalendar + :config + (gnus-icalendar-setup) + (setq gnus-icalendar-org-capture-file "~/win/Documents/sync/appointments.org") + (setq gnus-icalendar-org-capture-headline '("Calendar")) ;;make sure to create Calendar heading first + (gnus-icalendar-org-setup) + ) #+end_src Enable message delaying (scheduling) #+begin_src emacs-lisp -- cgit v1.2.3 From 2857ea9e67b66e5479100266c754c6e557fce314 Mon Sep 17 00:00:00 2001 From: fpi Date: Fri, 5 Jun 2020 15:37:17 +0200 Subject: Fixes --- gnus.org | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/gnus.org b/gnus.org index 94227da..7f26fbd 100644 --- a/gnus.org +++ b/gnus.org @@ -175,7 +175,11 @@ Enable =mail-aliases= and create aliases for all mail adresses if an entry has m #+end_src Don't fetch attachments before showing the message text to avoid long load times with big attachments. #+begin_src emacs-lisp -(setq nnimap-fetch-partial-articles "text/") +(setq nnimap-fetch-partial-articles "\\(text/\\|signature\\)") +#+end_src +Workaround for bug with ~gnus-cloud-method~ and ~custom-variable-recalc-variable~ upon reloading the =spacemacs-*= theme. +#+begin_src emacs-lisp +(setq server "nnimap:imsmail") #+end_src ** Adaptive scoring See [[info:gnus#Adaptive Scoring][info:gnus#Adaptive Scoring]] and this [[https://notes.whatthefuck.computer/1417593600.0-note.html][blog post]] by Ryan Rix. @@ -235,8 +239,8 @@ See [[info:gnus#Window Layout][info:gnus#Window Layout]]. #+end_src ** Format Summary buffer lines #+begin_src emacs-lisp -(setq gnus-summary-line-format "%U%R%z%I%(%[ %d : %-23,23f %]%) %s -") +;; (setq gnus-summary-line-format "%U%R%z%I%(%[ %d : %-23,23f %]%) %s +;; ") #+end_src ** nnreddit #+begin_src emacs-lisp -- cgit v1.2.3