From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.io/gmane.emacs.gnus.general/18889 Path: main.gmane.org!not-for-mail From: Shenghuo ZHU Newsgroups: gmane.emacs.gnus.general Subject: Re: 0.50 bug: gnus tries to search for empty line in message Date: 18 Nov 1998 13:56:50 -0500 Organization: Computer Dept of U Rochester Sender: owner-ding@hpc.uh.edu Message-ID: <5bg1bgn825.fsf@schnapps.cs.rochester.edu> References: NNTP-Posting-Host: coloc-standby.netfonds.no Mime-Version: 1.0 X-Trace: main.gmane.org 1035157336 8623 80.91.224.250 (20 Oct 2002 23:42:16 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 20 Oct 2002 23:42:16 +0000 (UTC) Return-Path: Original-Received: from karazm.math.uh.edu (karazm.math.uh.edu [129.7.128.1]) by sclp3.sclp.com (8.8.5/8.8.5) with ESMTP id NAA14212 for ; Wed, 18 Nov 1998 13:57:42 -0500 (EST) Original-Received: from sina.hpc.uh.edu (lists@Sina.HPC.UH.EDU [129.7.3.5]) by karazm.math.uh.edu (8.9.1/8.9.1) with ESMTP id MAB22249; Wed, 18 Nov 1998 12:57:27 -0600 (CST) Original-Received: by sina.hpc.uh.edu (TLB v0.09a (1.20 tibbs 1996/10/09 22:03:07)); Wed, 18 Nov 1998 12:57:24 -0600 (CST) Original-Received: from sclp3.sclp.com (root@sclp3.sclp.com [204.252.123.139]) by sina.hpc.uh.edu (8.7.3/8.7.3) with ESMTP id MAA08401 for ; Wed, 18 Nov 1998 12:57:08 -0600 (CST) Original-Received: from cayuga.cs.rochester.edu (cayuga.cs.rochester.edu [192.5.53.209]) by sclp3.sclp.com (8.8.5/8.8.5) with SMTP id NAA14187 for ; Wed, 18 Nov 1998 13:56:53 -0500 (EST) Original-Received: from slate.cs.rochester.edu (slate.cs.rochester.edu [192.5.53.101]) by cayuga.cs.rochester.edu (8.6.9/O) with ESMTP id NAA28835 for ; Wed, 18 Nov 1998 13:56:52 -0500 Original-Received: from schnapps.cs.rochester.edu (schnapps.cs.rochester.edu [192.5.53.194]) by slate.cs.rochester.edu (8.6.9/O) with ESMTP id NAA16437 for ; Wed, 18 Nov 1998 13:56:50 -0500 Original-Received: (from zsh@localhost) by schnapps.cs.rochester.edu (SMI-8.6/N++) id NAA23419; Wed, 18 Nov 1998 13:56:50 -0500 Original-To: ding@gnus.org X-Attribution: ZSH X-Face: 'IF:e51ib'Qbl^(}l^&4-J`'P!@[4~O|&k#:@Gld#b/]oMq&`&FVY._3+b`mzp~Jeve~/#/ ERD!OTe<86UhyN=l`mrPY)M7_}`Ktt\K+58Z!hu7>qU,i.N7TotU[FYE(f1;}`g2xj!u*l`^&=Q!g{ *q|ddto|nkt"$r,K$[)"|6,elPH= GJ6Q In-Reply-To: Vladimir Volovich's message of "18 Nov 1998 18:29:24 +0300" Original-Lines: 110 User-Agent: Gnus/5.07005 (Pterodactyl Gnus v0.50) Emacs/20.3 Precedence: list X-Majordomo: 1.94.jlt7 Xref: main.gmane.org gmane.emacs.gnus.general:18889 X-Report-Spam: http://spam.gmane.org/gmane.emacs.gnus.general:18889 >>>>> "VVV" == Vladimir Volovich writes: VVV> Hi, VVV> when i try to send the following message: VVV> -------------------------- VVV> To: anybody VVV> Subject: test VVV> --text follows this line-- VVV> abc VVV> def VVV> -------------------------- VVV> i get an error: VVV> Signaling: (search-failed " VVV> ") VVV> search-forward("\n\n") VVV> message-encode-message-body() VVV> message-send-mail(nil) VVV> message-send-via-mail(nil) VVV> message-send(nil) VVV> message-send-and-exit(nil) VVV> * call-interactively(message-send-and-exit) VVV> I.e., gnus for some strange reason searches for an empty line in a VVV> message. If the message does not contain an empty line, it issues an VVV> error. VVV> Also, it seems that pgnus 0.50 inserts an additional empty line after VVV> the first empty line in the message body. VVV> Best regards, -- Vladimir. Hope this patch works. -- Shenghuo :- cut -------------- --- ChangeLog 1998/11/18 18:45:57 1.2 +++ ChangeLog 1998/11/18 18:46:15 @@ -1,3 +1,7 @@ +Wed Nov 18 13:46:08 1998 Shenghuo ZHU + + * message.el (message-encode-message-body): Rewrite. + Wed Nov 18 11:52:19 1998 Shenghuo ZHU * gnus-art.el (gnus-mime-display-alternative): Set end of --- message.el 1998/11/18 17:03:07 1.1 +++ message.el 1998/11/18 18:51:13 @@ -4116,27 +4116,32 @@ type file))) (defun message-encode-message-body () - (message-goto-body) - (save-restriction - (narrow-to-region (point) (point-max)) - (let ((new (mml-generate-mime))) - (delete-region (point-min) (point-max)) - (insert new) - (goto-char (point-min)) - (widen) - (forward-line -1) - (let ((beg (point)) - (line (buffer-substring (point) (progn (forward-line 1) (point))))) - (delete-region beg (point)) - (insert "Mime-Version: 1.0\n") - (search-forward "\n\n") - (forward-char -1) - (insert line) - (when (save-excursion - (re-search-backward "^Content-Type: multipart/" nil t)) - (insert "This is a MIME multipart message. If you are reading\n") - (insert "this, you shouldn't.\n")))))) - + (let (lines multipart-p) + (message-goto-body) + (save-restriction + (narrow-to-region (point) (point-max)) + (let ((new (mml-generate-mime))) + (delete-region (point-min) (point-max)) + (insert new) + (goto-char (point-min)) + (if (eq (aref new 0) ?\n) + (delete-char 1) + (search-forward "\n\n") + (setq lines (buffer-substring (point-min) (1- (point)))) + (delete-region (point-min) (point))))) + (save-restriction + (message-narrow-to-headers-or-head) + (goto-char (point-max)) + (insert "Mime-Version: 1.0\n") + (if lines + (insert lines)) + (setq multipart-p + (re-search-backward "^Content-Type: multipart/" nil t))) + (when multipart-p + (message-goto-body) + (insert "This is a MIME multipart message. If you are reading\n") + (insert "this, you shouldn't.\n")))) + (run-hooks 'message-load-hook) (provide 'message)