home

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7d72b2801753291e8af9df4286f477f19289f922
parent a8add39a27f3463a53badeed69900d776b677149
Author: Vincent Demeester <vincent@sbr.pm>
Date:   Thu,  2 Apr 2020 18:53:06 +0200

gnus: use gnus-init-file to load lazily ๐Ÿ“ฅ

The `gnus-init-file' is only loaded when we run `gnus'. This speeds up
emacs startup time ๐Ÿ˜‰

Signed-off-by: Vincent Demeester <vincent@sbr.pm>

Diffstat:
Mdocs/emacs.org | 75+++++++++++++++++++++++++++++++++++++++------------------------------------
Mtools/emacs/config/setup-mails.el | 173+------------------------------------------------------------------------------
Atools/gnus/init.el | 172+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 212 insertions(+), 208 deletions(-)

diff --git a/docs/emacs.org b/docs/emacs.org @@ -554,7 +554,7 @@ First, let's define some basic constants, mainly on how my main =org= folder is organized. -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "4-14" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgConstants" :range-end "-OrgConstants" :lines "4-15" In a nutshell, I am currently trying the following organization, with =~/desktop/org/= as the base of almost all =org-mode= things: @@ -585,7 +585,7 @@ =inbox.org=. For this, we can use the emacs [[https://www.gnu.org/software/emacs/manual/html_node/emacs/Registers.html][registers]] and more accurately the [[https://www.gnu.org/software/emacs/manual/html_node/emacs/File-Registers.html#File-Registers][file registers]]. -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "17-22" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgRegisters" :range-end "-OrgRegisters" :lines "18-23" With this, I can jump to the inbox with ~C-x r j i~, to the journal using ~C-x r j j~, โ€ฆ @@ -678,7 +678,7 @@ /The =ensure org-plus-contrib= is there to make sure I am loading the =org= module from my nix configuration and not the built-in =org= module (that might lag in terms of version)/ -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "25-92" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgMain" :range-end "-OrgMain" :lines "26-98" I've set-up an =org-mode= hook to add few modes to the default setup. - I am really annoyed by trailing white-space so I want them to be shown @@ -687,15 +687,15 @@ + I turn on =auto-revert-mode= so that the buffer is always up-to-date. + I like to have header indented, so I'm enabling =org-indent-mode=. -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "95-104" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHook" :range-end "-OrgHook" :lines "101-110" Let's also use =org-id=โ€ฆ -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "107-136" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgId" :range-end "-OrgId" :lines "113-142" โ€ฆ and =org-crypt= (for encrypted =org-mode= files). -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "139-144" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCrypt" :range-end "-OrgCrypt" :lines "145-150" **** TODO Refiling :PROPERTIES: @@ -730,11 +730,11 @@ agenda views. This allows to group things and overall set-up the agenda view I want. This agenda view uses the =n= key. -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "147-196" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAgenda" :range-end "-OrgAgenda" :lines "153-203" Let's try to get my work calendar entries in my agenda too. It is a little bit tricky ๐Ÿ‘ผ. -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "199-213" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgGcal" :range-end "-OrgGcal" :lines "206-220" *** Habits :ATTACH: :PROPERTIES: @@ -766,14 +766,14 @@ [[./images/2020-02-29-14-41-59.png]] -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "216-221" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgHabit" :range-end "-OrgHabit" :lines "223-228" *** TODO Sources :PROPERTIES: :CUSTOM_ID: h:82c3b800-9d80-408d-b3b6-54dc15b0590c :END: -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "224-231" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgSrc" :range-end "-OrgSrc" :lines "231-238" *** TODO Capture :PROPERTIES: @@ -790,7 +790,7 @@ options. This is very interesting when you want to group some capture template together (like templates related to /work/, โ€ฆ). -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "234-238" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureStart" :range-end "-OrgCaptureStart" :lines "241-245" Some of my capture template are big and hard to read if embedded in the =emacs-lisp= code. The good thing is that =org-mode= is able to load the template from files too ๐Ÿ’ƒ. @@ -798,44 +798,44 @@ Here is a list of my templates: - Default :: Store a link (mainly used with =org-protocol=) and take a random note - #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "241-250" + #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureOldTemplate" :range-end "-OrgCaptureOldTemplate" :lines "248-257" - Tasks :: /work/ task, like reviewing a PR, or cleaning a folder. - #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "253-265" + #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureTask" :range-end "-OrgCaptureTask" :lines "260-272" - journaling :: As I use =org-mode= for my /journal/ too, I need capture entry for it. I currently have two types of journal entry : - #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "268-270" + #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalBase" :range-end "-OrgCaptureJournalBase" :lines "275-277" + standard: one title and some text #+INCLUDE: "../tools/emacs/etc/orgmode/journal.org" src org - #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "273-280" + #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureJournalEntry" :range-end "-OrgCaptureJournalEntry" :lines "280-287" + worklog: related to work, to be able to say what I did, what I wanted to do, problems, โ€ฆ during the daily #+INCLUDE: "../tools/emacs/etc/orgmode/worklog.org" src org - #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "283-288" + #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWorklog" :range-end "-OrgCaptureWorklog" :lines "290-295" - weekly review :: each and every week, I am going through this item to make my review of the week. #+INCLUDE: "../tools/emacs/etc/orgmode/weekly.org" src org - #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "291-296" + #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureWeekly" :range-end "-OrgCaptureWeekly" :lines "298-303" - blog posts :: - #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "299-309" + #+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureBlog" :range-end "-OrgCaptureBlog" :lines "313-315" -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "312-313" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgCaptureEnd" :range-end "-OrgCaptureEnd" :lines "318-319" -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "316-318" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgProtocol" :range-end "-OrgProtocol" :lines "322-324" *** Clocking :PROPERTIES: @@ -855,32 +855,32 @@ In addition to that workflow, I want to switch the state of the task to =STARTED= when I am clocking-in, if it's not already =STARTED=. -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "321-414" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgClock" :range-end "-OrgClock" :lines "327-420" *** TODO Links :PROPERTIES: :CUSTOM_ID: h:afc81fbb-f7a0-401c-8b56-19f51edebd88 :END: -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "417-420" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgAttach" :range-end "-OrgAttach" :lines "423-428" -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "423-448" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgLinks" :range-end "-OrgLinks" :lines "431-467" *** TODO Litterate programming :PROPERTIES: :CUSTOM_ID: h:b5f6beba-6195-4ff0-a194-502ac2a9e3da :END: -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "451-459" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgBabel" :range-end "-OrgBabel" :lines "470-529" *** TODO Exporting :PROPERTIES: :CUSTOM_ID: h:afad00e0-367c-4c7b-b191-e3ed72be754b :END: -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportConstants" :range-end "-OrgExportConstants" :lines "462-464" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportConstants" :range-end "-OrgExportConstants" :lines "532-534" -#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "467-478" +#+INCLUDE: "../tools/emacs/config/setup-org.el" src emacs-lisp :range-begin "OrgExportCfg" :range-end "-OrgExportCfg" :lines "537-548" ** TODO Email and newsgroup :PROPERTIES: @@ -949,6 +949,9 @@ for the Summary buffer is the use of the caret sign (=^=) to show you the previous message that the current item is a reply to. +/Note: this is in a =gnus/init.el= file that is loaded when the =gnus= command is +ran. This means it is only loaded whenever I need to use =gnus= and not before/ + **** Account settings :PROPERTIES: :CUSTOM_ID: h:be7bbb5b-4b13-49f0-8044-b79363ccba7f @@ -969,11 +972,11 @@ - [[http://www.cataclysmicmutation.com/2010/11/multiple-gmail-accounts-in-gnus/][Multiple GMail Accounts in Gnus - Cataclysmic Mutation]] - [[https://github.com/redguardtoo/mastering-emacs-in-one-year-guide/blob/master/gnus-guide-en.org][mastering-emacs-in-one-year-guide/gnus-guide-en.org at master ยท redguardtoo/mastering-emacs-in-one-year-guide]] -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusCfg" :range-end "-GnusCfg" :lines "20-77" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusCfg" :range-end "-GnusCfg" :lines "3-60" Let's also give to gnus my GnuPG key. -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusMmlSec" :range-end "-GnusMmlSec" :lines "80-84" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusMmlSec" :range-end "-GnusMmlSec" :lines "63-67" **** Gnus agent @@ -990,7 +993,7 @@ local messages. For example, we can set an expiry date, after which the message is deleted, or we can create a queue of outgoing messages when Gnus is in an unplugged state. -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusAgent" :range-end "-GnusAgent" :lines "87-101" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusAgent" :range-end "-GnusAgent" :lines "70-84" **** Gnus asynchronous operations :PROPERTIES: @@ -1001,7 +1004,7 @@ is blocked until Gnus has finished. By enabling this library, we can use certain functions in a non-blocking way. I do this for [[#h:8cd8c972-ba38-40c2-b30f-68a4233593d6][sending email]]. -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusAsync" :range-end "-GnusAsync" :lines "104-109" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusAsync" :range-end "-GnusAsync" :lines "87-92" **** Gnus group :PROPERTIES: @@ -1027,7 +1030,7 @@ Note that =gnus-group-sort-functions= requires the most important function to be declared last. -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusGroup" :range-end "-GnusGroup" :lines "112-128" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusGroup" :range-end "-GnusGroup" :lines "95-111" **** Gnus Summary :PROPERTIES: @@ -1046,7 +1049,7 @@ was within the day or the one before, else falls back to a default value. It is then called with =%&user-date;=. -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusSummary" :range-end "-GnusSummary" :lines "140-183" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusSummary" :range-end "-GnusSummary" :lines "123-166" Gnus summary displays a mark for each messages, those `O`, `!`, โ€ฆ Let's first describe what are those marks (from the [[https://www.gnu.org/software/emacs/manual/html_node/gnus/Marking-Articles.html#Marking-Articles][documentation]]) and which one make the more sense for me. @@ -1090,7 +1093,7 @@ "gnus" to see all the relevant key bindings and the functions they call. I only ever use =C-c C-m C-a= (=C-m= is the same as =RET=). -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "GnusDired" :range-end "-GnusDired" :lines "186-189" +#+INCLUDE: "../tools/gnus/init.el" src emacs-lisp :range-begin "GnusDired" :range-end "-GnusDired" :lines "169-172" **** TODO Searching mails :PROPERTIES: @@ -1107,16 +1110,16 @@ :CUSTOM_ID: h:8cd8c972-ba38-40c2-b30f-68a4233593d6 :END: -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "SendmailCfg" :range-end "-SendmailCfg" :lines "193-207" +#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "SendmailCfg" :range-end "-SendmailCfg" :lines "22-36" -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "MessageCfg" :range-end "-MessageCfg" :lines "210-221" +#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "MessageCfg" :range-end "-MessageCfg" :lines "39-50" *** TODO ~notmuch~ configuration :PROPERTIES: :CUSTOM_ID: h:b67b377e-0fbc-4237-857c-641cdf2de1cf :END: -#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "Notmuch" :range-end "-Notmuch" :lines "224-241" +#+INCLUDE: "../tools/emacs/config/setup-mails.el" src emacs-lisp :range-begin "Notmuch" :range-end "-Notmuch" :lines "53-70" * User interface and interactions :PROPERTIES: diff --git a/tools/emacs/config/setup-mails.el b/tools/emacs/config/setup-mails.el @@ -16,178 +16,7 @@ (epa-file-enable)) ;; -EPA -;; GnusCfg -(use-package gnus - :config - (setq nnml-directory "~/desktop/gnus/mail") - (setq nnfolder-directory "~/desktop/gnus/archive") - (setq nndraft-directory "~/desktop/gnus/drafts") - (setq nnmh-directory "~/desktop/gnus/drafts") - (setq gnus-article-save-directory "~/desktop/gnus/news") - (setq gnus-home-directory "~/desktop/gnus") - (setq gnus-kill-files-directory "~/desktop/gnus/news") - (setq gnus-cache-directory "~/desktop/gnus/news/cache") - (setq gnus-startup-file "~/desktop/gnus/newsrc") - (setq mail-source-directory "~/desktop/gnus/mail") - (setq gnus-registry-cache-file "~/desktop/gnus/gnus.registry.eld") - (setq gnus-select-method '(nnnil)) - (setq nntp-authinfo-file "~/.authinfo.gpg") - (setq gnus-secondary-select-methods - '((nntp "news.gwene.org") - (nnimap "prv" - (nnimap-address "mail.gandi.net") - (nnimap-stream ssl) - (nnimap-authinfo-file "~/.authinfo.gpg")) - (nnimap "redhat" - (nnimap-address "imap.gmail.com") - (nnimap-stream ssl) - (nnimap-authinfo-file "~/.authinfo.gpg")) - (nnimap "vde" - (nnimap-address "imap.gmail.com") - (nnimap-stream ssl) - (nnimap-authinfo-file "~/.authinfo.gpg")) - )) - (setq gnus-parameters - '(("prv" - (posting-style - (address "vincent@demeester.fr") - (signature-file "~/desktop/documents/.prv.signature") - (gcc "nnimap+prv:Sent"))) - ("redhat" - (posting-style - (address "vdemeest@redhat.com") - (signature-file "~/desktop/documents/.redhat.signature"))) - ("nnimap+redhat:INBOX" - (display . all)) - ("vde" - (posting-style - (address "vinc.demeester.fr") - (signature-file "~/desktop/documents/.vde.signature"))) - ("nnimap+vde:INBOX" - (display . all)))) - (setq gnus-agent t) - (setq mail-user-agent 'gnus-user-agent) ; also works with `sendmail-user-agent' - (setq gnus-check-new-newsgroups 'ask-server) - (setq gnus-read-active-file 'some) - (setq gnus-use-dribble-file t) - (setq gnus-always-read-dribble-file t) - (setq gnus-novice-user nil) - (setq gnus-extra-headers - '(To Newsgroups X-GM-LABELS))) -;; -GnusCfg - -;; GnusMmlSec -(use-package mml-sec - :config - (setq mml-secure-openpgp-signers - '("8C4E8DDA04C18C6B503BD2DBB7E7CF1C634256FA"))) -;; -GnusMmlSec - -;; GnusAgent -(use-package gnus-agent - :after gnus - :config - (setq gnus-agent-article-alist-save-format 1) ; uncompressed - (setq gnus-agent-cache t) - (setq gnus-agent-confirmation-function 'y-or-n-p) - (setq gnus-agent-consider-all-articles nil) - (setq gnus-agent-directory "~/desktop/gnus/agent/") - (setq gnus-agent-enable-expiration 'ENABLE) - (setq gnus-agent-expire-all nil) - (setq gnus-agent-expire-days 30) - (setq gnus-agent-mark-unread-after-downloaded t) - (setq gnus-agent-queue-mail t) ; queue if unplugged - (setq gnus-agent-synchronize-flags nil)) -;; -GnusAgent - -;; GnusAsync -(use-package gnus-async - :after gnus - :config - (setq gnus-asynchronous t) - (setq gnus-use-article-prefetch 30)) -;; -GnusAsync - -;; GnusGroup -(use-package gnus-group - :after gnus - :config - (setq gnus-level-subscribed 6) - (setq gnus-level-unsubscribed 7) - (setq gnus-level-zombie 8) - (setq gnus-group-sort-function - '((gnus-group-sort-by-unread) - (gnus-group-sort-by-alphabet) - (gnus-group-sort-by-rank))) - (setq gnus-group-mode-line-format "Gnus: %%b") - :hook - (gnus-select-group-hook . gnus-group-set-timestamp) - :bind (:map gnus-agent-group-mode-map - ("M-n" . gnus-topic-goto-next-topic) - ("M-p" . gnus-topic-goto-previous-topic))) -;; -GnusGroup - -;; GnusTopic -(use-package gnus-topic - :after (gnus gnus-group) - :config - (setq gnus-topic-display-empty-topics t) - :hook - (gnus-group-mode . gnus-topic-mode)) -;; -GnusTopic - -;; GnusSummary -(use-package gnus-sum - :after (gnus gnus-group) - :demand - :config - (setq gnus-auto-select-first nil) - (setq gnus-summary-ignore-duplicates t) - (setq gnus-suppress-duplicates t) - (setq gnus-summary-goto-unread nil) - (setq gnus-summary-make-false-root 'adopt) - (setq gnus-summary-thread-gathering-function 'gnus-gather-threads-by-subject) - (setq gnus-thread-sort-functions - '((not gnus-thread-sort-by-number) - (not gnus-thread-sort-by-date))) - (setq gnus-subthread-sort-functions - 'gnus-thread-sort-by-date) - (setq gnus-thread-hide-subtree nil) - (setq gnus-thread-ignore-subject t) - (setq gnus-user-date-format-alist - '(((gnus-seconds-today) . "Today at %R") - ((+ 86400 (gnus-seconds-today)) . "Yesterday, %R") - (t . "%Y-%m-%d %R"))) - (setq gnus-summary-line-format "%U%R%z %-16,16&user-date; %4L:%-30,30f %B%S\n") - (setq gnus-summary-mode-line-format "Gnus: %p (%U)") - (setq gnus-sum-thread-tree-false-root "") - (setq gnus-sum-thread-tree-indent " ") - (setq gnus-sum-thread-tree-leaf-with-other "โ”œโ”€โžค ") - (setq gnus-sum-thread-tree-root "") - (setq gnus-sum-thread-tree-single-leaf "โ””โ”€โžค ") - (setq gnus-sum-thread-tree-vertical "โ”‚") - :hook - (gnus-summary-exit-hook . gnus-topic-sort-groups-by-alphabet) - (gnus-summary-exit-hook . gnus-group-sort-groups-by-rank) - :bind (:map gnus-agent-summary-mode-map - ("<delete>" . gnus-summary-delete-article) - ("n" . gnus-summary-next-article) - ("p" . gnus-summary-prev-article) - ("N" . gnus-summary-next-unread-article) - ("P" . gnus-summary-prev-unread-article) - ("M-n" . gnus-summary-next-thread) - ("M-p" . gnus-summary-prev-thread) - ("C-M-n" . gnus-summary-next-group) - ("C-M-p" . gnus-summary-prev-group) - ("C-M-^" . gnus-summary-refer-thread))) -;; -GnusSummary - -;; GnusDired -(use-package gnus-dired - :after (gnus dired) - :hook (dired-mode . gnus-dired-mode)) -;; -GnusDired - +(setq gnus-init-file (expand-file-name "~/.config/gnus/init.el")) ;; SendmailCfg (use-package smtpmail diff --git a/tools/gnus/init.el b/tools/gnus/init.el @@ -0,0 +1,172 @@ + +;; GnusCfg +(use-package gnus + :config + (setq nnml-directory "~/desktop/gnus/mail") + (setq nnfolder-directory "~/desktop/gnus/archive") + (setq nndraft-directory "~/desktop/gnus/drafts") + (setq nnmh-directory "~/desktop/gnus/drafts") + (setq gnus-article-save-directory "~/desktop/gnus/news") + (setq gnus-home-directory "~/desktop/gnus") + (setq gnus-kill-files-directory "~/desktop/gnus/news") + (setq gnus-cache-directory "~/desktop/gnus/news/cache") + (setq gnus-startup-file "~/desktop/gnus/newsrc") + (setq mail-source-directory "~/desktop/gnus/mail") + (setq gnus-registry-cache-file "~/desktop/gnus/gnus.registry.eld") + (setq gnus-select-method '(nnnil)) + (setq nntp-authinfo-file "~/.authinfo.gpg") + (setq gnus-secondary-select-methods + '((nntp "news.gwene.org") + (nnimap "prv" + (nnimap-address "mail.gandi.net") + (nnimap-stream ssl) + (nnimap-authinfo-file "~/.authinfo.gpg")) + (nnimap "redhat" + (nnimap-address "imap.gmail.com") + (nnimap-stream ssl) + (nnimap-authinfo-file "~/.authinfo.gpg")) + (nnimap "vde" + (nnimap-address "imap.gmail.com") + (nnimap-stream ssl) + (nnimap-authinfo-file "~/.authinfo.gpg")) + )) + (setq gnus-parameters + '(("prv" + (posting-style + (address "vincent@demeester.fr") + (signature-file "~/desktop/documents/.prv.signature") + (gcc "nnimap+prv:Sent"))) + ("redhat" + (posting-style + (address "vdemeest@redhat.com") + (signature-file "~/desktop/documents/.redhat.signature"))) + ("nnimap+redhat:INBOX" + (display . all)) + ("vde" + (posting-style + (address "vinc.demeester.fr") + (signature-file "~/desktop/documents/.vde.signature"))) + ("nnimap+vde:INBOX" + (display . all)))) + (setq gnus-agent t) + (setq mail-user-agent 'gnus-user-agent) ; also works with `sendmail-user-agent' + (setq gnus-check-new-newsgroups 'ask-server) + (setq gnus-read-active-file 'some) + (setq gnus-use-dribble-file t) + (setq gnus-always-read-dribble-file t) + (setq gnus-novice-user nil) + (setq gnus-extra-headers + '(To Newsgroups X-GM-LABELS))) +;; -GnusCfg + +;; GnusMmlSec +(use-package mml-sec + :config + (setq mml-secure-openpgp-signers + '("8C4E8DDA04C18C6B503BD2DBB7E7CF1C634256FA"))) +;; -GnusMmlSec + +;; GnusAgent +(use-package gnus-agent + :after gnus + :config + (setq gnus-agent-article-alist-save-format 1) ; uncompressed + (setq gnus-agent-cache t) + (setq gnus-agent-confirmation-function 'y-or-n-p) + (setq gnus-agent-consider-all-articles nil) + (setq gnus-agent-directory "~/desktop/gnus/agent/") + (setq gnus-agent-enable-expiration 'ENABLE) + (setq gnus-agent-expire-all nil) + (setq gnus-agent-expire-days 30) + (setq gnus-agent-mark-unread-after-downloaded t) + (setq gnus-agent-queue-mail t) ; queue if unplugged + (setq gnus-agent-synchronize-flags nil)) +;; -GnusAgent + +;; GnusAsync +(use-package gnus-async + :after gnus + :config + (setq gnus-asynchronous t) + (setq gnus-use-article-prefetch 30)) +;; -GnusAsync + +;; GnusGroup +(use-package gnus-group + :after gnus + :config + (setq gnus-level-subscribed 6) + (setq gnus-level-unsubscribed 7) + (setq gnus-level-zombie 8) + (setq gnus-group-sort-function + '((gnus-group-sort-by-unread) + (gnus-group-sort-by-alphabet) + (gnus-group-sort-by-rank))) + (setq gnus-group-mode-line-format "Gnus: %%b") + :hook + (gnus-select-group-hook . gnus-group-set-timestamp) + :bind (:map gnus-agent-group-mode-map + ("M-n" . gnus-topic-goto-next-topic) + ("M-p" . gnus-topic-goto-previous-topic))) +;; -GnusGroup + +;; GnusTopic +(use-package gnus-topic + :after (gnus gnus-group) + :config + (setq gnus-topic-display-empty-topics t) + :hook + (gnus-group-mode . gnus-topic-mode)) +;; -GnusTopic + +;; GnusSummary +(use-package gnus-sum + :after (gnus gnus-group) + :demand + :config + (setq gnus-auto-select-first nil) + (setq gnus-summary-ignore-duplicates t) + (setq gnus-suppress-duplicates t) + (setq gnus-summary-goto-unread nil) + (setq gnus-summary-make-false-root 'adopt) + (setq gnus-summary-thread-gathering-function 'gnus-gather-threads-by-subject) + (setq gnus-thread-sort-functions + '((not gnus-thread-sort-by-number) + (not gnus-thread-sort-by-date))) + (setq gnus-subthread-sort-functions + 'gnus-thread-sort-by-date) + (setq gnus-thread-hide-subtree nil) + (setq gnus-thread-ignore-subject t) + (setq gnus-user-date-format-alist + '(((gnus-seconds-today) . "Today at %R") + ((+ 86400 (gnus-seconds-today)) . "Yesterday, %R") + (t . "%Y-%m-%d %R"))) + (setq gnus-summary-line-format "%U%R%z %-16,16&user-date; %4L:%-30,30f %B%S\n") + (setq gnus-summary-mode-line-format "Gnus: %p (%U)") + (setq gnus-sum-thread-tree-false-root "") + (setq gnus-sum-thread-tree-indent " ") + (setq gnus-sum-thread-tree-leaf-with-other "โ”œโ”€โžค ") + (setq gnus-sum-thread-tree-root "") + (setq gnus-sum-thread-tree-single-leaf "โ””โ”€โžค ") + (setq gnus-sum-thread-tree-vertical "โ”‚") + :hook + (gnus-summary-exit-hook . gnus-topic-sort-groups-by-alphabet) + (gnus-summary-exit-hook . gnus-group-sort-groups-by-rank) + :bind (:map gnus-agent-summary-mode-map + ("<delete>" . gnus-summary-delete-article) + ("n" . gnus-summary-next-article) + ("p" . gnus-summary-prev-article) + ("N" . gnus-summary-next-unread-article) + ("P" . gnus-summary-prev-unread-article) + ("M-n" . gnus-summary-next-thread) + ("M-p" . gnus-summary-prev-thread) + ("C-M-n" . gnus-summary-next-group) + ("C-M-p" . gnus-summary-prev-group) + ("C-M-^" . gnus-summary-refer-thread))) +;; -GnusSummary + +;; GnusDired +(use-package gnus-dired + :after (gnus dired) + :hook (dired-mode . gnus-dired-mode)) +;; -GnusDired