2015-04-01 20:26:20 +00:00
|
|
|
|
;;; packages.el --- gnus Layer packages File for Spacemacs
|
|
|
|
|
;;
|
2021-03-22 20:11:29 +00:00
|
|
|
|
;; Copyright (c) 2012-2021 Sylvain Benner & Contributors
|
2015-04-01 20:26:20 +00:00
|
|
|
|
;;
|
|
|
|
|
;; Author: Sylvain Benner <sylvain.benner@gmail.com>
|
|
|
|
|
;; URL: https://github.com/syl20bnr/spacemacs
|
|
|
|
|
;;
|
|
|
|
|
;; This file is not part of GNU Emacs.
|
|
|
|
|
;;
|
2021-03-24 03:31:44 +00: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 <http://www.gnu.org/licenses/>.
|
|
|
|
|
|
2015-04-01 20:26:20 +00:00
|
|
|
|
|
2020-06-25 23:33:36 +00:00
|
|
|
|
(defconst gnus-packages
|
|
|
|
|
'(
|
|
|
|
|
gnus
|
|
|
|
|
window-purpose
|
|
|
|
|
persp-mode))
|
2015-04-01 20:26:20 +00:00
|
|
|
|
|
2019-10-01 20:40:42 +00:00
|
|
|
|
(defun gnus/pre-init-persp-mode ()
|
|
|
|
|
(spacemacs|use-package-add-hook persp-mode
|
|
|
|
|
:post-config
|
|
|
|
|
(progn
|
|
|
|
|
(spacemacs|define-custom-layout gnus-spacemacs-layout-name
|
|
|
|
|
:binding gnus-spacemacs-layout-binding
|
|
|
|
|
:body
|
|
|
|
|
(call-interactively 'gnus)))))
|
|
|
|
|
|
2015-04-01 20:26:20 +00:00
|
|
|
|
(defun gnus/init-gnus ()
|
|
|
|
|
"Initialize my package"
|
|
|
|
|
(use-package gnus
|
2018-03-04 04:37:53 +00:00
|
|
|
|
:defer t
|
2015-04-01 20:26:20 +00:00
|
|
|
|
:commands gnus
|
|
|
|
|
:init
|
2020-03-02 08:45:05 +00:00
|
|
|
|
(progn
|
2020-06-28 21:25:04 +00:00
|
|
|
|
(spacemacs/declare-prefix "aeg" "gnus" "Gnus newsreader")
|
2020-03-02 08:45:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys
|
2020-06-28 21:25:04 +00:00
|
|
|
|
"aegg" 'gnus
|
|
|
|
|
"aegs" 'gnus-slave
|
|
|
|
|
"aegu" 'gnus-unplugged
|
|
|
|
|
"aego" 'gnus-slave-unplugged)
|
2020-03-02 08:45:05 +00:00
|
|
|
|
(spacemacs/declare-prefix-for-mode 'message-mode "mi" "insert")
|
|
|
|
|
(spacemacs/set-leader-keys-for-major-mode 'message-mode
|
|
|
|
|
;; RFC 1855
|
|
|
|
|
"miF" 'flame-on)
|
|
|
|
|
;; NOTE: If any of the following variables are modified,
|
|
|
|
|
;; also update their values in: `gnus/README.org'
|
|
|
|
|
(setq-default
|
|
|
|
|
gnus-summary-line-format "%U%R%z %(%&user-date; %-15,15f %B (%c) %s%)\n"
|
|
|
|
|
gnus-user-date-format-alist '((t . "%Y-%m-%d %H:%M"))
|
|
|
|
|
gnus-group-line-format "%M%S%p%P%5y:%B %G\n";;"%B%(%g%)"
|
|
|
|
|
gnus-summary-thread-gathering-function 'gnus-gather-threads-by-references
|
|
|
|
|
gnus-thread-sort-functions '(gnus-thread-sort-by-most-recent-date)
|
|
|
|
|
gnus-ignored-newsgroups "^to\\.\\|^[0-9. ]+\\( \\|$\\)\\|^[\”]\”[#’()]"
|
|
|
|
|
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 "│"
|
|
|
|
|
gnus-article-browse-delete-temp t
|
|
|
|
|
gnus-treat-strip-trailing-blank-lines 'last
|
|
|
|
|
gnus-keep-backlog 'nil
|
|
|
|
|
gnus-summary-display-arrow nil ; Don't show that annoying arrow:
|
|
|
|
|
gnus-mime-display-multipart-related-as-mixed t ; Show more MIME-stuff:
|
|
|
|
|
gnus-auto-select-first nil ; Don't get the first article automatically:
|
|
|
|
|
smiley-style 'medium
|
|
|
|
|
gnus-keep-backlog '0))
|
2015-04-01 20:26:20 +00:00
|
|
|
|
:config
|
|
|
|
|
(progn
|
2015-11-21 10:07:14 +00:00
|
|
|
|
;; No primary server
|
|
|
|
|
(setq gnus-select-method '(nnnil ""))
|
2015-04-01 20:26:20 +00:00
|
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
|
;; Use topics per default
|
|
|
|
|
(add-hook 'gnus-group-mode-hook 'gnus-topic-mode)
|
2015-04-01 20:26:20 +00:00
|
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(setq gnus-visible-headers
|
|
|
|
|
"^From:\\|^Reply-To\\|^Organization:\\|^To:\\|^Cc:\\|^Newsgroups:\\|^Subject:\\|^Date:\\|^Gnus")
|
2015-04-01 20:26:20 +00:00
|
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
|
;; Show the article headers in this order.
|
|
|
|
|
(setq gnus-sorted-header-list
|
|
|
|
|
'("^From:" "^Reply-To" "^Organization:" "^To:" "^Cc:" "^Newsgroups:"
|
|
|
|
|
"^Subject:" "^Date:" "^Gnus"))
|
2015-04-01 20:26:20 +00:00
|
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(require 'browse-url)
|
|
|
|
|
(require 'nnrss)
|
2019-11-14 20:42:13 +00:00
|
|
|
|
(defun spacemacs/gnus-flame-on ()
|
|
|
|
|
"Most important email function, for RFC1855 compliance."
|
|
|
|
|
;; https://tools.ietf.org/html/rfc1855
|
|
|
|
|
(interactive)
|
|
|
|
|
(insert "FLAME ON:\n")
|
|
|
|
|
(insert "FLAME OFF\n")
|
|
|
|
|
(forward-line -2)
|
|
|
|
|
(end-of-line))
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(defun spacemacs/browse-nnrss-url (arg)
|
|
|
|
|
"Open RSS Article directy in the browser"
|
|
|
|
|
(interactive "p")
|
|
|
|
|
(let ((url (assq nnrss-url-field
|
|
|
|
|
(mail-header-extra
|
|
|
|
|
(gnus-data-header
|
|
|
|
|
(assq (gnus-summary-article-number)
|
|
|
|
|
gnus-newsgroup-data))))))
|
|
|
|
|
(if url
|
|
|
|
|
(progn
|
|
|
|
|
(browse-url (cdr url))
|
|
|
|
|
(gnus-summary-mark-as-read-forward 1))
|
|
|
|
|
(gnus-summary-scroll-up arg))))
|
|
|
|
|
(add-to-list 'nnmail-extra-headers nnrss-url-field)
|
2015-04-01 20:26:20 +00:00
|
|
|
|
|
2019-08-27 20:34:01 +00:00
|
|
|
|
(evilified-state-evilify gnus-group-mode gnus-group-mode-map
|
2019-09-01 19:32:59 +00:00
|
|
|
|
(kbd "g r") 'gnus-group-get-new-news
|
|
|
|
|
(kbd "O") 'gnus-group-group-map)
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(evilified-state-evilify gnus-server-mode gnus-server-mode-map)
|
|
|
|
|
(evilified-state-evilify gnus-browse-mode gnus-browse-mode-map)
|
|
|
|
|
(evilified-state-evilify gnus-article-mode gnus-article-mode-map)
|
2015-11-05 13:09:00 +00:00
|
|
|
|
(evilified-state-evilify gnus-summary-mode gnus-summary-mode-map
|
|
|
|
|
(kbd "J") 'gnus-summary-next-article
|
|
|
|
|
(kbd "K") 'gnus-summary-prev-article
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(kbd "<RET>") 'spacemacs/browse-nnrss-url))))
|
2018-01-08 07:53:13 +00:00
|
|
|
|
|
2020-06-25 23:33:36 +00:00
|
|
|
|
(defun gnus/post-init-window-purpose ()
|
|
|
|
|
(purpose-set-extension-configuration
|
|
|
|
|
:gnus-layer
|
|
|
|
|
(purpose-conf :mode-purposes '((gnus-group-mode . mail)
|
|
|
|
|
(gnus-server-mode . mail)
|
|
|
|
|
(gnus-browse-mode . mail)
|
|
|
|
|
(gnus-article-mode . mail)
|
|
|
|
|
(gnus-summary-mode . mail)))))
|