summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorjao <jao@gnu.org>2022-02-27 20:26:18 +0000
committerjao <jao@gnu.org>2022-02-27 20:26:18 +0000
commitef74b59a8642e73b7fa15bc4003b6a45dd8265d0 (patch)
tree42b150b1fd274d9cc7ee706e961aab0076aa98e6
parenta0c179f036e923007dda13f19a92c8c025e7badc (diff)
downloadelibs-ef74b59a8642e73b7fa15bc4003b6a45dd8265d0.tar.gz
elibs-ef74b59a8642e73b7fa15bc4003b6a45dd8265d0.tar.bz2
gnus is a cat
-rw-r--r--email.org39
-rw-r--r--gnus.org76
-rw-r--r--init.org4
3 files changed, 50 insertions, 69 deletions
diff --git a/email.org b/email.org
index 6aa1c11..4048b09 100644
--- a/email.org
+++ b/email.org
@@ -9,33 +9,20 @@
(defvar jao-notmuch-enabled (eq jao-afio-mail-function 'notmuch))
#+end_src
* gnus
-*** directories
- #+begin_src emacs-lisp
- (setq gnus-init-file "~/.emacs.d/gnus.el"
- gnus-home-directory "~/.emacs.d/gnus"
- gnus-directory gnus-home-directory
- gnus-cache-directory (expand-file-name "cache" gnus-home-directory)
- gnus-kill-files-directory (expand-file-name "News" gnus-home-directory)
- message-directory (expand-file-name "Mail" gnus-home-directory)
- mail-source-directory (expand-file-name "Mail" gnus-home-directory))
-
- (when (eq jao-afio-mail-function 'gnus)
- (let ((org-file (expand-file-name "gnus.org" jao-emacs-dir)))
- (when (file-newer-than-file-p org-file gnus-init-file)
- (org-babel-tangle-file org-file))))
+ #+begin_src emacs-lisp
+ (setq gnus-init-file "~/.emacs.d/gnus.el"
+ gnus-home-directory "~/.emacs.d/gnus"
+ gnus-directory gnus-home-directory
+ gnus-cache-directory (expand-file-name "cache" gnus-home-directory)
+ gnus-kill-files-directory (expand-file-name "News" gnus-home-directory)
+ message-directory (expand-file-name "Mail" gnus-home-directory)
+ mail-source-directory (expand-file-name "Mail" gnus-home-directory))
+
+ (let ((org-file (expand-file-name "gnus.org" jao-emacs-dir)))
+ (when (file-newer-than-file-p org-file gnus-init-file)
+ (org-babel-tangle-file org-file)))
- #+end_src
-*** notifications
- #+begin_src emacs-lisp
- (defun jao-gnus-notify ()
- (interactive)
- (when (fboundp 'jao-gnus--notify)
- (unless (derived-mode-p 'gnus-summary-mode
- 'gnus-article-mode
- 'gnus-group-mode)
- (let ((inhibit-message t))
- (gnus-demon-scan-news)))))
- #+end_src
+ #+end_src
* message mode
*** Customization
#+begin_src emacs-lisp
diff --git a/gnus.org b/gnus.org
index 3185891..faadeec 100644
--- a/gnus.org
+++ b/gnus.org
@@ -138,7 +138,7 @@
(remove-prefix ,prefix)
(config-file ,config))))
- (add-to-list 'gnus-parameters '("^nnselect:.*" (nnselect-rescan t)))
+ (add-to-list 'gnus-parameters '("^nnselect:.*" (nnselect-rescan . t)))
#+end_src
* News server
@@ -172,10 +172,11 @@
#+end_src
*** nnml
#+begin_src emacs-lisp
- (setq mail-sources (when jao-gnus-use-nnml
- '((file :path "/var/mail/jao")
- (maildir :path "~/tmp/mail/spam/")
- (maildir :path "~/tmp/mail/trash/")))
+ (setq mail-sources
+ (when jao-gnus-use-nnml
+ (cons '(file :path "/var/mail/jao")
+ (mapcar (lambda (d) `(maildir :path ,(concat d "/")))
+ (directory-files "~/var/mail" t "[^\\.]"))))
gnus-message-archive-group nil
nnml-get-new-mail t
nnml-directory message-directory)
@@ -185,16 +186,6 @@
'gnus-secondary-select-methods
`(nnml "" ,(jao-gnus--notmuch-engine nnml-directory "notmuch.config"))))
- (defun jao-gnus-nnml--add-maildirs (dir)
- (dolist (f (directory-files (concat "~/tmp/mail/" dir) t "[^\\.]"))
- (add-to-list 'mail-sources `(maildir :path ,(concat f "/")))))
-
- (when jao-gnus-use-nnml
- (dolist (dir '("jao" "bigml" "feeds"))
- (jao-gnus-nnml--add-maildirs dir)))
-
- (defvar jao-gnus-image-groups '("xkcd"))
-
(defvar jao-gnus-nnml-group-params
`(("nnml:\\(local\\|trash\\|spam\\)"
(auto-expire . t)
@@ -207,19 +198,17 @@
(jao-gnus--trash-group "nnml:trash")
(jao-gnus--spam-group "nnml:spam")
(jao-gnus--archiving-group "nnml:jao.trove"))
- ("nnml:\\(jao\\|bigml\\)\\.\\(trash\\|spam\\)"
+ ("nnml:bigml\\..*"
(gcc-self . nil)
(auto-expire . t)
(total-expire . t)
- (expiry-wait . 1)
- (jao-gnus--trash-group nil)
- (expiry-target . delete))
- ("nnml:bigml\\..*"
+ (expiry-wait . 3)
+ (expiry-target . delete)
(posting-style (address "jao@bigml.com"))
(jao-gnus--trash-group "nnml:trash")
(jao-gnus--spam-group "nnml:spam")
(jao-gnus--archiving-group "nnml:bigml.trove"))
- ("nnml:bigml\\.inbox"
+ ("nnml:bigml\\.\\(inbox\\|support\\)"
(gcc-self . t)
(auto-expire . t)
(total-expire . t)
@@ -230,15 +219,6 @@
(total-expire . t)
(expiry-target . delete)
(expiry-wait . 365))
- (,(format "^nnml:bigml\\.%s" (regexp-opt '("support" "reports"
- "deploys" "lists"
- "drivel" "bugs")))
- (jao-gnus--trash-group nil)
- (gcc-self . nil)
- (auto-expire . t)
- (total-expire . t)
- (expiry-wait . 3)
- (expiry-target . delete))
("nnml:jao\\.drivel"
(auto-expire . t)
(total-expire . t)
@@ -252,20 +232,32 @@
(comment . "feeds.\\1")
(jao-gnus--archiving-group "nnml:feeds.trove"))
("^nnml:feeds\\.\\(news\\)$" (expiry-wait . 2))
- ("^nnml:feeds\\.erlang" (gnus-list-identifiers "Erlang Forums"))
- ("nnml:feeds\\.trove"
+ ("nnml:feeds\\.\\(trove\\|lobsters\\)"
(auto-expire . nil)
(total-expire . nil))
- (,(format "nnml:feeds\\.fun\\|gwene\\..*%s.*"
- (regexp-opt jao-gnus-image-groups))
+ ("nnml:feeds\\.fun"
+ (mm-html-inhibit-images nil)
+ (mm-html-blocked-images nil))))
+
+ (when jao-gnus-use-nnml
+ (dolist (p jao-gnus-nnml-group-params)
+ (add-to-list 'gnus-parameters p t)))
+
+ #+end_src
+*** leafnode
+ #+begin_src emacs-lisp
+ (defvar jao-gnus-image-groups '("xkcd"))
+
+ (defvar jao-gnus-leafnode-group-params
+ `((,(format "gwene\\..*%s.*" (regexp-opt jao-gnus-image-groups))
(mm-html-inhibit-images nil)
(mm-html-blocked-images nil))
("\\(gmane\\|gwene\\)\\..*"
(jao-gnus--archiving-group "nnml:feeds.trove")
(posting-style (address "jao@gnu.org")))))
- (when jao-gnus-use-nnml
- (dolist (p jao-gnus-nnml-group-params)
+ (when jao-gnus-use-leafnode
+ (dolist (p jao-gnus-leafnode-group-params)
(add-to-list 'gnus-parameters p t)))
#+end_src
@@ -304,8 +296,8 @@
(setq mail-user-agent 'gnus-user-agent)
(require 'gnus-demon)
- (gnus-demon-add-handler 'jao-gnus-notify 5 1)
- ;; (gnus-demon-remove-handler 'jao-gnus-notify)
+ (gnus-demon-add-handler 'gnus-demon-scan-news 5 1)
+ ;; (gnus-demon-remove-handler 'gnus-demon-scan-news)
;; synchronicity
(setq gnus-asynchronous t)
@@ -356,8 +348,10 @@
jao-gnus-tracked-groups))))
(defun jao-gnus--notify ()
- (setq jao-gnus--notify-strs (jao-gnus--notify-strs))
- (save-window-excursion (jao-minibuffer-refresh)))
+ (let ((inhibit-message t))
+ (shell-command-to-string "index-mail.sh")
+ (setq jao-gnus--notify-strs (jao-gnus--notify-strs))
+ (save-window-excursion (jao-minibuffer-refresh))))
(add-hook 'gnus-after-getting-new-news-hook #'jao-gnus--notify)
(add-hook 'gnus-started-hook #'jao-gnus--notify)
@@ -416,7 +410,7 @@
#+begin_src emacs-lisp
;; (setq gnus-group-line-format " %m%S%p%P:%~(pad-right 35)c %3y %B\n")
;; (setq gnus-group-line-format " %m%S%p%3y%P%* %~(pad-right 30)C %B\n")
- (setq gnus-group-line-format " %m%S%p%3y%P%* %~(pad-right 30)c %B\n")
+ (setq gnus-group-line-format " %m%S%p%3y%P%* %~(pad-right 30)G %B\n")
(setq gnus-topic-line-format "%i[ %(%{%n%}%) -- %A ]%v\n")
(setq gnus-group-uncollapsed-levels 2)
(setq gnus-auto-select-subject 'unread)
diff --git a/init.org b/init.org
index a5a96f8..d092111 100644
--- a/init.org
+++ b/init.org
@@ -1665,7 +1665,7 @@
(let* ((url+title (if (consp url) url (list url)))
(url (car url+title))
(title (cdr url+title))
- (cats (jao-notmuch--feed-tags "feeds")))
+ (cats (jao-notmuch--subtags "feeds")))
(if url
(let ((url (if (string-match "^feed:" url) (substring url 5) url)))
(when (y-or-n-p (format "Subscribe to <%s>? " url))
@@ -1681,7 +1681,7 @@
* Email
#+begin_src emacs-lisp
(setq jao-afio-mail-function 'notmuch)
- ;; (setq jao-afio-mail-function 'gnus)
+ (setq jao-afio-mail-function 'gnus)
(jao-load-org "email")
#+end_src
* PDFs