Gnus development mailing list
 help / color / mirror / Atom feed
* 0.50 bug: gnus tries to search for empty line in message
@ 1998-11-18 15:29 Vladimir Volovich
  1998-11-18 18:56 ` Shenghuo ZHU
  0 siblings, 1 reply; 4+ messages in thread
From: Vladimir Volovich @ 1998-11-18 15:29 UTC (permalink / raw)


Hi,


when i try to send the following message:

--------------------------
To: anybody
Subject: test
--text follows this line--
abc
def
--------------------------

i get an error:

Signaling: (search-failed "

")
  search-forward("\n\n")
  message-encode-message-body()
  message-send-mail(nil)
  message-send-via-mail(nil)
  message-send(nil)
  message-send-and-exit(nil)
* call-interactively(message-send-and-exit)


I.e., gnus for some strange reason searches for an empty line in a
message. If the message does not contain an empty line, it issues an
error.

Also, it seems that pgnus 0.50 inserts an additional empty line after
the first empty line in the message body.

	Best regards, -- Vladimir.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 0.50 bug: gnus tries to search for empty line in message
  1998-11-18 15:29 0.50 bug: gnus tries to search for empty line in message Vladimir Volovich
@ 1998-11-18 18:56 ` Shenghuo ZHU
  1998-11-19  0:33   ` Katsumi Yamaoka / 山岡 克美
  0 siblings, 1 reply; 4+ messages in thread
From: Shenghuo ZHU @ 1998-11-18 18:56 UTC (permalink / raw)


>>>>> "VVV" == Vladimir Volovich <vvv@vvv.vsu.ru> 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  <zsh@cs.rochester.edu>
+
+	* message.el (message-encode-message-body): Rewrite.
+
 Wed Nov 18 11:52:19 1998  Shenghuo ZHU  <zsh@cs.rochester.edu>
 
 	* 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)



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 0.50 bug: gnus tries to search for empty line in message
  1998-11-18 18:56 ` Shenghuo ZHU
@ 1998-11-19  0:33   ` Katsumi Yamaoka / 山岡 克美
  1998-11-19  1:03     ` Katsumi Yamaoka / 山岡 克美
  0 siblings, 1 reply; 4+ messages in thread
From: Katsumi Yamaoka / 山岡 克美 @ 1998-11-19  0:33 UTC (permalink / raw)


>>>>> In <5bg1bgn825.fsf@schnapps.cs.rochester.edu> 
>>>>>	Shenghuo ZHU <zsh@cs.rochester.edu> wrote:

>>>>> "VVV" == Vladimir Volovich <vvv@vvv.vsu.ru> writes:

VVV> i get an error:
VVV> Signaling: (search-failed "

VVV> ")

ZSH> Hope this patch works.

This is another patch for the problem. How's it?

--- message.el~	Wed Nov 18 10:20:17 1998
+++ message.el	Thu Nov 19 09:22:10 1998
@@ -4126,11 +4126,14 @@
       (widen)
       (forward-line -1)
       (let ((beg (point))
-	    (line (buffer-substring (point) (progn (forward-line 1) (point)))))
+	    (line (buffer-substring
+		   (point)
+		   (progn (forward-line 1) (1- (point))))))
 	(delete-region beg (point))
 	(insert "Mime-Version: 1.0\n")
-	(search-forward "\n\n")
-	(forward-char -1)
+	(unless (eolp)
+	  (search-forward "\n\n")
+	  (forward-char -1))
 	(insert line)
 	(when (save-excursion
 		(re-search-backward "^Content-Type: multipart/" nil t))
-- 
Katsumi Yamaoka <yamaoka@jpl.org>



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: 0.50 bug: gnus tries to search for empty line in message
  1998-11-19  0:33   ` Katsumi Yamaoka / 山岡 克美
@ 1998-11-19  1:03     ` Katsumi Yamaoka / 山岡 克美
  0 siblings, 0 replies; 4+ messages in thread
From: Katsumi Yamaoka / 山岡 克美 @ 1998-11-19  1:03 UTC (permalink / raw)


[-- Attachment #1: Type: text/plain, Size: 310 bytes --]

>>>>> In <2890h8msgn.fsf@kchisa.ga.sony.co.jp> 
>>>>>	yamaoka@jpl.org (Katsumi Yamaoka) wrote:

KY> This is another patch for the problem. How's it?

KY> --- message.el~	Wed Nov 18 10:20:17 1998
KY> +++ message.el	Thu Nov 19 09:22:10 1998

Sorry, it does not work for multipart message. The fixed one follows.

[-- Attachment #2: Type: application/octet-stream, Size: 838 bytes --]

--- message.el~	Wed Nov 18 10:20:17 1998
+++ message.el	Thu Nov 19 09:56:50 1998
@@ -4126,15 +4126,18 @@
       (widen)
       (forward-line -1)
       (let ((beg (point))
-	    (line (buffer-substring (point) (progn (forward-line 1) (point)))))
+	    (line (buffer-substring
+		   (point)
+		   (progn (forward-line 1) (1- (point))))))
 	(delete-region beg (point))
 	(insert "Mime-Version: 1.0\n")
-	(search-forward "\n\n")
-	(forward-char -1)
+	(unless (eolp)
+	  (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 "\nThis is a MIME multipart message.  If you are reading\n")
 	  (insert "this, you shouldn't.\n"))))))
     
 (run-hooks 'message-load-hook)

[-- Attachment #3: Type: text/plain, Size: 38 bytes --]

-- 
Katsumi Yamaoka <yamaoka@jpl.org>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-11-19  1:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-11-18 15:29 0.50 bug: gnus tries to search for empty line in message Vladimir Volovich
1998-11-18 18:56 ` Shenghuo ZHU
1998-11-19  0:33   ` Katsumi Yamaoka / 山岡 克美
1998-11-19  1:03     ` Katsumi Yamaoka / 山岡 克美

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).