Fixed rmail-cease-edit to remove the cached summary line
authorBrian A. LaMacchia <edu/mit/csail/zurich/bal>
Thu, 5 Nov 1992 16:41:22 +0000 (16:41 +0000)
committerBrian A. LaMacchia <edu/mit/csail/zurich/bal>
Thu, 5 Nov 1992 16:41:22 +0000 (16:41 +0000)
(in the message headers).  Forces rmail-summary mode to recalc
the summary line next time it is needed.  Thus, if you now edit
the Subject: line of a message, the summary line will change to
reflect this.

v7/src/edwin/rmail.scm

index 2e52f2be0a6af0b5d20006c9fa5c2bbd6a569e03..2378c19550ec83993fe143cc7b96c57c4f35a193 100644 (file)
@@ -1,6 +1,6 @@
 ;;; -*-Scheme-*-
 ;;;
-;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/rmail.scm,v 1.19 1992/08/03 21:44:14 cph Exp $
+;;;    $Header: /Users/cph/tmp/foo/mit-scheme/mit-scheme/v7/src/edwin/rmail.scm,v 1.20 1992/11/05 16:41:22 bal Exp $
 ;;;
 ;;;    Copyright (c) 1991-92 Massachusetts Institute of Technology
 ;;;
@@ -1414,7 +1414,22 @@ buffer visiting that file."
                      (let loop ((memo first))
                        (if memo
                            (if (mark< point (msg-memo/end memo))
-                               (select-message buffer memo)
+                               (begin
+                                 ; Need to force a recalc of the summary line
+                                 ; after message edit 
+                                 (if (ref-variable rmail-summary-buffer)
+                                     (if (ref-variable rmail-summary-vector
+                                                       (ref-variable rmail-summary-buffer))
+                                         (vector-set! 
+                                          (ref-variable rmail-summary-vector
+                                                        (ref-variable rmail-summary-buffer))
+                                          (-1+ (msg-memo/number memo)) #f)))
+                                 (let ((point (line-start (msg-memo/start memo) 2)))
+                                   (if (string-prefix?
+                                        "Summary-line: "
+                                        (extract-string point (line-end point 0)))
+                                       (delete-string point (line-start point 1))))
+                                 (select-message buffer memo))
                                (loop (msg-memo/next memo))))))))))))))
 
 (define-command rmail-abort-edit