From: Taylor R. Campbell Date: Sun, 11 Mar 2007 22:38:55 +0000 (+0000) Subject: Unmap the message indices returned by SEARCH-FOLDER. Define X-Git-Tag: 20090517-FFI~708 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=138229cfc8b95b326974923b00881164e8fd7d6f;p=mit-scheme.git Unmap the message indices returned by SEARCH-FOLDER. Define %SEARCH-FOLDER as a generic procedure which the non-generic procedure SEARCH-FOLDER calls. --- diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index e7269f887..18c162dd4 100644 --- a/v7/src/imail/imail-core.scm +++ b/v7/src/imail/imail-core.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-core.scm,v 1.164 2007/03/11 17:33:37 riastradh Exp $ +$Id: imail-core.scm,v 1.165 2007/03/11 22:38:55 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -538,9 +538,14 @@ USA. ;; ------------------------------------------------------------------- ;; Search FOLDER for messages matching CRITERIA. At present, CRITERIA -;; may be a string. Returns a list of messages. +;; may be a string. Returns a list of message indices. -(define-generic search-folder (folder criteria)) +(define (search-folder folder criteria) + (map (lambda (index) + (unmap-folder-index folder index)) + (%search-folder folder criteria))) + +(define-generic %search-folder (folder criteria)) ;; ------------------------------------------------------------------- ;; Compare FOLDER's cache with the persistent folder and return a diff --git a/v7/src/imail/imail-file.scm b/v7/src/imail/imail-file.scm index 7eaf86685..bafbde452 100644 --- a/v7/src/imail/imail-file.scm +++ b/v7/src/imail/imail-file.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-file.scm,v 1.90 2007/03/11 17:33:37 riastradh Exp $ +$Id: imail-file.scm,v 1.91 2007/03/11 22:38:55 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -359,7 +359,7 @@ USA. (loop (fix:+ i 1) (fix:+ i* 1))))))) (set-file-folder-messages! folder messages*))))))))) -(define-method search-folder ((folder ) criteria) +(define-method %search-folder ((folder ) criteria) (cond ((string? criteria) (let ((n (folder-length folder))) (let loop ((index 0) (winners '())) diff --git a/v7/src/imail/imail-imap.scm b/v7/src/imail/imail-imap.scm index 5602519cb..c2e7adf11 100644 --- a/v7/src/imail/imail-imap.scm +++ b/v7/src/imail/imail-imap.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: imail-imap.scm,v 1.210 2007/03/11 17:33:37 riastradh Exp $ +$Id: imail-imap.scm,v 1.211 2007/03/11 22:38:55 riastradh Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -1887,7 +1887,7 @@ USA. (define-method expunge-deleted-messages ((folder )) (imap:command:expunge (guarantee-imap-folder-open folder))) -(define-method search-folder ((folder ) criteria) +(define-method %search-folder ((folder ) criteria) (map (lambda (index) (- index 1)) (imap:response:search-indices (let ((connection (guarantee-imap-folder-open folder)))