From: Taylor R. Campbell Date: Thu, 25 Sep 2008 15:00:01 +0000 (+0000) Subject: Sort by ordered message index before summarizing search results. X-Git-Tag: 20090517-FFI~115 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=e383ddc52bfda0e2b3ff6c9996a2288d473efc9a;p=mit-scheme.git Sort by ordered message index before summarizing search results. --- diff --git a/v7/src/imail/imail-summary.scm b/v7/src/imail/imail-summary.scm index 990abbd2d..919684355 100644 --- a/v7/src/imail/imail-summary.scm +++ b/v7/src/imail/imail-summary.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-summary.scm,v 1.61 2008/09/09 15:37:03 riastradh Exp $ +$Id: imail-summary.scm,v 1.62 2008/09/25 15:00:01 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -158,20 +158,23 @@ SUBJECT is a string of regexps separated by commas." "Display a summary of the search results for a string of text." (lambda () (list (prompt-for-string "IMAIL search" #f - 'DEFAULT-TYPE 'INSERTED-DEFAULT - 'HISTORY 'IMAIL-SEARCH - 'HISTORY-INDEX 0))) + 'DEFAULT-TYPE 'INSERTED-DEFAULT + 'HISTORY 'IMAIL-SEARCH + 'HISTORY-INDEX 0))) (lambda (pattern) (imail-summary (string-append "Search: " pattern) (lambda (folder start end) ((imail-ui:message-wrapper "Searching for " pattern) (lambda () - (filter-map (lambda (index) - (and (<= start index) - (< index end) - (%get-message folder index))) - (%search-folder folder pattern)))))))) + (sort + (filter-map (lambda (index) + (and (<= start index) + (< index end) + (%get-message folder index))) + (%search-folder folder pattern)) + (lambda (a b) + (< (message-index a) (message-index b)))))))))) (define (imail-summary description procedure) (let* ((folder (selected-folder))