2016-01-06 05:21:55 +00:00
|
|
|
|
#+TITLE: Gnus layer
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
2019-05-02 21:49:30 +00:00
|
|
|
|
#+TAGS: e-mail|layer
|
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
|
[[file:img/gnus.gif]]
|
|
|
|
|
|
2019-05-07 20:05:06 +00:00
|
|
|
|
* Table of Contents :TOC_5_gh:noexport:
|
2018-01-09 21:38:12 +00:00
|
|
|
|
- [[#description][Description]]
|
|
|
|
|
- [[#features][Features:]]
|
2017-05-22 14:16:12 +00:00
|
|
|
|
- [[#install][Install]]
|
|
|
|
|
- [[#basic-concepts][Basic Concepts]]
|
|
|
|
|
- [[#adding-news-sources][Adding news sources]]
|
|
|
|
|
- [[#configuring-gmail][Configuring gmail]]
|
|
|
|
|
- [[#org-mime-in-org-layer][Org MIME in Org layer]]
|
2020-03-01 22:02:37 +00:00
|
|
|
|
- [[#setup-variables][Setup variables]]
|
2018-10-23 14:18:21 +00:00
|
|
|
|
- [[#key-bindings][Key bindings]]
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
2018-01-09 21:38:12 +00:00
|
|
|
|
* Description
|
|
|
|
|
This layer integrates a general purpose email/newsgroup client into Spacemacs.
|
|
|
|
|
|
|
|
|
|
** Features:
|
2019-06-01 17:13:30 +00:00
|
|
|
|
- Support for reading RSS feeds, newsgroups and mails directly within Emacs via [[http://www.gnus.org/][Gnus]].
|
2018-01-09 21:38:12 +00:00
|
|
|
|
- Support for beautiful HTML mails generated from any =org= buffer.
|
2019-06-01 17:13:30 +00:00
|
|
|
|
- Support for credential management via [[https://gnupg.org/][GnuPG]].
|
2018-01-09 21:38:12 +00:00
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
|
* Install
|
2016-01-06 05:21:55 +00:00
|
|
|
|
To use this configuration layer, add it to your =~/.spacemacs=. You will need to
|
|
|
|
|
add =gnus= to the existing =dotspacemacs-configuration-layers= list in this
|
|
|
|
|
file.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
|
|
* Basic Concepts
|
|
|
|
|
Gnus is a news reading application. The Gnus terminology can be confusing for
|
|
|
|
|
new users so the basics are listed here:
|
2018-09-19 03:54:47 +00:00
|
|
|
|
- A Newsgroup but can also be a RSS Feed or a mail directory
|
|
|
|
|
- Newsgroups can be assigned to topics which will be used to structure
|
|
|
|
|
the Group Buffer if Topic Mode is enabled(default).
|
2016-04-13 03:31:38 +00:00
|
|
|
|
|
2015-06-10 16:44:30 +00:00
|
|
|
|
* Adding news sources
|
2015-06-10 21:16:01 +00:00
|
|
|
|
Adding news sources can be done in your =.spacemacs= file by adding the
|
2015-06-10 16:44:30 +00:00
|
|
|
|
following:
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
;; Get email, and store in nnml
|
|
|
|
|
(setq gnus-secondary-select-methods
|
|
|
|
|
'(
|
|
|
|
|
(nntp "gmane"
|
|
|
|
|
(nntp-address "news.gmane.org"))
|
|
|
|
|
(nntp "news.eternal-september.org")
|
|
|
|
|
(nntp "nntp.aioe.org")
|
|
|
|
|
(nntp "news.gwene.org")
|
|
|
|
|
))
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2018-10-23 14:18:21 +00:00
|
|
|
|
For adding RSS Feeds please see the [[#key-bindings][key bindings section]].
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
|
|
* Configuring gmail
|
|
|
|
|
To configure Gnus with gmail support you can add the following to your
|
2016-04-13 03:31:38 +00:00
|
|
|
|
=.spacemacs= file.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
2018-09-19 03:54:47 +00:00
|
|
|
|
;; Get email, and store in nnml
|
|
|
|
|
(setq gnus-secondary-select-methods
|
|
|
|
|
'(
|
|
|
|
|
(nnimap "gmail"
|
|
|
|
|
(nnimap-address
|
|
|
|
|
"imap.gmail.com")
|
|
|
|
|
(nnimap-server-port 993)
|
|
|
|
|
(nnimap-stream ssl))
|
|
|
|
|
))
|
|
|
|
|
|
|
|
|
|
;; Send email via Gmail:
|
|
|
|
|
(setq message-send-mail-function 'smtpmail-send-it
|
|
|
|
|
smtpmail-default-smtp-server "smtp.gmail.com")
|
|
|
|
|
|
|
|
|
|
;; Archive outgoing email in Sent folder on imap.gmail.com:
|
|
|
|
|
(setq gnus-message-archive-method '(nnimap "imap.gmail.com")
|
|
|
|
|
gnus-message-archive-group "[Gmail]/Sent Mail")
|
|
|
|
|
|
|
|
|
|
;; Set return email address based on incoming email address
|
|
|
|
|
(setq gnus-posting-styles
|
|
|
|
|
'(((header "to" "address@outlook.com")
|
|
|
|
|
(address "address@outlook.com"))
|
|
|
|
|
((header "to" "address@gmail.com")
|
|
|
|
|
(address "address@gmail.com"))))
|
|
|
|
|
|
|
|
|
|
;; Store email in ~/gmail directory
|
|
|
|
|
(setq nnml-directory "~/gmail")
|
|
|
|
|
(setq message-directory "~/gmail")
|
2015-06-10 16:44:30 +00:00
|
|
|
|
#+END_SRC
|
|
|
|
|
|
2015-06-10 21:16:01 +00:00
|
|
|
|
Authentication for your gmail account is best stored in an =authinfo= or
|
|
|
|
|
=authinfo.pgp= file. It must be of the form:
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
2015-10-30 11:20:58 +00:00
|
|
|
|
#+BEGIN_EXAMPLE
|
2018-09-19 03:54:47 +00:00
|
|
|
|
machine smtp.gmail.com login name@gmail.com password SUPER_SECRET_PASS
|
|
|
|
|
machine imap.gmail.com login name@gmail.com port 993 password SUPER_SECRET_PASS
|
2015-10-30 11:20:58 +00:00
|
|
|
|
#+END_EXAMPLE
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
|
|
|
|
If you use two-step verification the password has to be an [[https://support.google.com/accounts/answer/185833?hl=en][application specific
|
|
|
|
|
password]].
|
|
|
|
|
|
2015-09-17 07:45:50 +00:00
|
|
|
|
* Org MIME in Org layer
|
2015-06-10 16:44:30 +00:00
|
|
|
|
It is possible to send beautiful HTML emails using org mode.
|
|
|
|
|
|
2017-07-07 10:14:48 +00:00
|
|
|
|
Pressing ~SPC m e m~ in a message buffer will convert the current message
|
2018-10-23 14:18:21 +00:00
|
|
|
|
from org mode to html. An org mode buffer can be sent via html email by pressing
|
2017-07-07 10:14:48 +00:00
|
|
|
|
~SPC m e m~ in any org mode buffer.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
2020-03-01 22:02:37 +00:00
|
|
|
|
* Setup variables
|
|
|
|
|
The Gnus layer defines the following variables like this:
|
|
|
|
|
|
|
|
|
|
#+BEGIN_SRC emacs-lisp
|
|
|
|
|
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
|
|
|
|
|
#+END_SRC
|
|
|
|
|
|
|
|
|
|
They can be configured as layer variables or from the =dotspacemacs/user-config=
|
|
|
|
|
section of =.spacemacs=.
|
|
|
|
|
|
2018-10-23 14:18:21 +00:00
|
|
|
|
* Key bindings
|
2015-06-10 16:44:30 +00:00
|
|
|
|
Gnus has very modal default keybindings.
|
|
|
|
|
Please see the [[http://www.gnus.org/manual.html][manual]] for a complete list.
|
|
|
|
|
|
2018-10-23 14:18:21 +00:00
|
|
|
|
Basic and Spacemacs specific key bindings can be found in the following table.
|
2015-06-10 16:44:30 +00:00
|
|
|
|
|
2019-09-01 19:32:59 +00:00
|
|
|
|
| Key binding | Gnus mode - Description |
|
|
|
|
|
|----------------------+-----------------------------------------------------|
|
|
|
|
|
| ~SPC a g~ | Starts Gnus |
|
|
|
|
|
| ~m~ | New Message |
|
|
|
|
|
| ~O R~, ~G R~ (emacs) | Group Buffer - Add RSS feed |
|
|
|
|
|
| ~g r~ | Group Buffer - Check for new mail |
|
|
|
|
|
| ~^~ | Open Server Buffer. Browse Newsgroups. |
|
|
|
|
|
| ~T n~ | Group Buffer - new Topic |
|
|
|
|
|
| ~T m~ | Group Buffer - Move Group to Topic |
|
|
|
|
|
| ~K~ | Article Buffer - Previous article |
|
|
|
|
|
| ~J~ | Article Buffer - Next article |
|
|
|
|
|
| ~RET~ | Summary Buffer(RSS) - Open article Link in browser |
|
|
|
|
|
| ~TAB~ | Summary Buffer(RSS) - Open article and switch to it |
|