From: akr Date: Thu, 27 Aug 1998 08:45:16 +0000 (+0000) Subject: * ew-dec.el (ew-decode-field-test): Now interactive. X-Git-Tag: doodle-1_9_2~8 X-Git-Url: http://git.chise.org/gitweb/?a=commitdiff_plain;h=23999792e6f22829c4e1a38c8a77de3b1d6ae3b4;p=elisp%2Fflim.git * ew-dec.el (ew-decode-field-test): Now interactive. * eword-decode.el (eword-decode-header): Put original field as text properties. * mmbuffer.el (insert-decoded-header): Put original field as text properties. --- diff --git a/ChangeLog b/ChangeLog index 192df86..2689101 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 1998-08-27 Tanaka Akira + * ew-dec.el (ew-decode-field-test): Now interactive. + + * eword-decode.el (eword-decode-header): Put original field as + text properties. + + * mmbuffer.el (insert-decoded-header): Put original field as + text properties. + +1998-08-27 Tanaka Akira + * DOODLE-TIPS: Add a notice about EVALARGS. * Makefile: evaluate environment variable EVALARGS if it is not diff --git a/ew-dec.el b/ew-dec.el index 91cb9c4..9636058 100644 --- a/ew-dec.el +++ b/ew-dec.el @@ -461,33 +461,41 @@ each line is separated by CRLF." (not (eq (charsets-to-mime-charset (find-charset-string str)) 'us-ascii))) ;;; - (defun ew-decode-field-test (field-name field-body) + (interactive + (list + (read-string "field-name:" (or (get-text-property (point) 'original-field-name) "")) + (read-string "field-body:" (or (get-text-property (point) 'original-field-body) "")))) (with-output-to-temp-buffer "*DOODLE*" (save-excursion + (set-buffer standard-output) (let ((ew-decode-sticked-encoded-word nil) (ew-decode-quoted-encoded-word nil) (ew-ignore-75bytes-limit nil) (ew-ignore-76bytes-limit nil) (ew-permit-sticked-comment nil) - (ew-permit-sticked-special nil)) - (princ field-name) (princ ":") (princ field-body) (princ "\n") - (princ (make-string fill-column ?-)) (princ "\n") - (princ field-name) (princ ":") (princ (ew-decode-field-no-cache field-name field-body)) (princ "\n") - (setq ew-ignore-76bytes-limit t) (princ "[ew-ignore-76bytes-limit -> t]\n") - (princ field-name) (princ ":") (princ (ew-decode-field-no-cache field-name field-body)) (princ "\n") - (setq ew-ignore-75bytes-limit t) (princ "[ew-ignore-75bytes-limit -> t]\n") - (princ field-name) (princ ":") (princ (ew-decode-field-no-cache field-name field-body)) (princ "\n") - (setq ew-permit-sticked-special t) (princ "[ew-ignore-76bytes-limit -> t]\n") - (princ field-name) (princ ":") (princ (ew-decode-field-no-cache field-name field-body)) (princ "\n") - (setq ew-permit-sticked-comment t) (princ "[ew-ignore-76bytes-comment -> t]\n") - (princ field-name) (princ ":") (princ (ew-decode-field-no-cache field-name field-body)) (princ "\n") - (setq ew-decode-sticked-encoded-word t) (princ "[ew-decode-sticked-encoded-word -> t]\n") - (princ field-name) (princ ":") (princ (ew-decode-field-no-cache field-name field-body)) (princ "\n") - (setq ew-decode-quoted-encoded-word t) (princ "[ew-decode-quoted-encoded-word -> t]\n") - (princ field-name) (princ ":") (princ (ew-decode-field-no-cache field-name field-body)) (princ "\n") - ;; ew-permit-null-encoded-text is not changable when runtime. - )))) + (ew-permit-sticked-special nil) + (options + '(ew-ignore-76bytes-limit + ew-ignore-75bytes-limit + ew-permit-sticked-special + ew-permit-sticked-comment + ew-decode-sticked-encoded-word + ew-decode-quoted-encoded-word + )) + d1 d2) + (setq d1 (ew-decode-field-no-cache field-name field-body)) + (insert field-name ":" field-body "\n" + (make-string 76 ?-) "\n" + field-name ":" d1 "\n") + (while options + (set (car options) t) + (insert (format "-- %s -> t\n" (car options))) + (setq d2 (ew-decode-field-no-cache field-name field-body)) + (unless (equal d1 d2) + (insert field-name ":" d2 "\n") + (setq d1 d2)) + (setq options (cdr options))))))) ;;; diff --git a/eword-decode.el b/eword-decode.el index 49e2761..5e4b6cb 100644 --- a/eword-decode.el +++ b/eword-decode.el @@ -440,7 +440,11 @@ If SEPARATOR is not nil, it is used as header separator." (1+ (string-width field-name)) fill-column))) (delete-region p end) - (insert (ew-crlf-to-lf decoded)))) + (insert (ew-crlf-to-lf decoded)) + (add-text-properties beg (min (1+ (point)) (point-max)) + (list 'original-field-name field-name + 'original-field-body field-body)) + )) (eword-decode-region (point-min) (point-max) t nil nil) )))) diff --git a/mmbuffer.el b/mmbuffer.el index 5913265..0e9ff82 100644 --- a/mmbuffer.el +++ b/mmbuffer.el @@ -179,10 +179,14 @@ decoded (1+ (string-width field-name)) fill-column))) + (setq beg (point)) (insert field-name) (insert ":") (insert (ew-crlf-to-lf decoded)) (insert "\n") + (add-text-properties beg (point) + (list 'original-field-name field-name + 'original-field-body field-body)) ))))))))