* ew-dec.el (ew-decode-field-test): Now interactive.
authorakr <akr>
Thu, 27 Aug 1998 08:45:16 +0000 (08:45 +0000)
committerakr <akr>
Thu, 27 Aug 1998 08:45:16 +0000 (08:45 +0000)
* eword-decode.el (eword-decode-header): Put original field as
text properties.

* mmbuffer.el (insert-decoded-header): Put original field as
text properties.

ChangeLog
ew-dec.el
eword-decode.el
mmbuffer.el

index 192df86..2689101 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,15 @@
 1998-08-27  Tanaka Akira      <akr@jaist.ac.jp>
 
+       * 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      <akr@jaist.ac.jp>
+
        * DOODLE-TIPS: Add a notice about EVALARGS.
 
        * Makefile: evaluate environment variable EVALARGS if it is not
index 91cb9c4..9636058 100644 (file)
--- 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)))))))
 
 ;;;
 
index 49e2761..5e4b6cb 100644 (file)
@@ -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)
        ))))
 
index 5913265..0e9ff82 100644 (file)
                                 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))
                ))))))))