[Mew-dist 2772] patch for external program

SAKAI Kiyotaka ksakai at example.com
1997年 10月 28日 (火) 19:40:13 JST


Image/Gif を表示する場合、XEmacs の場合は inline 表示してくれますが、
Emcas-20/Mule-2.3 では xv を起動して表示します。

このとき、パートを表示すると "Start xv? " とか聞かれますが、以下のパッ
チのように、Application/Octet-Stream のときと同様なインターフェースに
しませんか?

# SunOS の /usr/5bin/banner で "PROGRAM" の文字を作るとこの大きさにな
# りますが、"BINARY" の文字の大きさと違うのは何故だろう…。
-- 
酒井 清隆 (E-mail: ksakai at example.com)


Index: mew-summary.el
===================================================================
RCS file: /home/cvsroot/mew-1.92.1/mew-summary.el,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 mew-summary.el
--- mew-summary.el	1997/10/28 09:31:07	1.1.1.1
+++ mew-summary.el	1997/10/28 10:31:32
@@ -869,25 +869,43 @@
 	      (funcall program begin end params))
 	     ))
       (save-excursion
-	(set-buffer (mew-current-get 'cache))
-	(if (not (mew-which program exec-path))
-	    (message "Program %s is not found" program)
-	  (if (not (or mew-icon-p
-		       ;; gee, the following has a bug that multipart
-		       ;; icons disappear from toolbar...
-		       ;;(and mew-icon-p (button-event-p last-command-event))
-		       (mew-y-or-n-p "Start %s? " program)))
-	      ()
-	    (if (not (file-exists-p mew-temp-dir))
-		(mew-make-directory mew-temp-dir)) ;; just in case
-	    (setq file (make-temp-name mew-temp-file))
-	    ;; NEVER use call-process-region for privary reasons
-	    (mew-flet
-	     (write-region begin end file nil 'no-msg))
-	    (if async
-		(mew-mime-start-process program options file)
-	      (mew-mime-call-process program options file))
-	    ))))
+	(set-buffer (mew-buffer-message))
+	(let ((buffer-read-only nil))
+	  (insert " #####   #####    ####    ####   #####     ##    #    #\n"
+		  " #    #  #    #  #    #  #    #  #    #   #  #   ##  ##\n"
+		  " #    #  #    #  #    #  #       #    #  #    #  # ## #\n"
+		  " #####   #####   #    #  #  ###  #####   ######  #    #\n"
+		  " #       #   #   #    #  #    #  #   #   #    #  #    #\n"
+		  " #       #    #   ####    ####   #    #  #    #  #    #\n"
+		  "\n\n")
+	  (insert (format "Content-Type:\t%s\n" ct))
+	  (insert (format "Size:\t\t%dbytes\n" (- end begin)))
+	  (insert (format "Program:\t%s\n" program))
+	  (if (not (and execute
+			(or mew-icon-p
+			    ;; gee, the following has a bug that multipart
+			    ;; icons disappear from toolbar...
+			    ;;(and mew-icon-p (button-event-p last-command-event))
+			    (mew-y-or-n-p (format "Start %s? " program)))))
+	      (progn
+		(insert "\nTo execute this external command, type "
+			(substitute-command-keys
+			 "\\<mew-summary-mode-map>\\[mew-summary-execute-external]."))
+		(insert "\nTo save this part, type C-o.")
+		(insert "\nTo display this part in Message mode, type C-c TAB."))
+	    (if (not (mew-which program exec-path))
+		(message "Program %s is not found" program)
+	      (if (not (file-exists-p mew-temp-dir))
+		  (mew-make-directory mew-temp-dir)) ;; just in case
+	      (setq file (make-temp-name mew-temp-file))
+	      (set-buffer (mew-current-get 'cache))
+	      ;; NEVER use call-process-region for privary reasons
+	      (mew-flet
+	       (write-region begin end file nil 'no-msg))
+	      (if async
+		  (mew-mime-start-process program options file)
+		(mew-mime-call-process program options file))
+	      )))))
     (mew-current-set 'part num) ;; should be after funcall
     (if non-erase
 	()



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