Skip to content

Commit 0fc092b

Browse files
committed
Add more mail bindings for gnus
1 parent 12db1c3 commit 0fc092b

File tree

2 files changed

+34
-10
lines changed

2 files changed

+34
-10
lines changed

hgnus-mail.el

+29-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Mats Lidell
44
;;
55
;; Orig-Date: 17-Dec-22 at 22:04:19
6-
;; Last-Mod: 17-Dec-22 at 23:45:46 by Mats Lidell
6+
;; Last-Mod: 8-Jan-23 at 23:50:26 by Mats Lidell
77
;;
88
;; Copyright (C) 2021-2022 Free Software Foundation, Inc.
99
;; See the "HY-COPY" file for license information.
@@ -38,6 +38,9 @@
3838
;; File: hypb-gnus-email.el
3939
;; Function: hypb-gnus-email-init
4040

41+
(require 'gnus-sum)
42+
(require 'gnus-art)
43+
4144
;;;###autoload
4245
(defun Gnus-mail-init ()
4346
"Initialize Hyperbole support for Gnus mail reading."
@@ -56,10 +59,10 @@
5659
;; Setup private abstract interface to mail reader-specific functions
5760
;; used in "hmail.el".
5861
;;
59-
(defalias 'rmail:get-new 'gnus-group-get-new-news)
60-
(defalias 'rmail:msg-forward 'gnus-summary-mail-forward)
61-
(defalias 'rmail:summ-msg-to nil) ;FIXME - What is this for?
62-
(defalias 'rmail:summ-new nil) ;FIXME - What is this for?
62+
(defalias 'rmail:get-new #'gnus-group-get-new-news)
63+
(defalias 'rmail:msg-forward #'gnus-summary-mail-forward)
64+
(defalias 'rmail:summ-msg-to #'gnus-summary-show-article)
65+
(defalias 'rmail:summ-new #'gnus-summary-rescan-group)
6366
(if (called-interactively-p 'interactive)
6467
(message "Hyperbole Gnus mail reader support initialized.")))
6568

@@ -74,5 +77,26 @@
7477
"Open mail composer in other window with field TO set."
7578
(gnus-msg-mail to nil nil nil #'switch-to-buffer-other-window))
7679

80+
(defalias 'Gnus-Summ-goto #'gnus-summary-show-article)
81+
(defalias 'Gnus-msg-next #'gnus-article-goto-next-page)
82+
83+
;; (defun Gnus-Summ-delete ()
84+
;; "Delete an article. No undo for this one I'm afraid."
85+
;; (let ((gnus-novice-user t))
86+
;; (gnus-summary-delete-article)))
87+
88+
(defun Gnus-Summ-delete ()
89+
"Mark article for process so it can be expunged later."
90+
(gnus-summary-mark-as-processable 1))
91+
92+
(defun Gnus-Summ-expunge ()
93+
"Delete all articles with a process mark."
94+
(let ((gnus-novice-user t))
95+
(gnus-summary-delete-article)))
96+
97+
(defun Gnus-Summ-undelete-all ()
98+
"Undelete all messages."
99+
(error "Sorry. Deleted messages can't be undeleted"))
100+
77101
(provide 'hgnus-mail.el)
78102
;;; hgnus-mail.el ends here

hmail.el

+5-5
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
;; Author: Bob Weiner
44
;;
55
;; Orig-Date: 9-Oct-91 at 18:38:05
6-
;; Last-Mod: 17-Dec-22 at 23:36:33 by Mats Lidell
6+
;; Last-Mod: 9-Jan-23 at 00:30:47 by Mats Lidell
77
;;
88
;; Copyright (C) 1991-2022 Free Software Foundation, Inc.
99
;; See the HY-COPY (Hyperbole) or BR-COPY (OO-Browser) file for license
@@ -44,10 +44,10 @@
4444
"*Function (a symbol) to initialize Hyperbole support for a mail reader/composer.
4545
Valid values are: nil, Mh-init, Rmail-init, Vm-init or Gnus-mail-init."
4646
:type '(choice (const nil)
47-
(const Mh-init)
48-
(const Rmail-init)
49-
(const Vm-init)
50-
(const Gnus-mail-init))
47+
(function-item :tag "MH" :value Mh-init)
48+
(function-item :tag "Rmail" :value Rmail-init)
49+
(function-item :tag "Vm" :value Vm-init)
50+
(function-item :tag "Gnus" :value Gnus-mail-init))
5151
:group 'hyperbole-commands)
5252

5353
(defvar hmail:compose-mail-other-window 'mail-other-window

0 commit comments

Comments
 (0)