From 29e6249c52759302fbb493e50dec47963aa4856d Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Wed, 10 May 2000 16:53:19 +0000 Subject: [PATCH] Don't set message flags unless they have changed. --- v7/src/imail/imail-core.scm | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) 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))) -- 2.25.1