2015-04-01 20:26:20 +00:00
|
|
|
|
;;; packages.el --- gnus Layer packages File for Spacemacs
|
|
|
|
|
;;
|
2018-01-04 07:00:25 +00:00
|
|
|
|
;; Copyright (c) 2012-2018 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.
|
|
|
|
|
;;
|
|
|
|
|
;;; License: GPLv3
|
|
|
|
|
|
2015-04-21 03:42:53 +00:00
|
|
|
|
(setq gnus-packages '(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
|
2015-11-18 00:38:05 +00:00
|
|
|
|
(spacemacs/set-leader-keys "ag" 'gnus)
|
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
|
|
|
|
(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
|
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(require 'browse-url)
|
|
|
|
|
(require 'nnrss)
|
|
|
|
|
(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
|
|
|
|
|
2015-11-21 10:07:14 +00:00
|
|
|
|
(evilified-state-evilify gnus-group-mode gnus-group-mode-map)
|
|
|
|
|
(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))))
|