From: shuhei-k Date: Sat, 22 May 1999 16:52:04 +0000 (+0000) Subject: Update header. X-Git-Tag: flim-1_12_7~28 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=57ee6d96b04179f3155290836e648215319666e6;p=elisp%2Fflim.git Update header. (base64-ccl-encode-region): Use read-only `interactive' spec. (base64-ccl-decode-region): Ditto. (base64-ccl-insert-encoded-file): Use built-in `interactive' spec. (base64-ccl-write-decoded-region): Ditto. (encoded-text-decode-string): Anchor regexp with "\\`" and "\\'". --- diff --git a/mel-b-ccl.el b/mel-b-ccl.el index 02fd3e3..8bca881 100644 --- a/mel-b-ccl.el +++ b/mel-b-ccl.el @@ -1,4 +1,4 @@ -;;; mel-b-ccl.el: CCL based encoder/decoder of Base64 +;;; mel-b-ccl.el --- Base64 encoder/decoder using CCL. ;; Copyright (C) 1998 Tanaka Akira @@ -19,7 +19,7 @@ ;; General Public License for more details. ;; You should have received a copy of the GNU General Public License -;; along with GNU Emacs; see the file COPYING. If not, write to the +;; along with this program; see the file COPYING. If not, write to the ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, ;; Boston, MA 02111-1307, USA. @@ -404,12 +404,12 @@ abcdefghijklmnopqrstuvwxyz\ (defun base64-ccl-encode-region (start end) "Encode region from START to END with base64 encoding." - (interactive "r") + (interactive "*r") (decode-coding-region start end 'mel-ccl-base64-lf-rev)) (defun base64-ccl-insert-encoded-file (filename) "Encode contents of file FILENAME to base64, and insert the result." - (interactive (list (read-file-name "Insert encoded file: "))) + (interactive "*fInsert encoded file: ") (insert-file-contents-as-coding-system 'mel-ccl-base64-lf-rev filename)) (mel-define-method-function (mime-encode-string string (nil "base64")) @@ -430,14 +430,12 @@ abcdefghijklmnopqrstuvwxyz\ (defun base64-ccl-decode-region (start end) "Decode base64 encoded the region from START to END." - (interactive "r") + (interactive "*r") (encode-coding-region start end 'mel-ccl-b-rev)) (defun base64-ccl-write-decoded-region (start end filename) "Decode the region from START to END and write out to FILENAME." - (interactive - (list (region-beginning) (region-end) - (read-file-name "Write decoded region to file: "))) + (interactive "*r\nFWrite decoded region to file: ") (write-region-as-coding-system 'mel-ccl-b-rev start end filename)) (mel-define-method-function (mime-decode-string string (nil "base64")) @@ -449,8 +447,9 @@ abcdefghijklmnopqrstuvwxyz\ 'base64-ccl-write-decoded-region) (mel-define-method encoded-text-decode-string (string (nil "B")) - (if (and (string-match B-encoded-text-regexp string) - (string= string (match-string 0 string))) + (if (string-match (eval-when-compile + (concat "\\`" B-encoded-text-regexp "\\'")) + string) (base64-ccl-decode-string string) (error "Invalid encoded-text %s" string))) @@ -460,4 +459,4 @@ abcdefghijklmnopqrstuvwxyz\ (provide 'mel-b-ccl) -;;; mel-b-ccl.el ends here +;;; mel-b-ccl.el ends here.