From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/29528 Path: main.gmane.org!not-for-mail From: Julien Gilles Newsgroups: gmane.emacs.gnus.general Subject: RFC2369 - Mailing list & gnus Date: 15 Mar 2000 14:11:45 +0100 Sender: owner-ding@hpc.uh.edu Message-ID: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: main.gmane.org 1035166182 3226 80.91.224.250 (21 Oct 2002 02:09:42 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:09:42 +0000 (UTC) Return-Path: Original-Received: from lisa.math.uh.edu (lisa.math.uh.edu [129.7.128.49]) by mailhost.sclp.com (Postfix) with ESMTP id 1A88DD051E for ; Wed, 15 Mar 2000 08:14:23 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by lisa.math.uh.edu (8.9.1/8.9.1) with ESMTP id HAB20032; Wed, 15 Mar 2000 07:14:12 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 15 Mar 2000 07:13:25 -0600 (CST) Original-Received: from mailhost.sclp.com (postfix@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.9.3/8.9.3) with ESMTP id HAA10395 for ; Wed, 15 Mar 2000 07:13:12 -0600 (CST) Original-Received: from mel.alcatel.fr (mel.alcatel.fr [212.208.74.132]) by mailhost.sclp.com (Postfix) with ESMTP id 6A8D4D051E for ; Wed, 15 Mar 2000 08:13:23 -0500 (EST) Original-Received: from aifhs2.alcatel.fr (mailhub.alcatel.fr [155.132.180.80]) by mel.alcatel.fr (ALCANET/SMTP) with ESMTP id OAA13161 for ; Wed, 15 Mar 2000 14:05:14 +0100 Original-Received: from dnscit.cit.alcatel.fr (dnscit.cit.alcatel.fr [139.54.100.2]) by aifhs2.alcatel.fr (ALCANET/SMTP2) with ESMTP id OAA04342 for ; Wed, 15 Mar 2000 14:09:53 +0100 (MET) Original-Received: from dnsvz.vz.cit.alcatel.fr (dnsvz.vz.cit.alcatel.fr [139.54.85.1]) by dnscit.cit.alcatel.fr (8.9.3+Sun/8.9.3) with ESMTP id OAA00842 for ; Wed, 15 Mar 2000 14:14:43 +0100 (MET) Original-Received: from bcv01y01.vz.cit.alcatel.fr (bcv01y01.vz.cit.alcatel.fr [139.54.101.1]) by dnsvz.vz.cit.alcatel.fr (8.9.3+Sun/8.9.3) with ESMTP id OAA22480 for ; Wed, 15 Mar 2000 14:14:00 +0100 (MET) Original-Received: from bcv01xc7.vz.cit.alcatel.fr (bcv01xc7.vz.cit.alcatel.fr [139.54.101.199]) by bcv01y01.vz.cit.alcatel.fr with ESMTP (8.8.6 (PHNE_17135)/8.7.1) id OAA14972 for ; Wed, 15 Mar 2000 14:11:47 +0100 (MET) Original-Received: by bcv01xc7.vz.cit.alcatel.fr (8.8.8+Sun/SMI-SVR4) id OAA06752; Wed, 15 Mar 2000 14:11:45 +0100 (MET) Original-To: ding@gnus.org Original-Lines: 49 User-Agent: Gnus/5.0803 (Gnus v5.8.3) XEmacs/21.1 (Bryce Canyon) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:29528 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:29528 --=-=-= Hi, some weeks ago someone mentionned the RFC 2369, about "The Use of URLs as Meta-Syntax for Core Mail List Commands and their Transport through Message Header Fields". wow. In fact I didn't implemented the solution through message header fields, cause : I don't know exactly how to do that, and I never seen mailing list with such header fields. But I wrote a small minor mode providing mailing list commands based on the syntax described in the RFC Just define list-help, list-subscribe, etc... variable in a group, and command are then available : eg, my group parameters for nnml:ding : ((to-address . "ding@gnus.org") (to-list . "ding@gnus.org") (total-expire . t) (expiry-wait . 20) (admin-address . "ding-request@gnus.org") (list-help "") (list-unsubscribe "") (list-subscribe "")) here is the file : --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=gnus-ml.el Content-Description: gnus-ml.el ;;; gnus-ml.el --- Mailing list minor mode for gnus ;; Copyright (C) 2000 by Julien Gilles ;; Author: Julien Gilles ;; Keywords: news ;; 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 of the License, 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, write to the Free Software ;; Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ;;; Commentary: ;; implement (subset of) RFC 2369 ;;; Code: (require 'gnus) (eval-when-compile (require 'cl)) ;;; Mailing list minor mode (defvar gnus-mailing-list-mode nil "Minor mode for providing mailing-list commands.") (defvar gnus-mailing-list-mode-map nil) (unless gnus-mailing-list-mode-map (setq gnus-mailing-list-mode-map (make-sparse-keymap)) (gnus-define-keys gnus-mailing-list-mode-map "\C-nh" gnus-mailing-list-help "\C-ns" gnus-mailing-list-subscribe "\C-nu" gnus-mailing-list-unsubscribe "\C-np" gnus-mailing-list-post "\C-no" gnus-mailing-list-owner "\C-na" gnus-mailing-list-archive )) (defun gnus-mailing-list-make-menu-bar () (unless (boundp 'gnus-mailing-list-menu) (easy-menu-define gnus-mailing-list-menu gnus-mailing-list-mode-map "" '("Mailing-Lists" ["Get help" gnus-mailing-list-help t] ["Subscribe" gnus-mailing-list-subscribe t] ["Unsubscribe" gnus-mailing-list-unsubscribe t] ["Post a message" gnus-mailing-list-post t] ["Mail to owner" gnus-mailing-list-owner t] ["Browse archive" gnus-mailing-list-archive t])))) (defun gnus-mailing-list-mode (&optional arg) "Minor mode for providing mailing-list commands. \\{gnus-mailing-list-mode-map}" (interactive "P") (when (eq major-mode 'gnus-summary-mode) (when (set (make-local-variable 'gnus-mailing-list-mode) (if (null arg) (not gnus-mailing-list-mode) (> (prefix-numeric-value arg) 0))) ;; Set up the menu. (when (gnus-visual-p 'mailing-list-menu 'menu) (gnus-mailing-list-make-menu-bar)) (gnus-add-minor-mode 'gnus-mailing-list-mode " Mailing-List" gnus-mailing-list-mode-map) (gnus-run-hooks 'gnus-mailing-list-mode-hook)))) ;;; Commands (defun gnus-mailing-list-help () "Get help from mailing list server." (interactive) (cond (list-help (gnus-mailing-list-message list-help)) (t (display-message 'no-log "no list-help in this group")))) (defun gnus-mailing-list-subscribe () "Subscribe" (interactive) (cond (list-subscribe (gnus-mailing-list-message list-subscribe)) (t (display-message 'no-log "no list-subscribe in this group")))) (defun gnus-mailing-list-unsubscribe () "Unsubscribe" (interactive) (cond (list-unsubscribe (gnus-mailing-list-message list-unsubscribe)) (t (display-message 'no-log "no list-unsubscribe in this group")))) (defun gnus-mailing-list-post () "Post message (really useful ?)" (interactive) (cond (list-post (gnus-mailing-list-message list-post)) (t (display-message 'no-log "no list-post in this group"))) ) (defun gnus-mailing-list-owner () "Mail to the owner" (interactive) (cond (list-owner (gnus-mailing-list-message list-owner)) (t (display-message 'no-log "no list-owner in this group"))) ) (defun gnus-mailing-list-archive () "Browse archive" (interactive) (cond (list-archive (gnus-mailing-list-message list-archive)) (t (display-message 'no-log "no list-owner in this group"))) ) ;;; Utility functions (defun gnus-xmas-mailing-list-menu-add () (gnus-xmas-menu-add mailing-list gnus-mailing-list-menu)) (add-hook 'gnus-mailing-list-mode-hook 'gnus-xmas-mailing-list-menu-add) (defun gnus-mailing-list-message (address) "" (let ((mailto "") (to ()) (subject "None") (body "") ) (cond ((string-match "]*\\)>" address) (let ((args (match-string 1 address))) (cond ; with param ((string-match "\\(.*\\)\\?\\(.*\\)" args) (setq mailto (match-string 1 args)) (let ((param (match-string 2 args))) (if (string-match "subject=\\([^&]*\\)" param) (setq subject (match-string 1 param))) (if (string-match "body=\\([^&]*\\)" param) (setq body (match-string 1 param))) (if (string-match "to=\\([^&]*\\)" param) (push (match-string 1 param) to)) )) (t (setq mailto args))))) ; without param ; other case