From cd4667ae97b7e0fbbc23986cb3b41c9eab763045 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Mon, 8 May 2000 19:02:58 +0000 Subject: [PATCH] Eliminate ATTACH-MESSAGE. Change ATTACH-MESSAGE! to set the index as well as the folder. Change ATTACH-MESSAGE! and DETACH-MESSAGE! to do MESSAGE-MODIFIED!. --- v7/src/imail/imail-core.scm | 33 +++++++++++++++++---------------- v7/src/imail/imail-file.scm | 11 +++++------ 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index 3539b6b5f..70751036e 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.47 2000/05/08 18:54:51 cph Exp $ +;;; $Id: imail-core.scm,v 1.48 2000/05/08 19:02:42 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -333,8 +333,10 @@ (body define accessor) (flags define standard) (properties define standard) - (modification-count define standard initial-value 0) - (folder define standard initial-value #f) + (modification-count define standard + initial-value 0) + (folder define standard + initial-value #f) (index define standard)) (define-method write-instance ((message ) port) @@ -371,29 +373,28 @@ (else (loop (cdr headers) (cons (car headers) headers*) flags properties))))) - + (define (make-attached-message folder headers body) (let ((message (make-detached-message headers body))) (attach-message! message folder) message)) -(define (attach-message message folder) - (let ((message - (make-message (map copy-header-field (message-header-fields message)) - (message-body message) - (list-copy (message-flags message)) - (alist-copy (message-properties message))))) - (attach-message! message folder) - message)) +(define (copy-message message) + (make-message (map copy-header-field (message-header-fields message)) + (message-body message) + (list-copy (message-flags message)) + (alist-copy (message-properties message)))) -(define (attach-message! message folder) - (guarantee-folder folder 'ATTACH-MESSAGE) +(define (attach-message! message folder index) + (guarantee-folder folder 'ATTACH-MESSAGE!) (set-message-folder! message folder) - (set-message-index! message #f)) + (set-message-index! message index) + (message-modified! message)) (define (detach-message! message) (set-message-folder! message #f) - (set-message-index! message #f)) + (set-message-index! message #f) + (message-modified! message)) (define (message-modified! message) (without-interrupts diff --git a/v7/src/imail/imail-file.scm b/v7/src/imail/imail-file.scm index 7609cbc4f..e29945896 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.18 2000/05/08 18:51:43 cph Exp $ +;;; $Id: imail-file.scm,v 1.19 2000/05/08 19:02:58 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -98,7 +98,7 @@ (list-ref (file-folder-messages folder) index)) (define-method append-message ((folder ) (message )) - (let ((message (attach-message message folder))) + (let ((message (copy-message message))) (without-interrupts (lambda () (set-file-folder-messages! @@ -110,13 +110,12 @@ (if (pair? this) (loop this (cdr this) (fix:+ index 1)) (begin - (set-message-index! message index) + (attach-message! message folder index) (set-cdr! prev (list message))))) messages) (begin - (set-message-index! message 0) - (list message))))) - (message-modified! message))))) + (attach-message! message folder 0) + (list message))))))))) (define-method expunge-deleted-messages ((folder )) (without-interrupts -- 2.25.1