|
| 1 | +;;; hgnus-mail.el --- Gnus mailer support -*- lexical-binding: t; -*- |
| 2 | +;; |
| 3 | +;; Author: Mats Lidell |
| 4 | +;; |
| 5 | +;; Orig-Date: 17-Dec-22 at 22:04:19 |
| 6 | +;; Last-Mod: 17-Dec-22 at 23:45:46 by Mats Lidell |
| 7 | +;; |
| 8 | +;; Copyright (C) 2021-2022 Free Software Foundation, Inc. |
| 9 | +;; See the "HY-COPY" file for license information. |
| 10 | +;; |
| 11 | +;; This file is part of GNU Hyperbole. |
| 12 | + |
| 13 | +;;; Commentary: |
| 14 | +;; |
| 15 | + |
| 16 | +;;; Code: |
| 17 | + |
| 18 | +;;; ************************************************************************ |
| 19 | +;;; Requirements |
| 20 | +;;; ************************************************************************ |
| 21 | + |
| 22 | +;;; ************************************************************************ |
| 23 | +;;; Public variables |
| 24 | +;;; ************************************************************************ |
| 25 | + |
| 26 | +;;; ************************************************************************ |
| 27 | +;;; Private variables |
| 28 | +;;; ************************************************************************ |
| 29 | + |
| 30 | +;;; ************************************************************************ |
| 31 | +;;; Public functions |
| 32 | +;;; ************************************************************************ |
| 33 | + |
| 34 | +;; FIXME - Start to use common prefix such as hypb for file name and |
| 35 | +;; functions? |
| 36 | +;; |
| 37 | +;; Would be: |
| 38 | +;; File: hypb-gnus-email.el |
| 39 | +;; Function: hypb-gnus-email-init |
| 40 | + |
| 41 | +;;;###autoload |
| 42 | +(defun Gnus-mail-init () |
| 43 | + "Initialize Hyperbole support for Gnus mail reading." |
| 44 | + (interactive) |
| 45 | + (setq hmail:compose-mail-other-window 'hgnus-mail--message-mail-other-window |
| 46 | + hmail:composer 'message-mode |
| 47 | + hmail:lister 'gnus-summary-mode |
| 48 | + hmail:modifier 'message-mode |
| 49 | + hmail:reader 'gnus-article-mode) |
| 50 | + ;; |
| 51 | + ;; Setup public abstract interface to Hyperbole defined mail |
| 52 | + ;; reader-specific functions used in "hmail.el". |
| 53 | + ;; |
| 54 | + (rmail:init) |
| 55 | + ;; |
| 56 | + ;; Setup private abstract interface to mail reader-specific functions |
| 57 | + ;; used in "hmail.el". |
| 58 | + ;; |
| 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? |
| 63 | + (if (called-interactively-p 'interactive) |
| 64 | + (message "Hyperbole Gnus mail reader support initialized."))) |
| 65 | + |
| 66 | +;;; ************************************************************************ |
| 67 | +;;; Private functions |
| 68 | +;;; ************************************************************************ |
| 69 | + |
| 70 | +;; FIXME - noerase arg is nil in the other invocation so really not |
| 71 | +;; needed. We can use a local defun in the other case as well and so |
| 72 | +;; the noerase can go away. |
| 73 | +(defun hgnus-mail--message-mail-other-window (_noerase to) |
| 74 | + "Open mail composer in other window with field TO set." |
| 75 | + (gnus-msg-mail to nil nil nil #'switch-to-buffer-other-window)) |
| 76 | + |
| 77 | +(provide 'hgnus-mail.el) |
| 78 | +;;; hgnus-mail.el ends here |
0 commit comments