2019-02-26 11:31:20 +01:00
|
|
|
;;; oni-gnus.el --- Gnus configuration -*- lexical-binding: t; -*-
|
|
|
|
|
|
|
|
;; Copyright (C) 2019 Tom Willemse
|
|
|
|
|
|
|
|
;; Author: Tom Willemse <tom@ryuslash.org>
|
|
|
|
;; Keywords: local
|
2020-04-23 19:30:33 +02:00
|
|
|
;; Version: 2020.0423.103027
|
2019-02-28 08:43:16 +01:00
|
|
|
;; Package-Requires: (oni-data-dir)
|
2019-02-26 11:31:20 +01:00
|
|
|
|
|
|
|
;; This program is free software; you can redistribute it and/or modify
|
|
|
|
;; it under the terms of the GNU General Public License as published by
|
|
|
|
;; the Free Software Foundation, either version 3 of the License, or
|
|
|
|
;; (at your option) any later version.
|
|
|
|
|
|
|
|
;; This program is distributed in the hope that it will be useful,
|
|
|
|
;; but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
;; GNU General Public License for more details.
|
|
|
|
|
|
|
|
;; You should have received a copy of the GNU General Public License
|
|
|
|
;; along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
|
|
|
|
|
|
;;; Commentary:
|
|
|
|
|
|
|
|
;; Gnus configuration
|
|
|
|
|
|
|
|
;;; Code:
|
|
|
|
|
|
|
|
(require 'gnus)
|
|
|
|
(require 'gnus-msg)
|
|
|
|
(require 'mail-source)
|
|
|
|
(require 'message)
|
|
|
|
(require 'nnfolder)
|
2019-02-28 08:43:16 +01:00
|
|
|
(require 'oni-data-dir)
|
2019-02-26 11:31:20 +01:00
|
|
|
(require 'sendmail)
|
|
|
|
|
2019-02-28 08:43:16 +01:00
|
|
|
(setq gnus-directory (oni-data-dir-locate "News")
|
2019-02-26 11:31:20 +01:00
|
|
|
gnus-article-save-directory gnus-directory
|
|
|
|
gnus-cache-directory gnus-directory
|
|
|
|
gnus-kill-files-directory gnus-directory)
|
|
|
|
|
2019-02-28 08:43:16 +01:00
|
|
|
(setq mail-source-directory (oni-data-dir-locate "Mail")
|
2019-02-26 11:31:20 +01:00
|
|
|
message-directory mail-source-directory
|
|
|
|
nnfolder-directory mail-source-directory)
|
|
|
|
|
|
|
|
(setq send-mail-function 'send-mail-send-it
|
|
|
|
message-send-mail-function 'message-send-mail-with-sendmail
|
|
|
|
sendmail-program "/usr/bin/msmtp")
|
|
|
|
|
|
|
|
(setq gnus-novice-user nil)
|
|
|
|
|
|
|
|
(defun oni-gnus-delete-forward (&optional n)
|
|
|
|
"Delete the article under point and move to the next one.
|
|
|
|
Do this N times."
|
|
|
|
(interactive "p")
|
|
|
|
(dotimes (_ (or n 1))
|
|
|
|
(gnus-summary-delete-article)
|
|
|
|
(gnus-summary-next-subject 1)))
|
|
|
|
|
|
|
|
(define-key gnus-summary-mode-map (kbd "M-d") #'oni-gnus-delete-forward)
|
|
|
|
|
|
|
|
(setq gnus-group-line-format "%P%(%20G%): %-10s %S%p%B %5y %5T\n")
|
2020-04-15 10:24:33 +02:00
|
|
|
(setq gnus-summary-line-format "%U%R%z %&user-date;%20= %I%(%[%4L: %-23,23f%]%) %s\n")
|
2019-02-26 11:31:20 +01:00
|
|
|
|
2020-04-23 19:30:33 +02:00
|
|
|
(setq gnus-treat-from-gravatar t)
|
|
|
|
|
2019-02-26 11:31:20 +01:00
|
|
|
(setq gnus-select-method
|
|
|
|
'(nnmaildir "ryuslash" (directory "~/documents/mail/ryuslash/")))
|
|
|
|
|
|
|
|
(add-to-list 'gnus-posting-styles
|
|
|
|
'(".*"
|
|
|
|
(address "tom@ryuslash.org")
|
|
|
|
(eval (setq message-sendmail-extra-arguments
|
|
|
|
'("-a" "ryuslash")))))
|
|
|
|
|
|
|
|
(add-to-list 'gnus-secondary-select-methods
|
|
|
|
'(nnmaildir "gmail"
|
|
|
|
(directory "~/documents/mail/gmail/")))
|
|
|
|
|
|
|
|
(add-to-list 'gnus-posting-styles
|
|
|
|
'("gmail:"
|
|
|
|
(name "Tom Willemse")
|
|
|
|
(address "ryuslash@gmail.com")
|
|
|
|
(eval (setq message-sendmail-extra-arguments
|
|
|
|
'("-a" "gmail")))))
|
|
|
|
|
|
|
|
;;;###autoload(with-eval-after-load 'gnus (require 'oni-gnus))
|
|
|
|
|
|
|
|
(provide 'oni-gnus)
|
|
|
|
;;; oni-gnus.el ends here
|