From: morioka Date: Tue, 15 Sep 1998 09:16:22 +0000 (+0000) Subject: (base64): New group. X-Git-Tag: flim-1_10_0-pre1~18 X-Git-Url: http://git.chise.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=657d03090c7f7f49bb1620c028632fbcdbdb778f;p=elisp%2Fflim.git (base64): New group. (base64-external-encoder): Now a user option. (base64-external-decoder): Now a user option. (base64-external-decoder-option-to-specify-file): Now a user option. (base64-internal-encoding-limit): Now a user option. (base64-internal-decoding-limit): Now a user option. --- diff --git a/mel-b.el b/mel-b.el index 8a5f79b..205b4fe 100644 --- a/mel-b.el +++ b/mel-b.el @@ -27,35 +27,50 @@ ;;; Code: (require 'emu) +(require 'mime-def) ;;; @ variables ;;; -(defvar base64-external-encoder '("mmencode") - "*list of base64 encoder program name and its arguments.") +(defgroup base64 nil + "Base64 encoder/decoder" + :group 'mime) -(defvar base64-external-decoder '("mmencode" "-u") - "*list of base64 decoder program name and its arguments.") +(defcustom base64-external-encoder '("mmencode") + "*list of base64 encoder program name and its arguments." + :group 'base64 + :type '(cons (file :tag "Command")(repeat :tag "Arguments" string))) -(defvar base64-external-decoder-option-to-specify-file '("-o") - "*list of options of base64 decoder program to specify file.") +(defcustom base64-external-decoder '("mmencode" "-u") + "*list of base64 decoder program name and its arguments." + :group 'base64 + :type '(cons (file :tag "Command")(repeat :tag "Arguments" string))) -(defvar base64-internal-encoding-limit 1000 +(defcustom base64-external-decoder-option-to-specify-file '("-o") + "*list of options of base64 decoder program to specify file." + :group 'base64 + :type '(repeat :tag "Arguments" string)) + +(defcustom base64-internal-encoding-limit 1000 "*limit size to use internal base64 encoder. If size of input to encode is larger than this limit, -external encoder is called.") +external encoder is called." + :group 'base64 + :type 'integer) -(defvar base64-internal-decoding-limit 1000 +(defcustom base64-internal-decoding-limit 1000 "*limit size to use internal base64 decoder. If size of input to decode is larger than this limit, -external decoder is called.") +external decoder is called." + :group 'base64 + :type 'integer) ;;; @ internal base64 decoder ;;; -(defun base64-char-to-num (c) +(defsubst base64-char-to-num (c) (cond ((and (<= ?A c) (<= c ?Z)) (- c ?A)) ((and (<= ?a c) (<= c ?z)) (+ (- c ?a) 26)) ((and (<= ?0 c) (<= c ?9)) (+ (- c ?0) 52))