From: Chris Hanson Date: Wed, 10 May 2000 16:53:19 +0000 (+0000) Subject: Don't set message flags unless they have changed. X-Git-Tag: 20090517-FFI~3902 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=29e6249c52759302fbb493e50dec47963aa4856d;p=mit-scheme.git Don't set message flags unless they have changed. --- diff --git a/v7/src/imail/imail-core.scm b/v7/src/imail/imail-core.scm index b168b4af5..167f84592 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.50 2000/05/08 20:32:50 cph Exp $ +;;; $Id: imail-core.scm,v 1.51 2000/05/10 16:53:19 cph Exp $ ;;; ;;; Copyright (c) 1999-2000 Massachusetts Institute of Technology ;;; @@ -467,13 +467,21 @@ (define (set-message-flag message flag) (guarantee-message-flag flag 'SET-MESSAGE-FLAG) - (set-message-flags! message (flags-add flag (message-flags message))) - (message-modified! message)) + (without-interrupts + (lambda () + (let ((flags (message-flags message))) + (if (not (flags-member? flag flags)) + (set-message-flags! message (cons flag flags)))) + (message-modified! message)))) (define (clear-message-flag message flag) (guarantee-message-flag flag 'SET-MESSAGE-FLAG) - (set-message-flags! message (flags-delete! flag (message-flags message))) - (message-modified! message)) + (without-interrupts + (lambda () + (let ((flags (message-flags message))) + (if (flags-member? flag flags) + (set-message-flags! message (flags-delete! flag flags)))) + (message-modified! message)))) (define (folder-flags folder) (let ((n (folder-length folder)))