[Mew-dist 03460] Use differnt Form in differnt folder

AOSASA Shigeru aozasa at example.com
1998年 1月 20日 (火) 18:37:26 JST


青笹です。

Mew-1.93b8 で folder 毎に IM の Form を切り換えられるようにしてみました。
patch を当てて .emacs に以下のものを追加して下さい。

--- ここから .emacs に追加 ---
(setq mew-folder-form-alist
      '(("-.*" . "%+5n %m%d %-14A %S") ;; news の時は %b (本文) が空なので
                                       ;; %S (Subject:) を目一杯表示する
	("+from/.*" . "%+5n %m%d %-18S %b") ;; +from/* では From: が自明なので
                                            ;; 表示しない
	))

(setq mew-summary-scan-body-hook
      (function
       (lambda ()
	 (let (alist regexp form)
	   (setq mew-prog-im-form nil)
	   (setq alist mew-folder-form-alist)
	   (while alist
	     (setq regexp (car (car alist)))
	     (setq form (cdr (car alist)))
	     (if (string-match regexp folder)
		 (progn
		   (setq mew-prog-im-form form)
		   (setq alist nil)
		   ))
	     (setq alist (cdr alist)))))))
--- ここまで ---

--- Mew-1.93b8 への patch ここから ---

diff -urN mew-1.93b8~orig/mew-scan.el mew-1.93b8/mew-scan.el
--- mew-1.93b8~orig/mew-scan.el	Fri Dec 26 13:32:29 1997
+++ mew-1.93b8/mew-scan.el	Tue Jan 20 18:17:13 1998
@@ -73,6 +73,7 @@
 
 (defun mew-summary-scan-body (prog mode folder read &optional range folders grep)
   (save-excursion
+    (run-hooks 'mew-summary-scan-body-hook)
     (set-buffer (get-buffer-create folder))
     (buffer-disable-undo (current-buffer))
     (if (not (equal major-mode mode)) (funcall mode))
@@ -117,6 +118,9 @@
 						    (if (mew-folder-newsp folder) 
 							"yes" "no")))
 				      (list (concat "--src=" folder))
+				      (if (not (eq mew-prog-im-form nil))
+					  (list (concat
+						 "--form=" mew-prog-im-form)))
 				      mew-prog-imls-arg-list
 				      (if (listp (car range))
 					  (car range)
diff -urN mew-1.93b8~orig/mew-vars.el mew-1.93b8/mew-vars.el
--- mew-1.93b8~orig/mew-vars.el	Tue Dec 23 16:33:09 1997
+++ mew-1.93b8/mew-vars.el	Tue Jan 20 18:17:13 1998
@@ -158,6 +158,8 @@
   "*Hook called when scan finished.")
 (defvar mew-summary-exec-hook nil
   "*Hook called when mew-summary-exec finished.")
+(defvar mew-summary-scan-body-hook nil
+  "*Hook called before mew-summary-scan-body.")
 
 ;;
 ;;
@@ -195,6 +197,7 @@
 (defvar mew-prog-shell-arg   "-c")
 
 (defvar mew-prog-im-arg '("--help=no" "--debug=no"))
+(defvar mew-prog-im-form nil)
 
 (defvar mew-prog-imget-arg-list nil
   "*Argument list for mew-prog-imget")

--- ここまで ---
--
AOSASA Shigeru <aozasa at example.com>
1b 24 28 42 40 44 3a 7b 1b 28 42 20 1b 24 28 42 4c 50 1b 28 42 # c-text



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