[Mew-dist 456] contrib の mew-sort

Kazutaka SHIGENO shigeno at example.com
1997年 1月 27日 (月) 20:18:08 JST


重野@芸工大です。

~mew-1.54/contrib/sort/ にある mew-sort.el を使っています。
これはフォルダ内のメッセージを subject 順などで
ソート出来るようにするもので、
メールの量が多い時などは大変便利なものです。

しかし、収録されている mew.el.patch は以前の mew に対する patch で、
そのままでは mew-1.54 で使えません。
見た所、mew-summary.el に対して同じように書き換えれば
動く事がわかりましたので、pacth を作ってみました。
ついでに、Summary の describe-mode で出て来る help メッセージも
書き加えてあります。

簡単なものですが、mew-sort.el の作者方に感謝しつつ、
mew-dist ML に流します。
この patch に対して問題があればお知らせください。

-------------- next part --------------
--- mew-summary.el.orig	Tue Nov 26 01:34:19 1996
+++ mew-summary.el	Mon Jan 27 19:21:19 1997
@@ -13,6 +13,7 @@
 (defconst mew-summary-version "mew-summary.el version 0.05")
 
 (require 'mew)
+(require 'mew-sort)
 
 (defvar mew-summary-mode-map    nil)
 
@@ -32,7 +33,12 @@
   (define-key mew-summary-mode-map "O"    'mew-summary-pack)
   (define-key mew-summary-mode-map "i"    'mew-summary-inc)
   (define-key mew-summary-mode-map "s"    'mew-summary-scan)
-  (define-key mew-summary-mode-map "S"    'mew-summary-sort)
+;  (define-key mew-summary-mode-map "S"    'mew-summary-sort)
+  (define-key mew-summary-mode-map "Sd"   'mew-summary-sort-by-date)
+  (define-key mew-summary-mode-map "Ss"   'mew-summary-sort-by-subject)
+  (define-key mew-summary-mode-map "Sa"   'mew-summary-sort-by-author)
+  (define-key mew-summary-mode-map "Sr"   'mew-summary-sort-by-recipient)
+  (define-key mew-summary-mode-map "Sf"   'mew-summary-sort-by-field)
   (define-key mew-summary-mode-map "d"    'mew-summary-rmm)
   (define-key mew-summary-mode-map "x"    'mew-summary-exec)
   (define-key mew-summary-mode-map "X"    'mew-summary-exec-current)
@@ -109,6 +115,13 @@
        ["Suspend" mew-summary-suspend t]
        ["Quit" mew-summary-quit t]
        "----"
+       ("Sort"
+	["by date" mew-summary-sort-by-date t]
+	["by subject" mew-summary-sort-by-subject t]
+	["by author" mew-summary-sort-by-author t]
+	["by recipient" mew-summary-sort-by-recipient t]
+	["by field" mew-summary-sort-by-field t]
+	)
        ("Manipulate folder"
 	["Inc" mew-summary-inc t]
 	["Scan" mew-summary-scan t]
@@ -258,7 +271,11 @@
 #	Print this message or this part.
 |	Pipe this message.
 
-S	Sort messages in this folder.
+Sd	Sort messages by date.
+Ss	Sort messages by subject alphabetically.
+Sa	Sort messages by author.
+Sr	Sort messages by recipient.
+Sf	Sort messages by field.
 O	Pack messages in this folder.
 
 q	Switch to other buffer.
@@ -1464,27 +1481,27 @@
      )
     ))
 
-(defun mew-summary-sort ()    
-  (interactive)
-  (let ((folder (buffer-name)))
-    (if (null (mew-summary-exclusive-p))
-	()
-      (if (mew-summary-mark-exist-p (list mew-mark-rmm mew-mark-refile))
-	  (if (mew-y-or-n-p
-	       "Marked messages exist. Process mark before scan? ")
-	      (mew-summary-exec)))
-      (if (null (mew-y-or-n-p (format "Sort %s ? " folder)))
-	  ()
-	(setq mew-summary-buffer-process t)
-	(message "Sorting %s ... " folder)
-	(call-process mew-prog-sortm nil nil nil folder)
-	(message "Sorting %s ... done" folder)
-	(setq mew-summary-buffer-process nil)
-	(let ((buffer-read-only nil)) (erase-buffer))  ;; for update
-	(mew-summary-scan-body folder (mew-input-range folder))
-	)
-      )
-    ))
+;(defun mew-summary-sort ()    
+;  (interactive)
+;  (let ((folder (buffer-name)))
+;    (if (null (mew-summary-exclusive-p))
+;	()
+;      (if (mew-summary-mark-exist-p (list mew-mark-rmm mew-mark-refile))
+;	  (if (mew-y-or-n-p
+;	       "Marked messages exist. Process mark before scan? ")
+;	      (mew-summary-exec)))
+;      (if (null (mew-y-or-n-p (format "Sort %s ? " folder)))
+;	  ()
+;	(setq mew-summary-buffer-process t)
+;	(message "Sorting %s ... " folder)
+;	(call-process mew-prog-sortm nil nil nil folder)
+;	(message "Sorting %s ... done" folder)
+;	(setq mew-summary-buffer-process nil)
+;	(let ((buffer-read-only nil)) (erase-buffer))  ;; for update
+;	(mew-summary-scan-body folder (mew-input-range folder))
+;	)
+;      )
+;    ))
 
 (defun mew-summary-pack ()    
   (interactive)


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