* ew-dec.el (ew-decode-field-test): Search around current point
authorakr <akr>
Thu, 27 Aug 1998 11:53:03 +0000 (11:53 +0000)
committerakr <akr>
Thu, 27 Aug 1998 11:53:03 +0000 (11:53 +0000)
as default argument when called interactive.

ChangeLog
ew-dec.el

index 928a664..16c4cc1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 1998-08-27  Tanaka Akira      <akr@jaist.ac.jp>
 
+       * ew-dec.el (ew-decode-field-test): Search around current point
+       as default argument when called interactive.
+
+1998-08-27  Tanaka Akira      <akr@jaist.ac.jp>
+
        * FLIM-ELS (flime-modules): Add ew-ccl.
 
        * ew-bq.el: Now it is stub to ew-ccl and mel.
index 9636058..4c2675c 100644 (file)
--- a/ew-dec.el
+++ b/ew-dec.el
@@ -464,8 +464,23 @@ each line is separated by CRLF."
 (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) ""))))
+    (read-string "field-name:" (or (get-text-property (point) 'original-field-name)
+                                  (save-excursion
+                                    (end-of-line)
+                                    (and
+                                     (re-search-backward "^\\([!-9;-~]+\\):" nil t)
+                                     (match-string 1)))
+                                  ""))
+    (read-string "field-body:" (or (get-text-property (point) 'original-field-body)
+                                  (save-excursion
+                                    (end-of-line)
+                                    (and
+                                     (re-search-backward "^\\([!-9;-~]+\\):" nil t)
+                                     (progn
+                                       (goto-char (match-end 0))
+                                       (looking-at ".*\\(\n[ \t].*\\)*")
+                                       (ew-lf-crlf-to-crlf (match-string 0)))))
+                                  ""))))
   (with-output-to-temp-buffer "*DOODLE*"
     (save-excursion
       (set-buffer standard-output)