From a6096ae95f467a46fb8a96e93c877d2075e03148 Mon Sep 17 00:00:00 2001 From: hmurata Date: Sat, 10 Jun 2006 13:46:29 +0000 Subject: [PATCH] * 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. --- wl/ChangeLog | 10 ++++++++++ wl/wl-summary.el | 37 +++++++++++++------------------------ wl/wl.el | 1 + 3 files changed, 24 insertions(+), 24 deletions(-) diff --git a/wl/ChangeLog b/wl/ChangeLog index 84207a8..686e8f4 100644 --- a/wl/ChangeLog +++ b/wl/ChangeLog @@ -1,3 +1,13 @@ +2006-06-10 Hiroya Murata + + * 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 * wl-mime.el (wl-message-decrypt-pgp-nonmime): Keep text diff --git a/wl/wl-summary.el b/wl/wl-summary.el index 590e403..0138c24 100644 --- a/wl/wl-summary.el +++ b/wl/wl-summary.el @@ -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) diff --git a/wl/wl.el b/wl/wl.el index 0f9bc2f..a8d1916 100644 --- 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 -- 1.7.10.4