From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/29015 Path: main.gmane.org!not-for-mail From: Brian May Newsgroups: gmane.emacs.gnus.general Subject: mail from command prompt Date: 31 Jan 2000 14:53:54 +1100 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 1035165759 329 80.91.224.250 (21 Oct 2002 02:02:39 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 21 Oct 2002 02:02:39 +0000 (UTC) Return-Path: Original-Received: from spinoza.math.uh.edu (spinoza.math.uh.edu [129.7.128.18]) by mailhost.sclp.com (Postfix) with ESMTP id 85696D051F for ; Sun, 30 Jan 2000 23:00:29 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by spinoza.math.uh.edu (8.9.1/8.9.1) with ESMTP id VAB15497; Sun, 30 Jan 2000 21:56:56 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Sun, 30 Jan 2000 21:56:22 -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 VAA08648 for ; Sun, 30 Jan 2000 21:56:12 -0600 (CST) Original-Received: from lyell.csse.monash.edu.au (lyell.csse.monash.edu.au [130.194.64.41]) by mailhost.sclp.com (Postfix) with ESMTP id 3813BD051E for ; Sun, 30 Jan 2000 22:54:44 -0500 (EST) Original-Received: by lyell.csse.monash.edu.au (Postfix, from userid 3752) id ECCF5F724; Mon, 31 Jan 2000 14:53:54 +1100 (EST) Original-To: ding@gnus.org X-Home-Page: http://www.csse.monash.edu.au/~bmay/ Original-Lines: 52 User-Agent: Gnus/5.0802 (Gnus v5.8.2) XEmacs/20.4 (Emerald) Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:29015 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:29015 --=-=-= Hello, I posted a message about sending mail using gnus from the command prompt earlier on the gnus newsgroup. As I am impatient, I started work on finding out how it could be done without waiting for a response. Please tell me if there is already a way to do this... For instance, with my scripts (attached), you can now type in gnusmail filename and it will open a new window and allow you to edit the message based on the template found in file (compare with "mutt -H filename"). However, I am not very good at LISP, so would appreciate help on the following bugs: 1. Mail opens in new frame *and* current frame. 2. Cannot get it to work for headers other then "to:" or "subject:". 3. the gnusmail command should wait until mail is sent but doesn't. 4. could be used from other emacs applications? eg w3? 5. error handling (eg filename doesn't exist) in non-existent. 6. gnus-posting-styles uses the currently selected group. 7. Not sure if it will always work. Of course, gnus must be loaded (I think). 8. Description of function is wrong, nor no I understand what interactive or art-beg do. At least it should be easy to tell where I copied the code (with major changes) from ;-). Anyone able to assist? For me, the most important problems are 2 and 3. I suspect 5 should be easy to fix, too, for somebody who knows what they are doing ;-) --=-=-= Content-Disposition: attachment; filename=gnusmail Content-Description: shell script #!/bin/sh gnuclient -eval '(gnus-setup-message '\''message (message-do-send "'$1'"))' $1 --=-=-= Content-Type: application/emacs-lisp Content-Disposition: attachment; filename=gnusmail.el Content-Description: lisp code ;; This buffer is for notes you don't want to save, and for Lisp evaluation. ;; If you want to create a file, first visit that file with C-x C-f, ;; then enter the text in that file's own buffer. (defun message-do-send (&optional body) "Forward the current message via mail. Optional NEWS will use news to forward instead of mail." (interactive "P") (let (art-beg) (let ((buffer (get-buffer-create "*temp*"))) (unwind-protect (save-excursion (set-buffer buffer) (insert-file-contents body) (setq reportbug (message-fetch-field "x-reportbug-version")) (setq subject (message-fetch-field "subject")) (setq to (message-fetch-field "to")) (setq cc (message-fetch-field "cc")) (kill-buffer buffer))) ) (message-mail to subject '((X-Reportbug-Version "0.48")) ) (message-goto-body) (insert-file-contents body) (delete-file body) (delete-region (message-goto-body) (if (search-forward "\n\n" nil 1) (point) (point-max)) ) (message-position-point))) --=-=-= -- Brian May --=-=-=--