From fcc0dd59a68d6cdf6be46a804e454de34216a86b Mon Sep 17 00:00:00 2001 From: yamaoka Date: Wed, 20 Dec 2000 07:12:26 +0000 Subject: [PATCH] Synch with `flim-1_14'. --- ChangeLog | 8 ++++++++ eword-encode.el | 2 +- mel.el | 18 ++++++++++++++---- 3 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ebaac2a..fec0599 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2000-12-20 MORIOKA Tomohiko + * eword-encode.el (eword-encode-text): Specify `mode' of + `encoded-text-encode-string'. + + * mel.el (encoded-text-encode-string): Add optional argument + `mode'; use `base64-encode-string' directly for "B"-encoding. + +2000-12-20 MORIOKA Tomohiko + * FLIM-API.en: Renamed from FLIM-1.14-API.en; reordered and add some sections. diff --git a/eword-encode.el b/eword-encode.el index 71ebd75..2c56f47 100644 --- a/eword-encode.el +++ b/eword-encode.el @@ -71,7 +71,7 @@ CHARSET is a symbol to indicate MIME charset of the encoded-word. ENCODING allows \"B\" or \"Q\". MODE is allows `text', `comment', `phrase' or nil. Default value is `phrase'." - (let ((text (encoded-text-encode-string string encoding))) + (let ((text (encoded-text-encode-string string encoding mode))) (if text (concat "=?" (upcase (symbol-name charset)) "?" encoding "?" text "?=") diff --git a/mel.el b/mel.el index 0ea7809..f54132e 100644 --- a/mel.el +++ b/mel.el @@ -123,8 +123,8 @@ mmencode included in metamail or XEmacs package)." (buffer-string)))) (or (bolp) (insert ?\n))) - (mel-define-method-function (encoded-text-encode-string string (nil "B")) - 'base64-encode-string) + ;; (mel-define-method-function (encoded-text-encode-string string (nil "B")) + ;; 'base64-encode-string) (mel-define-method encoded-text-decode-string (string (nil "B")) (if (string-match (eval-when-compile (concat "\\`" B-encoded-text-regexp "\\'")) @@ -203,8 +203,18 @@ the STRING by its value." string))) -(mel-define-service encoded-text-encode-string (string encoding) - "Encode STRING as encoded-text using ENCODING. ENCODING must be string.") +(mel-define-service encoded-text-encode-string) +(defun encoded-text-encode-string (string encoding &optional mode) + "Encode STRING as encoded-text using ENCODING. +ENCODING must be string. +Optional argument MODE allows `text', `comment', `phrase' or nil. +Default value is `phrase'." + (if (string= encoding "B") + (base64-encode-string string 'no-line-break) + (let ((f (mel-find-function 'encoded-text-encode-string encoding))) + (if f + (funcall f string mode) + string)))) (mel-define-service encoded-text-decode-string (string encoding) "Decode STRING as encoded-text using ENCODING. ENCODING must be string.") -- 1.7.10.4