🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: gnu.emacs.gnus
Article #860

Fix to gnus-convert-article-to-rmail

#860
From: Michael Ernst
Date: Fri, 02 Feb 1990 18:01
30 lines
1586 bytes
;; If there is no "from" field, (mail-fetch-field "from") returns nil,
;; which mail-strip-quoted-names can't deal with.  This modification
;; provides an explicit check.

(defun gnus-convert-article-to-rmail ()
  "Convert article in current buffer to Rmail message format."
  (let ((buffer-read-only nil))
    ;; Insert special header of Unix mail.
    (goto-char (point-min))
    (insert "From "
	    (let ((from-field (mail-fetch-field "from")))
	      (or (if from-field (mail-strip-quoted-names from-field))
		  "unknown"))
	    " " (current-time-string) "\n")
    ;; ``Quote'' "\nFrom " as "\n>From "
    ;;  (note that this isn't really quoting, as there is no requirement
    ;;   that "\n[>]+From " be quoted in the same transparent way.)
    (while (search-forward "\nFrom " nil t)
      (forward-char -5)
      (insert ?>))
    ;; Convert article to babyl format.
    (rmail-convert-to-babyl-format)
    ))

---------------------------------------------------------------------------

The "if from-field" might not be necessary, but I didn't bother to check.
In any case, this works.
					-Michael Ernst
					 mernst@theory.lcs.mit.edu 
Technical Details
Message-ID: <MERNST.90Feb2130155@emu.lcs.mit.edu>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!mintaka!mintaka!mernst

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!samsung!think!mintaka!mintaka!mernst
From: mernst@theory.lcs.mit.edu (Michael Ernst)
Newsgroups: gnu.emacs.gnus
Subject: Fix to gnus-convert-article-to-rmail
Message-ID: <MERNST.90Feb2130155@emu.lcs.mit.edu>
Date: 2 Feb 90 18:01:55 GMT
Sender: news@mintaka.lcs.mit.edu
Distribution: gnu
Organization: MIT Lab for Computer Science
Lines: 30