(imap-base64-encode-string): Use `static-if' instead of
authoryamaoka <yamaoka>
Tue, 14 Dec 1999 11:48:01 +0000 (11:48 +0000)
committeryamaoka <yamaoka>
Tue, 14 Dec 1999 11:48:01 +0000 (11:48 +0000)
`static-condition-case'.

lisp/imap.el

index d3872e8..d244fda 100644 (file)
 (static-if (and (fboundp 'base64-encode-string)
                (subrp (symbol-function 'base64-encode-string)))
     (eval-and-compile (fset 'imap-base64-encode-string 'base64-encode-string))
-  (static-condition-case nil
-      (progn
-       (require 'mel)
-       (funcall (mel-find-function 'mime-encode-string "base64")
-                "" 'no-line-break)
-       (defun imap-base64-encode-string (string &optional no-line-break)
-         (fset 'imap-base64-encode-string
-               (symbol-function (mel-find-function
-                                 'mime-encode-string "base64")))
-         (imap-base64-encode-string string))
-       )
-    (wrong-number-of-arguments
-     (eval-and-compile
-       (fset 'imap-base64-encode-string-1
-            (symbol-function (mel-find-function
-                              'mime-encode-string "base64"))))
-     (defun imap-base64-encode-string (string &optional no-line-break)
-       (if no-line-break
-          (mapconcat (function identity)
-                     (split-string (imap-base64-encode-string-1 string)
-                                   "[\n\r]")
-                     "")
-        (imap-base64-encode-string-1 string)))
-     )))
+  (static-if (progn
+              (require 'mel)
+              (condition-case nil
+                  (funcall (mel-find-function 'mime-encode-string "base64")
+                           "" 'no-line-break)
+                (wrong-number-of-arguments nil)))
+      (defun imap-base64-encode-string (string &optional no-line-break)
+       (fset 'imap-base64-encode-string
+             (symbol-function (mel-find-function
+                               'mime-encode-string "base64")))
+       (imap-base64-encode-string string))
+    (eval-and-compile
+      (fset 'imap-base64-encode-string-1
+           (symbol-function (mel-find-function
+                             'mime-encode-string "base64"))))
+    (defun imap-base64-encode-string (string &optional no-line-break)
+      (if no-line-break
+         (mapconcat (function identity)
+                    (split-string (imap-base64-encode-string-1 string)
+                                  "[\n\r]")
+                    "")
+       (imap-base64-encode-string-1 string)))
+    ))
 
 (autoload 'md5 "md5")