diff options
| author | Dave Love | 2000-11-06 23:14:25 +0000 |
|---|---|---|
| committer | Dave Love | 2000-11-06 23:14:25 +0000 |
| commit | 1464e703ba2d7d9549571563626437c4ccf2fc55 (patch) | |
| tree | 1938f8df873612595a8c3e2873f0b7f299d3e905 | |
| parent | 8b84c4d38e6184c84001fa45e1d1a049b3338b10 (diff) | |
| download | emacs-1464e703ba2d7d9549571563626437c4ccf2fc55.tar.gz emacs-1464e703ba2d7d9549571563626437c4ccf2fc55.zip | |
2000-10-01 08:32:42 ShengHuo ZHU <zsh@cs.rochester.edu>
* gnus-ml.el: Usage.
(gnus-mailing-list-archive, gnus-mailing-list-owner,
gnus-mailing-list-post, gnus-mailing-list-unsubscribe,
gnus-mailing-list-subscribe, gnus-mailing-list-help): Bind list-*.
(gnus-mailing-list-menu): Define it.
(turn-on-gnus-mailing-list-mode, gnus-mailing-list-mode): Autoload.
| -rw-r--r-- | lisp/gnus/gnus-ml.el | 63 |
1 files changed, 40 insertions, 23 deletions
diff --git a/lisp/gnus/gnus-ml.el b/lisp/gnus/gnus-ml.el index 3e0f878dc97..d7c8fb3b2bf 100644 --- a/lisp/gnus/gnus-ml.el +++ b/lisp/gnus/gnus-ml.el | |||
| @@ -26,9 +26,14 @@ | |||
| 26 | 26 | ||
| 27 | ;; implement (small subset of) RFC 2369 | 27 | ;; implement (small subset of) RFC 2369 |
| 28 | 28 | ||
| 29 | ;;; Usage: | ||
| 30 | |||
| 31 | ;; (add-hook 'gnus-summary-mode-hook 'turn-on-gnus-mailing-list-mode) | ||
| 32 | |||
| 29 | ;;; Code: | 33 | ;;; Code: |
| 30 | 34 | ||
| 31 | (require 'gnus) | 35 | (require 'gnus) |
| 36 | (require 'gnus-msg) | ||
| 32 | (eval-when-compile (require 'cl)) | 37 | (eval-when-compile (require 'cl)) |
| 33 | 38 | ||
| 34 | ;;; Mailing list minor mode | 39 | ;;; Mailing list minor mode |
| @@ -38,6 +43,8 @@ | |||
| 38 | 43 | ||
| 39 | (defvar gnus-mailing-list-mode-map nil) | 44 | (defvar gnus-mailing-list-mode-map nil) |
| 40 | 45 | ||
| 46 | (defvar gnus-mailing-list-menu) | ||
| 47 | |||
| 41 | (unless gnus-mailing-list-mode-map | 48 | (unless gnus-mailing-list-mode-map |
| 42 | (setq gnus-mailing-list-mode-map (make-sparse-keymap)) | 49 | (setq gnus-mailing-list-mode-map (make-sparse-keymap)) |
| 43 | 50 | ||
| @@ -62,10 +69,12 @@ | |||
| 62 | ["Mail to owner" gnus-mailing-list-owner t] | 69 | ["Mail to owner" gnus-mailing-list-owner t] |
| 63 | ["Browse archive" gnus-mailing-list-archive t])))) | 70 | ["Browse archive" gnus-mailing-list-archive t])))) |
| 64 | 71 | ||
| 72 | ;;;###autoload | ||
| 65 | (defun turn-on-gnus-mailing-list-mode () | 73 | (defun turn-on-gnus-mailing-list-mode () |
| 66 | (when (gnus-group-get-parameter group 'to-list) | 74 | (when (gnus-group-get-parameter gnus-newsgroup-name 'to-list) |
| 67 | (gnus-mailing-list-mode 1))) | 75 | (gnus-mailing-list-mode 1))) |
| 68 | 76 | ||
| 77 | ;;;###autoload | ||
| 69 | (defun gnus-mailing-list-mode (&optional arg) | 78 | (defun gnus-mailing-list-mode (&optional arg) |
| 70 | "Minor mode for providing mailing-list commands. | 79 | "Minor mode for providing mailing-list commands. |
| 71 | 80 | ||
| @@ -86,51 +95,59 @@ | |||
| 86 | (defun gnus-mailing-list-help () | 95 | (defun gnus-mailing-list-help () |
| 87 | "Get help from mailing list server." | 96 | "Get help from mailing list server." |
| 88 | (interactive) | 97 | (interactive) |
| 89 | (cond (list-help (gnus-mailing-list-message list-help)) | 98 | (let ((list-help |
| 90 | (t (display-message 'no-log "no list-help in this group")))) | 99 | (with-current-buffer gnus-original-article-buffer |
| 100 | (gnus-fetch-field "list-help")))) | ||
| 101 | (cond (list-help (gnus-mailing-list-message list-help)) | ||
| 102 | (t (gnus-message 1 "no list-help in this group"))))) | ||
| 91 | 103 | ||
| 92 | (defun gnus-mailing-list-subscribe () | 104 | (defun gnus-mailing-list-subscribe () |
| 93 | "Subscribe" | 105 | "Subscribe" |
| 94 | (interactive) | 106 | (interactive) |
| 95 | (cond (list-subscribe (gnus-mailing-list-message list-subscribe)) | 107 | (let ((list-subscribe |
| 96 | (t (display-message 'no-log "no list-subscribe in this group")))) | 108 | (with-current-buffer gnus-original-article-buffer |
| 97 | 109 | (gnus-fetch-field "list-subscribe")))) | |
| 110 | (cond (list-subscribe (gnus-mailing-list-message list-subscribe)) | ||
| 111 | (t (gnus-message 1 "no list-subscribe in this group"))))) | ||
| 98 | 112 | ||
| 99 | (defun gnus-mailing-list-unsubscribe () | 113 | (defun gnus-mailing-list-unsubscribe () |
| 100 | "Unsubscribe" | 114 | "Unsubscribe" |
| 101 | (interactive) | 115 | (interactive) |
| 102 | (cond (list-unsubscribe (gnus-mailing-list-message list-unsubscribe)) | 116 | (let ((list-unsubscribe |
| 103 | (t (display-message 'no-log "no list-unsubscribe in this group")))) | 117 | (with-current-buffer gnus-original-article-buffer |
| 118 | (gnus-fetch-field "list-unsubscribe")))) | ||
| 119 | (cond (list-unsubscribe (gnus-mailing-list-message list-unsubscribe)) | ||
| 120 | (t (gnus-message 1 "no list-unsubscribe in this group"))))) | ||
| 104 | 121 | ||
| 105 | (defun gnus-mailing-list-post () | 122 | (defun gnus-mailing-list-post () |
| 106 | "Post message (really useful ?)" | 123 | "Post message (really useful ?)" |
| 107 | (interactive) | 124 | (interactive) |
| 108 | (cond (list-post (gnus-mailing-list-message list-post)) | 125 | (let ((list-post |
| 109 | (t (display-message 'no-log "no list-post in this group"))) | 126 | (with-current-buffer gnus-original-article-buffer |
| 110 | ) | 127 | (gnus-fetch-field "list-post")))) |
| 128 | (cond (list-post (gnus-mailing-list-message list-post)) | ||
| 129 | (t (gnus-message 1 "no list-post in this group"))))) | ||
| 111 | 130 | ||
| 112 | (defun gnus-mailing-list-owner () | 131 | (defun gnus-mailing-list-owner () |
| 113 | "Mail to the owner" | 132 | "Mail to the owner" |
| 114 | (interactive) | 133 | (interactive) |
| 115 | (cond (list-owner (gnus-mailing-list-message list-owner)) | 134 | (let ((list-owner |
| 116 | (t (display-message 'no-log "no list-owner in this group"))) | 135 | (with-current-buffer gnus-original-article-buffer |
| 117 | ) | 136 | (gnus-fetch-field "list-owner")))) |
| 137 | (cond (list-owner (gnus-mailing-list-message list-owner)) | ||
| 138 | (t (gnus-message 1 "no list-owner in this group"))))) | ||
| 118 | 139 | ||
| 119 | (defun gnus-mailing-list-archive () | 140 | (defun gnus-mailing-list-archive () |
| 120 | "Browse archive" | 141 | "Browse archive" |
| 121 | (interactive) | 142 | (interactive) |
| 122 | (cond (list-archive (gnus-mailing-list-message list-archive)) | 143 | (let ((list-archive |
| 123 | (t (display-message 'no-log "no list-owner in this group"))) | 144 | (with-current-buffer gnus-original-article-buffer |
| 124 | ) | 145 | (gnus-fetch-field "list-archive")))) |
| 146 | (cond (list-archive (gnus-mailing-list-message list-archive)) | ||
| 147 | (t (gnus-message 1 "no list-owner in this group"))))) | ||
| 125 | 148 | ||
| 126 | ;;; Utility functions | 149 | ;;; Utility functions |
| 127 | 150 | ||
| 128 | (defun gnus-xmas-mailing-list-menu-add () | ||
| 129 | (gnus-xmas-menu-add mailing-list | ||
| 130 | gnus-mailing-list-menu)) | ||
| 131 | |||
| 132 | (add-hook 'gnus-mailing-list-mode-hook 'gnus-xmas-mailing-list-menu-add) | ||
| 133 | |||
| 134 | (defun gnus-mailing-list-message (address) | 151 | (defun gnus-mailing-list-message (address) |
| 135 | "" | 152 | "" |
| 136 | (let ((mailto "") | 153 | (let ((mailto "") |