From caaa66c35c68ef6e0a0317e4886343f2cc7abc61 Mon Sep 17 00:00:00 2001 From: yamaoka Date: Tue, 14 Dec 1999 11:05:58 +0000 Subject: [PATCH] (imap-base64-encode-string): Allow the optional 2nd arg `no-line-break'. --- lisp/imap.el | 29 ++++++++++++++++++++++++----- 1 file changed, 24 insertions(+), 5 deletions(-) diff --git a/lisp/imap.el b/lisp/imap.el index 3544238..d3872e8 100644 --- a/lisp/imap.el +++ b/lisp/imap.el @@ -162,11 +162,30 @@ (static-if (and (fboundp 'base64-encode-string) (subrp (symbol-function 'base64-encode-string))) (eval-and-compile (fset 'imap-base64-encode-string 'base64-encode-string)) - (defun imap-base64-encode-string (string) - (fset 'imap-base64-encode-string - (symbol-function (mel-find-function 'mime-encode-string "base64"))) - (imap-base64-encode-string 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))) + ))) (autoload 'md5 "md5") -- 1.7.10.4