[Mew-dist 950] execute octet-stream

Mito mit at example.com
1997年 5月 8日 (木) 15:33:24 JST


酒井さんの external command interface patch の真似をしたら 
application/octet-stream のパートも同じようなインターフェー
スにできたので、diff を送ります。
y (mew-summary-save) で保存できるのですが、一応 C-c C-e でも
できるようにしました。
-- 
5/8 15:25頃
NECソフトウェア新潟  水戸嘉嗣
mailto:mit at example.com


ついでですが、

※ "後" こと gotoh at example.com さんの
   Message-Id: <199704250726.QAA16848 at example.com>
   『[Mew-dist 931] Re: attach』からの引用です。

後> --- mew-summary.el.orig	Wed Apr 23 18:24:38 1997
後> +++ mew-summary.el	Fri Apr 25 16:10:22 1997
後> @@ -1718,6 +1718,24 @@
後>      (if (not (or msg part))
後>  	(message "No message or part here")
後>        (setq file (mew-input-filename))
後> +      (let* ((ent (mew-syntax-get-entry-strnum

この mew-input-filename の行はいらないんですよね?
-------------- next part --------------
--- mew-summary.el.original	Thu May  8 14:43:18 1997
+++ mew-summary.el	Thu May  8 14:24:32 1997
@@ -880,7 +880,9 @@
 	(if (fboundp program)
 	    (cond ((eq program 'mew-mime-message/rfc822)
 		   (funcall program syntax)) ;; for recursive MIME
-		  ((eq program 'mew-mime-external-body)
+;		  ((eq program 'mew-mime-external-body)
+		  ((or (eq program 'mew-mime-external-body)
+                       (eq program 'mew-mime-application/octet-stream))
 		   (funcall program begin end params execute))
 		  (t
 		   (funcall program begin end params))))
@@ -928,12 +930,14 @@
       )
     ))
 
-(defun mew-summary-execute-external ()
-  (interactive)
+(defun mew-summary-execute-external (force)
+  (interactive "P")
   (let* ((ofld-msg (mew-current-get 'message))
 	 (msg (mew-summary-message-number))
 	 (part (mew-summary-part-number))
-	 (buf (buffer-name)))
+	 (buf (buffer-name))
+         (mew-save-application/octet-stream-p
+          (if force nil mew-save-application/octet-stream-p)))
     (if (or msg (not part))
 	(message "Not a part")
       (unwind-protect

--- mew-mime.el.original	Mon Apr 21 12:35:47 1997
+++ mew-mime.el	Thu May  8 14:30:46 1997
@@ -323,26 +323,46 @@
     (set-buffer-modified-p nil) ;; xxx
     ))
 
-(defun mew-mime-application/octet-stream (begin end &optional params)
+(defun mew-mime-application/octet-stream (begin end &optional params execute)
   (if (not mew-save-application/octet-stream-p)
       (mew-mime-text/plain begin end params)
-    (if (not (mew-y-or-n-p "Save this part? "))
-	()
-      (save-excursion
-	(set-buffer (mew-current-get 'cache))
-	(mew-flet
-	 (let* ((name (mew-syntax-get-member params "name"))
-		(file (mew-input-filename nil name)))
-	   (if (file-exists-p file)
-	       (if mew-file-append-p
-		   (write-region begin end file t)
-		 (if (mew-y-or-n-p (format "File %s exists. Append it? "
-					   (file-name-nondirectory file)))
-		     (write-region begin end file t)
-		   ()))
-	     (write-region begin end file)
-	     ))
-	 ))
-      )))
+    (save-excursion
+      (let ((ctl     (mew-syntax-get-ct syntax))
+            (ct      (car ctl))
+            (size (- end begin))
+            (buffer-read-only nil))
+        (set-buffer (mew-buffer-message))
+        (insert "######    ###   #     #    #    ######  #     #\n"
+                "#     #    #    ##    #   # #   #     #  #   #\n"
+                "#     #    #    # #   #  #   #  #     #   # #\n"
+                "######     #    #  #  # #     # ######     #\n"
+                "#     #    #    #   # # ####### #   #      #\n"
+                "#     #    #    #    ## #     # #    #     #\n"
+                "######    ###   #     # #     # #     #    #\n"
+                "\n\n"
+                (format "Content-Type:\t%s\n" ct)
+                (format "Size:\t\t%dbytes\n" size))
+        (if (not (and execute (mew-y-or-n-p "Save this part? ")))
+            (insert
+             "\nTo save this part, type "
+             (substitute-command-keys
+              "\\<mew-summary-mode-map>\\[mew-summary-execute-external].")
+             "\nTo display this part as text, type C-u "
+             (substitute-command-keys
+              "\\<mew-summary-mode-map>\\[mew-summary-execute-external]."))
+          (set-buffer (mew-current-get 'cache))
+          (mew-flet
+           (let* ((name (mew-syntax-get-member params "name"))
+                  (file (mew-input-filename nil name)))
+             (if (file-exists-p file)
+                 (if mew-file-append-p
+                     (write-region begin end file t)
+                   (if (mew-y-or-n-p (format "File %s exists. Append it? "
+                                             (file-name-nondirectory file)))
+                       (write-region begin end file t)
+                     ()))
+               (write-region begin end file)
+               ))
+           ))))))
 
 (provide 'mew-mime)


Mew-dist メーリングリストの案内