Skip to content

Commit

Permalink
Add more mail bindings for gnus
Browse files Browse the repository at this point in the history
  • Loading branch information
matsl committed Jan 22, 2023
1 parent 12db1c3 commit 0fc092b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 10 deletions.
34 changes: 29 additions & 5 deletions hgnus-mail.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Mats Lidell
;;
;; Orig-Date: 17-Dec-22 at 22:04:19
;; Last-Mod: 17-Dec-22 at 23:45:46 by Mats Lidell
;; Last-Mod: 8-Jan-23 at 23:50:26 by Mats Lidell
;;
;; Copyright (C) 2021-2022 Free Software Foundation, Inc.
;; See the "HY-COPY" file for license information.
Expand Down Expand Up @@ -38,6 +38,9 @@
;; File: hypb-gnus-email.el
;; Function: hypb-gnus-email-init

(require 'gnus-sum)
(require 'gnus-art)

;;;###autoload
(defun Gnus-mail-init ()
"Initialize Hyperbole support for Gnus mail reading."
Expand All @@ -56,10 +59,10 @@
;; Setup private abstract interface to mail reader-specific functions
;; used in "hmail.el".
;;
(defalias 'rmail:get-new 'gnus-group-get-new-news)
(defalias 'rmail:msg-forward 'gnus-summary-mail-forward)
(defalias 'rmail:summ-msg-to nil) ;FIXME - What is this for?
(defalias 'rmail:summ-new nil) ;FIXME - What is this for?
(defalias 'rmail:get-new #'gnus-group-get-new-news)
(defalias 'rmail:msg-forward #'gnus-summary-mail-forward)
(defalias 'rmail:summ-msg-to #'gnus-summary-show-article)
(defalias 'rmail:summ-new #'gnus-summary-rescan-group)
(if (called-interactively-p 'interactive)
(message "Hyperbole Gnus mail reader support initialized.")))

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

(defalias 'Gnus-Summ-goto #'gnus-summary-show-article)
(defalias 'Gnus-msg-next #'gnus-article-goto-next-page)

;; (defun Gnus-Summ-delete ()
;; "Delete an article. No undo for this one I'm afraid."
;; (let ((gnus-novice-user t))
;; (gnus-summary-delete-article)))

(defun Gnus-Summ-delete ()
"Mark article for process so it can be expunged later."
(gnus-summary-mark-as-processable 1))

(defun Gnus-Summ-expunge ()
"Delete all articles with a process mark."
(let ((gnus-novice-user t))
(gnus-summary-delete-article)))

(defun Gnus-Summ-undelete-all ()
"Undelete all messages."
(error "Sorry. Deleted messages can't be undeleted"))

(provide 'hgnus-mail.el)
;;; hgnus-mail.el ends here
10 changes: 5 additions & 5 deletions hmail.el
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
;; Author: Bob Weiner
;;
;; Orig-Date: 9-Oct-91 at 18:38:05
;; Last-Mod: 17-Dec-22 at 23:36:33 by Mats Lidell
;; Last-Mod: 9-Jan-23 at 00:30:47 by Mats Lidell
;;
;; Copyright (C) 1991-2022 Free Software Foundation, Inc.
;; See the HY-COPY (Hyperbole) or BR-COPY (OO-Browser) file for license
Expand Down Expand Up @@ -44,10 +44,10 @@
"*Function (a symbol) to initialize Hyperbole support for a mail reader/composer.
Valid values are: nil, Mh-init, Rmail-init, Vm-init or Gnus-mail-init."
:type '(choice (const nil)
(const Mh-init)
(const Rmail-init)
(const Vm-init)
(const Gnus-mail-init))
(function-item :tag "MH" :value Mh-init)
(function-item :tag "Rmail" :value Rmail-init)
(function-item :tag "Vm" :value Vm-init)
(function-item :tag "Gnus" :value Gnus-mail-init))
:group 'hyperbole-commands)

(defvar hmail:compose-mail-other-window 'mail-other-window
Expand Down

0 comments on commit 0fc092b

Please sign in to comment.