-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathgnus-recent-ivy.el
65 lines (51 loc) · 2.15 KB
/
gnus-recent-ivy.el
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
;;; gnus-recent-ivy.el --- select recently read Gnus articles with ivy -*- lexical-binding: t -*-
;; Copyright (C) 2018 Kevin Brubeck Unhammer
;; Author: Kevin Brubeck Unhammer <unhammer@fsfe.org>
;; Version: 0.3.0
;; URL: https://github.com/unhammer/gnus-recent
;; Package-Requires: ((emacs "25.3.2") (gnus-recent "0.3.0") (ivy "0.9.0"))
;; Keywords: convenience, mail
;; This file is not part of GNU Emacs.
;; 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 2, 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/>.
;;; Commentary:
;;; Avoid having to open Gnus and find the right group just to get back to
;;; that e-mail you were reading.
;;; To use, require and bind whatever keys you prefer to the
;;; interactive functions:
;;;
;;; (require 'gnus-recent-ivy)
;;; (global-set-key (kbd "<f3>") #'gnus-recent-ivy)
;;; If you prefer `use-package', the above settings would be:
;;;
;;; (use-package gnus-recent-ivy
;;; :after gnus
;;; :bind (("<f3>" . gnus-recent-ivy)))
;;; Code:
(require 'gnus-recent)
(require 'ivy)
(defun gnus-recent-ivy ()
"Select a recent Gnus article to open with `ivy'."
(interactive)
(ivy-read "Recent article: "
gnus-recent--articles-list
:action #'gnus-recent--open-article
:require-match t
:re-builder #'ivy--regex-plus))
(ivy-add-actions #'gnus-recent-ivy
'(("l" gnus-recent-insert-org-link "insert org link")
("c" gnus-recent-kill-new-org-link "copy org link")
("k" gnus-recent-forget "forget")
("K" gnus-recent-forget-all "forget all")))
(provide 'gnus-recent-ivy)
;;; gnus-recent-ivy.el ends here