* wl-summary.el (wl-summary-define-sort-command): New function.
authorhmurata <hmurata>
Sat, 10 Jun 2006 13:46:29 +0000 (13:46 +0000)
committerhmurata <hmurata>
Sat, 10 Jun 2006 13:46:29 +0000 (13:46 +0000)
(wl-summary-sort-by-date, wl-summary-sort-by-number)
(wl-summary-sort-by-subject, wl-summary-sort-by-from)
(wl-summary-sort-by-list-info, wl-summary-sort-by-size): Remove;
define by `wl-summary-define-sort-command'.

* wl.el (wl-init): Call wl-summary-define-sort-command.

wl/ChangeLog
wl/wl-summary.el
wl/wl.el

index 84207a8..686e8f4 100644 (file)
@@ -1,3 +1,13 @@
+2006-06-10  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
+
+       * wl-summary.el (wl-summary-define-sort-command): New function.
+       (wl-summary-sort-by-date, wl-summary-sort-by-number)
+       (wl-summary-sort-by-subject, wl-summary-sort-by-from)
+       (wl-summary-sort-by-list-info, wl-summary-sort-by-size): Remove;
+       define by `wl-summary-define-sort-command'.
+
+       * wl.el (wl-init): Call wl-summary-define-sort-command.
+
 2006-06-04  Hiroya Murata  <lapis-lazuli@pop06.odn.ne.jp>
 
        * wl-mime.el (wl-message-decrypt-pgp-nonmime): Keep text
index 590e403..0138c24 100644 (file)
@@ -1017,30 +1017,19 @@ Entering Folder mode calls the value of `wl-summary-mode-hook'."
       (string< (or (car list-info-x) "")
               (or (car list-info-y) "")))))
 
-(defun wl-summary-sort-by-date (reverse)
-  "Sort summary lines into the order by message date; argument means descending order."
-  (interactive "P")
-  (wl-summary-rescan "date" reverse))
-(defun wl-summary-sort-by-number (reverse)
-  "Sort summary lines into the order by message number; argument means descending order."
-  (interactive "P")
-  (wl-summary-rescan "number" reverse))
-(defun wl-summary-sort-by-subject (reverse)
-  "Sort summary lines into the order by subject; argument means descending order."
-  (interactive "P")
-  (wl-summary-rescan "subject" reverse))
-(defun wl-summary-sort-by-from (reverse)
-  "Sort summary lines into the order by from; argument means descending order."
-  (interactive "P")
-  (wl-summary-rescan "from" reverse))
-(defun wl-summary-sort-by-list-info (reverse)
-  "Sort summary lines into the order by mailing list info; argument means descending order."
-  (interactive "P")
-  (wl-summary-rescan "list-info" reverse))
-(defun wl-summary-sort-by-size (reverse)
-  "Sort summary lines into the order by message size; argument means descending order."
-  (interactive "P")
-  (wl-summary-rescan "size" reverse))
+(defun wl-summary-define-sort-command ()
+  "Define functions to sort summary lines by `wl-summary-sort-specs'."
+  (interactive)
+  (dolist (sort-by wl-summary-sort-specs)
+    (fset (intern (format "wl-summary-sort-by-%s" sort-by))
+         `(lambda (&optional reverse)
+            ,(format "\
+Sort summary lines into the order by %s.
+If optional argument REVERSE is non-nil, sort into descending order.
+
+This function is defined by `wl-summary-define-sort-command'." sort-by)
+            (interactive "P")
+            (wl-summary-rescan ,(symbol-name sort-by) reverse)))))
 
 (defun wl-summary-sort-function-from-spec (spec reverse)
   (let (funtion)
index 0f9bc2f..a8d1916 100644 (file)
--- a/wl/wl.el
+++ b/wl/wl.el
@@ -713,6 +713,7 @@ Entering Plugged mode calls the value of `wl-plugged-mode-hook'."
          (symbol-value 'wl-summary-subject-function))
     (fset 'wl-summary-subject-filter-func-internal
          (symbol-value 'wl-summary-subject-filter-function))
+    (wl-summary-define-sort-command)
     (wl-summary-define-mark-action)
     (dolist (spec wl-summary-flag-alist)
       (set-face-foreground