changeset 53445:c6a08cba798f

(rmail-convert-to-babyl-format): Make the code cleaner (suggested by Richard Stallman).
author Eli Zaretskii <eliz@is.elta.co.il>
date Tue, 30 Dec 2003 10:45:41 +0000
parents 673b9dafcf0f
children e90370b14fef
files lisp/mail/rmail.el
diffstat 1 files changed, 28 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Tue Dec 30 08:51:06 2003 +0000
+++ b/lisp/mail/rmail.el	Tue Dec 30 10:45:41 2003 +0000
@@ -1687,19 +1687,22 @@
 			 (delete-region (point) (search-backward ":"))
 			 (insert ": 8bit")))
 		   (if base64-header-field-end
-		       (condition-case nil
-			   (save-excursion
-			     (base64-decode-region (1+ header-end)
-						   (- (point) 2))
-			     ;; Change "base64" to "8bit", to reflect the
-			     ;; decoding we just did.
-			     (goto-char (1+ header-end))
-			     (while (search-forward "\r\n" (point-max) t)
-			       (replace-match "\n"))
-			     (goto-char base64-header-field-end)
-			     (delete-region (point) (search-backward ":"))
-			     (insert ": 8bit"))
-			 (error nil)))
+		       (save-excursion
+			 (when
+			     (condition-case nil
+				 (progn
+				   (base64-decode-region (1+ header-end)
+							 (- (point) 2))
+				   t)
+			       (error nil))
+			   ;; Change "base64" to "8bit", to reflect the
+			   ;; decoding we just did.
+			   (goto-char (1+ header-end))
+			   (while (search-forward "\r\n" (point-max) t)
+			     (replace-match "\n"))
+			   (goto-char base64-header-field-end)
+			   (delete-region (point) (search-backward ":"))
+			   (insert ": 8bit"))))
 		   (setq last-coding-system-used nil)
 		   (or rmail-enable-mime
 		       (not rmail-enable-multibyte)
@@ -1829,15 +1832,18 @@
 		       (delete-region (point) (search-backward ":"))
 		       (insert ": 8bit")))
 		 (if base64-header-field-end
-		     (condition-case nil
-			 (save-excursion
-			   (base64-decode-region header-end (point))
-			   ;; Change "base64" to "8bit", to reflect the
-			   ;; decoding we just did.
-			   (goto-char base64-header-field-end)
-			   (delete-region (point) (search-backward ":"))
-			   (insert ": 8bit"))
-		       (error nil))))
+		     (save-excursion
+		       (when
+			   (condition-case nil
+			       (progn
+				 (base64-decode-region header-end (point))
+				 t)
+			     (error nil))
+			 ;; Change "base64" to "8bit", to reflect the
+			 ;; decoding we just did.
+			 (goto-char base64-header-field-end)
+			 (delete-region (point) (search-backward ":"))
+			 (insert ": 8bit")))))
 
 	       (save-excursion
 		 (save-restriction